netlify-cli 11.3.0 → 11.5.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,22 +1,22 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "11.3.0",
3
+ "version": "11.5.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "11.3.0",
9
+ "version": "11.5.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@netlify/build": "^27.15.5",
14
- "@netlify/config": "^18.2.1",
15
- "@netlify/edge-bundler": "^1.13.0",
13
+ "@netlify/build": "^27.16.1",
14
+ "@netlify/config": "^18.2.3",
15
+ "@netlify/edge-bundler": "^1.14.1",
16
16
  "@netlify/framework-info": "^9.2.0",
17
17
  "@netlify/local-functions-proxy": "^1.1.1",
18
- "@netlify/plugins-list": "^6.39.0",
19
- "@netlify/zip-it-and-ship-it": "^5.13.5",
18
+ "@netlify/plugins-list": "^6.41.0",
19
+ "@netlify/zip-it-and-ship-it": "^6.0.0",
20
20
  "@octokit/rest": "^18.0.0",
21
21
  "@sindresorhus/slugify": "^1.1.0",
22
22
  "ansi-escapes": "^5.0.0",
@@ -83,7 +83,7 @@
83
83
  "netlify-headers-parser": "^6.0.2",
84
84
  "netlify-onegraph-internal": "0.10.0",
85
85
  "netlify-redirect-parser": "^13.0.5",
86
- "netlify-redirector": "^0.2.1",
86
+ "netlify-redirector": "^0.3.1",
87
87
  "node-fetch": "^2.6.0",
88
88
  "node-version-alias": "^1.0.1",
89
89
  "omit.js": "^2.0.2",
@@ -1189,19 +1189,19 @@
1189
1189
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
1190
1190
  },
1191
1191
  "node_modules/@netlify/build": {
1192
- "version": "27.15.5",
1193
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.15.5.tgz",
1194
- "integrity": "sha512-DfzpiNztkB+7e0eM3B8QrXGP1Fc0ky/9ow5Mwg3+R7VeFKknVFAF8PKddQucR1vS0CW1lL1/jjcrv1M5zudVmQ==",
1192
+ "version": "27.16.1",
1193
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.16.1.tgz",
1194
+ "integrity": "sha512-hXOivv/zCd/xPSL7XaqHvnn6GpXUSkztis9QfawLa39W6X01gDj2bXfQBW+cPxTT6S/UaGz70rwthPW9431pOQ==",
1195
1195
  "dependencies": {
1196
1196
  "@bugsnag/js": "^7.0.0",
1197
1197
  "@netlify/cache-utils": "^4.0.0",
1198
- "@netlify/config": "^18.2.2",
1199
- "@netlify/edge-bundler": "^1.13.0",
1200
- "@netlify/functions-utils": "^4.2.4",
1198
+ "@netlify/config": "^18.2.3",
1199
+ "@netlify/edge-bundler": "^1.14.1",
1200
+ "@netlify/functions-utils": "^4.2.5",
1201
1201
  "@netlify/git-utils": "^4.0.0",
1202
- "@netlify/plugins-list": "^6.36.0",
1202
+ "@netlify/plugins-list": "^6.41.0",
1203
1203
  "@netlify/run-utils": "^4.0.0",
1204
- "@netlify/zip-it-and-ship-it": "^5.13.5",
1204
+ "@netlify/zip-it-and-ship-it": "^6.0.0",
1205
1205
  "@sindresorhus/slugify": "^2.0.0",
1206
1206
  "@types/node": "^16.0.0",
1207
1207
  "ajv": "^8.11.0",
@@ -1806,9 +1806,9 @@
1806
1806
  }
1807
1807
  },
1808
1808
  "node_modules/@netlify/build/node_modules/read-pkg-up/node_modules/type-fest": {
1809
- "version": "2.18.1",
1810
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
1811
- "integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ==",
1809
+ "version": "2.19.0",
1810
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
1811
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
1812
1812
  "engines": {
1813
1813
  "node": ">=12.20"
1814
1814
  },
@@ -1817,9 +1817,9 @@
1817
1817
  }
1818
1818
  },
1819
1819
  "node_modules/@netlify/build/node_modules/read-pkg/node_modules/type-fest": {
1820
- "version": "2.18.1",
1821
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
1822
- "integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ==",
1820
+ "version": "2.19.0",
1821
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
1822
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
1823
1823
  "engines": {
1824
1824
  "node": ">=12.20"
1825
1825
  },
@@ -2011,9 +2011,9 @@
2011
2011
  }
2012
2012
  },
2013
2013
  "node_modules/@netlify/config": {
2014
- "version": "18.2.2",
2015
- "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.2.tgz",
2016
- "integrity": "sha512-VgtbLwjjkh6vRIejAuXY8DIvNvXia8ta1Bphkb33Dr3VbGITvZ0avRcnC0BANpKZCBb6jsaubyMwg7V6IzDkPw==",
2014
+ "version": "18.2.3",
2015
+ "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.3.tgz",
2016
+ "integrity": "sha512-z5pFAAVBfIvTsSv3lchfByWYNajPgiCKEbx3JkU/CtIljCtSR3f0B/GVqpHgCOJ9pfS0idVP60EhDHA2QLeUrg==",
2017
2017
  "dependencies": {
2018
2018
  "chalk": "^5.0.0",
2019
2019
  "cron-parser": "^4.1.0",
@@ -2028,7 +2028,7 @@
2028
2028
  "is-plain-obj": "^4.0.0",
2029
2029
  "js-yaml": "^4.0.0",
2030
2030
  "map-obj": "^5.0.0",
2031
- "netlify": "^12.0.0",
2031
+ "netlify": "^12.0.1",
2032
2032
  "netlify-headers-parser": "^6.0.2",
2033
2033
  "netlify-redirect-parser": "13.0.5",
2034
2034
  "omit.js": "^2.0.2",
@@ -2321,9 +2321,9 @@
2321
2321
  }
2322
2322
  },
2323
2323
  "node_modules/@netlify/config/node_modules/type-fest": {
2324
- "version": "2.18.1",
2325
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
2326
- "integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ==",
2324
+ "version": "2.19.0",
2325
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
2326
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==",
2327
2327
  "engines": {
2328
2328
  "node": ">=12.20"
2329
2329
  },
@@ -2343,9 +2343,9 @@
2343
2343
  }
2344
2344
  },
2345
2345
  "node_modules/@netlify/edge-bundler": {
2346
- "version": "1.13.0",
2347
- "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.13.0.tgz",
2348
- "integrity": "sha512-5LDNouZP2tUt3m6NyKkEgor9PycIEq7wxUgrRSpiUcZVV7CNU/CUxxpXJb11/wEFq2bWZp3/xqzxqbR7vpqFNg==",
2346
+ "version": "1.14.1",
2347
+ "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.14.1.tgz",
2348
+ "integrity": "sha512-0FJSvK5kZlf093aaWyvcULRzeUImypHn63oVsC+t8xvR08bhA9LebrYHPgQ/0GhFA8yDY+tz25xrNJ6JKKDWEw==",
2349
2349
  "dependencies": {
2350
2350
  "common-path-prefix": "^3.0.0",
2351
2351
  "del": "^6.0.0",
@@ -3243,11 +3243,11 @@
3243
3243
  }
3244
3244
  },
