@sanity/cli 6.3.1 → 6.3.2

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 (131) hide show
  1. package/README.md +295 -442
  2. package/dist/actions/build/decorateIndexWithStagingScript.js +16 -0
  3. package/dist/actions/build/decorateIndexWithStagingScript.js.map +1 -0
  4. package/dist/actions/build/writeSanityRuntime.js +3 -2
  5. package/dist/actions/build/writeSanityRuntime.js.map +1 -1
  6. package/dist/actions/dataset/create.js +4 -0
  7. package/dist/actions/dataset/create.js.map +1 -1
  8. package/dist/actions/deploy/findUserApplicationForApp.js +1 -0
  9. package/dist/actions/deploy/findUserApplicationForApp.js.map +1 -1
  10. package/dist/actions/deploy/types.js +1 -1
  11. package/dist/actions/deploy/types.js.map +1 -1
  12. package/dist/actions/init/templates/nextjs/index.js +1 -2
  13. package/dist/actions/init/templates/nextjs/index.js.map +1 -1
  14. package/dist/actions/manifest/types.js +1 -1
  15. package/dist/actions/manifest/types.js.map +1 -1
  16. package/dist/actions/schema/types.js +3 -3
  17. package/dist/actions/schema/types.js.map +1 -1
  18. package/dist/actions/users/validateEmail.js +2 -2
  19. package/dist/actions/users/validateEmail.js.map +1 -1
  20. package/dist/commands/backups/disable.js +1 -1
  21. package/dist/commands/backups/disable.js.map +1 -1
  22. package/dist/commands/backups/download.js +1 -1
  23. package/dist/commands/backups/download.js.map +1 -1
  24. package/dist/commands/backups/enable.js +1 -1
  25. package/dist/commands/backups/enable.js.map +1 -1
  26. package/dist/commands/backups/list.js +1 -1
  27. package/dist/commands/backups/list.js.map +1 -1
  28. package/dist/commands/build.js +1 -1
  29. package/dist/commands/build.js.map +1 -1
  30. package/dist/commands/cors/add.js +1 -1
  31. package/dist/commands/cors/add.js.map +1 -1
  32. package/dist/commands/cors/delete.js +1 -1
  33. package/dist/commands/cors/delete.js.map +1 -1
  34. package/dist/commands/cors/list.js +2 -2
  35. package/dist/commands/cors/list.js.map +1 -1
  36. package/dist/commands/datasets/alias/create.js +1 -1
  37. package/dist/commands/datasets/alias/create.js.map +1 -1
  38. package/dist/commands/datasets/alias/delete.js +1 -1
  39. package/dist/commands/datasets/alias/delete.js.map +1 -1
  40. package/dist/commands/datasets/alias/link.js +1 -1
  41. package/dist/commands/datasets/alias/link.js.map +1 -1
  42. package/dist/commands/datasets/alias/unlink.js +1 -1
  43. package/dist/commands/datasets/alias/unlink.js.map +1 -1
  44. package/dist/commands/datasets/copy.js +1 -1
  45. package/dist/commands/datasets/copy.js.map +1 -1
  46. package/dist/commands/datasets/create.js +1 -1
  47. package/dist/commands/datasets/create.js.map +1 -1
  48. package/dist/commands/datasets/delete.js +1 -1
  49. package/dist/commands/datasets/delete.js.map +1 -1
  50. package/dist/commands/datasets/embeddings/enable.js +11 -0
  51. package/dist/commands/datasets/embeddings/enable.js.map +1 -1
  52. package/dist/commands/datasets/export.js +2 -2
  53. package/dist/commands/datasets/export.js.map +1 -1
  54. package/dist/commands/datasets/list.js +2 -2
  55. package/dist/commands/datasets/list.js.map +1 -1
  56. package/dist/commands/debug.js +1 -1
  57. package/dist/commands/debug.js.map +1 -1
  58. package/dist/commands/deploy.js +3 -3
  59. package/dist/commands/deploy.js.map +1 -1
  60. package/dist/commands/dev.js +5 -5
  61. package/dist/commands/dev.js.map +1 -1
  62. package/dist/commands/docs/browse.js +1 -1
  63. package/dist/commands/docs/browse.js.map +1 -1
  64. package/dist/commands/documents/delete.js +1 -1
  65. package/dist/commands/documents/delete.js.map +1 -1
  66. package/dist/commands/exec.js +2 -2
  67. package/dist/commands/exec.js.map +1 -1
  68. package/dist/commands/graphql/deploy.js +2 -2
  69. package/dist/commands/graphql/deploy.js.map +1 -1
  70. package/dist/commands/graphql/list.js +2 -2
  71. package/dist/commands/graphql/list.js.map +1 -1
  72. package/dist/commands/hooks/create.js +2 -2
  73. package/dist/commands/hooks/create.js.map +1 -1
  74. package/dist/commands/hooks/delete.js +5 -5
  75. package/dist/commands/hooks/delete.js.map +1 -1
  76. package/dist/commands/hooks/list.js +3 -3
  77. package/dist/commands/hooks/list.js.map +1 -1
  78. package/dist/commands/hooks/logs.js +5 -5
  79. package/dist/commands/hooks/logs.js.map +1 -1
  80. package/dist/commands/init.js +30 -12
  81. package/dist/commands/init.js.map +1 -1
  82. package/dist/commands/install.js +1 -1
  83. package/dist/commands/install.js.map +1 -1
  84. package/dist/commands/learn.js +1 -1
  85. package/dist/commands/learn.js.map +1 -1
  86. package/dist/commands/login.js +1 -1
  87. package/dist/commands/login.js.map +1 -1
  88. package/dist/commands/logout.js +1 -1
  89. package/dist/commands/logout.js.map +1 -1
  90. package/dist/commands/manage.js +1 -1
  91. package/dist/commands/manage.js.map +1 -1
  92. package/dist/commands/manifest/extract.js +2 -2
  93. package/dist/commands/manifest/extract.js.map +1 -1
  94. package/dist/commands/media/delete-aspect.js +1 -1
  95. package/dist/commands/media/delete-aspect.js.map +1 -1
  96. package/dist/commands/media/export.js +1 -1
  97. package/dist/commands/media/export.js.map +1 -1
  98. package/dist/commands/preview.js +3 -3
  99. package/dist/commands/preview.js.map +1 -1
  100. package/dist/commands/projects/list.js +4 -2
  101. package/dist/commands/projects/list.js.map +1 -1
  102. package/dist/commands/schemas/deploy.js +3 -4
  103. package/dist/commands/schemas/deploy.js.map +1 -1
  104. package/dist/commands/schemas/extract.js +3 -3
  105. package/dist/commands/schemas/extract.js.map +1 -1
  106. package/dist/commands/schemas/list.js +4 -5
  107. package/dist/commands/schemas/list.js.map +1 -1
  108. package/dist/commands/telemetry/disable.js +2 -2
  109. package/dist/commands/telemetry/disable.js.map +1 -1
  110. package/dist/commands/telemetry/enable.js +2 -2
  111. package/dist/commands/telemetry/enable.js.map +1 -1
  112. package/dist/commands/telemetry/status.js +2 -2
  113. package/dist/commands/telemetry/status.js.map +1 -1
  114. package/dist/commands/tokens/add.js +1 -1
  115. package/dist/commands/tokens/add.js.map +1 -1
  116. package/dist/commands/tokens/delete.js +1 -1
  117. package/dist/commands/tokens/delete.js.map +1 -1
  118. package/dist/commands/tokens/list.js +2 -2
  119. package/dist/commands/tokens/list.js.map +1 -1
  120. package/dist/commands/users/list.js +1 -1
  121. package/dist/commands/users/list.js.map +1 -1
  122. package/dist/commands/versions.js +1 -1
  123. package/dist/commands/versions.js.map +1 -1
  124. package/dist/server/vite/plugin-sanity-build-entries.js +3 -2
  125. package/dist/server/vite/plugin-sanity-build-entries.js.map +1 -1
  126. package/dist/util/telemetry/createTelemetryStore.js +27 -12
  127. package/dist/util/telemetry/createTelemetryStore.js.map +1 -1
  128. package/dist/util/validateProjection.js +121 -0
  129. package/dist/util/validateProjection.js.map +1 -0
  130. package/oclif.manifest.json +158 -156
  131. package/package.json +22 -21
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/logout.ts"],"sourcesContent":["import {getCliToken, getUserConfig, SanityCommand, setCliUserConfig} from '@sanity/cli-core'\nimport {isHttpError} from '@sanity/client'\n\nimport {logout} from '../services/auth.js'\n\nexport class LogoutCommand extends SanityCommand<typeof LogoutCommand> {\n static override description = 'Logs out the CLI from the current user session'\n\n public async run(): Promise<void> {\n await this.parse(LogoutCommand)\n\n const previousToken = await getCliToken()\n if (!previousToken) {\n this.log('No login credentials found')\n return\n }\n\n try {\n await logout()\n\n this.clearConfig()\n } catch (error) {\n // In the case of session timeouts or missing sessions, we'll get a 401\n // This is an acceptable situation seen from a logout perspective - all we\n // need to do in this case is clear the session from the view of the CLI\n if (isHttpError(error) && error.response.statusCode === 401) {\n this.clearConfig()\n return\n }\n const err = error instanceof Error ? error : new Error(`${error}`)\n this.error(`Failed to logout: ${err.message}`, {exit: 1})\n }\n }\n\n private clearConfig() {\n setCliUserConfig('authToken', undefined)\n getUserConfig().delete('telemetryConsent')\n\n this.log('Logged out successfully')\n }\n}\n"],"names":["getCliToken","getUserConfig","SanityCommand","setCliUserConfig","isHttpError","logout","LogoutCommand","description","run","parse","previousToken","log","clearConfig","error","response","statusCode","err","Error","message","exit","undefined","delete"],"mappings":"AAAA,SAAQA,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,gBAAgB,QAAO,mBAAkB;AAC5F,SAAQC,WAAW,QAAO,iBAAgB;AAE1C,SAAQC,MAAM,QAAO,sBAAqB;AAE1C,OAAO,MAAMC,sBAAsBJ;IACjC,OAAgBK,cAAc,iDAAgD;IAE9E,MAAaC,MAAqB;QAChC,MAAM,IAAI,CAACC,KAAK,CAACH;QAEjB,MAAMI,gBAAgB,MAAMV;QAC5B,IAAI,CAACU,eAAe;YAClB,IAAI,CAACC,GAAG,CAAC;YACT;QACF;QAEA,IAAI;YACF,MAAMN;YAEN,IAAI,CAACO,WAAW;QAClB,EAAE,OAAOC,OAAO;YACd,uEAAuE;YACvE,0EAA0E;YAC1E,wEAAwE;YACxE,IAAIT,YAAYS,UAAUA,MAAMC,QAAQ,CAACC,UAAU,KAAK,KAAK;gBAC3D,IAAI,CAACH,WAAW;gBAChB;YACF;YACA,MAAMI,MAAMH,iBAAiBI,QAAQJ,QAAQ,IAAII,MAAM,GAAGJ,OAAO;YACjE,IAAI,CAACA,KAAK,CAAC,CAAC,kBAAkB,EAAEG,IAAIE,OAAO,EAAE,EAAE;gBAACC,MAAM;YAAC;QACzD;IACF;IAEQP,cAAc;QACpBT,iBAAiB,aAAaiB;QAC9BnB,gBAAgBoB,MAAM,CAAC;QAEvB,IAAI,CAACV,GAAG,CAAC;IACX;AACF"}
1
+ {"version":3,"sources":["../../src/commands/logout.ts"],"sourcesContent":["import {getCliToken, getUserConfig, SanityCommand, setCliUserConfig} from '@sanity/cli-core'\nimport {isHttpError} from '@sanity/client'\n\nimport {logout} from '../services/auth.js'\n\nexport class LogoutCommand extends SanityCommand<typeof LogoutCommand> {\n static override description = 'Log out of the current session'\n\n public async run(): Promise<void> {\n await this.parse(LogoutCommand)\n\n const previousToken = await getCliToken()\n if (!previousToken) {\n this.log('No login credentials found')\n return\n }\n\n try {\n await logout()\n\n this.clearConfig()\n } catch (error) {\n // In the case of session timeouts or missing sessions, we'll get a 401\n // This is an acceptable situation seen from a logout perspective - all we\n // need to do in this case is clear the session from the view of the CLI\n if (isHttpError(error) && error.response.statusCode === 401) {\n this.clearConfig()\n return\n }\n const err = error instanceof Error ? error : new Error(`${error}`)\n this.error(`Failed to logout: ${err.message}`, {exit: 1})\n }\n }\n\n private clearConfig() {\n setCliUserConfig('authToken', undefined)\n getUserConfig().delete('telemetryConsent')\n\n this.log('Logged out successfully')\n }\n}\n"],"names":["getCliToken","getUserConfig","SanityCommand","setCliUserConfig","isHttpError","logout","LogoutCommand","description","run","parse","previousToken","log","clearConfig","error","response","statusCode","err","Error","message","exit","undefined","delete"],"mappings":"AAAA,SAAQA,WAAW,EAAEC,aAAa,EAAEC,aAAa,EAAEC,gBAAgB,QAAO,mBAAkB;AAC5F,SAAQC,WAAW,QAAO,iBAAgB;AAE1C,SAAQC,MAAM,QAAO,sBAAqB;AAE1C,OAAO,MAAMC,sBAAsBJ;IACjC,OAAgBK,cAAc,iCAAgC;IAE9D,MAAaC,MAAqB;QAChC,MAAM,IAAI,CAACC,KAAK,CAACH;QAEjB,MAAMI,gBAAgB,MAAMV;QAC5B,IAAI,CAACU,eAAe;YAClB,IAAI,CAACC,GAAG,CAAC;YACT;QACF;QAEA,IAAI;YACF,MAAMN;YAEN,IAAI,CAACO,WAAW;QAClB,EAAE,OAAOC,OAAO;YACd,uEAAuE;YACvE,0EAA0E;YAC1E,wEAAwE;YACxE,IAAIT,YAAYS,UAAUA,MAAMC,QAAQ,CAACC,UAAU,KAAK,KAAK;gBAC3D,IAAI,CAACH,WAAW;gBAChB;YACF;YACA,MAAMI,MAAMH,iBAAiBI,QAAQJ,QAAQ,IAAII,MAAM,GAAGJ,OAAO;YACjE,IAAI,CAACA,KAAK,CAAC,CAAC,kBAAkB,EAAEG,IAAIE,OAAO,EAAE,EAAE;gBAACC,MAAM;YAAC;QACzD;IACF;IAEQP,cAAc;QACpBT,iBAAiB,aAAaiB;QAC9BnB,gBAAgBoB,MAAM,CAAC;QAEvB,IAAI,CAACV,GAAG,CAAC;IACX;AACF"}
@@ -2,7 +2,7 @@ import { getStudioConfig, SanityCommand } from '@sanity/cli-core';
2
2
  import open from 'open';
3
3
  import { getManageUrl } from '../actions/projects/getManageUrl.js';
4
4
  export class ManageCommand extends SanityCommand {
5
- static description = 'Opens project management interface in your web browser';
5
+ static description = 'Open project settings in your browser';
6
6
  static flags = {};
7
7
  async run() {
8
8
  // Parse to ensure no invalid flags are passed
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/manage.ts"],"sourcesContent":["import {type FlagInput} from '@oclif/core/interfaces'\nimport {getStudioConfig, SanityCommand} from '@sanity/cli-core'\nimport open from 'open'\n\nimport {getManageUrl} from '../actions/projects/getManageUrl.js'\n\nexport class ManageCommand extends SanityCommand<typeof ManageCommand> {\n static override description = 'Opens project management interface in your web browser'\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(ManageCommand)\n\n const cliConfig = await this.getCliConfig()\n // Read the projectId from the CLI config\n let projectId = cliConfig?.api?.projectId\n\n if (!projectId) {\n const projectRoot = await this.getProjectRoot()\n const config = await getStudioConfig(projectRoot.directory, {resolvePlugins: false})\n if (!Array.isArray(config) && config.projectId) {\n projectId = config.projectId\n }\n }\n\n const url = getManageUrl(projectId)\n\n this.log(`Opening ${url}`)\n await open(url)\n }\n}\n"],"names":["getStudioConfig","SanityCommand","open","getManageUrl","ManageCommand","description","flags","run","parse","cliConfig","getCliConfig","projectId","api","projectRoot","getProjectRoot","config","directory","resolvePlugins","Array","isArray","url","log"],"mappings":"AACA,SAAQA,eAAe,EAAEC,aAAa,QAAO,mBAAkB;AAC/D,OAAOC,UAAU,OAAM;AAEvB,SAAQC,YAAY,QAAO,sCAAqC;AAEhE,OAAO,MAAMC,sBAAsBH;IACjC,OAAgBI,cAAc,yDAAwD;IACtF,OAAgBC,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACJ;QAEjB,MAAMK,YAAY,MAAM,IAAI,CAACC,YAAY;QACzC,yCAAyC;QACzC,IAAIC,YAAYF,WAAWG,KAAKD;QAEhC,IAAI,CAACA,WAAW;YACd,MAAME,cAAc,MAAM,IAAI,CAACC,cAAc;YAC7C,MAAMC,SAAS,MAAMf,gBAAgBa,YAAYG,SAAS,EAAE;gBAACC,gBAAgB;YAAK;YAClF,IAAI,CAACC,MAAMC,OAAO,CAACJ,WAAWA,OAAOJ,SAAS,EAAE;gBAC9CA,YAAYI,OAAOJ,SAAS;YAC9B;QACF;QAEA,MAAMS,MAAMjB,aAAaQ;QAEzB,IAAI,CAACU,GAAG,CAAC,CAAC,QAAQ,EAAED,KAAK;QACzB,MAAMlB,KAAKkB;IACb;AACF"}
1
+ {"version":3,"sources":["../../src/commands/manage.ts"],"sourcesContent":["import {type FlagInput} from '@oclif/core/interfaces'\nimport {getStudioConfig, SanityCommand} from '@sanity/cli-core'\nimport open from 'open'\n\nimport {getManageUrl} from '../actions/projects/getManageUrl.js'\n\nexport class ManageCommand extends SanityCommand<typeof ManageCommand> {\n static override description = 'Open project settings in your browser'\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(ManageCommand)\n\n const cliConfig = await this.getCliConfig()\n // Read the projectId from the CLI config\n let projectId = cliConfig?.api?.projectId\n\n if (!projectId) {\n const projectRoot = await this.getProjectRoot()\n const config = await getStudioConfig(projectRoot.directory, {resolvePlugins: false})\n if (!Array.isArray(config) && config.projectId) {\n projectId = config.projectId\n }\n }\n\n const url = getManageUrl(projectId)\n\n this.log(`Opening ${url}`)\n await open(url)\n }\n}\n"],"names":["getStudioConfig","SanityCommand","open","getManageUrl","ManageCommand","description","flags","run","parse","cliConfig","getCliConfig","projectId","api","projectRoot","getProjectRoot","config","directory","resolvePlugins","Array","isArray","url","log"],"mappings":"AACA,SAAQA,eAAe,EAAEC,aAAa,QAAO,mBAAkB;AAC/D,OAAOC,UAAU,OAAM;AAEvB,SAAQC,YAAY,QAAO,sCAAqC;AAEhE,OAAO,MAAMC,sBAAsBH;IACjC,OAAgBI,cAAc,wCAAuC;IACrE,OAAgBC,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACJ;QAEjB,MAAMK,YAAY,MAAM,IAAI,CAACC,YAAY;QACzC,yCAAyC;QACzC,IAAIC,YAAYF,WAAWG,KAAKD;QAEhC,IAAI,CAACA,WAAW;YACd,MAAME,cAAc,MAAM,IAAI,CAACC,cAAc;YAC7C,MAAMC,SAAS,MAAMf,gBAAgBa,YAAYG,SAAS,EAAE;gBAACC,gBAAgB;YAAK;YAClF,IAAI,CAACC,MAAMC,OAAO,CAACJ,WAAWA,OAAOJ,SAAS,EAAE;gBAC9CA,YAAYI,OAAOJ,SAAS;YAC9B;QACF;QAEA,MAAMS,MAAMjB,aAAaQ;QAEzB,IAAI,CAACU,GAAG,CAAC,CAAC,QAAQ,EAAED,KAAK;QACzB,MAAMlB,KAAKkB;IACb;AACF"}
@@ -5,9 +5,9 @@ import { extractManifest } from '../../actions/manifest/extractManifest.js';
5
5
  import { formatSchemaValidation } from '../../actions/schema/formatSchemaValidation.js';
6
6
  import { SchemaExtractionError } from '../../actions/schema/utils/SchemaExtractionError.js';
7
7
  const description = `
8
- Extracts the studio configuration as one or more JSON manifest files.
8
+ Extract studio configuration as JSON manifest files.
9
9
 
10
- **Note**: This command is experimental and subject to change. It is currently intended for use with Create only.
10
+ Note: This command is experimental and subject to change. It is currently intended for use with Create only.
11
11
  `.trim();
12
12
  export class ExtractManifestCommand extends SanityCommand {
13
13
  static description = description;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/manifest/extract.ts"],"sourcesContent":["import {Flags} from '@oclif/core'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {manifestDebug} from '../../actions/manifest/debug.js'\nimport {extractManifest} from '../../actions/manifest/extractManifest.js'\nimport {formatSchemaValidation} from '../../actions/schema/formatSchemaValidation.js'\nimport {SchemaExtractionError} from '../../actions/schema/utils/SchemaExtractionError.js'\n\nconst description = `\nExtracts the studio configuration as one or more JSON manifest files.\n\n**Note**: This command is experimental and subject to change. It is currently intended for use with Create only.\n`.trim()\n\nexport class ExtractManifestCommand extends SanityCommand<typeof ExtractManifestCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Extracts manifests',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --path /public/static',\n description: 'Extracts manifests into /public/static',\n },\n ]\n\n static override flags = {\n path: Flags.string({\n default: 'dist/static',\n description: 'Optional path to specify destination directory of the manifest files',\n }),\n }\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(ExtractManifestCommand)\n\n try {\n await extractManifest(flags.path)\n } catch (error) {\n manifestDebug('Error extracting manifest in command', error)\n if (\n error instanceof SchemaExtractionError &&\n error.validation &&\n error.validation.length > 0\n ) {\n this.output.log(formatSchemaValidation(error.validation))\n this.exit(1)\n }\n\n this.error(\n `Failed to extract manifest:\\n${error instanceof Error ? error.message : String(error)}`,\n {exit: 1},\n )\n }\n }\n}\n"],"names":["Flags","SanityCommand","manifestDebug","extractManifest","formatSchemaValidation","SchemaExtractionError","description","trim","ExtractManifestCommand","examples","command","flags","path","string","default","run","parse","error","validation","length","output","log","exit","Error","message","String"],"mappings":"AAAA,SAAQA,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,aAAa,QAAO,kCAAiC;AAC7D,SAAQC,eAAe,QAAO,4CAA2C;AACzE,SAAQC,sBAAsB,QAAO,iDAAgD;AACrF,SAAQC,qBAAqB,QAAO,sDAAqD;AAEzF,MAAMC,cAAc,CAAC;;;;AAIrB,CAAC,CAACC,IAAI;AAEN,OAAO,MAAMC,+BAA+BP;IAC1C,OAAgBK,cAAcA,YAAW;IAEzC,OAAgBG,WAAW;QACzB;YACEC,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;KACD,CAAA;IAED,OAAgBK,QAAQ;QACtBC,MAAMZ,MAAMa,MAAM,CAAC;YACjBC,SAAS;YACTR,aAAa;QACf;IACF,EAAC;IAED,MAAaS,MAAqB;QAChC,MAAM,EAACJ,KAAK,EAAC,GAAG,MAAM,IAAI,CAACK,KAAK,CAACR;QAEjC,IAAI;YACF,MAAML,gBAAgBQ,MAAMC,IAAI;QAClC,EAAE,OAAOK,OAAO;YACdf,cAAc,wCAAwCe;YACtD,IACEA,iBAAiBZ,yBACjBY,MAAMC,UAAU,IAChBD,MAAMC,UAAU,CAACC,MAAM,GAAG,GAC1B;gBACA,IAAI,CAACC,MAAM,CAACC,GAAG,CAACjB,uBAAuBa,MAAMC,UAAU;gBACvD,IAAI,CAACI,IAAI,CAAC;YACZ;YAEA,IAAI,CAACL,KAAK,CACR,CAAC,6BAA6B,EAAEA,iBAAiBM,QAAQN,MAAMO,OAAO,GAAGC,OAAOR,QAAQ,EACxF;gBAACK,MAAM;YAAC;QAEZ;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/manifest/extract.ts"],"sourcesContent":["import {Flags} from '@oclif/core'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {manifestDebug} from '../../actions/manifest/debug.js'\nimport {extractManifest} from '../../actions/manifest/extractManifest.js'\nimport {formatSchemaValidation} from '../../actions/schema/formatSchemaValidation.js'\nimport {SchemaExtractionError} from '../../actions/schema/utils/SchemaExtractionError.js'\n\nconst description = `\nExtract studio configuration as JSON manifest files.\n\nNote: This command is experimental and subject to change. It is currently intended for use with Create only.\n`.trim()\n\nexport class ExtractManifestCommand extends SanityCommand<typeof ExtractManifestCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Extracts manifests',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --path /public/static',\n description: 'Extracts manifests into /public/static',\n },\n ]\n\n static override flags = {\n path: Flags.string({\n default: 'dist/static',\n description: 'Optional path to specify destination directory of the manifest files',\n }),\n }\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(ExtractManifestCommand)\n\n try {\n await extractManifest(flags.path)\n } catch (error) {\n manifestDebug('Error extracting manifest in command', error)\n if (\n error instanceof SchemaExtractionError &&\n error.validation &&\n error.validation.length > 0\n ) {\n this.output.log(formatSchemaValidation(error.validation))\n this.exit(1)\n }\n\n this.error(\n `Failed to extract manifest:\\n${error instanceof Error ? error.message : String(error)}`,\n {exit: 1},\n )\n }\n }\n}\n"],"names":["Flags","SanityCommand","manifestDebug","extractManifest","formatSchemaValidation","SchemaExtractionError","description","trim","ExtractManifestCommand","examples","command","flags","path","string","default","run","parse","error","validation","length","output","log","exit","Error","message","String"],"mappings":"AAAA,SAAQA,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,aAAa,QAAO,kCAAiC;AAC7D,SAAQC,eAAe,QAAO,4CAA2C;AACzE,SAAQC,sBAAsB,QAAO,iDAAgD;AACrF,SAAQC,qBAAqB,QAAO,sDAAqD;AAEzF,MAAMC,cAAc,CAAC;;;;AAIrB,CAAC,CAACC,IAAI;AAEN,OAAO,MAAMC,+BAA+BP;IAC1C,OAAgBK,cAAcA,YAAW;IAEzC,OAAgBG,WAAW;QACzB;YACEC,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;KACD,CAAA;IAED,OAAgBK,QAAQ;QACtBC,MAAMZ,MAAMa,MAAM,CAAC;YACjBC,SAAS;YACTR,aAAa;QACf;IACF,EAAC;IAED,MAAaS,MAAqB;QAChC,MAAM,EAACJ,KAAK,EAAC,GAAG,MAAM,IAAI,CAACK,KAAK,CAACR;QAEjC,IAAI;YACF,MAAML,gBAAgBQ,MAAMC,IAAI;QAClC,EAAE,OAAOK,OAAO;YACdf,cAAc,wCAAwCe;YACtD,IACEA,iBAAiBZ,yBACjBY,MAAMC,UAAU,IAChBD,MAAMC,UAAU,CAACC,MAAM,GAAG,GAC1B;gBACA,IAAI,CAACC,MAAM,CAACC,GAAG,CAACjB,uBAAuBa,MAAMC,UAAU;gBACvD,IAAI,CAACI,IAAI,CAAC;YACZ;YAEA,IAAI,CAACL,KAAK,CACR,CAAC,6BAA6B,EAAEA,iBAAiBM,QAAQN,MAAMO,OAAO,GAAGC,OAAOR,QAAQ,EACxF;gBAACK,MAAM;YAAC;QAEZ;IACF;AACF"}
