@sanity/cli 7.0.2 → 7.1.0
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.
|
@@ -15,7 +15,7 @@ export function getDevServerConfig({ cliConfig, flags, output, workDir }) {
|
|
|
15
15
|
configSpinner.succeed();
|
|
16
16
|
const isApp = cliConfig && 'app' in cliConfig;
|
|
17
17
|
const env = process.env;
|
|
18
|
-
const reactStrictMode = env.SANITY_STUDIO_REACT_STRICT_MODE ? env.SANITY_STUDIO_REACT_STRICT_MODE === 'true' :
|
|
18
|
+
const reactStrictMode = env.SANITY_STUDIO_REACT_STRICT_MODE ? env.SANITY_STUDIO_REACT_STRICT_MODE === 'true' : cliConfig?.reactStrictMode;
|
|
19
19
|
const envBasePath = getSanityEnvVar('BASEPATH', isApp ?? false);
|
|
20
20
|
if (envBasePath && cliConfig?.project?.basePath) {
|
|
21
21
|
output.warn(`Overriding configured base path (${cliConfig.project.basePath}) with value from environment variable (${envBasePath})`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/actions/dev/getDevServerConfig.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {type CliConfig, getSanityEnvVar, type Output} from '@sanity/cli-core'\nimport {spinner} from '@sanity/cli-core/ux'\n\nimport {type DevServerOptions} from '../../server/devServer.js'\nimport {getSharedServerConfig} from '../../util/getSharedServerConfig.js'\nimport {type DevFlags} from './types.js'\n\nexport function getDevServerConfig({\n cliConfig,\n flags,\n output,\n workDir,\n}: {\n cliConfig?: CliConfig\n flags: DevFlags\n output: Output\n workDir: string\n}): Omit<DevServerOptions, 'spinner'> {\n const configSpinner = spinner('Checking configuration files...')\n\n const baseConfig = getSharedServerConfig({\n cliConfig,\n flags: {\n host: flags.host,\n port: flags.port,\n },\n workDir,\n })\n\n configSpinner.succeed()\n\n const isApp = cliConfig && 'app' in cliConfig\n const env = process.env\n const reactStrictMode = env.SANITY_STUDIO_REACT_STRICT_MODE\n ? env.SANITY_STUDIO_REACT_STRICT_MODE === 'true'\n :
|
|
1
|
+
{"version":3,"sources":["../../../src/actions/dev/getDevServerConfig.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {type CliConfig, getSanityEnvVar, type Output} from '@sanity/cli-core'\nimport {spinner} from '@sanity/cli-core/ux'\n\nimport {type DevServerOptions} from '../../server/devServer.js'\nimport {getSharedServerConfig} from '../../util/getSharedServerConfig.js'\nimport {type DevFlags} from './types.js'\n\nexport function getDevServerConfig({\n cliConfig,\n flags,\n output,\n workDir,\n}: {\n cliConfig?: CliConfig\n flags: DevFlags\n output: Output\n workDir: string\n}): Omit<DevServerOptions, 'spinner'> {\n const configSpinner = spinner('Checking configuration files...')\n\n const baseConfig = getSharedServerConfig({\n cliConfig,\n flags: {\n host: flags.host,\n port: flags.port,\n },\n workDir,\n })\n\n configSpinner.succeed()\n\n const isApp = cliConfig && 'app' in cliConfig\n const env = process.env\n const reactStrictMode = env.SANITY_STUDIO_REACT_STRICT_MODE\n ? env.SANITY_STUDIO_REACT_STRICT_MODE === 'true'\n : cliConfig?.reactStrictMode\n\n const envBasePath = getSanityEnvVar('BASEPATH', isApp ?? false)\n if (envBasePath && cliConfig?.project?.basePath) {\n output.warn(\n `Overriding configured base path (${cliConfig.project.basePath}) with value from environment variable (${envBasePath})`,\n )\n }\n\n return {\n ...baseConfig,\n reactCompiler: cliConfig && 'reactCompiler' in cliConfig ? cliConfig.reactCompiler : undefined,\n reactStrictMode,\n staticPath: path.join(workDir, 'static'),\n typegen: cliConfig?.typegen,\n }\n}\n"],"names":["path","getSanityEnvVar","spinner","getSharedServerConfig","getDevServerConfig","cliConfig","flags","output","workDir","configSpinner","baseConfig","host","port","succeed","isApp","env","process","reactStrictMode","SANITY_STUDIO_REACT_STRICT_MODE","envBasePath","project","basePath","warn","reactCompiler","undefined","staticPath","join","typegen"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAE5B,SAAwBC,eAAe,QAAoB,mBAAkB;AAC7E,SAAQC,OAAO,QAAO,sBAAqB;AAG3C,SAAQC,qBAAqB,QAAO,sCAAqC;AAGzE,OAAO,SAASC,mBAAmB,EACjCC,SAAS,EACTC,KAAK,EACLC,MAAM,EACNC,OAAO,EAMR;IACC,MAAMC,gBAAgBP,QAAQ;IAE9B,MAAMQ,aAAaP,sBAAsB;QACvCE;QACAC,OAAO;YACLK,MAAML,MAAMK,IAAI;YAChBC,MAAMN,MAAMM,IAAI;QAClB;QACAJ;IACF;IAEAC,cAAcI,OAAO;IAErB,MAAMC,QAAQT,aAAa,SAASA;IACpC,MAAMU,MAAMC,QAAQD,GAAG;IACvB,MAAME,kBAAkBF,IAAIG,+BAA+B,GACvDH,IAAIG,+BAA+B,KAAK,SACxCb,WAAWY;IAEf,MAAME,cAAclB,gBAAgB,YAAYa,SAAS;IACzD,IAAIK,eAAed,WAAWe,SAASC,UAAU;QAC/Cd,OAAOe,IAAI,CACT,CAAC,iCAAiC,EAAEjB,UAAUe,OAAO,CAACC,QAAQ,CAAC,wCAAwC,EAAEF,YAAY,CAAC,CAAC;IAE3H;IAEA,OAAO;QACL,GAAGT,UAAU;QACba,eAAelB,aAAa,mBAAmBA,YAAYA,UAAUkB,aAAa,GAAGC;QACrFP;QACAQ,YAAYzB,KAAK0B,IAAI,CAAClB,SAAS;QAC/BmB,SAAStB,WAAWsB;IACtB;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/devServer.ts"],"sourcesContent":["import {\n extendViteConfigWithUserConfig,\n getViteConfig,\n writeSanityRuntime,\n} from '@sanity/cli-build/_internal/build'\nimport {CliConfig, getCliTelemetry, type UserViteConfig} from '@sanity/cli-core'\nimport {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {type FSWatcher} from 'chokidar'\nimport {createServer, type InlineConfig, type ViteDevServer} from 'vite'\n\nimport {\n getAppEnvironmentVariables,\n getStudioEnvironmentVariables,\n} from '../actions/build/getEnvironmentVariables.js'\nimport {serverDebug} from './serverDebug.js'\nimport {sanityTypegenPlugin} from './vite/plugin-typegen.js'\n\nconst debug = serverDebug.extend('dev')\n\nexport interface DevServerOptions {\n basePath: string\n cwd: string\n httpPort: number\n\n reactCompiler: ReactCompilerConfig | undefined\n reactStrictMode: boolean\n\n staticPath: string\n\n appTitle?: string\n entry?: string\n httpHost?: string\n isApp?: boolean\n projectName?: string\n schemaExtraction?: CliConfig['schemaExtraction']\n typegen?: CliConfig['typegen']\n vite?: UserViteConfig\n}\n\ninterface DevServer {\n close(): Promise<void>\n server: ViteDevServer\n\n watcher?: FSWatcher\n}\n\nexport async function startDevServer(options: DevServerOptions): Promise<DevServer> {\n const {\n appTitle,\n basePath,\n cwd,\n entry,\n httpHost,\n httpPort,\n isApp,\n reactCompiler,\n reactStrictMode,\n schemaExtraction,\n typegen,\n vite: extendViteConfig,\n } = options\n\n debug('Writing Sanity runtime files')\n const watcher = await writeSanityRuntime({\n appTitle,\n basePath,\n cwd,\n entry,\n isApp,\n reactStrictMode,\n watch: true,\n })\n\n debug('Resolving vite config')\n const mode = 'development'\n\n function getEnvironmentVariables() {\n return isApp\n ? getAppEnvironmentVariables({jsonEncode: true, prefix: 'process.env.'})\n : getStudioEnvironmentVariables({jsonEncode: true, prefix: 'process.env.'})\n }\n\n let viteConfig: InlineConfig = await getViteConfig({\n additionalPlugins: [\n // Add typegen when enabled\n ...(typegen?.enabled\n ? [\n sanityTypegenPlugin({\n config: typegen,\n telemetryLogger: getCliTelemetry(),\n workDir: cwd,\n }),\n ]\n : []),\n ],\n basePath,\n cwd,\n getEnvironmentVariables,\n isApp,\n mode: 'development',\n reactCompiler,\n schemaExtraction,\n server: {host: httpHost, port: httpPort},\n })\n\n // Extend Vite configuration with user-provided config\n if (extendViteConfig) {\n viteConfig = await extendViteConfigWithUserConfig(\n {command: 'serve', mode},\n viteConfig,\n extendViteConfig,\n )\n }\n\n debug('Creating vite server')\n const server = await createServer(viteConfig)\n\n debug('Listening on specified port')\n await server.listen()\n\n return {\n close: async () => {\n if (watcher) {\n await watcher.close()\n }\n await server.close()\n },\n server,\n watcher,\n }\n}\n"],"names":["extendViteConfigWithUserConfig","getViteConfig","writeSanityRuntime","getCliTelemetry","createServer","getAppEnvironmentVariables","getStudioEnvironmentVariables","serverDebug","sanityTypegenPlugin","debug","extend","startDevServer","options","appTitle","basePath","cwd","entry","httpHost","httpPort","isApp","reactCompiler","reactStrictMode","schemaExtraction","typegen","vite","extendViteConfig","watcher","watch","mode","getEnvironmentVariables","jsonEncode","prefix","viteConfig","additionalPlugins","enabled","config","telemetryLogger","workDir","server","host","port","command","listen","close"],"mappings":"AAAA,SACEA,8BAA8B,EAC9BC,aAAa,EACbC,kBAAkB,QACb,oCAAmC;AAC1C,SAAmBC,eAAe,QAA4B,mBAAkB;AAGhF,SAAQC,YAAY,QAA8C,OAAM;AAExE,SACEC,0BAA0B,EAC1BC,6BAA6B,QACxB,8CAA6C;AACpD,SAAQC,WAAW,QAAO,mBAAkB;AAC5C,SAAQC,mBAAmB,QAAO,2BAA0B;AAE5D,MAAMC,QAAQF,YAAYG,MAAM,CAAC;AA6BjC,OAAO,eAAeC,eAAeC,OAAyB;IAC5D,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACRC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,OAAO,EACPC,MAAMC,gBAAgB,EACvB,GAAGb;IAEJH,MAAM;IACN,MAAMiB,UAAU,MAAMxB,mBAAmB;QACvCW;QACAC;QACAC;QACAC;QACAG;QACAE;QACAM,OAAO;IACT;IAEAlB,MAAM;IACN,MAAMmB,OAAO;IAEb,SAASC;QACP,OAAOV,QACHd,2BAA2B;YAACyB,YAAY;YAAMC,QAAQ;QAAc,KACpEzB,8BAA8B;YAACwB,YAAY;YAAMC,QAAQ;QAAc;IAC7E;IAEA,IAAIC,aAA2B,MAAM/B,cAAc;QACjDgC,mBAAmB;YACjB,2BAA2B;eACvBV,SAASW,UACT;gBACE1B,oBAAoB;oBAClB2B,QAAQZ;oBACRa,iBAAiBjC;oBACjBkC,SAAStB;gBACX;aACD,GACD,EAAE;SACP;QACDD;QACAC;QACAc;QACAV;QACAS,MAAM;QACNR;QACAE;QACAgB,QAAQ;YAACC,MAAMtB;YAAUuB,MAAMtB;QAAQ;IACzC;IAEA,sDAAsD;IACtD,IAAIO,kBAAkB;QACpBO,aAAa,MAAMhC,+BACjB;YAACyC,SAAS;YAASb;QAAI,GACvBI,YACAP;IAEJ;IAEAhB,MAAM;IACN,MAAM6B,SAAS,MAAMlC,aAAa4B;IAElCvB,MAAM;IACN,MAAM6B,OAAOI,MAAM;IAEnB,OAAO;QACLC,OAAO;YACL,IAAIjB,SAAS;gBACX,MAAMA,QAAQiB,KAAK;YACrB;YACA,MAAML,OAAOK,KAAK;QACpB;QACAL;QACAZ;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/server/devServer.ts"],"sourcesContent":["import {\n extendViteConfigWithUserConfig,\n getViteConfig,\n writeSanityRuntime,\n} from '@sanity/cli-build/_internal/build'\nimport {CliConfig, getCliTelemetry, type UserViteConfig} from '@sanity/cli-core'\nimport {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {type FSWatcher} from 'chokidar'\nimport {createServer, type InlineConfig, type ViteDevServer} from 'vite'\n\nimport {\n getAppEnvironmentVariables,\n getStudioEnvironmentVariables,\n} from '../actions/build/getEnvironmentVariables.js'\nimport {serverDebug} from './serverDebug.js'\nimport {sanityTypegenPlugin} from './vite/plugin-typegen.js'\n\nconst debug = serverDebug.extend('dev')\n\nexport interface DevServerOptions {\n basePath: string\n cwd: string\n httpPort: number\n\n reactCompiler: ReactCompilerConfig | undefined\n reactStrictMode: boolean | undefined\n\n staticPath: string\n\n appTitle?: string\n entry?: string\n httpHost?: string\n isApp?: boolean\n projectName?: string\n schemaExtraction?: CliConfig['schemaExtraction']\n typegen?: CliConfig['typegen']\n vite?: UserViteConfig\n}\n\ninterface DevServer {\n close(): Promise<void>\n server: ViteDevServer\n\n watcher?: FSWatcher\n}\n\nexport async function startDevServer(options: DevServerOptions): Promise<DevServer> {\n const {\n appTitle,\n basePath,\n cwd,\n entry,\n httpHost,\n httpPort,\n isApp,\n reactCompiler,\n reactStrictMode,\n schemaExtraction,\n typegen,\n vite: extendViteConfig,\n } = options\n\n debug('Writing Sanity runtime files')\n const watcher = await writeSanityRuntime({\n appTitle,\n basePath,\n cwd,\n entry,\n isApp,\n reactStrictMode,\n watch: true,\n })\n\n debug('Resolving vite config')\n const mode = 'development'\n\n function getEnvironmentVariables() {\n return isApp\n ? getAppEnvironmentVariables({jsonEncode: true, prefix: 'process.env.'})\n : getStudioEnvironmentVariables({jsonEncode: true, prefix: 'process.env.'})\n }\n\n let viteConfig: InlineConfig = await getViteConfig({\n additionalPlugins: [\n // Add typegen when enabled\n ...(typegen?.enabled\n ? [\n sanityTypegenPlugin({\n config: typegen,\n telemetryLogger: getCliTelemetry(),\n workDir: cwd,\n }),\n ]\n : []),\n ],\n basePath,\n cwd,\n getEnvironmentVariables,\n isApp,\n mode: 'development',\n reactCompiler,\n schemaExtraction,\n server: {host: httpHost, port: httpPort},\n })\n\n // Extend Vite configuration with user-provided config\n if (extendViteConfig) {\n viteConfig = await extendViteConfigWithUserConfig(\n {command: 'serve', mode},\n viteConfig,\n extendViteConfig,\n )\n }\n\n debug('Creating vite server')\n const server = await createServer(viteConfig)\n\n debug('Listening on specified port')\n await server.listen()\n\n return {\n close: async () => {\n if (watcher) {\n await watcher.close()\n }\n await server.close()\n },\n server,\n watcher,\n }\n}\n"],"names":["extendViteConfigWithUserConfig","getViteConfig","writeSanityRuntime","getCliTelemetry","createServer","getAppEnvironmentVariables","getStudioEnvironmentVariables","serverDebug","sanityTypegenPlugin","debug","extend","startDevServer","options","appTitle","basePath","cwd","entry","httpHost","httpPort","isApp","reactCompiler","reactStrictMode","schemaExtraction","typegen","vite","extendViteConfig","watcher","watch","mode","getEnvironmentVariables","jsonEncode","prefix","viteConfig","additionalPlugins","enabled","config","telemetryLogger","workDir","server","host","port","command","listen","close"],"mappings":"AAAA,SACEA,8BAA8B,EAC9BC,aAAa,EACbC,kBAAkB,QACb,oCAAmC;AAC1C,SAAmBC,eAAe,QAA4B,mBAAkB;AAGhF,SAAQC,YAAY,QAA8C,OAAM;AAExE,SACEC,0BAA0B,EAC1BC,6BAA6B,QACxB,8CAA6C;AACpD,SAAQC,WAAW,QAAO,mBAAkB;AAC5C,SAAQC,mBAAmB,QAAO,2BAA0B;AAE5D,MAAMC,QAAQF,YAAYG,MAAM,CAAC;AA6BjC,OAAO,eAAeC,eAAeC,OAAyB;IAC5D,MAAM,EACJC,QAAQ,EACRC,QAAQ,EACRC,GAAG,EACHC,KAAK,EACLC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,aAAa,EACbC,eAAe,EACfC,gBAAgB,EAChBC,OAAO,EACPC,MAAMC,gBAAgB,EACvB,GAAGb;IAEJH,MAAM;IACN,MAAMiB,UAAU,MAAMxB,mBAAmB;QACvCW;QACAC;QACAC;QACAC;QACAG;QACAE;QACAM,OAAO;IACT;IAEAlB,MAAM;IACN,MAAMmB,OAAO;IAEb,SAASC;QACP,OAAOV,QACHd,2BAA2B;YAACyB,YAAY;YAAMC,QAAQ;QAAc,KACpEzB,8BAA8B;YAACwB,YAAY;YAAMC,QAAQ;QAAc;IAC7E;IAEA,IAAIC,aAA2B,MAAM/B,cAAc;QACjDgC,mBAAmB;YACjB,2BAA2B;eACvBV,SAASW,UACT;gBACE1B,oBAAoB;oBAClB2B,QAAQZ;oBACRa,iBAAiBjC;oBACjBkC,SAAStB;gBACX;aACD,GACD,EAAE;SACP;QACDD;QACAC;QACAc;QACAV;QACAS,MAAM;QACNR;QACAE;QACAgB,QAAQ;YAACC,MAAMtB;YAAUuB,MAAMtB;QAAQ;IACzC;IAEA,sDAAsD;IACtD,IAAIO,kBAAkB;QACpBO,aAAa,MAAMhC,+BACjB;YAACyC,SAAS;YAASb;QAAI,GACvBI,YACAP;IAEJ;IAEAhB,MAAM;IACN,MAAM6B,SAAS,MAAMlC,aAAa4B;IAElCvB,MAAM;IACN,MAAM6B,OAAOI,MAAM;IAEnB,OAAO;QACLC,OAAO;YACL,IAAIjB,SAAS;gBACX,MAAMA,QAAQiB,KAAK;YACrB;YACA,MAAML,OAAOK,KAAK;QACpB;QACAL;QACAZ;IACF;AACF"}
|
package/oclif.manifest.json
CHANGED
|
@@ -1292,69 +1292,107 @@
|
|
|
1292
1292
|
"list.js"
|
|
1293
1293
|
]
|
|
1294
1294
|
},
|
|
1295
|
-
"
|
|
1295
|
+
"cors:add": {
|
|
1296
1296
|
"aliases": [],
|
|
1297
|
-
"args": {
|
|
1298
|
-
|
|
1299
|
-
|
|
1297
|
+
"args": {
|
|
1298
|
+
"origin": {
|
|
1299
|
+
"description": "Origin to allow (e.g., https://example.com)",
|
|
1300
|
+
"name": "origin",
|
|
1301
|
+
"required": true
|
|
1302
|
+
}
|
|
1303
|
+
},
|
|
1304
|
+
"description": "Add a CORS origin to the project",
|
|
1305
|
+
"examples": [
|
|
1306
|
+
{
|
|
1307
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
1308
|
+
"description": "Interactively add a CORS origin"
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
"command": "<%= config.bin %> <%= command.id %> http://localhost:3000 --no-credentials",
|
|
1312
|
+
"description": "Add a localhost origin without credentials"
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
"command": "<%= config.bin %> <%= command.id %> https://myapp.com --credentials",
|
|
1316
|
+
"description": "Add a production origin with credentials allowed"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"command": "<%= config.bin %> <%= command.id %> https://myapp.com --project-id abc123",
|
|
1320
|
+
"description": "Add a CORS origin for a specific project"
|
|
1321
|
+
}
|
|
1322
|
+
],
|
|
1323
|
+
"flags": {
|
|
1324
|
+
"project-id": {
|
|
1325
|
+
"char": "p",
|
|
1326
|
+
"description": "Project ID to add CORS origin to (overrides CLI configuration)",
|
|
1327
|
+
"helpGroup": "OVERRIDE",
|
|
1328
|
+
"name": "project-id",
|
|
1329
|
+
"hasDynamicHelp": false,
|
|
1330
|
+
"helpValue": "<id>",
|
|
1331
|
+
"multiple": false,
|
|
1332
|
+
"type": "option"
|
|
1333
|
+
},
|
|
1334
|
+
"credentials": {
|
|
1335
|
+
"description": "Allow credentials (token/cookie) to be sent from this origin",
|
|
1336
|
+
"name": "credentials",
|
|
1337
|
+
"required": false,
|
|
1338
|
+
"allowNo": true,
|
|
1339
|
+
"type": "boolean"
|
|
1340
|
+
}
|
|
1341
|
+
},
|
|
1300
1342
|
"hasDynamicHelp": false,
|
|
1301
1343
|
"hiddenAliases": [],
|
|
1302
|
-
"id": "
|
|
1344
|
+
"id": "cors:add",
|
|
1303
1345
|
"pluginAlias": "@sanity/cli",
|
|
1304
1346
|
"pluginName": "@sanity/cli",
|
|
1305
1347
|
"pluginType": "core",
|
|
1306
1348
|
"strict": true,
|
|
1307
|
-
"enableJsonFlag": false,
|
|
1308
1349
|
"isESM": true,
|
|
1309
1350
|
"relativePath": [
|
|
1310
1351
|
"dist",
|
|
1311
1352
|
"commands",
|
|
1312
|
-
"
|
|
1313
|
-
"
|
|
1353
|
+
"cors",
|
|
1354
|
+
"add.js"
|
|
1314
1355
|
]
|
|
1315
1356
|
},
|
|
1316
|
-
"
|
|
1357
|
+
"cors:delete": {
|
|
1317
1358
|
"aliases": [],
|
|
1318
1359
|
"args": {
|
|
1319
|
-
"
|
|
1320
|
-
"description": "
|
|
1321
|
-
"name": "
|
|
1322
|
-
"required":
|
|
1360
|
+
"origin": {
|
|
1361
|
+
"description": "Origin to delete (will prompt if not provided)",
|
|
1362
|
+
"name": "origin",
|
|
1363
|
+
"required": false
|
|
1323
1364
|
}
|
|
1324
1365
|
},
|
|
1325
|
-
"description": "
|
|
1366
|
+
"description": "Delete a CORS origin from the project",
|
|
1326
1367
|
"examples": [
|
|
1327
1368
|
{
|
|
1328
|
-
"command": "<%= config.bin %> <%= command.id %>
|
|
1329
|
-
"description": "
|
|
1330
|
-
},
|
|
1331
|
-
{
|
|
1332
|
-
"command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
|
|
1333
|
-
"description": "Read using full URL"
|
|
1369
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
1370
|
+
"description": "Interactively select and delete a CORS origin"
|
|
1334
1371
|
},
|
|
1335
1372
|
{
|
|
1336
|
-
"command": "<%= config.bin %> <%= command.id %>
|
|
1337
|
-
"description": "
|
|
1373
|
+
"command": "<%= config.bin %> <%= command.id %> https://example.com",
|
|
1374
|
+
"description": "Delete a specific CORS origin"
|
|
1338
1375
|
},
|
|
1339
1376
|
{
|
|
1340
|
-
"command": "<%= config.bin %> <%= command.id %>
|
|
1341
|
-
"description": "
|
|
1377
|
+
"command": "<%= config.bin %> <%= command.id %> --project-id abc123",
|
|
1378
|
+
"description": "Delete a CORS origin from a specific project"
|
|
1342
1379
|
}
|
|
1343
1380
|
],
|
|
1344
1381
|
"flags": {
|
|
1345
|
-
"
|
|
1346
|
-
"
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
"
|
|
1350
|
-
"
|
|
1351
|
-
"
|
|
1352
|
-
"
|
|
1382
|
+
"project-id": {
|
|
1383
|
+
"char": "p",
|
|
1384
|
+
"description": "Project ID to delete CORS origin from (overrides CLI configuration)",
|
|
1385
|
+
"helpGroup": "OVERRIDE",
|
|
1386
|
+
"name": "project-id",
|
|
1387
|
+
"hasDynamicHelp": false,
|
|
1388
|
+
"helpValue": "<id>",
|
|
1389
|
+
"multiple": false,
|
|
1390
|
+
"type": "option"
|
|
1353
1391
|
}
|
|
1354
1392
|
},
|
|
1355
1393
|
"hasDynamicHelp": false,
|
|
1356
1394
|
"hiddenAliases": [],
|
|
1357
|
-
"id": "
|
|
1395
|
+
"id": "cors:delete",
|
|
1358
1396
|
"pluginAlias": "@sanity/cli",
|
|
1359
1397
|
"pluginName": "@sanity/cli",
|
|
1360
1398
|
"pluginType": "core",
|
|
@@ -1363,47 +1401,39 @@
|
|
|
1363
1401
|
"relativePath": [
|
|
1364
1402
|
"dist",
|
|
1365
1403
|
"commands",
|
|
1366
|
-
"
|
|
1367
|
-
"
|
|
1404
|
+
"cors",
|
|
1405
|
+
"delete.js"
|
|
1368
1406
|
]
|
|
1369
1407
|
},
|
|
1370
|
-
"
|
|
1408
|
+
"cors:list": {
|
|
1371
1409
|
"aliases": [],
|
|
1372
|
-
"args": {
|
|
1373
|
-
|
|
1374
|
-
"description": "Search query for documentation",
|
|
1375
|
-
"name": "query",
|
|
1376
|
-
"required": true
|
|
1377
|
-
}
|
|
1378
|
-
},
|
|
1379
|
-
"description": "Search Sanity docs",
|
|
1410
|
+
"args": {},
|
|
1411
|
+
"description": "List CORS origins for the project",
|
|
1380
1412
|
"examples": [
|
|
1381
1413
|
{
|
|
1382
|
-
"command": "<%= config.bin %> <%= command.id %>
|
|
1383
|
-
"description": "
|
|
1384
|
-
},
|
|
1385
|
-
{
|
|
1386
|
-
"command": "<%= config.bin %> <%= command.id %> \"groq functions\"",
|
|
1387
|
-
"description": "Search with phrase"
|
|
1414
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
1415
|
+
"description": "List CORS origins for the project"
|
|
1388
1416
|
},
|
|
1389
1417
|
{
|
|
1390
|
-
"command": "<%= config.bin %> <%= command.id %>
|
|
1391
|
-
"description": "
|
|
1418
|
+
"command": "<%= config.bin %> <%= command.id %> --project-id abc123",
|
|
1419
|
+
"description": "List CORS origins for a specific project"
|
|
1392
1420
|
}
|
|
1393
1421
|
],
|
|
1394
1422
|
"flags": {
|
|
1395
|
-
"
|
|
1396
|
-
"
|
|
1397
|
-
"
|
|
1398
|
-
"
|
|
1423
|
+
"project-id": {
|
|
1424
|
+
"char": "p",
|
|
1425
|
+
"description": "Project ID to list CORS origins for (overrides CLI configuration)",
|
|
1426
|
+
"helpGroup": "OVERRIDE",
|
|
1427
|
+
"name": "project-id",
|
|
1399
1428
|
"hasDynamicHelp": false,
|
|
1429
|
+
"helpValue": "<id>",
|
|
1400
1430
|
"multiple": false,
|
|
1401
1431
|
"type": "option"
|
|
1402
1432
|
}
|
|
1403
1433
|
},
|
|
1404
1434
|
"hasDynamicHelp": false,
|
|
1405
1435
|
"hiddenAliases": [],
|
|
1406
|
-
"id": "
|
|
1436
|
+
"id": "cors:list",
|
|
1407
1437
|
"pluginAlias": "@sanity/cli",
|
|
1408
1438
|
"pluginName": "@sanity/cli",
|
|
1409
1439
|
"pluginType": "core",
|
|
@@ -1412,8 +1442,8 @@
|
|
|
1412
1442
|
"relativePath": [
|
|
1413
1443
|
"dist",
|
|
1414
1444
|
"commands",
|
|
1415
|
-
"
|
|
1416
|
-
"
|
|
1445
|
+
"cors",
|
|
1446
|
+
"list.js"
|
|
1417
1447
|
]
|
|
1418
1448
|
},
|
|
1419
1449
|
"datasets:copy": {
|
|
@@ -2039,107 +2069,69 @@
|
|
|
2039
2069
|
"list.js"
|
|
2040
2070
|
]
|
|
2041
2071
|
},
|
|
2042
|
-
"
|
|
2072
|
+
"docs:browse": {
|
|
2043
2073
|
"aliases": [],
|
|
2044
|
-
"args": {
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
"name": "origin",
|
|
2048
|
-
"required": true
|
|
2049
|
-
}
|
|
2050
|
-
},
|
|
2051
|
-
"description": "Add a CORS origin to the project",
|
|
2052
|
-
"examples": [
|
|
2053
|
-
{
|
|
2054
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
2055
|
-
"description": "Interactively add a CORS origin"
|
|
2056
|
-
},
|
|
2057
|
-
{
|
|
2058
|
-
"command": "<%= config.bin %> <%= command.id %> http://localhost:3000 --no-credentials",
|
|
2059
|
-
"description": "Add a localhost origin without credentials"
|
|
2060
|
-
},
|
|
2061
|
-
{
|
|
2062
|
-
"command": "<%= config.bin %> <%= command.id %> https://myapp.com --credentials",
|
|
2063
|
-
"description": "Add a production origin with credentials allowed"
|
|
2064
|
-
},
|
|
2065
|
-
{
|
|
2066
|
-
"command": "<%= config.bin %> <%= command.id %> https://myapp.com --project-id abc123",
|
|
2067
|
-
"description": "Add a CORS origin for a specific project"
|
|
2068
|
-
}
|
|
2069
|
-
],
|
|
2070
|
-
"flags": {
|
|
2071
|
-
"project-id": {
|
|
2072
|
-
"char": "p",
|
|
2073
|
-
"description": "Project ID to add CORS origin to (overrides CLI configuration)",
|
|
2074
|
-
"helpGroup": "OVERRIDE",
|
|
2075
|
-
"name": "project-id",
|
|
2076
|
-
"hasDynamicHelp": false,
|
|
2077
|
-
"helpValue": "<id>",
|
|
2078
|
-
"multiple": false,
|
|
2079
|
-
"type": "option"
|
|
2080
|
-
},
|
|
2081
|
-
"credentials": {
|
|
2082
|
-
"description": "Allow credentials (token/cookie) to be sent from this origin",
|
|
2083
|
-
"name": "credentials",
|
|
2084
|
-
"required": false,
|
|
2085
|
-
"allowNo": true,
|
|
2086
|
-
"type": "boolean"
|
|
2087
|
-
}
|
|
2088
|
-
},
|
|
2074
|
+
"args": {},
|
|
2075
|
+
"description": "Open Sanity docs in your browser",
|
|
2076
|
+
"flags": {},
|
|
2089
2077
|
"hasDynamicHelp": false,
|
|
2090
2078
|
"hiddenAliases": [],
|
|
2091
|
-
"id": "
|
|
2079
|
+
"id": "docs:browse",
|
|
2092
2080
|
"pluginAlias": "@sanity/cli",
|
|
2093
2081
|
"pluginName": "@sanity/cli",
|
|
2094
2082
|
"pluginType": "core",
|
|
2095
2083
|
"strict": true,
|
|
2084
|
+
"enableJsonFlag": false,
|
|
2096
2085
|
"isESM": true,
|
|
2097
2086
|
"relativePath": [
|
|
2098
2087
|
"dist",
|
|
2099
2088
|
"commands",
|
|
2100
|
-
"
|
|
2101
|
-
"
|
|
2089
|
+
"docs",
|
|
2090
|
+
"browse.js"
|
|
2102
2091
|
]
|
|
2103
2092
|
},
|
|
2104
|
-
"
|
|
2093
|
+
"docs:read": {
|
|
2105
2094
|
"aliases": [],
|
|
2106
2095
|
"args": {
|
|
2107
|
-
"
|
|
2108
|
-
"description": "
|
|
2109
|
-
"name": "
|
|
2110
|
-
"required":
|
|
2096
|
+
"path": {
|
|
2097
|
+
"description": "Path or URL to article, found in search results and docs content as links",
|
|
2098
|
+
"name": "path",
|
|
2099
|
+
"required": true
|
|
2111
2100
|
}
|
|
2112
2101
|
},
|
|
2113
|
-
"description": "
|
|
2102
|
+
"description": "Read an article in terminal",
|
|
2114
2103
|
"examples": [
|
|
2115
2104
|
{
|
|
2116
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
2117
|
-
"description": "
|
|
2105
|
+
"command": "<%= config.bin %> <%= command.id %> /docs/studio/installation",
|
|
2106
|
+
"description": "Read as markdown in terminal"
|
|
2118
2107
|
},
|
|
2119
2108
|
{
|
|
2120
|
-
"command": "<%= config.bin %> <%= command.id %> https://
|
|
2121
|
-
"description": "
|
|
2109
|
+
"command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation",
|
|
2110
|
+
"description": "Read using full URL"
|
|
2122
2111
|
},
|
|
2123
2112
|
{
|
|
2124
|
-
"command": "<%= config.bin %> <%= command.id %> --
|
|
2125
|
-
"description": "
|
|
2113
|
+
"command": "<%= config.bin %> <%= command.id %> /docs/studio/installation --web",
|
|
2114
|
+
"description": "Open in web browser"
|
|
2115
|
+
},
|
|
2116
|
+
{
|
|
2117
|
+
"command": "<%= config.bin %> <%= command.id %> https://www.sanity.io/docs/studio/installation -w",
|
|
2118
|
+
"description": "Open using full URL in web browser"
|
|
2126
2119
|
}
|
|
2127
2120
|
],
|
|
2128
2121
|
"flags": {
|
|
2129
|
-
"
|
|
2130
|
-
"
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
"
|
|
2134
|
-
"
|
|
2135
|
-
"
|
|
2136
|
-
"
|
|
2137
|
-
"type": "option"
|
|
2122
|
+
"web": {
|
|
2123
|
+
"aliases": [
|
|
2124
|
+
"w"
|
|
2125
|
+
],
|
|
2126
|
+
"description": "Open in a web browser",
|
|
2127
|
+
"name": "web",
|
|
2128
|
+
"allowNo": false,
|
|
2129
|
+
"type": "boolean"
|
|
2138
2130
|
}
|
|
2139
2131
|
},
|
|
2140
2132
|
"hasDynamicHelp": false,
|
|
2141
2133
|
"hiddenAliases": [],
|
|
2142
|
-
"id": "
|
|
2134
|
+
"id": "docs:read",
|
|
2143
2135
|
"pluginAlias": "@sanity/cli",
|
|
2144
2136
|
"pluginName": "@sanity/cli",
|
|
2145
2137
|
"pluginType": "core",
|
|
@@ -2148,39 +2140,47 @@
|
|
|
2148
2140
|
"relativePath": [
|
|
2149
2141
|
"dist",
|
|
2150
2142
|
"commands",
|
|
2151
|
-
"
|
|
2152
|
-
"
|
|
2143
|
+
"docs",
|
|
2144
|
+
"read.js"
|
|
2153
2145
|
]
|
|
2154
2146
|
},
|
|
2155
|
-
"
|
|
2147
|
+
"docs:search": {
|
|
2156
2148
|
"aliases": [],
|
|
2157
|
-
"args": {
|
|
2158
|
-
|
|
2149
|
+
"args": {
|
|
2150
|
+
"query": {
|
|
2151
|
+
"description": "Search query for documentation",
|
|
2152
|
+
"name": "query",
|
|
2153
|
+
"required": true
|
|
2154
|
+
}
|
|
2155
|
+
},
|
|
2156
|
+
"description": "Search Sanity docs",
|
|
2159
2157
|
"examples": [
|
|
2160
2158
|
{
|
|
2161
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
2162
|
-
"description": "
|
|
2159
|
+
"command": "<%= config.bin %> <%= command.id %> schema",
|
|
2160
|
+
"description": "Search for documentation about schemas"
|
|
2163
2161
|
},
|
|
2164
2162
|
{
|
|
2165
|
-
"command": "<%= config.bin %> <%= command.id %>
|
|
2166
|
-
"description": "
|
|
2163
|
+
"command": "<%= config.bin %> <%= command.id %> \"groq functions\"",
|
|
2164
|
+
"description": "Search with phrase"
|
|
2165
|
+
},
|
|
2166
|
+
{
|
|
2167
|
+
"command": "<%= config.bin %> <%= command.id %> \"deployment\" --limit=5",
|
|
2168
|
+
"description": "Limit search results"
|
|
2167
2169
|
}
|
|
2168
2170
|
],
|
|
2169
2171
|
"flags": {
|
|
2170
|
-
"
|
|
2171
|
-
"
|
|
2172
|
-
"
|
|
2173
|
-
"
|
|
2174
|
-
"name": "project-id",
|
|
2172
|
+
"limit": {
|
|
2173
|
+
"description": "Maximum number of results to return",
|
|
2174
|
+
"name": "limit",
|
|
2175
|
+
"default": 10,
|
|
2175
2176
|
"hasDynamicHelp": false,
|
|
2176
|
-
"helpValue": "<id>",
|
|
2177
2177
|
"multiple": false,
|
|
2178
2178
|
"type": "option"
|
|
2179
2179
|
}
|
|
2180
2180
|
},
|
|
2181
2181
|
"hasDynamicHelp": false,
|
|
2182
2182
|
"hiddenAliases": [],
|
|
2183
|
-
"id": "
|
|
2183
|
+
"id": "docs:search",
|
|
2184
2184
|
"pluginAlias": "@sanity/cli",
|
|
2185
2185
|
"pluginName": "@sanity/cli",
|
|
2186
2186
|
"pluginType": "core",
|
|
@@ -2189,8 +2189,8 @@
|
|
|
2189
2189
|
"relativePath": [
|
|
2190
2190
|
"dist",
|
|
2191
2191
|
"commands",
|
|
2192
|
-
"
|
|
2193
|
-
"
|
|
2192
|
+
"docs",
|
|
2193
|
+
"search.js"
|
|
2194
2194
|
]
|
|
2195
2195
|
},
|
|
2196
2196
|
"documents:create": {
|
|
@@ -5116,5 +5116,5 @@
|
|
|
5116
5116
|
]
|
|
5117
5117
|
}
|
|
5118
5118
|
},
|
|
5119
|
-
"version": "7.0
|
|
5119
|
+
"version": "7.1.0"
|
|
5120
5120
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Sanity CLI tool for managing Sanity projects and organizations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -148,10 +148,10 @@
|
|
|
148
148
|
"sanity": "^5.30.0",
|
|
149
149
|
"typescript": "^5.9.3",
|
|
150
150
|
"vitest": "^4.1.8",
|
|
151
|
-
"@sanity/cli-test": "1.0.1",
|
|
152
151
|
"@repo/tsconfig": "3.70.0",
|
|
153
|
-
"@sanity/
|
|
154
|
-
"@repo/package.config": "0.0.1"
|
|
152
|
+
"@sanity/cli-test": "1.0.1",
|
|
153
|
+
"@repo/package.config": "0.0.1",
|
|
154
|
+
"@sanity/eslint-config-cli": "1.1.2"
|
|
155
155
|
},
|
|
156
156
|
"peerDependencies": {
|
|
157
157
|
"babel-plugin-react-compiler": "*"
|