netlify-cli 9.9.0 → 9.9.1

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,20 +1,20 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "9.9.0",
3
+ "version": "9.9.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "9.9.0",
9
+ "version": "9.9.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
13
  "@netlify/build": "^26.3.10",
14
- "@netlify/config": "^17.0.15",
14
+ "@netlify/config": "^17.0.16",
15
15
  "@netlify/framework-info": "^9.0.2",
16
16
  "@netlify/local-functions-proxy": "^1.1.1",
17
- "@netlify/plugin-edge-handlers": "^3.0.6",
17
+ "@netlify/plugin-edge-handlers": "^3.0.7",
18
18
  "@netlify/plugins-list": "^6.14.0",
19
19
  "@netlify/routing-local-proxy": "^0.34.1",
20
20
  "@netlify/zip-it-and-ship-it": "^5.9.0",
@@ -83,7 +83,7 @@
83
83
  "netlify": "^11.0.0",
84
84
  "netlify-headers-parser": "^6.0.2",
85
85
  "netlify-onegraph-internal": "0.0.50",
86
- "netlify-redirect-parser": "^13.0.4",
86
+ "netlify-redirect-parser": "^13.0.5",
87
87
  "netlify-redirector": "^0.2.1",
88
88
  "node-fetch": "^2.6.0",
89
89
  "node-version-alias": "^1.0.1",
@@ -3110,9 +3110,9 @@
3110
3110
  }
3111
3111
  },
3112
3112
  "node_modules/@netlify/config": {
3113
- "version": "17.0.15",
3114
- "resolved": "https://registry.npmjs.org/@netlify/config/-/config-17.0.15.tgz",
3115
- "integrity": "sha512-ShEMw5C5PrfC4M3rdcFTdN9Phj3bsPbE8fpy2LdHUEdjEGnNo26frxq3Nh+suLsVvLZ1zWY7yoCQcT+6McerIw==",
3113
+ "version": "17.0.16",
3114
+ "resolved": "https://registry.npmjs.org/@netlify/config/-/config-17.0.16.tgz",
3115
+ "integrity": "sha512-MajIdbsdOVpI59zayMY/9S4XrO0gVWXvl7r5iEFoSnzuloJlN/Ws0GFOSL9FqJEH8Fh1lafOIMPCugRxWhdJ6g==",
3116
3116
  "dependencies": {
3117
3117
  "chalk": "^5.0.0",
3118
3118
  "cron-parser": "^4.1.0",
@@ -3129,7 +3129,7 @@
3129
3129
  "map-obj": "^5.0.0",
3130
3130
  "netlify": "^11.0.0",
3131
3131
  "netlify-headers-parser": "^6.0.2",
3132
- "netlify-redirect-parser": "13.0.4",
3132
+ "netlify-redirect-parser": "13.0.5",
3133
3133
  "omit.js": "^2.0.2",
3134
3134
  "p-locate": "^6.0.0",
3135
3135
  "path-exists": "^5.0.0",
@@ -3312,9 +3312,9 @@
3312
3312
  }
3313
3313
  },
3314
3314
  "node_modules/@netlify/config/node_modules/map-obj": {
3315
- "version": "5.0.0",
3316
- "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz",
3317
- "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==",
3315
+ "version": "5.0.1",
3316
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.1.tgz",
3317
+ "integrity": "sha512-p3Qoax94q4c4Pb4etNi2lQSQGlqOA4PoD3ARovo7NllRoObZHwNEYd40fz4qgX1zTFK4geU/R1kbowl5hU5OVg==",
3318
3318
  "engines": {
3319
3319
  "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
3320
3320
  },
@@ -4272,9 +4272,9 @@
4272
4272
  "integrity": "sha512-lfNB/QYDgaP07pwm/nWEaWPvRAAGyhxvJqNzvxMijc7A4uwquMjlbYve8yYyd0LJXPwgBpGobwiQj5RA76xzUQ=="
4273
4273
  },
