@sanity/cli 3.65.2-cops.39 → 3.65.2-corel.465

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/cli",
3
- "version": "3.65.2-cops.39+eadc82ba20",
3
+ "version": "3.65.2-corel.465+c829d7e227",
4
4
  "description": "Sanity CLI tool for managing Sanity installations, managing plugins, schemas and datasets",
5
5
  "keywords": [
6
6
  "sanity",
@@ -57,10 +57,10 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@babel/traverse": "^7.23.5",
60
- "@sanity/client": "^6.24.0",
61
- "@sanity/codegen": "3.65.2-cops.39+eadc82ba20",
60
+ "@sanity/client": "^6.24.1",
61
+ "@sanity/codegen": "3.65.2-corel.465+c829d7e227",
62
62
  "@sanity/telemetry": "^0.7.7",
63
- "@sanity/util": "3.65.2-cops.39+eadc82ba20",
63
+ "@sanity/util": "3.65.2-corel.465+c829d7e227",
64
64
  "chalk": "^4.1.2",
65
65
  "debug": "^4.3.4",
66
66
  "decompress": "^4.2.0",
@@ -82,7 +82,7 @@
82
82
  "@rollup/plugin-node-resolve": "^15.2.3",
83
83
  "@sanity/eslint-config-studio": "^4.0.0",
84
84
  "@sanity/generate-help-url": "^3.0.0",
85
- "@sanity/types": "3.65.2-cops.39+eadc82ba20",
85
+ "@sanity/types": "3.65.2-corel.465+c829d7e227",
86
86
  "@types/babel__traverse": "^7.20.5",
87
87
  "@types/configstore": "^5.0.1",
88
88
  "@types/cpx": "^1.5.2",
@@ -136,5 +136,5 @@
136
136
  "engines": {
137
137
  "node": ">=18"
138
138
  },
139
- "gitHead": "eadc82ba200ce70835c6575afc5ab908826695f0"
139
+ "gitHead": "c829d7e227cb84f27017ee21ddf21522a1fc32a7"
140
140
  }
@@ -23,6 +23,7 @@ export interface BootstrapRemoteOptions {
23
23
  bearerToken?: string
24
24
  packageName: string
25
25
  variables: GenerateConfigOptions['variables']
26
+ isCI?: boolean
26
27
  }
27
28
 
28
29
  const INITIAL_COMMIT_MESSAGE = 'Initial commit from Sanity CLI'
@@ -31,7 +32,7 @@ export async function bootstrapRemoteTemplate(
31
32
  opts: BootstrapRemoteOptions,
32
33
  context: CliCommandContext,
33
34
  ): Promise<void> {
34
- const {outputPath, repoInfo, bearerToken, variables, packageName} = opts
35
+ const {outputPath, repoInfo, bearerToken, variables, packageName, isCI} = opts
35
36
  const {output, apiClient} = context
36
37
  const name = [repoInfo.username, repoInfo.name, repoInfo.filePath].filter(Boolean).join('/')
37
38
  const spinner = output.spinner(`Bootstrapping files from template "${name}"`).start()
@@ -47,7 +48,11 @@ export async function bootstrapRemoteTemplate(
47
48
  await downloadAndExtractRepo(outputPath, repoInfo, bearerToken)
48
49
 
49
50
  debug('Applying environment variables')
50
- const readToken = await generateSanityApiReadToken(variables.projectId, apiClient)
51
+ const readToken = await generateSanityApiReadToken(
52
+ isCI ? 'ci-remote-template-test-token-please-add-email-filter' : 'API Read Token',
53
+ variables.projectId,
54
+ apiClient,
55
+ )
51
56
  const isNext = await isNextJsTemplate(outputPath)
52
57
  const envName = isNext ? '.env.local' : '.env'
53
58
 
@@ -72,7 +72,7 @@ import {
72
72
  } from './templates/nextjs'
73
73
 
74
74
  // eslint-disable-next-line no-process-env
75
- const isCI = process.env.CI
75
+ const isCI = Boolean(process.env.CI)
76
76
 
77
77
  /**
78
78
  * @deprecated - No longer used
@@ -1127,6 +1127,7 @@ export default async function initSanity(
1127
1127
  repoInfo: remoteTemplateInfo,
1128
1128
  bearerToken: cliFlags['template-token'],
1129
1129
  variables: bootstrapVariables,
1130
+ isCI,
1130
1131
  },
1131
1132
  context,
1132
1133
  )
@@ -488,6 +488,7 @@ export async function tryApplyPackageName(root: string, name: string): Promise<v
488
488
  }
489
489
 
490
490
  export async function generateSanityApiReadToken(
491
+ label: string,
491
492
  projectId: string,
492
493
  apiClient: CliApiClient,
493
494
  ): Promise<string> {
@@ -497,7 +498,7 @@ export async function generateSanityApiReadToken(
497
498
  uri: `/projects/${projectId}/tokens`,
498
499
  method: 'POST',
499
500
  body: {
500
- label: `API Read Token (${Date.now()})`,
501
+ label: `${label} (${Date.now()})`, // Add timestamp to ensure uniqueness
501
502
  roleName: 'viewer',
502
503
  },
503
504
  })