@sanity/cli-core 3.11.1 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/_exports/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ import { i as isNotFoundError, n as isProjectRootNotFoundError, r as NotFoundErr
|
|
|
14
14
|
import { exitCodes } from "../exitCodes.js";
|
|
15
15
|
import { n as createStudioWorker, r as studioWorkerTask, t as tsxWorkerTask } from "../tsxWorkerTask-DQQSOYCZ.js";
|
|
16
16
|
import { a as getCliTelemetry, i as clearCliTelemetry, n as getTelemetryBaseInfo, o as reportCliTraceError, r as CLI_TELEMETRY_SYMBOL, s as setCliTelemetry, t as noopLogger } from "../noopTelemetry-BJRIvASI.js";
|
|
17
|
-
import { a as isCi, i as isInteractive, n as normalizePath, o as importModule, r as isStaging, s as doImport, t as safeStructuredClone } from "../safeStructuredClone-
|
|
17
|
+
import { a as isCi, i as isInteractive, n as normalizePath, o as importModule, r as isStaging, s as doImport, t as safeStructuredClone } from "../safeStructuredClone-BixYyg4K.js";
|
|
18
18
|
import { a as getLocalPackageVersion, i as getLocalPackageDir, n as resolveLocalPackageFrom, r as resolveLocalPackagePath, t as resolveLocalPackage } from "../resolveLocalPackage-Dr-TNTyk.js";
|
|
19
19
|
import { n as ReadPackageJsonOptions, r as readPackageJson, t as PackageJson } from "../readPackageJson-Cr_lbjVR.js";
|
|
20
20
|
import { n as colorizeJson, t as getTimer } from "../timer-Dwu2TIgB.js";
|
package/dist/_exports/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as getSanityDataDir, i as getSanityConfigDir, n as getSanityUrl, r as getSanityEnvVar, t as getWorkspace } from "../getWorkspace-CU32E6Uo.js";
|
|
2
|
-
import { a as isCi, i as isInteractive$1, n as normalizePath, o as importModule, r as isStaging, s as doImport, t as safeStructuredClone } from "../safeStructuredClone-
|
|
2
|
+
import { a as isCi, i as isInteractive$1, n as normalizePath, o as importModule, r as isStaging, s as doImport, t as safeStructuredClone } from "../safeStructuredClone-BixYyg4K.js";
|
|
3
3
|
declare function getCoreAppUrl(organizationId: string, appId: string): string;
|
|
4
4
|
/**
|
|
5
5
|
* Checks if the given value is a record (javascript objectish)
|
|
@@ -11,6 +11,12 @@ interface ImportModuleOptions {
|
|
|
11
11
|
* Default: true
|
|
12
12
|
*/
|
|
13
13
|
default?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether to transform JSX in the imported module (and anything it imports).
|
|
16
|
+
* Required for `.tsx`/`.jsx` modules — without it they fail to parse.
|
|
17
|
+
* Default: false
|
|
18
|
+
*/
|
|
19
|
+
jsx?: boolean;
|
|
14
20
|
/**
|
|
15
21
|
* Path to the tsconfig file to use for the import. If not provided, the tsconfig
|
|
16
22
|
* will be inferred from the nearest `tsconfig.json` file.
|
|
@@ -54,4 +60,4 @@ declare function normalizePath(path: string): string;
|
|
|
54
60
|
*/
|
|
55
61
|
declare function safeStructuredClone<T>(obj: T): T;
|
|
56
62
|
export { isCi as a, isInteractive as i, normalizePath as n, importModule as o, isStaging as r, doImport as s, safeStructuredClone as t };
|
|
57
|
-
//# sourceMappingURL=safeStructuredClone-
|
|
63
|
+
//# sourceMappingURL=safeStructuredClone-BixYyg4K.d.ts.map
|
|
@@ -11,9 +11,10 @@ const debug = subdebug('importModule');
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/ export async function importModule(filePath, options = {}) {
|
|
14
|
-
const { default: returnDefault = true, tsconfigPath } = options;
|
|
14
|
+
const { default: returnDefault = true, jsx = false, tsconfigPath } = options;
|
|
15
15
|
const jiti = createJiti(import.meta.url, {
|
|
16
16
|
debug: debug.enabled,
|
|
17
|
+
jsx,
|
|
17
18
|
tsconfigPaths: typeof tsconfigPath === 'string' ? tsconfigPath : true
|
|
18
19
|
});
|
|
19
20
|
const fileURL = typeof filePath === 'string' ? pathToFileURL(filePath) : filePath;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/util/importModule.ts"],"sourcesContent":["import {fileURLToPath, pathToFileURL} from 'node:url'\n\nimport {createJiti, type JitiResolveOptions} from 'jiti'\n\nimport {subdebug} from '../_exports/debug.js'\n\ninterface ImportModuleOptions {\n /**\n * Whether to return the default export of the module.\n * Default: true\n */\n default?: boolean\n\n /**\n * Path to the tsconfig file to use for the import. If not provided, the tsconfig\n * will be inferred from the nearest `tsconfig.json` file.\n */\n tsconfigPath?: string\n}\n\nconst debug = subdebug('importModule')\n\n/**\n * Imports a module using Jiti and returns its exports.\n *\n * @param filePath - Path to the module to import.\n * @param options - Options for the importModule function.\n * @returns The exported module.\n *\n * @internal\n */\nexport async function importModule<T = unknown>(\n filePath: string | URL,\n options: ImportModuleOptions = {},\n): Promise<T> {\n const {default: returnDefault = true, tsconfigPath} = options\n\n const jiti = createJiti(import.meta.url, {\n debug: debug.enabled,\n tsconfigPaths: typeof tsconfigPath === 'string' ? tsconfigPath : true,\n })\n\n const fileURL = typeof filePath === 'string' ? pathToFileURL(filePath) : filePath\n\n debug(`Loading module: ${fileURLToPath(fileURL)}`, {tsconfigPath})\n\n const jitiOptions: JitiResolveOptions & {default?: true} = {}\n\n // If the default option is true, add it to the jiti options\n if (returnDefault) {\n jitiOptions.default = true\n }\n\n return jiti.import<T>(fileURLToPath(fileURL), jitiOptions)\n}\n"],"names":["fileURLToPath","pathToFileURL","createJiti","subdebug","debug","importModule","filePath","options","default","returnDefault","tsconfigPath","jiti","url","enabled","tsconfigPaths","fileURL","jitiOptions","import"],"mappings":"AAAA,SAAQA,aAAa,EAAEC,aAAa,QAAO,WAAU;AAErD,SAAQC,UAAU,QAAgC,OAAM;AAExD,SAAQC,QAAQ,QAAO,uBAAsB;
|
|
1
|
+
{"version":3,"sources":["../../src/util/importModule.ts"],"sourcesContent":["import {fileURLToPath, pathToFileURL} from 'node:url'\n\nimport {createJiti, type JitiResolveOptions} from 'jiti'\n\nimport {subdebug} from '../_exports/debug.js'\n\ninterface ImportModuleOptions {\n /**\n * Whether to return the default export of the module.\n * Default: true\n */\n default?: boolean\n\n /**\n * Whether to transform JSX in the imported module (and anything it imports).\n * Required for `.tsx`/`.jsx` modules — without it they fail to parse.\n * Default: false\n */\n jsx?: boolean\n\n /**\n * Path to the tsconfig file to use for the import. If not provided, the tsconfig\n * will be inferred from the nearest `tsconfig.json` file.\n */\n tsconfigPath?: string\n}\n\nconst debug = subdebug('importModule')\n\n/**\n * Imports a module using Jiti and returns its exports.\n *\n * @param filePath - Path to the module to import.\n * @param options - Options for the importModule function.\n * @returns The exported module.\n *\n * @internal\n */\nexport async function importModule<T = unknown>(\n filePath: string | URL,\n options: ImportModuleOptions = {},\n): Promise<T> {\n const {default: returnDefault = true, jsx = false, tsconfigPath} = options\n\n const jiti = createJiti(import.meta.url, {\n debug: debug.enabled,\n jsx,\n tsconfigPaths: typeof tsconfigPath === 'string' ? tsconfigPath : true,\n })\n\n const fileURL = typeof filePath === 'string' ? pathToFileURL(filePath) : filePath\n\n debug(`Loading module: ${fileURLToPath(fileURL)}`, {tsconfigPath})\n\n const jitiOptions: JitiResolveOptions & {default?: true} = {}\n\n // If the default option is true, add it to the jiti options\n if (returnDefault) {\n jitiOptions.default = true\n }\n\n return jiti.import<T>(fileURLToPath(fileURL), jitiOptions)\n}\n"],"names":["fileURLToPath","pathToFileURL","createJiti","subdebug","debug","importModule","filePath","options","default","returnDefault","jsx","tsconfigPath","jiti","url","enabled","tsconfigPaths","fileURL","jitiOptions","import"],"mappings":"AAAA,SAAQA,aAAa,EAAEC,aAAa,QAAO,WAAU;AAErD,SAAQC,UAAU,QAAgC,OAAM;AAExD,SAAQC,QAAQ,QAAO,uBAAsB;AAuB7C,MAAMC,QAAQD,SAAS;AAEvB;;;;;;;;CAQC,GACD,OAAO,eAAeE,aACpBC,QAAsB,EACtBC,UAA+B,CAAC,CAAC;IAEjC,MAAM,EAACC,SAASC,gBAAgB,IAAI,EAAEC,MAAM,KAAK,EAAEC,YAAY,EAAC,GAAGJ;IAEnE,MAAMK,OAAOV,WAAW,YAAYW,GAAG,EAAE;QACvCT,OAAOA,MAAMU,OAAO;QACpBJ;QACAK,eAAe,OAAOJ,iBAAiB,WAAWA,eAAe;IACnE;IAEA,MAAMK,UAAU,OAAOV,aAAa,WAAWL,cAAcK,YAAYA;IAEzEF,MAAM,CAAC,gBAAgB,EAAEJ,cAAcgB,UAAU,EAAE;QAACL;IAAY;IAEhE,MAAMM,cAAqD,CAAC;IAE5D,4DAA4D;IAC5D,IAAIR,eAAe;QACjBQ,YAAYT,OAAO,GAAG;IACxB;IAEA,OAAOI,KAAKM,MAAM,CAAIlB,cAAcgB,UAAUC;AAChD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/cli-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Sanity CLI core package",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -119,8 +119,8 @@
|
|
|
119
119
|
"access": "public"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@inquirer/core": "^12.0.
|
|
123
|
-
"@inquirer/prompts": "^8.
|
|
122
|
+
"@inquirer/core": "^12.0.5",
|
|
123
|
+
"@inquirer/prompts": "^8.7.4",
|
|
124
124
|
"@oclif/core": "^4.11.14",
|
|
125
125
|
"@sanity/client": "^8.9.0",
|
|
126
126
|
"boxen": "^8.0.1",
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
"@swc/cli": "^0.8.1",
|
|
150
150
|
"@swc/core": "^1.15.43",
|
|
151
151
|
"@types/jsdom": "^28.0.3",
|
|
152
|
-
"@types/node": "^22.20.
|
|
152
|
+
"@types/node": "^22.20.5",
|
|
153
153
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
154
154
|
"eslint": "^10.7.0",
|
|
155
155
|
"oxc-transform-react": "^0.153.0",
|