@sanity/cli 6.0.0-alpha.13 → 6.0.0-alpha.15
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/README.md +113 -102
- package/dist/actions/build/buildApp.js +4 -3
- package/dist/actions/build/buildApp.js.map +1 -1
- package/dist/actions/build/buildStaticFiles.js +3 -2
- package/dist/actions/build/buildStaticFiles.js.map +1 -1
- package/dist/actions/build/buildStudio.js +1 -0
- package/dist/actions/build/buildStudio.js.map +1 -1
- package/dist/actions/build/buildVendorDependencies.js +15 -36
- package/dist/actions/build/buildVendorDependencies.js.map +1 -1
- package/dist/actions/build/checkRequiredDependencies.js +7 -5
- package/dist/actions/build/checkRequiredDependencies.js.map +1 -1
- package/dist/actions/build/checkStudioDependencyVersions.js +6 -6
- package/dist/actions/build/checkStudioDependencyVersions.js.map +1 -1
- package/dist/actions/deploy/deployApp.js +2 -2
- package/dist/actions/deploy/deployApp.js.map +1 -1
- package/dist/actions/deploy/deployStudio.js +2 -2
- package/dist/actions/deploy/deployStudio.js.map +1 -1
- package/dist/actions/dev/startStudioDevServer.js +2 -2
- package/dist/actions/dev/startStudioDevServer.js.map +1 -1
- package/dist/actions/manifest/extractManifest.js +2 -2
- package/dist/actions/manifest/extractManifest.js.map +1 -1
- package/dist/actions/mcp/detectAvailableEditors.js +16 -4
- package/dist/actions/mcp/detectAvailableEditors.js.map +1 -1
- package/dist/actions/mcp/editorConfigs.js +64 -6
- package/dist/actions/mcp/editorConfigs.js.map +1 -1
- package/dist/actions/mcp/writeMCPConfig.js +27 -15
- package/dist/actions/mcp/writeMCPConfig.js.map +1 -1
- package/dist/actions/schema/extractSchema.js +7 -32
- package/dist/actions/schema/extractSchema.js.map +1 -1
- package/dist/actions/schema/extractSchemaWatcher.js +126 -0
- package/dist/actions/schema/extractSchemaWatcher.js.map +1 -0
- package/dist/actions/schema/formatSchemaValidation.js +5 -1
- package/dist/actions/schema/formatSchemaValidation.js.map +1 -1
- package/dist/actions/schema/getExtractOptions.js +16 -0
- package/dist/actions/schema/getExtractOptions.js.map +1 -0
- package/dist/actions/schema/runSchemaExtraction.js +39 -0
- package/dist/actions/schema/runSchemaExtraction.js.map +1 -0
- package/dist/actions/schema/watchExtractSchema.js +71 -0
- package/dist/actions/schema/watchExtractSchema.js.map +1 -0
- package/dist/actions/versions/tryFindLatestVersion.js +1 -1
- package/dist/actions/versions/tryFindLatestVersion.js.map +1 -1
- package/dist/commands/mcp/configure.js +1 -1
- package/dist/commands/mcp/configure.js.map +1 -1
- package/dist/commands/schema/extract.js +32 -4
- package/dist/commands/schema/extract.js.map +1 -1
- package/dist/server/previewServer.js +2 -2
- package/dist/server/previewServer.js.map +1 -1
- package/dist/telemetry/extractSchema.telemetry.js +5 -0
- package/dist/telemetry/extractSchema.telemetry.js.map +1 -1
- package/dist/util/compareDependencyVersions.js +3 -5
- package/dist/util/compareDependencyVersions.js.map +1 -1
- package/dist/util/getLocalPackageVersion.js +30 -22
- package/dist/util/getLocalPackageVersion.js.map +1 -1
- package/dist/util/getWorkspace.js +1 -1
- package/dist/util/getWorkspace.js.map +1 -1
- package/dist/util/resolveLatestVersions.js +2 -2
- package/dist/util/resolveLatestVersions.js.map +1 -1
- package/dist/util/update/fetchLatestVersion.js +1 -1
- package/dist/util/update/fetchLatestVersion.js.map +1 -1
- package/oclif.manifest.json +168 -146
- package/package.json +5 -5
- package/dist/util/readModuleVersion.js +0 -21
- package/dist/util/readModuleVersion.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/server/previewServer.ts"],"sourcesContent":["import {readFile} from 'node:fs/promises'\nimport path from 'node:path'\nimport {styleText} from 'node:util'\n\nimport {type UserViteConfig} from '@sanity/cli-core'\nimport {type InlineConfig, preview} from 'vite'\n\nimport {extendViteConfigWithUserConfig} from '../actions/build/getViteConfig.js'\nimport {
|
|
1
|
+
{"version":3,"sources":["../../src/server/previewServer.ts"],"sourcesContent":["import {readFile} from 'node:fs/promises'\nimport path from 'node:path'\nimport {styleText} from 'node:util'\n\nimport {type UserViteConfig} from '@sanity/cli-core'\nimport {type InlineConfig, preview} from 'vite'\n\nimport {extendViteConfigWithUserConfig} from '../actions/build/getViteConfig.js'\nimport {getLocalPackageVersion} from '../util/getLocalPackageVersion.js'\nimport {serverDebug} from './serverDebug.js'\nimport {sanityBasePathRedirectPlugin} from './vite/plugin-sanity-basepath-redirect.js'\n\nconst debug = serverDebug.extend('preview')\n\n/**\n * @internal\n */\nexport interface PreviewServer {\n close(): Promise<void>\n urls: {local: string[]; network: string[]}\n}\n\ninterface PreviewServerOptions {\n cwd: string\n httpPort: number\n\n root: string\n\n workDir: string\n\n httpHost?: string\n isApp?: boolean\n vite?: UserViteConfig\n}\n\n/**\n * Starts a Vite preview server for the given build output directory\n *\n * @param options - Preview server options\n * @returns A promise that resolves to the started preview server\n * @internal\n */\nexport async function startPreviewServer(options: PreviewServerOptions): Promise<PreviewServer> {\n const {httpHost, httpPort, isApp, root, vite: extendViteConfig, workDir} = options\n const startTime = Date.now()\n\n const indexPath = path.join(root, 'index.html')\n let basePath: string | undefined\n try {\n const index = await readFile(indexPath, 'utf8')\n basePath = tryResolveBasePathFromIndex(index)\n } catch (err: unknown) {\n if (err instanceof Error && 'code' in err && err.code === 'ENOENT') {\n const error = new Error(`Could not find a production build in the '${root}' directory.`)\n error.name = 'BUILD_NOT_FOUND'\n throw error\n }\n\n throw err\n }\n\n const mode = 'production'\n let previewConfig: InlineConfig = {\n base: basePath || '/',\n // Needed for vite to not serve `root/dist`\n build: {\n outDir: root,\n },\n configFile: false,\n mode,\n plugins: [sanityBasePathRedirectPlugin(basePath)],\n preview: {\n host: httpHost,\n port: httpPort,\n strictPort: true,\n },\n root: workDir,\n }\n\n // Extend Vite configuration with user-provided config\n if (extendViteConfig) {\n previewConfig = await extendViteConfigWithUserConfig(\n {command: 'serve', mode},\n previewConfig,\n extendViteConfig,\n )\n }\n\n debug('Creating vite server')\n const server = await preview(previewConfig)\n const warn = server.config.logger.warn\n const info = server.config.logger.info\n const url = server.resolvedUrls!.local[0]\n\n if (basePath === undefined) {\n warn('Could not determine base path from index.html, using \"/\" as default')\n } else if (basePath && basePath !== '/') {\n info(`Using resolved base path from static build: ${styleText('cyan', basePath)}`)\n }\n\n const startupDuration = Date.now() - startTime\n\n const viteVersion = await getLocalPackageVersion('vite', import.meta.url)\n\n info(\n `Sanity ${isApp ? 'application' : 'Studio'} ` +\n `using ${styleText('cyan', `vite@${viteVersion}`)} ` +\n `ready in ${styleText('cyan', `${Math.ceil(startupDuration)}ms`)} ` +\n `and running at ${styleText('cyan', url)} (production preview mode)`,\n )\n\n return {\n close: () =>\n new Promise((resolve, reject) =>\n server.httpServer.close((err) => (err ? reject(err) : resolve())),\n ),\n urls: server.resolvedUrls!,\n }\n}\n\nfunction tryResolveBasePathFromIndex(index: string): string | undefined {\n // <script ... src=\"/some-base-path/static/sanity-a3cc3d86.js\"></script>\n const basePath = index.match(/<script[^>]+src=\"(.*?)\\/static\\/sanity-/)?.[1]\n\n // We _expect_ to be able to find the base path. If we can't, we should warn.\n // Note that we're checking for `undefined` here, since an empty string is a\n // valid base path.\n if (basePath === undefined) {\n return undefined\n }\n\n // In the case of an empty base path, we still want to return `/` to indicate\n // that we _found_ the basepath - it just happens to be empty. Eg:\n // <script ... src = \"/static/sanity-a3cc3d86.js\"></script>\n // Which differs from not being able to find the script tag at all, in which\n // case we'll want to show a warning to indicate that it is an abnormality.\n return basePath === '' ? '/' : basePath\n}\n"],"names":["readFile","path","styleText","preview","extendViteConfigWithUserConfig","getLocalPackageVersion","serverDebug","sanityBasePathRedirectPlugin","debug","extend","startPreviewServer","options","httpHost","httpPort","isApp","root","vite","extendViteConfig","workDir","startTime","Date","now","indexPath","join","basePath","index","tryResolveBasePathFromIndex","err","Error","code","error","name","mode","previewConfig","base","build","outDir","configFile","plugins","host","port","strictPort","command","server","warn","config","logger","info","url","resolvedUrls","local","undefined","startupDuration","viteVersion","Math","ceil","close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EAA6E;IAC7E,kEAAkE;IAClE,2DAA2D;IAC3D,4EAA4E;IAC5E,2EAA2E;IAC3E,OAAO3B,aAAa,KAAK,MAAMA;AACjC"}
|
|
@@ -4,5 +4,10 @@ export const SchemaExtractedTrace = defineTrace({
|
|
|
4
4
|
name: 'Schema Extracted',
|
|
5
5
|
version: 0
|
|
6
6
|
});
|
|
7
|
+
export const SchemaExtractionWatchModeTrace = defineTrace({
|
|
8
|
+
description: 'Trace emitted when schema extraction watch mode is run',
|
|
9
|
+
name: 'Schema Extraction Watch Mode',
|
|
10
|
+
version: 0
|
|
11
|
+
});
|
|
7
12
|
|
|
8
13
|
//# sourceMappingURL=extractSchema.telemetry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/telemetry/extractSchema.telemetry.ts"],"sourcesContent":["import {defineTrace} from '@sanity/telemetry'\n\ninterface SchemaExtractedTraceAttributes {\n enforceRequiredFields: boolean\n schemaAllTypesCount: number\n schemaDocumentTypesCount: number\n\n schemaFormat: string\n schemaTypesCount: number\n}\n\nexport const SchemaExtractedTrace = defineTrace<SchemaExtractedTraceAttributes>({\n description: 'Trace emitted when extracting schema',\n name: 'Schema Extracted',\n version: 0,\n})\n"],"names":["defineTrace","SchemaExtractedTrace","description","name","version"],"mappings":"AAAA,SAAQA,WAAW,QAAO,oBAAmB;
|
|
1
|
+
{"version":3,"sources":["../../src/telemetry/extractSchema.telemetry.ts"],"sourcesContent":["import {defineTrace} from '@sanity/telemetry'\n\ninterface SchemaExtractedTraceAttributes {\n enforceRequiredFields: boolean\n schemaAllTypesCount: number\n schemaDocumentTypesCount: number\n\n schemaFormat: string\n schemaTypesCount: number\n}\n\ntype SchemaExtractionWatchModeAttributes =\n | {\n averageExtractionDuration: number\n extractionFailedCount: number\n extractionSuccessfulCount: number\n step: 'stopped'\n watcherDuration: number\n }\n | {\n enforceRequiredFields: boolean\n schemaFormat: string\n step: 'started'\n }\n\nexport const SchemaExtractedTrace = defineTrace<SchemaExtractedTraceAttributes>({\n description: 'Trace emitted when extracting schema',\n name: 'Schema Extracted',\n version: 0,\n})\n\nexport const SchemaExtractionWatchModeTrace = defineTrace<SchemaExtractionWatchModeAttributes>({\n description: 'Trace emitted when schema extraction watch mode is run',\n name: 'Schema Extraction Watch Mode',\n version: 0,\n})\n"],"names":["defineTrace","SchemaExtractedTrace","description","name","version","SchemaExtractionWatchModeTrace"],"mappings":"AAAA,SAAQA,WAAW,QAAO,oBAAmB;AAyB7C,OAAO,MAAMC,uBAAuBD,YAA4C;IAC9EE,aAAa;IACbC,MAAM;IACNC,SAAS;AACX,GAAE;AAEF,OAAO,MAAMC,iCAAiCL,YAAiD;IAC7FE,aAAa;IACbC,MAAM;IACNC,SAAS;AACX,GAAE"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { readPackageJson } from '@sanity/cli-core';
|
|
3
|
-
import resolveFrom from 'resolve-from';
|
|
4
3
|
import semver from 'semver';
|
|
5
4
|
import { getModuleUrl } from '../actions/build/getAutoUpdatesImportMap.js';
|
|
5
|
+
import { getLocalPackageVersion } from './getLocalPackageVersion.js';
|
|
6
6
|
function getRemoteResolvedVersion(fetchFn, url) {
|
|
7
7
|
return fetchFn(url, {
|
|
8
8
|
method: 'HEAD',
|
|
@@ -55,11 +55,9 @@ function getRemoteResolvedVersion(fetchFn, url) {
|
|
|
55
55
|
const failedDependencies = [];
|
|
56
56
|
for (const pkg of packages){
|
|
57
57
|
const resolvedVersion = await getRemoteResolvedVersion(fetchFn, getModuleUrl(pkg));
|
|
58
|
-
const
|
|
58
|
+
const packageVersion = await getLocalPackageVersion(pkg.name, workDir);
|
|
59
59
|
const manifestVersion = dependencies[pkg.name];
|
|
60
|
-
const installed = semver.coerce(
|
|
61
|
-
skipSchemaValidation: true
|
|
62
|
-
})).version) : semver.coerce(manifestVersion));
|
|
60
|
+
const installed = semver.coerce(packageVersion ? semver.parse(packageVersion) : semver.coerce(manifestVersion));
|
|
63
61
|
if (!installed) {
|
|
64
62
|
throw new Error(`Failed to parse installed version for ${pkg}`);
|
|
65
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/compareDependencyVersions.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {readPackageJson} from '@sanity/cli-core'\nimport
|
|
1
|
+
{"version":3,"sources":["../../src/util/compareDependencyVersions.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {readPackageJson} from '@sanity/cli-core'\nimport semver from 'semver'\n\nimport {getModuleUrl} from '../actions/build/getAutoUpdatesImportMap.js'\nimport {getLocalPackageVersion} from './getLocalPackageVersion.js'\n\nfunction getRemoteResolvedVersion(fetchFn: typeof fetch, url: string) {\n return fetchFn(url, {\n method: 'HEAD',\n redirect: 'manual',\n }).then(\n (res) => {\n // 302 is expected, but lets also handle 2xx\n if (res.ok || res.status < 400) {\n const resolved = res.headers.get('x-resolved-version')\n if (!resolved) {\n throw new Error(`Missing 'x-resolved-version' header on response from HEAD ${url}`)\n }\n return resolved\n }\n throw new Error(`Unexpected HTTP response: ${res.status} ${res.statusText}`)\n },\n (err) => {\n throw new Error(`Failed to fetch remote version for ${url}: ${err.message}`, {cause: err})\n },\n )\n}\n\ninterface CompareDependencyVersions {\n installed: string\n pkg: string\n remote: string\n}\n\n/**\n * @internal\n *\n * Compares the versions of dependencies in the studio or app with their remote versions.\n *\n * This function reads the package.json file in the provided working directory, and compares the versions of the dependencies\n * specified in the `autoUpdatesImports` parameter with their remote versions. If the versions do not match, the dependency is\n * added to a list of failed dependencies, which is returned by the function.\n *\n * The failed dependencies are anything that does not strictly match the remote version.\n * This means that if a version is lower or greater by even a patch it will be marked as failed.\n *\n * @param autoUpdatesImports - An object mapping package names to their remote import URLs.\n * @param workDir - The path to the working directory containing the package.json file.\n * @param fetchFn - Optional {@link https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API | Fetch}-compatible function to use for requesting the current remote version of a module\n *\n * @returns A promise that resolves to an array of objects, each containing\n * the name of a package whose local and remote versions do not match, along with the local and remote versions.\n *\n * @throws Throws an error if the remote version of a package cannot be fetched, or if the local version of a package\n * cannot be parsed.\n */\nexport async function compareDependencyVersions(\n packages: {name: string; version: string}[],\n workDir: string,\n {fetchFn = globalThis.fetch}: {appId?: string; fetchFn?: typeof fetch} = {},\n): Promise<Array<CompareDependencyVersions>> {\n const manifest = await readPackageJson(path.join(workDir, 'package.json'), {\n skipSchemaValidation: true,\n })\n const dependencies = {...manifest?.dependencies, ...manifest?.devDependencies}\n\n const failedDependencies: Array<CompareDependencyVersions> = []\n\n for (const pkg of packages) {\n const resolvedVersion = await getRemoteResolvedVersion(fetchFn, getModuleUrl(pkg))\n\n const packageVersion = await getLocalPackageVersion(pkg.name, workDir)\n\n const manifestVersion = dependencies[pkg.name]\n\n const installed = semver.coerce(\n packageVersion ? semver.parse(packageVersion) : semver.coerce(manifestVersion),\n )\n\n if (!installed) {\n throw new Error(`Failed to parse installed version for ${pkg}`)\n }\n\n if (!semver.eq(resolvedVersion, installed.version)) {\n failedDependencies.push({\n installed: installed.version,\n pkg: pkg.name,\n remote: resolvedVersion,\n })\n }\n }\n\n return failedDependencies\n}\n"],"names":["path","readPackageJson","semver","getModuleUrl","getLocalPackageVersion","getRemoteResolvedVersion","fetchFn","url","method","redirect","then","res","ok","status","resolved","headers","get","Error","statusText","err","message","cause","compareDependencyVersions","packages","workDir","globalThis","fetch","manifest","join","skipSchemaValidation","dependencies","devDependencies","failedDependencies","pkg","resolvedVersion","packageVersion","name","manifestVersion","installed","coerce","parse","eq","version","push","remote"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAE5B,SAAQC,eAAe,QAAO,mBAAkB;AAChD,OAAOC,YAAY,SAAQ;AAE3B,SAAQC,YAAY,QAAO,8CAA6C;AACxE,SAAQC,sBAAsB,QAAO,8BAA6B;AAElE,SAASC,yBAAyBC,OAAqB,EAAEC,GAAW;IAClE,OAAOD,QAAQC,KAAK;QAClBC,QAAQ;Q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AAEgB,KAAK;QAChE;QAEA,IAAI,CAAC/B,OAAOuC,EAAE,CAACP,iBAAiBI,UAAUI,OAAO,GAAG;YAClDV,mBAAmBW,IAAI,CAAC;gBACtBL,WAAWA,UAAUI,OAAO;gBAC5BT,KAAKA,IAAIG,IAAI;gBACbQ,QAAQV;YACV;QACF;IACF;IAEA,OAAOF;AACT"}
|
|
@@ -1,32 +1,40 @@
|
|
|
1
|
-
import { join, normalize
|
|
1
|
+
import { join, normalize, resolve } from 'node:path';
|
|
2
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
2
3
|
import { readPackageJson } from '@sanity/cli-core';
|
|
3
|
-
import
|
|
4
|
+
import { moduleResolve } from 'import-meta-resolve';
|
|
4
5
|
/**
|
|
5
6
|
* Get the version of a package installed locally.
|
|
6
7
|
*
|
|
7
|
-
* @param
|
|
8
|
-
* @param workDir - The working directory to resolve the module from.
|
|
8
|
+
* @param moduleName - The name of the package in npm.
|
|
9
|
+
* @param workDir - The working directory to resolve the module from. (aka project root)
|
|
9
10
|
* @returns The version of the package installed locally.
|
|
10
11
|
* @internal
|
|
11
|
-
*/ export async function getLocalPackageVersion(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
*/ export async function getLocalPackageVersion(moduleName, workDir) {
|
|
13
|
+
try {
|
|
14
|
+
const dirUrl = pathToFileURL(resolve(workDir, 'noop.js'));
|
|
15
|
+
let packageJsonUrl;
|
|
16
|
+
try {
|
|
17
|
+
packageJsonUrl = moduleResolve(`${moduleName}/package.json`, dirUrl);
|
|
18
|
+
} catch (err) {
|
|
19
|
+
if (isErrPackagePathNotExported(err)) {
|
|
20
|
+
// Fallback: resolve main entry point and derive package root
|
|
21
|
+
const mainUrl = moduleResolve(moduleName, dirUrl);
|
|
22
|
+
const mainPath = fileURLToPath(mainUrl);
|
|
23
|
+
const normalizedName = normalize(moduleName);
|
|
24
|
+
const idx = mainPath.lastIndexOf(normalizedName);
|
|
25
|
+
const moduleRoot = mainPath.slice(0, idx + normalizedName.length);
|
|
26
|
+
packageJsonUrl = pathToFileURL(join(moduleRoot, 'package.json'));
|
|
27
|
+
} else {
|
|
28
|
+
throw err;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return (await readPackageJson(packageJsonUrl)).version;
|
|
32
|
+
} catch {
|
|
33
|
+
return null;
|
|
17
34
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const pathSegment = normalizePath(moduleId);
|
|
22
|
-
const parentPath = resolveFrom.silent(fromPath, moduleId);
|
|
23
|
-
if (!parentPath) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
const moduleRoot = parentPath.slice(0, parentPath.lastIndexOf(pathSegment) + pathSegment.length);
|
|
27
|
-
const manifestPath = join(moduleRoot, 'package.json');
|
|
28
|
-
const pkg = await readPackageJson(manifestPath);
|
|
29
|
-
return pkg.version;
|
|
35
|
+
}
|
|
36
|
+
function isErrPackagePathNotExported(err) {
|
|
37
|
+
return err instanceof Error && 'code' in err && err.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED';
|
|
30
38
|
}
|
|
31
39
|
|
|
32
40
|
//# sourceMappingURL=getLocalPackageVersion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/getLocalPackageVersion.ts"],"sourcesContent":["import {join, normalize
|
|
1
|
+
{"version":3,"sources":["../../src/util/getLocalPackageVersion.ts"],"sourcesContent":["import {join, normalize, resolve} from 'node:path'\nimport {fileURLToPath, pathToFileURL} from 'node:url'\n\nimport {readPackageJson} from '@sanity/cli-core'\nimport {moduleResolve} from 'import-meta-resolve'\n\n/**\n * Get the version of a package installed locally.\n *\n * @param moduleName - The name of the package in npm.\n * @param workDir - The working directory to resolve the module from. (aka project root)\n * @returns The version of the package installed locally.\n * @internal\n */\nexport async function getLocalPackageVersion(\n moduleName: string,\n workDir: string,\n): Promise<string | null> {\n try {\n const dirUrl = pathToFileURL(resolve(workDir, 'noop.js'))\n\n let packageJsonUrl: URL\n try {\n packageJsonUrl = moduleResolve(`${moduleName}/package.json`, dirUrl)\n } catch (err: unknown) {\n if (isErrPackagePathNotExported(err)) {\n // Fallback: resolve main entry point and derive package root\n const mainUrl = moduleResolve(moduleName, dirUrl)\n const mainPath = fileURLToPath(mainUrl)\n const normalizedName = normalize(moduleName)\n const idx = mainPath.lastIndexOf(normalizedName)\n const moduleRoot = mainPath.slice(0, idx + normalizedName.length)\n packageJsonUrl = pathToFileURL(join(moduleRoot, 'package.json'))\n } else {\n throw err\n }\n }\n\n return (await readPackageJson(packageJsonUrl)).version\n } catch {\n return null\n }\n}\n\nfunction isErrPackagePathNotExported(err: unknown): boolean {\n return err instanceof Error && 'code' in err && err.code === 'ERR_PACKAGE_PATH_NOT_EXPORTED'\n}\n"],"names":["join","normalize","resolve","fileURLToPath","pathToFileURL","readPackageJson","moduleResolve","getLocalPackageVersion","moduleName","workDir","dirUrl","packageJsonUrl","err","isErrPackagePathNotExported","mainUrl","mainPath","normalizedName","idx","lastIndexOf","moduleRoot","slice","length","version","Error","code"],"mappings":"AAAA,SAAQA,IAAI,EAAEC,SAAS,EAAEC,OAAO,QAAO,YAAW;AAClD,SAAQC,aAAa,EAAEC,aAAa,QAAO,WAAU;AAErD,SAAQC,eAAe,QAAO,mBAAkB;AAChD,SAAQC,aAAa,QAAO,sBAAqB;AAEjD;;;;;;;CAOC,GACD,OAAO,eAAeC,uBACpBC,UAAkB,EAClBC,OAAe;IAEf,IAAI;QACF,MAAMC,SAASN,cAAcF,QAAQO,SAAS;QAE9C,IAAIE;QACJ,IAAI;YACFA,iBAAiBL,cAAc,GAAGE,WAAW,aAAa,CAAC,EAAEE;QAC/D,EAAE,OAAOE,KAAc;YACrB,IAAIC,4BAA4BD,MAAM;gBACpC,6DAA6D;gBAC7D,MAAME,UAAUR,cAAcE,YAAYE;gBAC1C,MAAMK,WAAWZ,cAAcW;gBAC/B,MAAME,iBAAiBf,UAAUO;gBACjC,MAAMS,MAAMF,SAASG,WAAW,CAACF;gBACjC,MAAMG,aAAaJ,SAASK,KAAK,CAAC,GAAGH,MAAMD,eAAeK,MAAM;gBAChEV,iBAAiBP,cAAcJ,KAAKmB,YAAY;YAClD,OAAO;gBACL,MAAMP;YACR;QACF;QAEA,OAAO,AAAC,CAAA,MAAMP,gBAAgBM,eAAc,EAAGW,OAAO;IACxD,EAAE,OAAM;QACN,OAAO;IACT;AACF;AAEA,SAAST,4BAA4BD,GAAY;IAC/C,OAAOA,eAAeW,SAAS,UAAUX,OAAOA,IAAIY,IAAI,KAAK;AAC/D"}
|
|
@@ -6,7 +6,7 @@ export function getWorkspace(workspaces, workspaceName) {
|
|
|
6
6
|
return workspaces[0];
|
|
7
7
|
}
|
|
8
8
|
if (!workspaceName) {
|
|
9
|
-
throw new Error(`Multiple workspaces found. Please specify which workspace to use with
|
|
9
|
+
throw new Error(`Multiple workspaces found. Please specify which workspace to use with '--workspace' or with the schemaExtraction.workspace config prop. Available workspaces: ${workspaces.map((w)=>w.name).join(', ')}`);
|
|
10
10
|
}
|
|
11
11
|
const workspace = workspaces.find((w)=>w.name === workspaceName);
|
|
12
12
|
if (!workspace) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/getWorkspace.ts"],"sourcesContent":["export function getWorkspace<T extends {name: string}>(workspaces: T[], workspaceName?: string) {\n if (workspaces.length === 0) {\n throw new Error('No workspaces found')\n }\n\n if (workspaces.length === 1) {\n return workspaces[0]\n }\n\n if (!workspaceName) {\n throw new Error(\n `Multiple workspaces found. Please specify which workspace to use with
|
|
1
|
+
{"version":3,"sources":["../../src/util/getWorkspace.ts"],"sourcesContent":["export function getWorkspace<T extends {name: string}>(workspaces: T[], workspaceName?: string) {\n if (workspaces.length === 0) {\n throw new Error('No workspaces found')\n }\n\n if (workspaces.length === 1) {\n return workspaces[0]\n }\n\n if (!workspaceName) {\n throw new Error(\n `Multiple workspaces found. Please specify which workspace to use with '--workspace' or with the schemaExtraction.workspace config prop. Available workspaces: ${workspaces.map((w) => w.name).join(', ')}`,\n )\n }\n\n const workspace = workspaces.find((w) => w.name === workspaceName)\n\n if (!workspace) {\n throw new Error(\n `Could not find \"${workspaceName}\" workspace. Available workspaces: ${workspaces.map((w) => w.name).join(', ')}`,\n )\n }\n\n return workspace\n}\n"],"names":["getWorkspace","workspaces","workspaceName","length","Error","map","w","name","join","workspace","find"],"mappings":"AAAA,OAAO,SAASA,aAAuCC,UAAe,EAAEC,aAAsB;IAC5F,IAAID,WAAWE,MAAM,KAAK,GAAG;QAC3B,MAAM,IAAIC,MAAM;IAClB;IAEA,IAAIH,WAAWE,MAAM,KAAK,GAAG;QAC3B,OAAOF,UAAU,CAAC,EAAE;IACtB;IAEA,IAAI,CAACC,eAAe;QAClB,MAAM,IAAIE,MACR,CAAC,8JAA8J,EAAEH,WAAWI,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,EAAEC,IAAI,CAAC,OAAO;IAE/M;IAEA,MAAMC,YAAYR,WAAWS,IAAI,CAAC,CAACJ,IAAMA,EAAEC,IAAI,KAAKL;IAEpD,IAAI,CAACO,WAAW;QACd,MAAM,IAAIL,MACR,CAAC,gBAAgB,EAAEF,cAAc,mCAAmC,EAAED,WAAWI,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,EAAEC,IAAI,CAAC,OAAO;IAEpH;IAEA,OAAOC;AACT"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getLatestVersion } from 'get-latest-version';
|
|
2
2
|
import promiseProps from 'promise-props-recursive';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve the latest versions of given packages within their defined ranges
|
|
@@ -8,7 +8,7 @@ import promiseProps from 'promise-props-recursive';
|
|
|
8
8
|
*/ export function resolveLatestVersions(pkgs) {
|
|
9
9
|
const lookups = {};
|
|
10
10
|
for (const [packageName, range] of Object.entries(pkgs)){
|
|
11
|
-
lookups[packageName] = range === 'latest' ?
|
|
11
|
+
lookups[packageName] = range === 'latest' ? getLatestVersion(packageName, {
|
|
12
12
|
range
|
|
13
13
|
}).then(caretify) : range;
|
|
14
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/resolveLatestVersions.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"sources":["../../src/util/resolveLatestVersions.ts"],"sourcesContent":["import {getLatestVersion} from 'get-latest-version'\nimport promiseProps from 'promise-props-recursive'\n\n/**\n * Resolve the latest versions of given packages within their defined ranges\n *\n * @param pkgs - `{packageName: rangeOrTag}`\n * @returns Object of resolved version numbers\n */\nexport function resolveLatestVersions(\n pkgs: Record<string, string>,\n): Promise<Record<string, string>> {\n const lookups: Record<string, Promise<string> | string> = {}\n for (const [packageName, range] of Object.entries(pkgs)) {\n lookups[packageName] =\n range === 'latest' ? getLatestVersion(packageName, {range}).then(caretify) : range\n }\n\n return promiseProps(lookups)\n}\n\nfunction caretify(version: string | undefined) {\n return version ? `^${version}` : 'latest'\n}\n"],"names":["getLatestVersion","promiseProps","resolveLatestVersions","pkgs","lookups","packageName","range","Object","entries","then","caretify","version"],"mappings":"AAAA,SAAQA,gBAAgB,QAAO,qBAAoB;AACnD,OAAOC,kBAAkB,0BAAyB;AAElD;;;;;CAKC,GACD,OAAO,SAASC,sBACdC,IAA4B;IAE5B,MAAMC,UAAoD,CAAC;IAC3D,KAAK,MAAM,CAACC,aAAaC,MAAM,IAAIC,OAAOC,OAAO,CAACL,MAAO;QACvDC,OAAO,CAACC,YAAY,GAClBC,UAAU,WAAWN,iBAAiBK,aAAa;YAACC;QAAK,GAAGG,IAAI,CAACC,YAAYJ;IACjF;IAEA,OAAOL,aAAaG;AACtB;AAEA,SAASM,SAASC,OAA2B;IAC3C,OAAOA,UAAU,CAAC,CAAC,EAAEA,SAAS,GAAG;AACnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { subdebug } from '@sanity/cli-core';
|
|
2
|
-
import getLatestVersion from 'get-latest-version';
|
|
2
|
+
import { getLatestVersion } from 'get-latest-version';
|
|
3
3
|
import { promiseRaceWithTimeout } from '../promiseRaceWithTimeout.js';
|
|
4
4
|
const debug = subdebug('updateChecker');
|
|
5
5
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/util/update/fetchLatestVersion.ts"],"sourcesContent":["import {subdebug} from '@sanity/cli-core'\nimport getLatestVersion from 'get-latest-version'\n\nimport {promiseRaceWithTimeout} from '../promiseRaceWithTimeout.js'\n\nconst debug = subdebug('updateChecker')\n\n/**\n * Fetch the latest version from npm with a timeout\n */\nexport async function fetchLatestVersion(\n packageName: string,\n timeout: number,\n): Promise<string | null | undefined> {\n try {\n const result = await promiseRaceWithTimeout(getLatestVersion(packageName), timeout)\n\n if (result === null) {\n debug(`Max time ${timeout} reached waiting for latest version info`)\n }\n\n debug('Latest remote version is %s', result)\n\n return result\n } catch (err) {\n debug(\n `Failed to fetch latest version of ${packageName} from npm:\\n${err instanceof Error ? err.stack : String(err)}`,\n )\n throw err\n }\n}\n"],"names":["subdebug","getLatestVersion","promiseRaceWithTimeout","debug","fetchLatestVersion","packageName","timeout","result","err","Error","stack","String"],"mappings":"AAAA,SAAQA,QAAQ,QAAO,mBAAkB;AACzC,
|
|
1
|
+
{"version":3,"sources":["../../../src/util/update/fetchLatestVersion.ts"],"sourcesContent":["import {subdebug} from '@sanity/cli-core'\nimport {getLatestVersion} from 'get-latest-version'\n\nimport {promiseRaceWithTimeout} from '../promiseRaceWithTimeout.js'\n\nconst debug = subdebug('updateChecker')\n\n/**\n * Fetch the latest version from npm with a timeout\n */\nexport async function fetchLatestVersion(\n packageName: string,\n timeout: number,\n): Promise<string | null | undefined> {\n try {\n const result = await promiseRaceWithTimeout(getLatestVersion(packageName), timeout)\n\n if (result === null) {\n debug(`Max time ${timeout} reached waiting for latest version info`)\n }\n\n debug('Latest remote version is %s', result)\n\n return result\n } catch (err) {\n debug(\n `Failed to fetch latest version of ${packageName} from npm:\\n${err instanceof Error ? err.stack : String(err)}`,\n )\n throw err\n }\n}\n"],"names":["subdebug","getLatestVersion","promiseRaceWithTimeout","debug","fetchLatestVersion","packageName","timeout","result","err","Error","stack","String"],"mappings":"AAAA,SAAQA,QAAQ,QAAO,mBAAkB;AACzC,SAAQC,gBAAgB,QAAO,qBAAoB;AAEnD,SAAQC,sBAAsB,QAAO,+BAA8B;AAEnE,MAAMC,QAAQH,SAAS;AAEvB;;CAEC,GACD,OAAO,eAAeI,mBACpBC,WAAmB,EACnBC,OAAe;IAEf,IAAI;QACF,MAAMC,SAAS,MAAML,uBAAuBD,iBAAiBI,cAAcC;QAE3E,IAAIC,WAAW,MAAM;YACnBJ,MAAM,CAAC,SAAS,EAAEG,QAAQ,wCAAwC,CAAC;QACrE;QAEAH,MAAM,+BAA+BI;QAErC,OAAOA;IACT,EAAE,OAAOC,KAAK;QACZL,MACE,CAAC,kCAAkC,EAAEE,YAAY,YAAY,EAAEG,eAAeC,QAAQD,IAAIE,KAAK,GAAGC,OAAOH,MAAM;QAEjH,MAAMA;IACR;AACF"}
|
package/oclif.manifest.json
CHANGED
|
@@ -2623,7 +2623,7 @@
|
|
|
2623
2623
|
"mcp:configure": {
|
|
2624
2624
|
"aliases": [],
|
|
2625
2625
|
"args": {},
|
|
2626
|
-
"description": "Configure Sanity MCP server for AI editors (Cursor,
|
|
2626
|
+
"description": "Configure Sanity MCP server for AI editors (Claude Code, Codex CLI, Cursor, Gemini CLI, GitHub Copilot CLI, VS Code)",
|
|
2627
2627
|
"examples": [
|
|
2628
2628
|
{
|
|
2629
2629
|
"command": "<%= config.bin %> <%= command.id %>",
|
|
@@ -3008,150 +3008,6 @@
|
|
|
3008
3008
|
"list.js"
|
|
3009
3009
|
]
|
|
3010
3010
|
},
|
|
3011
|
-
"projects:create": {
|
|
3012
|
-
"aliases": [],
|
|
3013
|
-
"args": {
|
|
3014
|
-
"projectName": {
|
|
3015
|
-
"description": "Name of the project to create",
|
|
3016
|
-
"name": "projectName",
|
|
3017
|
-
"required": false
|
|
3018
|
-
}
|
|
3019
|
-
},
|
|
3020
|
-
"description": "Create a new Sanity project",
|
|
3021
|
-
"examples": [
|
|
3022
|
-
{
|
|
3023
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
3024
|
-
"description": "Interactively create a project"
|
|
3025
|
-
},
|
|
3026
|
-
{
|
|
3027
|
-
"command": "<%= config.bin %> <%= command.id %> \"My New Project\"",
|
|
3028
|
-
"description": "Create a project named \"My New Project\""
|
|
3029
|
-
},
|
|
3030
|
-
{
|
|
3031
|
-
"command": "<%= config.bin %> <%= command.id %> \"My Project\" --organization=my-org",
|
|
3032
|
-
"description": "Create a project in a specific organization"
|
|
3033
|
-
},
|
|
3034
|
-
{
|
|
3035
|
-
"command": "<%= config.bin %> <%= command.id %> \"My Project\" --dataset=staging --dataset-visibility=private",
|
|
3036
|
-
"description": "Create a project with a private dataset named \"staging\""
|
|
3037
|
-
},
|
|
3038
|
-
{
|
|
3039
|
-
"command": "<%= config.bin %> <%= command.id %> \"CI Project\" --yes --json",
|
|
3040
|
-
"description": "Create a project non-interactively with JSON output"
|
|
3041
|
-
}
|
|
3042
|
-
],
|
|
3043
|
-
"flags": {
|
|
3044
|
-
"dataset": {
|
|
3045
|
-
"description": "Create a dataset. Prompts for visibility unless specified or --yes used",
|
|
3046
|
-
"name": "dataset",
|
|
3047
|
-
"hasDynamicHelp": false,
|
|
3048
|
-
"multiple": false,
|
|
3049
|
-
"type": "option"
|
|
3050
|
-
},
|
|
3051
|
-
"dataset-visibility": {
|
|
3052
|
-
"description": "Dataset visibility: public or private",
|
|
3053
|
-
"name": "dataset-visibility",
|
|
3054
|
-
"hasDynamicHelp": false,
|
|
3055
|
-
"multiple": false,
|
|
3056
|
-
"options": [
|
|
3057
|
-
"private",
|
|
3058
|
-
"public"
|
|
3059
|
-
],
|
|
3060
|
-
"type": "option"
|
|
3061
|
-
},
|
|
3062
|
-
"json": {
|
|
3063
|
-
"description": "Output in JSON format",
|
|
3064
|
-
"name": "json",
|
|
3065
|
-
"allowNo": false,
|
|
3066
|
-
"type": "boolean"
|
|
3067
|
-
},
|
|
3068
|
-
"organization": {
|
|
3069
|
-
"description": "Organization to create the project in",
|
|
3070
|
-
"name": "organization",
|
|
3071
|
-
"hasDynamicHelp": false,
|
|
3072
|
-
"helpValue": "<slug|id>",
|
|
3073
|
-
"multiple": false,
|
|
3074
|
-
"type": "option"
|
|
3075
|
-
},
|
|
3076
|
-
"yes": {
|
|
3077
|
-
"char": "y",
|
|
3078
|
-
"description": "Skip prompts and use defaults (project: \"My Sanity Project\", dataset: production, visibility: public)",
|
|
3079
|
-
"name": "yes",
|
|
3080
|
-
"allowNo": false,
|
|
3081
|
-
"type": "boolean"
|
|
3082
|
-
}
|
|
3083
|
-
},
|
|
3084
|
-
"hasDynamicHelp": false,
|
|
3085
|
-
"hiddenAliases": [],
|
|
3086
|
-
"id": "projects:create",
|
|
3087
|
-
"pluginAlias": "@sanity/cli",
|
|
3088
|
-
"pluginName": "@sanity/cli",
|
|
3089
|
-
"pluginType": "core",
|
|
3090
|
-
"strict": true,
|
|
3091
|
-
"isESM": true,
|
|
3092
|
-
"relativePath": [
|
|
3093
|
-
"dist",
|
|
3094
|
-
"commands",
|
|
3095
|
-
"projects",
|
|
3096
|
-
"create.js"
|
|
3097
|
-
]
|
|
3098
|
-
},
|
|
3099
|
-
"projects:list": {
|
|
3100
|
-
"aliases": [],
|
|
3101
|
-
"args": {},
|
|
3102
|
-
"description": "Lists projects connected to your user",
|
|
3103
|
-
"examples": [
|
|
3104
|
-
{
|
|
3105
|
-
"command": "<%= config.bin %> <%= command.id %>",
|
|
3106
|
-
"description": "List projects"
|
|
3107
|
-
},
|
|
3108
|
-
{
|
|
3109
|
-
"command": "<%= config.bin %> <%= command.id %> --sort=members --order=asc",
|
|
3110
|
-
"description": "List all users of the project, but exclude pending invitations and robots"
|
|
3111
|
-
}
|
|
3112
|
-
],
|
|
3113
|
-
"flags": {
|
|
3114
|
-
"order": {
|
|
3115
|
-
"name": "order",
|
|
3116
|
-
"default": "desc",
|
|
3117
|
-
"hasDynamicHelp": false,
|
|
3118
|
-
"multiple": false,
|
|
3119
|
-
"options": [
|
|
3120
|
-
"asc",
|
|
3121
|
-
"desc"
|
|
3122
|
-
],
|
|
3123
|
-
"type": "option"
|
|
3124
|
-
},
|
|
3125
|
-
"sort": {
|
|
3126
|
-
"name": "sort",
|
|
3127
|
-
"default": "created",
|
|
3128
|
-
"hasDynamicHelp": false,
|
|
3129
|
-
"multiple": false,
|
|
3130
|
-
"options": [
|
|
3131
|
-
"id",
|
|
3132
|
-
"members",
|
|
3133
|
-
"name",
|
|
3134
|
-
"url",
|
|
3135
|
-
"created"
|
|
3136
|
-
],
|
|
3137
|
-
"type": "option"
|
|
3138
|
-
}
|
|
3139
|
-
},
|
|
3140
|
-
"hasDynamicHelp": false,
|
|
3141
|
-
"hiddenAliases": [],
|
|
3142
|
-
"id": "projects:list",
|
|
3143
|
-
"pluginAlias": "@sanity/cli",
|
|
3144
|
-
"pluginName": "@sanity/cli",
|
|
3145
|
-
"pluginType": "core",
|
|
3146
|
-
"strict": true,
|
|
3147
|
-
"isESM": true,
|
|
3148
|
-
"relativePath": [
|
|
3149
|
-
"dist",
|
|
3150
|
-
"commands",
|
|
3151
|
-
"projects",
|
|
3152
|
-
"list.js"
|
|
3153
|
-
]
|
|
3154
|
-
},
|
|
3155
3011
|
"schema:delete": {
|
|
3156
3012
|
"aliases": [],
|
|
3157
3013
|
"args": {},
|
|
@@ -3300,6 +3156,14 @@
|
|
|
3300
3156
|
{
|
|
3301
3157
|
"command": "<%= config.bin %> <%= command.id %> --workspace default",
|
|
3302
3158
|
"description": "Extracts schema types in a Sanity project with more than one workspace"
|
|
3159
|
+
},
|
|
3160
|
+
{
|
|
3161
|
+
"command": "<%= config.bin %> <%= command.id %> --watch",
|
|
3162
|
+
"description": "Watch mode - re-extract on changes"
|
|
3163
|
+
},
|
|
3164
|
+
{
|
|
3165
|
+
"command": "<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"",
|
|
3166
|
+
"description": "Watch with custom glob patterns"
|
|
3303
3167
|
}
|
|
3304
3168
|
],
|
|
3305
3169
|
"flags": {
|
|
@@ -3325,6 +3189,20 @@
|
|
|
3325
3189
|
"multiple": false,
|
|
3326
3190
|
"type": "option"
|
|
3327
3191
|
},
|
|
3192
|
+
"watch": {
|
|
3193
|
+
"description": "Enable watch mode to re-extract schema on file changes",
|
|
3194
|
+
"name": "watch",
|
|
3195
|
+
"allowNo": false,
|
|
3196
|
+
"type": "boolean"
|
|
3197
|
+
},
|
|
3198
|
+
"watch-patterns": {
|
|
3199
|
+
"description": "Additional glob pattern(s) to watch (can be specified multiple times)",
|
|
3200
|
+
"name": "watch-patterns",
|
|
3201
|
+
"hasDynamicHelp": false,
|
|
3202
|
+
"helpValue": "<glob>",
|
|
3203
|
+
"multiple": true,
|
|
3204
|
+
"type": "option"
|
|
3205
|
+
},
|
|
3328
3206
|
"workspace": {
|
|
3329
3207
|
"description": "The name of the workspace to generate a schema for",
|
|
3330
3208
|
"name": "workspace",
|
|
@@ -3852,6 +3730,150 @@
|
|
|
3852
3730
|
"list.js"
|
|
3853
3731
|
]
|
|
3854
3732
|
},
|
|
3733
|
+
"projects:create": {
|
|
3734
|
+
"aliases": [],
|
|
3735
|
+
"args": {
|
|
3736
|
+
"projectName": {
|
|
3737
|
+
"description": "Name of the project to create",
|
|
3738
|
+
"name": "projectName",
|
|
3739
|
+
"required": false
|
|
3740
|
+
}
|
|
3741
|
+
},
|
|
3742
|
+
"description": "Create a new Sanity project",
|
|
3743
|
+
"examples": [
|
|
3744
|
+
{
|
|
3745
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
3746
|
+
"description": "Interactively create a project"
|
|
3747
|
+
},
|
|
3748
|
+
{
|
|
3749
|
+
"command": "<%= config.bin %> <%= command.id %> \"My New Project\"",
|
|
3750
|
+
"description": "Create a project named \"My New Project\""
|
|
3751
|
+
},
|
|
3752
|
+
{
|
|
3753
|
+
"command": "<%= config.bin %> <%= command.id %> \"My Project\" --organization=my-org",
|
|
3754
|
+
"description": "Create a project in a specific organization"
|
|
3755
|
+
},
|
|
3756
|
+
{
|
|
3757
|
+
"command": "<%= config.bin %> <%= command.id %> \"My Project\" --dataset=staging --dataset-visibility=private",
|
|
3758
|
+
"description": "Create a project with a private dataset named \"staging\""
|
|
3759
|
+
},
|
|
3760
|
+
{
|
|
3761
|
+
"command": "<%= config.bin %> <%= command.id %> \"CI Project\" --yes --json",
|
|
3762
|
+
"description": "Create a project non-interactively with JSON output"
|
|
3763
|
+
}
|
|
3764
|
+
],
|
|
3765
|
+
"flags": {
|
|
3766
|
+
"dataset": {
|
|
3767
|
+
"description": "Create a dataset. Prompts for visibility unless specified or --yes used",
|
|
3768
|
+
"name": "dataset",
|
|
3769
|
+
"hasDynamicHelp": false,
|
|
3770
|
+
"multiple": false,
|
|
3771
|
+
"type": "option"
|
|
3772
|
+
},
|
|
3773
|
+
"dataset-visibility": {
|
|
3774
|
+
"description": "Dataset visibility: public or private",
|
|
3775
|
+
"name": "dataset-visibility",
|
|
3776
|
+
"hasDynamicHelp": false,
|
|
3777
|
+
"multiple": false,
|
|
3778
|
+
"options": [
|
|
3779
|
+
"private",
|
|
3780
|
+
"public"
|
|
3781
|
+
],
|
|
3782
|
+
"type": "option"
|
|
3783
|
+
},
|
|
3784
|
+
"json": {
|
|
3785
|
+
"description": "Output in JSON format",
|
|
3786
|
+
"name": "json",
|
|
3787
|
+
"allowNo": false,
|
|
3788
|
+
"type": "boolean"
|
|
3789
|
+
},
|
|
3790
|
+
"organization": {
|
|
3791
|
+
"description": "Organization to create the project in",
|
|
3792
|
+
"name": "organization",
|
|
3793
|
+
"hasDynamicHelp": false,
|
|
3794
|
+
"helpValue": "<slug|id>",
|
|
3795
|
+
"multiple": false,
|
|
3796
|
+
"type": "option"
|
|
3797
|
+
},
|
|
3798
|
+
"yes": {
|
|
3799
|
+
"char": "y",
|
|
3800
|
+
"description": "Skip prompts and use defaults (project: \"My Sanity Project\", dataset: production, visibility: public)",
|
|
3801
|
+
"name": "yes",
|
|
3802
|
+
"allowNo": false,
|
|
3803
|
+
"type": "boolean"
|
|
3804
|
+
}
|
|
3805
|
+
},
|
|
3806
|
+
"hasDynamicHelp": false,
|
|
3807
|
+
"hiddenAliases": [],
|
|
3808
|
+
"id": "projects:create",
|
|
3809
|
+
"pluginAlias": "@sanity/cli",
|
|
3810
|
+
"pluginName": "@sanity/cli",
|
|
3811
|
+
"pluginType": "core",
|
|
3812
|
+
"strict": true,
|
|
3813
|
+
"isESM": true,
|
|
3814
|
+
"relativePath": [
|
|
3815
|
+
"dist",
|
|
3816
|
+
"commands",
|
|
3817
|
+
"projects",
|
|
3818
|
+
"create.js"
|
|
3819
|
+
]
|
|
3820
|
+
},
|
|
3821
|
+
"projects:list": {
|
|
3822
|
+
"aliases": [],
|
|
3823
|
+
"args": {},
|
|
3824
|
+
"description": "Lists projects connected to your user",
|
|
3825
|
+
"examples": [
|
|
3826
|
+
{
|
|
3827
|
+
"command": "<%= config.bin %> <%= command.id %>",
|
|
3828
|
+
"description": "List projects"
|
|
3829
|
+
},
|
|
3830
|
+
{
|
|
3831
|
+
"command": "<%= config.bin %> <%= command.id %> --sort=members --order=asc",
|
|
3832
|
+
"description": "List all users of the project, but exclude pending invitations and robots"
|
|
3833
|
+
}
|
|
3834
|
+
],
|
|
3835
|
+
"flags": {
|
|
3836
|
+
"order": {
|
|
3837
|
+
"name": "order",
|
|
3838
|
+
"default": "desc",
|
|
3839
|
+
"hasDynamicHelp": false,
|
|
3840
|
+
"multiple": false,
|
|
3841
|
+
"options": [
|
|
3842
|
+
"asc",
|
|
3843
|
+
"desc"
|
|
3844
|
+
],
|
|
3845
|
+
"type": "option"
|
|
3846
|
+
},
|
|
3847
|
+
"sort": {
|
|
3848
|
+
"name": "sort",
|
|
3849
|
+
"default": "created",
|
|
3850
|
+
"hasDynamicHelp": false,
|
|
3851
|
+
"multiple": false,
|
|
3852
|
+
"options": [
|
|
3853
|
+
"id",
|
|
3854
|
+
"members",
|
|
3855
|
+
"name",
|
|
3856
|
+
"url",
|
|
3857
|
+
"created"
|
|
3858
|
+
],
|
|
3859
|
+
"type": "option"
|
|
3860
|
+
}
|
|
3861
|
+
},
|
|
3862
|
+
"hasDynamicHelp": false,
|
|
3863
|
+
"hiddenAliases": [],
|
|
3864
|
+
"id": "projects:list",
|
|
3865
|
+
"pluginAlias": "@sanity/cli",
|
|
3866
|
+
"pluginName": "@sanity/cli",
|
|
3867
|
+
"pluginType": "core",
|
|
3868
|
+
"strict": true,
|
|
3869
|
+
"isESM": true,
|
|
3870
|
+
"relativePath": [
|
|
3871
|
+
"dist",
|
|
3872
|
+
"commands",
|
|
3873
|
+
"projects",
|
|
3874
|
+
"list.js"
|
|
3875
|
+
]
|
|
3876
|
+
},
|
|
3855
3877
|
"dataset:alias:create": {
|
|
3856
3878
|
"aliases": [],
|
|
3857
3879
|
"args": {
|
|
@@ -4146,5 +4168,5 @@
|
|
|
4146
4168
|
]
|
|
4147
4169
|
}
|
|
4148
4170
|
},
|
|
4149
|
-
"version": "6.0.0-alpha.
|
|
4171
|
+
"version": "6.0.0-alpha.15"
|
|
4150
4172
|
}
|