sanity 3.72.2-server-side-schemas.24 → 3.72.2-server-side-schemas.25
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.
- package/lib/_chunks-cjs/_internal.js +2 -0
- package/lib/_chunks-cjs/_internal.js.map +1 -1
- package/lib/_chunks-cjs/deployAction.js +2 -1
- package/lib/_chunks-cjs/deployAction.js.map +1 -1
- package/lib/_chunks-cjs/storeSchemasAction.js +18 -17
- package/lib/_chunks-cjs/storeSchemasAction.js.map +1 -1
- package/lib/_chunks-cjs/version.js +1 -1
- package/lib/_chunks-es/version.mjs +1 -1
- package/lib/_legacy/version.esm.js +1 -1
- package/package.json +10 -10
- package/src/_internal/cli/actions/deploy/deployAction.ts +2 -0
- package/src/_internal/cli/actions/schema/storeSchemasAction.ts +38 -28
- package/src/_internal/cli/commands/deploy/deployCommand.ts +1 -0
- package/src/_internal/cli/commands/schema/storeSchemaCommand.ts +1 -0
@@ -81,7 +81,8 @@ async function deployStudioAction(args, context) {
|
|
81
81
|
...args,
|
82
82
|
extOptions: {
|
83
83
|
path: `${sourceDir}/static`,
|
84
|
-
"schema-required": flags["schema-required"]
|
84
|
+
"schema-required": flags["schema-required"],
|
85
|
+
verbose: flags.verbose
|
85
86
|
},
|
86
87
|
extraArguments: []
|
87
88
|
};
|
@@ -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 checkDir,\n createDeployment,\n debug,\n dirIsEmptyOrNonExistent,\n getInstalledSanityVersion,\n getOrCreateUserApplication,\n getOrCreateUserApplicationFromConfig,\n type UserApplication,\n} from './helpers'\n\nexport interface DeployStudioActionFlags extends BuildSanityStudioCommandFlags {\n 'build'?: boolean\n 'schema-required'?: boolean\n}\n\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\n const installedSanityVersion = await getInstalledSanityVersion()\n const configStudioHost = cliConfig && 'studioHost' in cliConfig && cliConfig.studioHost\n\n const client = apiClient({\n requireUser: true,\n requireProject: true,\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 // If the user has provided a studioHost in the config, use that\n if (configStudioHost) {\n userApplication = await getOrCreateUserApplicationFromConfig({\n client,\n context,\n spinner,\n appHost: configStudioHost,\n })\n } else {\n userApplication = await getOrCreateUserApplication({\n client,\n context,\n spinner,\n })\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 const extractManifestError = await extractManifestSafe(\n {\n ...buildArgs,\n extOptions: {},\n extraArguments: [],\n },\n context,\n )\n if (flags['schema-required'] && extractManifestError) {\n output.error(`Schema extraction error: ${extractManifestError.message}`)\n throw extractManifestError\n }\n\n const storeManifestSchemasArgs = {\n ...args,\n extOptions: {\n 'path': `${sourceDir}/static`,\n 'schema-required': flags['schema-required'],\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 Sanity.Studio').start()\n try {\n const {location} = await createDeployment({\n client,\n applicationId: userApplication.id,\n version: installedSanityVersion,\n isAutoUpdating,\n tarball,\n })\n\n spinner.succeed()\n\n // And let the user know we're done\n output.print(`\\nSuccess! Studio deployed to ${chalk.cyan(location)}`)\n\n if (!configStudioHost) {\n output.print(`\\nAdd ${chalk.cyan(`studioHost: '${userApplication.appHost}'`)}`)\n output.print('to defineCliConfig root properties in sanity.cli.js or sanity.cli.ts')\n output.print('to avoid prompting 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","installedSanityVersion","getInstalledSanityVersion","configStudioHost","studioHost","client","requireUser","requireProject","withConfig","apiVersion","Error","relativeOutput","relative","dirIsEmptyOrNonExistent","single","type","message","default","print","spinner","start","userApplication","getOrCreateUserApplicationFromConfig","appHost","getOrCreateUserApplication","err","error","red","debug","buildArgs","filter","Boolean","didCompile","buildSanityStudio","basePath","extractManifestError","extractManifestSafe","extraArguments","storeManifestSchemasArgs","storeManifestSchemas","checkDir","succeed","fail","parentDir","dirname","base","basename","tarball","tar","pack","entries","pipe","zlib","createGzip","location","createDeployment","applicationId","id","version","cyan"],"mappings":";;;;;;
|
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 checkDir,\n createDeployment,\n debug,\n dirIsEmptyOrNonExistent,\n getInstalledSanityVersion,\n getOrCreateUserApplication,\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\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\n const installedSanityVersion = await getInstalledSanityVersion()\n const configStudioHost = cliConfig && 'studioHost' in cliConfig && cliConfig.studioHost\n\n const client = apiClient({\n requireUser: true,\n requireProject: true,\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 // If the user has provided a studioHost in the config, use that\n if (configStudioHost) {\n userApplication = await getOrCreateUserApplicationFromConfig({\n client,\n context,\n spinner,\n appHost: configStudioHost,\n })\n } else {\n userApplication = await getOrCreateUserApplication({\n client,\n context,\n spinner,\n })\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 const extractManifestError = await extractManifestSafe(\n {\n ...buildArgs,\n extOptions: {},\n extraArguments: [],\n },\n context,\n )\n if (flags['schema-required'] && extractManifestError) {\n output.error(`Schema extraction error: ${extractManifestError.message}`)\n throw extractManifestError\n }\n\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 Sanity.Studio').start()\n try {\n const {location} = await createDeployment({\n client,\n applicationId: userApplication.id,\n version: installedSanityVersion,\n isAutoUpdating,\n tarball,\n })\n\n spinner.succeed()\n\n // And let the user know we're done\n output.print(`\\nSuccess! Studio deployed to ${chalk.cyan(location)}`)\n\n if (!configStudioHost) {\n output.print(`\\nAdd ${chalk.cyan(`studioHost: '${userApplication.appHost}'`)}`)\n output.print('to defineCliConfig root properties in sanity.cli.js or sanity.cli.ts')\n output.print('to avoid prompting 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","installedSanityVersion","getInstalledSanityVersion","configStudioHost","studioHost","client","requireUser","requireProject","withConfig","apiVersion","Error","relativeOutput","relative","dirIsEmptyOrNonExistent","single","type","message","default","print","spinner","start","userApplication","getOrCreateUserApplicationFromConfig","appHost","getOrCreateUserApplication","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","cyan"],"mappings":"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"}
|
@@ -5,11 +5,11 @@ function _interopDefaultCompat(e) {
|
|
5
5
|
}
|
6
6
|
var path__default = /* @__PURE__ */ _interopDefaultCompat(path);
|
7
7
|
async function storeManifestSchemas(args, context) {
|
8
|
-
const flags = args.extOptions, workspaceName = flags.workspace, idPrefix = flags["id-prefix"], {
|
8
|
+
const flags = args.extOptions, workspaceName = flags.workspace, idPrefix = flags["id-prefix"], verbose = flags.verbose, {
|
9
9
|
output,
|
10
10
|
workDir,
|
11
11
|
apiClient
|
12
|
-
} = context, defaultOutputDir = path.resolve(path.join(workDir, "dist")), outputDir = path.resolve(defaultOutputDir), defaultStaticPath = path.join(outputDir, "static"), staticPath = flags.path ?? defaultStaticPath;
|
12
|
+
} = context, defaultOutputDir = path.resolve(path.join(workDir, "dist")), outputDir = path.resolve(defaultOutputDir), defaultStaticPath = path.join(outputDir, "static"), staticPath = flags.path ?? defaultStaticPath, spinner = output.spinner({}).start("Storing schemas");
|
13
13
|
try {
|
14
14
|
const manifestPath = path__default.default.resolve(process.cwd(), staticPath), client = apiClient({
|
15
15
|
requireUser: !0,
|
@@ -21,13 +21,14 @@ async function storeManifestSchemas(args, context) {
|
|
21
21
|
try {
|
22
22
|
manifest = JSON.parse(fs.readFileSync(`${manifestPath}/create-manifest.json`, "utf-8"));
|
23
23
|
} catch (error) {
|
24
|
-
throw
|
24
|
+
throw spinner.fail(`Manifest not found at ${manifestPath}/create-manifest.json`), output.error(error), error;
|
25
25
|
}
|
26
|
+
let storedCount = 0;
|
26
27
|
const saveSchema = async (workspace) => {
|
27
|
-
const
|
28
|
+
const id = `${idPrefix || "sanity.workspace.schema"}.${workspace.name}`;
|
28
29
|
try {
|
29
30
|
if (workspace.projectId !== projectId && workspaceName !== workspace.name) {
|
30
|
-
|
31
|
+
output.error(`Mismatch between cli config and manifest projectId in workspace ${workspace.name}: ${projectId} !== ${workspace.projectId}`);
|
31
32
|
return;
|
32
33
|
}
|
33
34
|
const schema = JSON.parse(fs.readFileSync(`${manifestPath}/${workspace.schema}`, "utf-8"));
|
@@ -39,31 +40,31 @@ async function storeManifestSchemas(args, context) {
|
|
39
40
|
_id: id,
|
40
41
|
workspace,
|
41
42
|
schema
|
42
|
-
}).commit(), spinner.
|
43
|
+
}).commit(), storedCount++, spinner.text = `Stored ${storedCount} schemas so far...`;
|
43
44
|
} catch (error) {
|
44
|
-
throw
|
45
|
+
throw output.error(`Error storing schema for workspace ${workspace.name}: ${error}`), error;
|
45
46
|
} finally {
|
46
|
-
|
47
|
+
verbose && spinner.info(`Schema stored: ${JSON.stringify({
|
48
|
+
id,
|
47
49
|
workspace: workspace.name,
|
48
|
-
schemaId: id,
|
49
50
|
projectId: workspace.projectId,
|
50
51
|
dataset: workspace.dataset
|
51
|
-
}, null, 2));
|
52
|
+
}, null, 2)}`);
|
52
53
|
}
|
53
54
|
};
|
54
55
|
if (workspaceName) {
|
55
56
|
const workspaceToSave = manifest.workspaces.find((workspace) => workspace.name === workspaceName);
|
56
57
|
if (!workspaceToSave)
|
57
|
-
|
58
|
+
throw spinner.fail(`Workspace ${workspaceName} not found in manifest`), new Error(`Workspace ${workspaceName} not found in manifest: projectID: ${projectId}`);
|
58
59
|
await saveSchema(workspaceToSave);
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
})
|
60
|
+
} else
|
61
|
+
await Promise.all(manifest.workspaces.map(async (workspace) => {
|
62
|
+
await saveSchema(workspace);
|
63
|
+
}));
|
64
|
+
spinner.succeed(`Stored ${storedCount}/${manifest.workspaces.length} schemas`);
|
64
65
|
return;
|
65
66
|
} catch (err) {
|
66
|
-
if (output.error(err), flags["schema-required"])
|
67
|
+
if (spinner.fail("Error storing schemas"), output.error(err), flags["schema-required"])
|
67
68
|
throw err;
|
68
69
|
return err;
|
69
70
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"storeSchemasAction.js","sources":["../../src/_internal/cli/actions/schema/storeSchemasAction.ts"],"sourcesContent":["import {readFileSync} from 'node:fs'\nimport path, {join, resolve} from 'node:path'\n\nimport {type CliCommandArguments, type CliCommandContext} from '@sanity/cli'\n\nimport {\n type CreateManifest,\n type ManifestSchemaType,\n type ManifestWorkspaceFile,\n} from '../../../manifest/manifestTypes'\n\nexport interface StoreManifestSchemasFlags {\n 'path'?: string\n 'workspace'?: string\n 'id-prefix'?: string\n 'schema-required'?: boolean\n}\n\nexport default async function storeManifestSchemas(\n args: CliCommandArguments<StoreManifestSchemasFlags>,\n context: CliCommandContext,\n): Promise<Error | undefined> {\n const flags = args.extOptions\n const workspaceName = flags.workspace\n const idPrefix = flags['id-prefix']\n const {output, workDir, apiClient} = context\n\n const defaultOutputDir = resolve(join(workDir, 'dist'))\n\n const outputDir = resolve(defaultOutputDir)\n const defaultStaticPath = join(outputDir, 'static')\n\n const staticPath = flags.path ?? defaultStaticPath\n\n try {\n const manifestPath = path.resolve(process.cwd(), staticPath)\n const client = apiClient({\n requireUser: true,\n requireProject: true,\n }).withConfig({apiVersion: 'v2024-08-01'})\n\n const projectId = client.config().projectId\n\n let manifest: CreateManifest\n\n try {\n manifest = JSON.parse(readFileSync(`${manifestPath}/create-manifest.json`, 'utf-8'))\n } catch (error) {\n
|
1
|
+
{"version":3,"file":"storeSchemasAction.js","sources":["../../src/_internal/cli/actions/schema/storeSchemasAction.ts"],"sourcesContent":["import {readFileSync} from 'node:fs'\nimport path, {join, resolve} from 'node:path'\n\nimport {type CliCommandArguments, type CliCommandContext} from '@sanity/cli'\n\nimport {\n type CreateManifest,\n type ManifestSchemaType,\n type ManifestWorkspaceFile,\n} from '../../../manifest/manifestTypes'\n\nexport interface StoreManifestSchemasFlags {\n 'path'?: string\n 'workspace'?: string\n 'id-prefix'?: string\n 'schema-required'?: boolean\n 'verbose'?: boolean\n}\n\nexport default async function storeManifestSchemas(\n args: CliCommandArguments<StoreManifestSchemasFlags>,\n context: CliCommandContext,\n): Promise<Error | undefined> {\n const flags = args.extOptions\n const workspaceName = flags.workspace\n const idPrefix = flags['id-prefix']\n const verbose = flags.verbose\n const {output, workDir, apiClient} = context\n\n const defaultOutputDir = resolve(join(workDir, 'dist'))\n\n const outputDir = resolve(defaultOutputDir)\n const defaultStaticPath = join(outputDir, 'static')\n\n const staticPath = flags.path ?? defaultStaticPath\n\n const spinner = output.spinner({}).start('Storing schemas')\n\n try {\n const manifestPath = path.resolve(process.cwd(), staticPath)\n const client = apiClient({\n requireUser: true,\n requireProject: true,\n }).withConfig({apiVersion: 'v2024-08-01'})\n\n const projectId = client.config().projectId\n\n let manifest: CreateManifest\n\n try {\n manifest = JSON.parse(readFileSync(`${manifestPath}/create-manifest.json`, 'utf-8'))\n } catch (error) {\n spinner.fail(`Manifest not found at ${manifestPath}/create-manifest.json`)\n output.error(error)\n throw error\n }\n\n let storedCount = 0\n\n const saveSchema = async (workspace: ManifestWorkspaceFile) => {\n const id = `${idPrefix || 'sanity.workspace.schema'}.${workspace.name}`\n try {\n if (workspace.projectId !== projectId && workspaceName !== workspace.name) {\n output.error(\n `Mismatch between cli config and manifest projectId in workspace ${workspace.name}: ${projectId} !== ${workspace.projectId}`,\n )\n return\n }\n const schema = JSON.parse(\n readFileSync(`${manifestPath}/${workspace.schema}`, 'utf-8'),\n ) as ManifestSchemaType\n await client\n .withConfig({\n dataset: workspace.dataset,\n projectId: workspace.projectId,\n })\n .transaction()\n .createOrReplace({_type: 'sanity.workspace.schema', _id: id, workspace, schema})\n .commit()\n storedCount++\n spinner.text = `Stored ${storedCount} schemas so far...`\n } catch (error) {\n output.error(`Error storing schema for workspace ${workspace.name}: ${error}`)\n throw error\n } finally {\n if (verbose) {\n spinner.info(\n `Schema stored: ${JSON.stringify(\n {\n id,\n workspace: workspace.name,\n projectId: workspace.projectId,\n dataset: workspace.dataset,\n },\n null,\n 2,\n )}`,\n )\n }\n }\n }\n\n if (workspaceName) {\n const workspaceToSave = manifest.workspaces.find(\n (workspace) => workspace.name === workspaceName,\n )\n if (!workspaceToSave) {\n spinner.fail(`Workspace ${workspaceName} not found in manifest`)\n throw new Error(`Workspace ${workspaceName} not found in manifest: projectID: ${projectId}`)\n }\n await saveSchema(workspaceToSave)\n } else {\n await Promise.all(\n manifest.workspaces.map(async (workspace): Promise<void> => {\n await saveSchema(workspace)\n }),\n )\n }\n\n spinner.succeed(`Stored ${storedCount}/${manifest.workspaces.length} schemas`)\n return undefined\n } catch (err) {\n spinner.fail('Error storing schemas')\n output.error(err)\n if (flags['schema-required']) {\n throw err\n }\n return err\n }\n}\n"],"names":["storeManifestSchemas","args","context","flags","extOptions","workspaceName","workspace","idPrefix","verbose","output","workDir","apiClient","defaultOutputDir","resolve","join","outputDir","defaultStaticPath","staticPath","path","spinner","start","manifestPath","process","cwd","client","requireUser","requireProject","withConfig","apiVersion","projectId","config","manifest","JSON","parse","readFileSync","error","fail","storedCount","saveSchema","id","name","schema","dataset","transaction","createOrReplace","_type","_id","commit","text","info","stringify","workspaceToSave","workspaces","find","Error","Promise","all","map","succeed","length","err"],"mappings":"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"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "sanity",
|
3
|
-
"version": "3.72.2-server-side-schemas.
|
3
|
+
"version": "3.72.2-server-side-schemas.25+da41197c7d",
|
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.72.2-server-side-schemas.
|
163
|
+
"@sanity/cli": "3.72.2-server-side-schemas.25+da41197c7d",
|
164
164
|
"@sanity/client": "^6.27.2",
|
165
165
|
"@sanity/color": "^3.0.0",
|
166
166
|
"@sanity/comlink": "^3.0.1",
|
167
|
-
"@sanity/diff": "3.72.2-server-side-schemas.
|
167
|
+
"@sanity/diff": "3.72.2-server-side-schemas.25+da41197c7d",
|
168
168
|
"@sanity/diff-match-patch": "^3.1.1",
|
169
169
|
"@sanity/eventsource": "^5.0.0",
|
170
170
|
"@sanity/export": "^3.42.2",
|
@@ -173,15 +173,15 @@
|
|
173
173
|
"@sanity/import": "^3.37.9",
|
174
174
|
"@sanity/insert-menu": "1.0.20",
|
175
175
|
"@sanity/logos": "^2.1.13",
|
176
|
-
"@sanity/migrate": "3.72.2-server-side-schemas.
|
177
|
-
"@sanity/mutator": "3.72.2-server-side-schemas.
|
176
|
+
"@sanity/migrate": "3.72.2-server-side-schemas.25+da41197c7d",
|
177
|
+
"@sanity/mutator": "3.72.2-server-side-schemas.25+da41197c7d",
|
178
178
|
"@sanity/presentation-comlink": "^1.0.4",
|
179
179
|
"@sanity/preview-url-secret": "^2.1.4",
|
180
|
-
"@sanity/schema": "3.72.2-server-side-schemas.
|
180
|
+
"@sanity/schema": "3.72.2-server-side-schemas.25+da41197c7d",
|
181
181
|
"@sanity/telemetry": "^0.7.7",
|
182
|
-
"@sanity/types": "3.72.2-server-side-schemas.
|
182
|
+
"@sanity/types": "3.72.2-server-side-schemas.25+da41197c7d",
|
183
183
|
"@sanity/ui": "^2.11.7",
|
184
|
-
"@sanity/util": "3.72.2-server-side-schemas.
|
184
|
+
"@sanity/util": "3.72.2-server-side-schemas.25+da41197c7d",
|
185
185
|
"@sanity/uuid": "^3.0.2",
|
186
186
|
"@sentry/react": "^8.33.0",
|
187
187
|
"@tanstack/react-table": "^8.16.0",
|
@@ -280,7 +280,7 @@
|
|
280
280
|
"@repo/dev-aliases": "3.72.1",
|
281
281
|
"@repo/package.config": "3.72.1",
|
282
282
|
"@repo/test-config": "3.72.1",
|
283
|
-
"@sanity/codegen": "3.72.2-server-side-schemas.
|
283
|
+
"@sanity/codegen": "3.72.2-server-side-schemas.25+da41197c7d",
|
284
284
|
"@sanity/generate-help-url": "^3.0.0",
|
285
285
|
"@sanity/pkg-utils": "6.13.4",
|
286
286
|
"@sanity/tsdoc": "1.0.169",
|
@@ -324,5 +324,5 @@
|
|
324
324
|
"engines": {
|
325
325
|
"node": ">=18"
|
326
326
|
},
|
327
|
-
"gitHead": "
|
327
|
+
"gitHead": "da41197c7d39511812db0b3fa8948d9a76410397"
|
328
328
|
}
|
@@ -23,6 +23,7 @@ import {
|
|
23
23
|
export interface DeployStudioActionFlags extends BuildSanityStudioCommandFlags {
|
24
24
|
'build'?: boolean
|
25
25
|
'schema-required'?: boolean
|
26
|
+
'verbose'?: boolean
|
26
27
|
}
|
27
28
|
|
28
29
|
export default async function deployStudioAction(
|
@@ -133,6 +134,7 @@ export default async function deployStudioAction(
|
|
133
134
|
extOptions: {
|
134
135
|
'path': `${sourceDir}/static`,
|
135
136
|
'schema-required': flags['schema-required'],
|
137
|
+
'verbose': flags.verbose,
|
136
138
|
},
|
137
139
|
extraArguments: [],
|
138
140
|
}
|
@@ -14,6 +14,7 @@ export interface StoreManifestSchemasFlags {
|
|
14
14
|
'workspace'?: string
|
15
15
|
'id-prefix'?: string
|
16
16
|
'schema-required'?: boolean
|
17
|
+
'verbose'?: boolean
|
17
18
|
}
|
18
19
|
|
19
20
|
export default async function storeManifestSchemas(
|
@@ -23,6 +24,7 @@ export default async function storeManifestSchemas(
|
|
23
24
|
const flags = args.extOptions
|
24
25
|
const workspaceName = flags.workspace
|
25
26
|
const idPrefix = flags['id-prefix']
|
27
|
+
const verbose = flags.verbose
|
26
28
|
const {output, workDir, apiClient} = context
|
27
29
|
|
28
30
|
const defaultOutputDir = resolve(join(workDir, 'dist'))
|
@@ -32,6 +34,8 @@ export default async function storeManifestSchemas(
|
|
32
34
|
|
33
35
|
const staticPath = flags.path ?? defaultStaticPath
|
34
36
|
|
37
|
+
const spinner = output.spinner({}).start('Storing schemas')
|
38
|
+
|
35
39
|
try {
|
36
40
|
const manifestPath = path.resolve(process.cwd(), staticPath)
|
37
41
|
const client = apiClient({
|
@@ -46,16 +50,18 @@ export default async function storeManifestSchemas(
|
|
46
50
|
try {
|
47
51
|
manifest = JSON.parse(readFileSync(`${manifestPath}/create-manifest.json`, 'utf-8'))
|
48
52
|
} catch (error) {
|
49
|
-
|
53
|
+
spinner.fail(`Manifest not found at ${manifestPath}/create-manifest.json`)
|
54
|
+
output.error(error)
|
50
55
|
throw error
|
51
56
|
}
|
52
57
|
|
58
|
+
let storedCount = 0
|
59
|
+
|
53
60
|
const saveSchema = async (workspace: ManifestWorkspaceFile) => {
|
54
|
-
const spinner = output.spinner({}).start('Storing schemas')
|
55
61
|
const id = `${idPrefix || 'sanity.workspace.schema'}.${workspace.name}`
|
56
62
|
try {
|
57
63
|
if (workspace.projectId !== projectId && workspaceName !== workspace.name) {
|
58
|
-
|
64
|
+
output.error(
|
59
65
|
`Mismatch between cli config and manifest projectId in workspace ${workspace.name}: ${projectId} !== ${workspace.projectId}`,
|
60
66
|
)
|
61
67
|
return
|
@@ -71,46 +77,50 @@ export default async function storeManifestSchemas(
|
|
71
77
|
.transaction()
|
72
78
|
.createOrReplace({_type: 'sanity.workspace.schema', _id: id, workspace, schema})
|
73
79
|
.commit()
|
74
|
-
|
80
|
+
storedCount++
|
81
|
+
spinner.text = `Stored ${storedCount} schemas so far...`
|
75
82
|
} catch (error) {
|
76
|
-
|
83
|
+
output.error(`Error storing schema for workspace ${workspace.name}: ${error}`)
|
77
84
|
throw error
|
78
85
|
} finally {
|
79
|
-
|
80
|
-
|
81
|
-
{
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
86
|
+
if (verbose) {
|
87
|
+
spinner.info(
|
88
|
+
`Schema stored: ${JSON.stringify(
|
89
|
+
{
|
90
|
+
id,
|
91
|
+
workspace: workspace.name,
|
92
|
+
projectId: workspace.projectId,
|
93
|
+
dataset: workspace.dataset,
|
94
|
+
},
|
95
|
+
null,
|
96
|
+
2,
|
97
|
+
)}`,
|
98
|
+
)
|
99
|
+
}
|
91
100
|
}
|
92
101
|
}
|
93
|
-
|
102
|
+
|
94
103
|
if (workspaceName) {
|
95
104
|
const workspaceToSave = manifest.workspaces.find(
|
96
105
|
(workspace) => workspace.name === workspaceName,
|
97
106
|
)
|
98
107
|
if (!workspaceToSave) {
|
99
|
-
|
100
|
-
|
101
|
-
`Workspace ${workspaceName} not found in manifest: projectID: ${projectId}`,
|
102
|
-
)
|
108
|
+
spinner.fail(`Workspace ${workspaceName} not found in manifest`)
|
109
|
+
throw new Error(`Workspace ${workspaceName} not found in manifest: projectID: ${projectId}`)
|
103
110
|
}
|
104
111
|
await saveSchema(workspaceToSave)
|
105
|
-
|
112
|
+
} else {
|
113
|
+
await Promise.all(
|
114
|
+
manifest.workspaces.map(async (workspace): Promise<void> => {
|
115
|
+
await saveSchema(workspace)
|
116
|
+
}),
|
117
|
+
)
|
106
118
|
}
|
107
|
-
|
108
|
-
|
109
|
-
await saveSchema(workspace)
|
110
|
-
}),
|
111
|
-
)
|
119
|
+
|
120
|
+
spinner.succeed(`Stored ${storedCount}/${manifest.workspaces.length} schemas`)
|
112
121
|
return undefined
|
113
122
|
} catch (err) {
|
123
|
+
spinner.fail('Error storing schemas')
|
114
124
|
output.error(err)
|
115
125
|
if (flags['schema-required']) {
|
116
126
|
throw err
|
@@ -13,6 +13,7 @@ Options
|
|
13
13
|
--no-minify Skip minifying built JavaScript (speeds up build, increases size of bundle)
|
14
14
|
--no-build Don't build the studio prior to deploy, instead deploying the version currently in \`dist/\`
|
15
15
|
--schema-required Require schema extraction and storing to be successful
|
16
|
+
--verbose Enable verbose logging
|
16
17
|
-y, --yes Unattended mode, answers "yes" to any "yes/no" prompt and otherwise uses defaults
|
17
18
|
|
18
19
|
Examples
|
@@ -11,6 +11,7 @@ Options:
|
|
11
11
|
--workspace The name of the workspace to fetch the stored schema for
|
12
12
|
--path If you are not using the default static file path, you can specify it here.
|
13
13
|
--id-prefix you can specify a custom id prefix for the stored schemas. Useful if you want to store the schema in a different path than the default one.
|
14
|
+
--verbose Enable verbose logging
|
14
15
|
|
15
16
|
Examples
|
16
17
|
# if no options are provided all workspace schemas will be stored
|