Publication checks and formatting

Choose which package scripts Studio runs before publishing and which formatter editors can run.

Use studio.commands.json beside package.json to choose which existing package scripts Studio runs before publication. A failed check stops publication. With no file, Studio uses the site’s build script for structural changes. If the site has no build script, declare the checks to run or explicitly choose an empty list.

{
  "onPublish": "structure",
  "checks": [
    { "label": "Check content and types", "script": "check" },
    { "label": "Build the website", "script": "build", "timeoutSeconds": 600 }
  ]
}
KeyValues and effect
checksRequired array of up to 12 tasks, run in order. Use [] to opt out of website checks explicitly. Content schema validation still applies. Checks should leave website files unchanged.
onPublishstructure (default) runs the checks for structural website changes. always runs them for content-only publications too.
formatOptional task exposing a formatting action to the editor. It runs when the editor asks. Omit to offer no formatting action.
idOptional task identifier. Defaults to its script name for a check, or format for the formatter. Must be unique across all tasks. Use up to 80 ASCII letters, digits, hyphens, underscores, colons, or periods.
labelRequired nonempty task label shown to the editor, up to 120 bytes.
scriptRequired name of an existing script in this app’s package.json, up to 120 bytes. Use the name alone, for example build. Leading hyphens and control characters are rejected.
timeoutSecondsOptional whole number from 5 through 1800, default 300. Limits the run time of this task in seconds.

The file limit is 64 KiB. Unknown keys are rejected. Reviewing and publishing an Astro site