@sanity/cli-core 0.1.0-alpha.9 → 1.0.1
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/dist/SanityCommand.js +81 -5
- package/dist/SanityCommand.js.map +1 -1
- package/dist/_exports/package-manager.d.ts +33 -0
- package/dist/_exports/package-manager.js +3 -0
- package/dist/_exports/package-manager.js.map +1 -0
- package/dist/_exports/request.d.ts +79 -0
- package/dist/_exports/request.js +7 -0
- package/dist/_exports/request.js.map +1 -0
- package/dist/_exports/ux.d.ts +61 -26
- package/dist/_exports/ux.js +1 -0
- package/dist/_exports/ux.js.map +1 -1
- package/dist/config/cli/getCliConfig.js +33 -33
- package/dist/config/cli/getCliConfig.js.map +1 -1
- package/dist/config/cli/getCliConfigSync.js +1 -1
- package/dist/config/cli/getCliConfigSync.js.map +1 -1
- package/dist/config/cli/schemas.js +7 -0
- package/dist/config/cli/schemas.js.map +1 -1
- package/dist/config/cli/types/cliConfig.js.map +1 -1
- package/dist/config/findProjectRoot.js +6 -2
- package/dist/config/findProjectRoot.js.map +1 -1
- package/dist/config/findProjectRootSync.js +7 -3
- package/dist/config/findProjectRootSync.js.map +1 -1
- package/dist/config/studio/getStudioWorkspaces.js +14 -1
- package/dist/config/studio/getStudioWorkspaces.js.map +1 -1
- package/dist/config/studio/readStudioConfig.worker.js +6 -5
- package/dist/config/studio/readStudioConfig.worker.js.map +1 -1
- package/dist/errors/NonInteractiveError.js +18 -0
- package/dist/errors/NonInteractiveError.js.map +1 -0
- package/dist/{util → errors}/NotFoundError.js +1 -1
- package/dist/errors/NotFoundError.js.map +1 -0
- package/dist/errors/ProjectRootNotFoundError.js +35 -0
- package/dist/errors/ProjectRootNotFoundError.js.map +1 -0
- package/dist/index.d.ts +939 -5689
- package/dist/index.js +8 -14
- package/dist/index.js.map +1 -1
- package/dist/loaders/studio/studioWorkerLoader.worker.js +102 -23
- package/dist/loaders/studio/studioWorkerLoader.worker.js.map +1 -1
- package/dist/loaders/studio/studioWorkerTask.js +18 -27
- package/dist/loaders/studio/studioWorkerTask.js.map +1 -1
- package/dist/loaders/tsx/tsxWorkerLoader.worker.js +3 -4
- package/dist/loaders/tsx/tsxWorkerLoader.worker.js.map +1 -1
- package/dist/loaders/tsx/tsxWorkerTask.js +4 -34
- package/dist/loaders/tsx/tsxWorkerTask.js.map +1 -1
- package/dist/request/createRequester.js +83 -0
- package/dist/request/createRequester.js.map +1 -0
- package/dist/services/apiClient.js +7 -3
- package/dist/services/apiClient.js.map +1 -1
- package/dist/services/cliUserConfig.js +5 -5
- package/dist/services/cliUserConfig.js.map +1 -1
- package/dist/services/getCliToken.js +2 -2
- package/dist/services/getCliToken.js.map +1 -1
- package/dist/util/doImport.js +2 -1
- package/dist/util/doImport.js.map +1 -1
- package/dist/util/environment/mockBrowserEnvironment.js +1 -0
- package/dist/util/environment/mockBrowserEnvironment.js.map +1 -1
- package/dist/util/getCliTelemetry.js +6 -8
- package/dist/util/getCliTelemetry.js.map +1 -1
- package/dist/util/getSanityUrl.js +4 -3
- package/dist/util/getSanityUrl.js.map +1 -1
- package/dist/util/importModule.js +32 -0
- package/dist/util/importModule.js.map +1 -0
- package/dist/util/isInteractive.js +1 -1
- package/dist/util/isInteractive.js.map +1 -1
- package/dist/util/packageManager.js +55 -0
- package/dist/util/packageManager.js.map +1 -0
- package/dist/util/promisifyWorker.js +72 -0
- package/dist/util/promisifyWorker.js.map +1 -0
- package/dist/util/readPackageJson.js +74 -0
- package/dist/util/readPackageJson.js.map +1 -0
- package/dist/ux/prompts.js +49 -1
- package/dist/ux/prompts.js.map +1 -1
- package/package.json +44 -40
- package/dist/_exports/tree.d.ts +0 -47
- package/dist/_exports/tree.js +0 -3
- package/dist/_exports/tree.js.map +0 -1
- package/dist/config/cli/getCliConfig.worker.js +0 -15
- package/dist/config/cli/getCliConfig.worker.js.map +0 -1
- package/dist/telemetry/cleanupOldTelemetryFiles.js +0 -30
- package/dist/telemetry/cleanupOldTelemetryFiles.js.map +0 -1
- package/dist/telemetry/createTelemetryStore.js +0 -95
- package/dist/telemetry/createTelemetryStore.js.map +0 -1
- package/dist/telemetry/createTraceId.js +0 -10
- package/dist/telemetry/createTraceId.js.map +0 -1
- package/dist/telemetry/findTelemetryFiles.js +0 -36
- package/dist/telemetry/findTelemetryFiles.js.map +0 -1
- package/dist/telemetry/flushTelemetryFiles.js +0 -107
- package/dist/telemetry/flushTelemetryFiles.js.map +0 -1
- package/dist/telemetry/generateTelemetryFilePath.js +0 -30
- package/dist/telemetry/generateTelemetryFilePath.js.map +0 -1
- package/dist/telemetry/logger.js +0 -54
- package/dist/telemetry/logger.js.map +0 -1
- package/dist/telemetry/telemetryStoreDebug.js +0 -7
- package/dist/telemetry/telemetryStoreDebug.js.map +0 -1
- package/dist/telemetry/trace.js +0 -150
- package/dist/telemetry/trace.js.map +0 -1
- package/dist/util/NotFoundError.js.map +0 -1
- package/dist/util/createExpiringConfig.js +0 -60
- package/dist/util/createExpiringConfig.js.map +0 -1
- package/dist/util/parseStringFlag.js +0 -19
- package/dist/util/parseStringFlag.js.map +0 -1
- package/dist/util/tree.js +0 -108
- package/dist/util/tree.js.map +0 -1
- package/dist/util/waitForAsync.js +0 -5
- package/dist/util/waitForAsync.js.map +0 -1
- package/dist/ux/formatObject.js +0 -9
- package/dist/ux/formatObject.js.map +0 -1
- package/dist/ux/printKeyValue.js +0 -16
- package/dist/ux/printKeyValue.js.map +0 -1
package/dist/SanityCommand.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { Command } from '@oclif/core';
|
|
2
2
|
import { getCliConfig } from './config/cli/getCliConfig.js';
|
|
3
3
|
import { findProjectRoot } from './config/findProjectRoot.js';
|
|
4
|
+
import { subdebug } from './debug.js';
|
|
5
|
+
import { NonInteractiveError } from './errors/NonInteractiveError.js';
|
|
6
|
+
import { ProjectRootNotFoundError } from './errors/ProjectRootNotFoundError.js';
|
|
4
7
|
import { getGlobalCliClient, getProjectCliClient } from './services/apiClient.js';
|
|
5
8
|
import { getCliTelemetry } from './util/getCliTelemetry.js';
|
|
6
9
|
import { isInteractive } from './util/isInteractive.js';
|
|
10
|
+
const debug = subdebug('sanityCommand');
|
|
7
11
|
export class SanityCommand extends Command {
|
|
8
12
|
args;
|
|
9
13
|
flags;
|
|
@@ -48,15 +52,72 @@ export class SanityCommand extends Command {
|
|
|
48
52
|
* @returns The CLI config.
|
|
49
53
|
*/ async getCliConfig() {
|
|
50
54
|
const root = await this.getProjectRoot();
|
|
55
|
+
debug(`Using project root`, root);
|
|
51
56
|
return getCliConfig(root.directory);
|
|
52
57
|
}
|
|
53
58
|
/**
|
|
54
|
-
* Get the project ID from the CLI config.
|
|
59
|
+
* Get the project ID from passed flags or (if not provided) the CLI config.
|
|
55
60
|
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
61
|
+
* Optionally accepts a `fallback` function that is called when no project ID
|
|
62
|
+
* can be determined from flags or config. This allows commands to provide
|
|
63
|
+
* interactive project selection while keeping the prompt logic in the CLI package.
|
|
64
|
+
*
|
|
65
|
+
* If the fallback throws a `NonInteractiveError` (e.g. because the terminal is
|
|
66
|
+
* not interactive), it falls through to the standard error with suggestions.
|
|
67
|
+
*
|
|
68
|
+
* Optionally accepts a `deprecatedFlagName` for commands that have a deprecated
|
|
69
|
+
* flag (e.g. `--project`) that should be checked after `--project-id` but before
|
|
70
|
+
* the CLI config.
|
|
71
|
+
*
|
|
72
|
+
* @returns The project ID.
|
|
73
|
+
*/ async getProjectId(options) {
|
|
74
|
+
const hasProjectFlag = this.ctor.flags != null && 'project-id' in this.ctor.flags;
|
|
75
|
+
// Check --project-id flag first
|
|
76
|
+
if (hasProjectFlag) {
|
|
77
|
+
const flagProjectId = 'project-id' in this.flags && typeof this.flags['project-id'] === 'string' ? this.flags['project-id'] : undefined;
|
|
78
|
+
if (flagProjectId) return flagProjectId;
|
|
79
|
+
}
|
|
80
|
+
// Check deprecated flag (e.g. --project) before CLI config
|
|
81
|
+
if (options?.deprecatedFlagName) {
|
|
82
|
+
const deprecatedValue = options.deprecatedFlagName in this.flags && typeof this.flags[options.deprecatedFlagName] === 'string' ? this.flags[options.deprecatedFlagName] : undefined;
|
|
83
|
+
if (deprecatedValue) return deprecatedValue;
|
|
84
|
+
}
|
|
85
|
+
// Fall back to CLI config
|
|
86
|
+
try {
|
|
87
|
+
const config = await this.getCliConfig();
|
|
88
|
+
const configProjectId = config.api?.projectId;
|
|
89
|
+
if (configProjectId) return configProjectId;
|
|
90
|
+
} catch (err) {
|
|
91
|
+
if (!(err instanceof ProjectRootNotFoundError)) throw err;
|
|
92
|
+
// No project root — fall through to fallback/error
|
|
93
|
+
}
|
|
94
|
+
// Offer interactive selection if a fallback was provided
|
|
95
|
+
if (options?.fallback) {
|
|
96
|
+
try {
|
|
97
|
+
return await options.fallback();
|
|
98
|
+
} catch (err) {
|
|
99
|
+
if (!(err instanceof NonInteractiveError)) throw err;
|
|
100
|
+
// Non-interactive: throw with actionable suggestions
|
|
101
|
+
throw new ProjectRootNotFoundError('Unable to determine project ID', {
|
|
102
|
+
cause: err,
|
|
103
|
+
suggestions: [
|
|
104
|
+
...hasProjectFlag ? [
|
|
105
|
+
'Providing a project ID: --project-id <project-id>'
|
|
106
|
+
] : [],
|
|
107
|
+
'Running this command from within a Sanity project directory',
|
|
108
|
+
'Running in an interactive terminal to get a project selection prompt'
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
throw new ProjectRootNotFoundError('Unable to determine project ID', {
|
|
114
|
+
suggestions: [
|
|
115
|
+
...hasProjectFlag ? [
|
|
116
|
+
'Providing a project ID: --project-id <project-id>'
|
|
117
|
+
] : [],
|
|
118
|
+
'Running this command from within a Sanity project directory'
|
|
119
|
+
]
|
|
120
|
+
});
|
|
60
121
|
}
|
|
61
122
|
/**
|
|
62
123
|
* Get the project's root directory by resolving the config
|
|
@@ -98,6 +159,21 @@ export class SanityCommand extends Command {
|
|
|
98
159
|
*/ resolveIsInteractive() {
|
|
99
160
|
return isInteractive();
|
|
100
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Get the CLI config, returning an empty config if no project root is found.
|
|
164
|
+
*
|
|
165
|
+
* Use this instead of `getCliConfig()` in commands that can operate without a
|
|
166
|
+
* project directory (e.g. when `--project-id` and `--dataset` flags are provided).
|
|
167
|
+
*
|
|
168
|
+
* @returns The CLI config, or an empty config object if no project root is found.
|
|
169
|
+
*/ async tryGetCliConfig() {
|
|
170
|
+
try {
|
|
171
|
+
return await this.getCliConfig();
|
|
172
|
+
} catch (err) {
|
|
173
|
+
if (!(err instanceof ProjectRootNotFoundError)) throw err;
|
|
174
|
+
return {};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
101
177
|
}
|
|
102
178
|
|
|
103
179
|
//# sourceMappingURL=SanityCommand.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/SanityCommand.ts"],"sourcesContent":["import {Command, Interfaces} from '@oclif/core'\n\nimport {getCliConfig} from './config/cli/getCliConfig.js'\nimport {type CliConfig} from './config/cli/types/cliConfig.js'\nimport {findProjectRoot} from './config/findProjectRoot.js'\nimport {type ProjectRootResult} from './config/util/recursivelyResolveProjectRoot.js'\nimport {\n getGlobalCliClient,\n getProjectCliClient,\n type GlobalCliClientOptions,\n type ProjectCliClientOptions,\n} from './services/apiClient.js'\nimport {type CLITelemetryStore} from './telemetry/types.js'\nimport {type Output} from './types.js'\nimport {getCliTelemetry} from './util/getCliTelemetry.js'\nimport {isInteractive} from './util/isInteractive.js'\n\ntype Flags<T extends typeof Command> = Interfaces.InferredFlags<\n (typeof SanityCommand)['baseFlags'] & T['flags']\n>\n\ntype Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>\n\nexport abstract class SanityCommand<T extends typeof Command> extends Command {\n protected args!: Args<T>\n protected flags!: Flags<T>\n\n /**\n * Get the global API client.\n *\n * @param args - The global API client options.\n * @returns The global API client.\n *\n * @deprecated use `getGlobalCliClient` function directly instead.\n */\n protected getGlobalApiClient = (args: GlobalCliClientOptions) => getGlobalCliClient(args)\n\n /**\n * Get the project API client.\n *\n * @param args - The project API client options.\n * @returns The project API client.\n *\n * @deprecated use `getProjectCliClient` function directly instead.\n */\n protected getProjectApiClient = (args: ProjectCliClientOptions) => getProjectCliClient(args)\n\n /**\n * Helper for outputting to the console.\n *\n * @example\n * ```ts\n * this.output.log('Hello')\n * this.output.warn('Warning')\n * this.output.error('Error')\n * ```\n */\n protected output: Output = {\n error: this.error.bind(this),\n log: this.log.bind(this),\n warn: this.warn.bind(this),\n }\n\n /**\n * The telemetry store.\n *\n * @returns The telemetry store.\n */\n protected telemetry!: CLITelemetryStore\n\n /**\n * Get the CLI config.\n *\n * @returns The CLI config.\n */\n protected async getCliConfig(): Promise<CliConfig> {\n const root = await this.getProjectRoot()\n\n return getCliConfig(root.directory)\n }\n\n /**\n * Get the project ID from the CLI config.\n *\n * @returns The project ID or `undefined` if it's not set.\n */\n protected async getProjectId(): Promise<string | undefined> {\n const config = await this.getCliConfig()\n\n return config.api?.projectId\n }\n\n /**\n * Get the project's root directory by resolving the config\n *\n * @returns The project root result.\n */\n protected getProjectRoot(): Promise<ProjectRootResult> {\n return findProjectRoot(process.cwd())\n }\n\n public async init(): Promise<void> {\n const {args, flags} = await this.parse({\n args: this.ctor.args,\n baseFlags: (super.ctor as typeof SanityCommand).baseFlags,\n enableJsonFlag: this.ctor.enableJsonFlag,\n flags: this.ctor.flags,\n strict: this.ctor.strict,\n })\n\n this.args = args as Args<T>\n this.flags = flags as Flags<T>\n this.telemetry = getCliTelemetry()\n\n await super.init()\n }\n\n /**\n * Check if the command is running in unattended mode.\n *\n * This means the command should not ask for user input, instead using defaults where\n * possible, and if that does not make sense (eg there's missing information), then we\n * should error out (remember to exit with a non-zero code).\n *\n * Most commands should take an explicit `--yes` flag to enable unattended mode, but\n * some commands may also be run in unattended mode if `process.stdin` is not a TTY\n * (eg when running in a CI environment).\n */\n protected isUnattended(): boolean {\n return this.flags.yes || !this.resolveIsInteractive()\n }\n\n /**\n * Resolver for checking if the terminal is interactive. Override in tests to provide mock values.\n *\n * @returns Whether the terminal is interactive.\n */\n protected resolveIsInteractive(): boolean {\n return isInteractive()\n }\n}\n"],"names":["Command","getCliConfig","findProjectRoot","getGlobalCliClient","getProjectCliClient","getCliTelemetry","isInteractive","SanityCommand","args","flags","getGlobalApiClient","getProjectApiClient","output","error","bind","log","warn","telemetry","root","getProjectRoot","directory","getProjectId","config","api","projectId","process","cwd","init","parse","ctor","baseFlags","enableJsonFlag","strict","isUnattended","yes","resolveIsInteractive"],"mappings":"AAAA,SAAQA,OAAO,QAAmB,cAAa;AAE/C,SAAQC,YAAY,QAAO,+BAA8B;AAEzD,SAAQC,eAAe,QAAO,8BAA6B;AAE3D,SACEC,kBAAkB,EAClBC,mBAAmB,QAGd,0BAAyB;AAGhC,SAAQC,eAAe,QAAO,4BAA2B;AACzD,SAAQC,aAAa,QAAO,0BAAyB;AAQrD,OAAO,MAAeC,sBAAgDP;IAC1DQ,KAAc;IACdC,MAAgB;IAE1B;;;;;;;GAOC,GACD,AAAUC,qBAAqB,CAACF,OAAiCL,mBAAmBK,MAAK;IAEzF;;;;;;;GAOC,GACD,AAAUG,sBAAsB,CAACH,OAAkCJ,oBAAoBI,MAAK;IAE5F;;;;;;;;;GASC,GACD,AAAUI,SAAiB;QACzBC,OAAO,IAAI,CAACA,KAAK,CAACC,IAAI,CAAC,IAAI;QAC3BC,KAAK,IAAI,CAACA,GAAG,CAACD,IAAI,CAAC,IAAI;QACvBE,MAAM,IAAI,CAACA,IAAI,CAACF,IAAI,CAAC,IAAI;IAC3B,EAAC;IAED;;;;GAIC,GACD,AAAUG,UAA6B;IAEvC;;;;GAIC,GACD,MAAgBhB,eAAmC;QACjD,MAAMiB,OAAO,MAAM,IAAI,CAACC,cAAc;QAEtC,OAAOlB,aAAaiB,KAAKE,SAAS;IACpC;IAEA;;;;GAIC,GACD,MAAgBC,eAA4C;QAC1D,MAAMC,SAAS,MAAM,IAAI,CAACrB,YAAY;QAEtC,OAAOqB,OAAOC,GAAG,EAAEC;IACrB;IAEA;;;;GAIC,GACD,AAAUL,iBAA6C;QACrD,OAAOjB,gBAAgBuB,QAAQC,GAAG;IACpC;IAEA,MAAaC,OAAsB;QACjC,MAAM,EAACnB,IAAI,EAAEC,KAAK,EAAC,GAAG,MAAM,IAAI,CAACmB,KAAK,CAAC;YACrCpB,MAAM,IAAI,CAACqB,IAAI,CAACrB,IAAI;YACpBsB,WAAW,AAAC,KAAK,CAACD,KAA8BC,SAAS;YACzDC,gBAAgB,IAAI,CAACF,IAAI,CAACE,cAAc;YACxCtB,OAAO,IAAI,CAACoB,IAAI,CAACpB,KAAK;YACtBuB,QAAQ,IAAI,CAACH,IAAI,CAACG,MAAM;QAC1B;QAEA,IAAI,CAACxB,IAAI,GAAGA;QACZ,IAAI,CAACC,KAAK,GAAGA;QACb,IAAI,CAACQ,SAAS,GAAGZ;QAEjB,MAAM,KAAK,CAACsB;IACd;IAEA;;;;;;;;;;GAUC,GACD,AAAUM,eAAwB;QAChC,OAAO,IAAI,CAACxB,KAAK,CAACyB,GAAG,IAAI,CAAC,IAAI,CAACC,oBAAoB;IACrD;IAEA;;;;GAIC,GACD,AAAUA,uBAAgC;QACxC,OAAO7B;IACT;AACF"}
|
|
1
|
+
{"version":3,"sources":["../src/SanityCommand.ts"],"sourcesContent":["import {Command, Interfaces} from '@oclif/core'\n\nimport {getCliConfig} from './config/cli/getCliConfig.js'\nimport {type CliConfig} from './config/cli/types/cliConfig.js'\nimport {findProjectRoot} from './config/findProjectRoot.js'\nimport {type ProjectRootResult} from './config/util/recursivelyResolveProjectRoot.js'\nimport {subdebug} from './debug.js'\nimport {NonInteractiveError} from './errors/NonInteractiveError.js'\nimport {ProjectRootNotFoundError} from './errors/ProjectRootNotFoundError.js'\nimport {\n getGlobalCliClient,\n getProjectCliClient,\n type GlobalCliClientOptions,\n type ProjectCliClientOptions,\n} from './services/apiClient.js'\nimport {type CLITelemetryStore} from './telemetry/types.js'\nimport {type Output} from './types.js'\nimport {getCliTelemetry} from './util/getCliTelemetry.js'\nimport {isInteractive} from './util/isInteractive.js'\n\ntype Flags<T extends typeof Command> = Interfaces.InferredFlags<\n (typeof SanityCommand)['baseFlags'] & T['flags']\n>\n\ntype Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>\n\nconst debug = subdebug('sanityCommand')\n\nexport abstract class SanityCommand<T extends typeof Command> extends Command {\n protected args!: Args<T>\n protected flags!: Flags<T>\n\n /**\n * Get the global API client.\n *\n * @param args - The global API client options.\n * @returns The global API client.\n *\n * @deprecated use `getGlobalCliClient` function directly instead.\n */\n protected getGlobalApiClient = (args: GlobalCliClientOptions) => getGlobalCliClient(args)\n\n /**\n * Get the project API client.\n *\n * @param args - The project API client options.\n * @returns The project API client.\n *\n * @deprecated use `getProjectCliClient` function directly instead.\n */\n protected getProjectApiClient = (args: ProjectCliClientOptions) => getProjectCliClient(args)\n\n /**\n * Helper for outputting to the console.\n *\n * @example\n * ```ts\n * this.output.log('Hello')\n * this.output.warn('Warning')\n * this.output.error('Error')\n * ```\n */\n protected output: Output = {\n error: this.error.bind(this),\n log: this.log.bind(this),\n warn: this.warn.bind(this),\n }\n\n /**\n * The telemetry store.\n *\n * @returns The telemetry store.\n */\n protected telemetry!: CLITelemetryStore\n\n /**\n * Get the CLI config.\n *\n * @returns The CLI config.\n */\n protected async getCliConfig(): Promise<CliConfig> {\n const root = await this.getProjectRoot()\n\n debug(`Using project root`, root)\n return getCliConfig(root.directory)\n }\n\n /**\n * Get the project ID from passed flags or (if not provided) the CLI config.\n *\n * Optionally accepts a `fallback` function that is called when no project ID\n * can be determined from flags or config. This allows commands to provide\n * interactive project selection while keeping the prompt logic in the CLI package.\n *\n * If the fallback throws a `NonInteractiveError` (e.g. because the terminal is\n * not interactive), it falls through to the standard error with suggestions.\n *\n * Optionally accepts a `deprecatedFlagName` for commands that have a deprecated\n * flag (e.g. `--project`) that should be checked after `--project-id` but before\n * the CLI config.\n *\n * @returns The project ID.\n */\n protected async getProjectId(options?: {\n deprecatedFlagName?: string\n fallback?: () => Promise<string>\n }): Promise<string> {\n const hasProjectFlag = this.ctor.flags != null && 'project-id' in this.ctor.flags\n\n // Check --project-id flag first\n if (hasProjectFlag) {\n const flagProjectId =\n 'project-id' in this.flags && typeof this.flags['project-id'] === 'string'\n ? this.flags['project-id']\n : undefined\n\n if (flagProjectId) return flagProjectId\n }\n\n // Check deprecated flag (e.g. --project) before CLI config\n if (options?.deprecatedFlagName) {\n const deprecatedValue =\n options.deprecatedFlagName in this.flags &&\n typeof this.flags[options.deprecatedFlagName] === 'string'\n ? (this.flags[options.deprecatedFlagName] as string)\n : undefined\n\n if (deprecatedValue) return deprecatedValue\n }\n\n // Fall back to CLI config\n try {\n const config = await this.getCliConfig()\n const configProjectId = config.api?.projectId\n if (configProjectId) return configProjectId\n } catch (err) {\n if (!(err instanceof ProjectRootNotFoundError)) throw err\n // No project root — fall through to fallback/error\n }\n\n // Offer interactive selection if a fallback was provided\n if (options?.fallback) {\n try {\n return await options.fallback()\n } catch (err) {\n if (!(err instanceof NonInteractiveError)) throw err\n // Non-interactive: throw with actionable suggestions\n throw new ProjectRootNotFoundError('Unable to determine project ID', {\n cause: err,\n suggestions: [\n ...(hasProjectFlag ? ['Providing a project ID: --project-id <project-id>'] : []),\n 'Running this command from within a Sanity project directory',\n 'Running in an interactive terminal to get a project selection prompt',\n ],\n })\n }\n }\n\n throw new ProjectRootNotFoundError('Unable to determine project ID', {\n suggestions: [\n ...(hasProjectFlag ? ['Providing a project ID: --project-id <project-id>'] : []),\n 'Running this command from within a Sanity project directory',\n ],\n })\n }\n\n /**\n * Get the project's root directory by resolving the config\n *\n * @returns The project root result.\n */\n protected getProjectRoot(): Promise<ProjectRootResult> {\n return findProjectRoot(process.cwd())\n }\n\n public async init(): Promise<void> {\n const {args, flags} = await this.parse({\n args: this.ctor.args,\n baseFlags: (super.ctor as typeof SanityCommand).baseFlags,\n enableJsonFlag: this.ctor.enableJsonFlag,\n flags: this.ctor.flags,\n strict: this.ctor.strict,\n })\n\n this.args = args as Args<T>\n this.flags = flags as Flags<T>\n this.telemetry = getCliTelemetry()\n\n await super.init()\n }\n\n /**\n * Check if the command is running in unattended mode.\n *\n * This means the command should not ask for user input, instead using defaults where\n * possible, and if that does not make sense (eg there's missing information), then we\n * should error out (remember to exit with a non-zero code).\n *\n * Most commands should take an explicit `--yes` flag to enable unattended mode, but\n * some commands may also be run in unattended mode if `process.stdin` is not a TTY\n * (eg when running in a CI environment).\n */\n protected isUnattended(): boolean {\n return this.flags.yes || !this.resolveIsInteractive()\n }\n\n /**\n * Resolver for checking if the terminal is interactive. Override in tests to provide mock values.\n *\n * @returns Whether the terminal is interactive.\n */\n protected resolveIsInteractive(): boolean {\n return isInteractive()\n }\n\n /**\n * Get the CLI config, returning an empty config if no project root is found.\n *\n * Use this instead of `getCliConfig()` in commands that can operate without a\n * project directory (e.g. when `--project-id` and `--dataset` flags are provided).\n *\n * @returns The CLI config, or an empty config object if no project root is found.\n */\n protected async tryGetCliConfig(): Promise<CliConfig> {\n try {\n return await this.getCliConfig()\n } catch (err) {\n if (!(err instanceof ProjectRootNotFoundError)) throw err\n return {}\n }\n }\n}\n"],"names":["Command","getCliConfig","findProjectRoot","subdebug","NonInteractiveError","ProjectRootNotFoundError","getGlobalCliClient","getProjectCliClient","getCliTelemetry","isInteractive","debug","SanityCommand","args","flags","getGlobalApiClient","getProjectApiClient","output","error","bind","log","warn","telemetry","root","getProjectRoot","directory","getProjectId","options","hasProjectFlag","ctor","flagProjectId","undefined","deprecatedFlagName","deprecatedValue","config","configProjectId","api","projectId","err","fallback","cause","suggestions","process","cwd","init","parse","baseFlags","enableJsonFlag","strict","isUnattended","yes","resolveIsInteractive","tryGetCliConfig"],"mappings":"AAAA,SAAQA,OAAO,QAAmB,cAAa;AAE/C,SAAQC,YAAY,QAAO,+BAA8B;AAEzD,SA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I,CAAChB,IAAI;YACpBiC,WAAW,AAAC,KAAK,CAACjB,KAA8BiB,SAAS;YACzDC,gBAAgB,IAAI,CAAClB,IAAI,CAACkB,cAAc;YACxCjC,OAAO,IAAI,CAACe,IAAI,CAACf,KAAK;YACtBkC,QAAQ,IAAI,CAACnB,IAAI,CAACmB,MAAM;QAC1B;QAEA,IAAI,CAACnC,IAAI,GAAGA;QACZ,IAAI,CAACC,KAAK,GAAGA;QACb,IAAI,CAACQ,SAAS,GAAGb;QAEjB,MAAM,KAAK,CAACmC;IACd;IAEA;;;;;;;;;;GAUC,GACD,AAAUK,eAAwB;QAChC,OAAO,IAAI,CAACnC,KAAK,CAACoC,GAAG,IAAI,CAAC,IAAI,CAACC,oBAAoB;IACrD;IAEA;;;;GAIC,GACD,AAAUA,uBAAgC;QACxC,OAAOzC;IACT;IAEA;;;;;;;GAOC,GACD,MAAgB0C,kBAAsC;QACpD,IAAI;YACF,OAAO,MAAM,IAAI,CAAClD,YAAY;QAChC,EAAE,OAAOoC,KAAK;YACZ,IAAI,CAAEA,CAAAA,eAAehC,wBAAuB,GAAI,MAAMgC;YACtD,OAAO,CAAC;QACV;IACF;AACF"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime-detectable package managers (excludes 'manual' which is a UI-only choice).
|
|
3
|
+
*/
|
|
4
|
+
export declare type DetectedPackageManager = "bun" | "npm" | "pnpm" | "yarn";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Return the CLI invocation command for the detected (or provided) package manager.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Optional `bin` (defaults to `'sanity'`) and `userAgent` override.
|
|
10
|
+
* @returns A string like `"npx sanity"`, `"pnpm exec sanity"`, etc.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getBinCommand(options?: {
|
|
13
|
+
bin?: string;
|
|
14
|
+
userAgent?: string;
|
|
15
|
+
}): string;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Convenience wrapper that reads `process.env.npm_config_user_agent` and returns
|
|
19
|
+
* the detected package manager.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getRunningPackageManager():
|
|
22
|
+
| DetectedPackageManager
|
|
23
|
+
| undefined;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Extract the yarn major version from a `npm_config_user_agent` string.
|
|
27
|
+
*
|
|
28
|
+
* @param ua - User-agent string. Defaults to `process.env.npm_config_user_agent`.
|
|
29
|
+
* @returns The major version number, or `undefined` if yarn isn't detected.
|
|
30
|
+
*/
|
|
31
|
+
export declare function getYarnMajorVersion(ua?: string): number | undefined;
|
|
32
|
+
|
|
33
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/package-manager.ts"],"sourcesContent":["export {\n type DetectedPackageManager,\n getBinCommand,\n getRunningPackageManager,\n getYarnMajorVersion,\n} from '../util/packageManager.js'\n"],"names":["getBinCommand","getRunningPackageManager","getYarnMajorVersion"],"mappings":"AAAA,SAEEA,aAAa,EACbC,wBAAwB,EACxBC,mBAAmB,QACd,4BAA2B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { agent } from "get-it/middleware";
|
|
2
|
+
import { base } from "get-it/middleware";
|
|
3
|
+
import { injectResponse } from "get-it/middleware";
|
|
4
|
+
import { jsonRequest } from "get-it/middleware";
|
|
5
|
+
import { jsonResponse } from "get-it/middleware";
|
|
6
|
+
import { keepAlive } from "get-it/middleware";
|
|
7
|
+
import { observable } from "get-it/middleware";
|
|
8
|
+
import { progress } from "get-it/middleware";
|
|
9
|
+
import { proxy } from "get-it/middleware";
|
|
10
|
+
import { Requester } from "get-it";
|
|
11
|
+
import { retry } from "get-it/middleware";
|
|
12
|
+
import { urlEncoded } from "get-it/middleware";
|
|
13
|
+
|
|
14
|
+
export { agent };
|
|
15
|
+
|
|
16
|
+
export { base };
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Creates a `get-it` requester with a standard set of middleware.
|
|
20
|
+
*
|
|
21
|
+
* Default middleware (in order):
|
|
22
|
+
* 1. `httpErrors()` — throw on HTTP error status codes
|
|
23
|
+
* 2. `headers({'User-Agent': '@sanity/cli-core@<version>'})` — identify CLI requests
|
|
24
|
+
* 3. `debug({verbose: true, namespace: 'sanity:cli'})` — debug logging
|
|
25
|
+
* 4. `promise({onlyBody: true})` — return body directly (must be last)
|
|
26
|
+
*
|
|
27
|
+
* @param options - Optional configuration to disable or customize middleware
|
|
28
|
+
* @returns A configured `get-it` requester
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare function createRequester(options?: {
|
|
32
|
+
middleware?: MiddlewareOptions;
|
|
33
|
+
}): Requester;
|
|
34
|
+
|
|
35
|
+
export { injectResponse };
|
|
36
|
+
|
|
37
|
+
export { jsonRequest };
|
|
38
|
+
|
|
39
|
+
export { jsonResponse };
|
|
40
|
+
|
|
41
|
+
export { keepAlive };
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Options for configuring individual middleware in {@link createRequester}.
|
|
45
|
+
*
|
|
46
|
+
* Each key corresponds to a middleware. Omitting a key uses the default,
|
|
47
|
+
* `false` disables it, and an object merges with the defaults.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export declare type MiddlewareOptions = {
|
|
52
|
+
debug?:
|
|
53
|
+
| false
|
|
54
|
+
| {
|
|
55
|
+
namespace?: string;
|
|
56
|
+
verbose?: boolean;
|
|
57
|
+
};
|
|
58
|
+
headers?: false | Record<string, string>;
|
|
59
|
+
httpErrors?: false;
|
|
60
|
+
promise?:
|
|
61
|
+
| false
|
|
62
|
+
| {
|
|
63
|
+
onlyBody?: boolean;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export { observable };
|
|
68
|
+
|
|
69
|
+
export { progress };
|
|
70
|
+
|
|
71
|
+
export { proxy };
|
|
72
|
+
|
|
73
|
+
export { Requester };
|
|
74
|
+
|
|
75
|
+
export { retry };
|
|
76
|
+
|
|
77
|
+
export { urlEncoded };
|
|
78
|
+
|
|
79
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createRequester } from '../request/createRequester.js';
|
|
2
|
+
// Re-export non-default middleware from get-it for use alongside createRequester.
|
|
3
|
+
// Default middleware (httpErrors, headers, debug, promise) are applied automatically
|
|
4
|
+
// by createRequester and don't need to be imported separately.
|
|
5
|
+
export { agent, base, injectResponse, jsonRequest, jsonResponse, keepAlive, observable, progress, proxy, retry, urlEncoded } from 'get-it/middleware';
|
|
6
|
+
|
|
7
|
+
//# sourceMappingURL=request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/request.ts"],"sourcesContent":["export {createRequester, type MiddlewareOptions} from '../request/createRequester.js'\n\n// Re-export get-it types used by consumers of createRequester\nexport {type Requester} from 'get-it'\n\n// Re-export non-default middleware from get-it for use alongside createRequester.\n// Default middleware (httpErrors, headers, debug, promise) are applied automatically\n// by createRequester and don't need to be imported separately.\nexport {\n agent,\n base,\n injectResponse,\n jsonRequest,\n jsonResponse,\n keepAlive,\n observable,\n progress,\n proxy,\n retry,\n urlEncoded,\n} from 'get-it/middleware'\n"],"names":["createRequester","agent","base","injectResponse","jsonRequest","jsonResponse","keepAlive","observable","progress","proxy","retry","urlEncoded"],"mappings":"AAAA,SAAQA,eAAe,QAA+B,gCAA+B;AAKrF,kFAAkF;AAClF,qFAAqF;AACrF,+DAA+D;AAC/D,SACEC,KAAK,EACLC,IAAI,EACJC,cAAc,EACdC,WAAW,EACXC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,KAAK,EACLC,KAAK,EACLC,UAAU,QACL,oBAAmB"}
|
package/dist/_exports/ux.d.ts
CHANGED
|
@@ -1,40 +1,75 @@
|
|
|
1
|
-
import {default as boxen} from
|
|
2
|
-
import {Options as BoxenOptions} from
|
|
3
|
-
import {Boxes} from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { default as boxen } from "boxen";
|
|
2
|
+
import { Options as BoxenOptions } from "boxen";
|
|
3
|
+
import { Boxes } from "boxen";
|
|
4
|
+
import { CLIError } from "@oclif/core/errors";
|
|
5
|
+
import { CustomBorderStyle } from "boxen";
|
|
6
|
+
import * as inquirer from "@inquirer/prompts";
|
|
7
|
+
import { default as logSymbols } from "log-symbols";
|
|
8
|
+
import { Separator } from "@inquirer/prompts";
|
|
9
|
+
import { Spacing } from "boxen";
|
|
10
|
+
import { Spinner } from "ora";
|
|
11
|
+
import { default as spinner } from "ora";
|
|
12
|
+
import { Ora as SpinnerInstance } from "ora";
|
|
13
|
+
import { Options as SpinnerOptions } from "ora";
|
|
14
|
+
import { oraPromise as spinnerPromise } from "ora";
|
|
15
|
+
import { PromiseOptions as SpinnerPromiseOptions } from "ora";
|
|
13
16
|
|
|
14
|
-
export {boxen}
|
|
17
|
+
export { boxen };
|
|
15
18
|
|
|
16
|
-
export {BoxenOptions}
|
|
19
|
+
export { BoxenOptions };
|
|
17
20
|
|
|
18
|
-
export {Boxes}
|
|
21
|
+
export { Boxes };
|
|
19
22
|
|
|
20
|
-
export
|
|
23
|
+
export declare const checkbox: typeof inquirer.checkbox;
|
|
21
24
|
|
|
22
|
-
|
|
25
|
+
declare const confirm_2: typeof inquirer.confirm;
|
|
26
|
+
export { confirm_2 as confirm };
|
|
23
27
|
|
|
24
|
-
export {
|
|
28
|
+
export { CustomBorderStyle };
|
|
25
29
|
|
|
26
|
-
export
|
|
30
|
+
export declare const editor: typeof inquirer.editor;
|
|
27
31
|
|
|
28
|
-
export
|
|
32
|
+
export declare const expand: typeof inquirer.expand;
|
|
29
33
|
|
|
30
|
-
export
|
|
34
|
+
export declare const input: typeof inquirer.input;
|
|
31
35
|
|
|
32
|
-
export {
|
|
36
|
+
export { logSymbols };
|
|
33
37
|
|
|
34
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Error thrown when a prompt is attempted in a non-interactive environment
|
|
40
|
+
* (e.g., CI, non-TTY, piped stdin). Callers can catch this specific error
|
|
41
|
+
* to provide appropriate fallback behavior.
|
|
42
|
+
*
|
|
43
|
+
* Extends `CLIError` to suppress stack traces in user-facing output.
|
|
44
|
+
*/
|
|
45
|
+
export declare class NonInteractiveError extends CLIError {
|
|
46
|
+
constructor(promptName: string);
|
|
47
|
+
}
|
|
35
48
|
|
|
36
|
-
export
|
|
49
|
+
export declare const number: typeof inquirer.number;
|
|
37
50
|
|
|
38
|
-
export
|
|
51
|
+
export declare const password: typeof inquirer.password;
|
|
39
52
|
|
|
40
|
-
export
|
|
53
|
+
export declare const rawlist: typeof inquirer.rawlist;
|
|
54
|
+
|
|
55
|
+
export declare const search: typeof inquirer.search;
|
|
56
|
+
|
|
57
|
+
export declare const select: typeof inquirer.select;
|
|
58
|
+
|
|
59
|
+
export { Separator };
|
|
60
|
+
|
|
61
|
+
export { Spacing };
|
|
62
|
+
|
|
63
|
+
export { Spinner };
|
|
64
|
+
|
|
65
|
+
export { spinner };
|
|
66
|
+
|
|
67
|
+
export { SpinnerInstance };
|
|
68
|
+
|
|
69
|
+
export { SpinnerOptions };
|
|
70
|
+
|
|
71
|
+
export { spinnerPromise };
|
|
72
|
+
|
|
73
|
+
export { SpinnerPromiseOptions };
|
|
74
|
+
|
|
75
|
+
export {};
|
package/dist/_exports/ux.js
CHANGED
package/dist/_exports/ux.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/_exports/ux.ts"],"sourcesContent":["export * from '../ux/boxen.js'\nexport * from '../ux/logSymbols.js'\nexport * from '../ux/prompts.js'\nexport * from '../ux/spinner.js'\n"],"names":[],"mappings":"AAAA,cAAc,iBAAgB;AAC9B,cAAc,sBAAqB;AACnC,cAAc,mBAAkB;AAChC,cAAc,mBAAkB"}
|
|
1
|
+
{"version":3,"sources":["../../src/_exports/ux.ts"],"sourcesContent":["export {NonInteractiveError} from '../errors/NonInteractiveError.js'\nexport * from '../ux/boxen.js'\nexport * from '../ux/logSymbols.js'\nexport * from '../ux/prompts.js'\nexport * from '../ux/spinner.js'\n"],"names":["NonInteractiveError"],"mappings":"AAAA,SAAQA,mBAAmB,QAAO,mCAAkC;AACpE,cAAc,iBAAgB;AAC9B,cAAc,sBAAqB;AACnC,cAAc,mBAAkB;AAChC,cAAc,mBAAkB"}
|
|
@@ -1,25 +1,36 @@
|
|
|
1
|
-
import { getTsconfig } from 'get-tsconfig';
|
|
2
|
-
import { tsImport } from 'tsx/esm/api';
|
|
3
1
|
import { debug } from '../../debug.js';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { tryGetDefaultExport } from '../../util/tryGetDefaultExport.js';
|
|
2
|
+
import { NotFoundError } from '../../errors/NotFoundError.js';
|
|
3
|
+
import { importModule } from '../../util/importModule.js';
|
|
7
4
|
import { findPathForFiles } from '../util/findConfigsPaths.js';
|
|
8
5
|
import { cliConfigSchema } from './schemas.js';
|
|
6
|
+
const cache = new Map();
|
|
9
7
|
/**
|
|
10
8
|
* Get the CLI config for a project, given the root path.
|
|
11
9
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
10
|
+
* Results are cached in-memory keyed by rootPath for the lifetime of the
|
|
11
|
+
* process. Since the CLI always runs from a single project root, the config
|
|
12
|
+
* won't change during a command's execution, so caching avoids redundant
|
|
13
|
+
* filesystem reads and jiti imports from the prerun hook, SanityCommand
|
|
14
|
+
* helpers, and action files.
|
|
15
|
+
*
|
|
16
|
+
* If loading fails the cached promise is evicted so the next call retries.
|
|
18
17
|
*
|
|
19
18
|
* @param rootPath - Root path for the project, eg where `sanity.cli.(ts|js)` is located.
|
|
20
19
|
* @returns The CLI config
|
|
21
20
|
* @internal
|
|
22
|
-
*/ export
|
|
21
|
+
*/ export function getCliConfig(rootPath) {
|
|
22
|
+
const cached = cache.get(rootPath);
|
|
23
|
+
if (cached) {
|
|
24
|
+
return cached;
|
|
25
|
+
}
|
|
26
|
+
const promise = loadCliConfig(rootPath).catch((err)=>{
|
|
27
|
+
cache.delete(rootPath);
|
|
28
|
+
throw err;
|
|
29
|
+
});
|
|
30
|
+
cache.set(rootPath, promise);
|
|
31
|
+
return promise;
|
|
32
|
+
}
|
|
33
|
+
async function loadCliConfig(rootPath) {
|
|
23
34
|
const paths = await findPathForFiles(rootPath, [
|
|
24
35
|
'sanity.cli.ts',
|
|
25
36
|
'sanity.cli.js'
|
|
@@ -32,36 +43,25 @@ import { cliConfigSchema } from './schemas.js';
|
|
|
32
43
|
throw new Error(`Multiple CLI config files found (${configPaths.map((path)=>path.path).join(', ')})`);
|
|
33
44
|
}
|
|
34
45
|
const configPath = configPaths[0].path;
|
|
46
|
+
debug(`Loading CLI config from: ${configPath}`);
|
|
35
47
|
let cliConfig;
|
|
36
48
|
try {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
workerData: {
|
|
41
|
-
configPath
|
|
42
|
-
}
|
|
43
|
-
});
|
|
49
|
+
const result = await importModule(configPath);
|
|
50
|
+
debug('CLI config loaded: %o', result);
|
|
51
|
+
cliConfig = result;
|
|
44
52
|
} catch (err) {
|
|
45
53
|
debug('Failed to load CLI config in worker thread: %s', err);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const tsconfig = getTsconfig(rootPath);
|
|
49
|
-
// Ensure we get the default export (sometimes we get a bit of a mixed bag)
|
|
50
|
-
cliConfig = await tsImport(configPath, {
|
|
51
|
-
parentURL: import.meta.url,
|
|
52
|
-
tsconfig: tsconfig?.path ?? undefined
|
|
54
|
+
throw new Error('CLI config cannot be loaded', {
|
|
55
|
+
cause: err
|
|
53
56
|
});
|
|
54
|
-
cliConfig = tryGetDefaultExport(cliConfig);
|
|
55
|
-
if (!cliConfig) {
|
|
56
|
-
throw new Error('Invalid CLI config structure');
|
|
57
|
-
}
|
|
58
57
|
}
|
|
59
58
|
const { data, error, success } = cliConfigSchema.safeParse(cliConfig);
|
|
60
59
|
if (!success) {
|
|
61
|
-
|
|
60
|
+
debug(`Invalid CLI config: ${error.message}`);
|
|
61
|
+
throw new Error(`Invalid CLI config: ${error.message}`, {
|
|
62
|
+
cause: error
|
|
63
|
+
});
|
|
62
64
|
}
|
|
63
|
-
// There is a minor difference here because of the `vite` property and how the types
|
|
64
|
-
// aren't as specific as our manually typed `CliConfig` type, thus the cast.
|
|
65
65
|
return data;
|
|
66
66
|
}
|
|
67
67
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/cli/getCliConfig.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"sources":["../../../src/config/cli/getCliConfig.ts"],"sourcesContent":["import {debug} from '../../debug.js'\nimport {NotFoundError} from '../../errors/NotFoundError.js'\nimport {importModule} from '../../util/importModule.js'\nimport {findPathForFiles} from '../util/findConfigsPaths.js'\nimport {cliConfigSchema} from './schemas.js'\nimport {type CliConfig} from './types/cliConfig.js'\n\nconst cache = new Map<string, Promise<CliConfig>>()\n\n/**\n * Get the CLI config for a project, given the root path.\n *\n * Results are cached in-memory keyed by rootPath for the lifetime of the\n * process. Since the CLI always runs from a single project root, the config\n * won't change during a command's execution, so caching avoids redundant\n * filesystem reads and jiti imports from the prerun hook, SanityCommand\n * helpers, and action files.\n *\n * If loading fails the cached promise is evicted so the next call retries.\n *\n * @param rootPath - Root path for the project, eg where `sanity.cli.(ts|js)` is located.\n * @returns The CLI config\n * @internal\n */\nexport function getCliConfig(rootPath: string): Promise<CliConfig> {\n const cached = cache.get(rootPath)\n if (cached) {\n return cached\n }\n\n const promise = loadCliConfig(rootPath).catch((err) => {\n cache.delete(rootPath)\n throw err\n })\n\n cache.set(rootPath, promise)\n return promise\n}\n\nasync function loadCliConfig(rootPath: string): Promise<CliConfig> {\n const paths = await findPathForFiles(rootPath, ['sanity.cli.ts', 'sanity.cli.js'])\n const configPaths = paths.filter((path) => path.exists)\n\n if (configPaths.length === 0) {\n throw new NotFoundError(`No CLI config found at ${rootPath}/sanity.cli.(ts|js)`)\n }\n\n if (configPaths.length > 1) {\n throw new Error(\n `Multiple CLI config files found (${configPaths.map((path) => path.path).join(', ')})`,\n )\n }\n\n const configPath = configPaths[0].path\n\n debug(`Loading CLI config from: ${configPath}`)\n\n let cliConfig: CliConfig | undefined\n try {\n const result = await importModule<CliConfig>(configPath)\n\n debug('CLI config loaded: %o', result)\n\n cliConfig = result\n } catch (err) {\n debug('Failed to load CLI config in worker thread: %s', err)\n\n throw new Error('CLI config cannot be loaded', {cause: err})\n }\n\n const {data, error, success} = cliConfigSchema.safeParse(cliConfig)\n if (!success) {\n debug(`Invalid CLI config: ${error.message}`)\n throw new Error(`Invalid CLI config: ${error.message}`, {cause: error})\n }\n\n return data\n}\n"],"names":["debug","NotFoundError","importModule","findPathForFiles","cliConfigSchema","cache","Map","getCliConfig","rootPath","cached","get","promise","loadCliConfig","catch","err","delete","set","paths","configPaths","filter","path","exists","length","Error","map","join","configPath","cliConfig","result","cause","data","error","success","safeParse","message"],"mappings":"AAAA,SAAQA,KAAK,QAAO,iBAAgB;AACpC,SAAQC,aAAa,QAAO,gCAA+B;AAC3D,SAAQC,YAAY,QAAO,6BAA4B;AACvD,SAAQC,gBAAgB,QAAO,8BAA6B;AAC5D,SAAQC,eAAe,QAAO,eAAc;AAG5C,MAAMC,QAAQ,IAAIC;AAElB;;;;;;;;;;;;;;CAcC,GACD,OAAO,SAASC,aAAaC,QAAgB;IAC3C,MAAMC,SAASJ,MAAMK,GAAG,CAACF;IACzB,IAAIC,QAAQ;QACV,OAAOA;IACT;IAEA,MAAME,UAAUC,cAAcJ,UAAUK,KAAK,CAAC,CAACC;QAC7CT,MAAMU,MAAM,CAACP;QACb,MAAMM;IACR;IAEAT,MAAMW,GAAG,CAACR,UAAUG;IACpB,OAAOA;AACT;AAEA,eAAeC,cAAcJ,QAAgB;IAC3C,MAAMS,QAAQ,MAAMd,iBAAiBK,UAAU;QAAC;QAAiB;KAAgB;IACjF,MAAMU,cAAcD,MAAME,MAAM,CAAC,CAACC,OAASA,KAAKC,MAAM;IAEtD,IAAIH,YAAYI,MAAM,KAAK,GAAG;QAC5B,MAAM,IAAIrB,cAAc,CAAC,uBAAuB,EAAEO,SAAS,mBAAmB,CAAC;IACjF;IAEA,IAAIU,YAAYI,MAAM,GAAG,GAAG;QAC1B,MAAM,IAAIC,MACR,CAAC,iCAAiC,EAAEL,YAAYM,GAAG,CAAC,CAACJ,OAASA,KAAKA,IAAI,EAAEK,IAAI,CAAC,MAAM,CAAC,CAAC;IAE1F;IAEA,MAAMC,aAAaR,WAAW,CAAC,EAAE,CAACE,IAAI;IAEtCpB,MAAM,CAAC,yBAAyB,EAAE0B,YAAY;IAE9C,IAAIC;IACJ,IAAI;QACF,MAAMC,SAAS,MAAM1B,aAAwBwB;QAE7C1B,MAAM,yBAAyB4B;QAE/BD,YAAYC;IACd,EAAE,OAAOd,KAAK;QACZd,MAAM,kDAAkDc;QAExD,MAAM,IAAIS,MAAM,+BAA+B;YAACM,OAAOf;QAAG;IAC5D;IAEA,MAAM,EAACgB,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAC,GAAG5B,gBAAgB6B,SAAS,CAACN;IACzD,IAAI,CAACK,SAAS;QACZhC,MAAM,CAAC,oBAAoB,EAAE+B,MAAMG,OAAO,EAAE;QAC5C,MAAM,IAAIX,MAAM,CAAC,oBAAoB,EAAEQ,MAAMG,OAAO,EAAE,EAAE;YAACL,OAAOE;QAAK;IACvE;IAEA,OAAOD;AACT"}
|
|
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs';
|
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { register } from 'tsx/esm/api';
|
|
5
|
-
import { NotFoundError } from '../../
|
|
5
|
+
import { NotFoundError } from '../../errors/NotFoundError.js';
|
|
6
6
|
import { tryGetDefaultExport } from '../../util/tryGetDefaultExport.js';
|
|
7
7
|
import { cliConfigSchema } from './schemas.js';
|
|
8
8
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/cli/getCliConfigSync.ts"],"sourcesContent":["import {existsSync} from 'node:fs'\nimport {createRequire} from 'node:module'\nimport {join} from 'node:path'\n\nimport {register} from 'tsx/esm/api'\n\nimport {NotFoundError} from '../../
|
|
1
|
+
{"version":3,"sources":["../../../src/config/cli/getCliConfigSync.ts"],"sourcesContent":["import {existsSync} from 'node:fs'\nimport {createRequire} from 'node:module'\nimport {join} from 'node:path'\n\nimport {register} from 'tsx/esm/api'\n\nimport {NotFoundError} from '../../errors/NotFoundError.js'\nimport {tryGetDefaultExport} from '../../util/tryGetDefaultExport.js'\nimport {cliConfigSchema} from './schemas.js'\nimport {type CliConfig} from './types/cliConfig.js'\n\n/**\n * Get the CLI config for a project synchronously, given the root path.\n *\n * This loads the CLI config in the main thread using tsx/register for TypeScript support.\n * Note: This is a synchronous operation and does not use worker threads like the async version.\n *\n * @param rootPath - Root path for the project, eg where `sanity.cli.(ts|js)` is located.\n * @returns The CLI config\n * @internal\n */\nexport function getCliConfigSync(rootPath: string): CliConfig {\n const possiblePaths = ['sanity.cli.ts', 'sanity.cli.js'].map((file) => join(rootPath, file))\n const configPaths = possiblePaths.filter((path) => existsSync(path))\n\n if (configPaths.length === 0) {\n throw new NotFoundError(`No CLI config found at ${rootPath}/sanity.cli.(ts|js)`)\n }\n\n if (configPaths.length > 1) {\n throw new Error(`Multiple CLI config files found (${configPaths.join(', ')})`)\n }\n\n const configPath = configPaths[0]\n\n // Register tsx for TypeScript support\n const unregister = register()\n\n let cliConfig: CliConfig | undefined\n try {\n // Use createRequire for synchronous loading in ESM contexts\n // This works when tsx loader is active\n const require = createRequire(import.meta.url)\n const loaded = require(configPath)\n cliConfig = tryGetDefaultExport(loaded) as CliConfig | undefined\n } finally {\n unregister()\n }\n\n const {data, error, success} = cliConfigSchema.safeParse(cliConfig)\n if (!success) {\n throw new Error(`Invalid CLI config: ${error.message}`)\n }\n\n // There is a minor difference here because of the `vite` property and how the types\n // aren't as specific as our manually typed `CliConfig` type, thus the cast.\n return data as CliConfig\n}\n"],"names":["existsSync","createRequire","join","register","NotFoundError","tryGetDefaultExport","cliConfigSchema","getCliConfigSync","rootPath","possiblePaths","map","file","configPaths","filter","path","length","Error","configPath","unregister","cliConfig","require","url","loaded","data","error","success","safeParse","message"],"mappings":"AAAA,SAAQA,UAAU,QAAO,UAAS;AAClC,SAAQC,aAAa,QAAO,cAAa;AACzC,SAAQC,IAAI,QAAO,YAAW;AAE9B,SAAQC,QAAQ,QAAO,cAAa;AAEpC,SAAQC,aAAa,QAAO,gCAA+B;AAC3D,SAAQC,mBAAmB,QAAO,oCAAmC;AACrE,SAAQC,eAAe,QAAO,eAAc;AAG5C;;;;;;;;;CASC,GACD,OAAO,SAASC,iBAAiBC,QAAgB;IAC/C,MAAMC,gBAAgB;QAAC;QAAiB;KAAgB,CAACC,GAAG,CAAC,CAACC,OAAST,KAAKM,UAAUG;IACtF,MAAMC,cAAcH,cAAcI,MAAM,CAAC,CAACC,OAASd,WAAWc;IAE9D,IAAIF,YAAYG,MAAM,KAAK,GAAG;QAC5B,MAAM,IAAIX,cAAc,CAAC,uBAAuB,EAAEI,SAAS,mBAAmB,CAAC;IACjF;IAEA,IAAII,YAAYG,MAAM,GAAG,GAAG;QAC1B,MAAM,IAAIC,MAAM,CAAC,iCAAiC,EAAEJ,YAAYV,IAAI,CAAC,MAAM,CAAC,CAAC;IAC/E;IAEA,MAAMe,aAAaL,WAAW,CAAC,EAAE;IAEjC,sCAAsC;IACtC,MAAMM,aAAaf;IAEnB,IAAIgB;IACJ,IAAI;QACF,4DAA4D;QAC5D,uCAAuC;QACvC,MAAMC,UAAUnB,cAAc,YAAYoB,GAAG;QAC7C,MAAMC,SAASF,QAAQH;QACvBE,YAAYd,oBAAoBiB;IAClC,SAAU;QACRJ;IACF;IAEA,MAAM,EAACK,IAAI,EAAEC,KAAK,EAAEC,OAAO,EAAC,GAAGnB,gBAAgBoB,SAAS,CAACP;IACzD,IAAI,CAACM,SAAS;QACZ,MAAM,IAAIT,MAAM,CAAC,oBAAoB,EAAEQ,MAAMG,OAAO,EAAE;IACxD;IAEA,oFAAoF;IACpF,4EAA4E;IAC5E,OAAOJ;AACT"}
|
|
@@ -40,6 +40,13 @@ import { z } from 'zod';
|
|
|
40
40
|
}).optional(),
|
|
41
41
|
reactCompiler: z.custom().optional(),
|
|
42
42
|
reactStrictMode: z.boolean().optional(),
|
|
43
|
+
schemaExtraction: z.object({
|
|
44
|
+
enabled: z.boolean().optional(),
|
|
45
|
+
enforceRequiredFields: z.boolean().optional(),
|
|
46
|
+
path: z.string().optional(),
|
|
47
|
+
watchPatterns: z.array(z.string()).optional(),
|
|
48
|
+
workspace: z.string().optional()
|
|
49
|
+
}).optional(),
|
|
43
50
|
server: z.object({
|
|
44
51
|
hostname: z.string().optional(),
|
|
45
52
|
port: z.number().optional()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/cli/schemas.ts"],"sourcesContent":["import {type
|
|
1
|
+
{"version":3,"sources":["../../../src/config/cli/schemas.ts"],"sourcesContent":["import {type PluginOptions as ReactCompilerConfig} from 'babel-plugin-react-compiler'\nimport {z} from 'zod'\n\nimport {type CliConfig, type TypeGenConfig} from './types/cliConfig'\nimport {type UserViteConfig} from './types/userViteConfig'\n\n/**\n * @public\n */\nexport const cliConfigSchema = z.object({\n api: z\n .object({\n dataset: z.string().optional(),\n projectId: z.string().optional(),\n })\n .optional(),\n\n app: z\n .object({\n entry: z.string().optional(),\n icon: z.string().optional(),\n id: z.string().optional(),\n organizationId: z.string().optional(),\n title: z.string().optional(),\n })\n .optional(),\n\n autoUpdates: z.boolean().optional(),\n\n deployment: z\n .object({\n appId: z.string().optional(),\n autoUpdates: z.boolean().optional(),\n })\n .optional(),\n\n graphql: z\n .array(\n z.object({\n filterSuffix: z.string().optional(),\n generation: z.enum(['gen1', 'gen2', 'gen3']).optional(),\n id: z.string().optional(),\n nonNullDocumentFields: z.boolean().optional(),\n playground: z.boolean().optional(),\n source: z.string().optional(),\n tag: z.string().optional(),\n workspace: z.string().optional(),\n }),\n )\n .optional(),\n\n mediaLibrary: z\n .object({\n aspectsPath: z.string().optional(),\n })\n .optional(),\n\n project: z\n .object({\n basePath: z.string().optional(),\n })\n .optional(),\n\n reactCompiler: z.custom<ReactCompilerConfig>().optional(),\n\n reactStrictMode: z.boolean().optional(),\n\n schemaExtraction: z\n .object({\n enabled: z.boolean().optional(),\n enforceRequiredFields: z.boolean().optional(),\n path: z.string().optional(),\n watchPatterns: z.array(z.string()).optional(),\n workspace: z.string().optional(),\n })\n .optional(),\n\n server: z\n .object({\n hostname: z.string().optional(),\n port: z.number().optional(),\n })\n .optional(),\n\n studioHost: z.string().optional(),\n\n vite: z.custom<UserViteConfig>().optional(),\n\n typegen: z.custom<Partial<TypeGenConfig> & {enabled?: boolean}>().optional(),\n}) satisfies z.ZodType<CliConfig>\n"],"names":["z","cliConfigSchema","object","api","dataset","string","optional","projectId","app","entry","icon","id","organizationId","title","autoUpdates","boolean","deployment","appId","graphql","array","filterSuffix","generation","enum","nonNullDocumentFields","playground","source","tag","workspace","mediaLibrary","aspectsPath","project","basePath","reactCompiler","custom","reactStrictMode","schemaExtraction","enabled","enforceRequiredFields","path","watchPatterns","server","hostname","port","number","studioHost","vite","typegen"],"mappings":"AACA,SAAQA,CAAC,QAAO,MAAK;AAKrB;;CAEC,GACD,OAAO,MAAMC,kBAAkBD,EAAEE,MAAM,CAAC;IACtCC,KAAKH,EACFE,MAAM,CAAC;QACNE,SAASJ,EAAEK,MAAM,GAAGC,QAAQ;QAC5BC,WAAWP,EAAEK,MAAM,GAAGC,QAAQ;IAChC,GACCA,QAAQ;IAEXE,KAA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