Skip to content

Conversation

@tbeseda
Copy link
Member

@tbeseda tbeseda commented Feb 8, 2026

need to merge #70 first

nice.

image

becomes

image

Also I made the "basic example" for each definer part of the description so that it renders at the top instead of below the lengthy config parameters:

image

this helps typedoc generate nicer documentation
@github-actions
Copy link

github-actions bot commented Feb 8, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 98.42% 626 / 636
🔵 Statements 96.19% 682 / 709
🔵 Functions 100% 69 / 69
🔵 Branches 94.14% 595 / 632
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/definers/blueprints.ts 100% 100% 100% 100%
src/definers/cors.ts 100% 100% 100% 100%
src/definers/datasets.ts 100% 100% 100% 100%
src/definers/functions.ts 97.95% 95% 100% 100% 283
src/definers/resources.ts 100% 100% 100% 100%
src/definers/robotTokens.ts 100% 100% 100% 100%
src/definers/roles.ts 100% 100% 100% 100%
src/definers/webhooks.ts 100% 50% 100% 100%
src/types/functions.ts 100% 100% 100% 100%
Generated in workflow #212 for commit f5eefc7 by the Vitest Coverage Report Action

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

📚 TypeDoc Generation Result

TypeDoc generated successfully!

  • File size: 268K
  • Total exports: 187
  • Artifact: typedoc-5eaf4407a0aa216a5971c9601f9ea94c075727b4
  • HTML docs preview: Download artifact

The TypeDoc JSON file has been generated and validated. All documentation scripts completed successfully.

@socket-security
Copy link

socket-security bot commented Feb 8, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednpm/​@​vitest/​coverage-v8@​4.0.17 ⏵ 4.0.18991006999 +1100
Updatednpm/​vitest@​4.0.17 ⏵ 4.0.1896 +110079 +199 +1100
Updatednpm/​@​biomejs/​biome@​2.3.11 ⏵ 2.3.14100 +110010099 +2100

View full report

@tbeseda tbeseda self-assigned this Feb 8, 2026
@tbeseda tbeseda requested a review from a team February 8, 2026 02:06
@tbeseda tbeseda marked this pull request as ready for review February 8, 2026 02:06
makes it render at the top
let {name, src, event, timeout, memory, env, type, timezone, runtime} = functionConfig
if (!type) type = 'sanity.function.cron'
export function defineScheduleFunction(functionConfig: BlueprintScheduleFunctionConfig): BlueprintScheduleFunctionResource {
const {name, src, event, timeout, memory, env, timezone, runtime} = functionConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a robot token as well.

@tbeseda
Copy link
Member Author

tbeseda commented Feb 8, 2026

@macdonst thanks for catching that!
I don't think it was there before
So I checked what's available and what's used and it seems like some attributes were omitted across the definers, not just robotToken. project and displayName were inconsistent and lifecycle was never passed to defineFunction by the other definers.

So I changed it so that all specific definers like defineScheduledFunction pass the whole config to defineFunction and then defineFunction is the allow list and only uses valid attributes. To me, it's simpler, but I'd appreciate some more eyes 🔍

@macdonst
Copy link
Contributor

macdonst commented Feb 8, 2026

@tbeseda it wasn't and that was my oversight.

@tbeseda tbeseda merged commit 74a963f into tb/fix/docs/expand-types Feb 8, 2026
14 checks passed
@tbeseda tbeseda deleted the tb/fix/refactor-functions-config-types branch February 8, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants