sanity 3.93.1-next.39.fc3d873366 → 3.93.1-next.40.6377c06e67
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.
@@ -32,10 +32,10 @@ function getWorkspace({
|
|
32
32
|
if (workspaces.length === 1)
|
33
33
|
return workspaces[0];
|
34
34
|
if (workspaceName === void 0)
|
35
|
-
throw new Error(
|
35
|
+
throw new Error(`Multiple workspaces found. Please specify which workspace to use with '--workspace'. Available workspaces: ${workspaces.map((w) => w.name).join(", ")}`);
|
36
36
|
const workspace = workspaces.find((w) => w.name === workspaceName);
|
37
37
|
if (!workspace)
|
38
|
-
throw new Error(`Could not find
|
38
|
+
throw new Error(`Could not find "${workspaceName}" workspace. Available workspaces: ${workspaces.map((w) => w.name).join(", ")}`);
|
39
39
|
return workspace;
|
40
40
|
}
|
41
41
|
//# sourceMappingURL=extractSchema.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"extractSchema.js","sources":["../../../../src/_internal/cli/threads/extractSchema.ts"],"sourcesContent":["import {isMainThread, parentPort, workerData as _workerData} from 'node:worker_threads'\n\nimport {extractSchema} from '@sanity/schema/_internal'\nimport {type Workspace} from 'sanity'\n\nimport {getStudioWorkspaces} from '../util/getStudioWorkspaces'\nimport {mockBrowserEnvironment} from '../util/mockBrowserEnvironment'\n\n/** @internal */\nexport interface ExtractSchemaWorkerData {\n workDir: string\n workspaceName?: string\n enforceRequiredFields?: boolean\n format: 'groq-type-nodes' | string\n}\n\n/** @internal */\nexport interface ExtractSchemaWorkerResult {\n schema: ReturnType<typeof extractSchema>\n}\n\nasync function main() {\n if (isMainThread || !parentPort) {\n throw new Error('This module must be run as a worker thread')\n }\n\n const opts = _workerData as ExtractSchemaWorkerData\n const cleanup = mockBrowserEnvironment(opts.workDir)\n\n try {\n if (opts.format !== 'groq-type-nodes') {\n throw new Error(`Unsupported format: \"${opts.format}\"`)\n }\n\n const workspaces = await getStudioWorkspaces({basePath: opts.workDir})\n\n const workspace = getWorkspace({workspaces, workspaceName: opts.workspaceName})\n\n const schema = extractSchema(workspace.schema, {\n enforceRequiredFields: opts.enforceRequiredFields,\n })\n\n parentPort?.postMessage({\n schema,\n } satisfies ExtractSchemaWorkerResult)\n } finally {\n cleanup()\n }\n}\n\nmain().then(() => process.exit())\n\nfunction getWorkspace({\n workspaces,\n workspaceName,\n}: {\n workspaces: Workspace[]\n workspaceName?: string\n}): Workspace {\n if (workspaces.length === 0) {\n throw new Error('No studio configuration found')\n }\n\n if (workspaces.length === 1) {\n return workspaces[0]\n }\n\n if (workspaceName === undefined) {\n throw new Error(\n `Multiple workspaces found. Please specify which workspace to use with '--workspace'
|
1
|
+
{"version":3,"file":"extractSchema.js","sources":["../../../../src/_internal/cli/threads/extractSchema.ts"],"sourcesContent":["import {isMainThread, parentPort, workerData as _workerData} from 'node:worker_threads'\n\nimport {extractSchema} from '@sanity/schema/_internal'\nimport {type Workspace} from 'sanity'\n\nimport {getStudioWorkspaces} from '../util/getStudioWorkspaces'\nimport {mockBrowserEnvironment} from '../util/mockBrowserEnvironment'\n\n/** @internal */\nexport interface ExtractSchemaWorkerData {\n workDir: string\n workspaceName?: string\n enforceRequiredFields?: boolean\n format: 'groq-type-nodes' | string\n}\n\n/** @internal */\nexport interface ExtractSchemaWorkerResult {\n schema: ReturnType<typeof extractSchema>\n}\n\nasync function main() {\n if (isMainThread || !parentPort) {\n throw new Error('This module must be run as a worker thread')\n }\n\n const opts = _workerData as ExtractSchemaWorkerData\n const cleanup = mockBrowserEnvironment(opts.workDir)\n\n try {\n if (opts.format !== 'groq-type-nodes') {\n throw new Error(`Unsupported format: \"${opts.format}\"`)\n }\n\n const workspaces = await getStudioWorkspaces({basePath: opts.workDir})\n\n const workspace = getWorkspace({workspaces, workspaceName: opts.workspaceName})\n\n const schema = extractSchema(workspace.schema, {\n enforceRequiredFields: opts.enforceRequiredFields,\n })\n\n parentPort?.postMessage({\n schema,\n } satisfies ExtractSchemaWorkerResult)\n } finally {\n cleanup()\n }\n}\n\nmain().then(() => process.exit())\n\nfunction getWorkspace({\n workspaces,\n workspaceName,\n}: {\n workspaces: Workspace[]\n workspaceName?: string\n}): Workspace {\n if (workspaces.length === 0) {\n throw new Error('No studio configuration found')\n }\n\n if (workspaces.length === 1) {\n return workspaces[0]\n }\n\n if (workspaceName === undefined) {\n throw new Error(\n `Multiple workspaces found. Please specify which workspace to use with '--workspace'. Available workspaces: ${workspaces.map((w) => w.name).join(', ')}`,\n )\n }\n const workspace = workspaces.find((w) => w.name === workspaceName)\n if (!workspace) {\n throw new Error(\n `Could not find \"${workspaceName}\" workspace. Available workspaces: ${workspaces.map((w) => w.name).join(', ')}`,\n )\n }\n return workspace\n}\n"],"names":["main","isMainThread","parentPort","Error","opts","_workerData","cleanup","mockBrowserEnvironment","workDir","format","workspaces","getStudioWorkspaces","basePath","workspace","getWorkspace","workspaceName","schema","extractSchema","enforceRequiredFields","postMessage","then","process","exit","length","undefined","map","w","name","join","find"],"mappings":";;AAqBA,eAAeA,OAAO;AACpB,MAAIC,oBAAAA,gBAAgB,CAACC,oBAAAA;AACb,UAAA,IAAIC,MAAM,4CAA4C;AAG9D,QAAMC,OAAOC,oBAAAA,YACPC,UAAUC,uBAAAA,uBAAuBH,KAAKI,OAAO;AAE/C,MAAA;AACF,QAAIJ,KAAKK,WAAW;AAClB,YAAM,IAAIN,MAAM,wBAAwBC,KAAKK,MAAM,GAAG;AAGlDC,UAAAA,aAAa,MAAMC,wCAAoB;AAAA,MAACC,UAAUR,KAAKI;AAAAA,IAAAA,CAAQ,GAE/DK,YAAYC,aAAa;AAAA,MAACJ;AAAAA,MAAYK,eAAeX,KAAKW;AAAAA,IAAc,CAAA,GAExEC,SAASC,wBAAcJ,UAAUG,QAAQ;AAAA,MAC7CE,uBAAuBd,KAAKc;AAAAA,IAAAA,CAC7B;AAEDhB,wBAAAA,YAAYiB,YAAY;AAAA,MACtBH;AAAAA,IAAAA,CACmC;AAAA,EAAA,UAC7B;AACA,YAAA;AAAA,EAAA;AAEZ;AAEAhB,KAAAA,EAAOoB,KAAK,MAAMC,QAAQC,MAAM;AAEhC,SAASR,aAAa;AAAA,EACpBJ;AAAAA,EACAK;AAIF,GAAc;AACZ,MAAIL,WAAWa,WAAW;AAClB,UAAA,IAAIpB,MAAM,+BAA+B;AAGjD,MAAIO,WAAWa,WAAW;AACxB,WAAOb,WAAW,CAAC;AAGrB,MAAIK,kBAAkBS;AACpB,UAAM,IAAIrB,MACR,8GAA8GO,WAAWe,IAAKC,CAAAA,MAAMA,EAAEC,IAAI,EAAEC,KAAK,IAAI,CAAC,EACxJ;AAEF,QAAMf,YAAYH,WAAWmB,KAAMH,CAAMA,MAAAA,EAAEC,SAASZ,aAAa;AACjE,MAAI,CAACF;AACH,UAAM,IAAIV,MACR,mBAAmBY,aAAa,sCAAsCL,WAAWe,IAAKC,CAAMA,MAAAA,EAAEC,IAAI,EAAEC,KAAK,IAAI,CAAC,EAChH;AAEKf,SAAAA;AACT;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "sanity",
|
3
|
-
"version": "3.93.1-next.
|
3
|
+
"version": "3.93.1-next.40.6377c06e67",
|
4
4
|
"description": "Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches",
|
5
5
|
"keywords": [
|
6
6
|
"sanity",
|
@@ -150,11 +150,11 @@
|
|
150
150
|
"@rexxars/react-json-inspector": "^9.0.1",
|
151
151
|
"@sanity/asset-utils": "^2.2.1",
|
152
152
|
"@sanity/bifur-client": "^0.4.1",
|
153
|
-
"@sanity/cli": "3.93.1-next.
|
153
|
+
"@sanity/cli": "3.93.1-next.40.6377c06e67",
|
154
154
|
"@sanity/client": "^7.6.0",
|
155
155
|
"@sanity/color": "^3.0.6",
|
156
156
|
"@sanity/comlink": "^3.0.5",
|
157
|
-
"@sanity/diff": "3.93.1-next.
|
157
|
+
"@sanity/diff": "3.93.1-next.40.6377c06e67",
|
158
158
|
"@sanity/diff-match-patch": "^3.2.0",
|
159
159
|
"@sanity/diff-patch": "^5.0.0",
|
160
160
|
"@sanity/eventsource": "^5.0.2",
|
@@ -167,16 +167,16 @@
|
|
167
167
|
"@sanity/logos": "^2.2.0",
|
168
168
|
"@sanity/media-library-types": "^1.0.0",
|
169
169
|
"@sanity/message-protocol": "^0.13.0",
|
170
|
-
"@sanity/migrate": "3.93.1-next.
|
171
|
-
"@sanity/mutator": "3.93.1-next.
|
170
|
+
"@sanity/migrate": "3.93.1-next.40.6377c06e67",
|
171
|
+
"@sanity/mutator": "3.93.1-next.40.6377c06e67",
|
172
172
|
"@sanity/presentation-comlink": "^1.0.21",
|
173
173
|
"@sanity/preview-url-secret": "^2.1.11",
|
174
|
-
"@sanity/schema": "3.93.1-next.
|
174
|
+
"@sanity/schema": "3.93.1-next.40.6377c06e67",
|
175
175
|
"@sanity/sdk": "0.0.0-alpha.25",
|
176
176
|
"@sanity/telemetry": "^0.8.0",
|
177
|
-
"@sanity/types": "3.93.1-next.
|
177
|
+
"@sanity/types": "3.93.1-next.40.6377c06e67",
|
178
178
|
"@sanity/ui": "^2.16.2",
|
179
|
-
"@sanity/util": "3.93.1-next.
|
179
|
+
"@sanity/util": "3.93.1-next.40.6377c06e67",
|
180
180
|
"@sanity/uuid": "^3.0.2",
|
181
181
|
"@sentry/react": "^8.33.0",
|
182
182
|
"@tanstack/react-table": "^8.21.3",
|
@@ -285,7 +285,7 @@
|
|
285
285
|
"@repo/package.bundle": "3.93.0",
|
286
286
|
"@repo/package.config": "3.93.0",
|
287
287
|
"@repo/test-config": "3.93.0",
|
288
|
-
"@sanity/codegen": "3.93.1-next.
|
288
|
+
"@sanity/codegen": "3.93.1-next.40.6377c06e67",
|
289
289
|
"@sanity/eslint-config-i18n": "^2.0.0",
|
290
290
|
"@sanity/generate-help-url": "^3.0.0",
|
291
291
|
"@sanity/pkg-utils": "6.13.4",
|
@@ -334,5 +334,5 @@
|
|
334
334
|
"engines": {
|
335
335
|
"node": ">=18"
|
336
336
|
},
|
337
|
-
"gitHead": "
|
337
|
+
"gitHead": "6377c06e671004c3857f9232a332949bd5f78e2e"
|
338
338
|
}
|