netlify-cli 11.8.1 → 11.8.3

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,21 +1,21 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "11.8.1",
3
+ "version": "11.8.3",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "11.8.1",
9
+ "version": "11.8.3",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@netlify/build": "^27.18.3",
13
+ "@netlify/build": "^27.18.5",
14
14
  "@netlify/config": "^18.2.3",
15
- "@netlify/edge-bundler": "^2.1.0",
15
+ "@netlify/edge-bundler": "^2.2.0",
16
16
  "@netlify/framework-info": "^9.2.0",
17
17
  "@netlify/local-functions-proxy": "^1.1.1",
18
- "@netlify/plugins-list": "^6.45.0",
18
+ "@netlify/plugins-list": "^6.46.0",
19
19
  "@netlify/zip-it-and-ship-it": "^7.1.2",
20
20
  "@octokit/rest": "^18.0.0",
21
21
  "@sindresorhus/slugify": "^1.1.0",
@@ -1194,17 +1194,17 @@
1194
1194
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
1195
1195
  },
1196
1196
  "node_modules/@netlify/build": {
1197
- "version": "27.18.3",
1198
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.18.3.tgz",
1199
- "integrity": "sha512-Q4IKNpLhJFezhyMb+jg7OIhS2ANOB9akLt58JX4A/XStY+42jQvuzsNG/2EcDcmshjJP5fob50GyqrzpsLG3Aw==",
1197
+ "version": "27.18.5",
1198
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.18.5.tgz",
1199
+ "integrity": "sha512-SmLOcgp/VJiCe9ft/8oUmCdPBOvQ/k7G4Y0fUb1BXusRePdultUDzC0pHFybNa/YyIsA4HDTAtGsTAk8GJpu7g==",
1200
1200
  "dependencies": {
1201
1201
  "@bugsnag/js": "^7.0.0",
1202
1202
  "@netlify/cache-utils": "^4.0.0",
1203
1203
  "@netlify/config": "^18.2.3",
1204
- "@netlify/edge-bundler": "^2.1.0",
1204
+ "@netlify/edge-bundler": "^2.2.0",
1205
1205
  "@netlify/functions-utils": "^4.2.9",
1206
1206
  "@netlify/git-utils": "^4.0.0",
1207
- "@netlify/plugins-list": "^6.44.0",
1207
+ "@netlify/plugins-list": "^6.46.0",
1208
1208
  "@netlify/run-utils": "^4.0.0",
1209
1209
  "@netlify/zip-it-and-ship-it": "^7.1.2",
1210
1210
  "@sindresorhus/slugify": "^2.0.0",
@@ -2348,9 +2348,9 @@
2348
2348
  }
2349
2349
  },
2350
2350
  "node_modules/@netlify/edge-bundler": {
2351
- "version": "2.1.0",
2352
- "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-2.1.0.tgz",
2353
- "integrity": "sha512-yHb4xIZi1qiDtrL7Th7zJkJDBMmrbtRNVGllqq1hLLqDhugEtAz9AVGp3huHgl2F9D5m0l0HbpyWKG+SnZ+54A==",
2351
+ "version": "2.2.0",
2352
+ "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-2.2.0.tgz",
2353
+ "integrity": "sha512-8dvI9y77TULQCcLXya4xJIt1GMTmCAJ0XIPfxjv6lbbB2XU87/tEAQ/8VOzaC2lNf+U5qG0fcrzVjjuKt3K2Sw==",
2354
2354
  "dependencies": {
2355
2355
  "@import-maps/resolve": "^1.0.1",
2356
2356
  "common-path-prefix": "^3.0.0",
@@ -2358,6 +2358,7 @@
2358
2358
  "env-paths": "^3.0.0",
2359
2359
  "execa": "^6.0.0",
2360
2360
  "find-up": "^6.3.0",
2361
+ "get-port": "^6.1.2",
2361
2362
  "glob-to-regexp": "^0.4.1",
2362
2363
  "node-fetch": "^3.1.1",
2363
2364
  "node-stream-zip": "^1.15.0",
@@ -2420,6 +2421,17 @@
2420
2421
  "url": "https://github.com/sponsors/sindresorhus"
2421
2422
  }
2422
2423
  },
