netlify-cli 9.9.1 → 9.10.0

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": "9.9.1",
3
+ "version": "9.10.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "9.9.1",
9
+ "version": "9.10.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@netlify/build": "^26.3.10",
13
+ "@netlify/build": "^26.3.12",
14
14
  "@netlify/config": "^17.0.16",
15
15
  "@netlify/framework-info": "^9.0.2",
16
16
  "@netlify/local-functions-proxy": "^1.1.1",
17
17
  "@netlify/plugin-edge-handlers": "^3.0.7",
18
- "@netlify/plugins-list": "^6.14.0",
18
+ "@netlify/plugins-list": "^6.15.0",
19
19
  "@netlify/routing-local-proxy": "^0.34.1",
20
20
  "@netlify/zip-it-and-ship-it": "^5.9.0",
21
21
  "@octokit/rest": "^18.0.0",
@@ -2358,16 +2358,16 @@
2358
2358
  }
2359
2359
  },
2360
2360
  "node_modules/@netlify/build": {
2361
- "version": "26.3.10",
2362
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-26.3.10.tgz",
2363
- "integrity": "sha512-H+nl0VVMv2j/txGYLYwG5KLdh/eaDfAdCr5mBvMCZlfehoZySIA3S6thgUHVsGUDyyCeQ0H2wMQvHp6YgkkAsQ==",
2361
+ "version": "26.3.12",
2362
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-26.3.12.tgz",
2363
+ "integrity": "sha512-xZfCck6jmJi/r36t/4Vwlbtc9Q4SekQorkMfRkp7auUvixVVTzS50P8i5Uov1BYtO9dEgcVBU0HvwSHsjtpSfQ==",
2364
2364
  "dependencies": {
2365
2365
  "@bugsnag/js": "^7.0.0",
2366
2366
  "@netlify/cache-utils": "^4.0.0",
2367
2367
  "@netlify/config": "^17.0.0",
2368
2368
  "@netlify/functions-utils": "^4.0.0",
2369
2369
  "@netlify/git-utils": "^4.0.0",
2370
- "@netlify/plugin-edge-handlers": "^3.0.6",
2370
+ "@netlify/plugin-edge-handlers": "^3.0.7",
2371
2371
  "@netlify/plugins-list": "^6.14.0",
2372
2372
  "@netlify/run-utils": "^4.0.0",
2373
2373
  "@netlify/zip-it-and-ship-it": "5.9.0",
@@ -2737,9 +2737,9 @@
2737
2737
  }
2738
2738
  },
2739
2739
  "node_modules/@netlify/build/node_modules/map-obj": {
2740
- "version": "5.0.0",
2741
- "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz",
2742
- "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA==",
2740
+ "version": "5.0.1",
2741
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.1.tgz",
2742
+ "integrity": "sha512-p3Qoax94q4c4Pb4etNi2lQSQGlqOA4PoD3ARovo7NllRoObZHwNEYd40fz4qgX1zTFK4geU/R1kbowl5hU5OVg==",
2743
2743
  "engines": {
2744
2744
  "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
2745
2745
  },
@@ -2967,9 +2967,9 @@
2967
2967
  }
2968
2968
  },
2969
2969
  "node_modules/@netlify/build/node_modules/string-width": {
2970
- "version": "5.1.0",
2971
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz",
2972
- "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==",
2970
+ "version": "5.1.2",
2971
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
2972
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
2973
2973
  "dependencies": {
2974
2974
  "eastasianwidth": "^0.2.0",
2975
2975
  "emoji-regex": "^9.2.2",
@@ -4328,9 +4328,9 @@
4328
4328
  }
4329
4329
  },
4330
4330
  "node_modules/@netlify/plugins-list": {
4331
- "version": "6.14.0",
4332
- "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.14.0.tgz",
4333
- "integrity": "sha512-AOlFh13F5TLLq9uJ+/ahamWYnZAJIo36H55FnWvDlnfFvkp9aIfjHvMv4qL8/Tvc6a5Ulx1NYrL8Fpw6qd5YCw==",
4331
+ "version": "6.15.0",
4332
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.15.0.tgz",
4333
+ "integrity": "sha512-CGvHVRS+IInm+dyn8qEGrADsFiWY/HC8z+taIPQ9d7sZlNr3ShtXHq5fdHVHGH2A9WDVeh8+Xan87196KyE3IQ==",
4334
4334
  "engines": {
4335
4335
  "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
4336
4336
  }
@@ -26118,16 +26118,16 @@
26118
26118
  }
