netlify-cli 10.17.7 → 10.17.8

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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "10.17.7",
3
+ "version": "10.17.8",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "10.17.7",
9
+ "version": "10.17.8",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "10.17.7",
4
+ "version": "10.17.8",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "@whitep4nth3r (https://twitter.com/whitep4nth3r)",
@@ -74,11 +74,7 @@ const envClone = async (options, command) => {
74
74
  return false
75
75
  }
76
76
 
77
- log(
78
- `Successfully cloned environment variables from ${chalk.greenBright(siteFrom.name)} to ${chalk.greenBright(
79
- siteTo.name,
80
- )}`,
81
- )
77
+ log(`Successfully cloned environment variables from ${chalk.green(siteFrom.name)} to ${chalk.green(siteTo.name)}`)
82
78
 
83
79
  return true
84
80
  }
@@ -98,7 +94,7 @@ const mongoToMongo = async ({ api, siteFrom, siteTo }) => {
98
94
  ] = [siteFrom, siteTo]
99
95
 
100
96
  if (isEmpty(envFrom)) {
101
- log(`${chalk.greenBright(siteFrom.name)} has no environment variables, nothing to clone`)
97
+ log(`${chalk.green(siteFrom.name)} has no environment variables, nothing to clone`)
102
98
  return false
103
99
  }
104
100
 
