sanity 3.92.1-next.28.e41e8140d2 → 3.92.1-next.30.cedda92b03

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.
@@ -22,10 +22,8 @@ function getStudioConfig({
22
22
  const mod = require(configPath);
23
23
  config = mod.__esModule && mod.default ? mod.default : mod;
24
24
  } catch (err) {
25
- const message = `Failed to load configuration file "${configPath}":
26
- ${err.message}`;
27
- throw Object.assign(err, {
28
- message
25
+ throw new Error(`Failed to load configuration file "${configPath}"`, {
26
+ cause: err
29
27
  });
30
28
  }
31
29
  if (!config) throw new Error("Configuration did not export expected config shape");
@@ -1 +1 @@
1
- {"version":3,"file":"getStudioWorkspaces.js","sources":["../../src/_internal/cli/util/getStudioWorkspaces.ts"],"sourcesContent":["/* eslint-disable no-sync */\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {firstValueFrom} from 'rxjs'\nimport {type Config, resolveConfig, type Workspace, type WorkspaceOptions} from 'sanity'\n\nimport {mockBrowserEnvironment} from './mockBrowserEnvironment'\n\nconst candidates = [\n 'sanity.config.js',\n 'sanity.config.jsx',\n 'sanity.config.ts',\n 'sanity.config.tsx',\n]\n\ninterface GetStudioWorkspacesOptions {\n configPath?: string\n basePath: string\n}\n\n/**\n * Note: Don't run this on the main thread, use it a forked process\n */\nexport function getStudioConfig({\n basePath,\n configPath: cfgPath,\n}: GetStudioWorkspacesOptions): WorkspaceOptions[] {\n let cleanup\n try {\n cleanup = mockBrowserEnvironment(basePath)\n\n let configPath = cfgPath\n if (configPath && !fs.existsSync(configPath)) {\n throw new Error(`Failed to find config at \"${cfgPath}\"`)\n } else if (!configPath) {\n configPath = candidates\n .map((candidate) => path.join(basePath, candidate))\n .find((candidate) => fs.existsSync(candidate))\n }\n\n if (!configPath) {\n throw new Error(`Failed to resolve sanity.config.(js|ts) for base path \"${basePath}\"`)\n }\n\n let config: Config | undefined\n try {\n // eslint-disable-next-line import/no-dynamic-require\n const mod = require(configPath)\n config = mod.__esModule && mod.default ? mod.default : mod\n } catch (err) {\n const message = `Failed to load configuration file \"${configPath}\":\\n${err.message}`\n // this helps preserve the stack trace\n throw Object.assign(err, {message})\n }\n\n if (!config) throw new Error('Configuration did not export expected config shape')\n const normalized = Array.isArray(config)\n ? config\n : [{...config, name: config.name || 'default', basePath: config.basePath || '/'}]\n\n return normalized\n } finally {\n cleanup?.()\n }\n}\n\n/**\n * Note: Don't run this on the main thread, use it a forked process\n */\nexport async function getStudioWorkspaces(\n options: GetStudioWorkspacesOptions,\n): Promise<Workspace[]> {\n let cleanup\n\n try {\n cleanup = mockBrowserEnvironment(options.basePath)\n const config = getStudioConfig(options)\n const workspaces = await firstValueFrom(resolveConfig(config))\n if (!workspaces) throw new Error('Failed to resolve configuration')\n return workspaces\n } finally {\n cleanup?.()\n }\n}\n"],"names":["candidates","getStudioConfig","basePath","configPath","cfgPath","cleanup","mockBrowserEnvironment","fs","existsSync","Error","map","candidate","path","join","find","config","mod","require","__esModule","default","err","message","Object","assign","Array","isArray","name","getStudioWorkspaces","options","workspaces","firstValueFrom","resolveConfig"],"mappings":";;;;;;AASA,MAAMA,aAAa,CACjB,oBACA,qBACA,oBACA,mBAAmB;AAWd,SAASC,gBAAgB;AAAA,EAC9BC;AAAAA,EACAC,YAAYC;AACc,GAAuB;AAC7CC,MAAAA;AACA,MAAA;AACFA,cAAUC,8CAAuBJ,QAAQ;AAEzC,QAAIC,aAAaC;AACjB,QAAID,cAAc,CAACI,oBAAGC,WAAWL,UAAU;AACzC,YAAM,IAAIM,MAAM,6BAA6BL,OAAO,GAAG;AAOzD,QANYD,eACVA,aAAaH,WACVU,IAAKC,CAAcC,cAAAA,cAAAA,QAAKC,KAAKX,UAAUS,SAAS,CAAC,EACjDG,KAAMH,CAAcJ,cAAAA,YAAAA,QAAGC,WAAWG,SAAS,CAAC,IAG7C,CAACR;AACH,YAAM,IAAIM,MAAM,0DAA0DP,QAAQ,GAAG;AAGnFa,QAAAA;AACA,QAAA;AAEIC,YAAAA,MAAMC,QAAQd,UAAU;AAC9BY,eAASC,IAAIE,cAAcF,IAAIG,UAAUH,IAAIG,UAAUH;AAAAA,aAChDI,KAAK;AACNC,YAAAA,UAAU,sCAAsClB,UAAU;AAAA,EAAOiB,IAAIC,OAAO;AAE5EC,YAAAA,OAAOC,OAAOH,KAAK;AAAA,QAACC;AAAAA,MAAAA,CAAQ;AAAA,IAAA;AAGpC,QAAI,CAACN,OAAc,OAAA,IAAIN,MAAM,oDAAoD;AAKjF,WAJmBe,MAAMC,QAAQV,MAAM,IACnCA,SACA,CAAC;AAAA,MAAC,GAAGA;AAAAA,MAAQW,MAAMX,OAAOW,QAAQ;AAAA,MAAWxB,UAAUa,OAAOb,YAAY;AAAA,IAAA,CAAI;AAAA,EAAA,UAG1E;AACE,cAAA;AAAA,EAAA;AAEd;AAKA,eAAsByB,oBACpBC,SACsB;AAClBvB,MAAAA;AAEA,MAAA;AACQC,cAAAA,uBAAAA,uBAAuBsB,QAAQ1B,QAAQ;AAC3Ca,UAAAA,SAASd,gBAAgB2B,OAAO,GAChCC,aAAa,MAAMC,KAAAA,eAAeC,qBAAchB,MAAM,CAAC;AAC7D,QAAI,CAACc,WAAkB,OAAA,IAAIpB,MAAM,iCAAiC;AAC3DoB,WAAAA;AAAAA,EAAAA,UACC;AACE,cAAA;AAAA,EAAA;AAEd;;;"}
1
+ {"version":3,"file":"getStudioWorkspaces.js","sources":["../../src/_internal/cli/util/getStudioWorkspaces.ts"],"sourcesContent":["/* eslint-disable no-sync */\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {firstValueFrom} from 'rxjs'\nimport {type Config, resolveConfig, type Workspace, type WorkspaceOptions} from 'sanity'\n\nimport {mockBrowserEnvironment} from './mockBrowserEnvironment'\n\nconst candidates = [\n 'sanity.config.js',\n 'sanity.config.jsx',\n 'sanity.config.ts',\n 'sanity.config.tsx',\n]\n\ninterface GetStudioWorkspacesOptions {\n configPath?: string\n basePath: string\n}\n\n/**\n * Note: Don't run this on the main thread, use it a forked process\n */\nexport function getStudioConfig({\n basePath,\n configPath: cfgPath,\n}: GetStudioWorkspacesOptions): WorkspaceOptions[] {\n let cleanup\n try {\n cleanup = mockBrowserEnvironment(basePath)\n\n let configPath = cfgPath\n if (configPath && !fs.existsSync(configPath)) {\n throw new Error(`Failed to find config at \"${cfgPath}\"`)\n } else if (!configPath) {\n configPath = candidates\n .map((candidate) => path.join(basePath, candidate))\n .find((candidate) => fs.existsSync(candidate))\n }\n\n if (!configPath) {\n throw new Error(`Failed to resolve sanity.config.(js|ts) for base path \"${basePath}\"`)\n }\n\n let config: Config | undefined\n try {\n // eslint-disable-next-line import/no-dynamic-require\n const mod = require(configPath)\n config = mod.__esModule && mod.default ? mod.default : mod\n } catch (err) {\n throw new Error(`Failed to load configuration file \"${configPath}\"`, {\n cause: err,\n })\n }\n\n if (!config) throw new Error('Configuration did not export expected config shape')\n const normalized = Array.isArray(config)\n ? config\n : [{...config, name: config.name || 'default', basePath: config.basePath || '/'}]\n\n return normalized\n } finally {\n cleanup?.()\n }\n}\n\n/**\n * Note: Don't run this on the main thread, use it a forked process\n */\nexport async function getStudioWorkspaces(\n options: GetStudioWorkspacesOptions,\n): Promise<Workspace[]> {\n let cleanup\n\n try {\n cleanup = mockBrowserEnvironment(options.basePath)\n const config = getStudioConfig(options)\n const workspaces = await firstValueFrom(resolveConfig(config))\n if (!workspaces) throw new Error('Failed to resolve configuration')\n return workspaces\n } finally {\n cleanup?.()\n }\n}\n"],"names":["candidates","getStudioConfig","basePath","configPath","cfgPath","cleanup","mockBrowserEnvironment","fs","existsSync","Error","map","candidate","path","join","find","config","mod","require","__esModule","default","err","cause","Array","isArray","name","getStudioWorkspaces","options","workspaces","firstValueFrom","resolveConfig"],"mappings":";;;;;;AASA,MAAMA,aAAa,CACjB,oBACA,qBACA,oBACA,mBAAmB;AAWd,SAASC,gBAAgB;AAAA,EAC9BC;AAAAA,EACAC,YAAYC;AACc,GAAuB;AAC7CC,MA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  "use strict";
2
- const SANITY_VERSION = "3.92.1-next.28.e41e8140d2";
2
+ const SANITY_VERSION = "3.92.1-next.30.cedda92b03";
3
3
  exports.SANITY_VERSION = SANITY_VERSION;
4
4
  //# sourceMappingURL=version.js.map
@@ -1,4 +1,4 @@
1
- const SANITY_VERSION = "3.92.1-next.28.e41e8140d2";
1
+ const SANITY_VERSION = "3.92.1-next.30.cedda92b03";
2
2
  export {
3
3
  SANITY_VERSION
4
4
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sanity",
3
- "version": "3.92.1-next.28.e41e8140d2",
3
+ "version": "3.92.1-next.30.cedda92b03",
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",
@@ -156,11 +156,11 @@
156
156
  "@rexxars/react-json-inspector": "^9.0.1",
157
157
  "@sanity/asset-utils": "^2.2.1",
158
158
  "@sanity/bifur-client": "^0.4.1",
159
- "@sanity/cli": "3.92.1-next.28.e41e8140d2",
159
+ "@sanity/cli": "3.92.1-next.30.cedda92b03",
160
160
  "@sanity/client": "^7.6.0",
161
161
  "@sanity/color": "^3.0.0",
162
162
  "@sanity/comlink": "^3.0.5",
163
- "@sanity/diff": "3.92.1-next.28.e41e8140d2",
163
+ "@sanity/diff": "3.92.1-next.30.cedda92b03",
164
164
  "@sanity/diff-match-patch": "^3.1.1",
165
165
  "@sanity/diff-patch": "^5.0.0",
166
166
  "@sanity/eventsource": "^5.0.0",
@@ -172,16 +172,16 @@
172
172
  "@sanity/insert-menu": "^1.1.12",
173
173
  "@sanity/logos": "^2.2.0",
174
174
  "@sanity/message-protocol": "^0.13.0",
175
- "@sanity/migrate": "3.92.1-next.28.e41e8140d2",
176
- "@sanity/mutator": "3.92.1-next.28.e41e8140d2",
175
+ "@sanity/migrate": "3.92.1-next.30.cedda92b03",
176
+ "@sanity/mutator": "3.92.1-next.30.cedda92b03",
177
177
  "@sanity/presentation-comlink": "^1.0.21",
178
178
  "@sanity/preview-url-secret": "^2.1.11",
179
- "@sanity/schema": "3.92.1-next.28.e41e8140d2",
179
+ "@sanity/schema": "3.92.1-next.30.cedda92b03",
180
180
  "@sanity/sdk": "0.0.0-alpha.25",
181
181
  "@sanity/telemetry": "^0.8.0",
182
- "@sanity/types": "3.92.1-next.28.e41e8140d2",
182
+ "@sanity/types": "3.92.1-next.30.cedda92b03",
183
183
  "@sanity/ui": "^2.15.18",
184
- "@sanity/util": "3.92.1-next.28.e41e8140d2",
184
+ "@sanity/util": "3.92.1-next.30.cedda92b03",
185
185
  "@sanity/uuid": "^3.0.2",
186
186
  "@sentry/react": "^8.33.0",
187
187
  "@tanstack/react-table": "^8.16.0",
@@ -288,7 +288,7 @@
288
288
  "@repo/dev-aliases": "3.92.0",
289
289
  "@repo/package.config": "3.92.0",
290
290
  "@repo/test-config": "3.92.0",
291
- "@sanity/codegen": "3.92.1-next.28.e41e8140d2",
291
+ "@sanity/codegen": "3.92.1-next.30.cedda92b03",
292
292
  "@sanity/generate-help-url": "^3.0.0",
293
293
  "@sanity/pkg-utils": "6.13.4",
294
294
  "@sanity/tsdoc": "1.0.169",
@@ -335,5 +335,5 @@
335
335
  "engines": {
336
336
  "node": ">=18"
337
337
  },
338
- "gitHead": "e41e8140d2de74151228f535181d368407aa9111"
338
+ "gitHead": "cedda92b038b013d6c3380fcfc72c9f39b6e052d"
339
339
  }
@@ -49,9 +49,9 @@ export function getStudioConfig({
49
49
  const mod = require(configPath)
50
50
  config = mod.__esModule && mod.default ? mod.default : mod
51
51
  } catch (err) {
52
- const message = `Failed to load configuration file "${configPath}":\n${err.message}`
53
- // this helps preserve the stack trace
54
- throw Object.assign(err, {message})
52
+ throw new Error(`Failed to load configuration file "${configPath}"`, {
53
+ cause: err,
54
+ })
55
55
  }
56
56
 
57
57
  if (!config) throw new Error('Configuration did not export expected config shape')