@sanity/cli 3.57.2-canary.16 → 3.57.2-manifests.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7275,6 +7275,7 @@ const commonMistakes = { get: "list" }, levenThreshold = 3, coreCommands = [
7275
7275
  "graphql",
7276
7276
  "hook",
7277
7277
  "migration",
7278
+ "manifest",
7278
7279
  "preview",
7279
7280
  "schema",
7280
7281
  "start",
@@ -42019,7 +42020,12 @@ export default defineCliConfig({
42019
42020
  api: {
42020
42021
  projectId: '%projectId%',
42021
42022
  dataset: '%dataset%'
42022
- }
42023
+ },
42024
+ /**
42025
+ * Enable auto-updates for studios.
42026
+ * Learn more at https://www.sanity.io/docs/cli#auto-updates
42027
+ */
42028
+ autoUpdates: __BOOL__autoUpdates__,
42023
42029
  })
42024
42030
  `;
42025
42031
  function createCliConfig(options2) {
@@ -42033,7 +42039,24 @@ function createCliConfig(options2) {
42033
42039
  const variableName = value.slice(1, -1);
42034
42040
  if (!(variableName in variables))
42035
42041
  throw new Error(`Template variable '${value}' not defined`);
42036
- node.value = variables[variableName] || "";
42042
+ const newValue = variables[variableName];
42043
+ node.value = typeof newValue == "string" ? newValue : "";
42044
+ }
42045
+ },
42046
+ Identifier: {
42047
+ enter(path2) {
42048
+ if (!path2.node.name.startsWith("__BOOL__"))
42049
+ return;
42050
+ const variableName = path2.node.name.replace(
42051
+ /^__BOOL__(.+?)__$/,
42052
+ "$1"
42053
+ );
42054
+ if (!(variableName in variables))
42055
+ throw new Error(`Template variable '${variableName}' not defined`);
42056
+ const value = variables[variableName];
42057
+ if (typeof value != "boolean")
42058
+ throw new Error(`Expected boolean value for '${variableName}'`);
42059
+ path2.replaceWith({ type: "BooleanLiteral", value });
42037
42060
  }
42038
42061
  }
42039
42062
  }), main$3.print(ast, { quote: "single" }).code;
@@ -42172,7 +42195,8 @@ function createStudioConfig(options2) {
42172
42195
  const variableName = value.slice(1, -1);
42173
42196
  if (!(variableName in variables))
42174
42197
  throw new Error(`Template variable '${value}' not defined`);
42175
- node.value = variables[variableName] || "";
42198
+ const newValue = variables[variableName];
42199
+ node.value = typeof newValue == "string" ? newValue : "";
42176
42200
  }
42177
42201
  }
42178
42202
  }), main$3.print(ast, { quote: "single" }).code;
@@ -42406,7 +42430,8 @@ async function bootstrapTemplate(opts, context) {
42406
42430
  variables
42407
42431
  }), cliConfig = await createCliConfig({
42408
42432
  projectId: variables.projectId,
42409
- dataset: variables.dataset
42433
+ dataset: variables.dataset,
42434
+ autoUpdates: variables.autoUpdates
42410
42435
  }), codeExt = useTypeScript ? "ts" : "js";
42411
42436
  await Promise.all([
42412
42437
  writeFileIfNotExists(`sanity.config.${codeExt}`, studioConfig),
@@ -44370,6 +44395,8 @@ ${chalk2.green("Success!")} Your Sanity configuration files has been added to th
44370
44395
  const typescriptOnly = template.typescriptOnly === !0;
44371
44396
  let useTypeScript = !0;
44372
44397
  !typescriptOnly && typeof cliFlags.typescript == "boolean" ? useTypeScript = cliFlags.typescript : !typescriptOnly && !unattended && (useTypeScript = await promptForTypeScript(prompt2), trace.log({ step: "useTypeScript", selectedOption: useTypeScript ? "yes" : "no" }));
44398
+ let autoUpdates = !0;
44399
+ typeof cliFlags["auto-updates"] == "boolean" && (autoUpdates = cliFlags["auto-updates"]);
44373
44400
  const templateOptions = {
44374
44401
  outputPath,
44375
44402
  packageName: sluggedName,
@@ -44377,6 +44404,7 @@ ${chalk2.green("Success!")} Your Sanity configuration files has been added to th
44377
44404
  schemaUrl,
44378
44405
  useTypeScript,
44379
44406
  variables: {
44407
+ autoUpdates,
44380
44408
  dataset: datasetName,
44381
44409
  projectId,
44382
44410
  projectName: displayName || answers.projectName
@@ -44900,6 +44928,7 @@ Options
44900
44928
  --coupon <name> Optionally select a coupon for a new project (cannot be used with --project-plan)
44901
44929
  --no-typescript Do not use TypeScript for template files
44902
44930
  --package-manager <name> Specify which package manager to use [allowed: ${allowedPackageManagersString}]
44931
+ --no-auto-updates Disable auto updates of studio versions
44903
44932
 
44904
44933
  Examples
44905
44934
  # Initialize a new project, prompt for required information along the way