@sanity/cli-core 0.1.0-alpha.7 → 0.1.0-alpha.9
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 +7 -0
- package/dist/SanityCommand.js.map +1 -1
- package/dist/_exports/tree.d.ts +47 -1
- package/dist/_exports/ux.d.ts +40 -4
- package/dist/_exports/ux.js +1 -1
- package/dist/_exports/ux.js.map +1 -1
- package/dist/config/cli/getCliConfig.worker.js +2 -1
- package/dist/config/cli/getCliConfig.worker.js.map +1 -1
- package/dist/config/findProjectRoot.js +2 -2
- package/dist/config/findProjectRoot.js.map +1 -1
- package/dist/config/studio/getStudioConfig.js +0 -3
- package/dist/config/studio/getStudioConfig.js.map +1 -1
- package/dist/config/studio/getStudioWorkspaces.js +50 -0
- package/dist/config/studio/getStudioWorkspaces.js.map +1 -0
- package/dist/config/studio/isStudioConfig.js +19 -0
- package/dist/config/studio/isStudioConfig.js.map +1 -0
- package/dist/config/studio/readStudioConfig.worker.js +4 -30
- package/dist/config/studio/readStudioConfig.worker.js.map +1 -1
- package/dist/config/util/findStudioConfigPath.js +24 -3
- package/dist/config/util/findStudioConfigPath.js.map +1 -1
- package/dist/config/util/recursivelyResolveProjectRoot.js.map +1 -1
- package/dist/index.d.ts +6027 -35
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/loaders/studio/studioWorkerTask.js +41 -11
- package/dist/loaders/studio/studioWorkerTask.js.map +1 -1
- package/dist/loaders/tsx/tsxWorkerTask.js +3 -0
- package/dist/loaders/tsx/tsxWorkerTask.js.map +1 -1
- package/dist/services/apiClient.js +13 -11
- package/dist/services/apiClient.js.map +1 -1
- package/dist/telemetry/cleanupOldTelemetryFiles.js +30 -0
- package/dist/telemetry/cleanupOldTelemetryFiles.js.map +1 -0
- package/dist/telemetry/createTelemetryStore.js +95 -0
- package/dist/telemetry/createTelemetryStore.js.map +1 -0
- package/dist/telemetry/createTraceId.js +10 -0
- package/dist/telemetry/createTraceId.js.map +1 -0
- package/dist/telemetry/findTelemetryFiles.js +36 -0
- package/dist/telemetry/findTelemetryFiles.js.map +1 -0
- package/dist/telemetry/flushTelemetryFiles.js +107 -0
- package/dist/telemetry/flushTelemetryFiles.js.map +1 -0
- package/dist/telemetry/generateTelemetryFilePath.js +30 -0
- package/dist/telemetry/generateTelemetryFilePath.js.map +1 -0
- package/dist/telemetry/getTelemetryBaseInfo.js +33 -0
- package/dist/telemetry/getTelemetryBaseInfo.js.map +1 -0
- package/dist/telemetry/logger.js +54 -0
- package/dist/telemetry/logger.js.map +1 -0
- package/dist/telemetry/telemetryStoreDebug.js +7 -0
- package/dist/telemetry/telemetryStoreDebug.js.map +1 -0
- package/dist/telemetry/trace.js +150 -0
- package/dist/telemetry/trace.js.map +1 -0
- package/dist/telemetry/types.js +5 -0
- package/dist/telemetry/types.js.map +1 -0
- package/dist/util/doImport.js +16 -0
- package/dist/util/doImport.js.map +1 -0
- package/dist/util/environment/getStudioEnvironmentVariables.js +2 -1
- package/dist/util/environment/getStudioEnvironmentVariables.js.map +1 -1
- package/dist/util/getCliTelemetry.js +36 -0
- package/dist/util/getCliTelemetry.js.map +1 -0
- package/dist/util/isStaging.js +10 -0
- package/dist/util/isStaging.js.map +1 -0
- package/dist/util/normalizePath.js +12 -0
- package/dist/util/normalizePath.js.map +1 -0
- package/dist/util/readNDJSON.js +18 -0
- package/dist/util/readNDJSON.js.map +1 -0
- package/dist/util/resolveLocalPackage.js +2 -1
- package/dist/util/resolveLocalPackage.js.map +1 -1
- package/dist/util/waitForAsync.js +5 -0
- package/dist/util/waitForAsync.js.map +1 -0
- package/dist/ux/boxen.js +3 -0
- package/dist/ux/boxen.js.map +1 -0
- package/dist/ux/colorizeJson.js +6 -6
- package/dist/ux/colorizeJson.js.map +1 -1
- package/package.json +29 -22
- package/dist/SanityCommand.d.ts +0 -78
- package/dist/config/cli/getCliConfig.d.ts +0 -16
- package/dist/config/cli/getCliConfig.worker.d.ts +0 -1
- package/dist/config/cli/getCliConfigSync.d.ts +0 -12
- package/dist/config/cli/schemas.d.ts +0 -104
- package/dist/config/cli/types/cliConfig.d.ts +0 -83
- package/dist/config/cli/types/userViteConfig.d.ts +0 -5
- package/dist/config/findProjectRoot.d.ts +0 -14
- package/dist/config/findProjectRootSync.d.ts +0 -27
- package/dist/config/studio/getStudioConfig.d.ts +0 -14
- package/dist/config/studio/readStudioConfig.d.ts +0 -96
- package/dist/config/studio/readStudioConfig.worker.d.ts +0 -1
- package/dist/config/util/configPathsSync.d.ts +0 -17
- package/dist/config/util/findAppConfigPath.d.ts +0 -8
- package/dist/config/util/findConfigsPaths.d.ts +0 -16
- package/dist/config/util/findStudioConfigPath.d.ts +0 -9
- package/dist/config/util/isSanityV2StudioRoot.d.ts +0 -8
- package/dist/config/util/recursivelyResolveProjectRoot.d.ts +0 -27
- package/dist/debug.d.ts +0 -15
- package/dist/loaders/studio/studioWorkerLoader.worker.d.ts +0 -1
- package/dist/loaders/studio/studioWorkerTask.d.ts +0 -40
- package/dist/loaders/tsx/tsxWorkerLoader.worker.d.ts +0 -1
- package/dist/loaders/tsx/tsxWorkerTask.d.ts +0 -28
- package/dist/services/apiClient.d.ts +0 -53
- package/dist/services/cliUserConfig.d.ts +0 -40
- package/dist/services/getCliToken.d.ts +0 -7
- package/dist/types.d.ts +0 -15
- package/dist/util/NotFoundError.d.ts +0 -20
- package/dist/util/createExpiringConfig.d.ts +0 -37
- package/dist/util/environment/getStudioEnvironmentVariables.d.ts +0 -12
- package/dist/util/environment/mockBrowserEnvironment.d.ts +0 -17
- package/dist/util/environment/setupBrowserStubs.d.ts +0 -10
- package/dist/util/environment/stubs.d.ts +0 -254
- package/dist/util/fileExists.d.ts +0 -9
- package/dist/util/generateHelpUrl.d.ts +0 -8
- package/dist/util/getEmptyAuth.d.ts +0 -5
- package/dist/util/getSanityEnvVar.d.ts +0 -19
- package/dist/util/getSanityUrl.d.ts +0 -5
- package/dist/util/getUserConfig.d.ts +0 -2
- package/dist/util/isCi.d.ts +0 -1
- package/dist/util/isInteractive.d.ts +0 -1
- package/dist/util/isRecord.d.ts +0 -8
- package/dist/util/isTrueish.d.ts +0 -1
- package/dist/util/parseStringFlag.d.ts +0 -10
- package/dist/util/readJsonFile.d.ts +0 -14
- package/dist/util/resolveLocalPackage.d.ts +0 -18
- package/dist/util/safeStructuredClone.d.ts +0 -8
- package/dist/util/tree.d.ts +0 -31
- package/dist/util/tryGetDefaultExport.d.ts +0 -5
- package/dist/util/writeJsonFile.d.ts +0 -9
- package/dist/ux/chalk.d.ts +0 -2
- package/dist/ux/chalk.js +0 -4
- package/dist/ux/chalk.js.map +0 -1
- package/dist/ux/colorizeJson.d.ts +0 -1
- package/dist/ux/formatObject.d.ts +0 -1
- package/dist/ux/logSymbols.d.ts +0 -1
- package/dist/ux/printKeyValue.d.ts +0 -1
- package/dist/ux/prompts.d.ts +0 -1
- package/dist/ux/spinner.d.ts +0 -1
- package/dist/ux/timer.d.ts +0 -12
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli-core",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
4
|
"description": "Sanity CLI core package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sanity",
|
|
@@ -25,59 +25,66 @@
|
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
27
27
|
"source": "./src/index.ts",
|
|
28
|
-
"
|
|
29
|
-
"import": "./dist/index.js"
|
|
28
|
+
"default": "./dist/index.js"
|
|
30
29
|
},
|
|
31
30
|
"./tree": {
|
|
32
31
|
"source": "./src/_exports/tree.ts",
|
|
33
|
-
"
|
|
34
|
-
"import": "./dist/_exports/tree.js"
|
|
32
|
+
"default": "./dist/_exports/tree.js"
|
|
35
33
|
},
|
|
36
34
|
"./ux": {
|
|
37
35
|
"source": "./src/_exports/ux.ts",
|
|
38
|
-
"
|
|
39
|
-
"import": "./dist/_exports/ux.js"
|
|
36
|
+
"default": "./dist/_exports/ux.js"
|
|
40
37
|
},
|
|
41
38
|
"./package.json": "./package.json"
|
|
42
39
|
},
|
|
43
|
-
"main": "dist/index.js",
|
|
40
|
+
"main": "./dist/index.js",
|
|
44
41
|
"types": "dist/index.d.ts",
|
|
45
42
|
"files": [
|
|
46
43
|
"./dist"
|
|
47
44
|
],
|
|
48
45
|
"dependencies": {
|
|
49
|
-
"@inquirer/prompts": "^8.
|
|
46
|
+
"@inquirer/prompts": "^8.2.0",
|
|
50
47
|
"@oclif/core": "^4.8.0",
|
|
51
|
-
"@sanity/client": "^7.14.
|
|
52
|
-
"@sanity/types": "^5.
|
|
48
|
+
"@sanity/client": "^7.14.1",
|
|
49
|
+
"@sanity/types": "^5.8.1",
|
|
53
50
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
54
|
-
"
|
|
51
|
+
"boxen": "^8.0.1",
|
|
55
52
|
"configstore": "^7.0.0",
|
|
56
53
|
"debug": "^4.4.3",
|
|
57
|
-
"get-tsconfig": "^4.13.
|
|
54
|
+
"get-tsconfig": "^4.13.1",
|
|
58
55
|
"import-meta-resolve": "^4.1.0",
|
|
59
56
|
"jsdom": "^27.4.0",
|
|
60
57
|
"json-lexer": "^1.2.0",
|
|
61
58
|
"log-symbols": "^7.0.1",
|
|
62
59
|
"ora": "^9.0.0",
|
|
60
|
+
"rxjs": "^7.8.2",
|
|
61
|
+
"tinyglobby": "^0.2.15",
|
|
63
62
|
"tsx": "^4.21.0",
|
|
63
|
+
"typeid-js": "^1.2.0",
|
|
64
64
|
"vite": "^7.3.1",
|
|
65
|
-
"zod": "^4.3.
|
|
65
|
+
"zod": "^4.3.6"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@eslint/compat": "^2.0.
|
|
69
|
-
"@sanity/codegen": "^5.
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
68
|
+
"@eslint/compat": "^2.0.2",
|
|
69
|
+
"@sanity/codegen": "^5.9.2",
|
|
70
|
+
"@sanity/pkg-utils": "^10.4.4",
|
|
71
|
+
"@sanity/telemetry": "^0.8.1",
|
|
72
|
+
"@swc/cli": "^0.7.10",
|
|
73
|
+
"@swc/core": "^1.15.11",
|
|
72
74
|
"@types/debug": "^4.1.12",
|
|
73
75
|
"@types/jsdom": "^27.0.0",
|
|
74
76
|
"@types/node": "^20.19.30",
|
|
75
77
|
"eslint": "^9.39.2",
|
|
76
|
-
"publint": "^0.3.
|
|
78
|
+
"publint": "^0.3.17",
|
|
79
|
+
"sanity": "^5.8.1",
|
|
77
80
|
"typescript": "^5.9.3",
|
|
78
|
-
"vitest": "^4.0.
|
|
81
|
+
"vitest": "^4.0.18",
|
|
82
|
+
"@sanity/eslint-config-cli": "0.0.0-alpha.1",
|
|
79
83
|
"@repo/tsconfig": "3.70.0",
|
|
80
|
-
"@
|
|
84
|
+
"@repo/package.config": "0.0.1"
|
|
85
|
+
},
|
|
86
|
+
"peerDependencies": {
|
|
87
|
+
"@sanity/telemetry": ">=0.8.1 <0.9.0"
|
|
81
88
|
},
|
|
82
89
|
"engines": {
|
|
83
90
|
"node": ">=20.19.1 <22 || >=22.12"
|
|
@@ -87,7 +94,7 @@
|
|
|
87
94
|
},
|
|
88
95
|
"scripts": {
|
|
89
96
|
"build": "swc --delete-dir-on-start --strip-leading-paths --out-dir dist/ src --ignore '**/*.test.ts'",
|
|
90
|
-
"build:types": "
|
|
97
|
+
"build:types": "pkg-utils build --emitDeclarationOnly",
|
|
91
98
|
"check:types": "tsc --noEmit",
|
|
92
99
|
"lint": "eslint .",
|
|
93
100
|
"publint": "publint",
|
package/dist/SanityCommand.d.ts
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Command, Interfaces } from '@oclif/core';
|
|
2
|
-
import { type CliConfig } from './config/cli/types/cliConfig.js';
|
|
3
|
-
import { type ProjectRootResult } from './config/util/recursivelyResolveProjectRoot.js';
|
|
4
|
-
import { type GlobalCliClientOptions, type ProjectCliClientOptions } from './services/apiClient.js';
|
|
5
|
-
import { type Output } from './types.js';
|
|
6
|
-
type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof SanityCommand)['baseFlags'] & T['flags']>;
|
|
7
|
-
type Args<T extends typeof Command> = Interfaces.InferredArgs<T['args']>;
|
|
8
|
-
export declare abstract class SanityCommand<T extends typeof Command> extends Command {
|
|
9
|
-
protected args: Args<T>;
|
|
10
|
-
protected flags: Flags<T>;
|
|
11
|
-
/**
|
|
12
|
-
* Get the global API client.
|
|
13
|
-
*
|
|
14
|
-
* @param args - The global API client options.
|
|
15
|
-
* @returns The global API client.
|
|
16
|
-
*
|
|
17
|
-
* @deprecated use `getGlobalCliClient` function directly instead.
|
|
18
|
-
*/
|
|
19
|
-
protected getGlobalApiClient: (args: GlobalCliClientOptions) => Promise<import("@sanity/client").SanityClient>;
|
|
20
|
-
/**
|
|
21
|
-
* Get the project API client.
|
|
22
|
-
*
|
|
23
|
-
* @param args - The project API client options.
|
|
24
|
-
* @returns The project API client.
|
|
25
|
-
*
|
|
26
|
-
* @deprecated use `getProjectCliClient` function directly instead.
|
|
27
|
-
*/
|
|
28
|
-
protected getProjectApiClient: (args: ProjectCliClientOptions) => Promise<import("@sanity/client").SanityClient>;
|
|
29
|
-
/**
|
|
30
|
-
* Helper for outputting to the console.
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```ts
|
|
34
|
-
* this.output.log('Hello')
|
|
35
|
-
* this.output.warn('Warning')
|
|
36
|
-
* this.output.error('Error')
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
protected output: Output;
|
|
40
|
-
/**
|
|
41
|
-
* Get the CLI config.
|
|
42
|
-
*
|
|
43
|
-
* @returns The CLI config.
|
|
44
|
-
*/
|
|
45
|
-
protected getCliConfig(): Promise<CliConfig>;
|
|
46
|
-
/**
|
|
47
|
-
* Get the project ID from the CLI config.
|
|
48
|
-
*
|
|
49
|
-
* @returns The project ID or `undefined` if it's not set.
|
|
50
|
-
*/
|
|
51
|
-
protected getProjectId(): Promise<string | undefined>;
|
|
52
|
-
/**
|
|
53
|
-
* Get the project's root directory by resolving the config
|
|
54
|
-
*
|
|
55
|
-
* @returns The project root result.
|
|
56
|
-
*/
|
|
57
|
-
protected getProjectRoot(): Promise<ProjectRootResult>;
|
|
58
|
-
init(): Promise<void>;
|
|
59
|
-
/**
|
|
60
|
-
* Check if the command is running in unattended mode.
|
|
61
|
-
*
|
|
62
|
-
* This means the command should not ask for user input, instead using defaults where
|
|
63
|
-
* possible, and if that does not make sense (eg there's missing information), then we
|
|
64
|
-
* should error out (remember to exit with a non-zero code).
|
|
65
|
-
*
|
|
66
|
-
* Most commands should take an explicit `--yes` flag to enable unattended mode, but
|
|
67
|
-
* some commands may also be run in unattended mode if `process.stdin` is not a TTY
|
|
68
|
-
* (eg when running in a CI environment).
|
|
69
|
-
*/
|
|
70
|
-
protected isUnattended(): boolean;
|
|
71
|
-
/**
|
|
72
|
-
* Resolver for checking if the terminal is interactive. Override in tests to provide mock values.
|
|
73
|
-
*
|
|
74
|
-
* @returns Whether the terminal is interactive.
|
|
75
|
-
*/
|
|
76
|
-
protected resolveIsInteractive(): boolean;
|
|
77
|
-
}
|
|
78
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type CliConfig } from './types/cliConfig.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get the CLI config for a project, given the root path.
|
|
4
|
-
*
|
|
5
|
-
* We really want to avoid loading the CLI config in the main thread, as we'll need
|
|
6
|
-
* TypeScript loading logic, potentially with ts path aliases, syntax extensions and all
|
|
7
|
-
* sorts of nonsense. Thus, we _attempt_ to use a worker thread - but have to fall back
|
|
8
|
-
* to using the main thread if not possible. This can be the case if the configuration
|
|
9
|
-
* contains non-serializable properties, such as functions. This is unfortunately used
|
|
10
|
-
* by the vite config, for example.
|
|
11
|
-
*
|
|
12
|
-
* @param rootPath - Root path for the project, eg where `sanity.cli.(ts|js)` is located.
|
|
13
|
-
* @returns The CLI config
|
|
14
|
-
* @internal
|
|
15
|
-
*/
|
|
16
|
-
export declare function getCliConfig(rootPath: string): Promise<CliConfig>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type CliConfig } from './types/cliConfig.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get the CLI config for a project synchronously, given the root path.
|
|
4
|
-
*
|
|
5
|
-
* This loads the CLI config in the main thread using tsx/register for TypeScript support.
|
|
6
|
-
* Note: This is a synchronous operation and does not use worker threads like the async version.
|
|
7
|
-
*
|
|
8
|
-
* @param rootPath - Root path for the project, eg where `sanity.cli.(ts|js)` is located.
|
|
9
|
-
* @returns The CLI config
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export declare function getCliConfigSync(rootPath: string): CliConfig;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { type UserViteConfig } from './types/userViteConfig';
|
|
3
|
-
/**
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export declare const cliConfigSchema: z.ZodObject<{
|
|
7
|
-
api: z.ZodOptional<z.ZodObject<{
|
|
8
|
-
dataset: z.ZodOptional<z.ZodString>;
|
|
9
|
-
projectId: z.ZodOptional<z.ZodString>;
|
|
10
|
-
}, z.core.$strip>>;
|
|
11
|
-
app: z.ZodOptional<z.ZodObject<{
|
|
12
|
-
entry: z.ZodOptional<z.ZodString>;
|
|
13
|
-
icon: z.ZodOptional<z.ZodString>;
|
|
14
|
-
id: z.ZodOptional<z.ZodString>;
|
|
15
|
-
organizationId: z.ZodOptional<z.ZodString>;
|
|
16
|
-
title: z.ZodOptional<z.ZodString>;
|
|
17
|
-
}, z.core.$strip>>;
|
|
18
|
-
autoUpdates: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
-
deployment: z.ZodOptional<z.ZodObject<{
|
|
20
|
-
appId: z.ZodOptional<z.ZodString>;
|
|
21
|
-
autoUpdates: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
-
}, z.core.$strip>>;
|
|
23
|
-
graphql: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
24
|
-
filterSuffix: z.ZodOptional<z.ZodString>;
|
|
25
|
-
generation: z.ZodOptional<z.ZodEnum<{
|
|
26
|
-
gen1: "gen1";
|
|
27
|
-
gen2: "gen2";
|
|
28
|
-
gen3: "gen3";
|
|
29
|
-
}>>;
|
|
30
|
-
id: z.ZodOptional<z.ZodString>;
|
|
31
|
-
nonNullDocumentFields: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
-
playground: z.ZodOptional<z.ZodBoolean>;
|
|
33
|
-
source: z.ZodOptional<z.ZodString>;
|
|
34
|
-
tag: z.ZodOptional<z.ZodString>;
|
|
35
|
-
workspace: z.ZodOptional<z.ZodString>;
|
|
36
|
-
}, z.core.$strip>>>;
|
|
37
|
-
mediaLibrary: z.ZodOptional<z.ZodObject<{
|
|
38
|
-
aspectsPath: z.ZodOptional<z.ZodString>;
|
|
39
|
-
}, z.core.$strip>>;
|
|
40
|
-
project: z.ZodOptional<z.ZodObject<{
|
|
41
|
-
basePath: z.ZodOptional<z.ZodString>;
|
|
42
|
-
}, z.core.$strip>>;
|
|
43
|
-
reactCompiler: z.ZodOptional<z.ZodCustom<Partial<{
|
|
44
|
-
environment: Partial<import("babel-plugin-react-compiler").EnvironmentConfig>;
|
|
45
|
-
logger: import("babel-plugin-react-compiler").Logger | null;
|
|
46
|
-
gating: import("babel-plugin-react-compiler").ExternalFunction | null;
|
|
47
|
-
dynamicGating: {
|
|
48
|
-
source: string;
|
|
49
|
-
} | null;
|
|
50
|
-
panicThreshold: "none" | "all_errors" | "critical_errors";
|
|
51
|
-
noEmit: boolean;
|
|
52
|
-
compilationMode: "syntax" | "infer" | "annotation" | "all";
|
|
53
|
-
eslintSuppressionRules: Array<string> | null | undefined;
|
|
54
|
-
flowSuppressions: boolean;
|
|
55
|
-
ignoreUseNoForget: boolean;
|
|
56
|
-
customOptOutDirectives: string[] | null;
|
|
57
|
-
sources: Array<string> | ((filename: string) => boolean) | null;
|
|
58
|
-
enableReanimatedCheck: boolean;
|
|
59
|
-
target: "17" | "18" | "19" | {
|
|
60
|
-
kind: "donotuse_meta_internal";
|
|
61
|
-
runtimeModule: string;
|
|
62
|
-
};
|
|
63
|
-
}>, Partial<{
|
|
64
|
-
environment: Partial<import("babel-plugin-react-compiler").EnvironmentConfig>;
|
|
65
|
-
logger: import("babel-plugin-react-compiler").Logger | null;
|
|
66
|
-
gating: import("babel-plugin-react-compiler").ExternalFunction | null;
|
|
67
|
-
dynamicGating: {
|
|
68
|
-
source: string;
|
|
69
|
-
} | null;
|
|
70
|
-
panicThreshold: "none" | "all_errors" | "critical_errors";
|
|
71
|
-
noEmit: boolean;
|
|
72
|
-
compilationMode: "syntax" | "infer" | "annotation" | "all";
|
|
73
|
-
eslintSuppressionRules: Array<string> | null | undefined;
|
|
74
|
-
flowSuppressions: boolean;
|
|
75
|
-
ignoreUseNoForget: boolean;
|
|
76
|
-
customOptOutDirectives: string[] | null;
|
|
77
|
-
sources: Array<string> | ((filename: string) => boolean) | null;
|
|
78
|
-
enableReanimatedCheck: boolean;
|
|
79
|
-
target: "17" | "18" | "19" | {
|
|
80
|
-
kind: "donotuse_meta_internal";
|
|
81
|
-
runtimeModule: string;
|
|
82
|
-
};
|
|
83
|
-
}>>>;
|
|
84
|
-
reactStrictMode: z.ZodOptional<z.ZodBoolean>;
|
|
85
|
-
server: z.ZodOptional<z.ZodObject<{
|
|
86
|
-
hostname: z.ZodOptional<z.ZodString>;
|
|
87
|
-
port: z.ZodOptional<z.ZodNumber>;
|
|
88
|
-
}, z.core.$strip>>;
|
|
89
|
-
studioHost: z.ZodOptional<z.ZodString>;
|
|
90
|
-
vite: z.ZodOptional<z.ZodCustom<UserViteConfig, UserViteConfig>>;
|
|
91
|
-
typegen: z.ZodOptional<z.ZodCustom<{
|
|
92
|
-
path: string | string[];
|
|
93
|
-
schema: string;
|
|
94
|
-
generates: string;
|
|
95
|
-
formatGeneratedCode: boolean;
|
|
96
|
-
overloadClientMethods: boolean;
|
|
97
|
-
}, {
|
|
98
|
-
path: string | string[];
|
|
99
|
-
schema: string;
|
|
100
|
-
generates: string;
|
|
101
|
-
formatGeneratedCode: boolean;
|
|
102
|
-
overloadClientMethods: boolean;
|
|
103
|
-
}>>;
|
|
104
|
-
}, z.core.$strip>;
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { type TypeGenConfig } from '@sanity/codegen';
|
|
2
|
-
import { type PluginOptions as ReactCompilerConfig } from 'babel-plugin-react-compiler';
|
|
3
|
-
import { type UserViteConfig } from './userViteConfig';
|
|
4
|
-
/**
|
|
5
|
-
* @public
|
|
6
|
-
*/
|
|
7
|
-
export interface CliConfig {
|
|
8
|
-
/** The project ID and dataset the Sanity CLI should use to run its commands */
|
|
9
|
-
api?: {
|
|
10
|
-
dataset?: string;
|
|
11
|
-
projectId?: string;
|
|
12
|
-
};
|
|
13
|
-
/** Configuration for custom Sanity apps built with the App SDK */
|
|
14
|
-
app?: {
|
|
15
|
-
/** The entrypoint for your custom app. By default, `src/App.tsx` */
|
|
16
|
-
entry?: string;
|
|
17
|
-
/** String encoding of an icon (typically an SVG) */
|
|
18
|
-
icon?: string;
|
|
19
|
-
/** @deprecated Use deployment.appId */
|
|
20
|
-
id?: string;
|
|
21
|
-
/** The ID for the Sanity organization that manages this application */
|
|
22
|
-
organizationId?: string;
|
|
23
|
-
/** The title of the custom app. Used in Dashboard and in the browser tab */
|
|
24
|
-
title?: string;
|
|
25
|
-
};
|
|
26
|
-
/** @deprecated Use deployment.autoUpdates */
|
|
27
|
-
autoUpdates?: boolean;
|
|
28
|
-
/** Options for custom app and Studio deployments */
|
|
29
|
-
deployment?: {
|
|
30
|
-
/**
|
|
31
|
-
* The ID for your custom app or Studio. Generated when deploying your app or Studio for the first time.
|
|
32
|
-
* Get your app ID by either:
|
|
33
|
-
* 1. Checking the output of `sanity deploy`, or
|
|
34
|
-
* 2. Checking your project’s Studio tab at https://sanity.io/manage
|
|
35
|
-
*
|
|
36
|
-
* @remarks This is required for all custom app deployments, and for Studios opting in to fine grained version control.
|
|
37
|
-
* {@link https://www.sanity.io/docs/studio/latest-version-of-sanity#k0896ed4574b7}
|
|
38
|
-
*/
|
|
39
|
-
appId?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Enable automatic updates for your Studio or custom app’s Sanity dependencies.
|
|
42
|
-
* {@link https://www.sanity.io/docs/studio/latest-version-of-sanity}
|
|
43
|
-
*/
|
|
44
|
-
autoUpdates?: boolean;
|
|
45
|
-
};
|
|
46
|
-
/** Define the GraphQL APIs that the CLI can deploy and interact with */
|
|
47
|
-
graphql?: Array<{
|
|
48
|
-
filterSuffix?: string;
|
|
49
|
-
generation?: 'gen1' | 'gen2' | 'gen3';
|
|
50
|
-
id?: string;
|
|
51
|
-
nonNullDocumentFields?: boolean;
|
|
52
|
-
playground?: boolean;
|
|
53
|
-
source?: string;
|
|
54
|
-
tag?: string;
|
|
55
|
-
workspace?: string;
|
|
56
|
-
}>;
|
|
57
|
-
/** Configuration for the Media Library */
|
|
58
|
-
mediaLibrary?: {
|
|
59
|
-
/** The path to the Media Library aspects directory. When using the CLI to manage aspects, this is the directory they will be read from and written to. */
|
|
60
|
-
aspectsPath?: string;
|
|
61
|
-
};
|
|
62
|
-
/** Contains the property `basePath` which lets you change the top-level slug for the Studio. You typically need to set this if you embed the Studio in another application where it is one of many routes. Defaults to an empty string. */
|
|
63
|
-
project?: {
|
|
64
|
-
basePath?: string;
|
|
65
|
-
};
|
|
66
|
-
/** Configuration options for React Compiler */
|
|
67
|
-
reactCompiler?: ReactCompilerConfig;
|
|
68
|
-
/** Wraps the Studio in \<React.StrictMode\> root to aid in flagging potential problems related to concurrent features (startTransition, useTransition, useDeferredValue, Suspense). Can also be enabled by setting SANITY_STUDIO_REACT_STRICT_MODE="true"|"false". It only applies to sanity dev in development mode and is ignored in sanity build and in production. Defaults to false. */
|
|
69
|
-
reactStrictMode?: boolean;
|
|
70
|
-
/** Defines the hostname and port that the development server should run on. hostname defaults to localhost, and port to 3333. */
|
|
71
|
-
server?: {
|
|
72
|
-
hostname?: string;
|
|
73
|
-
port?: number;
|
|
74
|
-
};
|
|
75
|
-
/** @deprecated Use deployment.appId */
|
|
76
|
-
studioHost?: string;
|
|
77
|
-
/**
|
|
78
|
-
* Configuration for Sanity typegen
|
|
79
|
-
*/
|
|
80
|
-
typegen?: Partial<TypeGenConfig>;
|
|
81
|
-
/** Exposes the default Vite configuration for custom apps and the Studio so it can be changed and extended. */
|
|
82
|
-
vite?: UserViteConfig;
|
|
83
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type ProjectRootResult } from './util/recursivelyResolveProjectRoot.js';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve project root directory and type.
|
|
4
|
-
*
|
|
5
|
-
* Project root is:
|
|
6
|
-
* - `studio` - A pre-blueprints Sanity studio root (containing `sanity.config.(ts|js)`)
|
|
7
|
-
* - `app` - A Sanity app root (containing `sanity.cli.(ts|js)`)
|
|
8
|
-
*
|
|
9
|
-
* If a Sanity Studio v2/v1 root is found (containing `sanity.json` with `root: true`),
|
|
10
|
-
* an error is thrown, as v2/v1 is no longer supported.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
*/
|
|
14
|
-
export declare function findProjectRoot(cwd: string): Promise<ProjectRootResult>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { ProjectRootResult } from './util/recursivelyResolveProjectRoot.js';
|
|
2
|
-
/**
|
|
3
|
-
* Generic recursive search function for project configuration files (synchronous version).
|
|
4
|
-
*
|
|
5
|
-
* @param basePath - The base path to start searching from
|
|
6
|
-
* @param findConfigFn - Function that looks for config files in a given directory
|
|
7
|
-
* @param projectType - The type of project ('app' | 'studio')
|
|
8
|
-
* @param iterations - Current iteration count, passed internally to prevent infinite recursion
|
|
9
|
-
* @returns An object if config is found, false otherwise
|
|
10
|
-
* @internal
|
|
11
|
-
*/
|
|
12
|
-
export declare function recursivelyResolveProjectRootSync(basePath: string, findConfigFn: (path: string) => string | undefined, projectType: 'app' | 'studio', iterations?: number): false | ProjectRootResult;
|
|
13
|
-
/**
|
|
14
|
-
* Resolve project root directory and type synchronously.
|
|
15
|
-
*
|
|
16
|
-
* Project root is:
|
|
17
|
-
* - `studio` - A pre-blueprints Sanity studio root (containing `sanity.config.(ts|js)`)
|
|
18
|
-
* - `app` - A Sanity app root (containing `sanity.cli.(ts|js)`)
|
|
19
|
-
*
|
|
20
|
-
* If a Sanity Studio v2/v1 root is found (containing `sanity.json` with `root: true`),
|
|
21
|
-
* an error is thrown, as v2/v1 is no longer supported.
|
|
22
|
-
*
|
|
23
|
-
* @param cwd - Current working directory to start searching from
|
|
24
|
-
* @returns Project root result
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export declare function findProjectRootSync(cwd: string): ProjectRootResult;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type RawStudioConfig, type ResolvedStudioConfig } from './readStudioConfig.js';
|
|
2
|
-
/**
|
|
3
|
-
* Get the studio config for a project, given the root path.
|
|
4
|
-
*
|
|
5
|
-
* @param rootPath - The root path for the project
|
|
6
|
-
* @returns The studio config (some properties may be missing)
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function getStudioConfig(rootPath: string, options: {
|
|
10
|
-
resolvePlugins: true;
|
|
11
|
-
}): Promise<ResolvedStudioConfig>;
|
|
12
|
-
export declare function getStudioConfig(rootPath: string, options: {
|
|
13
|
-
resolvePlugins: false;
|
|
14
|
-
}): Promise<RawStudioConfig>;
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
declare const rawConfigSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodObject<{
|
|
3
|
-
basePath: z.ZodString;
|
|
4
|
-
name: z.ZodString;
|
|
5
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
6
|
-
title: z.ZodString;
|
|
7
|
-
unstable_sources: z.ZodArray<z.ZodObject<{
|
|
8
|
-
dataset: z.ZodString;
|
|
9
|
-
projectId: z.ZodString;
|
|
10
|
-
schema: z.ZodObject<{
|
|
11
|
-
_original: z.ZodObject<{
|
|
12
|
-
name: z.ZodOptional<z.ZodString>;
|
|
13
|
-
types: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
14
|
-
}, z.core.$strip>;
|
|
15
|
-
}, z.core.$strip>;
|
|
16
|
-
}, z.core.$strip>>;
|
|
17
|
-
dataset: z.ZodString;
|
|
18
|
-
projectId: z.ZodString;
|
|
19
|
-
schema: z.ZodObject<{
|
|
20
|
-
_original: z.ZodObject<{
|
|
21
|
-
name: z.ZodOptional<z.ZodString>;
|
|
22
|
-
types: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
}, z.core.$strip>>, z.ZodObject<{
|
|
26
|
-
basePath: z.ZodOptional<z.ZodString>;
|
|
27
|
-
name: z.ZodOptional<z.ZodString>;
|
|
28
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
29
|
-
schema: z.ZodOptional<z.ZodObject<{
|
|
30
|
-
name: z.ZodOptional<z.ZodString>;
|
|
31
|
-
types: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
32
|
-
}, z.core.$strip>>;
|
|
33
|
-
title: z.ZodOptional<z.ZodString>;
|
|
34
|
-
unstable_sources: z.ZodArray<z.ZodObject<{
|
|
35
|
-
dataset: z.ZodString;
|
|
36
|
-
projectId: z.ZodString;
|
|
37
|
-
schema: z.ZodObject<{
|
|
38
|
-
_original: z.ZodObject<{
|
|
39
|
-
name: z.ZodOptional<z.ZodString>;
|
|
40
|
-
types: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
41
|
-
}, z.core.$strip>;
|
|
42
|
-
}, z.core.$strip>;
|
|
43
|
-
}, z.core.$strip>>;
|
|
44
|
-
dataset: z.ZodString;
|
|
45
|
-
projectId: z.ZodString;
|
|
46
|
-
}, z.core.$loose>]>;
|
|
47
|
-
declare const resolvedConfigSchema: z.ZodArray<z.ZodObject<{
|
|
48
|
-
basePath: z.ZodString;
|
|
49
|
-
name: z.ZodString;
|
|
50
|
-
plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
|
|
51
|
-
title: z.ZodString;
|
|
52
|
-
unstable_sources: z.ZodArray<z.ZodObject<{
|
|
53
|
-
dataset: z.ZodString;
|
|
54
|
-
projectId: z.ZodString;
|
|
55
|
-
schema: z.ZodObject<{
|
|
56
|
-
_original: z.ZodObject<{
|
|
57
|
-
name: z.ZodOptional<z.ZodString>;
|
|
58
|
-
types: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
59
|
-
}, z.core.$strip>;
|
|
60
|
-
}, z.core.$strip>;
|
|
61
|
-
}, z.core.$strip>>;
|
|
62
|
-
dataset: z.ZodString;
|
|
63
|
-
projectId: z.ZodString;
|
|
64
|
-
schema: z.ZodObject<{
|
|
65
|
-
_original: z.ZodObject<{
|
|
66
|
-
name: z.ZodOptional<z.ZodString>;
|
|
67
|
-
types: z.ZodArray<z.ZodObject<{}, z.core.$loose>>;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
}, z.core.$strip>;
|
|
70
|
-
}, z.core.$strip>>;
|
|
71
|
-
export type RawStudioConfig = z.infer<typeof rawConfigSchema>;
|
|
72
|
-
export type ResolvedStudioConfig = z.infer<typeof resolvedConfigSchema>;
|
|
73
|
-
export interface ReadStudioConfigOptions {
|
|
74
|
-
/**
|
|
75
|
-
* Whether or not to resolve the plugins defined in the config.
|
|
76
|
-
*
|
|
77
|
-
* In some cases, you need this in order to have the full picture of what the studio
|
|
78
|
-
* would "see". As an example, plugins can define schema types that are not explicitly
|
|
79
|
-
* defined in the users' schema types. In order to get the full picture, you need to
|
|
80
|
-
* resolve the plugins, which is an asyncronous operation.
|
|
81
|
-
*
|
|
82
|
-
* In other cases, it might be enough to only do a shallow pass. As an example, if you
|
|
83
|
-
* only need to know about the defined workspace, or the user-defined schema types,
|
|
84
|
-
* this can be set to `false` - which should resolve faster (and potentially "safer")
|
|
85
|
-
* in terms of not triggering all kinds of browser behavior that may or may not be
|
|
86
|
-
* loaded as the plugins are resolved.
|
|
87
|
-
*/
|
|
88
|
-
resolvePlugins: boolean;
|
|
89
|
-
}
|
|
90
|
-
export declare function readStudioConfig(configPath: string, options: {
|
|
91
|
-
resolvePlugins: true;
|
|
92
|
-
}): Promise<ResolvedStudioConfig>;
|
|
93
|
-
export declare function readStudioConfig(configPath: string, options: {
|
|
94
|
-
resolvePlugins: false;
|
|
95
|
-
}): Promise<RawStudioConfig>;
|
|
96
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves to a string containing the found config path, or `undefined` if not found.
|
|
3
|
-
* Throws if Sanity v2 studio root is found.
|
|
4
|
-
*
|
|
5
|
-
* @param basePath - The base path to start searching from
|
|
6
|
-
* @returns A string containing the found config path, or `undefined` if not found
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function findStudioConfigPathSync(basePath: string): string | undefined;
|
|
10
|
-
/**
|
|
11
|
-
* Resolves to a string containing the found config path, or `undefined` if not found.
|
|
12
|
-
*
|
|
13
|
-
* @param basePath - The base path to start searching from
|
|
14
|
-
* @returns A string containing the found config path, or `undefined` if not found
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export declare function findAppConfigPathSync(basePath: string): string | undefined;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves to a string containing the found config path, or `undefined` if not found.
|
|
3
|
-
*
|
|
4
|
-
* @param basePath - The base path to start searching from
|
|
5
|
-
* @returns A promise that resolves to a string containing the found config path, or `undefined` if not found
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export declare function findAppConfigPath(basePath: string): Promise<string | undefined>;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @internal
|
|
3
|
-
*/
|
|
4
|
-
interface PathResult {
|
|
5
|
-
exists: boolean;
|
|
6
|
-
path: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Finds the path for a given set of files.
|
|
10
|
-
*
|
|
11
|
-
* @param basePath - The base path to search for files.
|
|
12
|
-
* @param files - The files to search for.
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
export declare function findPathForFiles(basePath: string, files: string[]): Promise<PathResult[]>;
|
|
16
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolves to a string containing the found config path, or `false` if not found.
|
|
3
|
-
* Throws if Sanity v2 studio root is found.
|
|
4
|
-
*
|
|
5
|
-
* @param basePath - The base path to start searching from
|
|
6
|
-
* @returns A promise that resolves to a string containing the found config path, or `undefined` if not found
|
|
7
|
-
* @internal
|
|
8
|
-
*/
|
|
9
|
-
export declare function findStudioConfigPath(basePath: string): Promise<string | undefined>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Checks for a `sanity.json` file with `"root": true` in the given directory.
|
|
3
|
-
*
|
|
4
|
-
* @param basePath - The base path to look for a `sanity.json` in
|
|
5
|
-
* @returns Resolves to true if a `sanity.json` with `"root": true` is found, false otherwise
|
|
6
|
-
* @internal
|
|
7
|
-
*/
|
|
8
|
-
export declare function isSanityV2StudioRoot(basePath: string): Promise<boolean>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Result of finding a project configuration
|
|
3
|
-
*
|
|
4
|
-
* @internal
|
|
5
|
-
*/
|
|
6
|
-
export interface ProjectRootResult {
|
|
7
|
-
directory: string;
|
|
8
|
-
/**
|
|
9
|
-
* Path to the project configuration file, if found.
|
|
10
|
-
*/
|
|
11
|
-
path: string;
|
|
12
|
-
/**
|
|
13
|
-
* Type of project root.
|
|
14
|
-
*/
|
|
15
|
-
type: 'app' | 'studio';
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Generic recursive search function for project configuration files.
|
|
19
|
-
*
|
|
20
|
-
* @param basePath - The base path to start searching from
|
|
21
|
-
* @param findConfigFn - Function that looks for config files in a given directory
|
|
22
|
-
* @param projectType - The type of project ('app' | 'studio')
|
|
23
|
-
* @param iterations - Current iteration count, passed internally to prevent infinite recursion
|
|
24
|
-
* @returns A promise that resolves to an object if config is found, false otherwise
|
|
25
|
-
* @internal
|
|
26
|
-
*/
|
|
27
|
-
export declare function recursivelyResolveProjectRoot(basePath: string, findConfigFn: (path: string) => Promise<string | undefined>, projectType: 'app' | 'studio', iterations?: number): Promise<false | ProjectRootResult>;
|