3245
3245
  "node_modules/@netlify/functions-utils": {
3246
- "version": "4.2.4",
3247
- "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.4.tgz",
3248
- "integrity": "sha512-+Uw9qO6lIshJrcieriAluGhjFM8JsyNFe5TGxkTssfUeel/+RIrIG5RMslrBoEk8HUKL+4HQDbZRoI6DtWlwsw==",
3246
+ "version": "4.2.5",
3247
+ "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.5.tgz",
3248
+ "integrity": "sha512-sa8TAD35xO/6q3YSpqlObOSfC25n0JT6DV+j3WaZ5NCSXAdlZJD+pT02pudputwstfMPJtw7GJg3buIiTyGulQ==",
3249
3249
  "dependencies": {
3250
- "@netlify/zip-it-and-ship-it": "^5.13.5",
3250
+ "@netlify/zip-it-and-ship-it": "^6.0.0",
3251
3251
  "cpy": "^8.1.0",
3252
3252
  "path-exists": "^5.0.0"
3253
3253
  },
@@ -3593,9 +3593,9 @@
3593
3593
  "integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
3594
3594
  },
3595
3595
  "node_modules/@netlify/plugins-list": {
3596
- "version": "6.39.0",
3597
- "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.39.0.tgz",
3598
- "integrity": "sha512-f8sMN7XFlQQ63km5vhg5y5+E3DXoWEoAe94YOMGlmzifZCCzPS/bEUVaQ07n+iDspy3dOIN97FHAAu0B2Jpe2Q==",
3596
+ "version": "6.41.0",
3597
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.41.0.tgz",
3598
+ "integrity": "sha512-WUXn1kk1oDumzYKQVAf3Z5xQkVuHyR6k+LGt2qq6rFlxILmFA3gWMSf+AwVfT2bYK8gHWcdz2I9MSo5hbp1ohQ==",
3599
3599
  "engines": {
3600
3600
  "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
3601
3601
  }
@@ -3703,9 +3703,9 @@
3703
3703
  }
3704
3704
  },
3705
3705
  "node_modules/@netlify/zip-it-and-ship-it": {
3706
- "version": "5.13.5",
3707
- "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-5.13.5.tgz",
3708
- "integrity": "sha512-oVXGtGwUQqEDBRApwKgqfauuzD+FhyxKGcwERF2fZLOiH24NoBcskaNDW6TCJmBj3hKiVCgmp69hapvjMVibFQ==",
3706
+ "version": "6.0.0",
3707
+ "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-6.0.0.tgz",
3708
+ "integrity": "sha512-5nxAeUwQ6ftlnlRShRa7oY+RPiYBRH2qMmTR6RwsBYzUBUzoTgdb+X8tOnO4FFAKndXzzjJrO/ubp+YMeOKSbg==",
3709
3709
  "dependencies": {
3710
3710
  "@babel/parser": "7.16.8",
3711
3711
  "@netlify/binary-info": "^1.0.0",
@@ -3722,6 +3722,7 @@
3722
3722
  "find-up": "^5.0.0",
3723
3723
  "glob": "^8.0.3",
3724
3724
  "is-builtin-module": "^3.1.0",
3725
+ "is-path-inside": "^3.0.3",
3725
3726
  "junk": "^3.1.0",
3726
3727
  "locate-path": "^6.0.0",
3727
3728
  "merge-options": "^3.0.4",
@@ -5486,9 +5487,9 @@
5486
5487
  }
5487
5488
  },
5488
5489
  "node_modules/ava": {
5489
- "version": "4.3.1",
5490
- "resolved": "https://registry.npmjs.org/ava/-/ava-4.3.1.tgz",
5491
- "integrity": "sha512-zdSp9QxRTmN5hJeGmg+ZjUKL5yHFLMcP/0KBla8GH25XD8Xm7Uc34CDFlwqGL6JXtjNbVkJ0Zw+DqcTf4ggCCA==",
5490
+ "version": "4.3.3",
5491
+ "resolved": "https://registry.npmjs.org/ava/-/ava-4.3.3.tgz",
5492
+ "integrity": "sha512-9Egq/d9R74ExrWohHeqUlexjDbgZJX5jA1Wq4KCTqc3wIfpGEK79zVy4rBtofJ9YKIxs4PzhJ8BgbW5PlAYe6w==",
5492
5493
  "dev": true,
5493
5494
  "dependencies": {
5494
5495
  "acorn": "^8.7.1",
@@ -16018,9 +16019,9 @@
16018
16019
  }
16019
16020
  },
16020
16021
  "node_modules/netlify-redirector": {
16021
- "version": "0.2.1",
16022
- "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.2.1.tgz",
16023
- "integrity": "sha512-17vDR9p1Loanp+vd57y+b6WlKb5X+qb0LZ44oTYsKJbdonz4Md+Ybv1lzH1w1aKm5YWWXHR8LMpWyY9bjlAJKw=="
16022
+ "version": "0.3.1",
16023
+ "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.3.1.tgz",
16024
+ "integrity": "sha512-+8x07Ukx8vgKkGqTDq1GrkuCRR0DqheZ9fF5PXk6VbIChp9Qi8+psmwBV3hjocoyUvUGH7CIHLUk05aVwLN3wA=="
16024
16025
  },
16025
16026
  "node_modules/netlify/node_modules/node-fetch": {
16026
16027
  "version": "3.2.10",
@@ -21495,9 +21496,9 @@
21495
21496
  }
21496
21497
  },
