sanity 3.77.3-server-side-schemas.21 → 3.77.3-server-side-schemas.23

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.
@@ -63,6 +63,7 @@ async function deployStudioAction(args, context) {
63
63
  }
64
64
  throw helpers.debug("Error creating user application", err), err;
65
65
  }
66
+ let extractManifestError;
66
67
  if (flags.build) {
67
68
  const buildArgs = {
68
69
  ...args,
@@ -75,15 +76,12 @@ async function deployStudioAction(args, context) {
75
76
  });
76
77
  if (!didCompile)
77
78
  return;
78
- if (!isCoreApp) {
79
- const extractManifestError = await _internal.extractManifestSafe({
80
- ...buildArgs,
81
- extOptions: {},
82
- extraArguments: []
83
- }, context);
84
- if (flags["schema-required"] && extractManifestError)
85
- throw output.error(`Schema extraction error: ${extractManifestError.message}`), extractManifestError;
86
- }
79
+ if (!isCoreApp && (extractManifestError = await _internal.extractManifestSafe({
80
+ ...buildArgs,
81
+ extOptions: {},
82
+ extraArguments: []
83
+ }, context), flags["schema-required"] && extractManifestError))
84
+ throw output.error(`Schema extraction error: ${extractManifestError.message}`), extractManifestError;
87
85
  }
88
86
  if (!isCoreApp) {
89
87
  const storeManifestSchemasArgs = {
@@ -93,7 +91,7 @@ async function deployStudioAction(args, context) {
93
91
  verbose: flags.verbose
94
92
  }
95
93
  };
96
- await _internal.storeSchemasAction(storeManifestSchemasArgs, context);
94
+ extractManifestError || await _internal.storeSchemasAction(storeManifestSchemasArgs, context);
97
95
  }
98
96
  spinner = output.spinner("Verifying local content").start();