@@ -14,7 +14,7 @@ export class MediaDeleteAspectCommand extends SanityCommand {
14
14
  required: true
15
15
  })
16
16
  };
17
- static description = 'Undeploy an aspect';
17
+ static description = 'Delete an aspect definition';
18
18
  static examples = [
19
19
  {
20
20
  command: '<%= config.bin %> <%= command.id %> someAspect',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/media/delete-aspect.ts"],"sourcesContent":["import {styleText} from 'node:util'\n\nimport {Args, Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\nimport {confirm} from '@sanity/cli-core/ux'\n\nimport {promptForProject} from '../../prompts/promptForProject.js'\nimport {selectMediaLibrary} from '../../prompts/selectMediaLibrary.js'\nimport {deleteAspect} from '../../services/mediaLibraries.js'\nimport {getProjectIdFlag} from '../../util/sharedFlags.js'\n\nconst deleteAspectDebug = subdebug('media:delete-aspect')\n\nexport class MediaDeleteAspectCommand extends SanityCommand<typeof MediaDeleteAspectCommand> {\n static override args = {\n aspectName: Args.string({\n description: 'Name of the aspect to delete',\n required: true,\n }),\n }\n\n static override description = 'Undeploy an aspect'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %> someAspect',\n description: 'Delete the aspect named \"someAspect\"',\n },\n ]\n\n static override flags = {\n ...getProjectIdFlag({\n description: 'Project ID to delete media aspect from',\n semantics: 'override',\n }),\n 'media-library-id': Flags.string({\n description: 'The id of the target media library',\n required: false,\n }),\n yes: Flags.boolean({\n aliases: ['y'],\n description: 'Skip confirmation prompt',\n required: false,\n }),\n }\n\n public async run(): Promise<void> {\n const {aspectName} = this.args\n const {'media-library-id': mediaLibraryIdFlag, yes: skipConfirmation} = this.flags\n\n const projectId = await this.getProjectId({fallback: () => promptForProject({})})\n\n try {\n let mediaLibraryId = mediaLibraryIdFlag\n if (!mediaLibraryId) {\n mediaLibraryId = await selectMediaLibrary(projectId)\n }\n\n if (!skipConfirmation) {\n const confirmed = await confirm({\n default: false,\n message: `Are you absolutely sure you want to undeploy the ${aspectName} aspect from the \"${mediaLibraryId}\" media library?`,\n })\n\n if (!confirmed) {\n this.log('Operation cancelled')\n return\n }\n }\n\n const response = await deleteAspect({\n aspectName,\n mediaLibraryId,\n projectId,\n })\n\n if (response.results.length === 0) {\n this.warn(styleText('bold', `There's no deployed aspect with that name`))\n this.log(` - ${aspectName}`)\n return\n }\n\n this.log()\n this.log(`${styleText('green', '✓')} ${styleText('bold', 'Deleted aspect')}`)\n this.log(` - ${aspectName}`)\n\n // TODO: Find existing aspect definition files matching the undeployed aspect name and offer\n // to delete them.\n } catch (error) {\n const err = error as Error\n deleteAspectDebug('Failed to delete aspect', err)\n this.error(\n styleText('bold', 'Failed to delete aspect') +\n `\\n - ${aspectName}\\n\\n${styleText('red', err.message)}`,\n {\n exit: 1,\n },\n )\n }\n }\n}\n"],"names":["styleText","Args","Flags","SanityCommand","subdebug","confirm","promptForProject","selectMediaLibrary","deleteAspect","getProjectIdFlag","deleteAspectDebug","MediaDeleteAspectCommand","args","aspectName","string","description","required","examples","command","flags","semantics","yes","boolean","aliases","run","mediaLibraryIdFlag","skipConfirmation","projectId","getProjectId","fallback","mediaLibraryId","confirmed","default","message","log","response","results","length","warn","error","err","exit"],"mappings":"AAAA,SAAQA,SAAS,QAAO,YAAW;AAEnC,SAAQC,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AACxD,SAAQC,OAAO,QAAO,sBAAqB;AAE3C,SAA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YACF;YAEA,MAAMC,WAAW,MAAM3B,aAAa;gBAClCK;gBACAiB;gBACAH;YACF;YAEA,IAAIQ,SAASC,OAAO,CAACC,MAAM,KAAK,GAAG;gBACjC,IAAI,CAACC,IAAI,CAACtC,UAAU,QAAQ,CAAC,yCAAyC,CAAC;gBACvE,IAAI,CAACkC,GAAG,CAAC,CAAC,IAAI,EAAErB,YAAY;gBAC5B;YACF;YAEA,IAAI,CAACqB,GAAG;YACR,IAAI,CAACA,GAAG,CAAC,GAAGlC,UAAU,SAAS,KAAK,CAAC,EAAEA,UAAU,QAAQ,mBAAmB;YAC5E,IAAI,CAACkC,GAAG,CAAC,CAAC,IAAI,EAAErB,YAAY;QAE5B,4FAA4F;QAC5F,kBAAkB;QACpB,EAAE,OAAO0B,OAAO;YACd,MAAMC,MAAMD;YACZ7B,kBAAkB,2BAA2B8B;YAC7C,IAAI,CAACD,KAAK,CACRvC,UAAU,QAAQ,6BAChB,CAAC,MAAM,EAAEa,WAAW,IAAI,EAAEb,UAAU,OAAOwC,IAAIP,OAAO,GAAG,EAC3D;gBACEQ,MAAM;YACR;QAEJ;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/media/delete-aspect.ts"],"sourcesContent":["import {styleText} from 'node:util'\n\nimport {Args, Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\nimport {confirm} from '@sanity/cli-core/ux'\n\nimport {promptForProject} from '../../prompts/promptForProject.js'\nimport {selectMediaLibrary} from '../../prompts/selectMediaLibrary.js'\nimport {deleteAspect} from '../../services/mediaLibraries.js'\nimport {getProjectIdFlag} from '../../util/sharedFlags.js'\n\nconst deleteAspectDebug = subdebug('media:delete-aspect')\n\nexport class MediaDeleteAspectCommand extends SanityCommand<typeof MediaDeleteAspectCommand> {\n static override args = {\n aspectName: Args.string({\n description: 'Name of the aspect to delete',\n required: true,\n }),\n }\n\n static override description = 'Delete an aspect definition'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %> someAspect',\n description: 'Delete the aspect named \"someAspect\"',\n },\n ]\n\n static override flags = {\n ...getProjectIdFlag({\n description: 'Project ID to delete media aspect from',\n semantics: 'override',\n }),\n 'media-library-id': Flags.string({\n description: 'The id of the target media library',\n required: false,\n }),\n yes: Flags.boolean({\n aliases: ['y'],\n description: 'Skip confirmation prompt',\n required: false,\n }),\n }\n\n public async run(): Promise<void> {\n const {aspectName} = this.args\n const {'media-library-id': mediaLibraryIdFlag, yes: skipConfirmation} = this.flags\n\n const projectId = await this.getProjectId({fallback: () => promptForProject({})})\n\n try {\n let mediaLibraryId = mediaLibraryIdFlag\n if (!mediaLibraryId) {\n mediaLibraryId = await selectMediaLibrary(projectId)\n }\n\n if (!skipConfirmation) {\n const confirmed = await confirm({\n default: false,\n message: `Are you absolutely sure you want to undeploy the ${aspectName} aspect from the \"${mediaLibraryId}\" media library?`,\n })\n\n if (!confirmed) {\n this.log('Operation cancelled')\n return\n }\n }\n\n const response = await deleteAspect({\n aspectName,\n mediaLibraryId,\n projectId,\n })\n\n if (response.results.length === 0) {\n this.warn(styleText('bold', `There's no deployed aspect with that name`))\n this.log(` - ${aspectName}`)\n return\n }\n\n this.log()\n this.log(`${styleText('green', '✓')} ${styleText('bold', 'Deleted aspect')}`)\n this.log(` - ${aspectName}`)\n\n // TODO: Find existing aspect definition files matching the undeployed aspect name and offer\n // to delete them.\n } catch (error) {\n const err = error as Error\n deleteAspectDebug('Failed to delete aspect', err)\n this.error(\n styleText('bold', 'Failed to delete aspect') +\n `\\n - ${aspectName}\\n\\n${styleText('red', err.message)}`,\n {\n exit: 1,\n },\n )\n }\n }\n}\n"],"names":["styleText","Args","Flags","SanityCommand","subdebug","confirm","promptForProject","selectMediaLibrary","deleteAspect","getProjectIdFlag","deleteAspectDebug","MediaDeleteAspectCommand","args","aspectName","string","description","required","examples","command","flags","semantics","yes","boolean","aliases","run","mediaLibraryIdFlag","skipConfirmation","projectId","getProjectId","fallback","mediaLibraryId","confirmed","default","message","log","response","results","length","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AY,MAAM1B,QAAQ;oBAC9B2B,SAAS;oBACTC,SAAS,CAAC,iDAAiD,EAAEpB,WAAW,kBAAkB,EAAEiB,eAAe,gBAAgB,CAAC;gBAC9H;gBAEA,IAAI,CAACC,WAAW;oBACd,IAAI,CAACG,GAAG,CAAC;oBACT;gBACF;YACF;YAEA,MAAMC,WAAW,MAAM3B,aAAa;gBAClCK;gBACAiB;gBACAH;YACF;YAEA,IAAIQ,SAASC,OAAO,CAACC,MAAM,KAAK,GAAG;gBACjC,IAAI,CAACC,IAAI,CAACtC,UAAU,QAAQ,CAAC,yCAAyC,CAAC;gBACvE,IAAI,CAACkC,GAAG,CAAC,CAAC,IAAI,EAAErB,YAAY;gBAC5B;YACF;YAEA,IAAI,CAACqB,GAAG;YACR,IAAI,CAACA,GAAG,CAAC,GAAGlC,UAAU,SAAS,KAAK,CAAC,EAAEA,UAAU,QAAQ,mBAAmB;YAC5E,IAAI,CAACkC,GAAG,CAAC,CAAC,IAAI,EAAErB,YAAY;QAE5B,4FAA4F;QAC5F,kBAAkB;QACpB,EAAE,OAAO0B,OAAO;YACd,MAAMC,MAAMD;YACZ7B,kBAAkB,2BAA2B8B;YAC7C,IAAI,CAACD,KAAK,CACRvC,UAAU,QAAQ,6BAChB,CAAC,MAAM,EAAEa,WAAW,IAAI,EAAEb,UAAU,OAAOwC,IAAIP,OAAO,GAAG,EAC3D;gBACEQ,MAAM;YACR;QAEJ;IACF;AACF"}
@@ -18,7 +18,7 @@ export class MediaExportCommand extends SanityCommand {
18
18
  description: 'Output destination file path'
19
19
  })
20
20
  };