4274
4274
  "node_modules/@netlify/plugin-edge-handlers": {
4275
- "version": "3.0.6",
4276
- "resolved": "https://registry.npmjs.org/@netlify/plugin-edge-handlers/-/plugin-edge-handlers-3.0.6.tgz",
4277
- "integrity": "sha512-wf9556qv5lEzuZuj3X5XIbhLerOipcrTNybGFSuDRN4bIRrpWDfap+fGiZI2D+EyEXWvkQDNaEHc64AH9H8Siw==",
4275
+ "version": "3.0.7",
4276
+ "resolved": "https://registry.npmjs.org/@netlify/plugin-edge-handlers/-/plugin-edge-handlers-3.0.7.tgz",
4277
+ "integrity": "sha512-ThceMAZ7M0k6WVcZwszVh9qozZKveQCnmQtWZW69Qf+g1pGHFkGIt9Vclt5op+Dd8bIdk0kcu1NnX9Ll7eZL1w==",
4278
4278
  "dependencies": {
4279
4279
  "@babel/core": "^7.11.4",
4280
4280
  "@babel/preset-env": "^7.11.5",
@@ -4300,9 +4300,9 @@
4300
4300
  }
4301
4301
  },
4302
4302
  "node_modules/@netlify/plugin-edge-handlers/node_modules/node-fetch": {
4303
- "version": "3.2.0",
4304
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.0.tgz",
4305
- "integrity": "sha512-8xeimMwMItMw8hRrOl3C9/xzU49HV/yE6ORew/l+dxWimO5A4Ra8ld2rerlJvc/O7et5Z1zrWsPX43v1QBjCxw==",
4303
+ "version": "3.2.1",
4304
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.1.tgz",
4305
+ "integrity": "sha512-Ef3SPFtRWFCDyhvcwCSvacLpkwmYZcD57mmZzAsMiks9TpHpIghe32U9H06tMICnr+X7YCpzH7WvUlUoml2urA==",
4306
4306
  "dependencies": {
4307
4307
  "data-uri-to-buffer": "^4.0.0",
4308
4308
  "fetch-blob": "^3.1.4",
@@ -17206,9 +17206,9 @@
17206
17206
  }
17207
17207
  },
17208
17208
  "node_modules/netlify-redirect-parser": {
17209
- "version": "13.0.4",
17210
- "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-13.0.4.tgz",
17211
- "integrity": "sha512-Dg3JACJTcMwjof4FzeV9yDl6BgWkIIoBBfZxBjV2PNv9+QRYb1bOE7k4jx4HA9TTwzNQCJCdfJqmIqtR/w3Qrg==",
17209
+ "version": "13.0.5",
17210
+ "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-13.0.5.tgz",
17211
+ "integrity": "sha512-Q5YEQu9YLItP38VzmzJRZ+dP4HTnK0i4Reczq+AC4UDGGEcf9JkyUC8f9YgCoamtMPjX3Qb+o+7lF1vYztH/UQ==",
17212
17212
  "dependencies": {
17213
17213
  "filter-obj": "^3.0.0",
17214
17214
  "is-plain-obj": "^4.0.0",
@@ -26583,9 +26583,9 @@
26583
26583
  }
26584
26584
  },
26585
26585
  "@netlify/config": {
26586
- "version": "17.0.15",
26587
- "resolved": "https://registry.npmjs.org/@netlify/config/-/config-17.0.15.tgz",
26588
- "integrity": "sha512-ShEMw5C5PrfC4M3rdcFTdN9Phj3bsPbE8fpy2LdHUEdjEGnNo26frxq3Nh+suLsVvLZ1zWY7yoCQcT+6McerIw==",
26586
+ "version": "17.0.16",
26587
+ "resolved": "https://registry.npmjs.org/@netlify/config/-/config-17.0.16.tgz",
26588
+ "integrity": "sha512-MajIdbsdOVpI59zayMY/9S4XrO0gVWXvl7r5iEFoSnzuloJlN/Ws0GFOSL9FqJEH8Fh1lafOIMPCugRxWhdJ6g==",
26589
26589
  "requires": {
26590
26590
  "chalk": "^5.0.0",
26591
26591
  "cron-parser": "^4.1.0",
@@ -26602,7 +26602,7 @@
26602
26602
  "map-obj": "^5.0.0",
26603
26603
  "netlify": "^11.0.0",
26604
26604
  "netlify-headers-parser": "^6.0.2",
26605
- "netlify-redirect-parser": "13.0.4",
26605
+ "netlify-redirect-parser": "13.0.5",
26606
26606
  "omit.js": "^2.0.2",
26607
26607
  "p-locate": "^6.0.0",
26608
26608
  "path-exists": "^5.0.0",
@@ -26704,9 +26704,9 @@
26704
26704
  }
26705
26705
  },