21497
21498
  "node_modules/typescript": {
21498
- "version": "4.7.4",
21499
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
21500
- "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
21499
+ "version": "4.8.2",
21500
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
21501
+ "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==",
21501
21502
  "bin": {
21502
21503
  "tsc": "bin/tsc",
21503
21504
  "tsserver": "bin/tsserver"
@@ -22410,15 +22411,15 @@
22410
22411
  "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
22411
22412
  },
22412
22413
  "node_modules/write-file-atomic": {
22413
- "version": "4.0.1",
22414
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz",
22415
- "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==",
22414
+ "version": "4.0.2",
22415
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz",
22416
+ "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==",
22416
22417
  "dependencies": {
22417
22418
  "imurmurhash": "^0.1.4",
22418
22419
  "signal-exit": "^3.0.7"
22419
22420
  },
22420
22421
  "engines": {
22421
- "node": "^12.13.0 || ^14.15.0 || >=16"
22422
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
22422
22423
  }
22423
22424
  },
22424
22425
  "node_modules/ws": {
@@ -23374,19 +23375,19 @@
23374
23375
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
23375
23376
  },
23376
23377
  "@netlify/build": {
23377
- "version": "27.15.5",
23378
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.15.5.tgz",
23379
- "integrity": "sha512-DfzpiNztkB+7e0eM3B8QrXGP1Fc0ky/9ow5Mwg3+R7VeFKknVFAF8PKddQucR1vS0CW1lL1/jjcrv1M5zudVmQ==",
23378
+ "version": "27.16.1",
23379
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.16.1.tgz",
23380
+ "integrity": "sha512-hXOivv/zCd/xPSL7XaqHvnn6GpXUSkztis9QfawLa39W6X01gDj2bXfQBW+cPxTT6S/UaGz70rwthPW9431pOQ==",
23380
23381
  "requires": {
23381
23382
  "@bugsnag/js": "^7.0.0",
23382
23383
  "@netlify/cache-utils": "^4.0.0",
23383
- "@netlify/config": "^18.2.2",
23384
- "@netlify/edge-bundler": "^1.13.0",
23385
- "@netlify/functions-utils": "^4.2.4",
23384
+ "@netlify/config": "^18.2.3",
23385
+ "@netlify/edge-bundler": "^1.14.1",
23386
+ "@netlify/functions-utils": "^4.2.5",
23386
23387
  "@netlify/git-utils": "^4.0.0",
23387
- "@netlify/plugins-list": "^6.36.0",
23388
+ "@netlify/plugins-list": "^6.41.0",
23388
23389
  "@netlify/run-utils": "^4.0.0",
23389
- "@netlify/zip-it-and-ship-it": "^5.13.5",
23390
+ "@netlify/zip-it-and-ship-it": "^6.0.0",
23390
23391
  "@sindresorhus/slugify": "^2.0.0",
23391
23392
  "@types/node": "^16.0.0",
23392
23393
  "ajv": "^8.11.0",
@@ -23752,9 +23753,9 @@
23752
23753
  },
23753
23754
  "dependencies": {
23754
23755
  "type-fest": {
23755
- "version": "2.18.1",
23756
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
23757
- "integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ=="
23756
+ "version": "2.19.0",
23757
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
23758
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
23758
23759
  }
23759
23760
  }
23760
23761
  },
@@ -23769,9 +23770,9 @@
23769
23770
  },
23770
23771
  "dependencies": {
23771
23772
  "type-fest": {
23772
- "version": "2.18.1",
23773
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
23774
- "integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ=="
23773
+ "version": "2.19.0",
23774
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
23775
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
23775
23776
  }
23776
23777
  }
23777
23778
  },
@@ -23885,9 +23886,9 @@
23885
23886
  }
23886
23887
  },
23887
23888
  "@netlify/config": {
23888
- "version": "18.2.2",
23889
- "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.2.tgz",
23890
- "integrity": "sha512-VgtbLwjjkh6vRIejAuXY8DIvNvXia8ta1Bphkb33Dr3VbGITvZ0avRcnC0BANpKZCBb6jsaubyMwg7V6IzDkPw==",
23889
+ "version": "18.2.3",
23890
+ "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.3.tgz",
23891
+ "integrity": "sha512-z5pFAAVBfIvTsSv3lchfByWYNajPgiCKEbx3JkU/CtIljCtSR3f0B/GVqpHgCOJ9pfS0idVP60EhDHA2QLeUrg==",
23891
23892
  "requires": {
23892
23893
  "chalk": "^5.0.0",
23893
23894
  "cron-parser": "^4.1.0",
@@ -23902,7 +23903,7 @@
23902
23903
  "is-plain-obj": "^4.0.0",
23903
23904
  "js-yaml": "^4.0.0",
23904
23905
  "map-obj": "^5.0.0",
23905
- "netlify": "^12.0.0",
23906
+ "netlify": "^12.0.1",
23906
23907
  "netlify-headers-parser": "^6.0.2",
23907
23908
  "netlify-redirect-parser": "13.0.5",
23908
23909
  "omit.js": "^2.0.2",
@@ -24063,9 +24064,9 @@
24063
24064
  "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw=="
24064
24065
  },
24065
24066
  "type-fest": {
24066
- "version": "2.18.1",
24067
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.1.tgz",
24068
- "integrity": "sha512-UKCINsd4qiATXD6OIlnQw9t1ux/n2ld+Nl0kzPbCONhCaUIS/BhJbNw14w6584HCQWf3frBK8vmWnGZq/sbPHQ=="
24067
+ "version": "2.19.0",
24068
+ "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz",
24069
+ "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA=="
24069
24070
  },
24070
24071
  "yocto-queue": {
24071
24072
  "version": "1.0.0",
@@ -24075,9 +24076,9 @@
24075
24076
  }
24076
24077
  },
24077
24078
  "@netlify/edge-bundler": {
24078
- "version": "1.13.0",
24079
- "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.13.0.tgz",
24080
- "integrity": "sha512-5LDNouZP2tUt3m6NyKkEgor9PycIEq7wxUgrRSpiUcZVV7CNU/CUxxpXJb11/wEFq2bWZp3/xqzxqbR7vpqFNg==",
24079
+ "version": "1.14.1",
24080
+ "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-1.14.1.tgz",
24081
+ "integrity": "sha512-0FJSvK5kZlf093aaWyvcULRzeUImypHn63oVsC+t8xvR08bhA9LebrYHPgQ/0GhFA8yDY+tz25xrNJ6JKKDWEw==",
24081
24082
  "requires": {
24082
24083
  "common-path-prefix": "^3.0.0",
24083
24084
  "del": "^6.0.0",
@@ -24577,11 +24578,11 @@
24577
24578
  }
24578
24579
  },
24579
24580
  "@netlify/functions-utils": {
24580
- "version": "4.2.4",
24581
- "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.4.tgz",
24582
- "integrity": "sha512-+Uw9qO6lIshJrcieriAluGhjFM8JsyNFe5TGxkTssfUeel/+RIrIG5RMslrBoEk8HUKL+4HQDbZRoI6DtWlwsw==",
24581
+ "version": "4.2.5",
24582
+ "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-4.2.5.tgz",
24583
+ "integrity": "sha512-sa8TAD35xO/6q3YSpqlObOSfC25n0JT6DV+j3WaZ5NCSXAdlZJD+pT02pudputwstfMPJtw7GJg3buIiTyGulQ==",
24583
24584
  "requires": {
24584
- "@netlify/zip-it-and-ship-it": "^5.13.5",
24585
+ "@netlify/zip-it-and-ship-it": "^6.0.0",
24585
24586
  "cpy": "^8.1.0",
24586
24587
  "path-exists": "^5.0.0"
24587
24588
  },
@@ -24766,9 +24767,9 @@
24766
24767
  "integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
24767
24768
  },