2424
+ "node_modules/@netlify/edge-bundler/node_modules/get-port": {
2425
+ "version": "6.1.2",
2426
+ "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz",
2427
+ "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==",
2428
+ "engines": {
2429
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
2430
+ },
2431
+ "funding": {
2432
+ "url": "https://github.com/sponsors/sindresorhus"
2433
+ }
2434
+ },
2423
2435
  "node_modules/@netlify/edge-bundler/node_modules/glob-to-regexp": {
2424
2436
  "version": "0.4.1",
2425
2437
  "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
@@ -3684,9 +3696,9 @@
3684
3696
  "integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
3685
3697
  },
3686
3698
  "node_modules/@netlify/plugins-list": {
3687
- "version": "6.45.0",
3688
- "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.45.0.tgz",
3689
- "integrity": "sha512-eFvBjP1o+ckujlV81GFDfnMOM9Vz4jeI/ZsRELLH7j1+GnGRrYcdG20THDJCS++l1bWEvX59PC2Je9eyD7fZFA==",
3699
+ "version": "6.46.0",
3700
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.46.0.tgz",
3701
+ "integrity": "sha512-kUX90Eacqko9ni3cepVZKXFTLmhdwES/HDRlMYxyUh+SmvXWRC+h43b11nA0/6M5PEPolUChQOZN9wZql6oJJw==",
3690
3702
  "engines": {
3691
3703
  "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
3692
3704
  }
@@ -23481,17 +23493,17 @@
23481
23493
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
23482
23494
  },
23483
23495
  "@netlify/build": {
23484
- "version": "27.18.3",
23485
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.18.3.tgz",
23486
- "integrity": "sha512-Q4IKNpLhJFezhyMb+jg7OIhS2ANOB9akLt58JX4A/XStY+42jQvuzsNG/2EcDcmshjJP5fob50GyqrzpsLG3Aw==",
23496
+ "version": "27.18.5",
23497
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.18.5.tgz",
23498
+ "integrity": "sha512-SmLOcgp/VJiCe9ft/8oUmCdPBOvQ/k7G4Y0fUb1BXusRePdultUDzC0pHFybNa/YyIsA4HDTAtGsTAk8GJpu7g==",
23487
23499
  "requires": {
23488
23500
  "@bugsnag/js": "^7.0.0",
23489
23501
  "@netlify/cache-utils": "^4.0.0",
23490
23502
  "@netlify/config": "^18.2.3",
23491
- "@netlify/edge-bundler": "^2.1.0",
23503
+ "@netlify/edge-bundler": "^2.2.0",
23492
23504
  "@netlify/functions-utils": "^4.2.9",
23493
23505
  "@netlify/git-utils": "^4.0.0",
23494
- "@netlify/plugins-list": "^6.44.0",
23506
+ "@netlify/plugins-list": "^6.46.0",
23495
23507
  "@netlify/run-utils": "^4.0.0",
23496
23508
  "@netlify/zip-it-and-ship-it": "^7.1.2",
23497
23509
  "@sindresorhus/slugify": "^2.0.0",
@@ -24182,9 +24194,9 @@
24182
24194
  }
24183
24195
  },