26119
26119
  },
26120
26120
  "@netlify/build": {
26121
- "version": "26.3.10",
26122
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-26.3.10.tgz",
26123
- "integrity": "sha512-H+nl0VVMv2j/txGYLYwG5KLdh/eaDfAdCr5mBvMCZlfehoZySIA3S6thgUHVsGUDyyCeQ0H2wMQvHp6YgkkAsQ==",
26121
+ "version": "26.3.12",
26122
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-26.3.12.tgz",
26123
+ "integrity": "sha512-xZfCck6jmJi/r36t/4Vwlbtc9Q4SekQorkMfRkp7auUvixVVTzS50P8i5Uov1BYtO9dEgcVBU0HvwSHsjtpSfQ==",
26124
26124
  "requires": {
26125
26125
  "@bugsnag/js": "^7.0.0",
26126
26126
  "@netlify/cache-utils": "^4.0.0",
26127
26127
  "@netlify/config": "^17.0.0",
26128
26128
  "@netlify/functions-utils": "^4.0.0",
26129
26129
  "@netlify/git-utils": "^4.0.0",
26130
- "@netlify/plugin-edge-handlers": "^3.0.6",
26130
+ "@netlify/plugin-edge-handlers": "^3.0.7",
26131
26131
  "@netlify/plugins-list": "^6.14.0",
26132
26132
  "@netlify/run-utils": "^4.0.0",
26133
26133
  "@netlify/zip-it-and-ship-it": "5.9.0",
@@ -26367,9 +26367,9 @@
26367
26367
  }
26368
26368
  },
26369
26369
  "map-obj": {
26370
- "version": "5.0.0",
26371
- "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.0.tgz",
26372
- "integrity": "sha512-2L3MIgJynYrZ3TYMriLDLWocz15okFakV6J12HXvMXDHui2x/zgChzg1u9mFFGbbGWE+GsLpQByt4POb9Or+uA=="
26370
+ "version": "5.0.1",
26371
+ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-5.0.1.tgz",
26372
+ "integrity": "sha512-p3Qoax94q4c4Pb4etNi2lQSQGlqOA4PoD3ARovo7NllRoObZHwNEYd40fz4qgX1zTFK4geU/R1kbowl5hU5OVg=="
26373
26373
  },
26374
26374
  "mimic-response": {
26375
26375
  "version": "2.1.0",
@@ -26496,9 +26496,9 @@
26496
26496
  }
26497
26497
  },
26498
26498
  "string-width": {
26499
- "version": "5.1.0",
26500
- "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.0.tgz",
26501
- "integrity": "sha512-7x54QnN21P+XL/v8SuNKvfgsUre6PXpN7mc77N3HlZv+f1SBRGmjxtOud2Z6FZ8DmdkD/IdjCaf9XXbnqmTZGQ==",
26499
+ "version": "5.1.2",
26500
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz",
26501
+ "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==",
26502
26502
  "requires": {
26503
26503
  "eastasianwidth": "^0.2.0",
26504
26504
  "emoji-regex": "^9.2.2",
@@ -27317,9 +27317,9 @@
27317
27317
  }
27318
27318
  },
27319
27319
  "@netlify/plugins-list": {
27320
- "version": "6.14.0",
27321
- "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.14.0.tgz",
27322
- "integrity": "sha512-AOlFh13F5TLLq9uJ+/ahamWYnZAJIo36H55FnWvDlnfFvkp9aIfjHvMv4qL8/Tvc6a5Ulx1NYrL8Fpw6qd5YCw=="
27320
+ "version": "6.15.0",
27321
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.15.0.tgz",
27322
+ "integrity": "sha512-CGvHVRS+IInm+dyn8qEGrADsFiWY/HC8z+taIPQ9d7sZlNr3ShtXHq5fdHVHGH2A9WDVeh8+Xan87196KyE3IQ=="
27323
27323
  },
27324
27324
  "@netlify/routing-local-proxy": {
27325
27325
  "version": "0.34.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": "9.9.1",
4
+ "version": "9.10.0",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "Abraham Schilling <AbrahamSchilling@gmail.com> (https://gitlab.com/n4bb12)",
@@ -200,12 +200,12 @@
200
200
  "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\" \"!site/package-lock.json\" \"!.github/**/*.md\""
201
201
  },