24768
24769
  "@netlify/plugins-list": {
24769
- "version": "6.39.0",
24770
- "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.39.0.tgz",
24771
- "integrity": "sha512-f8sMN7XFlQQ63km5vhg5y5+E3DXoWEoAe94YOMGlmzifZCCzPS/bEUVaQ07n+iDspy3dOIN97FHAAu0B2Jpe2Q=="
24770
+ "version": "6.41.0",
24771
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.41.0.tgz",
24772
+ "integrity": "sha512-WUXn1kk1oDumzYKQVAf3Z5xQkVuHyR6k+LGt2qq6rFlxILmFA3gWMSf+AwVfT2bYK8gHWcdz2I9MSo5hbp1ohQ=="
24772
24773
  },
24773
24774
  "@netlify/run-utils": {
24774
24775
  "version": "4.0.1",
@@ -24833,9 +24834,9 @@
24833
24834
  }
24834
24835
  },
24835
24836
  "@netlify/zip-it-and-ship-it": {
24836
- "version": "5.13.5",
24837
- "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-5.13.5.tgz",
24838
- "integrity": "sha512-oVXGtGwUQqEDBRApwKgqfauuzD+FhyxKGcwERF2fZLOiH24NoBcskaNDW6TCJmBj3hKiVCgmp69hapvjMVibFQ==",
24837
+ "version": "6.0.0",
24838
+ "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-6.0.0.tgz",
24839
+ "integrity": "sha512-5nxAeUwQ6ftlnlRShRa7oY+RPiYBRH2qMmTR6RwsBYzUBUzoTgdb+X8tOnO4FFAKndXzzjJrO/ubp+YMeOKSbg==",
24839
24840
  "requires": {
24840
24841
  "@babel/parser": "7.16.8",
24841
24842
  "@netlify/binary-info": "^1.0.0",
@@ -24852,6 +24853,7 @@
24852
24853
  "find-up": "^5.0.0",
24853
24854
  "glob": "^8.0.3",
24854
24855
  "is-builtin-module": "^3.1.0",
24856
+ "is-path-inside": "^3.0.3",
24855
24857
  "junk": "^3.1.0",
24856
24858
  "locate-path": "^6.0.0",
24857
24859
  "merge-options": "^3.0.4",
@@ -26232,9 +26234,9 @@
26232
26234
  "dev": true
26233
26235
  },
26234
26236
  "ava": {
26235
- "version": "4.3.1",
26236
- "resolved": "https://registry.npmjs.org/ava/-/ava-4.3.1.tgz",
26237
- "integrity": "sha512-zdSp9QxRTmN5hJeGmg+ZjUKL5yHFLMcP/0KBla8GH25XD8Xm7Uc34CDFlwqGL6JXtjNbVkJ0Zw+DqcTf4ggCCA==",
26237
+ "version": "4.3.3",
26238
+ "resolved": "https://registry.npmjs.org/ava/-/ava-4.3.3.tgz",
26239
+ "integrity": "sha512-9Egq/d9R74ExrWohHeqUlexjDbgZJX5jA1Wq4KCTqc3wIfpGEK79zVy4rBtofJ9YKIxs4PzhJ8BgbW5PlAYe6w==",
26238
26240
  "dev": true,
26239
26241
  "requires": {
26240
26242
  "acorn": "^8.7.1",
@@ -34232,9 +34234,9 @@
34232
34234
  }
34233
34235
  },
34234
34236
  "netlify-redirector": {
34235
- "version": "0.2.1",
34236
- "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.2.1.tgz",
34237
- "integrity": "sha512-17vDR9p1Loanp+vd57y+b6WlKb5X+qb0LZ44oTYsKJbdonz4Md+Ybv1lzH1w1aKm5YWWXHR8LMpWyY9bjlAJKw=="
34237
+ "version": "0.3.1",
34238
+ "resolved": "https://registry.npmjs.org/netlify-redirector/-/netlify-redirector-0.3.1.tgz",
34239
+ "integrity": "sha512-+8x07Ukx8vgKkGqTDq1GrkuCRR0DqheZ9fF5PXk6VbIChp9Qi8+psmwBV3hjocoyUvUGH7CIHLUk05aVwLN3wA=="
34238
34240
  },
34239
34241
  "next-tick": {
34240
34242
  "version": "1.1.0",
@@ -38404,9 +38406,9 @@
38404
38406
  }
38405
38407
  },
38406
38408
  "typescript": {
38407
- "version": "4.7.4",
38408
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
38409
- "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ=="
38409
+ "version": "4.8.2",
38410
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
38411
+ "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw=="
38410
38412
  },
38411
38413
  "uglify-js": {
38412
38414
  "version": "3.15.0",
@@ -39129,9 +39131,9 @@
39129
39131
  "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
39130
39132
  },