24184
24196
  "@netlify/edge-bundler": {
24185
- "version": "2.1.0",
24186
- "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-2.1.0.tgz",
24187
- "integrity": "sha512-yHb4xIZi1qiDtrL7Th7zJkJDBMmrbtRNVGllqq1hLLqDhugEtAz9AVGp3huHgl2F9D5m0l0HbpyWKG+SnZ+54A==",
24197
+ "version": "2.2.0",
24198
+ "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-2.2.0.tgz",
24199
+ "integrity": "sha512-8dvI9y77TULQCcLXya4xJIt1GMTmCAJ0XIPfxjv6lbbB2XU87/tEAQ/8VOzaC2lNf+U5qG0fcrzVjjuKt3K2Sw==",
24188
24200
  "requires": {
24189
24201
  "@import-maps/resolve": "^1.0.1",
24190
24202
  "common-path-prefix": "^3.0.0",
@@ -24192,6 +24204,7 @@
24192
24204
  "env-paths": "^3.0.0",
24193
24205
  "execa": "^6.0.0",
24194
24206
  "find-up": "^6.3.0",
24207
+ "get-port": "^6.1.2",
24195
24208
  "glob-to-regexp": "^0.4.1",
24196
24209
  "node-fetch": "^3.1.1",
24197
24210
  "node-stream-zip": "^1.15.0",
@@ -24233,6 +24246,11 @@
24233
24246
  "path-exists": "^5.0.0"
24234
24247
  }
24235
24248
  },
24249
+ "get-port": {
24250
+ "version": "6.1.2",
24251
+ "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz",
24252
+ "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw=="
24253
+ },
24236
24254
  "glob-to-regexp": {
24237
24255
  "version": "0.4.1",
24238
24256
  "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
@@ -24923,9 +24941,9 @@
24923
24941
  "integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
24924
24942
  },
24925
24943
  "@netlify/plugins-list": {
24926
- "version": "6.45.0",
24927
- "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.45.0.tgz",
24928
- "integrity": "sha512-eFvBjP1o+ckujlV81GFDfnMOM9Vz4jeI/ZsRELLH7j1+GnGRrYcdG20THDJCS++l1bWEvX59PC2Je9eyD7fZFA=="
24944
+ "version": "6.46.0",
24945
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.46.0.tgz",
24946
+ "integrity": "sha512-kUX90Eacqko9ni3cepVZKXFTLmhdwES/HDRlMYxyUh+SmvXWRC+h43b11nA0/6M5PEPolUChQOZN9wZql6oJJw=="
24929
24947
  },
24930
24948
  "@netlify/run-utils": {
24931
24949
  "version": "4.0.1",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "11.8.1",
4
+ "version": "11.8.3",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "@whitep4nth3r (https://twitter.com/whitep4nth3r)",
@@ -223,12 +223,12 @@
223
223
  "prettier": "--ignore-path .gitignore --loglevel=warn \"{src,tools,scripts,site,tests,.github}/**/*.{mjs,cjs,js,md,yml,json,html}\" \"*.{mjs,cjs,js,yml,json,html}\" \".*.{mjs,cjs,js,yml,json,html}\" \"!CHANGELOG.md\" \"!npm-shrinkwrap.json\" \"!**/*/package-lock.json\" \"!.github/**/*.md\""
224
224
  },