99
97
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"deployAction.js","sources":["../../src/_internal/cli/actions/deploy/deployAction.ts"],"sourcesContent":["/* eslint-disable max-statements */\nimport path from 'node:path'\nimport zlib from 'node:zlib'\n\nimport {type CliCommandArguments, type CliCommandContext} from '@sanity/cli'\nimport tar from 'tar-fs'\n\nimport {shouldAutoUpdate} from '../../util/shouldAutoUpdate'\nimport buildSanityStudio, {type BuildSanityStudioCommandFlags} from '../build/buildAction'\nimport {extractManifestSafe} from '../manifest/extractManifestAction'\nimport storeManifestSchemas from '../schema/storeSchemasAction'\nimport {\n type BaseConfigOptions,\n checkDir,\n createDeployment,\n debug,\n dirIsEmptyOrNonExistent,\n getInstalledSanityVersion,\n getOrCreateCoreApplication,\n getOrCreateStudio,\n getOrCreateUserApplicationFromConfig,\n type UserApplication,\n} from './helpers'\n\nexport interface DeployStudioActionFlags extends BuildSanityStudioCommandFlags {\n 'build'?: boolean\n 'schema-required'?: boolean\n 'verbose'?: boolean\n}\n\n// eslint-disable-next-line complexity\nexport default async function deployStudioAction(\n args: CliCommandArguments<DeployStudioActionFlags>,\n context: CliCommandContext,\n): Promise<void> {\n const {apiClient, workDir, chalk, output, prompt, cliConfig} = context\n const flags = {build: true, ...args.extOptions}\n const customSourceDir = args.argsWithoutOptions[0]\n const sourceDir = path.resolve(process.cwd(), customSourceDir || path.join(workDir, 'dist'))\n const isAutoUpdating = shouldAutoUpdate({flags, cliConfig})\n const isCoreApp = cliConfig && '__experimental_coreAppConfiguration' in cliConfig\n\n const installedSanityVersion = await getInstalledSanityVersion()\n const configStudioHost = cliConfig && 'studioHost' in cliConfig && cliConfig.studioHost\n const appId =\n cliConfig &&\n '__experimental_coreAppConfiguration' in cliConfig &&\n cliConfig.__experimental_coreAppConfiguration?.appId\n\n const client = apiClient({\n requireUser: true,\n requireProject: !isCoreApp, // core apps are not project-specific\n }).withConfig({apiVersion: 'v2024-08-01'})\n\n if (customSourceDir === 'graphql') {\n throw new Error('Did you mean `sanity graphql deploy`?')\n }\n\n if (customSourceDir) {\n let relativeOutput = path.relative(process.cwd(), sourceDir)\n if (relativeOutput[0] !== '.') {\n relativeOutput = `./${relativeOutput}`\n }\n\n const isEmpty = await dirIsEmptyOrNonExistent(sourceDir)\n const shouldProceed =\n isEmpty ||\n (await prompt.single({\n type: 'confirm',\n message: `\"${relativeOutput}\" is not empty, do you want to proceed?`,\n default: false,\n }))\n\n if (!shouldProceed) {\n output.print('Cancelled.')\n return\n }\n\n output.print(`Building to ${relativeOutput}\\n`)\n }\n\n // Check that the project has a studio hostname\n let spinner = output.spinner('Checking project info').start()\n\n let userApplication: UserApplication\n\n try {\n const configParams: BaseConfigOptions & {\n appHost?: string\n appId?: string\n } = {\n client,\n context,\n spinner,\n }\n\n if (isCoreApp && appId) {\n configParams.appId = appId\n } else if (configStudioHost) {\n configParams.appHost = configStudioHost\n }\n // If the user has provided a studioHost / appId in the config, use that\n if (configStudioHost || appId) {\n userApplication = await getOrCreateUserApplicationFromConfig(configParams)\n } else {\n userApplication = isCoreApp\n ? await getOrCreateCoreApplication({client, context, spinner})\n : await getOrCreateStudio({client, context, spinner})\n }\n } catch (err) {\n if (err.message) {\n output.error(chalk.red(err.message))\n return\n }\n\n debug('Error creating user application', err)\n throw err\n }\n\n // Always build the project, unless --no-build is passed\n const shouldBuild = flags.build\n if (shouldBuild) {\n const buildArgs = {\n ...args,\n extOptions: flags,\n argsWithoutOptions: [customSourceDir].filter(Boolean),\n }\n const {didCompile} = await buildSanityStudio(buildArgs, context, {basePath: '/'})\n\n if (!didCompile) {\n return\n }\n\n if (!isCoreApp) {\n const extractManifestError = await extractManifestSafe(\n {\n ...buildArgs,\n extOptions: {},\n extraArguments: [],\n },\n context,\n )\n\n if (flags['schema-required'] && extractManifestError) {\n output.error(`Schema extraction error: ${extractManifestError.message}`)\n throw extractManifestError\n }\n }\n }\n\n if (!isCoreApp) {\n const storeManifestSchemasArgs = {\n ...args,\n extOptions: {\n 'path': `${sourceDir}/static`,\n 'schema-required': flags['schema-required'],\n 'verbose': flags.verbose,\n },\n extraArguments: [],\n }\n\n await storeManifestSchemas(storeManifestSchemasArgs, context)\n }\n\n // Ensure that the directory exists, is a directory and seems to have valid content\n spinner = output.spinner('Verifying local content').start()\n try {\n await checkDir(sourceDir)\n spinner.succeed()\n } catch (err) {\n spinner.fail()\n debug('Error checking directory', err)\n throw err\n }\n\n // Now create a tarball of the given directory\n const parentDir = path.dirname(sourceDir)\n const base = path.basename(sourceDir)\n const tarball = tar.pack(parentDir, {entries: [base]}).pipe(zlib.createGzip())\n\n spinner = output.spinner(`Deploying to ${isCoreApp ? 'CORE' : 'Sanity.Studio'}`).start()\n try {\n const {location} = await createDeployment({\n client,\n applicationId: userApplication.id,\n version: installedSanityVersion,\n isAutoUpdating,\n tarball,\n isCoreApp,\n })\n\n spinner.succeed()\n\n output.print()\n\n // And let the user know we're done\n output.print(\n `\\nSuccess! ${isCoreApp ? 'Application deployed' : `Studio deployed to ${chalk.cyan(location)}`}`,\n )\n\n if ((isCoreApp && !appId) || (!isCoreApp && !configStudioHost)) {\n output.print(\n `\\nAdd ${chalk.cyan(isCoreApp ? `appId: '${userApplication.id}'` : `studioHost: '${userApplication.appHost}'`)}`,\n )\n output.print(\n `to ${isCoreApp ? '__experimental_coreAppConfiguration' : 'defineCliConfig root properties'} in sanity.cli.js or sanity.cli.ts`,\n )\n output.print(`to avoid prompting ${isCoreApp ? '' : 'for hostname'} on next deploy.`)\n }\n } catch (err) {\n spinner.fail()\n debug('Error deploying studio', err)\n throw err\n }\n}\n"],"names":["deployStudioAction","args","context","apiClient","workDir","chalk","output","prompt","cliConfig","flags","build","extOptions","customSourceDir","argsWithoutOptions","sourceDir","path","resolve","process","cwd","join","isAutoUpdating","shouldAutoUpdate","isCoreApp","installedSanityVersion","getInstalledSanityVersion","configStudioHost","studioHost","appId","__experimental_coreAppConfiguration","client","requireUser","requireProject","withConfig","apiVersion","Error","relativeOutput","relative","dirIsEmptyOrNonExistent","single","type","message","default","print","spinner","start","userApplication","configParams","appHost","getOrCreateUserApplicationFromConfig","getOrCreateCoreApplication","getOrCreateStudio","err","error","red","debug","buildArgs","filter","Boolean","didCompile","buildSanityStudio","basePath","extractManifestError","extractManifestSafe","extraArguments","storeManifestSchemasArgs","verbose","storeManifestSchemas","checkDir","succeed","fail","parentDir","dirname","base","basename","tarball","tar","pack","entries","pipe","zlib","createGzip","location","createDeployment","applicationId","id","version","cy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AAAA,MAASrC,MAAMiF,KAAKhE,YAAY,WAAWuB,gBAAgBuC,EAAE,MAAM,gBAAgBvC,gBAAgBE,OAAO,GAAG,CAAC,EAChH,GACAzC,OAAOoC,MACL,MAAMpB,YAAY,wCAAwC,iCAAiC,oCAC7F,GACAhB,OAAOoC,MAAM,sBAAsBpB,YAAY,KAAK,cAAc,kBAAkB;AAAA,WAE/E6B,KAAK;AACZR,UAAAA,QAAQ0B,KAAK,GACbf,QAAM,MAAA,0BAA0BH,GAAG,GAC7BA;AAAAA,EAAAA;AAEV;;"}
1
+ {"version":3,"file":"deployAction.js","sources":["../../src/_internal/cli/actions/deploy/deployAction.ts"],"sourcesContent":["/* eslint-disable max-statements */\nimport path from 'node:path'\nimport zlib from 'node:zlib'\n\nimport {type CliCommandArguments, type CliCommandContext} from '@sanity/cli'\nimport tar from 'tar-fs'\n\nimport {shouldAutoUpdate} from '../../util/shouldAutoUpdate'\nimport buildSanityStudio, {type BuildSanityStudioCommandFlags} from '../build/buildAction'\nimport {extractManifestSafe} from '../manifest/extractManifestAction'\nimport storeManifestSchemas from '../schema/storeSchemasAction'\nimport {\n type BaseConfigOptions,\n checkDir,\n createDeployment,\n debug,\n dirIsEmptyOrNonExistent,\n getInstalledSanityVersion,\n getOrCreateCoreApplication,\n getOrCreateStudio,\n getOrCreateUserApplicationFromConfig,\n type UserApplication,\n} from './helpers'\n\nexport interface DeployStudioActionFlags extends BuildSanityStudioCommandFlags {\n 'build'?: boolean\n 'schema-required'?: boolean\n 'verbose'?: boolean\n}\n\n// eslint-disable-next-line complexity\nexport default async function deployStudioAction(\n args: CliCommandArguments<DeployStudioActionFlags>,\n context: CliCommandContext,\n): Promise<void> {\n const {apiClient, workDir, chalk, output, prompt, cliConfig} = context\n const flags = {build: true, ...args.extOptions}\n const customSourceDir = args.argsWithoutOptions[0]\n const sourceDir = path.resolve(process.cwd(), customSourceDir || path.join(workDir, 'dist'))\n const isAutoUpdating = shouldAutoUpdate({flags, cliConfig})\n const isCoreApp = cliConfig && '__experimental_coreAppConfiguration' in cliConfig\n\n const installedSanityVersion = await getInstalledSanityVersion()\n const configStudioHost = cliConfig && 'studioHost' in cliConfig && cliConfig.studioHost\n const appId =\n cliConfig &&\n '__experimental_coreAppConfiguration' in cliConfig &&\n cliConfig.__experimental_coreAppConfiguration?.appId\n\n const client = apiClient({\n requireUser: true,\n requireProject: !isCoreApp, // core apps are not project-specific\n }).withConfig({apiVersion: 'v2024-08-01'})\n\n if (customSourceDir === 'graphql') {\n throw new Error('Did you mean `sanity graphql deploy`?')\n }\n\n if (customSourceDir) {\n let relativeOutput = path.relative(process.cwd(), sourceDir)\n if (relativeOutput[0] !== '.') {\n relativeOutput = `./${relativeOutput}`\n }\n\n const isEmpty = await dirIsEmptyOrNonExistent(sourceDir)\n const shouldProceed =\n isEmpty ||\n (await prompt.single({\n type: 'confirm',\n message: `\"${relativeOutput}\" is not empty, do you want to proceed?`,\n default: false,\n }))\n\n if (!shouldProceed) {\n output.print('Cancelled.')\n return\n }\n\n output.print(`Building to ${relativeOutput}\\n`)\n }\n\n // Check that the project has a studio hostname\n let spinner = output.spinner('Checking project info').start()\n\n let userApplication: UserApplication\n\n try {\n const configParams: BaseConfigOptions & {\n appHost?: string\n appId?: string\n } = {\n client,\n context,\n spinner,\n }\n\n if (isCoreApp && appId) {\n configParams.appId = appId\n } else if (configStudioHost) {\n configParams.appHost = configStudioHost\n }\n // If the user has provided a studioHost / appId in the config, use that\n if (configStudioHost || appId) {\n userApplication = await getOrCreateUserApplicationFromConfig(configParams)\n } else {\n userApplication = isCoreApp\n ? await getOrCreateCoreApplication({client, context, spinner})\n : await getOrCreateStudio({client, context, spinner})\n }\n } catch (err) {\n if (err.message) {\n output.error(chalk.red(err.message))\n return\n }\n\n debug('Error creating user application', err)\n throw err\n }\n\n // Always build the project, unless --no-build is passed\n let extractManifestError: Error | undefined\n const shouldBuild = flags.build\n if (shouldBuild) {\n const buildArgs = {\n ...args,\n extOptions: flags,\n argsWithoutOptions: [customSourceDir].filter(Boolean),\n }\n const {didCompile} = await buildSanityStudio(buildArgs, context, {basePath: '/'})\n\n if (!didCompile) {\n return\n }\n\n if (!isCoreApp) {\n extractManifestError = await extractManifestSafe(\n {\n ...buildArgs,\n extOptions: {},\n extraArguments: [],\n },\n context,\n )\n\n if (flags['schema-required'] && extractManifestError) {\n output.error(`Schema extraction error: ${extractManifestError.message}`)\n throw extractManifestError\n }\n }\n }\n\n if (!isCoreApp) {\n const storeManifestSchemasArgs = {\n ...args,\n extOptions: {\n 'path': `${sourceDir}/static`,\n 'schema-required': flags['schema-required'],\n 'verbose': flags.verbose,\n },\n extraArguments: [],\n }\n\n if (!extractManifestError) {\n await storeManifestSchemas(storeManifestSchemasArgs, context)\n }\n }\n\n // Ensure that the directory exists, is a directory and seems to have valid content\n spinner = output.spinner('Verifying local content').start()\n try {\n await checkDir(sourceDir)\n spinner.succeed()\n } catch (err) {\n spinner.fail()\n debug('Error checking directory', err)\n throw err\n }\n\n // Now create a tarball of the given directory\n const parentDir = path.dirname(sourceDir)\n const base = path.basename(sourceDir)\n const tarball = tar.pack(parentDir, {entries: [base]}).pipe(zlib.createGzip())\n\n spinner = output.spinner(`Deploying to ${isCoreApp ? 'CORE' : 'Sanity.Studio'}`).start()\n try {\n const {location} = await createDeployment({\n client,\n applicationId: userApplication.id,\n version: installedSanityVersion,\n isAutoUpdating,\n tarball,\n isCoreApp,\n })\n\n spinner.succeed()\n\n output.print()\n\n // And let the user know we're done\n output.print(\n `\\nSuccess! ${isCoreApp ? 'Application deployed' : `Studio deployed to ${chalk.cyan(location)}`}`,\n )\n\n if ((isCoreApp && !appId) || (!isCoreApp && !configStudioHost)) {\n output.print(\n `\\nAdd ${chalk.cyan(isCoreApp ? `appId: '${userApplication.id}'` : `studioHost: '${userApplication.appHost}'`)}`,\n )\n output.print(\n `to ${isCoreApp ? '__experimental_coreAppConfiguration' : 'defineCliConfig root properties'} in sanity.cli.js or sanity.cli.ts`,\n )\n output.print(`to avoid prompting ${isCoreApp ? '' : 'for hostname'} on next deploy.`)\n }\n } catch (err) {\n spinner.fail()\n debug('Error deploying studio', err)\n throw err\n }\n}\n"],"names":["deployStudioAction","args","context","apiClient","workDir","chalk","output","prompt","cliConfig","flags","build","extOptions","customSourceDir","argsWithoutOptions","sourceDir","path","resolve","process","cwd","join","isAutoUpdating","shouldAutoUpdate","isCoreApp","installedSanityVersion","getInstalledSanityVersion","configStudioHost","studioHost","appId","__experimental_coreAppConfiguration","client","requireUser","requireProject","withConfig","apiVersion","Error","relativeOutput","relative","dirIsEmptyOrNonExistent","single","type","message","default","print","spinner","start","userApplication","configParams","appHost","getOrCreateUserApplicationFromConfig","getOrCreateCoreApplication","getOrCreateStudio","err","error","red","debug","extractManifestError","buildArgs","filter","Boolean","didCompile","buildSanityStudio","basePath","extractManifestSafe","extraArguments","storeManifestSchemasArgs","verbose","storeManifestSchemas","checkDir","succeed","fail","parentDir","dirname","base","basename","tarball","tar","pack","entries","pipe","zlib","createGzip","location","createDeployment","applicationId","id","version","cyan"],"mappings":";;;;;;AA+B8BA,eAAAA,mBAC5BC,MACAC,SACe;AACT,QAAA;AAAA,IAACC;AAAAA,IAAWC;AAAAA,IAASC;AAAAA,IAAOC;AAAAA,IAAQC;AAAAA,IAAQC;AAAAA,EAAAA,IAAaN,SACzDO,QAAQ;AAAA,IAACC,OAAO;AAAA,IAAM,GAAGT,KAAKU;AAAAA,EAAAA,GAC9BC,kBAAkBX,KAAKY,mBAAmB,CAAC,GAC3CC,YAAYC,cAAAA,QAAKC,QAAQC,QAAQC,OAAON,mBAAmBG,sBAAKI,KAAKf,SAAS,MAAM,CAAC,GACrFgB,iBAAiBC,6BAAiB;AAAA,IAACZ;AAAAA,IAAOD;AAAAA,EAAU,CAAA,GACpDc,YAAYd,aAAa,yCAAyCA,WAElEe,yBAAyB,MAAMC,kCAA0B,GACzDC,mBAAmBjB,aAAa,gBAAgBA,aAAaA,UAAUkB,YACvEC,QACJnB,aACA,yCAAyCA,aAC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AS3D,SAAS,GAC9B4D,UAAUC,aAAAA,QAAIC,KAAKN,WAAW;AAAA,IAACO,SAAS,CAACL,IAAI;AAAA,EAAE,CAAA,EAAEM,KAAKC,sBAAKC,YAAY;AAEnE1E,YAAAA,OAAOqC,QAAQ,gBAAgBrB,YAAY,SAAS,eAAe,EAAE,EAAEsB,MAAM;AACnF,MAAA;AACI,UAAA;AAAA,MAACqC;AAAAA,IAAQ,IAAI,MAAMC,QAAAA,iBAAiB;AAAA,MACxCrD;AAAAA,MACAsD,eAAetC,gBAAgBuC;AAAAA,MAC/BC,SAAS9D;AAAAA,MACTH;AAAAA,MACAsD;AAAAA,MACApD;AAAAA,IAAAA,CACD;AAEDqB,YAAQyB,WAER9D,OAAOoC,MAAM,GAGbpC,OAAOoC,MACL;AAAA,WAAcpB,YAAY,yBAAyB,sBAAsBjB,MAAMiF,KAAKL,QAAQ,CAAC,EAAE,EACjG,IAEK3D,aAAa,CAACK,SAAW,CAACL,aAAa,CAACG,sBAC3CnB,OAAOoC,MACL;AAAA,MAASrC,MAAMiF,KAAKhE,YAAY,WAAWuB,gBAAgBuC,EAAE,MAAM,gBAAgBvC,gBAAgBE,OAAO,GAAG,CAAC,EAChH,GACAzC,OAAOoC,MACL,MAAMpB,YAAY,wCAAwC,iCAAiC,oCAC7F,GACAhB,OAAOoC,MAAM,sBAAsBpB,YAAY,KAAK,cAAc,kBAAkB;AAAA,WAE/E6B,KAAK;AACZR,UAAAA,QAAQ0B,KAAK,GACbf,QAAM,MAAA,0BAA0BH,GAAG,GAC7BA;AAAAA,EAAAA;AAEV;;"}
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
- const SANITY_VERSION = "3.77.3-server-side-schemas.21+9d4266dc54";
2
+ const SANITY_VERSION = "3.77.3-server-side-schemas.23+8244319bba";
3
3
  exports.SANITY_VERSION = SANITY_VERSION;