@@ -130,7 +126,7 @@ const mongoToEnvelope = async ({ api, siteFrom, siteTo }) => {
130
126
  const keysFrom = Object.keys(envFrom)
131
127
 
132
128
  if (isEmpty(envFrom)) {
133
- log(`${chalk.greenBright(siteFrom.name)} has no environment variables, nothing to clone`)
129
+ log(`${chalk.green(siteFrom.name)} has no environment variables, nothing to clone`)
134
130
  return false
135
131
  }
136
132
 
@@ -163,7 +159,7 @@ const envelopeToMongo = async ({ api, siteFrom, siteTo }) => {
163
159
  const envFrom = translateFromEnvelopeToMongo(envelopeVariables)
164
160
 
165
161
  if (isEmpty(envFrom)) {
166
- log(`${chalk.greenBright(siteFrom.name)} has no environment variables, nothing to clone`)
162
+ log(`${chalk.green(siteFrom.name)} has no environment variables, nothing to clone`)
167
163
  return false
168
164
  }
169
165
 
@@ -201,7 +197,7 @@ const envelopeToEnvelope = async ({ api, siteFrom, siteTo }) => {
201
197
  const keysFrom = envelopeFrom.map(({ key }) => key)
202
198
 
203
199
  if (isEmpty(keysFrom)) {
204
- log(`${chalk.greenBright(siteFrom.name)} has no environment variables, nothing to clone`)
200
+ log(`${chalk.green(siteFrom.name)} has no environment variables, nothing to clone`)
205
201
  return false
206
202
  }
207
203
 
@@ -26,7 +26,7 @@ const envGet = async (name, options, command) => {
26
26
  env = await getEnvelopeEnv({ api, context, env, key: name, scope, siteInfo })
27
27
  } else if (context !== 'dev' || scope !== 'any') {
28
28
  error(
29
- `To specify a context or scope, please run ${chalk.yellowBright(
29
+ `To specify a context or scope, please run ${chalk.yellow(
30
30
  'netlify open:admin',
31
31
  )} to open the Netlify UI and opt in to the new environment variables experience from Site settings`,
32
32
  )
@@ -42,9 +42,9 @@ const envGet = async (name, options, command) => {
42
42
  }
43
43
 
44
44
  if (!value) {
45
- const withContext = `in the ${chalk.magentaBright(context)} context`
46
- const withScope = scope === 'any' ? '' : ` in the ${chalk.magentaBright(context)} scope`
47
- log(`No value set ${withContext}${withScope} for environment variable ${chalk.yellowBright(name)}`)
45
+ const withContext = `in the ${chalk.magenta(context)} context`
46
+ const withScope = scope === 'any' ? '' : ` and the ${chalk.magenta(scope)} scope`
47
+ log(`No value set ${withContext}${withScope} for environment variable ${chalk.yellow(name)}`)
48
48
  return false
49
49
  }
50
50
 
@@ -55,7 +55,7 @@ const envList = async (options, command) => {
55
55
  environment = await getEnvelopeEnv({ api, context, env, scope, siteInfo })
56
56
  } else if (context !== 'dev' || scope !== 'any') {
57
57
  error(
58
- `To specify a context or scope, please run ${chalk.yellowBright(
58
+ `To specify a context or scope, please run ${chalk.yellow(
59
59
  'netlify open:admin',
60
60
  )} to open the Netlify UI and opt in to the new environment variables experience from Site settings`,
61
61
  )
@@ -76,9 +76,9 @@ const envList = async (options, command) => {
76
76
  return false
77
77
  }
78
78
 
79
- const forSite = `for site ${chalk.greenBright(siteInfo.name)}`
80
- const withContext = isUsingEnvelope ? `in the ${chalk.magentaBright(options.context)} context` : ''
81
- const withScope = isUsingEnvelope && scope !== 'any' ? `and ${chalk.yellowBright(options.scope)} scope` : ''
79
+ const forSite = `for site ${chalk.green(siteInfo.name)}`
80
+ const withContext = isUsingEnvelope ? `in the ${chalk.magenta(options.context)} context` : ''
81
+ const withScope = isUsingEnvelope && scope !== 'any' ? `and ${chalk.yellow(options.scope)} scope` : ''
82
82
  if (isEmpty(environment)) {
83
83
  log(`No environment variables set ${forSite} ${withContext} ${withScope}`)
84
84
  return false
@@ -828,12 +828,32 @@ const detectLocalCLISessionMetadata = async ({ siteRoot }) => {
828
828
  * @param {string} input.jwt The GraphJWT string
829
829
  * @param {string} input.sessionId The id of the cli session to fetch the current metadata for
830
830
  * @param {string} input.siteRoot Path to the root of the project
831
+ * @param {object} input.config The parsed netlify.toml config file
831
832
  * @param {string} input.docId The GraphQL operations document id to fetch
832
833
  * @param {string} input.schemaId The GraphQL schemaId to use when generating code
833
834
  */
834
- const publishCliSessionMetadataPublishEvent = async ({ docId, jwt, schemaId, sessionId, siteRoot }) => {
835
+ const publishCliSessionMetadataPublishEvent = async ({ config, docId, jwt, schemaId, sessionId, siteRoot }) => {
835
836
  const detectedMetadata = await detectLocalCLISessionMetadata({ siteRoot })
836
837
 
838
+ /** @type {CodegenHelpers.CodegenModuleMeta | null} */
839
+ let codegen = null
840
+
841
+ const codegenModule = await getCodegenModule({ config })
842
+
843
+ if (codegenModule) {
844
+ codegen = {
845
+ id: codegenModule.id,
846
+ version: codegenModule.id,
847
+ generators: codegenModule.generators.map((generator) => ({
848
+ id: generator.id,
849
+ name: generator.name,
850
+ options: generator.generateHandlerOptions || null,
851
+ supportedDefinitionTypes: generator.supportedDefinitionTypes,
852
+ version: generator.version,
853
+ })),
854
+ }
855
+ }
856
+
837
857
  /** @type {CliEventHelper.OneGraphNetlifyCliSessionMetadataPublishEvent} */
838
858
  const event = {
839
859
  __typename: 'OneGraphNetlifyCliSessionMetadataPublishEvent',
@@ -848,7 +868,7 @@ const publishCliSessionMetadataPublishEvent = async ({ docId, jwt, schemaId, ses
848
868
  siteRootFriendly: detectedMetadata.siteRoot,
849
869
  persistedDocId: docId,
850
870
  schemaId,
851
- codegenModule: detectedMetadata.codegen,
871
+ codegenModule: codegen,
852
872
  arch: detectedMetadata.arch,
853
873
  nodeVersion: detectedMetadata.nodeVersion,
854
874
  platform: detectedMetadata.platform,