202
202
  "dependencies": {
203
- "@netlify/build": "^26.3.10",
203
+ "@netlify/build": "^26.3.12",
204
204
  "@netlify/config": "^17.0.16",
205
205
  "@netlify/framework-info": "^9.0.2",
206
206
  "@netlify/local-functions-proxy": "^1.1.1",
207
207
  "@netlify/plugin-edge-handlers": "^3.0.7",
208
- "@netlify/plugins-list": "^6.14.0",
208
+ "@netlify/plugins-list": "^6.15.0",
209
209
  "@netlify/routing-local-proxy": "^0.34.1",
210
210
  "@netlify/zip-it-and-ship-it": "^5.9.0",
211
211
  "@octokit/rest": "^18.0.0",
@@ -302,6 +302,7 @@ const runDeploy = async ({
302
302
  }) => {
303
303
  let results
304
304
  let deployId
305
+
305
306
  try {
306
307
  if (deployToProduction) {
307
308
  await prepareProductionDeploy({ siteData, api })
@@ -462,10 +463,26 @@ const deploy = async (options, command) => {
462
463
  await command.authenticate(options.auth)
463
464
 
464
465
  let siteId = options.site || site.id
466
+
465
467
  let siteData = {}
466
468
  if (siteId) {
467
469
  try {
468
- siteData = await api.getSite({ siteId })
470
+ const [{ siteError, siteFoundById }, sites] = await Promise.all([
471
+ api
472
+ .getSite({ siteId })
473
+ .then((data) => ({ siteFoundById: data }))
474
+ .catch((error_) => ({ siteError: error_ })),
475
+ api.listSites({ name: options.site, filter: 'all' }),
476
+ ])
477
+ const siteFoundByName = sites.find((filteredSite) => filteredSite.name === options.site)
478
+ if (siteFoundById) {
479
+ siteData = siteFoundById
480
+ } else if (siteFoundByName) {
481
+ siteData = siteFoundByName
482
+ siteId = siteFoundByName.id
483
+ } else {
484
+ throw siteError
485
+ }
469
486
  } catch (error_) {
470
487
  // TODO specifically handle known cases (e.g. no account access)
471
488
  if (error_.status === 404) {
@@ -674,7 +691,7 @@ Support for package.json's main field, and intrinsic index.js entrypoints are co
674
691
  .option('-o, --open', 'Open site after deploy', false)
675
692
  .option('-m, --message <message>', 'A short message to include in the deploy log')
676
693
  .option('-a, --auth <token>', 'Netlify auth token to deploy with', env.NETLIFY_AUTH_TOKEN)
677
- .option('-s, --site <id>', 'A site ID to deploy to', env.NETLIFY_SITE_ID)
694
+ .option('-s, --site <name-or-id>', 'A site name or ID to deploy to', env.NETLIFY_SITE_ID)
678
695
  .option('--json', 'Output deployment data as JSON')
679
696
  .option('--timeout <number>', 'Timeout to wait for deployment to finish', (value) => Number.parseInt(value))
680
697
  .option('--trigger', 'Trigger a new build of your site on Netlify without uploading local files')
@@ -687,6 +704,7 @@ Support for package.json's main field, and intrinsic index.js entrypoints are co
687
704
  )
688
705
  .addExamples([
689
706
  'netlify deploy',
707
+ 'netlify deploy --site my-first-site',
690
708
  'netlify deploy --prod',
691
709
  'netlify deploy --prod --open',
692
710
  'netlify deploy --prodIfUnlocked',
package/src/lib/build.js CHANGED
@@ -18,11 +18,12 @@ const netlifyBuildPromise = import('@netlify/build')
18
18
  * @param {import('commander').OptionValues} config.options
19
19
  * @returns {BuildConfig}
20
20
  */
21
- const getBuildOptions = ({ cachedConfig, options: { debug, dry, json, offline, silent }, token }) => ({
21
+ const getBuildOptions = ({ cachedConfig, options: { context, debug, dry, json, offline, silent }, token }) => ({
22
22
  cachedConfig,
23
23
  token,
24
24
  dry,
25
25
  debug,
26
+ context,
26
27
  mode: 'cli',
27
28
  telemetry: false,
28
29
  // buffer = true will not stream output