@sanity/cli 3.93.1-bump-pkg-utils.10.412e2ab170 → 3.93.1-bump-pkg-utils.34.5d0c0b3d22

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.
Files changed (167) hide show
  1. package/lib/_chunks-cjs/cli.js +1 -1
  2. package/lib/_chunks-cjs/cli.js.map +1 -1
  3. package/lib/_chunks-cjs/cliWorker.js.map +1 -1
  4. package/lib/_chunks-cjs/generateAction.js.map +1 -1
  5. package/lib/_chunks-cjs/getCliConfig.js.map +1 -1
  6. package/lib/_chunks-cjs/journeyConfig.js.map +1 -1
  7. package/lib/_chunks-cjs/loadEnv.js.map +1 -1
  8. package/lib/cli.d.ts +10 -6
  9. package/lib/index.d.mts +418 -331
  10. package/lib/index.d.ts +418 -331
  11. package/lib/index.js.map +1 -1
  12. package/lib/index.mjs.map +1 -1
  13. package/lib/run.d.ts +1 -1
  14. package/lib/run.js.map +1 -1
  15. package/lib/workers/getAndWriteJourneySchema.d.ts +1 -1
  16. package/lib/workers/getAndWriteJourneySchema.js.map +1 -1
  17. package/lib/workers/getCliConfig.d.ts +1 -1
  18. package/lib/workers/getCliConfig.js.map +1 -1
  19. package/lib/workers/typegenGenerate.d.ts +42 -35
  20. package/lib/workers/typegenGenerate.js.map +1 -1
  21. package/package.json +6 -7
  22. package/templates/blog/README.md +1 -1
  23. package/templates/clean/README.md +1 -1
  24. package/templates/ecommerce/README.md +1 -1
  25. package/templates/get-started/README.md +1 -1
  26. package/templates/moviedb/README.md +1 -1
  27. package/templates/quickstart/README.md +1 -1
  28. package/src/CommandRunner.ts +0 -219
  29. package/src/__telemetry__/cli.telemetry.ts +0 -29
  30. package/src/__telemetry__/init.telemetry.ts +0 -95
  31. package/src/actions/codemod/codemodAction.ts +0 -109
  32. package/src/actions/codemod/mods/deskRename.ts +0 -19
  33. package/src/actions/codemod/mods/index.ts +0 -9
  34. package/src/actions/codemod/mods/partsTypeDirective.ts +0 -28
  35. package/src/actions/codemod/mods/reactIconsV3.ts +0 -54
  36. package/src/actions/codemod/types.ts +0 -10
  37. package/src/actions/init-plugin/bootstrapFromTemplate.ts +0 -196
  38. package/src/actions/init-project/bootstrapLocalTemplate.ts +0 -201
  39. package/src/actions/init-project/bootstrapRemoteTemplate.ts +0 -118
  40. package/src/actions/init-project/createAppCliConfig.ts +0 -24
  41. package/src/actions/init-project/createCliConfig.ts +0 -31
  42. package/src/actions/init-project/createPackageManifest.ts +0 -102
  43. package/src/actions/init-project/createStudioConfig.ts +0 -53
  44. package/src/actions/init-project/determineAppTemplate.ts +0 -13
  45. package/src/actions/init-project/fsUtils.ts +0 -40
  46. package/src/actions/init-project/git.ts +0 -59
  47. package/src/actions/init-project/initProject.ts +0 -1708
  48. package/src/actions/init-project/processTemplate.ts +0 -55
  49. package/src/actions/init-project/promptForDatasetName.ts +0 -68
  50. package/src/actions/init-project/prompts/index.ts +0 -51
  51. package/src/actions/init-project/prompts/nextjs.ts +0 -59
  52. package/src/actions/init-project/readPackageJson.ts +0 -17
  53. package/src/actions/init-project/templates/appQuickstart.ts +0 -23
  54. package/src/actions/init-project/templates/appSanityUi.ts +0 -25
  55. package/src/actions/init-project/templates/blog.ts +0 -5
  56. package/src/actions/init-project/templates/clean.ts +0 -5
  57. package/src/actions/init-project/templates/getStarted.ts +0 -37
  58. package/src/actions/init-project/templates/index.ts +0 -24
  59. package/src/actions/init-project/templates/moviedb.ts +0 -35
  60. package/src/actions/init-project/templates/nextjs/index.ts +0 -238
  61. package/src/actions/init-project/templates/nextjs/schemaTypes/blog.ts +0 -252
  62. package/src/actions/init-project/templates/quickstart.ts +0 -5
  63. package/src/actions/init-project/templates/shopify.ts +0 -78
  64. package/src/actions/init-project/templates/shopifyOnline.ts +0 -50
  65. package/src/actions/init-project/updateInitialTemplateMetadata.ts +0 -24
  66. package/src/actions/login/login.telemetry.ts +0 -18
  67. package/src/actions/login/login.ts +0 -350
  68. package/src/actions/login/types.ts +0 -19
  69. package/src/actions/project/createProject.ts +0 -36
  70. package/src/actions/telemetry/setTelemetryConsent.ts +0 -101
  71. package/src/actions/typegen/generate.telemetry.ts +0 -20
  72. package/src/actions/typegen/generateAction.ts +0 -210
  73. package/src/actions/versions/findSanityModuleVersions.ts +0 -185
  74. package/src/actions/yarn/events.ts +0 -73
  75. package/src/cli.ts +0 -350
  76. package/src/cliClient.ts +0 -62
  77. package/src/commands/blueprints/addBlueprintsCommand.ts +0 -155
  78. package/src/commands/blueprints/blueprintsGroup.ts +0 -10
  79. package/src/commands/blueprints/configBlueprintsCommand.ts +0 -86
  80. package/src/commands/blueprints/deployBlueprintsCommand.ts +0 -63
  81. package/src/commands/blueprints/destroyBlueprintsCommand.ts +0 -78
  82. package/src/commands/blueprints/infoBlueprintsCommand.ts +0 -55
  83. package/src/commands/blueprints/initBlueprintsCommand.ts +0 -99
  84. package/src/commands/blueprints/logsBlueprintsCommand.ts +0 -66
  85. package/src/commands/blueprints/planBlueprintsCommand.ts +0 -51
  86. package/src/commands/blueprints/stacksBlueprintsCommand.ts +0 -66
  87. package/src/commands/codemod/codemodCommand.ts +0 -32
  88. package/src/commands/debug/debugCommand.ts +0 -26
  89. package/src/commands/debug/printDebugInfo.ts +0 -243
  90. package/src/commands/docs/docsCommand.ts +0 -20
  91. package/src/commands/functions/devFunctionsCommand.ts +0 -73
  92. package/src/commands/functions/envFunctionsCommand.ts +0 -105
  93. package/src/commands/functions/functionsGroup.ts +0 -10
  94. package/src/commands/functions/logsFunctionsCommand.ts +0 -94
  95. package/src/commands/functions/testFunctionsCommand.ts +0 -93
  96. package/src/commands/help/helpCommand.ts +0 -21
  97. package/src/commands/help/showHelp.ts +0 -58
  98. package/src/commands/index.ts +0 -72
  99. package/src/commands/init/initCommand.ts +0 -123
  100. package/src/commands/install/installCommand.ts +0 -38
  101. package/src/commands/learn/learnCommand.ts +0 -20
  102. package/src/commands/login/loginCommand.ts +0 -29
  103. package/src/commands/logout/logoutCommand.ts +0 -52
  104. package/src/commands/manage/manageCommand.ts +0 -24
  105. package/src/commands/projects/listProjectsCommand.ts +0 -62
  106. package/src/commands/projects/projectsGroup.ts +0 -10
  107. package/src/commands/telemetry/disableTelemetryCommand.ts +0 -19
  108. package/src/commands/telemetry/enableTelemetryCommand.ts +0 -19
  109. package/src/commands/telemetry/telemetryGroup.ts +0 -10
  110. package/src/commands/telemetry/telemetryStatusCommand.ts +0 -89
  111. package/src/commands/typegen/generateTypesCommand.ts +0 -56
  112. package/src/commands/typegen/typegenGroup.ts +0 -10
  113. package/src/commands/versions/printVersionResult.ts +0 -51
  114. package/src/commands/versions/versionsCommand.ts +0 -13
  115. package/src/config.ts +0 -14
  116. package/src/debug.ts +0 -3
  117. package/src/index.ts +0 -6
  118. package/src/outputters/cliOutputter.ts +0 -47
  119. package/src/packageManager/getInstallCommand.ts +0 -26
  120. package/src/packageManager/getUpgradeCommand.ts +0 -52
  121. package/src/packageManager/index.ts +0 -33
  122. package/src/packageManager/installPackages.ts +0 -99
  123. package/src/packageManager/packageManagerChoice.ts +0 -204
  124. package/src/packageManager/uninstallPackages.ts +0 -44
  125. package/src/packageManager/yarnStub.ts +0 -22
  126. package/src/prompters/cliPrompter.ts +0 -9
  127. package/src/run.ts +0 -8
  128. package/src/studioDependencies.ts +0 -25
  129. package/src/types.ts +0 -387
  130. package/src/util/canLaunchBrowser.ts +0 -12
  131. package/src/util/cliWorker.ts +0 -34
  132. package/src/util/clientWrapper.ts +0 -119
  133. package/src/util/copy.ts +0 -50
  134. package/src/util/createExpiringConfig.ts +0 -80
  135. package/src/util/createTelemetryStore.ts +0 -204
  136. package/src/util/detectRuntime.ts +0 -12
  137. package/src/util/dynamicRequire.ts +0 -17
  138. package/src/util/frameworkPort.ts +0 -63
  139. package/src/util/generateCommandsDocumentation.ts +0 -62
  140. package/src/util/getCliConfig.ts +0 -172
  141. package/src/util/getCliVersion.ts +0 -22
  142. package/src/util/getLocalVersion.ts +0 -35
  143. package/src/util/getProjectDefaults.ts +0 -103
  144. package/src/util/getProviderName.ts +0 -9
  145. package/src/util/getUserConfig.ts +0 -15
  146. package/src/util/isCi.ts +0 -7
  147. package/src/util/isCommandGroup.ts +0 -7
  148. package/src/util/isInteractive.ts +0 -3
  149. package/src/util/isTrueish.ts +0 -8
  150. package/src/util/journeyConfig.ts +0 -280
  151. package/src/util/loadEnv.ts +0 -110
  152. package/src/util/mergeCommands.ts +0 -78
  153. package/src/util/neatStack.ts +0 -30
  154. package/src/util/noSuchCommandText.ts +0 -91
  155. package/src/util/parseArguments.ts +0 -76
  156. package/src/util/pathExists.ts +0 -14
  157. package/src/util/readJson.ts +0 -6
  158. package/src/util/readdirRecursive.ts +0 -26
  159. package/src/util/remoteTemplate.ts +0 -320
  160. package/src/util/resolveLatestVersions.ts +0 -24
  161. package/src/util/resolveRootDir.ts +0 -59
  162. package/src/util/telemetryDisclosure.ts +0 -45
  163. package/src/util/updateNotifier.ts +0 -158
  164. package/src/util/writeJson.ts +0 -6
  165. package/src/workers/getAndWriteJourneySchema.ts +0 -7
  166. package/src/workers/getCliConfig.ts +0 -14
  167. package/src/workers/typegenGenerate.ts +0 -228
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/cliClient.ts","../src/config.ts"],"sourcesContent":["import {createClient, type SanityClient} from '@sanity/client'\n\nimport {getCliConfigSync} from './util/getCliConfig'\nimport {resolveRootDir} from './util/resolveRootDir'\n\nexport interface CliClientOptions {\n cwd?: string\n\n projectId?: string\n dataset?: string\n useCdn?: boolean\n token?: string\n apiVersion?: string\n}\n\nexport function getCliClient(options: CliClientOptions = {}): SanityClient {\n if (typeof process !== 'object') {\n throw new Error('getCliClient() should only be called from node.js scripts')\n }\n\n const {\n // eslint-disable-next-line no-process-env\n cwd = process.env.SANITY_BASE_PATH || process.cwd(),\n useCdn = false,\n apiVersion = '2022-06-06',\n projectId,\n dataset,\n token = getCliClient.__internal__getToken(),\n } = options\n\n if (projectId && dataset) {\n return createClient({projectId, dataset, apiVersion, useCdn, token})\n }\n\n const rootDir = resolveRootDir(cwd)\n const {config} = getCliConfigSync(rootDir) || {}\n if (!config) {\n throw new Error('Unable to resolve CLI configuration')\n }\n\n const apiConfig = config?.api || {}\n if (!apiConfig.projectId || !apiConfig.dataset) {\n throw new Error('Unable to resolve project ID/dataset from CLI configuration')\n }\n\n return createClient({\n projectId: apiConfig.projectId,\n dataset: apiConfig.dataset,\n apiVersion,\n useCdn,\n token,\n })\n}\n\n/* eslint-disable camelcase */\n/**\n * @internal\n * @deprecated This is only for INTERNAL use, and should not be relied upon outside of official Sanity modules\n * @returns A token to use when constructing a client without a `token` explicitly defined, or undefined\n */\ngetCliClient.__internal__getToken = (): string | undefined => undefined\n/* eslint-enable camelcase */\n","import {type CliConfig} from './types'\n\n/** @beta */\nexport function defineCliConfig(config: CliConfig): CliConfig {\n return config\n}\n\n/**\n * @deprecated Use `defineCliConfig` instead\n * @beta\n */\nexport function createCliConfig(config: CliConfig): CliConfig {\n return config\n}\n"],"names":["createClient","resolveRootDir","getCliConfigSync"],"mappings":";;;AAegB,SAAA,aAAa,UAA4B,IAAkB;AACzE,MAAI,OAAO,WAAY;AACf,UAAA,IAAI,MAAM,2DAA2D;AAGvE,QAAA;AAAA;AAAA,IAEJ,MAAM,QAAQ,IAAI,oBAAoB,QAAQ,IAAI;AAAA,IAClD,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,QAAQ,aAAa,qBAAqB;AAAA,EAAA,IACxC;AAEJ,MAAI,aAAa;AACf,WAAOA,OAAAA,aAAa,EAAC,WAAW,SAAS,YAAY,QAAQ,OAAM;AAG/D,QAAA,UAAUC,QAAe,eAAA,GAAG,GAC5B,EAAC,WAAUC,aAAAA,iBAAiB,OAAO,KAAK,CAAC;AAC/C,MAAI,CAAC;AACG,UAAA,IAAI,MAAM,qCAAqC;AAGjD,QAAA,YAAY,QAAQ,OAAO,CAAC;AAClC,MAAI,CAAC,UAAU,aAAa,CAAC,UAAU;AAC/B,UAAA,IAAI,MAAM,6DAA6D;AAG/E,SAAOF,oBAAa;AAAA,IAClB,WAAW,UAAU;AAAA,IACrB,SAAS,UAAU;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AACH;AAQA,aAAa,uBAAuB,MAAuB;AAAA;ACzDpD,SAAS,gBAAgB,QAA8B;AACrD,SAAA;AACT;AAMO,SAAS,gBAAgB,QAA8B;AACrD,SAAA;AACT;;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/cliClient.ts","../src/config.ts"],"sourcesContent":["import {createClient, type SanityClient} from '@sanity/client'\n\nimport {getCliConfigSync} from './util/getCliConfig'\nimport {resolveRootDir} from './util/resolveRootDir'\n\nexport interface CliClientOptions {\n cwd?: string\n\n projectId?: string\n dataset?: string\n useCdn?: boolean\n token?: string\n apiVersion?: string\n}\n\nexport function getCliClient(options: CliClientOptions = {}): SanityClient {\n if (typeof process !== 'object') {\n throw new Error('getCliClient() should only be called from node.js scripts')\n }\n\n const {\n // eslint-disable-next-line no-process-env\n cwd = process.env.SANITY_BASE_PATH || process.cwd(),\n useCdn = false,\n apiVersion = '2022-06-06',\n projectId,\n dataset,\n token = getCliClient.__internal__getToken(),\n } = options\n\n if (projectId && dataset) {\n return createClient({projectId, dataset, apiVersion, useCdn, token})\n }\n\n const rootDir = resolveRootDir(cwd)\n const {config} = getCliConfigSync(rootDir) || {}\n if (!config) {\n throw new Error('Unable to resolve CLI configuration')\n }\n\n const apiConfig = config?.api || {}\n if (!apiConfig.projectId || !apiConfig.dataset) {\n throw new Error('Unable to resolve project ID/dataset from CLI configuration')\n }\n\n return createClient({\n projectId: apiConfig.projectId,\n dataset: apiConfig.dataset,\n apiVersion,\n useCdn,\n token,\n })\n}\n\n/* eslint-disable camelcase */\n/**\n * @internal\n * @deprecated This is only for INTERNAL use, and should not be relied upon outside of official Sanity modules\n * @returns A token to use when constructing a client without a `token` explicitly defined, or undefined\n */\ngetCliClient.__internal__getToken = (): string | undefined => undefined\n/* eslint-enable camelcase */\n","import {type CliConfig} from './types'\n\n/** @beta */\nexport function defineCliConfig(config: CliConfig): CliConfig {\n return config\n}\n\n/**\n * @deprecated Use `defineCliConfig` instead\n * @beta\n */\nexport function createCliConfig(config: CliConfig): CliConfig {\n return config\n}\n"],"names":["createClient","resolveRootDir","getCliConfigSync"],"mappings":";;;AAeO,SAAS,aAAa,UAA4B,IAAkB;AACzE,MAAI,OAAO,WAAY;AACrB,UAAM,IAAI,MAAM,2DAA2D;AAG7E,QAAM;AAAA;AAAA,IAEJ,MAAM,QAAQ,IAAI,oBAAoB,QAAQ,IAAA;AAAA,IAC9C,SAAS;AAAA,IACT,aAAa;AAAA,IACb;AAAA,IACA;AAAA,IACA,QAAQ,aAAa,qBAAA;AAAA,EAAqB,IACxC;AAEJ,MAAI,aAAa;AACf,WAAOA,OAAAA,aAAa,EAAC,WAAW,SAAS,YAAY,QAAQ,OAAM;AAGrE,QAAM,UAAUC,QAAAA,eAAe,GAAG,GAC5B,EAAC,WAAUC,aAAAA,iBAAiB,OAAO,KAAK,CAAA;AAC9C,MAAI,CAAC;AACH,UAAM,IAAI,MAAM,qCAAqC;AAGvD,QAAM,YAAY,QAAQ,OAAO,CAAA;AACjC,MAAI,CAAC,UAAU,aAAa,CAAC,UAAU;AACrC,UAAM,IAAI,MAAM,6DAA6D;AAG/E,SAAOF,oBAAa;AAAA,IAClB,WAAW,UAAU;AAAA,IACrB,SAAS,UAAU;AAAA,IACnB;AAAA,IACA;AAAA,IACA;AAAA,EAAA,CACD;AACH;AAQA,aAAa,uBAAuB,MAAuB;AAAA;ACzDpD,SAAS,gBAAgB,QAA8B;AAC5D,SAAO;AACT;AAMO,SAAS,gBAAgB,QAA8B;AAC5D,SAAO;AACT;;;;;"}
package/lib/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/util/dynamicRequire.ts","../src/util/getCliConfig.ts","../src/debug.ts","../src/util/resolveRootDir.ts","../src/cliClient.ts","../src/config.ts","../../../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js","../../../../node_modules/.pnpm/dotenv-expand@9.0.0/node_modules/dotenv-expand/lib/main.js","../src/util/loadEnv.ts"],"sourcesContent":["// Prevent webpack from bundling in webpack context,\n// use regular node require for unbundled context\n\n/* eslint-disable camelcase, no-undef */\ndeclare const __webpack_require__: boolean\ndeclare const __non_webpack_require__: typeof require\n\nconst requireFunc: typeof require =\n typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require\n/* eslint-enable camelcase, no-undef */\n\nexport function dynamicRequire<T = any>(request: string): T {\n const mod = requireFunc(request)\n return mod.__esModule && mod.default ? mod.default : mod\n}\n\ndynamicRequire.resolve = requireFunc.resolve\n","/* eslint-disable no-sync */\n\n/**\n * Reads the Sanity CLI config from one of the following files (in preferred order):\n * - sanity.cli.js\n * - sanity.cli.ts\n *\n * Note: There are two ways of using this:\n * a) `getCliConfig(cwd)`\n * b) `getCliConfig(cwd, {forked: true})`\n *\n * Approach a is generally a bit faster as it avoids the forking startup time, while\n * approach b could be considered \"safer\" since any side-effects of running the config\n * file will not bleed into the current CLI process directly.\n */\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport {Worker} from 'node:worker_threads'\n\nimport {type CliConfig, type SanityJson} from '../types'\nimport {getCliWorkerPath} from './cliWorker'\nimport {dynamicRequire} from './dynamicRequire'\n\nexport type CliMajorVersion = 2 | 3\n\nexport type CliConfigResult =\n | {config: SanityJson; path: string; version: 2}\n | {config: CliConfig; path: string; version: 3}\n | {config: null; path: string; version: CliMajorVersion}\n\nexport async function getCliConfig(\n cwd: string,\n {forked}: {forked?: boolean} = {},\n): Promise<CliConfigResult | null> {\n if (forked) {\n try {\n return await getCliConfigForked(cwd)\n } catch {\n // Intentional noop - try unforked variant\n }\n }\n\n const {unregister} = __DEV__\n ? {unregister: () => undefined}\n : // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('esbuild-register/dist/node').register({supported: {'dynamic-import': true}})\n\n try {\n const v3Config = getSanityCliConfig(cwd)\n if (v3Config) {\n return v3Config\n }\n\n return getSanityJsonConfig(cwd)\n } catch (err) {\n throw err\n } finally {\n unregister()\n }\n}\n\nexport function getCliConfigSync(cwd: string): CliConfigResult | null {\n const v3Config = getSanityCliConfig(cwd)\n return v3Config ? v3Config : getSanityJsonConfig(cwd)\n}\n\nasync function getCliConfigForked(cwd: string): Promise<CliConfigResult | null> {\n const workerPath = await getCliWorkerPath('getCliConfig')\n return new Promise((resolve, reject) => {\n const worker = new Worker(workerPath, {\n workerData: cwd,\n env: process.env,\n })\n worker.on('message', (message) => {\n if (message.type === 'config') {\n resolve(message.config)\n } else {\n const error = new Error(message.error)\n ;(error as any).type = message.errorType\n reject(new Error(message.error))\n }\n })\n worker.on('error', reject)\n worker.on('exit', (code) => {\n if (code !== 0) {\n reject(new Error(`Worker stopped with exit code ${code}`))\n }\n })\n })\n}\n\nfunction getSanityJsonConfig(cwd: string): CliConfigResult | null {\n const configPath = path.join(cwd, 'sanity.json')\n\n if (!fs.existsSync(configPath)) {\n return null\n }\n\n return {\n config: loadJsonConfig(configPath),\n path: configPath,\n version: 2,\n }\n}\n\nfunction getSanityCliConfig(cwd: string): CliConfigResult | null {\n const jsConfigPath = path.join(cwd, 'sanity.cli.js')\n const tsConfigPath = path.join(cwd, 'sanity.cli.ts')\n\n const [js, ts] = [fs.existsSync(jsConfigPath), fs.existsSync(tsConfigPath)]\n\n if (!js && !ts) {\n return null\n }\n\n if (!js && ts) {\n return {\n config: importConfig(tsConfigPath),\n path: tsConfigPath,\n version: 3,\n }\n }\n\n if (js && ts) {\n warn('Found both `sanity.cli.js` and `sanity.cli.ts` - using sanity.cli.js')\n }\n\n return {\n config: importConfig(jsConfigPath),\n path: jsConfigPath,\n version: 3,\n }\n}\n\nfunction loadJsonConfig(filePath: string): SanityJson | null {\n try {\n const content = fs.readFileSync(filePath, 'utf8')\n return JSON.parse(content)\n } catch (err) {\n console.error(`Error reading \"${filePath}\": ${err.message}`)\n return null\n }\n}\n\nfunction importConfig(filePath: string): CliConfig | null {\n try {\n const config = dynamicRequire<CliConfig | {default: CliConfig} | null>(filePath)\n if (config === null || typeof config !== 'object') {\n throw new Error('Module export is not a configuration object')\n }\n\n return 'default' in config ? config.default : config\n } catch (err) {\n // If attempting to import `defineCliConfig` or similar from `sanity/cli`,\n // accept the fact that it might not be installed. Instead, let the CLI\n // give a warning about the `sanity` module not being installed\n if (err.code === 'MODULE_NOT_FOUND' && err.message.includes('sanity/cli')) {\n return null\n }\n\n console.error(`Error reading \"${filePath}\": ${err.message}`)\n return null\n }\n}\n\nfunction warn(warning: string) {\n if (typeof process.send === 'function') {\n process.send({type: 'warning', warning})\n } else {\n console.warn(warning)\n }\n}\n","import debugIt from 'debug'\n\nexport const debug = debugIt('sanity:cli')\n","/* eslint-disable no-sync */\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {debug} from '../debug'\n\n/**\n * Resolve project root directory, falling back to cwd if it cannot be found\n */\nexport function resolveRootDir(cwd: string): string {\n try {\n return resolveProjectRoot(cwd) || cwd\n } catch (err) {\n throw new Error(`Error occurred trying to resolve project root:\\n${err.message}`)\n }\n}\n\nfunction hasSanityConfig(basePath: string, configName: string): boolean {\n const buildConfigs = [\n fileExists(path.join(basePath, `${configName}.js`)),\n fileExists(path.join(basePath, `${configName}.ts`)),\n isSanityV2StudioRoot(basePath),\n ]\n\n return buildConfigs.some(Boolean)\n}\n\nfunction resolveProjectRoot(basePath: string, iterations = 0): string | false {\n const configName = 'sanity.config'\n if (hasSanityConfig(basePath, configName)) {\n return basePath\n }\n\n const parentDir = path.resolve(basePath, '..')\n if (parentDir === basePath || iterations > 30) {\n // Reached root (or max depth), give up\n return false\n }\n\n return resolveProjectRoot(parentDir, iterations + 1)\n}\n\nfunction isSanityV2StudioRoot(basePath: string): boolean {\n try {\n const content = fs.readFileSync(path.join(basePath, 'sanity.json'), 'utf8')\n const sanityJson = JSON.parse(content)\n const isRoot = Boolean(sanityJson?.root)\n if (isRoot) {\n debug('Found Sanity v2 studio root at %s', basePath)\n }\n return isRoot\n } catch (err) {\n return false\n }\n}\n\nfunction fileExists(filePath: string): boolean {\n return fs.existsSync(filePath)\n}\n","import {createClient, type SanityClient} from '@sanity/client'\n\nimport {getCliConfigSync} from './util/getCliConfig'\nimport {resolveRootDir} from './util/resolveRootDir'\n\nexport interface CliClientOptions {\n cwd?: string\n\n projectId?: string\n dataset?: string\n useCdn?: boolean\n token?: string\n apiVersion?: string\n}\n\nexport function getCliClient(options: CliClientOptions = {}): SanityClient {\n if (typeof process !== 'object') {\n throw new Error('getCliClient() should only be called from node.js scripts')\n }\n\n const {\n // eslint-disable-next-line no-process-env\n cwd = process.env.SANITY_BASE_PATH || process.cwd(),\n useCdn = false,\n apiVersion = '2022-06-06',\n projectId,\n dataset,\n token = getCliClient.__internal__getToken(),\n } = options\n\n if (projectId && dataset) {\n return createClient({projectId, dataset, apiVersion, useCdn, token})\n }\n\n const rootDir = resolveRootDir(cwd)\n const {config} = getCliConfigSync(rootDir) || {}\n if (!config) {\n throw new Error('Unable to resolve CLI configuration')\n }\n\n const apiConfig = config?.api || {}\n if (!apiConfig.projectId || !apiConfig.dataset) {\n throw new Error('Unable to resolve project ID/dataset from CLI configuration')\n }\n\n return createClient({\n projectId: apiConfig.projectId,\n dataset: apiConfig.dataset,\n apiVersion,\n useCdn,\n token,\n })\n}\n\n/* eslint-disable camelcase */\n/**\n * @internal\n * @deprecated This is only for INTERNAL use, and should not be relied upon outside of official Sanity modules\n * @returns A token to use when constructing a client without a `token` explicitly defined, or undefined\n */\ngetCliClient.__internal__getToken = (): string | undefined => undefined\n/* eslint-enable camelcase */\n","import {type CliConfig} from './types'\n\n/** @beta */\nexport function defineCliConfig(config: CliConfig): CliConfig {\n return config\n}\n\n/**\n * @deprecated Use `defineCliConfig` instead\n * @beta\n */\nexport function createCliConfig(config: CliConfig): CliConfig {\n return config\n}\n","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n const vaultPath = _vaultPath(options)\n\n // Parse .env.vault\n const result = DotenvModule.configDotenv({ path: vaultPath })\n if (!result.parsed) {\n const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n err.code = 'MISSING_DATA'\n throw err\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n const err = new Error('INVALID_DOTENV_KEY: Missing key part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n const err = new Error('INVALID_DOTENV_KEY: Missing environment part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'\n throw err\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let possibleVaultPath = null\n\n if (options && options.path && options.path.length > 0) {\n if (Array.isArray(options.path)) {\n for (const filepath of options.path) {\n if (fs.existsSync(filepath)) {\n possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`\n }\n }\n } else {\n possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`\n }\n } else {\n possibleVaultPath = path.resolve(process.cwd(), '.env.vault')\n }\n\n if (fs.existsSync(possibleVaultPath)) {\n return possibleVaultPath\n }\n\n return null\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n const debug = Boolean(options && options.debug)\n if (debug) {\n _debug('Loading env from encrypted .env.vault')\n }\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n const dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n\n if (options && options.encoding) {\n encoding = options.encoding\n } else {\n if (debug) {\n _debug('No encoding is specified. UTF-8 is used by default')\n }\n }\n\n let optionPaths = [dotenvPath] // default, look for .env\n if (options && options.path) {\n if (!Array.isArray(options.path)) {\n optionPaths = [_resolveHome(options.path)]\n } else {\n optionPaths = [] // reset default\n for (const filepath of options.path) {\n optionPaths.push(_resolveHome(filepath))\n }\n }\n }\n\n // Build the parsed data in a temporary object (because we need to return it). Once we have the final\n // parsed data, we will combine it with process.env (or options.processEnv if provided).\n let lastError\n const parsedAll = {}\n for (const path of optionPaths) {\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))\n\n DotenvModule.populate(parsedAll, parsed, options)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${path} ${e.message}`)\n }\n lastError = e\n }\n }\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsedAll, options)\n\n if (lastError) {\n return { parsed: parsedAll, error: lastError }\n } else {\n return { parsed: parsedAll }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n const vaultPath = _vaultPath(options)\n\n // dotenvKey exists but .env.vault file does not exist\n if (!vaultPath) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.subarray(0, 12)\n const authTag = ciphertext.subarray(-16)\n ciphertext = ciphertext.subarray(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n } else if (decryptionFailed) {\n const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')\n err.code = 'DECRYPTION_FAILED'\n throw err\n } else {\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n err.code = 'OBJECT_REQUIRED'\n throw err\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n","'use strict'\n\nfunction _interpolate (envValue, environment, config) {\n const matches = envValue.match(/(.?\\${*[\\w]*(?::-[\\w/]*)?}*)/g) || []\n\n return matches.reduce(function (newEnv, match, index) {\n const parts = /(.?)\\${*([\\w]*(?::-[\\w/]*)?)?}*/g.exec(match)\n if (!parts || parts.length === 0) {\n return newEnv\n }\n\n const prefix = parts[1]\n\n let value, replacePart\n\n if (prefix === '\\\\') {\n replacePart = parts[0]\n value = replacePart.replace('\\\\$', '$')\n } else {\n const keyParts = parts[2].split(':-')\n const key = keyParts[0]\n replacePart = parts[0].substring(prefix.length)\n // process.env value 'wins' over .env file's value\n value = Object.prototype.hasOwnProperty.call(environment, key)\n ? environment[key]\n : (config.parsed[key] || keyParts[1] || '')\n\n // If the value is found, remove nested expansions.\n if (keyParts.length > 1 && value) {\n const replaceNested = matches[index + 1]\n matches[index + 1] = ''\n\n newEnv = newEnv.replace(replaceNested, '')\n }\n // Resolve recursive interpolations\n value = _interpolate(value, environment, config)\n }\n\n return newEnv.replace(replacePart, value)\n }, envValue)\n}\n\nfunction expand (config) {\n // if ignoring process.env, use a blank object\n const environment = config.ignoreProcessEnv ? {} : process.env\n\n for (const configKey in config.parsed) {\n const value = Object.prototype.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey]\n\n config.parsed[configKey] = _interpolate(value, environment, config)\n }\n\n for (const processKey in config.parsed) {\n environment[processKey] = config.parsed[processKey]\n }\n\n return config\n}\n\nmodule.exports.expand = expand\n","/**\n * This is an \"inlined\" version of Vite's `loadEnv` function,\n * simplified somewhat to only support our use case.\n *\n * Ideally we'd just use `loadEnv` from Vite, but importing it\n * causes bundling issues due to node APIs and downstream dependencies.\n *\n * Vite is MIT licensed, copyright (c) Yuxi (Evan) You and Vite contributors.\n */\n\n/* eslint-disable no-process-env */\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {parse} from 'dotenv'\nimport {expand} from 'dotenv-expand'\n\nexport function loadEnv(\n mode: string,\n envDir: string,\n prefixes: string[] = ['VITE_'],\n): Record<string, string> {\n if (mode === 'local') {\n throw new Error(\n `\"local\" cannot be used as a mode name because it conflicts with ` +\n `the .local postfix for .env files.`,\n )\n }\n\n const env: Record<string, string> = {}\n const envFiles = [\n /** default file */ `.env`,\n /** local file */ `.env.local`,\n /** mode file */ `.env.${mode}`,\n /** mode local file */ `.env.${mode}.local`,\n ]\n\n const parsed = Object.fromEntries(\n envFiles.flatMap((file) => {\n const envPath = lookupFile(envDir, [file], {\n rootDir: envDir,\n })\n if (!envPath) return []\n return Object.entries(parse(fs.readFileSync(envPath)))\n }),\n )\n\n // test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this\n if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {\n process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV\n }\n // support BROWSER and BROWSER_ARGS env variables\n if (parsed.BROWSER && process.env.BROWSER === undefined) {\n process.env.BROWSER = parsed.BROWSER\n }\n if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) {\n process.env.BROWSER_ARGS = parsed.BROWSER_ARGS\n }\n\n try {\n // let environment variables use each other\n expand({parsed})\n } catch (e) {\n // custom error handling until https://github.com/motdotla/dotenv-expand/issues/65 is fixed upstream\n // check for message \"TypeError: Cannot read properties of undefined (reading 'split')\"\n if (e.message.includes('split')) {\n throw new Error('dotenv-expand failed to expand env vars. Maybe you need to escape `$`?')\n }\n throw e\n }\n\n // only keys that start with prefix are exposed to client\n for (const [key, value] of Object.entries(parsed)) {\n if (prefixes.some((prefix) => key.startsWith(prefix))) {\n env[key] = value\n }\n }\n\n // check if there are actual env variables starting with VITE_*\n // these are typically provided inline and should be prioritized\n for (const key in process.env) {\n if (prefixes.some((prefix) => key.startsWith(prefix))) {\n env[key] = process.env[key] as string\n }\n }\n\n return env\n}\n\nfunction lookupFile(\n dir: string,\n formats: string[],\n options?: {\n rootDir?: string\n },\n): string | undefined {\n for (const format of formats) {\n const fullPath = path.join(dir, format)\n // eslint-disable-next-line no-sync\n if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {\n return fullPath\n }\n }\n const parentDir = path.dirname(dir)\n if (parentDir !== dir && (!options?.rootDir || parentDir.startsWith(options?.rootDir))) {\n return lookupFile(parentDir, formats, options)\n }\n\n return undefined\n}\n"],"names":["fs","path","version","debug","mainModule","parse","expand"],"mappings":";;;;;;;;AAOA,MAAM,cACJ,OAAO,uBAAwB,aAAa,0BAA0B;AAGjE,SAAS,eAAwB,SAAoB;AACpD,QAAA,MAAM,YAAY,OAAO;AAC/B,SAAO,IAAI,cAAc,IAAI,UAAU,IAAI,UAAU;AACvD;AAEA,eAAe,UAAU,YAAY;AC6C9B,SAAS,iBAAiB,KAAqC;AAE7D,SADU,mBAAmB,GAAG,KACV,oBAAoB,GAAG;AACtD;AA2BA,SAAS,oBAAoB,KAAqC;AAChE,QAAM,aAAa,KAAK,KAAK,KAAK,aAAa;AAE1C,SAAA,GAAG,WAAW,UAAU,IAItB;AAAA,IACL,QAAQ,eAAe,UAAU;AAAA,IACjC,MAAM;AAAA,IACN,SAAS;AAAA,EAAA,IANF;AAQX;AAEA,SAAS,mBAAmB,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G,IAAI;AAMf,aAAW,OAAO,QAAQ;AACpB,aAAS,KAAK,CAAC,WAAW,IAAI,WAAW,MAAM,CAAC,MAClD,IAAI,GAAG,IAAI,QAAQ,IAAI,GAAG;AAIvB,SAAA;AACT;AAEA,SAAS,WACP,KACA,SACA,SAGoB;AACpB,aAAW,UAAU,SAAS;AAC5B,UAAM,WAAW,KAAK,KAAK,KAAK,MAAM;AAElC,QAAA,GAAG,WAAW,QAAQ,KAAK,GAAG,SAAS,QAAQ,EAAE,OAAO;AACnD,aAAA;AAAA,EAAA;AAGL,QAAA,YAAY,KAAK,QAAQ,GAAG;AAC9B,MAAA,cAAc,QAAQ,CAAC,SAAS,WAAW,UAAU,WAAW,SAAS,OAAO;AAC3E,WAAA,WAAW,WAAW,SAAS,OAAO;AAIjD;","x_google_ignoreList":[6,7]}
1
+ {"version":3,"file":"index.mjs","sources":["../src/util/dynamicRequire.ts","../src/util/getCliConfig.ts","../src/debug.ts","../src/util/resolveRootDir.ts","../src/cliClient.ts","../src/config.ts","../../../../node_modules/.pnpm/dotenv@16.5.0/node_modules/dotenv/lib/main.js","../../../../node_modules/.pnpm/dotenv-expand@9.0.0/node_modules/dotenv-expand/lib/main.js","../src/util/loadEnv.ts"],"sourcesContent":["// Prevent webpack from bundling in webpack context,\n// use regular node require for unbundled context\n\n/* eslint-disable camelcase, no-undef */\ndeclare const __webpack_require__: boolean\ndeclare const __non_webpack_require__: typeof require\n\nconst requireFunc: typeof require =\n typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require\n/* eslint-enable camelcase, no-undef */\n\nexport function dynamicRequire<T = any>(request: string): T {\n const mod = requireFunc(request)\n return mod.__esModule && mod.default ? mod.default : mod\n}\n\ndynamicRequire.resolve = requireFunc.resolve\n","/* eslint-disable no-sync */\n\n/**\n * Reads the Sanity CLI config from one of the following files (in preferred order):\n * - sanity.cli.js\n * - sanity.cli.ts\n *\n * Note: There are two ways of using this:\n * a) `getCliConfig(cwd)`\n * b) `getCliConfig(cwd, {forked: true})`\n *\n * Approach a is generally a bit faster as it avoids the forking startup time, while\n * approach b could be considered \"safer\" since any side-effects of running the config\n * file will not bleed into the current CLI process directly.\n */\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport {Worker} from 'node:worker_threads'\n\nimport {type CliConfig, type SanityJson} from '../types'\nimport {getCliWorkerPath} from './cliWorker'\nimport {dynamicRequire} from './dynamicRequire'\n\nexport type CliMajorVersion = 2 | 3\n\nexport type CliConfigResult =\n | {config: SanityJson; path: string; version: 2}\n | {config: CliConfig; path: string; version: 3}\n | {config: null; path: string; version: CliMajorVersion}\n\nexport async function getCliConfig(\n cwd: string,\n {forked}: {forked?: boolean} = {},\n): Promise<CliConfigResult | null> {\n if (forked) {\n try {\n return await getCliConfigForked(cwd)\n } catch {\n // Intentional noop - try unforked variant\n }\n }\n\n const {unregister} = __DEV__\n ? {unregister: () => undefined}\n : // eslint-disable-next-line @typescript-eslint/no-require-imports\n require('esbuild-register/dist/node').register({supported: {'dynamic-import': true}})\n\n try {\n const v3Config = getSanityCliConfig(cwd)\n if (v3Config) {\n return v3Config\n }\n\n return getSanityJsonConfig(cwd)\n } catch (err) {\n throw err\n } finally {\n unregister()\n }\n}\n\nexport function getCliConfigSync(cwd: string): CliConfigResult | null {\n const v3Config = getSanityCliConfig(cwd)\n return v3Config ? v3Config : getSanityJsonConfig(cwd)\n}\n\nasync function getCliConfigForked(cwd: string): Promise<CliConfigResult | null> {\n const workerPath = await getCliWorkerPath('getCliConfig')\n return new Promise((resolve, reject) => {\n const worker = new Worker(workerPath, {\n workerData: cwd,\n env: process.env,\n })\n worker.on('message', (message) => {\n if (message.type === 'config') {\n resolve(message.config)\n } else {\n const error = new Error(message.error)\n ;(error as any).type = message.errorType\n reject(new Error(message.error))\n }\n })\n worker.on('error', reject)\n worker.on('exit', (code) => {\n if (code !== 0) {\n reject(new Error(`Worker stopped with exit code ${code}`))\n }\n })\n })\n}\n\nfunction getSanityJsonConfig(cwd: string): CliConfigResult | null {\n const configPath = path.join(cwd, 'sanity.json')\n\n if (!fs.existsSync(configPath)) {\n return null\n }\n\n return {\n config: loadJsonConfig(configPath),\n path: configPath,\n version: 2,\n }\n}\n\nfunction getSanityCliConfig(cwd: string): CliConfigResult | null {\n const jsConfigPath = path.join(cwd, 'sanity.cli.js')\n const tsConfigPath = path.join(cwd, 'sanity.cli.ts')\n\n const [js, ts] = [fs.existsSync(jsConfigPath), fs.existsSync(tsConfigPath)]\n\n if (!js && !ts) {\n return null\n }\n\n if (!js && ts) {\n return {\n config: importConfig(tsConfigPath),\n path: tsConfigPath,\n version: 3,\n }\n }\n\n if (js && ts) {\n warn('Found both `sanity.cli.js` and `sanity.cli.ts` - using sanity.cli.js')\n }\n\n return {\n config: importConfig(jsConfigPath),\n path: jsConfigPath,\n version: 3,\n }\n}\n\nfunction loadJsonConfig(filePath: string): SanityJson | null {\n try {\n const content = fs.readFileSync(filePath, 'utf8')\n return JSON.parse(content)\n } catch (err) {\n console.error(`Error reading \"${filePath}\": ${err.message}`)\n return null\n }\n}\n\nfunction importConfig(filePath: string): CliConfig | null {\n try {\n const config = dynamicRequire<CliConfig | {default: CliConfig} | null>(filePath)\n if (config === null || typeof config !== 'object') {\n throw new Error('Module export is not a configuration object')\n }\n\n return 'default' in config ? config.default : config\n } catch (err) {\n // If attempting to import `defineCliConfig` or similar from `sanity/cli`,\n // accept the fact that it might not be installed. Instead, let the CLI\n // give a warning about the `sanity` module not being installed\n if (err.code === 'MODULE_NOT_FOUND' && err.message.includes('sanity/cli')) {\n return null\n }\n\n console.error(`Error reading \"${filePath}\": ${err.message}`)\n return null\n }\n}\n\nfunction warn(warning: string) {\n if (typeof process.send === 'function') {\n process.send({type: 'warning', warning})\n } else {\n console.warn(warning)\n }\n}\n","import debugIt from 'debug'\n\nexport const debug = debugIt('sanity:cli')\n","/* eslint-disable no-sync */\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {debug} from '../debug'\n\n/**\n * Resolve project root directory, falling back to cwd if it cannot be found\n */\nexport function resolveRootDir(cwd: string): string {\n try {\n return resolveProjectRoot(cwd) || cwd\n } catch (err) {\n throw new Error(`Error occurred trying to resolve project root:\\n${err.message}`)\n }\n}\n\nfunction hasSanityConfig(basePath: string, configName: string): boolean {\n const buildConfigs = [\n fileExists(path.join(basePath, `${configName}.js`)),\n fileExists(path.join(basePath, `${configName}.ts`)),\n isSanityV2StudioRoot(basePath),\n ]\n\n return buildConfigs.some(Boolean)\n}\n\nfunction resolveProjectRoot(basePath: string, iterations = 0): string | false {\n const configName = 'sanity.config'\n if (hasSanityConfig(basePath, configName)) {\n return basePath\n }\n\n const parentDir = path.resolve(basePath, '..')\n if (parentDir === basePath || iterations > 30) {\n // Reached root (or max depth), give up\n return false\n }\n\n return resolveProjectRoot(parentDir, iterations + 1)\n}\n\nfunction isSanityV2StudioRoot(basePath: string): boolean {\n try {\n const content = fs.readFileSync(path.join(basePath, 'sanity.json'), 'utf8')\n const sanityJson = JSON.parse(content)\n const isRoot = Boolean(sanityJson?.root)\n if (isRoot) {\n debug('Found Sanity v2 studio root at %s', basePath)\n }\n return isRoot\n } catch (err) {\n return false\n }\n}\n\nfunction fileExists(filePath: string): boolean {\n return fs.existsSync(filePath)\n}\n","import {createClient, type SanityClient} from '@sanity/client'\n\nimport {getCliConfigSync} from './util/getCliConfig'\nimport {resolveRootDir} from './util/resolveRootDir'\n\nexport interface CliClientOptions {\n cwd?: string\n\n projectId?: string\n dataset?: string\n useCdn?: boolean\n token?: string\n apiVersion?: string\n}\n\nexport function getCliClient(options: CliClientOptions = {}): SanityClient {\n if (typeof process !== 'object') {\n throw new Error('getCliClient() should only be called from node.js scripts')\n }\n\n const {\n // eslint-disable-next-line no-process-env\n cwd = process.env.SANITY_BASE_PATH || process.cwd(),\n useCdn = false,\n apiVersion = '2022-06-06',\n projectId,\n dataset,\n token = getCliClient.__internal__getToken(),\n } = options\n\n if (projectId && dataset) {\n return createClient({projectId, dataset, apiVersion, useCdn, token})\n }\n\n const rootDir = resolveRootDir(cwd)\n const {config} = getCliConfigSync(rootDir) || {}\n if (!config) {\n throw new Error('Unable to resolve CLI configuration')\n }\n\n const apiConfig = config?.api || {}\n if (!apiConfig.projectId || !apiConfig.dataset) {\n throw new Error('Unable to resolve project ID/dataset from CLI configuration')\n }\n\n return createClient({\n projectId: apiConfig.projectId,\n dataset: apiConfig.dataset,\n apiVersion,\n useCdn,\n token,\n })\n}\n\n/* eslint-disable camelcase */\n/**\n * @internal\n * @deprecated This is only for INTERNAL use, and should not be relied upon outside of official Sanity modules\n * @returns A token to use when constructing a client without a `token` explicitly defined, or undefined\n */\ngetCliClient.__internal__getToken = (): string | undefined => undefined\n/* eslint-enable camelcase */\n","import {type CliConfig} from './types'\n\n/** @beta */\nexport function defineCliConfig(config: CliConfig): CliConfig {\n return config\n}\n\n/**\n * @deprecated Use `defineCliConfig` instead\n * @beta\n */\nexport function createCliConfig(config: CliConfig): CliConfig {\n return config\n}\n","const fs = require('fs')\nconst path = require('path')\nconst os = require('os')\nconst crypto = require('crypto')\nconst packageJson = require('../package.json')\n\nconst version = packageJson.version\n\nconst LINE = /(?:^|^)\\s*(?:export\\s+)?([\\w.-]+)(?:\\s*=\\s*?|:\\s+?)(\\s*'(?:\\\\'|[^'])*'|\\s*\"(?:\\\\\"|[^\"])*\"|\\s*`(?:\\\\`|[^`])*`|[^#\\r\\n]+)?\\s*(?:#.*)?(?:$|$)/mg\n\n// Parse src into an Object\nfunction parse (src) {\n const obj = {}\n\n // Convert buffer to string\n let lines = src.toString()\n\n // Convert line breaks to same format\n lines = lines.replace(/\\r\\n?/mg, '\\n')\n\n let match\n while ((match = LINE.exec(lines)) != null) {\n const key = match[1]\n\n // Default undefined or null to empty string\n let value = (match[2] || '')\n\n // Remove whitespace\n value = value.trim()\n\n // Check if double quoted\n const maybeQuote = value[0]\n\n // Remove surrounding quotes\n value = value.replace(/^(['\"`])([\\s\\S]*)\\1$/mg, '$2')\n\n // Expand newlines if double quoted\n if (maybeQuote === '\"') {\n value = value.replace(/\\\\n/g, '\\n')\n value = value.replace(/\\\\r/g, '\\r')\n }\n\n // Add to object\n obj[key] = value\n }\n\n return obj\n}\n\nfunction _parseVault (options) {\n const vaultPath = _vaultPath(options)\n\n // Parse .env.vault\n const result = DotenvModule.configDotenv({ path: vaultPath })\n if (!result.parsed) {\n const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`)\n err.code = 'MISSING_DATA'\n throw err\n }\n\n // handle scenario for comma separated keys - for use with key rotation\n // example: DOTENV_KEY=\"dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=prod,dotenv://:key_7890@dotenvx.com/vault/.env.vault?environment=prod\"\n const keys = _dotenvKey(options).split(',')\n const length = keys.length\n\n let decrypted\n for (let i = 0; i < length; i++) {\n try {\n // Get full key\n const key = keys[i].trim()\n\n // Get instructions for decrypt\n const attrs = _instructions(result, key)\n\n // Decrypt\n decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key)\n\n break\n } catch (error) {\n // last key\n if (i + 1 >= length) {\n throw error\n }\n // try next key\n }\n }\n\n // Parse decrypted .env string\n return DotenvModule.parse(decrypted)\n}\n\nfunction _warn (message) {\n console.log(`[dotenv@${version}][WARN] ${message}`)\n}\n\nfunction _debug (message) {\n console.log(`[dotenv@${version}][DEBUG] ${message}`)\n}\n\nfunction _dotenvKey (options) {\n // prioritize developer directly setting options.DOTENV_KEY\n if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {\n return options.DOTENV_KEY\n }\n\n // secondary infra already contains a DOTENV_KEY environment variable\n if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {\n return process.env.DOTENV_KEY\n }\n\n // fallback to empty string\n return ''\n}\n\nfunction _instructions (result, dotenvKey) {\n // Parse DOTENV_KEY. Format is a URI\n let uri\n try {\n uri = new URL(dotenvKey)\n } catch (error) {\n if (error.code === 'ERR_INVALID_URL') {\n const err = new Error('INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n throw error\n }\n\n // Get decrypt key\n const key = uri.password\n if (!key) {\n const err = new Error('INVALID_DOTENV_KEY: Missing key part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get environment\n const environment = uri.searchParams.get('environment')\n if (!environment) {\n const err = new Error('INVALID_DOTENV_KEY: Missing environment part')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n }\n\n // Get ciphertext payload\n const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`\n const ciphertext = result.parsed[environmentKey] // DOTENV_VAULT_PRODUCTION\n if (!ciphertext) {\n const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`)\n err.code = 'NOT_FOUND_DOTENV_ENVIRONMENT'\n throw err\n }\n\n return { ciphertext, key }\n}\n\nfunction _vaultPath (options) {\n let possibleVaultPath = null\n\n if (options && options.path && options.path.length > 0) {\n if (Array.isArray(options.path)) {\n for (const filepath of options.path) {\n if (fs.existsSync(filepath)) {\n possibleVaultPath = filepath.endsWith('.vault') ? filepath : `${filepath}.vault`\n }\n }\n } else {\n possibleVaultPath = options.path.endsWith('.vault') ? options.path : `${options.path}.vault`\n }\n } else {\n possibleVaultPath = path.resolve(process.cwd(), '.env.vault')\n }\n\n if (fs.existsSync(possibleVaultPath)) {\n return possibleVaultPath\n }\n\n return null\n}\n\nfunction _resolveHome (envPath) {\n return envPath[0] === '~' ? path.join(os.homedir(), envPath.slice(1)) : envPath\n}\n\nfunction _configVault (options) {\n const debug = Boolean(options && options.debug)\n if (debug) {\n _debug('Loading env from encrypted .env.vault')\n }\n\n const parsed = DotenvModule._parseVault(options)\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsed, options)\n\n return { parsed }\n}\n\nfunction configDotenv (options) {\n const dotenvPath = path.resolve(process.cwd(), '.env')\n let encoding = 'utf8'\n const debug = Boolean(options && options.debug)\n\n if (options && options.encoding) {\n encoding = options.encoding\n } else {\n if (debug) {\n _debug('No encoding is specified. UTF-8 is used by default')\n }\n }\n\n let optionPaths = [dotenvPath] // default, look for .env\n if (options && options.path) {\n if (!Array.isArray(options.path)) {\n optionPaths = [_resolveHome(options.path)]\n } else {\n optionPaths = [] // reset default\n for (const filepath of options.path) {\n optionPaths.push(_resolveHome(filepath))\n }\n }\n }\n\n // Build the parsed data in a temporary object (because we need to return it). Once we have the final\n // parsed data, we will combine it with process.env (or options.processEnv if provided).\n let lastError\n const parsedAll = {}\n for (const path of optionPaths) {\n try {\n // Specifying an encoding returns a string instead of a buffer\n const parsed = DotenvModule.parse(fs.readFileSync(path, { encoding }))\n\n DotenvModule.populate(parsedAll, parsed, options)\n } catch (e) {\n if (debug) {\n _debug(`Failed to load ${path} ${e.message}`)\n }\n lastError = e\n }\n }\n\n let processEnv = process.env\n if (options && options.processEnv != null) {\n processEnv = options.processEnv\n }\n\n DotenvModule.populate(processEnv, parsedAll, options)\n\n if (lastError) {\n return { parsed: parsedAll, error: lastError }\n } else {\n return { parsed: parsedAll }\n }\n}\n\n// Populates process.env from .env file\nfunction config (options) {\n // fallback to original dotenv if DOTENV_KEY is not set\n if (_dotenvKey(options).length === 0) {\n return DotenvModule.configDotenv(options)\n }\n\n const vaultPath = _vaultPath(options)\n\n // dotenvKey exists but .env.vault file does not exist\n if (!vaultPath) {\n _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`)\n\n return DotenvModule.configDotenv(options)\n }\n\n return DotenvModule._configVault(options)\n}\n\nfunction decrypt (encrypted, keyStr) {\n const key = Buffer.from(keyStr.slice(-64), 'hex')\n let ciphertext = Buffer.from(encrypted, 'base64')\n\n const nonce = ciphertext.subarray(0, 12)\n const authTag = ciphertext.subarray(-16)\n ciphertext = ciphertext.subarray(12, -16)\n\n try {\n const aesgcm = crypto.createDecipheriv('aes-256-gcm', key, nonce)\n aesgcm.setAuthTag(authTag)\n return `${aesgcm.update(ciphertext)}${aesgcm.final()}`\n } catch (error) {\n const isRange = error instanceof RangeError\n const invalidKeyLength = error.message === 'Invalid key length'\n const decryptionFailed = error.message === 'Unsupported state or unable to authenticate data'\n\n if (isRange || invalidKeyLength) {\n const err = new Error('INVALID_DOTENV_KEY: It must be 64 characters long (or more)')\n err.code = 'INVALID_DOTENV_KEY'\n throw err\n } else if (decryptionFailed) {\n const err = new Error('DECRYPTION_FAILED: Please check your DOTENV_KEY')\n err.code = 'DECRYPTION_FAILED'\n throw err\n } else {\n throw error\n }\n }\n}\n\n// Populate process.env with parsed values\nfunction populate (processEnv, parsed, options = {}) {\n const debug = Boolean(options && options.debug)\n const override = Boolean(options && options.override)\n\n if (typeof parsed !== 'object') {\n const err = new Error('OBJECT_REQUIRED: Please check the processEnv argument being passed to populate')\n err.code = 'OBJECT_REQUIRED'\n throw err\n }\n\n // Set process.env\n for (const key of Object.keys(parsed)) {\n if (Object.prototype.hasOwnProperty.call(processEnv, key)) {\n if (override === true) {\n processEnv[key] = parsed[key]\n }\n\n if (debug) {\n if (override === true) {\n _debug(`\"${key}\" is already defined and WAS overwritten`)\n } else {\n _debug(`\"${key}\" is already defined and was NOT overwritten`)\n }\n }\n } else {\n processEnv[key] = parsed[key]\n }\n }\n}\n\nconst DotenvModule = {\n configDotenv,\n _configVault,\n _parseVault,\n config,\n decrypt,\n parse,\n populate\n}\n\nmodule.exports.configDotenv = DotenvModule.configDotenv\nmodule.exports._configVault = DotenvModule._configVault\nmodule.exports._parseVault = DotenvModule._parseVault\nmodule.exports.config = DotenvModule.config\nmodule.exports.decrypt = DotenvModule.decrypt\nmodule.exports.parse = DotenvModule.parse\nmodule.exports.populate = DotenvModule.populate\n\nmodule.exports = DotenvModule\n","'use strict'\n\nfunction _interpolate (envValue, environment, config) {\n const matches = envValue.match(/(.?\\${*[\\w]*(?::-[\\w/]*)?}*)/g) || []\n\n return matches.reduce(function (newEnv, match, index) {\n const parts = /(.?)\\${*([\\w]*(?::-[\\w/]*)?)?}*/g.exec(match)\n if (!parts || parts.length === 0) {\n return newEnv\n }\n\n const prefix = parts[1]\n\n let value, replacePart\n\n if (prefix === '\\\\') {\n replacePart = parts[0]\n value = replacePart.replace('\\\\$', '$')\n } else {\n const keyParts = parts[2].split(':-')\n const key = keyParts[0]\n replacePart = parts[0].substring(prefix.length)\n // process.env value 'wins' over .env file's value\n value = Object.prototype.hasOwnProperty.call(environment, key)\n ? environment[key]\n : (config.parsed[key] || keyParts[1] || '')\n\n // If the value is found, remove nested expansions.\n if (keyParts.length > 1 && value) {\n const replaceNested = matches[index + 1]\n matches[index + 1] = ''\n\n newEnv = newEnv.replace(replaceNested, '')\n }\n // Resolve recursive interpolations\n value = _interpolate(value, environment, config)\n }\n\n return newEnv.replace(replacePart, value)\n }, envValue)\n}\n\nfunction expand (config) {\n // if ignoring process.env, use a blank object\n const environment = config.ignoreProcessEnv ? {} : process.env\n\n for (const configKey in config.parsed) {\n const value = Object.prototype.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey]\n\n config.parsed[configKey] = _interpolate(value, environment, config)\n }\n\n for (const processKey in config.parsed) {\n environment[processKey] = config.parsed[processKey]\n }\n\n return config\n}\n\nmodule.exports.expand = expand\n","/**\n * This is an \"inlined\" version of Vite's `loadEnv` function,\n * simplified somewhat to only support our use case.\n *\n * Ideally we'd just use `loadEnv` from Vite, but importing it\n * causes bundling issues due to node APIs and downstream dependencies.\n *\n * Vite is MIT licensed, copyright (c) Yuxi (Evan) You and Vite contributors.\n */\n\n/* eslint-disable no-process-env */\nimport fs from 'node:fs'\nimport path from 'node:path'\n\nimport {parse} from 'dotenv'\nimport {expand} from 'dotenv-expand'\n\nexport function loadEnv(\n mode: string,\n envDir: string,\n prefixes: string[] = ['VITE_'],\n): Record<string, string> {\n if (mode === 'local') {\n throw new Error(\n `\"local\" cannot be used as a mode name because it conflicts with ` +\n `the .local postfix for .env files.`,\n )\n }\n\n const env: Record<string, string> = {}\n const envFiles = [\n /** default file */ `.env`,\n /** local file */ `.env.local`,\n /** mode file */ `.env.${mode}`,\n /** mode local file */ `.env.${mode}.local`,\n ]\n\n const parsed = Object.fromEntries(\n envFiles.flatMap((file) => {\n const envPath = lookupFile(envDir, [file], {\n rootDir: envDir,\n })\n if (!envPath) return []\n return Object.entries(parse(fs.readFileSync(envPath)))\n }),\n )\n\n // test NODE_ENV override before expand as otherwise process.env.NODE_ENV would override this\n if (parsed.NODE_ENV && process.env.VITE_USER_NODE_ENV === undefined) {\n process.env.VITE_USER_NODE_ENV = parsed.NODE_ENV\n }\n // support BROWSER and BROWSER_ARGS env variables\n if (parsed.BROWSER && process.env.BROWSER === undefined) {\n process.env.BROWSER = parsed.BROWSER\n }\n if (parsed.BROWSER_ARGS && process.env.BROWSER_ARGS === undefined) {\n process.env.BROWSER_ARGS = parsed.BROWSER_ARGS\n }\n\n try {\n // let environment variables use each other\n expand({parsed})\n } catch (e) {\n // custom error handling until https://github.com/motdotla/dotenv-expand/issues/65 is fixed upstream\n // check for message \"TypeError: Cannot read properties of undefined (reading 'split')\"\n if (e.message.includes('split')) {\n throw new Error('dotenv-expand failed to expand env vars. Maybe you need to escape `$`?')\n }\n throw e\n }\n\n // only keys that start with prefix are exposed to client\n for (const [key, value] of Object.entries(parsed)) {\n if (prefixes.some((prefix) => key.startsWith(prefix))) {\n env[key] = value\n }\n }\n\n // check if there are actual env variables starting with VITE_*\n // these are typically provided inline and should be prioritized\n for (const key in process.env) {\n if (prefixes.some((prefix) => key.startsWith(prefix))) {\n env[key] = process.env[key] as string\n }\n }\n\n return env\n}\n\nfunction lookupFile(\n dir: string,\n formats: string[],\n options?: {\n rootDir?: string\n },\n): string | undefined {\n for (const format of formats) {\n const fullPath = path.join(dir, format)\n // eslint-disable-next-line no-sync\n if (fs.existsSync(fullPath) && fs.statSync(fullPath).isFile()) {\n return fullPath\n }\n }\n const parentDir = path.dirname(dir)\n if (parentDir !== dir && (!options?.rootDir || parentDir.startsWith(options?.rootDir))) {\n return lookupFile(parentDir, formats, options)\n }\n\n return undefined\n}\n"],"names":["fs","path","version","debug","mainModule","parse","expand"],"mappings":";;;;;;;;AAOA,MAAM,cACJ,OAAO,uBAAwB,aAAa,0BAA0B;AAGjE,SAAS,eAAwB,SAAoB;AAC1D,QAAM,MAAM,YAAY,OAAO;AAC/B,SAAO,IAAI,cAAc,IAAI,UAAU,IAAI,UAAU;AACvD;AAEA,eAAe,UAAU,YAAY;AC6C9B,SAAS,iBAAiB,KAAqC;AAEpE,SADiB,mBAAmB,GAAG,KACV,oBAAoB,GAAG;AACtD;AA2BA,SAAS,oBAAoB,KAAqC;AAChE,QAAM,aAAa,KAAK,KAAK,KAAK,aAAa;AAE/C,SAAK,GAAG,WAAW,UAAU,IAItB;AAAA,IACL,QAAQ,eAAe,UAAU;AAAA,IACjC,MAAM;AAAA,IACN,SAAS;AAAA,EAAA,IANF;AAQX;AAEA,SAAS,mBAAmB,KAAqC;AAC/D,QAAM,eAAe,KAAK,KAAK,KAAK,eAAe,GAC7C,eAAe,KAAK,KAAK,KAAK,eAAe,GAE7C,CAAC,IAAI,EAAE,IAAI,CAAC,GAAG,WAAW,YAAY,GAAG,GAAG,WAAW,YAAY,CAAC;AAE1E,SAAI,CAAC,MAAM,CAAC,KACH,OAGL,CAAC,MAAM,KACF;AAAA,IACL,QAAQ,aAAa,YAAY;AAAA,IACjC,MAAM;AAAA,IACN,SAAS;AAAA,EAAA,KAIT,MAAM,MACR,KAAK,sEAAsE,GAGtE;AAAA,IACL,QAAQ,aAAa,YAAY;AAAA,IACjC,MAAM;AAAA,IACN,SAAS;AAAA,EAAA;AAEb;AAEA,SAAS,eAAe,UAAqC;AAC3D,MAAI;AACF,UAAM,UAAU,GAAG,aAAa,UAAU,MAAM;AAChD,WAAO,KAAK,MAAM,OAAO;AAAA,EAAA,SAClB,KAAK;AACZ,WAAA,QAAQ,MAAM,kBAAkB,QAAQ,MAA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 +1 @@
1
- {"version":3,"file":"run.js","sources":["../src/run.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {runCli} from './cli'\nimport {getCliVersion} from './util/getCliVersion'\n\ngetCliVersion().then((cliVersion) => {\n runCli(path.join(__dirname, '..'), {cliVersion})\n})\n"],"names":["getCliVersion","runCli","path"],"mappings":";;;;;;AAKAA,IAAAA,gBAAgB,KAAK,CAAC,eAAe;AACnCC,MAAA,OAAOC,sBAAK,KAAK,WAAW,IAAI,GAAG,EAAC,YAAW;AACjD,CAAC;"}
1
+ {"version":3,"file":"run.js","sources":["../src/run.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {runCli} from './cli'\nimport {getCliVersion} from './util/getCliVersion'\n\ngetCliVersion().then((cliVersion) => {\n runCli(path.join(__dirname, '..'), {cliVersion})\n})\n"],"names":["getCliVersion","runCli","path"],"mappings":";;;;;;AAKAA,IAAAA,gBAAgB,KAAK,CAAC,eAAe;AACnCC,MAAAA,OAAOC,cAAAA,QAAK,KAAK,WAAW,IAAI,GAAG,EAAC,YAAW;AACjD,CAAC;"}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1 +1 @@
1
- {"version":3,"file":"getAndWriteJourneySchema.js","sources":["../../src/workers/getAndWriteJourneySchema.ts"],"sourcesContent":["import {parentPort, workerData} from 'node:worker_threads'\n\nimport {getAndWriteJourneySchema} from '../util/journeyConfig'\n\ngetAndWriteJourneySchema(workerData)\n .then(() => parentPort?.postMessage({type: 'success'}))\n .catch((error) => parentPort?.postMessage({type: 'error', error}))\n"],"names":["getAndWriteJourneySchema","workerData","parentPort"],"mappings":";;AAIAA,cAAAA,yBAAyBC,oBAAU,UAAA,EAChC,KAAK,MAAMC,oBAAAA,YAAY,YAAY,EAAC,MAAM,WAAU,CAAC,EACrD,MAAM,CAAC,UAAUA,oBAAAA,YAAY,YAAY,EAAC,MAAM,SAAS,MAAK,CAAC,CAAC;"}
1
+ {"version":3,"file":"getAndWriteJourneySchema.js","sources":["../../src/workers/getAndWriteJourneySchema.ts"],"sourcesContent":["import {parentPort, workerData} from 'node:worker_threads'\n\nimport {getAndWriteJourneySchema} from '../util/journeyConfig'\n\ngetAndWriteJourneySchema(workerData)\n .then(() => parentPort?.postMessage({type: 'success'}))\n .catch((error) => parentPort?.postMessage({type: 'error', error}))\n"],"names":["getAndWriteJourneySchema","workerData","parentPort"],"mappings":";;AAIAA,cAAAA,yBAAyBC,oBAAAA,UAAU,EAChC,KAAK,MAAMC,oBAAAA,YAAY,YAAY,EAAC,MAAM,WAAU,CAAC,EACrD,MAAM,CAAC,UAAUA,oBAAAA,YAAY,YAAY,EAAC,MAAM,SAAS,MAAA,CAAM,CAAC;"}
@@ -1 +1 @@
1
- export { };
1
+ export {}
@@ -1 +1 @@
1
- {"version":3,"file":"getCliConfig.js","sources":["../../src/workers/getCliConfig.ts"],"sourcesContent":["import {parentPort, workerData} from 'node:worker_threads'\n\nimport {getCliConfig} from '../util/getCliConfig'\n\n// We're communicating with a parent process through a message channel\ngetCliConfig(workerData, {forked: false})\n .then((config) => parentPort?.postMessage({type: 'config', config}))\n .catch((error) =>\n parentPort?.postMessage({\n type: 'error',\n error: error instanceof Error ? error.stack : error,\n errorType: error && (error.type || error.name),\n }),\n )\n"],"names":["getCliConfig","workerData","parentPort"],"mappings":";;AAKAA,aAAAA,aAAaC,oBAAAA,YAAY,EAAC,QAAQ,GAAK,CAAC,EACrC,KAAK,CAAC,WAAWC,oBAAAA,YAAY,YAAY,EAAC,MAAM,UAAU,OAAM,CAAC,CAAC,EAClE;AAAA,EAAM,CAAC,UACNA,oBAAA,YAAY,YAAY;AAAA,IACtB,MAAM;AAAA,IACN,OAAO,iBAAiB,QAAQ,MAAM,QAAQ;AAAA,IAC9C,WAAW,UAAU,MAAM,QAAQ,MAAM;AAAA,EAC1C,CAAA;AACH;"}
1
+ {"version":3,"file":"getCliConfig.js","sources":["../../src/workers/getCliConfig.ts"],"sourcesContent":["import {parentPort, workerData} from 'node:worker_threads'\n\nimport {getCliConfig} from '../util/getCliConfig'\n\n// We're communicating with a parent process through a message channel\ngetCliConfig(workerData, {forked: false})\n .then((config) => parentPort?.postMessage({type: 'config', config}))\n .catch((error) =>\n parentPort?.postMessage({\n type: 'error',\n error: error instanceof Error ? error.stack : error,\n errorType: error && (error.type || error.name),\n }),\n )\n"],"names":["getCliConfig","workerData","parentPort"],"mappings":";;AAKAA,aAAAA,aAAaC,oBAAAA,YAAY,EAAC,QAAQ,GAAA,CAAM,EACrC,KAAK,CAAC,WAAWC,oBAAAA,YAAY,YAAY,EAAC,MAAM,UAAU,OAAA,CAAO,CAAC,EAClE;AAAA,EAAM,CAAC,UACNA,oBAAAA,YAAY,YAAY;AAAA,IACtB,MAAM;AAAA,IACN,OAAO,iBAAiB,QAAQ,MAAM,QAAQ;AAAA,IAC9C,WAAW,UAAU,MAAM,QAAQ,MAAM;AAAA,EAAA,CAC1C;AACH;"}
@@ -1,36 +1,43 @@
1
- interface TypegenGenerateTypesWorkerData {
2
- workDir: string;
3
- workspaceName?: string;
4
- schemaPath: string;
5
- searchPath: string | string[];
6
- overloadClientMethods?: boolean;
1
+ export declare interface TypegenGenerateTypesWorkerData {
2
+ workDir: string
3
+ workspaceName?: string
4
+ schemaPath: string
5
+ searchPath: string | string[]
6
+ overloadClientMethods?: boolean
7
7
  }
8
- type TypegenGenerateTypesWorkerMessage = {
9
- type: 'error';
10
- error: Error;
11
- fatal: boolean;
12
- query?: string;
13
- filename?: string;
14
- } | {
15
- type: 'types';
16
- filename: string;
17
- types: {
18
- queryName: string;
19
- query: string;
20
- type: string;
21
- unknownTypeNodesGenerated: number;
22
- typeNodesGenerated: number;
23
- emptyUnionTypeNodesGenerated: number;
24
- }[];
25
- } | {
26
- type: 'schema';
27
- filename: string;
28
- schema: string;
29
- length: number;
30
- } | {
31
- type: 'typemap';
32
- typeMap: string;
33
- } | {
34
- type: 'complete';
35
- };
36
- export { TypegenGenerateTypesWorkerData, TypegenGenerateTypesWorkerMessage };
8
+
9
+ export declare type TypegenGenerateTypesWorkerMessage =
10
+ | {
11
+ type: 'error'
12
+ error: Error
13
+ fatal: boolean
14
+ query?: string
15
+ filename?: string
16
+ }
17
+ | {
18
+ type: 'types'
19
+ filename: string
20
+ types: {
21
+ queryName: string
22
+ query: string
23
+ type: string
24
+ unknownTypeNodesGenerated: number
25
+ typeNodesGenerated: number
26
+ emptyUnionTypeNodesGenerated: number
27
+ }[]
28
+ }
29
+ | {
30
+ type: 'schema'
31
+ filename: string
32
+ schema: string
33
+ length: number
34
+ }
35
+ | {
36
+ type: 'typemap'
37
+ typeMap: string
38
+ }
39
+ | {
40
+ type: 'complete'
41
+ }
42
+
43
+ export {}
@@ -1 +1 @@
1
- {"version":3,"file":"typegenGenerate.js","sources":["../../src/workers/typegenGenerate.ts"],"sourcesContent":["import {isMainThread, parentPort, workerData as _workerData} from 'node:worker_threads'\n\nimport {\n findQueriesInPath,\n getResolver,\n readSchema,\n registerBabel,\n safeParseQuery,\n TypeGenerator,\n} from '@sanity/codegen'\nimport createDebug from 'debug'\nimport {typeEvaluate, type TypeNode} from 'groq-js'\n\nconst $info = createDebug('sanity:codegen:generate:info')\n\nexport interface TypegenGenerateTypesWorkerData {\n workDir: string\n workspaceName?: string\n schemaPath: string\n searchPath: string | string[]\n overloadClientMethods?: boolean\n}\n\nexport type TypegenGenerateTypesWorkerMessage =\n | {\n type: 'error'\n error: Error\n fatal: boolean\n query?: string\n filename?: string\n }\n | {\n type: 'types'\n filename: string\n types: {\n queryName: string\n query: string\n type: string\n unknownTypeNodesGenerated: number\n typeNodesGenerated: number\n emptyUnionTypeNodesGenerated: number\n }[]\n }\n | {\n type: 'schema'\n filename: string\n schema: string\n length: number\n }\n | {\n type: 'typemap'\n typeMap: string\n }\n | {\n type: 'complete'\n }\n\nif (isMainThread || !parentPort) {\n throw new Error('This module must be run as a worker thread')\n}\n\nconst opts = _workerData as TypegenGenerateTypesWorkerData\n\nregisterBabel()\n\nasync function main() {\n const schema = await readSchema(opts.schemaPath)\n\n const typeGenerator = new TypeGenerator(schema)\n const schemaTypes = [typeGenerator.generateSchemaTypes(), TypeGenerator.generateKnownTypes()]\n .join('\\n')\n .trim()\n const resolver = getResolver()\n\n parentPort?.postMessage({\n type: 'schema',\n schema: `${schemaTypes.trim()}\\n`,\n filename: 'schema.json',\n length: schema.length,\n } satisfies TypegenGenerateTypesWorkerMessage)\n\n const queries = findQueriesInPath({\n path: opts.searchPath,\n resolver,\n })\n\n const allQueries = []\n\n for await (const result of queries) {\n if (result.type === 'error') {\n parentPort?.postMessage({\n type: 'error',\n error: result.error,\n fatal: false,\n filename: result.filename,\n } satisfies TypegenGenerateTypesWorkerMessage)\n continue\n }\n $info(`Processing ${result.queries.length} queries in \"${result.filename}\"...`)\n\n const fileQueryTypes: {\n queryName: string\n query: string\n type: string\n typeName: string\n typeNode: TypeNode\n unknownTypeNodesGenerated: number\n typeNodesGenerated: number\n emptyUnionTypeNodesGenerated: number\n }[] = []\n for (const {name: queryName, result: query} of result.queries) {\n try {\n const ast = safeParseQuery(query)\n const queryTypes = typeEvaluate(ast, schema)\n\n const typeName = `${queryName}Result`\n const type = typeGenerator.generateTypeNodeTypes(typeName, queryTypes)\n\n const queryTypeStats = walkAndCountQueryTypeNodeStats(queryTypes)\n fileQueryTypes.push({\n queryName,\n query,\n typeName,\n typeNode: queryTypes,\n type: `${type.trim()}\\n`,\n unknownTypeNodesGenerated: queryTypeStats.unknownTypes,\n typeNodesGenerated: queryTypeStats.allTypes,\n emptyUnionTypeNodesGenerated: queryTypeStats.emptyUnions,\n })\n } catch (err) {\n parentPort?.postMessage({\n type: 'error',\n error: new Error(\n `Error generating types for query \"${queryName}\" in \"${result.filename}\": ${err.message}`,\n {cause: err},\n ),\n fatal: false,\n query,\n } satisfies TypegenGenerateTypesWorkerMessage)\n }\n }\n\n if (fileQueryTypes.length > 0) {\n $info(`Generated types for ${fileQueryTypes.length} queries in \"${result.filename}\"\\n`)\n parentPort?.postMessage({\n type: 'types',\n types: fileQueryTypes,\n filename: result.filename,\n } satisfies TypegenGenerateTypesWorkerMessage)\n }\n\n if (fileQueryTypes.length > 0) {\n allQueries.push(...fileQueryTypes)\n }\n }\n\n if (opts.overloadClientMethods && allQueries.length > 0) {\n const typeMap = `${typeGenerator.generateQueryMap(allQueries).trim()}\\n`\n parentPort?.postMessage({\n type: 'typemap',\n typeMap,\n } satisfies TypegenGenerateTypesWorkerMessage)\n }\n\n parentPort?.postMessage({\n type: 'complete',\n } satisfies TypegenGenerateTypesWorkerMessage)\n}\n\nfunction walkAndCountQueryTypeNodeStats(typeNode: TypeNode): {\n allTypes: number\n unknownTypes: number\n emptyUnions: number\n} {\n switch (typeNode.type) {\n case 'unknown': {\n return {allTypes: 1, unknownTypes: 1, emptyUnions: 0}\n }\n case 'array': {\n const acc = walkAndCountQueryTypeNodeStats(typeNode.of)\n acc.allTypes += 1 // count the array type itself\n return acc\n }\n case 'object': {\n // if the rest is unknown, we count it as one unknown type\n if (typeNode.rest && typeNode.rest.type === 'unknown') {\n return {allTypes: 2, unknownTypes: 1, emptyUnions: 0} // count the object type itself as well\n }\n\n const restStats = typeNode.rest\n ? walkAndCountQueryTypeNodeStats(typeNode.rest)\n : {allTypes: 1, unknownTypes: 0, emptyUnions: 0} // count the object type itself\n\n return Object.values(typeNode.attributes).reduce((acc, attribute) => {\n const {allTypes, unknownTypes, emptyUnions} = walkAndCountQueryTypeNodeStats(\n attribute.value,\n )\n return {\n allTypes: acc.allTypes + allTypes,\n unknownTypes: acc.unknownTypes + unknownTypes,\n emptyUnions: acc.emptyUnions + emptyUnions,\n }\n }, restStats)\n }\n case 'union': {\n if (typeNode.of.length === 0) {\n return {allTypes: 1, unknownTypes: 0, emptyUnions: 1}\n }\n\n return typeNode.of.reduce(\n (acc, type) => {\n const {allTypes, unknownTypes, emptyUnions} = walkAndCountQueryTypeNodeStats(type)\n return {\n allTypes: acc.allTypes + allTypes,\n unknownTypes: acc.unknownTypes + unknownTypes,\n emptyUnions: acc.emptyUnions + emptyUnions,\n }\n },\n {allTypes: 1, unknownTypes: 0, emptyUnions: 0}, // count the union type itself\n )\n }\n default: {\n return {allTypes: 1, unknownTypes: 0, emptyUnions: 0}\n }\n }\n}\n\nmain()\n"],"names":["createDebug","isMainThread","parentPort","_workerData","registerBabel","readSchema","TypeGenerator","getResolver","findQueriesInPath","safeParseQuery","typeEvaluate"],"mappings":";;;;;;AAaA,MAAM,QAAQA,yBAAY,8BAA8B;AA4CxD,IAAIC,oBAAAA,gBAAgB,CAACC,oBAAA;AACb,QAAA,IAAI,MAAM,4CAA4C;AAG9D,MAAM,OAAOC,oBAAA;AAEbC,QAAAA,cAAc;AAEd,eAAe,OAAO;AACd,QAAA,SAAS,MAAMC,mBAAW,KAAK,UAAU,GAEzC,gBAAgB,IAAIC,sBAAc,MAAM,GACxC,cAAc,CAAC,cAAc,oBAAoB,GAAGA,QAAAA,cAAc,mBAAmB,CAAC,EACzF,KAAK;AAAA,CAAI,EACT,KAAA,GACG,WAAWC,oBAAY;AAE7BL,sBAAAA,YAAY,YAAY;AAAA,IACtB,MAAM;AAAA,IACN,QAAQ,GAAG,YAAY,KAAM,CAAA;AAAA;AAAA,IAC7B,UAAU;AAAA,IACV,QAAQ,OAAO;AAAA,EAAA,CAC4B;AAE7C,QAAM,UAAUM,QAAAA,kBAAkB;AAAA,IAChC,MAAM,KAAK;AAAA,IACX;AAAA,EAAA,CACD,GAEK,aAAa,CAAC;AAEpB,mBAAiB,UAAU,SAAS;AAC9B,QAAA,OAAO,SAAS,SAAS;AAC3BN,0BAAAA,YAAY,YAAY;AAAA,QACtB,MAAM;AAAA,QACN,OAAO,OAAO;AAAA,QACd,OAAO;AAAA,QACP,UAAU,OAAO;AAAA,MAAA,CAC0B;AAC7C;AAAA,IAAA;AAEF,UAAM,cAAc,OAAO,QAAQ,MAAM,gBAAgB,OAAO,QAAQ,MAAM;AAE9E,UAAM,iBASA,CAAC;AACP,eAAW,EAAC,MAAM,WAAW,QAAQ,MAAA,KAAU,OAAO;A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parentPort, workerData as _workerData} from 'node:worker_threads'\n\nimport {\n findQueriesInPath,\n getResolver,\n readSchema,\n registerBabel,\n safeParseQuery,\n TypeGenerator,\n} from '@sanity/codegen'\nimport createDebug from 'debug'\nimport {typeEvaluate, type TypeNode} from 'groq-js'\n\nconst $info = createDebug('sanity:codegen:generate:info')\n\nexport interface TypegenGenerateTypesWorkerData {\n workDir: string\n workspaceName?: string\n schemaPath: string\n searchPath: string | string[]\n overloadClientMethods?: boolean\n}\n\nexport type TypegenGenerateTypesWorkerMessage =\n | {\n type: 'error'\n error: Error\n fatal: boolean\n query?: string\n filename?: string\n }\n | {\n type: 'types'\n filename: string\n types: {\n queryName: string\n query: string\n type: string\n unknownTypeNodesGenerated: number\n typeNodesGenerated: number\n emptyUnionTypeNodesGenerated: number\n }[]\n }\n | {\n type: 'schema'\n filename: string\n schema: string\n length: number\n }\n | {\n type: 'typemap'\n typeMap: string\n }\n | {\n type: 'complete'\n }\n\nif (isMainThread || !parentPort) {\n throw new Error('This module must be run as a worker thread')\n}\n\nconst opts = _workerData as TypegenGenerateTypesWorkerData\n\nregisterBabel()\n\nasync function main() {\n const schema = await readSchema(opts.schemaPath)\n\n const typeGenerator = new TypeGenerator(schema)\n const schemaTypes = [typeGenerator.generateSchemaTypes(), TypeGenerator.generateKnownTypes()]\n .join('\\n')\n .trim()\n const resolver = getResolver()\n\n parentPort?.postMessage({\n type: 'schema',\n schema: `${schemaTypes.trim()}\\n`,\n filename: 'schema.json',\n length: schema.length,\n } satisfies TypegenGenerateTypesWorkerMessage)\n\n const queries = findQueriesInPath({\n path: opts.searchPath,\n resolver,\n })\n\n const allQueries = []\n\n for await (const result of queries) {\n if (result.type === 'error') {\n parentPort?.postMessage({\n type: 'error',\n error: result.error,\n fatal: false,\n filename: result.filename,\n } satisfies TypegenGenerateTypesWorkerMessage)\n continue\n }\n $info(`Processing ${result.queries.length} queries in \"${result.filename}\"...`)\n\n const fileQueryTypes: {\n queryName: string\n query: string\n type: string\n typeName: string\n typeNode: TypeNode\n unknownTypeNodesGenerated: number\n typeNodesGenerated: number\n emptyUnionTypeNodesGenerated: number\n }[] = []\n for (const {name: queryName, result: query} of result.queries) {\n try {\n const ast = safeParseQuery(query)\n const queryTypes = typeEvaluate(ast, schema)\n\n const typeName = `${queryName}Result`\n const type = typeGenerator.generateTypeNodeTypes(typeName, queryTypes)\n\n const queryTypeStats = walkAndCountQueryTypeNodeStats(queryTypes)\n fileQueryTypes.push({\n queryName,\n query,\n typeName,\n typeNode: queryTypes,\n type: `${type.trim()}\\n`,\n unknownTypeNodesGenerated: queryTypeStats.unknownTypes,\n typeNodesGenerated: queryTypeStats.allTypes,\n emptyUnionTypeNodesGenerated: queryTypeStats.emptyUnions,\n })\n } catch (err) {\n parentPort?.postMessage({\n type: 'error',\n error: new Error(\n `Error generating types for query \"${queryName}\" in \"${result.filename}\": ${err.message}`,\n {cause: err},\n ),\n fatal: false,\n query,\n } satisfies TypegenGenerateTypesWorkerMessage)\n }\n }\n\n if (fileQueryTypes.length > 0) {\n $info(`Generated types for ${fileQueryTypes.length} queries in \"${result.filename}\"\\n`)\n parentPort?.postMessage({\n type: 'types',\n types: fileQueryTypes,\n filename: result.filename,\n } satisfies TypegenGenerateTypesWorkerMessage)\n }\n\n if (fileQueryTypes.length > 0) {\n allQueries.push(...fileQueryTypes)\n }\n }\n\n if (opts.overloadClientMethods && allQueries.length > 0) {\n const typeMap = `${typeGenerator.generateQueryMap(allQueries).trim()}\\n`\n parentPort?.postMessage({\n type: 'typemap',\n typeMap,\n } satisfies TypegenGenerateTypesWorkerMessage)\n }\n\n parentPort?.postMessage({\n type: 'complete',\n } satisfies TypegenGenerateTypesWorkerMessage)\n}\n\nfunction walkAndCountQueryTypeNodeStats(typeNode: TypeNode): {\n allTypes: number\n unknownTypes: number\n emptyUnions: number\n} {\n switch (typeNode.type) {\n case 'unknown': {\n return {allTypes: 1, unknownTypes: 1, emptyUnions: 0}\n }\n case 'array': {\n const acc = walkAndCountQueryTypeNodeStats(typeNode.of)\n acc.allTypes += 1 // count the array type itself\n return acc\n }\n case 'object': {\n // if the rest is unknown, we count it as one unknown type\n if (typeNode.rest && typeNode.rest.type === 'unknown') {\n return {allTypes: 2, unknownTypes: 1, emptyUnions: 0} // count the object type itself as well\n }\n\n const restStats = typeNode.rest\n ? walkAndCountQueryTypeNodeStats(typeNode.rest)\n : {allTypes: 1, unknownTypes: 0, emptyUnions: 0} // count the object type itself\n\n return Object.values(typeNode.attributes).reduce((acc, attribute) => {\n const {allTypes, unknownTypes, emptyUnions} = walkAndCountQueryTypeNodeStats(\n attribute.value,\n )\n return {\n allTypes: acc.allTypes + allTypes,\n unknownTypes: acc.unknownTypes + unknownTypes,\n emptyUnions: acc.emptyUnions + emptyUnions,\n }\n }, restStats)\n }\n case 'union': {\n if (typeNode.of.length === 0) {\n return {allTypes: 1, unknownTypes: 0, emptyUnions: 1}\n }\n\n return typeNode.of.reduce(\n (acc, type) => {\n const {allTypes, unknownTypes, emptyUnions} = walkAndCountQueryTypeNodeStats(type)\n return {\n allTypes: acc.allTypes + allTypes,\n unknownTypes: acc.unknownTypes + unknownTypes,\n emptyUnions: acc.emptyUnions + emptyUnions,\n }\n },\n {allTypes: 1, unknownTypes: 0, emptyUnions: 0}, // count the union type itself\n )\n }\n default: {\n return {allTypes: 1, unknownTypes: 0, emptyUnions: 0}\n }\n }\n}\n\nmain()\n"],"names":["createDebug","isMainThread","parentPort","_workerData","registerBabel","readSchema","TypeGenerator","getResolver","findQueriesInPath","safeParseQuery","typeEvaluate"],"mappings":";;;;;;AAaA,MAAM,QAAQA,iBAAAA,QAAY,8BAA8B;AA4CxD,IAAIC,oBAAAA,gBAAgB,CAACC,oBAAAA;AACnB,QAAM,IAAI,MAAM,4CAA4C;AAG9D,MAAM,OAAOC,oBAAAA;AAEbC,QAAAA,cAAA;AAEA,eAAe,OAAO;AACpB,QAAM,SAAS,MAAMC,mBAAW,KAAK,UAAU,GAEzC,gBAAgB,IAAIC,sBAAc,MAA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AAAA,UAC5C,UAAU;AAAA,QAAA;AAEZ,eAAO;AAAA,UACL,UAAU,IAAI,WAAW;AAAA,UACzB,cAAc,IAAI,eAAe;AAAA,UACjC,aAAa,IAAI,cAAc;AAAA,QAAA;AAAA,MACjC,GACC,SAAS;AAAA,IAAA;AAAA,IAEd,KAAK;AACH,aAAI,SAAS,GAAG,WAAW,IAClB,EAAC,UAAU,GAAG,cAAc,GAAG,aAAa,EAAA,IAG9C,SAAS,GAAG;AAAA,QACjB,CAAC,KAAK,SAAS;AACb,gBAAM,EAAC,UAAU,cAAc,YAAA,IAAe,+BAA+B,IAAI;AACjF,iBAAO;AAAA,YACL,UAAU,IAAI,WAAW;AAAA,YACzB,cAAc,IAAI,eAAe;AAAA,YACjC,aAAa,IAAI,cAAc;AAAA,UAAA;AAAA,QACjC;AAAA,QAEF,EAAC,UAAU,GAAG,cAAc,GAAG,aAAa,EAAA;AAAA;AAAA,MAAC;AAAA,IAGjD;AACE,aAAO,EAAC,UAAU,GAAG,cAAc,GAAG,aAAa,EAAA;AAAA,EAAC;AAG1D;AAEA,KAAA;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli",
3
- "version": "3.93.1-bump-pkg-utils.10.412e2ab170",
3
+ "version": "3.93.1-bump-pkg-utils.34.5d0c0b3d22",
4
4
  "description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
5
5
  "keywords": [
6
6
  "sanity",
@@ -43,7 +43,6 @@
43
43
  "bin",
44
44
  "codemods",
45
45
  "lib",
46
- "src",
47
46
  "templates"
48
47
  ],
49
48
  "scripts": {
@@ -59,11 +58,11 @@
59
58
  "dependencies": {
60
59
  "@babel/traverse": "^7.27.4",
61
60
  "@sanity/client": "^7.6.0",
62
- "@sanity/codegen": "3.93.1-bump-pkg-utils.10.412e2ab170",
61
+ "@sanity/codegen": "3.93.1-bump-pkg-utils.34.5d0c0b3d22",
63
62
  "@sanity/runtime-cli": "^8.1.0",
64
63
  "@sanity/telemetry": "^0.8.0",
65
64
  "@sanity/template-validator": "^2.4.3",
66
- "@sanity/util": "3.93.1-bump-pkg-utils.10.412e2ab170",
65
+ "@sanity/util": "3.93.1-bump-pkg-utils.34.5d0c0b3d22",
67
66
  "chalk": "^4.1.2",
68
67
  "debug": "^4.3.4",
69
68
  "decompress": "^4.2.0",
@@ -81,10 +80,10 @@
81
80
  "@repo/package.config": "3.93.0",
82
81
  "@repo/test-config": "3.93.0",
83
82
  "@rexxars/gitconfiglocal": "^3.0.1",
84
- "@rollup/plugin-node-resolve": "^15.2.3",
83
+ "@rollup/plugin-node-resolve": "^16.0.1",
85
84
  "@sanity/eslint-config-studio": "^5.0.2",
86
85
  "@sanity/generate-help-url": "^3.0.0",
87
- "@sanity/types": "3.93.1-bump-pkg-utils.10.412e2ab170",
86
+ "@sanity/types": "3.93.1-bump-pkg-utils.34.5d0c0b3d22",
88
87
  "@types/babel__traverse": "^7.20.5",
89
88
  "@types/configstore": "^5.0.1",
90
89
  "@types/cpx": "^1.5.2",
@@ -137,5 +136,5 @@
137
136
  "engines": {
138
137
  "node": ">=18"
139
138
  },
140
- "gitHead": "412e2ab1709ae9a314ad020f81e650158cfde397"
139
+ "gitHead": "5d0c0b3d2247f0daedb6846bae52ea62470c9a6d"
141
140
  }
@@ -7,5 +7,5 @@ Now you can do the following things:
7
7
  - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
8
8
  - Check out the example frontend: [React/Next.js](https://github.com/sanity-io/tutorial-sanity-blog-react-next)
9
9
  - [Read the blog post about this template](https://www.sanity.io/blog/build-your-own-blog-with-sanity-and-next-js?utm_source=readme)
10
- - [Join the community Slack](https://snty.link/community/?utm_source=readme)
10
+ - [Join the Sanity community](https://www.sanity.io/community/join?utm_source=readme)
11
11
  - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
@@ -5,5 +5,5 @@ Congratulations, you have now installed the Sanity Content Studio, an open-sourc
5
5
  Now you can do the following things:
6
6
 
7
7
  - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
8
- - [Join the community Slack](https://snty.link/community/?utm_source=readme)
8
+ - [Join the Sanity community](https://www.sanity.io/community/join?utm_source=readme)
9
9
  - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
@@ -7,5 +7,5 @@ Now you can do the following things:
7
7
  - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
8
8
  - Check out the example frontend: [Vue/Nuxt.js](https://github.com/sanity-io/example-ecommerce-snipcart-vue)
9
9
  - [Read the blog post about this template](https://www.sanity.io/blog/e-commerce-vue-nuxt-snipcart?uutm_source=readme)
10
- - [Join the community Slack](https://snty.link/community/?utm_source=readme)
10
+ - [Join the Sanity community](https://www.sanity.io/community/join?utm_source=readme)
11
11
  - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
@@ -5,5 +5,5 @@ Congratulations, you have now installed the Sanity Content Studio, an open-sourc
5
5
  Now you can do the following things:
6
6
 
7
7
  - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
8
- - [Join the community Slack](https://snty.link/community/?utm_source=readme)
8
+ - [Join the Sanity community](https://www.sanity.io/community/join?utm_source=readme)
9
9
  - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
@@ -6,5 +6,5 @@ Now you can do the following things:
6
6
 
7
7
  - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
8
8
  - Check out one of the example frontends: [React](https://github.com/sanity-io/example-frontend-next-js) | [React Native](https://github.com/sanity-io/example-app-react-native) | [Vue](https://github.com/sanity-io/example-frontend-vue-js) | [PHP](https://github.com/sanity-io/example-frontend-silex-twig)
9
- - [Join the community Slack](https://snty.link/community/?utm_source=readme)
9
+ - [Join the Sanity community](https://www.sanity.io/community/join?utm_source=readme)
10
10
  - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)
@@ -5,5 +5,5 @@ Congratulations, you have now installed Sanity Studio, an open-source real-time
5
5
  Now you can do the following things:
6
6
 
7
7
  - [Read “getting started” in the docs](https://www.sanity.io/docs/introduction/getting-started?utm_source=readme)
8
- - [Join the community Slack](https://snty.link/community/?utm_source=readme)
8
+ - [Join the Sanity community](https://www.sanity.io/community/join?utm_source=readme)
9
9
  - [Extend and build plugins](https://www.sanity.io/docs/content-studio/extending?utm_source=readme)