@sanity/cli 3.59.2-canary.33 → 3.59.2-corel-presentation-lcapi.562

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 (48) hide show
  1. package/lib/_chunks-cjs/cli.js +34360 -26058
  2. package/lib/_chunks-cjs/cli.js.map +1 -1
  3. package/lib/_chunks-cjs/cliWorker.js.map +1 -1
  4. package/lib/_chunks-cjs/generateAction.js.map +1 -1
  5. package/lib/_chunks-cjs/getCliConfig.js +1 -1
  6. package/lib/_chunks-cjs/getCliConfig.js.map +1 -1
  7. package/lib/_chunks-cjs/journeyConfig.js.map +1 -1
  8. package/lib/_chunks-cjs/loadEnv.js +200 -202
  9. package/lib/_chunks-cjs/loadEnv.js.map +1 -1
  10. package/lib/index.d.mts +37 -1
  11. package/lib/index.d.ts +37 -1
  12. package/lib/index.esm.js +223 -224
  13. package/lib/index.esm.js.map +1 -1
  14. package/lib/index.js.map +1 -1
  15. package/lib/index.mjs +223 -224
  16. package/lib/index.mjs.map +1 -1
  17. package/lib/workers/getCliConfig.js.map +1 -1
  18. package/lib/workers/typegenGenerate.js.map +1 -1
  19. package/package.json +17 -19
  20. package/src/CommandRunner.ts +1 -2
  21. package/src/actions/init-project/{bootstrapTemplate.ts → bootstrapLocalTemplate.ts} +8 -21
  22. package/src/actions/init-project/bootstrapRemoteTemplate.ts +118 -0
  23. package/src/actions/init-project/git.ts +2 -2
  24. package/src/actions/init-project/initProject.ts +158 -146
  25. package/src/actions/init-project/readPackageJson.ts +18 -0
  26. package/src/actions/init-project/templates/nextjs/index.ts +16 -0
  27. package/src/actions/init-project/templates/nextjs/schemaTypes/blog.ts +2 -2
  28. package/src/actions/init-project/updateInitialTemplateMetadata.ts +24 -0
  29. package/src/actions/login/login.ts +2 -3
  30. package/src/actions/versions/findSanityModuleVersions.ts +0 -1
  31. package/src/commands/index.ts +2 -2
  32. package/src/commands/init/initCommand.ts +7 -67
  33. package/src/commands/learn/learnCommand.ts +20 -0
  34. package/src/commands/logout/logoutCommand.ts +1 -1
  35. package/src/outputters/cliOutputter.ts +21 -8
  36. package/src/studioDependencies.ts +1 -1
  37. package/src/types.ts +41 -1
  38. package/src/util/frameworkPort.ts +63 -0
  39. package/src/util/generateCommandsDocumentation.ts +7 -4
  40. package/src/util/getCliConfig.ts +1 -1
  41. package/src/util/getProviderName.ts +9 -0
  42. package/src/util/remoteTemplate.ts +320 -0
  43. package/templates/get-started/plugins/sanity-plugin-tutorial/GetStartedTutorial.tsx +4 -4
  44. package/src/actions/init-plugin/initPlugin.ts +0 -119
  45. package/src/actions/init-plugin/pluginTemplates.ts +0 -38
  46. package/src/actions/init-project/reconfigureV2Project.ts +0 -446
  47. package/src/commands/upgrade/upgradeCommand.ts +0 -38
  48. package/src/commands/upgrade/upgradeDependencies.ts +0 -289