21
- static description = 'Export an archive of all file and image assets including their aspect data from the target media library. Video assets are excluded from the export.';
21
+ static description = 'Export file and image assets from a media library (excludes video)';
22
22
  static examples = [
23
23
  {
24
24
  command: '<%= config.bin %> <%= command.id %>',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/media/export.ts"],"sourcesContent":["import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport {type Writable} from 'node:stream'\n\nimport {Args, Flags} from '@oclif/core'\nimport {getProjectCliClient, SanityCommand, subdebug} from '@sanity/cli-core'\nimport {boxen, input, spinner} from '@sanity/cli-core/ux'\nimport {exportDataset, type ExportOptions, type ExportProgress} from '@sanity/export'\nimport prettyMs from 'pretty-ms'\n\nimport {promptForMediaLibrary} from '../../prompts/promptForMediaLibrary.js'\nimport {promptForProject} from '../../prompts/promptForProject.js'\nimport {getMediaLibraries} from '../../services/mediaLibraries.js'\nimport {absolutify} from '../../util/absolutify.js'\nimport {getProjectIdFlag} from '../../util/sharedFlags.js'\n\nconst noop = () => null\nconst exportDebug = subdebug('media:export')\n\nexport class MediaExportCommand extends SanityCommand<typeof MediaExportCommand> {\n static override args = {\n destination: Args.string({\n description: 'Output destination file path',\n }),\n }\n\n static override description =\n 'Export an archive of all file and image assets including their aspect data from the target media library. Video assets are excluded from the export.'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Export media library interactively',\n },\n {\n command: '<%= config.bin %> <%= command.id %> output.tar.gz',\n description: 'Export media library to output.tar.gz',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --media-library-id my-library-id',\n description: 'Export specific media library',\n },\n ]\n\n static override flags = {\n ...getProjectIdFlag({\n description: 'Project ID to export media from',\n semantics: 'override',\n }),\n 'asset-concurrency': Flags.integer({\n default: 8,\n description: 'Concurrent number of asset downloads',\n }),\n 'media-library-id': Flags.string({\n description: 'The id of the target media library',\n }),\n 'no-compress': Flags.boolean({\n default: false,\n description: 'Skips compressing tarball entries (still generates a gzip file)',\n }),\n overwrite: Flags.boolean({\n default: false,\n description: 'Overwrite any file with the same name',\n }),\n }\n\n public async run(): Promise<void> {\n const {args, flags} = await this.parse(MediaExportCommand)\n const {destination: targetDestination} = args\n\n const projectId = await this.getProjectId({fallback: () => promptForProject({})})\n\n const projectClient = await getProjectCliClient({\n apiVersion: 'v2025-02-19',\n projectId,\n requireUser: true,\n })\n\n let mediaLibraries\n try {\n mediaLibraries = await getMediaLibraries(projectId)\n } catch (error) {\n exportDebug('Error listing media libraries', error)\n this.error(\n `Failed to list media libraries:\\n${error instanceof Error ? error.message : error}`,\n {\n exit: 1,\n },\n )\n }\n\n if (mediaLibraries.length === 0) {\n this.error('No active media libraries found in this project', {exit: 1})\n }\n\n let mediaLibraryId = flags['media-library-id']\n if (!mediaLibraryId) {\n try {\n mediaLibraryId = await promptForMediaLibrary({mediaLibraries})\n } catch (error) {\n exportDebug('Error selecting media library', error)\n this.error(\n `Failed to select media library:\\n${error instanceof Error ? error.message : error}`,\n {\n exit: 1,\n },\n )\n }\n }\n\n if (!mediaLibraries.some((library) => library.id === mediaLibraryId)) {\n this.error(`Media library with id \"${mediaLibraryId}\" not found`, {exit: 1})\n }\n\n this.log(\n boxen(\n `Exporting from:\nprojectId: ${projectId.padEnd(44)}\nmediaLibraryId: ${mediaLibraryId.padEnd(37)}`,\n {\n borderColor: 'yellow',\n borderStyle: 'round',\n },\n ),\n )\n\n let destinationPath = targetDestination\n if (!destinationPath) {\n destinationPath = await this.promptForDestination({mediaLibraryId})\n }\n\n const outputPath = await this.getOutputPath(destinationPath, mediaLibraryId, flags)\n if (!outputPath) {\n this.error('Cancelled', {exit: 1})\n }\n\n const {fail, onProgress, succeed} = this.createProgressHandler()\n const exportOptions: ExportOptions = {\n assetConcurrency: flags['asset-concurrency'],\n client: projectClient,\n compress: !flags['no-compress'],\n mediaLibraryId,\n onProgress,\n outputPath,\n }\n\n const start = Date.now()\n try {\n await exportDataset(exportOptions)\n succeed()\n this.log(`Export finished (${prettyMs(Date.now() - start)})`)\n } catch (error) {\n fail()\n const err = error instanceof Error ? error : new Error(String(error))\n exportDebug('Export failed', err)\n this.error(`Export failed: ${err.message}`, {exit: 1})\n }\n }\n\n private createProgressHandler() {\n let currentSpinner: ReturnType<typeof spinner> | null = null\n let currentStep = ''\n\n const onProgress = (progress: ExportProgress) => {\n if (progress.step !== currentStep) {\n succeed()\n\n currentStep = progress.step\n currentSpinner = spinner(progress.step).start()\n } else if (progress.step === currentStep && progress.update && currentSpinner) {\n currentSpinner.text = `${progress.step} (${progress.current}/${progress.total})`\n }\n }\n\n const succeed = () => {\n currentSpinner?.succeed()\n }\n\n const fail = () => {\n currentSpinner?.fail()\n }\n\n return {fail, onProgress, succeed}\n }\n\n private async getOutputPath(\n destination: string,\n mediaLibraryId: string,\n flags: {overwrite?: boolean},\n ): Promise<string | Writable> {\n if (destination === '-') {\n return process.stdout\n }\n\n const dstPath = path.isAbsolute(destination)\n ? destination\n : path.resolve(process.cwd(), destination)\n\n const dstStats = await fs.stat(dstPath).catch(noop)\n const looksLikeFile = dstStats ? dstStats.isFile() : path.basename(dstPath).includes('.')\n\n if (!dstStats) {\n const createPath = looksLikeFile ? path.dirname(dstPath) : dstPath\n try {\n await fs.mkdir(createPath, {recursive: true})\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error))\n this.error(`Failed to create directory \"${createPath}\": ${err.message}`, {\n exit: 1,\n })\n }\n }\n\n const finalPath = looksLikeFile\n ? dstPath\n : path.join(dstPath, `${mediaLibraryId}-export.tar.gz`)\n const finalPathStats = await fs.stat(finalPath).catch(noop)\n\n if (!flags.overwrite && finalPathStats && finalPathStats.isFile()) {\n this.error(`File \"${finalPath}\" already exists. Use --overwrite flag to overwrite it.`, {\n exit: 1,\n })\n }\n\n return finalPath\n }\n\n private promptForDestination(options: {\n mediaLibraryId: string\n workDir?: string\n }): Promise<string> {\n const {mediaLibraryId, workDir = process.cwd()} = options\n\n const defaultPath = path.join(workDir, `${mediaLibraryId}-export.tar.gz`)\n\n return input({\n default: defaultPath,\n message: 'Output path:',\n transformer: (value: string) => absolutify(value.trim()),\n validate: (value: string) => {\n const trimmed = value.trim()\n if (!trimmed) {\n return 'Please provide a valid output path'\n }\n return true\n },\n })\n }\n}\n"],"names":["fs","path","Args","Flags","getProjectCliClient","SanityCommand","subdebug","boxen","input","spinner","exportDataset","prettyMs","promptForMediaLibrary","promptForProject","getMediaLibraries","absolutify","getProjectIdFlag","noop","exportDebug","MediaExportCommand","args","destination","string","description","examples","command","flags","semantics","integer","default","boolean","overwrite","run","parse","targetDestination","projectId","getProjectId","fallback","projectClient","apiVersion","requireUser","mediaLibraries","error","Error","message","exit","length","mediaLibraryId","some","library","id","log","padEnd","borderColor","borderStyle","destinationPath","promptForDestination","outputPath","getOutputPath","fail","onProgress","succeed","createProgressHandler","exportOptions","assetConcurrency","client","compress","start","Date","now","err","String","currentSpinner","currentStep","progress","step","update","text","current","total","process","stdout","dstPath","isAbsolute","resolve","cwd","dstStats","stat","catch","looksLikeFile","isFile","basename","includes","createPath","dirname","mkdir","recursive","finalPath","join","finalPathStats","options","workDir","defaultPath","transformer","value","trim","validate","trimmed"],"mappings":"AAAA,OAAOA,QAAQ,mBAAkB;AACjC,OAAOC,UAAU,YAAW;AAG5B,SAAQC,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,mBAAmB,EAAEC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AAC7E,SAAQC,KAAK,EAAEC,KAAK,EAAEC,OAAO,QAAO,sBAAqB;AACzD,SAAQC,aAAa,QAAgD,iBAAgB;AACrF,OAAOC,cAAc,YAAW;AAEhC,SAAQC,qBAAqB,QAAO,yCAAwC;AAC5E,SAAQC,gBAAgB,QAAO,oCAAmC;AAClE,SAAQC,iBAAiB,QAAO,mCAAkC;AAClE,SAAQC,UAAU,QAAO,2BAA0B;AACnD,SAAQC,gBAAgB,QAAO,4BAA2B;AAE1D,MAAMC,OAAO,IAAM;AACnB,MAAMC,cAAcZ,SAAS;AAE7B,OAAO,MAAMa,2BAA2Bd;IACtC,OAAgBe,OAAO;QACrBC,aAAanB,KAAKoB,MAAM,CAAC;YACvBC,aAAa;QACf;IACF,EAAC;IAED,OAAgBA,cACd,uJAAsJ;IAExJ,OAAgBC,WAAW;QACzB;YACEC,SAAS;YACTF,aAAa;QACf;QACA;YACEE,SAAS;YACTF,aAAa;QACf;QACA;YACEE,SAAS;YACTF,aAAa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AI;YAC7C,EAAE,OAAOtD,OAAO;gBACd,MAAM4B,MAAM5B,iBAAiBC,QAAQD,QAAQ,IAAIC,MAAM4B,OAAO7B;gBAC9D,IAAI,CAACA,KAAK,CAAC,CAAC,4BAA4B,EAAEmD,WAAW,GAAG,EAAEvB,IAAI1B,OAAO,EAAE,EAAE;oBACvEC,MAAM;gBACR;YACF;QACF;QAEA,MAAMoD,YAAYR,gBACdP,UACAjF,KAAKiG,IAAI,CAAChB,SAAS,GAAGnC,eAAe,cAAc,CAAC;QACxD,MAAMoD,iBAAiB,MAAMnG,GAAGuF,IAAI,CAACU,WAAWT,KAAK,CAACvE;QAEtD,IAAI,CAACS,MAAMK,SAAS,IAAIoE,kBAAkBA,eAAeT,MAAM,IAAI;YACjE,IAAI,CAAChD,KAAK,CAAC,CAAC,MAAM,EAAEuD,UAAU,uDAAuD,CAAC,EAAE;gBACtFpD,MAAM;YACR;QACF;QAEA,OAAOoD;IACT;IAEQzC,qBAAqB4C,OAG5B,EAAmB;QAClB,MAAM,EAACrD,cAAc,EAAEsD,UAAUrB,QAAQK,GAAG,EAAE,EAAC,GAAGe;QAElD,MAAME,cAAcrG,KAAKiG,IAAI,CAACG,SAAS,GAAGtD,eAAe,cAAc,CAAC;QAExE,OAAOvC,MAAM;YACXqB,SAASyE;YACT1D,SAAS;YACT2D,aAAa,CAACC,QAAkBzF,WAAWyF,MAAMC,IAAI;YACrDC,UAAU,CAACF;gBACT,MAAMG,UAAUH,MAAMC,IAAI;gBAC1B,IAAI,CAACE,SAAS;oBACZ,OAAO;gBACT;gBACA,OAAO;YACT;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/media/export.ts"],"sourcesContent":["import fs from 'node:fs/promises'\nimport path from 'node:path'\nimport {type Writable} from 'node:stream'\n\nimport {Args, Flags} from '@oclif/core'\nimport {getProjectCliClient, SanityCommand, subdebug} from '@sanity/cli-core'\nimport {boxen, input, spinner} from '@sanity/cli-core/ux'\nimport {exportDataset, type ExportOptions, type ExportProgress} from '@sanity/export'\nimport prettyMs from 'pretty-ms'\n\nimport {promptForMediaLibrary} from '../../prompts/promptForMediaLibrary.js'\nimport {promptForProject} from '../../prompts/promptForProject.js'\nimport {getMediaLibraries} from '../../services/mediaLibraries.js'\nimport {absolutify} from '../../util/absolutify.js'\nimport {getProjectIdFlag} from '../../util/sharedFlags.js'\n\nconst noop = () => null\nconst exportDebug = subdebug('media:export')\n\nexport class MediaExportCommand extends SanityCommand<typeof MediaExportCommand> {\n static override args = {\n destination: Args.string({\n description: 'Output destination file path',\n }),\n }\n\n static override description = 'Export file and image assets from a media library (excludes video)'\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Export media library interactively',\n },\n {\n command: '<%= config.bin %> <%= command.id %> output.tar.gz',\n description: 'Export media library to output.tar.gz',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --media-library-id my-library-id',\n description: 'Export specific media library',\n },\n ]\n\n static override flags = {\n ...getProjectIdFlag({\n description: 'Project ID to export media from',\n semantics: 'override',\n }),\n 'asset-concurrency': Flags.integer({\n default: 8,\n description: 'Concurrent number of asset downloads',\n }),\n 'media-library-id': Flags.string({\n description: 'The id of the target media library',\n }),\n 'no-compress': Flags.boolean({\n default: false,\n description: 'Skips compressing tarball entries (still generates a gzip file)',\n }),\n overwrite: Flags.boolean({\n default: false,\n description: 'Overwrite any file with the same name',\n }),\n }\n\n public async run(): Promise<void> {\n const {args, flags} = await this.parse(MediaExportCommand)\n const {destination: targetDestination} = args\n\n const projectId = await this.getProjectId({fallback: () => promptForProject({})})\n\n const projectClient = await getProjectCliClient({\n apiVersion: 'v2025-02-19',\n projectId,\n requireUser: true,\n })\n\n let mediaLibraries\n try {\n mediaLibraries = await getMediaLibraries(projectId)\n } catch (error) {\n exportDebug('Error listing media libraries', error)\n this.error(\n `Failed to list media libraries:\\n${error instanceof Error ? error.message : error}`,\n {\n exit: 1,\n },\n )\n }\n\n if (mediaLibraries.length === 0) {\n this.error('No active media libraries found in this project', {exit: 1})\n }\n\n let mediaLibraryId = flags['media-library-id']\n if (!mediaLibraryId) {\n try {\n mediaLibraryId = await promptForMediaLibrary({mediaLibraries})\n } catch (error) {\n exportDebug('Error selecting media library', error)\n this.error(\n `Failed to select media library:\\n${error instanceof Error ? error.message : error}`,\n {\n exit: 1,\n },\n )\n }\n }\n\n if (!mediaLibraries.some((library) => library.id === mediaLibraryId)) {\n this.error(`Media library with id \"${mediaLibraryId}\" not found`, {exit: 1})\n }\n\n this.log(\n boxen(\n `Exporting from:\nprojectId: ${projectId.padEnd(44)}\nmediaLibraryId: ${mediaLibraryId.padEnd(37)}`,\n {\n borderColor: 'yellow',\n borderStyle: 'round',\n },\n ),\n )\n\n let destinationPath = targetDestination\n if (!destinationPath) {\n destinationPath = await this.promptForDestination({mediaLibraryId})\n }\n\n const outputPath = await this.getOutputPath(destinationPath, mediaLibraryId, flags)\n if (!outputPath) {\n this.error('Cancelled', {exit: 1})\n }\n\n const {fail, onProgress, succeed} = this.createProgressHandler()\n const exportOptions: ExportOptions = {\n assetConcurrency: flags['asset-concurrency'],\n client: projectClient,\n compress: !flags['no-compress'],\n mediaLibraryId,\n onProgress,\n outputPath,\n }\n\n const start = Date.now()\n try {\n await exportDataset(exportOptions)\n succeed()\n this.log(`Export finished (${prettyMs(Date.now() - start)})`)\n } catch (error) {\n fail()\n const err = error instanceof Error ? error : new Error(String(error))\n exportDebug('Export failed', err)\n this.error(`Export failed: ${err.message}`, {exit: 1})\n }\n }\n\n private createProgressHandler() {\n let currentSpinner: ReturnType<typeof spinner> | null = null\n let currentStep = ''\n\n const onProgress = (progress: ExportProgress) => {\n if (progress.step !== currentStep) {\n succeed()\n\n currentStep = progress.step\n currentSpinner = spinner(progress.step).start()\n } else if (progress.step === currentStep && progress.update && currentSpinner) {\n currentSpinner.text = `${progress.step} (${progress.current}/${progress.total})`\n }\n }\n\n const succeed = () => {\n currentSpinner?.succeed()\n }\n\n const fail = () => {\n currentSpinner?.fail()\n }\n\n return {fail, onProgress, succeed}\n }\n\n private async getOutputPath(\n destination: string,\n mediaLibraryId: string,\n flags: {overwrite?: boolean},\n ): Promise<string | Writable> {\n if (destination === '-') {\n return process.stdout\n }\n\n const dstPath = path.isAbsolute(destination)\n ? destination\n : path.resolve(process.cwd(), destination)\n\n const dstStats = await fs.stat(dstPath).catch(noop)\n const looksLikeFile = dstStats ? dstStats.isFile() : path.basename(dstPath).includes('.')\n\n if (!dstStats) {\n const createPath = looksLikeFile ? path.dirname(dstPath) : dstPath\n try {\n await fs.mkdir(createPath, {recursive: true})\n } catch (error) {\n const err = error instanceof Error ? error : new Error(String(error))\n this.error(`Failed to create directory \"${createPath}\": ${err.message}`, {\n exit: 1,\n })\n }\n }\n\n const finalPath = looksLikeFile\n ? dstPath\n : path.join(dstPath, `${mediaLibraryId}-export.tar.gz`)\n const finalPathStats = await fs.stat(finalPath).catch(noop)\n\n if (!flags.overwrite && finalPathStats && finalPathStats.isFile()) {\n this.error(`File \"${finalPath}\" already exists. Use --overwrite flag to overwrite it.`, {\n exit: 1,\n })\n }\n\n return finalPath\n }\n\n private promptForDestination(options: {\n mediaLibraryId: string\n workDir?: string\n }): Promise<string> {\n const {mediaLibraryId, workDir = process.cwd()} = options\n\n const defaultPath = path.join(workDir, `${mediaLibraryId}-export.tar.gz`)\n\n return input({\n default: defaultPath,\n message: 'Output path:',\n transformer: (value: string) => absolutify(value.trim()),\n validate: (value: string) => {\n const trimmed = value.trim()\n if (!trimmed) {\n return 'Please provide a valid output path'\n }\n return true\n },\n })\n }\n}\n"],"names":["fs","path","Args","Flags","getProjectCliClient","SanityCommand","subdebug","boxen","input","spinner","exportDataset","prettyMs","promptForMediaLibrary","promptForProject","getMediaLibraries","absolutify","getProjectIdFlag","noop","exportDebug","MediaExportCommand","args","destination","string","description","examples","command","flags","semantics","integer","default","boolean","overwrite","run","parse","targetDestination","projectId","getProjectId","fallback","projectClient","apiVersion","requireUser","mediaLibraries","error","Error","message","exit","length","mediaLibraryId","some","library","id","log","padEnd","borderColor","borderStyle","destinationPath","promptForDestination","outputPath","getOutputPath","fail","onProgress","succeed","createProgressHandler","exportOptions","assetConcurrency","client","compress","start","Date","now","err","String","currentSpinner","currentStep","progress","step","update","text","current","total","process","stdout","dstPath","isAbsolute","resolve","cwd","dstStats","stat","catch","looksLikeFile","isFile","basename","includes","createPath","dirname","mkdir","recursive","finalPath","join","finalPathStats","options","workDir","defaultPath","transformer","value","trim","validate","trimmed"],"mappings":"AAAA,OAAOA,QAAQ,mBAAkB;AACjC,OAAOC,UAAU,YAAW;AAG5B,SAAQC,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,mBAAmB,EAAEC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AAC7E,SAAQC,KAAK,EAAEC,KAAK,EAAEC,OAAO,QAAO,sBAAqB;AACzD,SAAQC,aAAa,QAAgD,iBAAgB;AACrF,OAAOC,cAAc,YAAW;AAEhC,SAAQC,qBAAqB,QAAO,yCAAwC;AAC5E,SAAQC,gBAAgB,QAAO,oCAAmC;AAClE,SAAQC,iBAAiB,QAAO,mCAAkC;AAClE,SAAQC,UAAU,QAAO,2BAA0B;AACnD,SAAQC,gBAAgB,QAAO,4BAA2B;AAE1D,MAAMC,OAAO,IAAM;AACnB,MAAMC,cAAcZ,SAAS;AAE7B,OAAO,MAAMa,2BAA2Bd;IACtC,OAAgBe,OAAO;QACrBC,aAAanB,KAAKoB,MAAM,CAAC;YACvBC,aAAa;QACf;IACF,EAAC;IAED,OAAgBA,cAAc,qEAAoE;IAElG,OAAgBC,WAAW;QACzB;YACEC,SAAS;YACTF,aAAa;QACf;QACA;YACEE,SAAS;YACTF,aAAa;QACf;QACA;YACEE,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ;QACtB,GAAGV,iBAAiB;YAClBO,aAAa;YACbI,WAAW;QACb,EAAE;QACF,qBAAqBxB,MAAMyB,OAAO,CAAC;YACjCC,SAAS;YACTN,aAAa;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,WAAW,GAAG,EAAEvB,IAAI1B,OAAO,EAAE,EAAE;oBACvEC,MAAM;gBACR;YACF;QACF;QAEA,MAAMoD,YAAYR,gBACdP,UACAjF,KAAKiG,IAAI,CAAChB,SAAS,GAAGnC,eAAe,cAAc,CAAC;QACxD,MAAMoD,iBAAiB,MAAMnG,GAAGuF,IAAI,CAACU,WAAWT,KAAK,CAACvE;QAEtD,IAAI,CAACS,MAAMK,SAAS,IAAIoE,kBAAkBA,eAAeT,MAAM,IAAI;YACjE,IAAI,CAAChD,KAAK,CAAC,CAAC,MAAM,EAAEuD,UAAU,uDAAuD,CAAC,EAAE;gBACtFpD,MAAM;YACR;QACF;QAEA,OAAOoD;IACT;IAEQzC,qBAAqB4C,OAG5B,EAAmB;QAClB,MAAM,EAACrD,cAAc,EAAEsD,UAAUrB,QAAQK,GAAG,EAAE,EAAC,GAAGe;QAElD,MAAME,cAAcrG,KAAKiG,IAAI,CAACG,SAAS,GAAGtD,eAAe,cAAc,CAAC;QAExE,OAAOvC,MAAM;YACXqB,SAASyE;YACT1D,SAAS;YACT2D,aAAa,CAACC,QAAkBzF,WAAWyF,MAAMC,IAAI;YACrDC,UAAU,CAACF;gBACT,MAAMG,UAAUH,MAAMC,IAAI;gBAC1B,IAAI,CAACE,SAAS;oBACZ,OAAO;gBACT;gBACA,OAAO;YACT;QACF;IACF;AACF"}