4
4
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- const SANITY_VERSION = "3.77.3-server-side-schemas.21+9d4266dc54";
1
+ const SANITY_VERSION = "3.77.3-server-side-schemas.23+8244319bba";
2
2
  export {
3
3
  SANITY_VERSION
4
4
  };
@@ -1,4 +1,4 @@
1
- const SANITY_VERSION = "3.77.3-server-side-schemas.21+9d4266dc54";
1
+ const SANITY_VERSION = "3.77.3-server-side-schemas.23+8244319bba";
2
2
  export {
3
3
  SANITY_VERSION
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity",
3
- "version": "3.77.3-server-side-schemas.21+9d4266dc54",
3
+ "version": "3.77.3-server-side-schemas.23+8244319bba",
4
4
  "description": "Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches",
5
5
  "keywords": [
6
6
  "sanity",
@@ -160,11 +160,11 @@
160
160
  "@rexxars/react-json-inspector": "^9.0.1",
161
161
  "@sanity/asset-utils": "^2.0.6",
162
162
  "@sanity/bifur-client": "^0.4.1",
163
- "@sanity/cli": "3.77.3-server-side-schemas.21+9d4266dc54",
163
+ "@sanity/cli": "3.77.3-server-side-schemas.23+8244319bba",
164
164
  "@sanity/client": "^6.28.1",
165
165
  "@sanity/color": "^3.0.0",
166
166
  "@sanity/comlink": "^3.0.1",
167
- "@sanity/diff": "3.77.3-server-side-schemas.21+9d4266dc54",
167
+ "@sanity/diff": "3.77.3-server-side-schemas.23+8244319bba",
168
168
  "@sanity/diff-match-patch": "^3.1.1",
169
169
  "@sanity/diff-patch": "^5.0.0",
170
170
  "@sanity/eventsource": "^5.0.0",
@@ -174,15 +174,15 @@
174
174
  "@sanity/import": "^3.37.9",
175
175
  "@sanity/insert-menu": "^1.1.3",
176
176
  "@sanity/logos": "^2.1.13",
177
- "@sanity/migrate": "3.77.3-server-side-schemas.21+9d4266dc54",
178
- "@sanity/mutator": "3.77.3-server-side-schemas.21+9d4266dc54",
177
+ "@sanity/migrate": "3.77.3-server-side-schemas.23+8244319bba",
178
+ "@sanity/mutator": "3.77.3-server-side-schemas.23+8244319bba",
179
179
  "@sanity/presentation-comlink": "^1.0.8",
180
180
  "@sanity/preview-url-secret": "^2.1.4",
181
- "@sanity/schema": "3.77.3-server-side-schemas.21+9d4266dc54",
181
+ "@sanity/schema": "3.77.3-server-side-schemas.23+8244319bba",
182
182
  "@sanity/telemetry": "^0.7.7",
183
- "@sanity/types": "3.77.3-server-side-schemas.21+9d4266dc54",
183
+ "@sanity/types": "3.77.3-server-side-schemas.23+8244319bba",
184
184
  "@sanity/ui": "^2.14.3",
185
- "@sanity/util": "3.77.3-server-side-schemas.21+9d4266dc54",
185
+ "@sanity/util": "3.77.3-server-side-schemas.23+8244319bba",
186
186
  "@sanity/uuid": "^3.0.2",
187
187
  "@sentry/react": "^8.33.0",
188
188
  "@tanstack/react-table": "^8.16.0",
@@ -280,7 +280,7 @@
280
280
  "@repo/dev-aliases": "3.77.2",
281
281
  "@repo/package.config": "3.77.2",
282
282
  "@repo/test-config": "3.77.2",
283
- "@sanity/codegen": "3.77.3-server-side-schemas.21+9d4266dc54",
283
+ "@sanity/codegen": "3.77.3-server-side-schemas.23+8244319bba",
284
284
  "@sanity/generate-help-url": "^3.0.0",
285
285
  "@sanity/pkg-utils": "6.13.4",
286
286
  "@sanity/tsdoc": "1.0.169",
@@ -325,5 +325,5 @@
325
325
  "engines": {
326
326
  "node": ">=18"
327
327
  },
328
- "gitHead": "9d4266dc54832e3e33bcaad546f3fe76bf3593f0"
328
+ "gitHead": "8244319bbada5110b280174d9b2cabdc192e9f6c"
329
329
  }
@@ -118,6 +118,7 @@ export default async function deployStudioAction(
118
118
  }
119
119
 
120
120
  // Always build the project, unless --no-build is passed
121
+ let extractManifestError: Error | undefined
121
122
  const shouldBuild = flags.build
122
123
  if (shouldBuild) {
123
124
  const buildArgs = {
@@ -132,7 +133,7 @@ export default async function deployStudioAction(
132
133
  }
133
134
 
134
135
  if (!isCoreApp) {
135
- const extractManifestError = await extractManifestSafe(
136
+ extractManifestError = await extractManifestSafe(
136
137
  {
137
138
  ...buildArgs,
138
139
  extOptions: {},
@@ -159,7 +160,9 @@ export default async function deployStudioAction(
159
160
  extraArguments: [],
160
161
  }
161
162
 
162
- await storeManifestSchemas(storeManifestSchemasArgs, context)
163
+ if (!extractManifestError) {
164
+ await storeManifestSchemas(storeManifestSchemasArgs, context)
165
+ }
163
166
  }
164
167
 
165
168
  // Ensure that the directory exists, is a directory and seems to have valid content