39131
39133
  "write-file-atomic": {
39132
- "version": "4.0.1",
39133
- "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz",
39134
- "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==",
39134
+ "version": "4.0.2",
39135
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz",
39136
+ "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==",
39135
39137
  "requires": {
39136
39138
  "imurmurhash": "^0.1.4",
39137
39139
  "signal-exit": "^3.0.7"
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.3.0",
4
+ "version": "11.5.1",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "@whitep4nth3r (https://twitter.com/whitep4nth3r)",
@@ -46,6 +46,7 @@
46
46
  "Erez Rokah (https://www.erezro.com)",
47
47
  "Erica Pisani <pisani.erica@gmail.com>",
48
48
  "Evans Hauser (https://twitter.com/evanshauser)",
49
+ "Ewan Valentine <ewan.valentine89@gmail.com> (http://ewanvalentine.io)",
49
50
  "Finn Woelm (https://twitter.com/FinnWoelm)",
50
51
  "Flxbot",
51
52
  "Gavin Henderson <gavin.henderson@hotmail.co.uk> (https://twitter.com/gavinhenderson5)",
@@ -222,13 +223,13 @@
222
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\""
223
224
  },
224
225
  "dependencies": {
225
- "@netlify/build": "^27.15.5",
226
- "@netlify/config": "^18.2.1",
227
- "@netlify/edge-bundler": "^1.13.0",
226
+ "@netlify/build": "^27.16.1",
227
+ "@netlify/config": "^18.2.3",
228
+ "@netlify/edge-bundler": "^1.14.1",
228
229
  "@netlify/framework-info": "^9.2.0",
229
230
  "@netlify/local-functions-proxy": "^1.1.1",
230
- "@netlify/plugins-list": "^6.39.0",
231
- "@netlify/zip-it-and-ship-it": "^5.13.5",
231
+ "@netlify/plugins-list": "^6.41.0",
232
+ "@netlify/zip-it-and-ship-it": "^6.0.0",
232
233
  "@octokit/rest": "^18.0.0",
233
234
  "@sindresorhus/slugify": "^1.1.0",
234
235
  "ansi-escapes": "^5.0.0",
@@ -295,7 +296,7 @@
295
296
  "netlify-headers-parser": "^6.0.2",
296
297
  "netlify-onegraph-internal": "0.10.0",
297
298
  "netlify-redirect-parser": "^13.0.5",
298
- "netlify-redirector": "^0.2.1",
299
+ "netlify-redirector": "^0.3.1",
299
300
  "node-fetch": "^2.6.0",
300
301
  "node-version-alias": "^1.0.1",
301
302
  "omit.js": "^2.0.2",
@@ -2,7 +2,7 @@ const process = require('process')
2
2
 
3
3
  // @ts-check
4
4
  const { getBuildOptions, runBuild } = require('../../lib/build')
5
- const { error, exit, generateNetlifyGraphJWT, getEnvelopeEnv, getToken } = require('../../utils')
5
+ const { error, exit, generateNetlifyGraphJWT, getEnvelopeEnv, getToken, normalizeContext } = require('../../utils')
6
6
 
7
7
  /**
8
8
  * @param {import('../../lib/build').BuildConfig} options
@@ -85,7 +85,12 @@ const createBuildCommand = (program) =>
85
85
  program
86
86
  .command('build')
87
87
  .description('(Beta) Build on your local machine')
88
- .option('--context <context>', 'Specify a build context', process.env.CONTEXT || 'production')
88
+ .option(
89
+ '--context <context>',
90
+ 'Specify a build context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")',
91
+ normalizeContext,
92
+ process.env.CONTEXT || 'production',
93
+ )
89
94
  .option('--dry', 'Dry run: show instructions without running them', false)
90
95
  .option('-o, --offline', 'disables any features that require network access', false)
91
96
  .addExamples(['netlify build'])
@@ -410,7 +410,13 @@ const bundleEdgeFunctions = async (options) => {
410
410
  phase: 'start',
411
411
  })
412
412
 
413
- const { severityCode, success } = await runCoreSteps(['edge_functions_bundling'], { ...options, buffer: true })
413
+ const { severityCode, success } = await runCoreSteps(['edge_functions_bundling'], {
414
+ ...options,
415
+ buffer: true,
416
+ featureFlags: {
417
+ edge_functions_produce_eszip: true,
418
+ },
419
+ })
414
420
 
415
421
  if (!success) {
416
422
  statusCb({
@@ -1,7 +1,6 @@
1
- const { Option } = require('commander')
2
1
  const execa = require('execa')
3
2
 
4
- const { getEnvelopeEnv, injectEnvVariables } = require('../../utils')
3
+ const { getEnvelopeEnv, injectEnvVariables, normalizeContext } = require('../../utils')
5
4
 
6
5
  /**
7
6
  * The dev:exec command
@@ -32,10 +31,11 @@ const createDevExecCommand = (program) =>
32
31
  program
33
32
  .command('dev:exec')
34
33
  .argument('<...cmd>', `the command that should be executed`)
35
- .addOption(
36
- new Option('--context <context>', 'Specify a deploy context for environment variables')
37
- .choices(['production', 'deploy-preview', 'branch-deploy', 'dev'])
38
- .default('dev'),
34
+ .option(
35
+ '--context <context>',
36
+ 'Specify a deploy context or branch for environment variables (contexts: "production", "deploy-preview", "branch-deploy", "dev")',
37
+ normalizeContext,
38
+ 'dev',
39
39
  )
40
40
  .description(
41
41
  'Exec command\nRuns a command within the netlify dev environment, e.g. with env variables from any installed addons',
@@ -45,6 +45,7 @@ const {
45
45
  injectEnvVariables,
46
46
  log,
47
47
  normalizeConfig,
48
+ normalizeContext,
48
49
  openBrowser,
49
50
  processOnExit,
50
51
  startLiveTunnel,
@@ -684,10 +685,11 @@ const createDevCommand = (program) => {
684
685
  `Local dev server\nThe dev command will run a local dev server with Netlify's proxy and redirect rules`,
685
686
  )
686
687
  .option('-c ,--command <command>', 'command to run')
687
- .addOption(
688
- new Option('--context <context>', 'Specify a deploy context for environment variables')
689
- .choices(['production', 'deploy-preview', 'branch-deploy', 'dev'])
690
- .default('dev'),
688
+ .option(
689
+ '--context <context>',
690
+ 'Specify a deploy context or branch for environment variables (contexts: "production", "deploy-preview", "branch-deploy", "dev")',
691
+ normalizeContext,
692
+ 'dev',
691
693
  )
692
694
  .option('-p ,--port <port>', 'port of netlify dev', (value) => Number.parseInt(value))
693
695
  .option('--targetPort <port>', 'port of target app server', (value) => Number.parseInt(value))
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  const { Option } = require('commander')
3
3
 
4
- const { chalk, error, getEnvelopeEnv, log, logJson } = require('../../utils')
4
+ const { AVAILABLE_CONTEXTS, chalk, error, getEnvelopeEnv, log, logJson, normalizeContext } = require('../../utils')
5
5
 
6
6
  /**
7
7
  * The env:get command
@@ -42,7 +42,8 @@ const envGet = async (name, options, command) => {
42
42
  }
43
43
 
44
44
  if (!value) {
45
- const withContext = `in the ${chalk.magenta(context)} context`
45
+ const contextType = AVAILABLE_CONTEXTS.includes(context) ? 'context' : 'branch'
46
+ const withContext = `in the ${chalk.magenta(context)} ${contextType}`
46
47
  const withScope = scope === 'any' ? '' : ` and the ${chalk.magenta(scope)} scope`
47
48
  log(`No value set ${withContext}${withScope} for environment variable ${chalk.yellow(name)}`)
48
49
  return false
@@ -60,16 +61,23 @@ const createEnvGetCommand = (program) =>
60
61
  program
61
62
  .command('env:get')
62
63
  .argument('<name>', 'Environment variable name')
63
- .addOption(
64
- new Option('-c, --context <context>', 'Specify a deploy context')
65
- .choices(['production', 'deploy-preview', 'branch-deploy', 'dev'])
66
- .default('dev'),
64
+ .option(
65
+ '-c, --context <context>',
66
+ 'Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")',
67
+ normalizeContext,
68
+ 'dev',
67
69
  )
68
70
  .addOption(
69
71
  new Option('-s, --scope <scope>', 'Specify a scope')
70
72
  .choices(['builds', 'functions', 'post_processing', 'runtime', 'any'])
71
73
  .default('any'),
72
74
  )
75
+ .addExamples([
76
+ 'netlify env:get MY_VAR # get value for MY_VAR in dev context',
77
+ 'netlify env:get MY_VAR --context production',
78
+ 'netlify env:get MY_VAR --context branch:staging',
79
+ 'netlify env:get MY_VAR --scope functions',
80
+ ])
73
81
  .description('Get resolved value of specified environment variable (includes netlify.toml)')
74
82
  .action(async (name, options, command) => {
75
83
  await envGet(name, options, command)
@@ -5,7 +5,16 @@ const { Option } = require('commander')
5
5
  const inquirer = require('inquirer')
6
6
  const isEmpty = require('lodash/isEmpty')
7
7
 
8
- const { chalk, error, getEnvelopeEnv, getHumanReadableScopes, log, logJson } = require('../../utils')
8
+ const {
9
+ AVAILABLE_CONTEXTS,
10
+ chalk,
11
+ error,
12
+ getEnvelopeEnv,
13
+ getHumanReadableScopes,
14
+ log,
15
+ logJson,
16
+ normalizeContext,
17
+ } = require('../../utils')
9
18
 
10
19
  const [logUpdatePromise, ansiEscapesPromise] = [import('log-update'), import('ansi-escapes')]
11
20
 
@@ -77,7 +86,8 @@ const envList = async (options, command) => {
77
86
  }
78
87
 
79
88
  const forSite = `for site ${chalk.green(siteInfo.name)}`
80
- const withContext = isUsingEnvelope ? `in the ${chalk.magenta(options.context)} context` : ''
89
+ const contextType = AVAILABLE_CONTEXTS.includes(context) ? 'context' : 'branch'
90
+ const withContext = isUsingEnvelope ? `in the ${chalk.magenta(options.context)} ${contextType}` : ''
81
91
  const withScope = isUsingEnvelope && scope !== 'any' ? `and ${chalk.yellow(options.scope)} scope` : ''
82
92
  if (isEmpty(environment)) {
83
93
  log(`No environment variables set ${forSite} ${withContext} ${withScope}`)
@@ -122,16 +132,23 @@ const envList = async (options, command) => {
122
132
  const createEnvListCommand = (program) =>
123
133
  program
124
134
  .command('env:list')
125
- .addOption(
126
- new Option('-c, --context <context>', 'Specify a deploy context')
127
- .choices(['production', 'deploy-preview', 'branch-deploy', 'dev'])
128
- .default('dev'),
135
+ .option(
136
+ '-c, --context <context>',
137
+ 'Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev")',
138
+ normalizeContext,
139
+ 'dev',
129
140
  )
130
141
  .addOption(
131
142
  new Option('-s, --scope <scope>', 'Specify a scope')
132
143
  .choices(['builds', 'functions', 'post_processing', 'runtime', 'any'])
133
144
  .default('any'),
134
145
  )
146
+ .addExamples([
147
+ 'netlify env:list # list variables with values in the dev context and with any scope',
148
+ 'netlify env:list --context production',
149
+ 'netlify env:list --context branch:staging',
150
+ 'netlify env:list --scope functions',
151
+ ])
135
152
  .description('Lists resolved environment variables for site (includes netlify.toml)')
136
153
  .action(async (options, command) => {
137
154
  await envList(options, command)
@@ -1,9 +1,16 @@
1
1
  // @ts-check
2
2
  const { Option } = require('commander')
3
3
 
4
- const { chalk, error, log, logJson, translateFromEnvelopeToMongo } = require('../../utils')
5
-
6
- const AVAILABLE_SCOPES = ['builds', 'functions', 'runtime', 'post_processing']
4
+ const {
5
+ AVAILABLE_CONTEXTS,
6
+ AVAILABLE_SCOPES,
7
+ chalk,
8
+ error,
9
+ log,
10
+ logJson,
11
+ normalizeContext,
12
+ translateFromEnvelopeToMongo,
13
+ } = require('../../utils')
7
14
 
8
15
  /**
9
16
  * The env:set command
@@ -52,10 +59,11 @@ const envSet = async (key, value, options, command) => {
52
59
  }
53
60
 
54
61
  const withScope = scope ? ` scoped to ${chalk.white(scope)}` : ''
62
+ const contextType = AVAILABLE_CONTEXTS.includes(context || 'all') ? 'context' : 'branch'
55
63
  log(
56
64
  `Set environment variable ${chalk.yellow(`${key}${value ? '=' : ''}${value}`)}${withScope} in the ${chalk.magenta(
57
65
  context || 'all',
58
- )} context`,
66
+ )} ${contextType}`,
59
67
  )
60
68
  }
61
69
 
@@ -93,7 +101,10 @@ const setInEnvelope = async ({ api, context, key, scope, siteInfo, value }) => {
93
101
  const contexts = context || ['all']
94
102
  const scopes = scope || AVAILABLE_SCOPES
95
103
 
96
- let values = contexts.map((ctx) => ({ context: ctx, value }))
104
+ // if the passed context is unknown, it is actually a branch name
105
+ let values = contexts.map((ctx) =>
106
+ AVAILABLE_CONTEXTS.includes(ctx) ? { context: ctx, value } : { context: 'branch', context_parameter: ctx, value },
107
+ )
97
108
 
98
109
  const existing = envelopeVariables.find((envVar) => envVar.key === key)
99
110
 
@@ -144,13 +155,11 @@ const createEnvSetCommand = (program) =>
144
155
  .command('env:set')
145
156
  .argument('<key>', 'Environment variable key')
146
157
  .argument('[value]', 'Value to set to', '')
147
- .addOption(
148
- new Option('-c, --context <context...>', 'Specify a deploy context (default: all contexts)').choices([
149
- 'production',
150
- 'deploy-preview',
151
- 'branch-deploy',
152
- 'dev',
153
- ]),
158
+ .option(
159
+ '-c, --context <context...>',
160
+ 'Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev") (default: all contexts)',
161
+ // spread over an array for variadic options
162
+ (context, previous = []) => [...previous, normalizeContext(context)],
154
163
  )
155
164
  .addOption(
156
165
  new Option('-s, --scope <scope...>', 'Specify a scope (default: all scopes)').choices([
@@ -1,9 +1,13 @@
1
- const { Option } = require('commander')
2
-
3
1
  // @ts-check
4
- const { chalk, error, log, logJson, translateFromEnvelopeToMongo } = require('../../utils')
5
-
6
- const AVAILABLE_CONTEXTS = ['production', 'deploy-preview', 'branch-deploy', 'dev']
2
+ const {
3
+ AVAILABLE_CONTEXTS,
4
+ chalk,
5
+ error,
6
+ log,
7
+ logJson,
8
+ normalizeContext,
9
+ translateFromEnvelopeToMongo,
10
+ } = require('../../utils')
7
11
 
8
12
  /**
9
13
  * The env:unset command
@@ -44,7 +48,8 @@ const envUnset = async (key, options, command) => {
44
48
  return false
45
49
  }
46
50
 
47
- log(`Unset environment variable ${chalk.yellow(key)} in the ${chalk.magenta(context || 'all')} context`)
51
+ const contextType = AVAILABLE_CONTEXTS.includes(context || 'all') ? 'context' : 'branch'
52
+ log(`Unset environment variable ${chalk.yellow(key)} in the ${chalk.magenta(context || 'all')} ${contextType}`)
48
53
  }
49
54
 
50
55
  /**
@@ -98,8 +103,10 @@ const unsetInEnvelope = async ({ api, context, key, siteInfo }) => {
98
103
  const params = { accountId, siteId, key }
99
104
  try {
100
105
  if (context) {
101
- // if context(s) are passed, delete the matching contexts, and the `all` context
102
- const values = variable.values.filter((val) => [...contexts, 'all'].includes(val.context))
106
+ // if context(s) are passed, delete the matching contexts / branches, and the `all` context
107
+ const values = variable.values.filter((val) =>
108
+ [...contexts, 'all'].includes(val.context_parameter || val.context),
109
+ )
103
110
  if (values) {
104
111
  await Promise.all(values.map((value) => api.deleteEnvVarValue({ ...params, id: value.id })))
105
112
  // if this was the `all` context, we need to create 3 values in the other contexts
@@ -107,7 +114,9 @@ const unsetInEnvelope = async ({ api, context, key, siteInfo }) => {
107
114
  const newContexts = AVAILABLE_CONTEXTS.filter((ctx) => !context.includes(ctx))
108
115
  const allValue = values[0].value
109
116
  await Promise.all(
110
- newContexts.map((ctx) => api.setEnvVarValue({ ...params, body: { context: ctx, value: allValue } })),
117
+ newContexts
118
+ .filter((ctx) => ctx !== 'all')
119
+ .map((ctx) => api.setEnvVarValue({ ...params, body: { context: ctx, value: allValue } })),
111
120
  )
112
121
  }
113
122
  }
@@ -134,13 +143,11 @@ const createEnvUnsetCommand = (program) =>
134
143
  .command('env:unset')
135
144
  .aliases(['env:delete', 'env:remove'])
136
145
  .argument('<key>', 'Environment variable key')
137
- .addOption(
138
- new Option('-c, --context <context...>', 'Specify a deploy context (default: all contexts)').choices([
139
- 'production',
140
- 'deploy-preview',
141
- 'branch-deploy',
142
- 'dev',
143
- ]),
146
+ .option(
147
+ '-c, --context <context...>',
148
+ 'Specify a deploy context or branch (contexts: "production", "deploy-preview", "branch-deploy", "dev") (default: all contexts)',
149
+ // spread over an array for variadic options
150
+ (context, previous = []) => [...previous, normalizeContext(context)],
144
151
  )
145
152
  .addExamples([
146
153
  'netlify env:unset VAR_NAME # unset in all contexts',
@@ -16,7 +16,7 @@
16
16
  "license": "MIT",
17
17
  "dependencies": {
18
18
  "apollo-server-lambda": "^2.18.2",
19
- "apollo-datasource-rest": "^0.14.0",
19
+ "apollo-datasource-rest": "^0.15.0",
20
20
  "graphql": "^14.1.1"
21
21
  }
22
22
  }
@@ -26,9 +26,9 @@
26
26
  }
27
27
  },
28
28
  "node_modules/@types/node": {
29
- "version": "14.18.23",
30
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.23.tgz",
31
- "integrity": "sha512-MhbCWN18R4GhO8ewQWAFK4TGQdBpXWByukz7cWyJmXhvRuCIaM/oWytGPqVmDzgEnnaIc9ss6HbU5mUi+vyZPA=="
29
+ "version": "14.18.26",
30
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.26.tgz",
31
+ "integrity": "sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA=="
32
32
  },
33
33
  "node_modules/is-promise": {
34
34
  "version": "4.0.0",
@@ -36,9 +36,9 @@
36
36
  "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
37
37
  },
38
38
  "node_modules/typescript": {
39
- "version": "4.7.4",
40
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
41
- "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==",
39
+ "version": "4.8.2",
40
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
41
+ "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==",
42
42
  "bin": {
43
43
  "tsc": "bin/tsc",
44
44
  "tsserver": "bin/tsserver"
@@ -58,9 +58,9 @@
58
58
  }
59
59
  },
60
60
  "@types/node": {
61
- "version": "14.18.23",
62
- "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.23.tgz",
63
- "integrity": "sha512-MhbCWN18R4GhO8ewQWAFK4TGQdBpXWByukz7cWyJmXhvRuCIaM/oWytGPqVmDzgEnnaIc9ss6HbU5mUi+vyZPA=="
61
+ "version": "14.18.26",
62
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.26.tgz",
63
+ "integrity": "sha512-0b+utRBSYj8L7XAp0d+DX7lI4cSmowNaaTkk6/1SKzbKkG+doLuPusB9EOvzLJ8ahJSk03bTLIL6cWaEd4dBKA=="
64
64
  },
65
65
  "is-promise": {
66
66
  "version": "4.0.0",
@@ -68,9 +68,9 @@
68
68
  "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="
69
69
  },
70
70
  "typescript": {
71
- "version": "4.7.4",
72
- "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz",
73
- "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ=="
71
+ "version": "4.8.2",
72
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.8.2.tgz",
73
+ "integrity": "sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw=="
74
74
  }
75
75
  }
76
76
  }
package/src/lib/build.js CHANGED
@@ -35,6 +35,7 @@ const getBuildOptions = ({ cachedConfig, options: { context, cwd, debug, dry, js
35
35
  cwd,
36
36
  featureFlags: {
37
37
  functionsBundlingManifest: true,
38
+ edge_functions_produce_eszip: true,
38
39
  },
39
40
  })
40
41
 
@@ -1,10 +1,46 @@
1
+ const { error } = require('../command-helpers')
2
+
3
+ const AVAILABLE_CONTEXTS = ['all', 'production', 'deploy-preview', 'branch-deploy', 'dev']
4
+ const AVAILABLE_SCOPES = ['builds', 'functions', 'runtime', 'post_processing']
5
+
6
+ /**
7
+ * @param {string|undefined} context - The deploy context or branch of the environment variable value
8
+ * @returns {Array<string|undefined>} The normalized context or branch name
9
+ */
10
+ const normalizeContext = (context) => {
11
+ if (!context) {
12
+ return context
13
+ }
14
+ const CONTEXT_SYNONYMS = {
15
+ dp: 'deploy-preview',
16
+ prod: 'production',
17
+ }
18
+ context = context.toLowerCase()
19
+ if (context in CONTEXT_SYNONYMS) {
20
+ context = CONTEXT_SYNONYMS[context]
21
+ }
22
+ const forbiddenContexts = AVAILABLE_CONTEXTS.map((ctx) => `branch:${ctx}`)
23
+ if (forbiddenContexts.includes(context)) {
24
+ error(`The context ${context} includes a reserved keyword and is not allowed`)
25
+ }
26
+ context = context.replace(/^branch:/, '')
27
+ return context
28
+ }
29
+
1
30
  /**
2
31
  * Finds a matching environment variable value from a given context
3
32
  * @param {Array<object>} values - An array of environment variable values from Envelope
4
- * @param {enum<dev,branch-deploy,deploy-preview,production>} context - The deploy context of the environment variable value
5
- * @returns {object<context: enum<dev,branch-deploy,deploy-preview,production>, value: string>} The matching environment variable value object
33
+ * @param {string} context - The deploy context or branch of the environment variable value
34
+ * @returns {object<context: enum<dev,branch-deploy,deploy-preview,production,branch>, context_parameter: <string>, value: string>} The matching environment variable value object
6
35
  */
7
- const findValueFromContext = (values, context) => values.find((val) => [context, 'all'].includes(val.context))
36
+ const findValueInValues = (values, context) =>
37
+ values.find((val) => {
38
+ if (!AVAILABLE_CONTEXTS.includes(context)) {
39
+ // the "context" option passed in is actually the name of a branch
40
+ return val.context === 'all' || val.context_parameter === context
41
+ }
42
+ return [context, 'all'].includes(val.context)
43
+ })
8
44
 
9
45
  /**
10
46
  * Finds environment variables that match a given source
@@ -45,7 +81,7 @@ const fetchEnvelopeItems = async function ({ accountId, api, key, siteId }) {
45
81
 
46
82
  /**
47
83
  * Filters and sorts data from Envelope by a given context and/or scope
48
- * @param {enum<dev,branch-deploy,deploy-preview,production>} context - The deploy context of the environment variable value
84
+ * @param {string} context - The deploy context or branch of the environment variable value
49
85
  * @param {Array<object>} envelopeItems - An array of environment variables from the Envelope service
50
86
  * @param {enum<any,builds,functions,runtime,post_processing>} scope - The scope of the environment variables
51
87
  * @param {enum<general,account,addons,ui,configFile>} source - The source of the environment variable
@@ -58,7 +94,8 @@ const fetchEnvelopeItems = async function ({ accountId, api, key, siteId }) {
58
94
  * value: 'bar',
59
95
  * },
60
96
  * BAZ: {
61
- * context: 'dev',
97
+ * context: 'branch',
98
+ * branch: 'staging',
62
99
  * scopes: ['runtime'],
63
100
  * sources: ['account'],
64
101
  * value: 'bang',
@@ -68,18 +105,19 @@ const fetchEnvelopeItems = async function ({ accountId, api, key, siteId }) {
68
105
  const formatEnvelopeData = ({ context = 'dev', envelopeItems = [], scope = 'any', source }) =>
69
106
  envelopeItems
70
107
  // filter by context
71
- .filter(({ values }) => Boolean(findValueFromContext(values, context)))
108
+ .filter(({ values }) => Boolean(findValueInValues(values, context)))
72
109
  // filter by scope
73
110
  .filter(({ scopes }) => (scope === 'any' ? true : scopes.includes(scope)))
74
111
  // sort alphabetically, case insensitive
75
112
  .sort((left, right) => (left.key.toLowerCase() < right.key.toLowerCase() ? -1 : 1))
76
113
  // format the data
77
114
  .reduce((acc, cur) => {
78
- const { context: ctx, value } = findValueFromContext(cur.values, context)
115
+ const { context: ctx, context_parameter: branch, value } = findValueInValues(cur.values, context)
79
116
  return {
80
117
  ...acc,
81
118
  [cur.key]: {
82
119
  context: ctx,
120
+ branch,
83
121
  scopes: cur.scopes,
84
122
  sources: [source],
85
123
  value,
@@ -90,7 +128,7 @@ const formatEnvelopeData = ({ context = 'dev', envelopeItems = [], scope = 'any'
90
128
  /**
91
129
  * Collects env vars from multiple sources and arranges them in the correct order of precedence
92
130
  * @param {object} api - The api singleton object
93
- * @param {enum<dev,branch-deploy,deploy-preview,production>} context - The deploy context of the environment variable
131
+ * @param {string} context - The deploy context or branch of the environment variable
94
132
  * @param {object} env - The dictionary of environment variables
95
133
  * @param {string} key - If present, fetch a single key (case-sensitive)
96
134
  * @param {enum<any,builds,functions,runtime,post_processing>} scope - The scope of the environment variables
@@ -130,7 +168,7 @@ const getEnvelopeEnv = async ({ api, context = 'dev', env, key = '', scope = 'an
130
168
  * @returns {string} A human-readable, comma-separated list of scopes
131
169
  */
132
170
  const getHumanReadableScopes = (scopes) => {
133
- const AVAILABLE_SCOPES = {
171
+ const HUMAN_SCOPES = {
134
172
  builds: 'Builds',
135
173
  functions: 'Functions',
136
174
  post_processing: 'Post processing',
@@ -141,11 +179,11 @@ const getHumanReadableScopes = (scopes) => {
141
179
  // env vars specified in netlify.toml are present in the `builds` and `post_processing` scope
142
180
  return 'Builds, Post processing'
143
181
  }
144
- if (scopes.length === Object.keys(AVAILABLE_SCOPES).length) {
182
+ if (scopes.length === Object.keys(HUMAN_SCOPES).length) {
145
183
  // shorthand instead of listing every available scope
146
184
  return 'All'
147
185
  }
148
- return scopes.map((scope) => AVAILABLE_SCOPES[scope]).join(', ')
186
+ return scopes.map((scope) => HUMAN_SCOPES[scope]).join(', ')
149
187
  }
150
188
 
151
189
  /**
@@ -156,7 +194,7 @@ const getHumanReadableScopes = (scopes) => {
156
194
  const translateFromMongoToEnvelope = (env = {}) => {
157
195
  const envVars = Object.entries(env).map(([key, value]) => ({
158
196
  key,
159
- scopes: ['builds', 'functions', 'runtime', 'post_processing'],
197
+ scopes: AVAILABLE_SCOPES,
160
198
  values: [
161
199
  {
162
200
  context: 'all',
@@ -171,14 +209,14 @@ const translateFromMongoToEnvelope = (env = {}) => {
171
209
  /**
172
210
  * Translates an Envelope env into a Mongo env
173
211
  * @param {Array<object>} envVars - The array of Envelope env vars
174
- * @param {enum<dev,branch-deploy,deploy-preview,production>} context - The deploy context of the environment variable
212
+ * @param {string} context - The deploy context or branch of the environment variable
175
213
  * @returns {object} The env object as compatible with Mongo
176
214
  */
177
215
  const translateFromEnvelopeToMongo = (envVars = [], context = 'dev') =>
178
216
  envVars
179
217
  .sort((left, right) => (left.key.toLowerCase() < right.key.toLowerCase() ? -1 : 1))
180
218
  .reduce((acc, cur) => {
181
- const envVar = cur.values.find((val) => [context, 'all'].includes(val.context))
219
+ const envVar = cur.values.find((val) => [context, 'all'].includes(val.context_parameter || val.context))
182
220
  if (envVar && envVar.value) {
183
221
  return {
184
222
  ...acc,
@@ -189,11 +227,14 @@ const translateFromEnvelopeToMongo = (envVars = [], context = 'dev') =>
189
227
  }, {})
190
228
 
191
229
  module.exports = {
192
- findValueFromContext,
230
+ AVAILABLE_CONTEXTS,
231
+ AVAILABLE_SCOPES,
232
+ findValueInValues,
193
233
  filterEnvBySource,
194
234
  formatEnvelopeData,
195
235
  getEnvelopeEnv,
196
236
  getHumanReadableScopes,
237
+ normalizeContext,
197
238
  translateFromEnvelopeToMongo,
198
239
  translateFromMongoToEnvelope,
199
240
  }