package/lib/index.d.mts CHANGED
@@ -21,7 +21,6 @@ export declare interface CliBaseCommandContext {
21
21
  output: CliOutputter
22
22
  prompt: CliPrompter
23
23
  apiClient: CliApiClient
24
- yarn: CliStubbedYarn
25
24
  sanityMajorVersion: 2 | 3
26
25
  cliConfigPath?: string
27
26
  cliRoot: string
@@ -101,6 +100,12 @@ export declare interface CliConfig {
101
100
  * Defaults to `false`
102
101
  */
103
102
  reactStrictMode?: boolean
103
+ /**
104
+ * The React Compiler is currently in beta, and is disabled by default.
105
+ * @see https://react.dev/learn/react-compiler
106
+ * @beta
107
+ */
108
+ reactCompiler?: ReactCompilerConfig
104
109
  server?: {
105
110
  hostname?: string
106
111
  port?: number
@@ -144,6 +149,7 @@ declare type CliMajorVersion = 2 | 3
144
149
 
145
150
  export declare interface CliOutputter {
146
151
  print: (...args: unknown[]) => void
152
+ success: (...args: unknown[]) => void
147
153
  warn: (...args: unknown[]) => void
148
154
  error: (...args: unknown[]) => void
149
155
  clear: () => void
@@ -366,6 +372,27 @@ export declare interface PackageJson {
366
372
 
367
373
  declare type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'manual'
368
374
 
375
+ /**
376
+ * Until these types are on npm: https://github.com/facebook/react/blob/0bc30748730063e561d87a24a4617526fdd38349/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L39-L122
377
+ * @beta
378
+ */
379
+ export declare interface ReactCompilerConfig {
380
+ /**
381
+ * @see https://react.dev/learn/react-compiler#existing-projects
382
+ */
383
+ sources?: Array<string> | ((filename: string) => boolean) | null
384
+ /**
385
+ * The minimum major version of React that the compiler should emit code for. If the target is 19
386
+ * or higher, the compiler emits direct imports of React runtime APIs needed by the compiler. On
387
+ * versions prior to 19, an extra runtime package react-compiler-runtime is necessary to provide
388
+ * a userspace approximation of runtime APIs.
389
+ * @see https://react.dev/learn/react-compiler#using-react-compiler-with-react-17-or-18
390
+ */
391
+ target: '18' | '19'
392
+ panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'
393
+ compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all'
394
+ }
395
+
369
396
  export declare interface ResolvedCliCommand {
370
397
  command: CliCommandDefinition | CliCommandGroupDefinition
371
398
  commandName: string
@@ -418,6 +445,15 @@ export declare interface SanityModuleInternal {
418
445
  }
419
446
  }
420
447
 
448
+ export declare type SanityUser = {
449
+ id: string
450
+ name: string
451
+ email: string
452
+ profileImage?: string
453
+ tosAcceptedAt?: string
454
+ provider: 'google' | 'github' | 'sanity' | `saml-${string}`
455
+ }
456
+
421
457
  export declare type SinglePrompt =
422
458
  | (Omit<DistinctQuestion, 'name'> & {
423
459
  type: 'list'
package/lib/index.d.ts CHANGED
@@ -21,7 +21,6 @@ export declare interface CliBaseCommandContext {
21
21
  output: CliOutputter
22
22
  prompt: CliPrompter
23
23
  apiClient: CliApiClient
24
- yarn: CliStubbedYarn
25
24
  sanityMajorVersion: 2 | 3
26
25
  cliConfigPath?: string
27
26
  cliRoot: string
@@ -101,6 +100,12 @@ export declare interface CliConfig {
101
100
  * Defaults to `false`
102
101
  */
103
102
  reactStrictMode?: boolean
103
+ /**
104
+ * The React Compiler is currently in beta, and is disabled by default.
105
+ * @see https://react.dev/learn/react-compiler
106
+ * @beta
107
+ */
108
+ reactCompiler?: ReactCompilerConfig
104
109
  server?: {
105
110
  hostname?: string
106
111
  port?: number
@@ -144,6 +149,7 @@ declare type CliMajorVersion = 2 | 3
144
149
 
145
150
  export declare interface CliOutputter {
146
151
  print: (...args: unknown[]) => void
152
+ success: (...args: unknown[]) => void
147
153
  warn: (...args: unknown[]) => void
148
154
  error: (...args: unknown[]) => void
149
155
  clear: () => void
@@ -366,6 +372,27 @@ export declare interface PackageJson {
366
372
 
367
373
  declare type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun' | 'manual'
368
374
 
375
+ /**
376
+ * Until these types are on npm: https://github.com/facebook/react/blob/0bc30748730063e561d87a24a4617526fdd38349/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Options.ts#L39-L122
377
+ * @beta
378
+ */
379
+ export declare interface ReactCompilerConfig {
380
+ /**
381
+ * @see https://react.dev/learn/react-compiler#existing-projects
382
+ */
383
+ sources?: Array<string> | ((filename: string) => boolean) | null
384
+ /**
385
+ * The minimum major version of React that the compiler should emit code for. If the target is 19
386
+ * or higher, the compiler emits direct imports of React runtime APIs needed by the compiler. On
387
+ * versions prior to 19, an extra runtime package react-compiler-runtime is necessary to provide
388
+ * a userspace approximation of runtime APIs.
389
+ * @see https://react.dev/learn/react-compiler#using-react-compiler-with-react-17-or-18
390
+ */
391
+ target: '18' | '19'
392
+ panicThreshold?: 'ALL_ERRORS' | 'CRITICAL_ERRORS' | 'NONE'
393
+ compilationMode?: 'infer' | 'syntax' | 'annotation' | 'all'
394
+ }
395
+
369
396
  export declare interface ResolvedCliCommand {
370
397
  command: CliCommandDefinition | CliCommandGroupDefinition
371
398
  commandName: string
@@ -418,6 +445,15 @@ export declare interface SanityModuleInternal {
418
445
  }
419
446
  }
420
447
 
448
+ export declare type SanityUser = {
449
+ id: string
450
+ name: string
451
+ email: string
452
+ profileImage?: string
453
+ tosAcceptedAt?: string
454
+ provider: 'google' | 'github' | 'sanity' | `saml-${string}`
455
+ }
456
+
421
457
  export declare type SinglePrompt =
422
458
  | (Omit<DistinctQuestion, 'name'> & {
423
459
  type: 'list'