@@ -10,7 +10,7 @@ export class PreviewCommand extends SanityCommand {
10
10
  })
11
11
  };
12
12
  static deprecateAliases = true;
13
- static description = 'Starts a server to preview a production build';
13
+ static description = 'Start a local server to preview a production build';
14
14
  static examples = [
15
15
  '<%= config.bin %> <%= command.id %> --host=0.0.0.0',
16
16
  '<%= config.bin %> <%= command.id %> --port=1942',
@@ -18,10 +18,10 @@ export class PreviewCommand extends SanityCommand {
18
18
  ];
19
19
  static flags = {
20
20
  host: Flags.string({
21
- description: '[default: localhost] The local network interface at which to listen.'
21
+ description: 'Local network interface to listen on (default: localhost)'
22
22
  }),
23
23
  port: Flags.string({
24
- description: '[default: 3333] TCP port to start server on.'
24
+ description: 'TCP port to start server on (default: 3333)'
25
25
  })
26
26
  };
27
27
  static hiddenAliases = [
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/commands/preview.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {Args, Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\n\nimport {previewAction} from '../actions/preview/previewAction.js'\nimport {type PreviewServer} from '../server/previewServer.js'\n\nexport const previewDebug = subdebug('preview')\n\nexport class PreviewCommand extends SanityCommand<typeof PreviewCommand> {\n static override args = {\n outputDir: Args.directory({description: 'Output directory'}),\n }\n\n static override deprecateAliases = true\n\n static override description = 'Starts a server to preview a production build'\n\n static override examples = [\n '<%= config.bin %> <%= command.id %> --host=0.0.0.0',\n '<%= config.bin %> <%= command.id %> --port=1942',\n '<%= config.bin %> <%= command.id %> some/build-output-dir',\n ]\n\n static override flags = {\n host: Flags.string({\n description: '[default: localhost] The local network interface at which to listen.',\n }),\n port: Flags.string({\n description: '[default: 3333] TCP port to start server on.',\n }),\n }\n static override hiddenAliases: string[] = ['start']\n\n public async run(): Promise<PreviewServer | void> {\n const {args, flags} = await this.parse(PreviewCommand)\n\n const workDir = (await this.getProjectRoot()).directory\n const cliConfig = await this.getCliConfig()\n\n const {outputDir} = args\n\n const defaultRootDir = path.resolve(path.join(workDir, 'dist'))\n const outDir = path.resolve(outputDir || defaultRootDir)\n\n try {\n return await previewAction({cliConfig, flags, outDir, workDir})\n } catch (error: unknown) {\n const suggestions =\n error instanceof Error && error.name === 'BUILD_NOT_FOUND'\n ? [\n '`sanity build` to create a production build',\n '`sanity dev` to run a development server',\n ]\n : undefined\n\n const message = error instanceof Error ? error.message : String(error)\n this.output.error(`Failed to start preview server: ${message}`, {\n exit: 1,\n suggestions,\n })\n }\n }\n}\n"],"names":["path","Args","Flags","SanityCommand","subdebug","previewAction","previewDebug","PreviewCommand","args","outputDir","directory","description","deprecateAliases","examples","flags","host","string","port","hiddenAliases","run","parse","workDir","getProjectRoot","cliConfig","getCliConfig","defaultRootDir","resolve","join","outDir","error","suggestions","Error","name","undefined","message","String","output","exit"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAE5B,SAAQC,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AAExD,SAAQC,aAAa,QAAO,sCAAqC;AAGjE,OAAO,MAAMC,eAAeF,SAAS,WAAU;AAE/C,OAAO,MAAMG,uBAAuBJ;IAClC,OAAgBK,OAAO;QACrBC,WAAWR,KAAKS,SAAS,CAAC;YAACC,aAAa;QAAkB;IAC5D,EAAC;IAED,OAAgBC,mBAAmB,KAAI;IAEvC,OAAgBD,cAAc,gDAA+C;IAE7E,OAAgBE,WAAW;QACzB;QACA;QACA;KACD,CAAA;IAED,OAAgBC,QAAQ;QACtBC,MAAMb,MAAMc,MAAM,CAAC;YACjBL,aAAa;QACf;QACAM,MAAMf,MAAMc,MAAM,CAAC;YACjBL,aAAa;QACf;IACF,EAAC;IACD,OAAgBO,gBAA0B;QAAC;KAAQ,CAAA;IAEnD,MAAaC,MAAqC;QAChD,MAAM,EAACX,IAAI,EAAEM,KAAK,EAAC,GAAG,MAAM,IAAI,CAACM,KAAK,CAACb;QAEvC,MAAMc,UAAU,AAAC,CAAA,MAAM,IAAI,CAACC,cAAc,EAAC,EAAGZ,SAAS;QACvD,MAAMa,YAAY,MAAM,IAAI,CAACC,YAAY;QAEzC,MAAM,EAACf,SAAS,EAAC,GAAGD;QAEpB,MAAMiB,iBAAiBzB,KAAK0B,OAAO,CAAC1B,KAAK2B,IAAI,CAACN,SAAS;QACvD,MAAMO,SAAS5B,KAAK0B,OAAO,CAACjB,aAAagB;QAEzC,IAAI;YACF,OAAO,MAAMpB,cAAc;gBAACkB;gBAAWT;gBAAOc;gBAAQP;YAAO;QAC/D,EAAE,OAAOQ,OAAgB;YACvB,MAAMC,cACJD,iBAAiBE,SAASF,MAAMG,IAAI,KAAK,oBACrC;gBACE;gBACA;aACD,GACDC;YAEN,MAAMC,UAAUL,iBAAiBE,QAAQF,MAAMK,OAAO,GAAGC,OAAON;YAChE,IAAI,CAACO,MAAM,CAACP,KAAK,CAAC,CAAC,gCAAgC,EAAEK,SAAS,EAAE;gBAC9DG,MAAM;gBACNP;YACF;QACF;IACF;AACF"}
1
+ {"version":3,"sources":["../../src/commands/preview.ts"],"sourcesContent":["import path from 'node:path'\n\nimport {Args, Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\n\nimport {previewAction} from '../actions/preview/previewAction.js'\nimport {type PreviewServer} from '../server/previewServer.js'\n\nexport const previewDebug = subdebug('preview')\n\nexport class PreviewCommand extends SanityCommand<typeof PreviewCommand> {\n static override args = {\n outputDir: Args.directory({description: 'Output directory'}),\n }\n\n static override deprecateAliases = true\n\n static override description = 'Start a local server to preview a production build'\n\n static override examples = [\n '<%= config.bin %> <%= command.id %> --host=0.0.0.0',\n '<%= config.bin %> <%= command.id %> --port=1942',\n '<%= config.bin %> <%= command.id %> some/build-output-dir',\n ]\n\n static override flags = {\n host: Flags.string({\n description: 'Local network interface to listen on (default: localhost)',\n }),\n port: Flags.string({\n description: 'TCP port to start server on (default: 3333)',\n }),\n }\n static override hiddenAliases: string[] = ['start']\n\n public async run(): Promise<PreviewServer | void> {\n const {args, flags} = await this.parse(PreviewCommand)\n\n const workDir = (await this.getProjectRoot()).directory\n const cliConfig = await this.getCliConfig()\n\n const {outputDir} = args\n\n const defaultRootDir = path.resolve(path.join(workDir, 'dist'))\n const outDir = path.resolve(outputDir || defaultRootDir)\n\n try {\n return await previewAction({cliConfig, flags, outDir, workDir})\n } catch (error: unknown) {\n const suggestions =\n error instanceof Error && error.name === 'BUILD_NOT_FOUND'\n ? [\n '`sanity build` to create a production build',\n '`sanity dev` to run a development server',\n ]\n : undefined\n\n const message = error instanceof Error ? error.message : String(error)\n this.output.error(`Failed to start preview server: ${message}`, {\n exit: 1,\n suggestions,\n })\n }\n }\n}\n"],"names":["path","Args","Flags","SanityCommand","subdebug","previewAction","previewDebug","PreviewCommand","args","outputDir","directory","description","deprecateAliases","examples","flags","host","string","port","hiddenAliases","run","parse","workDir","getProjectRoot","cliConfig","getCliConfig","defaultRootDir","resolve","join","outDir","error","suggestions","Error","name","undefined","message","String","output","exit"],"mappings":"AAAA,OAAOA,UAAU,YAAW;AAE5B,SAAQC,IAAI,EAAEC,KAAK,QAAO,cAAa;AACvC,SAAQC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AAExD,SAAQC,aAAa,QAAO,sCAAqC;AAGjE,OAAO,MAAMC,eAAeF,SAAS,WAAU;AAE/C,OAAO,MAAMG,uBAAuBJ;IAClC,OAAgBK,OAAO;QACrBC,WAAWR,KAAKS,SAAS,CAAC;YAACC,aAAa;QAAkB;IAC5D,EAAC;IAED,OAAgBC,mBAAmB,KAAI;IAEvC,OAAgBD,cAAc,qDAAoD;IAElF,OAAgBE,WAAW;QACzB;QACA;QACA;KACD,CAAA;IAED,OAAgBC,QAAQ;QACtBC,MAAMb,MAAMc,MAAM,CAAC;YACjBL,aAAa;QACf;QACAM,MAAMf,MAAMc,MAAM,CAAC;YACjBL,aAAa;QACf;IACF,EAAC;IACD,OAAgBO,gBAA0B;QAAC;KAAQ,CAAA;IAEnD,MAAaC,MAAqC;QAChD,MAAM,EAACX,IAAI,EAAEM,KAAK,EAAC,GAAG,MAAM,IAAI,CAACM,KAAK,CAACb;QAEvC,MAAMc,UAAU,AAAC,CAAA,MAAM,IAAI,CAACC,cAAc,EAAC,EAAGZ,SAAS;QACvD,MAAMa,YAAY,MAAM,IAAI,CAACC,YAAY;QAEzC,MAAM,EAACf,SAAS,EAAC,GAAGD;QAEpB,MAAMiB,iBAAiBzB,KAAK0B,OAAO,CAAC1B,KAAK2B,IAAI,CAACN,SAAS;QACvD,MAAMO,SAAS5B,KAAK0B,OAAO,CAACjB,aAAagB;QAEzC,IAAI;YACF,OAAO,MAAMpB,cAAc;gBAACkB;gBAAWT;gBAAOc;gBAAQP;YAAO;QAC/D,EAAE,OAAOQ,OAAgB;YACvB,MAAMC,cACJD,iBAAiBE,SAASF,MAAMG,IAAI,KAAK,oBACrC;gBACE;gBACA;aACD,GACDC;YAEN,MAAMC,UAAUL,iBAAiBE,QAAQF,MAAMK,OAAO,GAAGC,OAAON;YAChE,IAAI,CAACO,MAAM,CAACP,KAAK,CAAC,CAAC,gCAAgC,EAAEK,SAAS,EAAE;gBAC9DG,MAAM;gBACNP;YACF;QACF;IACF;AACF"}
@@ -13,7 +13,7 @@ const sortFields = [
13
13
  ];
14
14
  const projectsDebug = subdebug('projects');
15
15
  export class List extends SanityCommand {
16
- static description = 'Lists projects connected to your user';
16
+ static description = 'List your projects';
17
17
  static examples = [
18
18
  {
19
19
  command: '<%= config.bin %> <%= command.id %>',
@@ -21,12 +21,13 @@ export class List extends SanityCommand {
21
21
  },
22
22
  {
23
23
  command: '<%= config.bin %> <%= command.id %> --sort=members --order=asc',
24
- description: 'List all users of the project, but exclude pending invitations and robots'
24
+ description: 'List projects sorted by member count, ascending'
25
25
  }
26
26
  ];
27
27
  static flags = {
28
28
  order: Flags.string({
29
29
  default: 'desc',
30
+ description: 'Sort direction',
30
31
  options: [
31
32
  'asc',
32
33
  'desc'
@@ -34,6 +35,7 @@ export class List extends SanityCommand {
34
35
  }),
35
36
  sort: Flags.string({
36
37
  default: 'created',
38
+ description: 'Sort field',
37
39
  options: sortFields
38
40
  })
39
41
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/projects/list.ts"],"sourcesContent":["import {styleText} from 'node:util'\n\nimport {Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\nimport size from 'lodash-es/size.js'\nimport sortBy from 'lodash-es/sortBy.js'\n\nimport {listProjects} from '../../services/projects.js'\n\nconst sortFields = ['id', 'members', 'name', 'url', 'created']\n\nconst projectsDebug = subdebug('projects')\n\nexport class List extends SanityCommand<typeof List> {\n static override description = 'Lists projects connected to your user'\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'List projects',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --sort=members --order=asc',\n description: 'List all users of the project, but exclude pending invitations and robots',\n },\n ]\n\n static override flags = {\n order: Flags.string({\n default: 'desc',\n options: ['asc', 'desc'],\n }),\n sort: Flags.string({\n default: 'created',\n options: sortFields,\n }),\n }\n\n static override hiddenAliases: string[] = ['project:list']\n\n public async run() {\n const {order, sort} = this.flags\n\n try {\n const projects = await listProjects()\n const ordered = sortBy(\n projects.map(({createdAt, displayName, id, members = []}) => {\n const manage = `https://www.sanity.io/manage/project/${id}`\n return [id, members.length, displayName, manage, createdAt].map(String)\n }),\n [sortFields.indexOf(sort)],\n )\n\n const rows = order === 'asc' ? ordered : ordered.toReversed()\n\n // Initialize maxWidths with the width of each header\n const maxWidths = sortFields.map((str) => size(str))\n\n // Calculate maximum width for each column\n for (const row of rows) {\n for (const [i, element] of row.entries()) {\n maxWidths[i] = Math.max(size(element), maxWidths[i])\n }\n }\n\n const printRow = (row: string[]) =>\n row.map((col, i) => `${col}`.padEnd(maxWidths[i])).join(' ')\n\n this.log(styleText('cyan', printRow(sortFields)))\n for (const row of rows) this.log(printRow(row))\n } catch (error) {\n projectsDebug('Error listing projects', error)\n this.error('Failed to list projects', {exit: 1})\n }\n }\n}\n"],"names":["styleText","Flags","SanityCommand","subdebug","size","sortBy","listProjects","sortFields","projectsDebug","List","description","examples","command","flags","order","string","default","options","sort","hiddenAliases","run","projects","ordered","map","createdAt","displayName","id","members","manage","length","String","indexOf","rows","toReversed","maxWidths","str","row","i","element","entries","Math","max","printRow","col","padEnd","join","log","error","exit"],"mappings":"AAAA,SAAQA,SAAS,QAAO,YAAW;AAEnC,SAAQC,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AACxD,OAAOC,UAAU,oBAAmB;AACpC,OAAOC,YAAY,sBAAqB;A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GAAG,CAACrC,KAAKkC,UAAUJ,SAAS,CAACG,EAAE;gBACrD;YACF;YAEA,MAAMK,WAAW,CAACN,MAChBA,IAAIb,GAAG,CAAC,CAACoB,KAAKN,IAAM,GAAGM,KAAK,CAACC,MAAM,CAACV,SAAS,CAACG,EAAE,GAAGQ,IAAI,CAAC;YAE1D,IAAI,CAACC,GAAG,CAAC9C,UAAU,QAAQ0C,SAASnC;YACpC,KAAK,MAAM6B,OAAOJ,KAAM,IAAI,CAACc,GAAG,CAACJ,SAASN;QAC5C,EAAE,OAAOW,OAAO;YACdvC,cAAc,0BAA0BuC;YACxC,IAAI,CAACA,KAAK,CAAC,2BAA2B;gBAACC,MAAM;YAAC;QAChD;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/projects/list.ts"],"sourcesContent":["import {styleText} from 'node:util'\n\nimport {Flags} from '@oclif/core'\nimport {SanityCommand, subdebug} from '@sanity/cli-core'\nimport size from 'lodash-es/size.js'\nimport sortBy from 'lodash-es/sortBy.js'\n\nimport {listProjects} from '../../services/projects.js'\n\nconst sortFields = ['id', 'members', 'name', 'url', 'created']\n\nconst projectsDebug = subdebug('projects')\n\nexport class List extends SanityCommand<typeof List> {\n static override description = 'List your projects'\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'List projects',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --sort=members --order=asc',\n description: 'List projects sorted by member count, ascending',\n },\n ]\n\n static override flags = {\n order: Flags.string({\n default: 'desc',\n description: 'Sort direction',\n options: ['asc', 'desc'],\n }),\n sort: Flags.string({\n default: 'created',\n description: 'Sort field',\n options: sortFields,\n }),\n }\n\n static override hiddenAliases: string[] = ['project:list']\n\n public async run() {\n const {order, sort} = this.flags\n\n try {\n const projects = await listProjects()\n const ordered = sortBy(\n projects.map(({createdAt, displayName, id, members = []}) => {\n const manage = `https://www.sanity.io/manage/project/${id}`\n return [id, members.length, displayName, manage, createdAt].map(String)\n }),\n [sortFields.indexOf(sort)],\n )\n\n const rows = order === 'asc' ? ordered : ordered.toReversed()\n\n // Initialize maxWidths with the width of each header\n const maxWidths = sortFields.map((str) => size(str))\n\n // Calculate maximum width for each column\n for (const row of rows) {\n for (const [i, element] of row.entries()) {\n maxWidths[i] = Math.max(size(element), maxWidths[i])\n }\n }\n\n const printRow = (row: string[]) =>\n row.map((col, i) => `${col}`.padEnd(maxWidths[i])).join(' ')\n\n this.log(styleText('cyan', printRow(sortFields)))\n for (const row of rows) this.log(printRow(row))\n } catch (error) {\n projectsDebug('Error listing projects', error)\n this.error('Failed to list projects', {exit: 1})\n }\n }\n}\n"],"names":["styleText","Flags","SanityCommand","subdebug","size","sortBy","listProjects","sortFields","projectsDebug","List","description","examples","command","flags","order","string","default","options","sort","hiddenAliases","run","projects","ordered","map","createdAt","displayName","id","members","manage","length","String","indexOf","rows","toReversed","maxWidths","str","row","i","element","entries","Math","max","printRow","col","padEnd","join","log","error","exit"],"mappings":"AAAA,SAAQA,SAAS,QAAO,YAAW;AAEnC,SAAQC,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,EAAEC,QAAQ,QAAO,mBAAkB;AACxD,OAAOC,UAAU,oBAAmB;AACpC,OAAOC,YAAY,sBAAqB;AAExC,SAAQC,YAAY,QAAO,6BAA4B;AAEvD,MAAMC,aAAa;IAAC;IAAM;IAAW;IAAQ;IAAO;CAAU;AAE9D,MAAMC,gBAAgBL,SAAS;AAE/B,OAAO,MAAMM,aAAaP;IACxB,OAAgBQ,cAAc,qBAAoB;IAClD,OAAgBC,WAAW;QACzB;YACEC,SAAS;YACTF,aAAa;QACf;QACA;YACEE,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ;QACtBC,OAAOb,MAAMc,MAAM,CAAC;YAClBC,SAAS;YACTN,aAAa;YACbO,SAAS;gBAAC;gBAAO;aAAO;QAC1B;QACAC,MAAMjB,MAAMc,MAAM,CAAC;YACjBC,SAAS;YACTN,aAAa;YACbO,SAASV;QACX;IACF,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 -10,10 +10,9 @@ import { parseTag } from '../../actions/schema/utils/schemaStoreValidation.js';
10
10
  const description = `
11
11
  Deploy schema documents into workspace datasets.
12
12
 
13
- **Note**: This command is experimental and subject to change.
13
+ Note: This command is experimental and subject to change.
14
14
 
15
- This operation (re-)generates a manifest file describing the sanity config workspace by default.
16
- To re-use an existing manifest file, use --no-extract-manifest.
15
+ Regenerates a manifest file by default. To re-use an existing manifest, use --no-extract-manifest.
17
16
  `.trim();
18
17
  export class DeploySchemaCommand extends SanityCommand {
19
18
  static description = description;
@@ -31,7 +30,7 @@ export class DeploySchemaCommand extends SanityCommand {
31
30
  'extract-manifest': Flags.boolean({
32
31
  allowNo: true,
33
32
  default: true,
34
- description: 'Disables manifest generation - the command will fail if no manifest exists'
33
+ description: 'Regenerate manifest before deploying (use --no-extract-manifest to skip)'
35
34
  }),
36
35
  'manifest-dir': Flags.directory({
37
36
  default: './dist/static',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/schemas/deploy.ts"],"sourcesContent":["import {styleText} from 'node:util'\n\nimport {Flags} from '@oclif/core'\nimport {CLIError} from '@oclif/core/errors'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {deploySchemas} from '../../actions/schema/deploySchemas.js'\nimport {formatSchemaValidation} from '../../actions/schema/formatSchemaValidation.js'\nimport {schemasDeployDebug} from '../../actions/schema/utils/debug.js'\nimport {SchemaExtractionError} from '../../actions/schema/utils/SchemaExtractionError.js'\nimport {parseTag} from '../../actions/schema/utils/schemaStoreValidation.js'\n\nconst description = `\nDeploy schema documents into workspace datasets.\n\n**Note**: This command is experimental and subject to change.\n\nThis operation (re-)generates a manifest file describing the sanity config workspace by default.\nTo re-use an existing manifest file, use --no-extract-manifest.\n`.trim()\n\nexport class DeploySchemaCommand extends SanityCommand<typeof DeploySchemaCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Deploy all workspace schemas',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --workspace default',\n description: 'Deploy the schema for only the workspace \"default\"',\n },\n ]\n\n static override flags = {\n 'extract-manifest': Flags.boolean({\n allowNo: true,\n default: true,\n description: 'Disables manifest generation - the command will fail if no manifest exists',\n }),\n 'manifest-dir': Flags.directory({\n default: './dist/static',\n description: 'Directory containing manifest file',\n helpValue: '<directory>',\n }),\n tag: Flags.string({\n description: 'Add a tag suffix to the schema id',\n helpValue: '<tag>',\n parse: parseTag,\n }),\n verbose: Flags.boolean({\n default: false,\n description: 'Print detailed information during deployment',\n }),\n workspace: Flags.string({\n description: 'The name of the workspace to deploy a schema for',\n helpValue: '<name>',\n parse: async (input) => {\n if (!input) throw new CLIError('workspace argument cannot be empty if specified', {exit: 1})\n return input\n },\n }),\n }\n\n static override hiddenAliases: string[] = ['schema:deploy']\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(DeploySchemaCommand)\n const {tag, workspace} = flags\n\n try {\n const workDir = (await this.getProjectRoot()).directory\n\n await deploySchemas({\n tag,\n verbose: flags['verbose'],\n workDir,\n workspaceName: workspace,\n })\n\n this.log(\n `${styleText('gray', '↳ List deployed schemas with:')} ${styleText('cyan', 'sanity schema list')}`,\n )\n } catch (error) {\n if (\n error instanceof SchemaExtractionError &&\n error.validation &&\n error.validation.length > 0\n ) {\n this.output.log(formatSchemaValidation(error.validation))\n this.exit(1)\n }\n\n schemasDeployDebug('Failed to deploy schemas', error)\n const errorMessage = error instanceof Error ? error.message : String(error)\n this.error(`Failed to deploy schemas:\\n${errorMessage}`, {exit: 1})\n }\n }\n}\n"],"names":["styleText","Flags","CLIError","SanityCommand","deploySchemas","formatSchemaValidation","schemasDeployDebug","SchemaExtractionError","parseTag","description","trim","DeploySchemaCommand","examples","command","flags","boolean","allowNo","default","directory","helpValue","tag","string","parse","verbose","workspace","input","exit","hiddenAliases","run","workDir","getProjectRoot","workspaceName","log","error","validation","length","output","errorMessage","Error","message","String"],"mappings":"AAAA,SAAQA,SAAS,QAAO,YAAW;AAEnC,SAAQ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,CAACC,cAAc,EAAC,EAAGZ,SAAS;YAEvD,MAAMd,cAAc;gBAClBgB;gBACAG,SAAST,KAAK,CAAC,UAAU;gBACzBe;gBACAE,eAAeP;YACjB;YAEA,IAAI,CAACQ,GAAG,CACN,GAAGhC,UAAU,QAAQ,iCAAiC,CAAC,EAAEA,UAAU,QAAQ,uBAAuB;QAEtG,EAAE,OAAOiC,OAAO;YACd,IACEA,iBAAiB1B,yBACjB0B,MAAMC,UAAU,IAChBD,MAAMC,UAAU,CAACC,MAAM,GAAG,GAC1B;gBACA,IAAI,CAACC,MAAM,CAACJ,GAAG,CAAC3B,uBAAuB4B,MAAMC,UAAU;gBACvD,IAAI,CAACR,IAAI,CAAC;YACZ;YAEApB,mBAAmB,4BAA4B2B;YAC/C,MAAMI,eAAeJ,iBAAiBK,QAAQL,MAAMM,OAAO,GAAGC,OAAOP;YACrE,IAAI,CAACA,KAAK,CAAC,CAAC,2BAA2B,EAAEI,cAAc,EAAE;gBAACX,MAAM;YAAC;QACnE;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/schemas/deploy.ts"],"sourcesContent":["import {styleText} from 'node:util'\n\nimport {Flags} from '@oclif/core'\nimport {CLIError} from '@oclif/core/errors'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {deploySchemas} from '../../actions/schema/deploySchemas.js'\nimport {formatSchemaValidation} from '../../actions/schema/formatSchemaValidation.js'\nimport {schemasDeployDebug} from '../../actions/schema/utils/debug.js'\nimport {SchemaExtractionError} from '../../actions/schema/utils/SchemaExtractionError.js'\nimport {parseTag} from '../../actions/schema/utils/schemaStoreValidation.js'\n\nconst description = `\nDeploy schema documents into workspace datasets.\n\nNote: This command is experimental and subject to change.\n\nRegenerates a manifest file by default. To re-use an existing manifest, use --no-extract-manifest.\n`.trim()\n\nexport class DeploySchemaCommand extends SanityCommand<typeof DeploySchemaCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'Deploy all workspace schemas',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --workspace default',\n description: 'Deploy the schema for only the workspace \"default\"',\n },\n ]\n\n static override flags = {\n 'extract-manifest': Flags.boolean({\n allowNo: true,\n default: true,\n description: 'Regenerate manifest before deploying (use --no-extract-manifest to skip)',\n }),\n 'manifest-dir': Flags.directory({\n default: './dist/static',\n description: 'Directory containing manifest file',\n helpValue: '<directory>',\n }),\n tag: Flags.string({\n description: 'Add a tag suffix to the schema id',\n helpValue: '<tag>',\n parse: parseTag,\n }),\n verbose: Flags.boolean({\n default: false,\n description: 'Print detailed information during deployment',\n }),\n workspace: Flags.string({\n description: 'The name of the workspace to deploy a schema for',\n helpValue: '<name>',\n parse: async (input) => {\n if (!input) throw new CLIError('workspace argument cannot be empty if specified', {exit: 1})\n return input\n },\n }),\n }\n\n static override hiddenAliases: string[] = ['schema:deploy']\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(DeploySchemaCommand)\n const {tag, workspace} = flags\n\n try {\n const workDir = (await this.getProjectRoot()).directory\n\n await deploySchemas({\n tag,\n verbose: flags['verbose'],\n workDir,\n workspaceName: workspace,\n })\n\n this.log(\n `${styleText('gray', '↳ List deployed schemas with:')} ${styleText('cyan', 'sanity schema list')}`,\n )\n } catch (error) {\n if (\n error instanceof SchemaExtractionError &&\n error.validation &&\n error.validation.length > 0\n ) {\n this.output.log(formatSchemaValidation(error.validation))\n this.exit(1)\n }\n\n schemasDeployDebug('Failed to deploy schemas', error)\n const errorMessage = error instanceof Error ? error.message : String(error)\n this.error(`Failed to deploy schemas:\\n${errorMessage}`, {exit: 1})\n }\n }\n}\n"],"names":["styleText","Flags","CLIError","SanityCommand","deploySchemas","formatSchemaValidation","schemasDeployDebug","SchemaExtractionError","parseTag","description","trim","DeploySchemaCommand","examples","command","flags","boolean","allowNo","default","directory","helpValue","tag","string","parse","verbose","workspace","input","exit","hiddenAliases","run","workDir","getProjectRoot","workspaceName","log","error","validation","length","output","errorMessage","Error","message","String"],"mappings":"AAA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F,MAAMe,UAAU,AAAC,CAAA,MAAM,IAAI,CAACC,cAAc,EAAC,EAAGZ,SAAS;YAEvD,MAAMd,cAAc;gBAClBgB;gBACAG,SAAST,KAAK,CAAC,UAAU;gBACzBe;gBACAE,eAAeP;YACjB;YAEA,IAAI,CAACQ,GAAG,CACN,GAAGhC,UAAU,QAAQ,iCAAiC,CAAC,EAAEA,UAAU,QAAQ,uBAAuB;QAEtG,EAAE,OAAOiC,OAAO;YACd,IACEA,iBAAiB1B,yBACjB0B,MAAMC,UAAU,IAChBD,MAAMC,UAAU,CAACC,MAAM,GAAG,GAC1B;gBACA,IAAI,CAACC,MAAM,CAACJ,GAAG,CAAC3B,uBAAuB4B,MAAMC,UAAU;gBACvD,IAAI,CAACR,IAAI,CAAC;YACZ;YAEApB,mBAAmB,4BAA4B2B;YAC/C,MAAMI,eAAeJ,iBAAiBK,QAAQL,MAAMM,OAAO,GAAGC,OAAOP;YACrE,IAAI,CAACA,KAAK,CAAC,CAAC,2BAA2B,EAAEI,cAAc,EAAE;gBAACX,MAAM;YAAC;QACnE;IACF;AACF"}
@@ -4,9 +4,9 @@ import { extractSchema } from '../../actions/schema/extractSchema.js';
4
4
  import { getExtractOptions } from '../../actions/schema/getExtractOptions.js';
5
5
  import { watchExtractSchema } from '../../actions/schema/watchExtractSchema.js';
6
6
  const description = `
7
- Extracts a JSON representation of a Sanity schema within a Studio context.
7
+ Extract a JSON representation of a Sanity schema within a Studio context.
8
8
 
9
- **Note**: This command is experimental and subject to change.
9
+ Note: This command is experimental and subject to change.
10
10
  `.trim();
11
11
  export class ExtractSchemaCommand extends SanityCommand {
12
12
  static description = description;
@@ -30,7 +30,7 @@ export class ExtractSchemaCommand extends SanityCommand {
30
30
  }),
31
31
  format: Flags.string({
32
32
  default: 'groq-type-nodes',
33
- description: 'Format the schema as GROQ type nodes. Only available format at the moment.',
33
+ description: 'Output format (currently only groq-type-nodes)',
34
34
  helpValue: '<format>'
35
35
  }),
36
36
  path: Flags.string({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/schemas/extract.ts"],"sourcesContent":["import {Flags} from '@oclif/core'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {extractSchema} from '../../actions/schema/extractSchema.js'\nimport {getExtractOptions} from '../../actions/schema/getExtractOptions.js'\nimport {watchExtractSchema} from '../../actions/schema/watchExtractSchema.js'\n\nconst description = `\nExtracts a JSON representation of a Sanity schema within a Studio context.\n\n**Note**: This command is experimental and subject to change.\n`.trim()\n\nexport class ExtractSchemaCommand extends SanityCommand<typeof ExtractSchemaCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %> --workspace default',\n description: 'Extracts schema types in a Sanity project with more than one workspace',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --watch',\n description: 'Watch mode - re-extract on changes',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"',\n description: 'Watch with custom glob patterns',\n },\n ]\n\n static override flags = {\n 'enforce-required-fields': Flags.boolean({\n description: 'Makes the schema generated treat fields marked as required as non-optional',\n }),\n format: Flags.string({\n default: 'groq-type-nodes',\n description: 'Format the schema as GROQ type nodes. Only available format at the moment.',\n helpValue: '<format>',\n }),\n path: Flags.string({\n description: 'Optional path to specify destination of the schema file',\n }),\n watch: Flags.boolean({\n description: 'Enable watch mode to re-extract schema on file changes',\n }),\n 'watch-patterns': Flags.string({\n description: 'Additional glob pattern(s) to watch (can be specified multiple times)',\n helpValue: '<glob>',\n multiple: true,\n }),\n workspace: Flags.string({\n description: 'The name of the workspace to generate a schema for',\n helpValue: '<name>',\n }),\n }\n\n static override hiddenAliases: string[] = ['schema:extract']\n\n public async run(): Promise<{close?: () => Promise<void>} | void> {\n const {flags} = await this.parse(ExtractSchemaCommand)\n const projectRoot = await this.getProjectRoot()\n\n const {schemaExtraction} = await this.getCliConfig()\n const extractOptions = getExtractOptions({\n flags,\n projectRoot,\n schemaExtraction,\n })\n\n if (flags.watch) {\n return watchExtractSchema({\n extractOptions,\n output: this.output,\n })\n }\n\n return extractSchema({\n extractOptions,\n output: this.output,\n })\n }\n}\n"],"names":["Flags","SanityCommand","extractSchema","getExtractOptions","watchExtractSchema","description","trim","ExtractSchemaCommand","examples","command","flags","boolean","format","string","default","helpValue","path","watch","multiple","workspace","hiddenAliases","run","parse","projectRoot","getProjectRoot","schemaExtraction","getCliConfig","extractOptions","output"],"mappings":"AAAA,SAAQA,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,aAAa,QAAO,wCAAuC;AACnE,SAAQC,iBAAiB,QAAO,4CAA2C;AAC3E,SAAQC,kBAAkB,QAAO,6CAA4C;AAE7E,MAAMC,cAAc,CAAC;;;;AAIrB,CAAC,CAACC,IAAI;AAEN,OAAO,MAAMC,6BAA6BN;IACxC,OAAgBI,cAAcA,YAAW;IAEzC,OAAgBG,WAAW;QACzB;YACEC,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;KACD,CAAA;IAED,OAAgBK,QAAQ;QACtB,2BAA2BV,MAAMW,OAAO,CAAC;YACvCN,aAAa;QACf;QACAO,QAAQZ,MAAMa,MAAM,CAAC;YACnBC,SAAS;YACTT,aAAa;YACbU,WAAW;QACb;QACAC,MAAMhB,MAAMa,MAAM,CAAC;YACjBR,aAAa;QACf;QACAY,OAAOjB,MAAMW,OAAO,CAAC;YACnBN,aAAa;QACf;QACA,kBAAkBL,MAAMa,MAAM,CAAC;YAC7BR,aAAa;YACbU,WAAW;YACXG,UAAU;QACZ;QACAC,WAAWnB,MAAMa,MAAM,CAAC;YACtBR,aAAa;YACbU,WAAW;QACb;IACF,EAAC;IAED,OAAgBK,gBAA0B;QAAC;KAAiB,CAAA;IAE5D,MAAaC,MAAqD;QAChE,MAAM,EAACX,KAAK,EAAC,GAAG,MAAM,IAAI,CAACY,KAAK,CAACf;QACjC,MAAMgB,cAAc,MAAM,IAAI,CAACC,cAAc;QAE7C,MAAM,EAACC,gBAAgB,EAAC,GAAG,MAAM,IAAI,CAACC,YAAY;QAClD,MAAMC,iBAAiBxB,kBAAkB;YACvCO;YACAa;YACAE;QACF;QAEA,IAAIf,MAAMO,KAAK,EAAE;YACf,OAAOb,mBAAmB;gBACxBuB;gBACAC,QAAQ,IAAI,CAACA,MAAM;YACrB;QACF;QAEA,OAAO1B,cAAc;YACnByB;YACAC,QAAQ,IAAI,CAACA,MAAM;QACrB;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/schemas/extract.ts"],"sourcesContent":["import {Flags} from '@oclif/core'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {extractSchema} from '../../actions/schema/extractSchema.js'\nimport {getExtractOptions} from '../../actions/schema/getExtractOptions.js'\nimport {watchExtractSchema} from '../../actions/schema/watchExtractSchema.js'\n\nconst description = `\nExtract a JSON representation of a Sanity schema within a Studio context.\n\nNote: This command is experimental and subject to change.\n`.trim()\n\nexport class ExtractSchemaCommand extends SanityCommand<typeof ExtractSchemaCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %> --workspace default',\n description: 'Extracts schema types in a Sanity project with more than one workspace',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --watch',\n description: 'Watch mode - re-extract on changes',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --watch --watch-patterns \"lib/**/*.ts\"',\n description: 'Watch with custom glob patterns',\n },\n ]\n\n static override flags = {\n 'enforce-required-fields': Flags.boolean({\n description: 'Makes the schema generated treat fields marked as required as non-optional',\n }),\n format: Flags.string({\n default: 'groq-type-nodes',\n description: 'Output format (currently only groq-type-nodes)',\n helpValue: '<format>',\n }),\n path: Flags.string({\n description: 'Optional path to specify destination of the schema file',\n }),\n watch: Flags.boolean({\n description: 'Enable watch mode to re-extract schema on file changes',\n }),\n 'watch-patterns': Flags.string({\n description: 'Additional glob pattern(s) to watch (can be specified multiple times)',\n helpValue: '<glob>',\n multiple: true,\n }),\n workspace: Flags.string({\n description: 'The name of the workspace to generate a schema for',\n helpValue: '<name>',\n }),\n }\n\n static override hiddenAliases: string[] = ['schema:extract']\n\n public async run(): Promise<{close?: () => Promise<void>} | void> {\n const {flags} = await this.parse(ExtractSchemaCommand)\n const projectRoot = await this.getProjectRoot()\n\n const {schemaExtraction} = await this.getCliConfig()\n const extractOptions = getExtractOptions({\n flags,\n projectRoot,\n schemaExtraction,\n })\n\n if (flags.watch) {\n return watchExtractSchema({\n extractOptions,\n output: this.output,\n })\n }\n\n return extractSchema({\n extractOptions,\n output: this.output,\n })\n }\n}\n"],"names":["Flags","SanityCommand","extractSchema","getExtractOptions","watchExtractSchema","description","trim","ExtractSchemaCommand","examples","command","flags","boolean","format","string","default","helpValue","path","watch","multiple","workspace","hiddenAliases","run","parse","projectRoot","getProjectRoot","schemaExtraction","getCliConfig","extractOptions","output"],"mappings":"AAAA,SAAQA,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,aAAa,QAAO,wCAAuC;AACnE,SAAQC,iBAAiB,QAAO,4CAA2C;AAC3E,SAAQC,kBAAkB,QAAO,6CAA4C;AAE7E,MAAMC,cAAc,CAAC;;;;AAIrB,CAAC,CAACC,IAAI;AAEN,OAAO,MAAMC,6BAA6BN;IACxC,OAAgBI,cAAcA,YAAW;IAEzC,OAAgBG,WAAW;QACzB;YACEC,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;KACD,CAAA;IAED,OAAgBK,QAAQ;QACtB,2BAA2BV,MAAMW,OAAO,CAAC;YACvCN,aAAa;QACf;QACAO,QAAQZ,MAAMa,MAAM,CAAC;YACnBC,SAAS;YACTT,aAAa;YACbU,WAAW;QACb;QACAC,MAAMhB,MAAMa,MAAM,CAAC;YACjBR,aAAa;QACf;QACAY,OAAOjB,MAAMW,OAAO,CAAC;YACnBN,aAAa;QACf;QACA,kBAAkBL,MAAMa,MAAM,CAAC;YAC7BR,aAAa;YACbU,WAAW;YACXG,UAAU;QACZ;QACAC,WAAWnB,MAAMa,MAAM,CAAC;YACtBR,aAAa;YACbU,WAAW;QACb;IACF,EAAC;IAED,OAAgBK,gBAA0B;QAAC;KAAiB,CAAA;IAE5D,MAAaC,MAAqD;QAChE,MAAM,EAACX,KAAK,EAAC,GAAG,MAAM,IAAI,CAACY,KAAK,CAACf;QACjC,MAAMgB,cAAc,MAAM,IAAI,CAACC,cAAc;QAE7C,MAAM,EAACC,gBAAgB,EAAC,GAAG,MAAM,IAAI,CAACC,YAAY;QAClD,MAAMC,iBAAiBxB,kBAAkB;YACvCO;YACAa;YACAE;QACF;QAEA,IAAIf,MAAMO,KAAK,EAAE;YACf,OAAOb,mBAAmB;gBACxBuB;gBACAC,QAAQ,IAAI,CAACA,MAAM;YACrB;QACF;QAEA,OAAO1B,cAAc;YACnByB;YACAC,QAAQ,IAAI,CAACA,MAAM;QACrB;IACF;AACF"}
@@ -4,12 +4,11 @@ import { listSchemas } from '../../actions/schema/listSchemas.js';
4
4
  import { schemasListDebug } from '../../actions/schema/utils/debug.js';
5
5
  import { parseWorkspaceSchemaId } from '../../actions/schema/utils/schemaStoreValidation.js';
6
6
  const description = `
7
- Lists all schemas in the current dataset.
7
+ List all schemas in the current dataset.
8
8
 
9
- **Note**: This command is experimental and subject to change.
9
+ Note: This command is experimental and subject to change.
10
10
 
11
- This operation (re-)generates a manifest file describing the sanity config workspace by default.
12
- To re-use an existing manifest file, use --no-extract-manifest.
11
+ Regenerates a manifest file by default. To reuse an existing manifest, use --no-extract-manifest.
13
12
  `.trim();
14
13
  export class ListSchemaCommand extends SanityCommand {
15
14
  static description = description;
@@ -35,7 +34,7 @@ export class ListSchemaCommand extends SanityCommand {
35
34
  'extract-manifest': Flags.boolean({
36
35
  allowNo: true,
37
36
  default: true,
38
- description: 'Disables manifest generation - the command will fail if no manifest exists',
37
+ description: 'Regenerate manifest before listing (use --no-extract-manifest to skip)',
39
38
  hidden: true
40
39
  }),
41
40
  id: Flags.string({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/schemas/list.ts"],"sourcesContent":["import {Flags} from '@oclif/core'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {listSchemas} from '../../actions/schema/listSchemas.js'\nimport {schemasListDebug} from '../../actions/schema/utils/debug.js'\nimport {parseWorkspaceSchemaId} from '../../actions/schema/utils/schemaStoreValidation.js'\n\nconst description = `\nLists all schemas in the current dataset.\n\n**Note**: This command is experimental and subject to change.\n\nThis operation (re-)generates a manifest file describing the sanity config workspace by default.\nTo re-use an existing manifest file, use --no-extract-manifest.\n`.trim()\n\nexport class ListSchemaCommand extends SanityCommand<typeof ListSchemaCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'List all schemas found in any workspace dataset in a table',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName',\n description: 'Get a schema for a given id',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --json',\n description: 'Get stored schemas as pretty-printed json-array',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName',\n description: 'Get singular stored schema as pretty-printed json-object',\n },\n ]\n\n static override flags = {\n 'extract-manifest': Flags.boolean({\n allowNo: true,\n default: true,\n description: 'Disables manifest generation - the command will fail if no manifest exists',\n hidden: true,\n }),\n id: Flags.string({\n description: 'Fetch a single schema by id',\n helpValue: '<schema_id>',\n }),\n json: Flags.boolean({\n description: 'Get schema as json',\n }),\n 'manifest-dir': Flags.directory({\n default: './dist/static',\n description: 'Directory containing manifest file',\n helpValue: '<directory>',\n hidden: true,\n }),\n }\n\n static override hiddenAliases: string[] = ['schema:list']\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(ListSchemaCommand)\n\n try {\n const projectRoot = await this.getProjectRoot()\n\n const errors: string[] = []\n const id = parseWorkspaceSchemaId(errors, flags.id)?.schemaId\n if (errors.length > 0) {\n this.error(`Invalid arguments:\\n${errors.map((error) => ` - ${error}`).join('\\n')}`, {\n exit: 1,\n })\n }\n\n await listSchemas({\n configPath: projectRoot.path,\n id,\n json: !!flags.json,\n output: this.output,\n workDir: projectRoot.directory,\n })\n } catch (error) {\n schemasListDebug('Failed to list schemas', error)\n\n const errorMessage = error instanceof Error ? error.message : String(error)\n this.error(`Failed to list schemas:\\n${errorMessage}`, {exit: 1})\n }\n }\n}\n"],"names":["Flags","SanityCommand","listSchemas","schemasListDebug","parseWorkspaceSchemaId","description","trim","ListSchemaCommand","examples","command","flags","boolean","allowNo","default","hidden","id","string","helpValue","json","directory","hiddenAliases","run","parse","projectRoot","getProjectRoot","errors","schemaId","length","error","map","join","exit","configPath","path","output","workDir","errorMessage","Error","message","String"],"mappings":"AAAA,SAAQA,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,WAAW,QAAO,sCAAqC;AAC/D,SAAQC,gBAAgB,QAAO,sCAAqC;AACpE,SAAQC,sBAAsB,QAAO,sDAAqD;AAE1F,MAAMC,cAAc,CAAC;;;;;;;AAOrB,CAAC,CAACC,IAAI;AAEN,OAAO,MAAMC,0BAA0BN;IACrC,OAAgBI,cAAcA,YAAW;IAEzC,OAAgBG,WAAW;QACzB;YACEC,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;KACD,CAAA;IAED,OAAgBK,QAAQ;QACtB,oBAAoBV,MAAMW,OAAO,CAAC;YAChCC,SAAS;YACTC,SAAS;YACTR,aAAa;YACbS,QAAQ;QACV;QACAC,IAAIf,MAAMgB,MAAM,CAAC;YACfX,aAAa;YACbY,WAAW;QACb;QACAC,MAAMlB,MAAMW,OAAO,CAAC;YAClBN,aAAa;QACf;QACA,gBAAgBL,MAAMmB,SAAS,CAAC;YAC9BN,SAAS;YACTR,aAAa;YACbY,WAAW;YACXH,QAAQ;QACV;IACF,EAAC;IAED,OAAgBM,gBAA0B;QAAC;KAAc,CAAA;IAEzD,MAAaC,MAAqB;QAChC,MAAM,EAACX,KAAK,EAAC,GAAG,MAAM,IAAI,CAACY,KAAK,CAACf;QAEjC,IAAI;YACF,MAAMgB,cAAc,MAAM,IAAI,CAACC,cAAc;YAE7C,MAAMC,SAAmB,EAAE;YAC3B,MAAMV,KAAKX,uBAAuBqB,QAAQf,MAAMK,EAAE,GAAGW;YACrD,IAAID,OAAOE,MAAM,GAAG,GAAG;gBACrB,IAAI,CAACC,KAAK,CAAC,CAAC,oBAAoB,EAAEH,OAAOI,GAAG,CAAC,CAACD,QAAU,CAAC,IAAI,EAAEA,OAAO,EAAEE,IAAI,CAAC,OAAO,EAAE;oBACpFC,MAAM;gBACR;YACF;YAEA,MAAM7B,YAAY;gBAChB8B,YAAYT,YAAYU,IAAI;gBAC5BlB;gBACAG,MAAM,CAAC,CAACR,MAAMQ,IAAI;gBAClBgB,QAAQ,IAAI,CAACA,MAAM;gBACnBC,SAASZ,YAAYJ,SAAS;YAChC;QACF,EAAE,OAAOS,OAAO;YACdzB,iBAAiB,0BAA0ByB;YAE3C,MAAMQ,eAAeR,iBAAiBS,QAAQT,MAAMU,OAAO,GAAGC,OAAOX;YACrE,IAAI,CAACA,KAAK,CAAC,CAAC,yBAAyB,EAAEQ,cAAc,EAAE;gBAACL,MAAM;YAAC;QACjE;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/schemas/list.ts"],"sourcesContent":["import {Flags} from '@oclif/core'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {listSchemas} from '../../actions/schema/listSchemas.js'\nimport {schemasListDebug} from '../../actions/schema/utils/debug.js'\nimport {parseWorkspaceSchemaId} from '../../actions/schema/utils/schemaStoreValidation.js'\n\nconst description = `\nList all schemas in the current dataset.\n\nNote: This command is experimental and subject to change.\n\nRegenerates a manifest file by default. To reuse an existing manifest, use --no-extract-manifest.\n`.trim()\n\nexport class ListSchemaCommand extends SanityCommand<typeof ListSchemaCommand> {\n static override description = description\n\n static override examples = [\n {\n command: '<%= config.bin %> <%= command.id %>',\n description: 'List all schemas found in any workspace dataset in a table',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --id _.schemas.workspaceName',\n description: 'Get a schema for a given id',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --json',\n description: 'Get stored schemas as pretty-printed json-array',\n },\n {\n command: '<%= config.bin %> <%= command.id %> --json --id _.schemas.workspaceName',\n description: 'Get singular stored schema as pretty-printed json-object',\n },\n ]\n\n static override flags = {\n 'extract-manifest': Flags.boolean({\n allowNo: true,\n default: true,\n description: 'Regenerate manifest before listing (use --no-extract-manifest to skip)',\n hidden: true,\n }),\n id: Flags.string({\n description: 'Fetch a single schema by id',\n helpValue: '<schema_id>',\n }),\n json: Flags.boolean({\n description: 'Get schema as json',\n }),\n 'manifest-dir': Flags.directory({\n default: './dist/static',\n description: 'Directory containing manifest file',\n helpValue: '<directory>',\n hidden: true,\n }),\n }\n\n static override hiddenAliases: string[] = ['schema:list']\n\n public async run(): Promise<void> {\n const {flags} = await this.parse(ListSchemaCommand)\n\n try {\n const projectRoot = await this.getProjectRoot()\n\n const errors: string[] = []\n const id = parseWorkspaceSchemaId(errors, flags.id)?.schemaId\n if (errors.length > 0) {\n this.error(`Invalid arguments:\\n${errors.map((error) => ` - ${error}`).join('\\n')}`, {\n exit: 1,\n })\n }\n\n await listSchemas({\n configPath: projectRoot.path,\n id,\n json: !!flags.json,\n output: this.output,\n workDir: projectRoot.directory,\n })\n } catch (error) {\n schemasListDebug('Failed to list schemas', error)\n\n const errorMessage = error instanceof Error ? error.message : String(error)\n this.error(`Failed to list schemas:\\n${errorMessage}`, {exit: 1})\n }\n }\n}\n"],"names":["Flags","SanityCommand","listSchemas","schemasListDebug","parseWorkspaceSchemaId","description","trim","ListSchemaCommand","examples","command","flags","boolean","allowNo","default","hidden","id","string","helpValue","json","directory","hiddenAliases","run","parse","projectRoot","getProjectRoot","errors","schemaId","length","error","map","join","exit","configPath","path","output","workDir","errorMessage","Error","message","String"],"mappings":"AAAA,SAAQA,KAAK,QAAO,cAAa;AACjC,SAAQC,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,WAAW,QAAO,sCAAqC;AAC/D,SAAQC,gBAAgB,QAAO,sCAAqC;AACpE,SAAQC,sBAAsB,QAAO,sDAAqD;AAE1F,MAAMC,cAAc,CAAC;;;;;;AAMrB,CAAC,CAACC,IAAI;AAEN,OAAO,MAAMC,0BAA0BN;IACrC,OAAgBI,cAAcA,YAAW;IAEzC,OAAgBG,WAAW;QACzB;YACEC,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;QACA;YACEI,SAAS;YACTJ,aAAa;QACf;KACD,CAAA;IAED,OAAgBK,QAAQ;QACtB,oBAAoBV,MAAMW,OAAO,CAAC;YAChCC,SAAS;YACTC,SAAS;YACTR,aAAa;YACbS,QAAQ;QACV;QACAC,IAAIf,MAAMgB,MAAM,CAAC;YACfX,aAAa;YACbY,WAAW;QACb;QACAC,MAAMlB,MAAMW,OAAO,CAAC;YAClBN,aAAa;QACf;QACA,gBAAgBL,MAAMmB,SAAS,CAAC;YAC9BN,SAAS;YACTR,aAAa;YACbY,WAAW;YACXH,QAAQ;QACV;IACF,EAAC;IAED,OAAgBM,gBAA0B;QAAC;KAAc,CAAA;IAEzD,MAAaC,MAAqB;QAChC,MAAM,EAACX,KAAK,EAAC,GAAG,MAAM,IAAI,CAACY,KAAK,CAACf;QAEjC,IAAI;YACF,MAAMgB,cAAc,MAAM,IAAI,CAACC,cAAc;YAE7C,MAAMC,SAAmB,EAAE;YAC3B,MAAMV,KAAKX,uBAAuBqB,QAAQf,MAAMK,EAAE,GAAGW;YACrD,IAAID,OAAOE,MAAM,GAAG,GAAG;gBACrB,IAAI,CAACC,KAAK,CAAC,CAAC,oBAAoB,EAAEH,OAAOI,GAAG,CAAC,CAACD,QAAU,CAAC,IAAI,EAAEA,OAAO,EAAEE,IAAI,CAAC,OAAO,EAAE;oBACpFC,MAAM;gBACR;YACF;YAEA,MAAM7B,YAAY;gBAChB8B,YAAYT,YAAYU,IAAI;gBAC5BlB;gBACAG,MAAM,CAAC,CAACR,MAAMQ,IAAI;gBAClBgB,QAAQ,IAAI,CAACA,MAAM;gBACnBC,SAASZ,YAAYJ,SAAS;YAChC;QACF,EAAE,OAAOS,OAAO;YACdzB,iBAAiB,0BAA0ByB;YAE3C,MAAMQ,eAAeR,iBAAiBS,QAAQT,MAAMU,OAAO,GAAGC,OAAOX;YACrE,IAAI,CAACA,KAAK,CAAC,CAAC,yBAAyB,EAAEQ,cAAc,EAAE;gBAACL,MAAM;YAAC;QACjE;IACF;AACF"}
@@ -2,11 +2,11 @@ import { SanityCommand } from '@sanity/cli-core';
2
2
  import { setConsent } from '../../actions/telemetry/setConsent.js';
3
3
  import { telemetryLearnMoreMessage } from '../../actions/telemetry/telemetryLearnMoreMessage.js';
4
4
  export class Disable extends SanityCommand {
5
- static description = 'Disable telemetry for your logged in user';
5
+ static description = 'Disable telemetry for your account';
6
6
  static examples = [
7
7
  {
8
8
  command: '<%= config.bin %> telemetry <%= command.id %>',
9
- description: 'Disable telemetry for your logged in user'
9
+ description: 'Disable telemetry for your account'
10
10
  }
11
11
  ];
12
12
  static flags = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/telemetry/disable.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {type FlagInput} from '@oclif/core/interfaces'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {setConsent} from '../../actions/telemetry/setConsent.js'\nimport {telemetryLearnMoreMessage} from '../../actions/telemetry/telemetryLearnMoreMessage.js'\n\nexport class Disable extends SanityCommand<typeof Disable> {\n static override description = 'Disable telemetry for your logged in user'\n\n static override examples: Array<Command.Example> = [\n {\n command: '<%= config.bin %> telemetry <%= command.id %>',\n description: 'Disable telemetry for your logged in user',\n },\n ]\n\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(Disable)\n\n try {\n const result = await setConsent({\n status: 'denied',\n })\n\n this.log(result.message)\n\n if (result.changed) {\n this.log(`\\n${telemetryLearnMoreMessage('denied')}`)\n }\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : 'An unknown error occurred'\n this.error(message, {exit: 1})\n }\n }\n}\n"],"names":["SanityCommand","setConsent","telemetryLearnMoreMessage","Disable","description","examples","command","flags","run","parse","result","status","log","message","changed","err","Error","error","exit"],"mappings":"AAEA,SAAQA,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,UAAU,QAAO,wCAAuC;AAChE,SAAQC,yBAAyB,QAAO,uDAAsD;AAE9F,OAAO,MAAMC,gBAAgBH;IAC3B,OAAgBI,cAAc,4CAA2C;IAEzE,OAAgBC,WAAmC;QACjD;YACEC,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACN;QAEjB,IAAI;YACF,MAAMO,SAAS,MAAMT,WAAW;gBAC9BU,QAAQ;YACV;YAEA,IAAI,CAACC,GAAG,CAACF,OAAOG,OAAO;YAEvB,IAAIH,OAAOI,OAAO,EAAE;gBAClB,IAAI,CAACF,GAAG,CAAC,CAAC,EAAE,EAAEV,0BAA0B,WAAW;YACrD;QACF,EAAE,OAAOa,KAAc;YACrB,MAAMF,UAAUE,eAAeC,QAAQD,IAAIF,OAAO,GAAG;YACrD,IAAI,CAACI,KAAK,CAACJ,SAAS;gBAACK,MAAM;YAAC;QAC9B;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/telemetry/disable.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {type FlagInput} from '@oclif/core/interfaces'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {setConsent} from '../../actions/telemetry/setConsent.js'\nimport {telemetryLearnMoreMessage} from '../../actions/telemetry/telemetryLearnMoreMessage.js'\n\nexport class Disable extends SanityCommand<typeof Disable> {\n static override description = 'Disable telemetry for your account'\n\n static override examples: Array<Command.Example> = [\n {\n command: '<%= config.bin %> telemetry <%= command.id %>',\n description: 'Disable telemetry for your account',\n },\n ]\n\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(Disable)\n\n try {\n const result = await setConsent({\n status: 'denied',\n })\n\n this.log(result.message)\n\n if (result.changed) {\n this.log(`\\n${telemetryLearnMoreMessage('denied')}`)\n }\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : 'An unknown error occurred'\n this.error(message, {exit: 1})\n }\n }\n}\n"],"names":["SanityCommand","setConsent","telemetryLearnMoreMessage","Disable","description","examples","command","flags","run","parse","result","status","log","message","changed","err","Error","error","exit"],"mappings":"AAEA,SAAQA,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,UAAU,QAAO,wCAAuC;AAChE,SAAQC,yBAAyB,QAAO,uDAAsD;AAE9F,OAAO,MAAMC,gBAAgBH;IAC3B,OAAgBI,cAAc,qCAAoC;IAElE,OAAgBC,WAAmC;QACjD;YACEC,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACN;QAEjB,IAAI;YACF,MAAMO,SAAS,MAAMT,WAAW;gBAC9BU,QAAQ;YACV;YAEA,IAAI,CAACC,GAAG,CAACF,OAAOG,OAAO;YAEvB,IAAIH,OAAOI,OAAO,EAAE;gBAClB,IAAI,CAACF,GAAG,CAAC,CAAC,EAAE,EAAEV,0BAA0B,WAAW;YACrD;QACF,EAAE,OAAOa,KAAc;YACrB,MAAMF,UAAUE,eAAeC,QAAQD,IAAIF,OAAO,GAAG;YACrD,IAAI,CAACI,KAAK,CAACJ,SAAS;gBAACK,MAAM;YAAC;QAC9B;IACF;AACF"}
@@ -2,11 +2,11 @@ import { SanityCommand } from '@sanity/cli-core';
2
2
  import { setConsent } from '../../actions/telemetry/setConsent.js';
3
3
  import { telemetryLearnMoreMessage } from '../../actions/telemetry/telemetryLearnMoreMessage.js';
4
4
  export class Enable extends SanityCommand {
5
- static description = 'Enable telemetry for your logged in user';
5
+ static description = 'Enable telemetry for your account';
6
6
  static examples = [
7
7
  {
8
8
  command: '<%= config.bin %> telemetry <%= command.id %>',
9
- description: 'Enable telemetry for your logged in user'
9
+ description: 'Enable telemetry for your account'
10
10
  }
11
11
  ];
12
12
  static flags = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/telemetry/enable.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {type FlagInput} from '@oclif/core/interfaces'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {setConsent} from '../../actions/telemetry/setConsent.js'\nimport {telemetryLearnMoreMessage} from '../../actions/telemetry/telemetryLearnMoreMessage.js'\n\nexport class Enable extends SanityCommand<typeof Enable> {\n static override description = 'Enable telemetry for your logged in user'\n\n static override examples: Array<Command.Example> = [\n {\n command: '<%= config.bin %> telemetry <%= command.id %>',\n description: 'Enable telemetry for your logged in user',\n },\n ]\n\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(Enable)\n\n try {\n const result = await setConsent({\n status: 'granted',\n })\n\n this.log(result.message)\n\n if (result.changed) {\n this.log(`\\n${telemetryLearnMoreMessage('granted')}`)\n }\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : 'An unknown error occurred'\n this.error(message, {exit: 1})\n }\n }\n}\n"],"names":["SanityCommand","setConsent","telemetryLearnMoreMessage","Enable","description","examples","command","flags","run","parse","result","status","log","message","changed","err","Error","error","exit"],"mappings":"AAEA,SAAQA,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,UAAU,QAAO,wCAAuC;AAChE,SAAQC,yBAAyB,QAAO,uDAAsD;AAE9F,OAAO,MAAMC,eAAeH;IAC1B,OAAgBI,cAAc,2CAA0C;IAExE,OAAgBC,WAAmC;QACjD;YACEC,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACN;QAEjB,IAAI;YACF,MAAMO,SAAS,MAAMT,WAAW;gBAC9BU,QAAQ;YACV;YAEA,IAAI,CAACC,GAAG,CAACF,OAAOG,OAAO;YAEvB,IAAIH,OAAOI,OAAO,EAAE;gBAClB,IAAI,CAACF,GAAG,CAAC,CAAC,EAAE,EAAEV,0BAA0B,YAAY;YACtD;QACF,EAAE,OAAOa,KAAc;YACrB,MAAMF,UAAUE,eAAeC,QAAQD,IAAIF,OAAO,GAAG;YACrD,IAAI,CAACI,KAAK,CAACJ,SAAS;gBAACK,MAAM;YAAC;QAC9B;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/telemetry/enable.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {type FlagInput} from '@oclif/core/interfaces'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {setConsent} from '../../actions/telemetry/setConsent.js'\nimport {telemetryLearnMoreMessage} from '../../actions/telemetry/telemetryLearnMoreMessage.js'\n\nexport class Enable extends SanityCommand<typeof Enable> {\n static override description = 'Enable telemetry for your account'\n\n static override examples: Array<Command.Example> = [\n {\n command: '<%= config.bin %> telemetry <%= command.id %>',\n description: 'Enable telemetry for your account',\n },\n ]\n\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(Enable)\n\n try {\n const result = await setConsent({\n status: 'granted',\n })\n\n this.log(result.message)\n\n if (result.changed) {\n this.log(`\\n${telemetryLearnMoreMessage('granted')}`)\n }\n } catch (err: unknown) {\n const message = err instanceof Error ? err.message : 'An unknown error occurred'\n this.error(message, {exit: 1})\n }\n }\n}\n"],"names":["SanityCommand","setConsent","telemetryLearnMoreMessage","Enable","description","examples","command","flags","run","parse","result","status","log","message","changed","err","Error","error","exit"],"mappings":"AAEA,SAAQA,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,UAAU,QAAO,wCAAuC;AAChE,SAAQC,yBAAyB,QAAO,uDAAsD;AAE9F,OAAO,MAAMC,eAAeH;IAC1B,OAAgBI,cAAc,oCAAmC;IAEjE,OAAgBC,WAAmC;QACjD;YACEC,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACN;QAEjB,IAAI;YACF,MAAMO,SAAS,MAAMT,WAAW;gBAC9BU,QAAQ;YACV;YAEA,IAAI,CAACC,GAAG,CAACF,OAAOG,OAAO;YAEvB,IAAIH,OAAOI,OAAO,EAAE;gBAClB,IAAI,CAACF,GAAG,CAAC,CAAC,EAAE,EAAEV,0BAA0B,YAAY;YACtD;QACF,EAAE,OAAOa,KAAc;YACrB,MAAMF,UAAUE,eAAeC,QAAQD,IAAIF,OAAO,GAAG;YACrD,IAAI,CAACI,KAAK,CAACJ,SAAS;gBAACK,MAAM;YAAC;QAC9B;IACF;AACF"}
@@ -3,11 +3,11 @@ import { getLearnMoreMessage } from '../../actions/telemetry/getLearnMoreMessage
3
3
  import { getStatusMessage } from '../../actions/telemetry/getStatusMessage.js';
4
4
  import { resolveConsent } from '../../actions/telemetry/resolveConsent.js';
5
5
  export class Status extends SanityCommand {
6
- static description = 'Check telemetry consent status for your logged in user';
6
+ static description = 'Check telemetry status for your account';
7
7
  static examples = [
8
8
  {
9
9
  command: '<%= config.bin %> telemetry <%= command.id %>',
10
- description: 'Check telemetry consent status for your logged in user'
10
+ description: 'Check telemetry status for your account'
11
11
  }
12
12
  ];
13
13
  static flags = {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/commands/telemetry/status.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {type FlagInput} from '@oclif/core/interfaces'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {getLearnMoreMessage} from '../../actions/telemetry/getLearnMoreMessage.js'\nimport {getStatusMessage} from '../../actions/telemetry/getStatusMessage.js'\nimport {resolveConsent} from '../../actions/telemetry/resolveConsent.js'\n\nexport class Status extends SanityCommand<typeof Status> {\n static override description = 'Check telemetry consent status for your logged in user'\n\n static override examples: Array<Command.Example> = [\n {\n command: '<%= config.bin %> telemetry <%= command.id %>',\n description: 'Check telemetry consent status for your logged in user',\n },\n ]\n\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(Status)\n\n const consentInfo = await resolveConsent()\n\n const statusMessage = getStatusMessage(consentInfo)\n const learnMoreMessage = getLearnMoreMessage(consentInfo.status)\n\n this.log(statusMessage)\n this.log(`\\n${learnMoreMessage}`)\n }\n}\n"],"names":["SanityCommand","getLearnMoreMessage","getStatusMessage","resolveConsent","Status","description","examples","command","flags","run","parse","consentInfo","statusMessage","learnMoreMessage","status","log"],"mappings":"AAEA,SAAQA,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,mBAAmB,QAAO,iDAAgD;AAClF,SAAQC,gBAAgB,QAAO,8CAA6C;AAC5E,SAAQC,cAAc,QAAO,4CAA2C;AAExE,OAAO,MAAMC,eAAeJ;IAC1B,OAAgBK,cAAc,yDAAwD;IAEtF,OAAgBC,WAAmC;QACjD;YACEC,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACN;QAEjB,MAAMO,cAAc,MAAMR;QAE1B,MAAMS,gBAAgBV,iBAAiBS;QACvC,MAAME,mBAAmBZ,oBAAoBU,YAAYG,MAAM;QAE/D,IAAI,CAACC,GAAG,CAACH;QACT,IAAI,CAACG,GAAG,CAAC,CAAC,EAAE,EAAEF,kBAAkB;IAClC;AACF"}
1
+ {"version":3,"sources":["../../../src/commands/telemetry/status.ts"],"sourcesContent":["import {Command} from '@oclif/core'\nimport {type FlagInput} from '@oclif/core/interfaces'\nimport {SanityCommand} from '@sanity/cli-core'\n\nimport {getLearnMoreMessage} from '../../actions/telemetry/getLearnMoreMessage.js'\nimport {getStatusMessage} from '../../actions/telemetry/getStatusMessage.js'\nimport {resolveConsent} from '../../actions/telemetry/resolveConsent.js'\n\nexport class Status extends SanityCommand<typeof Status> {\n static override description = 'Check telemetry status for your account'\n\n static override examples: Array<Command.Example> = [\n {\n command: '<%= config.bin %> telemetry <%= command.id %>',\n description: 'Check telemetry status for your account',\n },\n ]\n\n static override flags = {} satisfies FlagInput\n\n public async run(): Promise<void> {\n // Parse to ensure no invalid flags are passed\n await this.parse(Status)\n\n const consentInfo = await resolveConsent()\n\n const statusMessage = getStatusMessage(consentInfo)\n const learnMoreMessage = getLearnMoreMessage(consentInfo.status)\n\n this.log(statusMessage)\n this.log(`\\n${learnMoreMessage}`)\n }\n}\n"],"names":["SanityCommand","getLearnMoreMessage","getStatusMessage","resolveConsent","Status","description","examples","command","flags","run","parse","consentInfo","statusMessage","learnMoreMessage","status","log"],"mappings":"AAEA,SAAQA,aAAa,QAAO,mBAAkB;AAE9C,SAAQC,mBAAmB,QAAO,iDAAgD;AAClF,SAAQC,gBAAgB,QAAO,8CAA6C;AAC5E,SAAQC,cAAc,QAAO,4CAA2C;AAExE,OAAO,MAAMC,eAAeJ;IAC1B,OAAgBK,cAAc,0CAAyC;IAEvE,OAAgBC,WAAmC;QACjD;YACEC,SAAS;YACTF,aAAa;QACf;KACD,CAAA;IAED,OAAgBG,QAAQ,CAAC,EAAqB;IAE9C,MAAaC,MAAqB;QAChC,8CAA8C;QAC9C,MAAM,IAAI,CAACC,KAAK,CAACN;QAEjB,MAAMO,cAAc,MAAMR;QAE1B,MAAMS,gBAAgBV,iBAAiBS;QACvC,MAAME,mBAAmBZ,oBAAoBU,YAAYG,MAAM;QAE/D,IAAI,CAACC,GAAG,CAACH;QACT,IAAI,CAACG,GAAG,CAAC,CAAC,EAAE,EAAEF,kBAAkB;IAClC;AACF"}
@@ -13,7 +13,7 @@ export class AddTokenCommand extends SanityCommand {
13
13
  required: false
14
14
  })
15
15
  };
16
- static description = 'Create a new API token for this project';
16
+ static description = 'Create a new API token for the project';
17
17
  static examples = [
18
18
  {
19
19
  command: '<%= config.bin %> <%= command.id %> "My API Token"',