225
225
  "dependencies": {
226
- "@netlify/build": "^27.18.3",
226
+ "@netlify/build": "^27.18.5",
227
227
  "@netlify/config": "^18.2.3",
228
- "@netlify/edge-bundler": "^2.1.0",
228
+ "@netlify/edge-bundler": "^2.2.0",
229
229
  "@netlify/framework-info": "^9.2.0",
230
230
  "@netlify/local-functions-proxy": "^1.1.1",
231
- "@netlify/plugins-list": "^6.45.0",
231
+ "@netlify/plugins-list": "^6.46.0",
232
232
  "@netlify/zip-it-and-ship-it": "^7.1.2",
233
233
  "@octokit/rest": "^18.0.0",
234
234
  "@sindresorhus/slugify": "^1.1.0",
@@ -7,7 +7,11 @@ const { error, exit, generateNetlifyGraphJWT, getEnvelopeEnv, getToken, normaliz
7
7
  /**
8
8
  * @param {import('../../lib/build').BuildConfig} options
9
9
  */
10
- const checkOptions = ({ token }) => {
10
+ const checkOptions = ({ cachedConfig: { siteInfo = {} }, token }) => {
11
+ if (!siteInfo.id) {
12
+ error('Could not find the site ID. Please run netlify link.')
13
+ }
14
+
11
15
  if (!token) {
12
16
  error('Could not find the access token. Please run netlify login.')
13
17
  }
@@ -68,7 +72,7 @@ const build = async (options, command) => {
68
72
  await injectEnv(command, { api, buildOptions, context, site, siteInfo })
69
73
  }
70
74
 
71
- const { exitCode } = await runBuild(buildOptions, command, options)
75
+ const { exitCode } = await runBuild(buildOptions)
72
76
  exit(exitCode)
73
77
  }
74
78
 
@@ -375,11 +375,10 @@ const runDeploy = async ({
375
375
  *
376
376
  * @param {object} config
377
377
  * @param {*} config.cachedConfig
378
- * @param {*} config.command
379
378
  * @param {import('commander').OptionValues} config.options The options of the command
380
379
  * @returns
381
380
  */
382
- const handleBuild = async ({ cachedConfig, command, options }) => {
381
+ const handleBuild = async ({ cachedConfig, options }) => {
383
382
  if (!options.build) {
384
383
  return {}
385
384
  }
@@ -389,7 +388,7 @@ const handleBuild = async ({ cachedConfig, command, options }) => {
389
388
  token,
390
389
  options,
391
390
  })
392
- const { configMutations, exitCode, newConfig } = await runBuild(resolvedOptions, command, options)
391
+ const { configMutations, exitCode, newConfig } = await runBuild(resolvedOptions)
393
392
  if (exitCode !== 0) {
394
393
  exit(exitCode)
395
394
  }
@@ -574,7 +573,6 @@ const deploy = async (options, command) => {
574
573
 
575
574
  const { newConfig, configMutations = [] } = await handleBuild({
576
575
  cachedConfig: command.netlify.cachedConfig,
577
- command,
578
576
  options,
579
577
  })
580
578
  const config = newConfig || command.netlify.config
package/src/lib/build.js CHANGED
@@ -3,8 +3,6 @@ const process = require('process')
3
3
 
4
4
  const netlifyBuildPromise = import('@netlify/build')
5
5
 
6
- const { NETLIFYDEVERR, detectServerSettings, error, log } = require('../utils')
7
-
8
6
  /**
9
7
  * The buildConfig + a missing cachedConfig
10
8
  * @typedef BuildConfig
@@ -44,20 +42,11 @@ const getBuildOptions = ({ cachedConfig, options: { context, cwd, debug, dry, js
44
42
 
45
43
  /**
46
44
  * run the build command
47
- * @param {BuildConfig} buildOptions
48
- * @param {import('../commands/base-command').BaseCommand} command
49
- * @param {import('commander').OptionValues} commandOptions
45
+ * @param {BuildConfig} options
50
46
  * @returns
51
47
  */
52
- const runBuild = async (buildOptions, command, commandOptions) => {
48
+ const runBuild = async (options) => {
53
49
  const { default: build } = await netlifyBuildPromise
54
- const { cachedConfig, config, site } = command.netlify
55
- const devConfig = {
56
- framework: '#auto',
57
- ...(config.functionsDirectory && { functions: config.functionsDirectory }),
58
- ...config.dev,
59
- ...commandOptions,
60
- }
61
50
 
62
51
  // If netlify NETLIFY_API_URL is set we need to pass this information to @netlify/build
63
52
  // TODO don't use testOpts, but add real properties to do this.
@@ -67,52 +56,10 @@ const runBuild = async (buildOptions, command, commandOptions) => {
67
56
  scheme: apiUrl.protocol.slice(0, -1),
68
57
  host: apiUrl.host,
69
58
  }
70
- buildOptions = { ...buildOptions, testOpts }
71
- }
72
-
73
- /** @type {Partial<import('../../utils/types').ServerSettings>} */
74
- let settings = {}
75
- try {
76
- settings = await detectServerSettings(devConfig, commandOptions, site.root)
77
-
78
- const defaultConfig = { build: {} }
79
-
80
- if (settings.buildCommand && settings.dist) {
81
- buildOptions.cachedConfig.config.build.command = settings.buildCommand
82
- defaultConfig.build.command = settings.buildCommand
83
- buildOptions.cachedConfig.config.build.publish = settings.buildCommand
84
- defaultConfig.build.publish = settings.dist
85
- }
86
-
87
- if (defaultConfig.build.command && defaultConfig.build.publish) {
88
- buildOptions.defaultConfig = defaultConfig
89
- }
90
-
91
- // If there are plugins that we should be running for this site, add them
92
- // to the config as if they were declared in netlify.toml. We must check
93
- // whether the plugin has already been added by another source (like the
94
- // TOML file or the UI), as we don't want to run the same plugin twice.
95
- if (settings.plugins) {
96
- const { plugins: existingPlugins = [] } = cachedConfig.config
97
- const existingPluginNames = new Set(existingPlugins.map((plugin) => plugin.package))
98
- const newPlugins = settings.plugins
99
- .map((pluginName) => {
100
- if (existingPluginNames.has(pluginName)) {
101
- return
102
- }
103
-
104
- return { package: pluginName, origin: 'config', inputs: {} }
105
- })
106
- .filter(Boolean)
107
-
108
- buildOptions.cachedConfig.config.plugins = [...newPlugins, ...cachedConfig.config.plugins]
109
- }
110
- } catch (detectServerSettingsError) {
111
- log(NETLIFYDEVERR, detectServerSettingsError.message)
112
- error(detectServerSettingsError)
59
+ options = { ...options, testOpts }
113
60
  }
114
61
 
115
- const { configMutations, netlifyConfig: newConfig, severityCode: exitCode } = await build(buildOptions)
62
+ const { configMutations, netlifyConfig: newConfig, severityCode: exitCode } = await build(options)
116
63
  return { exitCode, newConfig, configMutations }
117
64
  }
118
65
 
@@ -158,10 +158,7 @@ const handleStaticServer = async ({ devConfig, options, projectDir }) => {
158
158
  */
159
159
  const getSettingsFromFramework = (framework) => {
160
160
  const {
161
- build: {
162
- directory: dist,
163
- commands: [buildCommand],
164
- },
161
+ build: { directory: dist },
165
162
  dev: {
166
163
  commands: [command],
167
164
  port: frameworkPort,
@@ -175,7 +172,6 @@ const getSettingsFromFramework = (framework) => {
175
172
 
176
173
  return {
177
174
  command,
178
- buildCommand,
179
175
  frameworkPort,
180
176
  dist: staticDir || dist,
181
177
  framework: frameworkName,
@@ -254,7 +250,6 @@ const handleCustomFramework = ({ devConfig }) => {
254
250
  const mergeSettings = async ({ devConfig, frameworkSettings = {} }) => {
255
251
  const {
256
252
  command: frameworkCommand,
257
- buildCommand,
258
253
  frameworkPort: frameworkDetectedPort,
259
254
  dist,
260
255
  framework,
@@ -268,7 +263,6 @@ const mergeSettings = async ({ devConfig, frameworkSettings = {} }) => {
268
263
  const useStaticServer = !(command && frameworkPort)
269
264
  return {
270
265
  command,
271
- buildCommand,
272
266
  frameworkPort: useStaticServer ? await getStaticServerPort({ devConfig }) : frameworkPort,
273
267
  dist: devConfig.publish || dist || getDefaultDist(),
274
268
  framework,