26706
26706
  "map-obj": {
26707
- "version": "5.0.0",
26708
- "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz",
26709
- "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA=="
26707
+ "version": "5.0.1",
26708
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.1.tgz",
26709
+ "integrity": "sha512-p3Qoax94q4c4Pb4etNi2lQSQGlqOA4PoD3ARovo7NllRoObZHwNEYd40fz4qgX1zTFK4geU/R1kbowl5hU5OVg=="
26710
26710
  },
26711
26711
  "npm-run-path": {
26712
26712
  "version": "5.1.0",
@@ -27278,9 +27278,9 @@
27278
27278
  "integrity": "sha512-lfNB/QYDgaP07pwm/nWEaWPvRAAGyhxvJqNzvxMijc7A4uwquMjlbYve8yYyd0LJXPwgBpGobwiQj5RA76xzUQ=="
27279
27279
  },
27280
27280
  "@netlify/plugin-edge-handlers": {
27281
- "version": "3.0.6",
27282
- "resolved": "https://registry.npmjs.org/@netlify/plugin-edge-handlers/-/plugin-edge-handlers-3.0.6.tgz",
27283
- "integrity": "sha512-wf9556qv5lEzuZuj3X5XIbhLerOipcrTNybGFSuDRN4bIRrpWDfap+fGiZI2D+EyEXWvkQDNaEHc64AH9H8Siw==",
27281
+ "version": "3.0.7",
27282
+ "resolved": "https://registry.npmjs.org/@netlify/plugin-edge-handlers/-/plugin-edge-handlers-3.0.7.tgz",
27283
+ "integrity": "sha512-ThceMAZ7M0k6WVcZwszVh9qozZKveQCnmQtWZW69Qf+g1pGHFkGIt9Vclt5op+Dd8bIdk0kcu1NnX9Ll7eZL1w==",
27284
27284
  "requires": {
27285
27285
  "@babel/core": "^7.11.4",
27286
27286
  "@babel/preset-env": "^7.11.5",
@@ -27300,9 +27300,9 @@
27300
27300
  },
27301
27301
  "dependencies": {
27302
27302
  "node-fetch": {
27303
- "version": "3.2.0",
27304
- "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.0.tgz",
27305
- "integrity": "sha512-8xeimMwMItMw8hRrOl3C9/xzU49HV/yE6ORew/l+dxWimO5A4Ra8ld2rerlJvc/O7et5Z1zrWsPX43v1QBjCxw==",
27303
+ "version": "3.2.1",
27304
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.1.tgz",
27305
+ "integrity": "sha512-Ef3SPFtRWFCDyhvcwCSvacLpkwmYZcD57mmZzAsMiks9TpHpIghe32U9H06tMICnr+X7YCpzH7WvUlUoml2urA==",
27306
27306
  "requires": {
27307
27307
  "data-uri-to-buffer": "^4.0.0",
27308
27308
  "fetch-blob": "^3.1.4",
@@ -37123,9 +37123,9 @@
37123
37123
  }
37124
37124
  },
37125
37125
  "netlify-redirect-parser": {
37126
- "version": "13.0.4",
37127
- "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-13.0.4.tgz",
37128
- "integrity": "sha512-Dg3JACJTcMwjof4FzeV9yDl6BgWkIIoBBfZxBjV2PNv9+QRYb1bOE7k4jx4HA9TTwzNQCJCdfJqmIqtR/w3Qrg==",
37126
+ "version": "13.0.5",
37127
+ "resolved": "https://registry.npmjs.org/netlify-redirect-parser/-/netlify-redirect-parser-13.0.5.tgz",
37128
+ "integrity": "sha512-Q5YEQu9YLItP38VzmzJRZ+dP4HTnK0i4Reczq+AC4UDGGEcf9JkyUC8f9YgCoamtMPjX3Qb+o+7lF1vYztH/UQ==",
37129
37129
  "requires": {
37130
37130
  "filter-obj": "^3.0.0",
37131
37131
  "is-plain-obj": "^4.0.0",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "9.9.0",
4
+ "version": "9.9.1",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
@@ -201,10 +201,10 @@
201
201
  },
202
202
  "dependencies": {
203
203
  "@netlify/build": "^26.3.10",
204
- "@netlify/config": "^17.0.15",
204
+ "@netlify/config": "^17.0.16",
205
205
  "@netlify/framework-info": "^9.0.2",
206
206
  "@netlify/local-functions-proxy": "^1.1.1",
207
- "@netlify/plugin-edge-handlers": "^3.0.6",
207
+ "@netlify/plugin-edge-handlers": "^3.0.7",
208
208
  "@netlify/plugins-list": "^6.14.0",
209
209
  "@netlify/routing-local-proxy": "^0.34.1",
210
210
  "@netlify/zip-it-and-ship-it": "^5.9.0",
@@ -273,7 +273,7 @@
273
273
  "netlify": "^11.0.0",
274
274
  "netlify-headers-parser": "^6.0.2",
275
275
  "netlify-onegraph-internal": "0.0.50",
276
- "netlify-redirect-parser": "^13.0.4",
276
+ "netlify-redirect-parser": "^13.0.5",
277
277
  "netlify-redirector": "^0.2.1",
278
278
  "node-fetch": "^2.6.0",
279
279
  "node-version-alias": "^1.0.1",
@@ -1,5 +1,4 @@
1
1
  // @ts-check
2
- const events = require('events')
3
2
  const process = require('process')
4
3
  const { format } = require('util')
5
4
 
@@ -29,7 +28,6 @@ const {
29
28
  pollForToken,
30
29
  sortOptions,
31
30
  track,
32
- watchDebounced,
33
31
  } = require('../utils')
34
32
 
35
33
  // Netlify CLI client id. Lives in bot@netlify.com
@@ -121,11 +119,6 @@ class BaseCommand extends Command {
121
119
  await this.init(actionCommand)
122
120
  debug(`${name}:preAction`)('end')
123
121
  })
124
- .hook('postAction', async () => {
125
- if (this.configWatcherHandle) {
126
- await this.configWatcherHandle.close()
127
- }
128
- })
129
122
  )
130
123
  }
131
124
 
@@ -437,27 +430,10 @@ class BaseCommand extends Command {
437
430
  const globalConfig = await getGlobalConfig()
438
431
  const { NetlifyAPI } = await jsClient
439
432
 
440
- const configWatcher = new events.EventEmitter()
441
-
442
- // Only set up a watcher if we know the config path.
443
- if (configPath) {
444
- const configWatcherHandle = await watchDebounced(configPath, {
445
- depth: 1,
446
- onChange: async () => {
447
- const { config: newConfig } = await actionCommand.getConfig({ cwd, state, token, ...apiUrlOpts })
448
-
449
- const normalizedNewConfig = normalizeConfig(newConfig)
450
- configWatcher.emit('change', normalizedNewConfig)
451
- },
452
- })
453
-
454
- // chokidar handler
455
- this.configWatcherHandle = configWatcherHandle
456
- }
457
-
458
433
  actionCommand.netlify = {
459
434
  // api methods
460
435
  api: new NetlifyAPI(token || '', apiOpts),
436
+ apiOpts,
461
437
  repositoryRoot,
462
438
  // current site context
463
439
  site: {
@@ -480,8 +456,6 @@ class BaseCommand extends Command {
480
456
  globalConfig,
481
457
  // state of current site dir
482
458
  state,
483
- // netlify.toml file watcher
484
- configWatcher,
485
459
  }
486
460
  debug(`${this.name()}:init`)('end')
487
461
  }
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ const events = require('events')
2
3
  const path = require('path')
3
4
  const process = require('process')
4
5
  const { promisify } = require('util')
@@ -35,13 +36,17 @@ const {
35
36
  exit,
36
37
  generateNetlifyGraphJWT,
37
38
  getSiteInformation,
39
+ getToken,
38
40
  injectEnvVariables,
39
41
  log,
42
+ normalizeConfig,
40
43
  openBrowser,
44
+ processOnExit,
41
45
  startForwardProxy,
42
46
  startLiveTunnel,
43
47
  startProxy,
44
48
  warn,
49
+ watchDebounced,
45
50
  } = require('../../utils')
46
51
 
47
52
  const { createDevExecCommand } = require('./dev-exec')
@@ -147,9 +152,7 @@ const runCommand = (command, env = {}) => {
147
152
 
148
153
  return await cleanupBeforeExit({ exitCode: 1 })
149
154
  })
150
- ;['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP', 'exit'].forEach((signal) => {
151
- process.on(signal, async () => await cleanupBeforeExit({}))
152
- })
155
+ processOnExit(async () => await cleanupBeforeExit({}))
153
156
 
154
157
  return commandProcess
155
158
  }
@@ -417,9 +420,31 @@ const dev = async (options, command) => {
417
420
  return oneGraphSessionId
418
421
  }
419
422
 
420
- //
423
+ const configWatcher = new events.EventEmitter()
424
+
425
+ // Only set up a watcher if we know the config path.
426
+ const { configPath } = command.netlify.site
427
+ if (configPath) {
428
+ // chokidar handle
429
+ command.configWatcherHandle = await watchDebounced(configPath, {
430
+ depth: 1,
431
+ onChange: async () => {
432
+ const cwd = options.cwd || process.cwd()
433
+ const [token] = await getToken(options.auth)
434
+ const { config: newConfig } = await command.getConfig({ cwd, state, token, ...command.netlify.apiUrlOpts })
435
+
436
+ const normalizedNewConfig = normalizeConfig(newConfig)
437
+ configWatcher.emit('change', normalizedNewConfig)
438
+ },
439
+ })
440
+
441
+ processOnExit(async () => {
442
+ await command.configWatcherHandle.close()
443
+ })
444
+ }
445
+
421
446
  // Set up a handler for config changes.
422
- command.netlify.configWatcher.on('change', (newConfig) => {
447
+ configWatcher.on('change', (newConfig) => {
423
448
  command.netlify.config = newConfig
424
449
  stopWatchingCLISessions()
425
450
  createOrResumeSession()
@@ -486,8 +511,10 @@ const createDevCommand = (program) => {
486
511
  'netlify dev',
487
512
  'netlify dev -d public',
488
513
  'netlify dev -c "hugo server -w" --targetPort 1313',
514
+ 'netlify dev --graph',
489
515
  'BROWSER=none netlify dev # disable browser auto opening',
490
516
  ])
491
517
  .action(dev)
492
518
  }
519
+
493
520
  module.exports = { createDevCommand }
@@ -63,7 +63,6 @@ const getFunctionZips = async ({
63
63
 
64
64
  const featureFlags = {
65
65
  zisi_detect_esm: true,
66
- zisi_pure_esm: true,
67
66
  }
68
67
 
69
68
  return await zipIt.zipFunctions(directories, tmpDir, { basePath: rootDir, config: functionsConfig, featureFlags })
package/src/utils/dev.js CHANGED
@@ -215,9 +215,17 @@ const generateNetlifyGraphJWT = ({ authlifyTokenId, netlifyToken, siteId }) => {
215
215
  )
216
216
  }
217
217
 
218
+ const processOnExit = (fn) => {
219
+ const signals = ['SIGINT', 'SIGTERM', 'SIGQUIT', 'SIGHUP', 'exit']
220
+ signals.forEach((signal) => {
221
+ process.on(signal, fn)
222
+ })
223
+ }
224
+
218
225
  module.exports = {
219
226
  getSiteInformation,
220
227
  injectEnvVariables,
221
228
  acquirePort,
222
229
  generateNetlifyGraphJWT,
230
+ processOnExit,
223
231
  }