netlify-cli 11.1.0 → 11.4.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": "11.1.0",
3
+ "version": "11.4.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "11.1.0",
9
+ "version": "11.4.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@netlify/build": "^27.14.0",
14
- "@netlify/config": "^18.2.0",
13
+ "@netlify/build": "^27.15.6",
14
+ "@netlify/config": "^18.2.1",
15
15
  "@netlify/edge-bundler": "^1.13.0",
16
16
  "@netlify/framework-info": "^9.2.0",
17
17
  "@netlify/local-functions-proxy": "^1.1.1",
18
- "@netlify/plugins-list": "^6.39.0",
18
+ "@netlify/plugins-list": "^6.40.0",
19
19
  "@netlify/zip-it-and-ship-it": "^5.13.5",
20
20
  "@octokit/rest": "^18.0.0",
21
21
  "@sindresorhus/slugify": "^1.1.0",
@@ -81,7 +81,7 @@
81
81
  "multiparty": "^4.2.1",
82
82
  "netlify": "^12.0.1",
83
83
  "netlify-headers-parser": "^6.0.2",
84
- "netlify-onegraph-internal": "0.8.7",
84
+ "netlify-onegraph-internal": "0.10.0",
85
85
  "netlify-redirect-parser": "^13.0.5",
86
86
  "netlify-redirector": "^0.2.1",
87
87
  "node-fetch": "^2.6.0",
@@ -1189,14 +1189,14 @@
1189
1189
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
1190
1190
  },
1191
1191
  "node_modules/@netlify/build": {
1192
- "version": "27.14.0",
1193
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.14.0.tgz",
1194
- "integrity": "sha512-/o1Q+Z2JNpU15S63AsyT4HBPbiweMhBO6jclxNN9kjBnlTefcBJ1c5zN7cOlrcHM+SC+tRPC0oJM/aL/OkXsWg==",
1192
+ "version": "27.15.6",
1193
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.15.6.tgz",
1194
+ "integrity": "sha512-ZSah6LDAG0KwWiTUfVfL/kBie7qsUj4cMSl0D7dbTBWSRpGx8MgYjlJHP3U2PgXAgmLcc4NOciGIZD/zL4yJCA==",
1195
1195
  "dependencies": {
1196
1196
  "@bugsnag/js": "^7.0.0",
1197
1197
  "@netlify/cache-utils": "^4.0.0",
1198
- "@netlify/config": "^18.2.0",
1199
- "@netlify/edge-bundler": "^1.12.1",
1198
+ "@netlify/config": "^18.2.2",
1199
+ "@netlify/edge-bundler": "^1.13.0",
1200
1200
  "@netlify/functions-utils": "^4.2.4",
1201
1201
  "@netlify/git-utils": "^4.0.0",
1202
1202
  "@netlify/plugins-list": "^6.36.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.0",
1810
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
1811
- "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==",
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==",
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.0",
1821
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
1822
- "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==",
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==",
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.0",
2015
- "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.0.tgz",
2016
- "integrity": "sha512-UxJ2bg9KQVNzzPhuTRVybtXLuVo/XBw8CCVJkWHkVSJlomYvtnA0epTreRHjtGSvy++10Rhu37WwzRbFNG5rBQ==",
2014
+ "version": "18.2.2",
2015
+ "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.2.tgz",
2016
+ "integrity": "sha512-VgtbLwjjkh6vRIejAuXY8DIvNvXia8ta1Bphkb33Dr3VbGITvZ0avRcnC0BANpKZCBb6jsaubyMwg7V6IzDkPw==",
2017
2017
  "dependencies": {
2018
2018
  "chalk": "^5.0.0",
2019
2019
  "cron-parser": "^4.1.0",
@@ -2321,9 +2321,9 @@
2321
2321
  }
2322
2322
  },
2323
2323
  "node_modules/@netlify/config/node_modules/type-fest": {
2324
- "version": "2.18.0",
2325
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
2326
- "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==",
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==",
2327
2327
  "engines": {
2328
2328
  "node": ">=12.20"
2329
2329
  },
@@ -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.40.0",
3597
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.40.0.tgz",
3598
+ "integrity": "sha512-VDYHEVS/r3eEylUNVwwF0scyV8ISMfxbz6MMl7TEpgArXOS+lYhObNAukrWcUR7aa0zf9C3jwy67zROh0M+ZdQ==",
3599
3599
  "engines": {
3600
3600
  "node": "^12.20.0 || ^14.14.0 || >=16.0.0"
3601
3601
  }
@@ -15963,9 +15963,9 @@
15963
15963
  }
15964
15964
  },
15965
15965
  "node_modules/netlify-onegraph-internal": {
15966
- "version": "0.8.7",
15967
- "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.8.7.tgz",
15968
- "integrity": "sha512-FDHQes/GP7UjlzAwJ+qwKfhESBo9NQDN9Ed6U+9a5CW5o2j8Lr23P9Ac1MKp7jDP5h0uAq73r9P86J9Kl1yzLQ==",
15966
+ "version": "0.10.0",
15967
+ "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.10.0.tgz",
15968
+ "integrity": "sha512-Gf6cE1W+q35niIz54xpSLneShpRxlleYL3ZD3D1tjGazuv19q8XBVAAynaAQFzbOk/RPTnu3+Vi/5L7DGACOIg==",
15969
15969
  "dependencies": {
15970
15970
  "graphql": "16.5.0",
15971
15971
  "node-fetch": "^2.6.0",
@@ -22410,15 +22410,15 @@
22410
22410
  "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
22411
22411
  },
22412
22412
  "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==",
22413
+ "version": "4.0.2",
22414
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz",
22415
+ "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==",
22416
22416
  "dependencies": {
22417
22417
  "imurmurhash": "^0.1.4",
22418
22418
  "signal-exit": "^3.0.7"
22419
22419
  },
22420
22420
  "engines": {
22421
- "node": "^12.13.0 || ^14.15.0 || >=16"
22421
+ "node": "^12.13.0 || ^14.15.0 || >=16.0.0"
22422
22422
  }
22423
22423
  },
22424
22424
  "node_modules/ws": {
@@ -23374,14 +23374,14 @@
23374
23374
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
23375
23375
  },
23376
23376
  "@netlify/build": {
23377
- "version": "27.14.0",
23378
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.14.0.tgz",
23379
- "integrity": "sha512-/o1Q+Z2JNpU15S63AsyT4HBPbiweMhBO6jclxNN9kjBnlTefcBJ1c5zN7cOlrcHM+SC+tRPC0oJM/aL/OkXsWg==",
23377
+ "version": "27.15.6",
23378
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-27.15.6.tgz",
23379
+ "integrity": "sha512-ZSah6LDAG0KwWiTUfVfL/kBie7qsUj4cMSl0D7dbTBWSRpGx8MgYjlJHP3U2PgXAgmLcc4NOciGIZD/zL4yJCA==",
23380
23380
  "requires": {
23381
23381
  "@bugsnag/js": "^7.0.0",
23382
23382
  "@netlify/cache-utils": "^4.0.0",
23383
- "@netlify/config": "^18.2.0",
23384
- "@netlify/edge-bundler": "^1.12.1",
23383
+ "@netlify/config": "^18.2.2",
23384
+ "@netlify/edge-bundler": "^1.13.0",
23385
23385
  "@netlify/functions-utils": "^4.2.4",
23386
23386
  "@netlify/git-utils": "^4.0.0",
23387
23387
  "@netlify/plugins-list": "^6.36.0",
@@ -23752,9 +23752,9 @@
23752
23752
  },
23753
23753
  "dependencies": {
23754
23754
  "type-fest": {
23755
- "version": "2.18.0",
23756
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
23757
- "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw=="
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=="
23758
23758
  }
23759
23759
  }
23760
23760
  },
@@ -23769,9 +23769,9 @@
23769
23769
  },
23770
23770
  "dependencies": {
23771
23771
  "type-fest": {
23772
- "version": "2.18.0",
23773
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
23774
- "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw=="
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=="
23775
23775
  }
23776
23776
  }
23777
23777
  },
@@ -23885,9 +23885,9 @@
23885
23885
  }
23886
23886
  },
23887
23887
  "@netlify/config": {
23888
- "version": "18.2.0",
23889
- "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.0.tgz",
23890
- "integrity": "sha512-UxJ2bg9KQVNzzPhuTRVybtXLuVo/XBw8CCVJkWHkVSJlomYvtnA0epTreRHjtGSvy++10Rhu37WwzRbFNG5rBQ==",
23888
+ "version": "18.2.2",
23889
+ "resolved": "https://registry.npmjs.org/@netlify/config/-/config-18.2.2.tgz",
23890
+ "integrity": "sha512-VgtbLwjjkh6vRIejAuXY8DIvNvXia8ta1Bphkb33Dr3VbGITvZ0avRcnC0BANpKZCBb6jsaubyMwg7V6IzDkPw==",
23891
23891
  "requires": {
23892
23892
  "chalk": "^5.0.0",
23893
23893
  "cron-parser": "^4.1.0",
@@ -24063,9 +24063,9 @@
24063
24063
  "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw=="
24064
24064
  },
24065
24065
  "type-fest": {
24066
- "version": "2.18.0",
24067
- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz",
24068
- "integrity": "sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw=="
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=="
24069
24069
  },
24070
24070
  "yocto-queue": {
24071
24071
  "version": "1.0.0",
@@ -24766,9 +24766,9 @@
24766
24766
  "integrity": "sha512-1n9VvO/9qM7cRB5f7NgSNqeUrovM7j9WVAY7ZQ4LtQuXSquFmO9Fku7WrV3zAUC6v2Y62fxGyJ0fRllYz5uXLw=="
24767
24767
  },
24768
24768
  "@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=="
24769
+ "version": "6.40.0",
24770
+ "resolved": "https://registry.npmjs.org/@netlify/plugins-list/-/plugins-list-6.40.0.tgz",
24771
+ "integrity": "sha512-VDYHEVS/r3eEylUNVwwF0scyV8ISMfxbz6MMl7TEpgArXOS+lYhObNAukrWcUR7aa0zf9C3jwy67zROh0M+ZdQ=="
24772
24772
  },
24773
24773
  "@netlify/run-utils": {
24774
24774
  "version": "4.0.1",
@@ -34193,9 +34193,9 @@
34193
34193
  }
34194
34194
  },
34195
34195
  "netlify-onegraph-internal": {
34196
- "version": "0.8.7",
34197
- "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.8.7.tgz",
34198
- "integrity": "sha512-FDHQes/GP7UjlzAwJ+qwKfhESBo9NQDN9Ed6U+9a5CW5o2j8Lr23P9Ac1MKp7jDP5h0uAq73r9P86J9Kl1yzLQ==",
34196
+ "version": "0.10.0",
34197
+ "resolved": "https://registry.npmjs.org/netlify-onegraph-internal/-/netlify-onegraph-internal-0.10.0.tgz",
34198
+ "integrity": "sha512-Gf6cE1W+q35niIz54xpSLneShpRxlleYL3ZD3D1tjGazuv19q8XBVAAynaAQFzbOk/RPTnu3+Vi/5L7DGACOIg==",
34199
34199
  "requires": {
34200
34200
  "graphql": "16.5.0",
34201
34201
  "node-fetch": "^2.6.0",
@@ -39129,9 +39129,9 @@
39129
39129
  "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8="
39130
39130
  },
39131
39131
  "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==",
39132
+ "version": "4.0.2",
39133
+ "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz",
39134
+ "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==",
39135
39135
  "requires": {
39136
39136
  "imurmurhash": "^0.1.4",
39137
39137
  "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.1.0",
4
+ "version": "11.4.0",
5
5
  "author": "Netlify Inc.",
6
6
  "contributors": [
7
7
  "@whitep4nth3r (https://twitter.com/whitep4nth3r)",
@@ -222,12 +222,12 @@
222
222
  "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
223
  },
224
224
  "dependencies": {
225
- "@netlify/build": "^27.14.0",
226
- "@netlify/config": "^18.2.0",
225
+ "@netlify/build": "^27.15.6",
226
+ "@netlify/config": "^18.2.1",
227
227
  "@netlify/edge-bundler": "^1.13.0",
228
228
  "@netlify/framework-info": "^9.2.0",
229
229
  "@netlify/local-functions-proxy": "^1.1.1",
230
- "@netlify/plugins-list": "^6.39.0",
230
+ "@netlify/plugins-list": "^6.40.0",
231
231
  "@netlify/zip-it-and-ship-it": "^5.13.5",
232
232
  "@octokit/rest": "^18.0.0",
233
233
  "@sindresorhus/slugify": "^1.1.0",
@@ -293,7 +293,7 @@
293
293
  "multiparty": "^4.2.1",
294
294
  "netlify": "^12.0.1",
295
295
  "netlify-headers-parser": "^6.0.2",
296
- "netlify-onegraph-internal": "0.8.7",
296
+ "netlify-onegraph-internal": "0.10.0",
297
297
  "netlify-redirect-parser": "^13.0.5",
298
298
  "netlify-redirector": "^0.2.1",
299
299
  "node-fetch": "^2.6.0",
@@ -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({
@@ -434,6 +434,7 @@ const dev = async (options, command) => {
434
434
  }
435
435
 
436
436
  let { env } = cachedConfig
437
+
437
438
  if (!options.offline && siteInfo.use_envelope) {
438
439
  env = await getEnvelopeEnv({ api, context: options.context, env, siteInfo })
439
440
  }
@@ -33,17 +33,18 @@ const graphHandler = async (args, options, command) => {
33
33
  error(`Error parsing schema: ${buildSchemaError}`)
34
34
  }
35
35
 
36
- const userOperationName = args.operationName
36
+ const userOperationNames = args.operationNames
37
37
  const userCodegenId = options.codegen
38
38
 
39
39
  const handlerOptions = options.data ? JSON.parse(options.data) : {}
40
40
 
41
- let operationName = userOperationName
42
- if (!operationName) {
43
- operationName = await autocompleteOperationNames({ netlifyGraphConfig })
41
+ let operationNames = userOperationNames
42
+ if (!operationNames || operationNames.length === 0) {
43
+ const operationName = await autocompleteOperationNames({ netlifyGraphConfig })
44
+ operationNames = [operationName]
44
45
  }
45
46
 
46
- if (!operationName) {
47
+ if (!operationNames || operationNames.length === 0) {
47
48
  error(`No operation name provided`)
48
49
  }
49
50
 
@@ -66,14 +67,17 @@ const graphHandler = async (args, options, command) => {
66
67
  }
67
68
 
68
69
  if (schema) {
69
- generateHandlerByOperationName({
70
- generate: codeGenerator.generateHandler,
71
- logger: log,
72
- netlifyGraphConfig,
73
- schema,
74
- operationName,
75
- handlerOptions,
76
- })
70
+ /* eslint-disable fp/no-loops */
71
+ for (const operationName of operationNames) {
72
+ await generateHandlerByOperationName({
73
+ generate: codeGenerator.generateHandler,
74
+ logger: log,
75
+ netlifyGraphConfig,
76
+ schema,
77
+ operationName,
78
+ handlerOptions,
79
+ })
80
+ }
77
81
  } else {
78
82
  error(`Failed to parse Netlify GraphQL schema`)
79
83
  }
@@ -87,14 +91,14 @@ const graphHandler = async (args, options, command) => {
87
91
  const createGraphHandlerCommand = (program) =>
88
92
  program
89
93
  .command('graph:handler')
90
- .argument('[name]', 'Operation name')
94
+ .argument('[name...]', 'Operation name(s)')
91
95
  .option('-c, --codegen <id>', 'The id of the specific code generator to use')
92
96
  .option("-d, --data '<json>'", 'Optional data to pass along to the code generator')
93
97
  .description(
94
98
  'Generate a handler for a Graph operation given its name. See `graph:operations` for a list of operations.',
95
99
  )
96
- .action(async (operationName, options, command) => {
97
- await graphHandler({ operationName }, options, command)
100
+ .action(async (operationNames, options, command) => {
101
+ await graphHandler({ operationNames }, options, command)
98
102
  })
99
103
 
100
104
  module.exports = { createGraphHandlerCommand }
@@ -198,6 +198,8 @@ const init = async (options, command) => {
198
198
  siteInfo = await createOrLinkSiteToRepo(command)
199
199
  }
200
200
 
201
+ log()
202
+
201
203
  // Check for existing CI setup
202
204
  const remoteBuildRepo = getRepoUrl({ siteInfo })
203
205
  if (remoteBuildRepo && !options.force) {
@@ -1,8 +1,4 @@
1
1
  // @ts-check
2
- const { join, relative } = require('path')
3
- const path = require('path')
4
- const { cwd } = require('process')
5
-
6
2
  const inquirer = require('inquirer')
7
3
  const isEmpty = require('lodash/isEmpty')
8
4
 
@@ -234,10 +230,6 @@ or run ${chalk.cyanBright('netlify sites:create')} to create a site.`)
234
230
  log(`Admin url: ${chalk.magentaBright(site.admin_url)}`)
235
231
  log(`Site url: ${chalk.cyanBright(site.ssl_url || site.url)}`)
236
232
  log()
237
-
238
- log(`Site id saved to ${path.join(netlify.site.root, '/.netlify/state.json')}`)
239
- // log(`Local Config: .netlify/config.json`)
240
- log()
241
233
  log(`You can now run other \`netlify\` cli commands in this directory`)
242
234
 
243
235
  return site
@@ -296,7 +288,7 @@ const link = async (options, command) => {
296
288
 
297
289
  // Save site ID
298
290
  state.set('siteId', siteData.id)
299
- log(`Linked to ${siteData.name} in ${state.path}`)
291
+ log(`Linked to ${siteData.name}`)
300
292
 
301
293
  await track('sites_linked', {
302
294
  siteId: siteData.id,
@@ -327,7 +319,7 @@ const link = async (options, command) => {
327
319
  const [firstSiteData] = results
328
320
  state.set('siteId', firstSiteData.id)
329
321
 
330
- log(`Linked to ${firstSiteData.name} in ${relative(join(cwd(), '..'), state.path)}`)
322
+ log(`Linked to ${firstSiteData.name}`)
331
323
 
332
324
  await track('sites_linked', {
333
325
  siteId: (firstSiteData && firstSiteData.id) || siteId,
@@ -39,16 +39,14 @@ const getSiteNameInput = async (name, user, api) => {
39
39
  ]
40
40
  siteSuggestion = sample(suggestions)
41
41
 
42
- console.log(
43
- `Choose a unique site name (e.g. ${siteSuggestion}.netlify.app) or leave it blank for a random name. You can update the site name later.`,
44
- )
45
42
  const { name: nameInput } = await inquirer.prompt([
46
43
  {
47
44
  type: 'input',
48
45
  name: 'name',
49
- message: 'Site name (optional):',
50
- filter: (val) => (val === '' ? undefined : val),
51
- validate: (input) => /^[a-zA-Z\d-]+$/.test(input) || 'Only alphanumeric characters and hyphens are allowed',
46
+ message: 'Site name (you can change it later):',
47
+ default: siteSuggestion,
48
+ validate: (input) =>
49
+ /^[a-zA-Z\d-]+$/.test(input || undefined) || 'Only alphanumeric characters and hyphens are allowed',
52
50
  },
53
51
  ])
54
52
  name = nameInput || siteSuggestion
@@ -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.25",
30
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.25.tgz",
31
+ "integrity": "sha512-9pLfceRSrKIsv/MISN6RoFWTIzka36Uk2Uuf5a8cHyDYhEgl5Hm5dXoe621KULeBjt+cFsY18mILsWWtJeG80w=="
32
32
  },
33
33
  "node_modules/is-promise": {
34
34
  "version": "4.0.0",
@@ -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.25",
62
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.25.tgz",
63
+ "integrity": "sha512-9pLfceRSrKIsv/MISN6RoFWTIzka36Uk2Uuf5a8cHyDYhEgl5Hm5dXoe621KULeBjt+cFsY18mILsWWtJeG80w=="
64
64
  },
65
65
  "is-promise": {
66
66
  "version": "4.0.0",
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
 
@@ -318,7 +318,7 @@ const refetchAndGenerateFromOneGraph = async (input) => {
318
318
  return
319
319
  }
320
320
 
321
- generateFunctionsFile({
321
+ await generateFunctionsFile({
322
322
  config,
323
323
  logger,
324
324
  netlifyGraphConfig,
@@ -619,7 +619,7 @@ ${JSON.stringify(payload, null, 2)}`)
619
619
  return
620
620
  }
621
621
 
622
- const files = generateHandlerByOperationId({
622
+ const files = await generateHandlerByOperationId({
623
623
  netlifyGraphConfig,
624
624
  schema,
625
625
  operationId: payload.operationId,
@@ -550,9 +550,9 @@ const readGraphQLSchemaFile = (netlifyGraphConfig) => {
550
550
  * @param {string} input.operationsDoc The document containing the operation with operationId and any fragment dependency to use when generating the handler
551
551
  * @param {object} input.handlerOptions The options to use when generating the handler
552
552
  * @param {(message: string) => void=} input.logger A function that if provided will be used to log messages
553
- * @returns {{exportedFiles: CodegenHelpers.ExportedFile[]; operation: GraphQL.OperationDefinitionNode;} | undefined} The generated files
553
+ * @returns {Promise<{exportedFiles: CodegenHelpers.ExportedFile[]; operation: GraphQL.OperationDefinitionNode;} | undefined>} The generated files
554
554
  */
555
- const generateHandlerSourceByOperationId = ({
555
+ const generateHandlerSourceByOperationId = async ({
556
556
  generate,
557
557
  handlerOptions,
558
558
  netlifyGraphConfig,
@@ -571,7 +571,7 @@ const generateHandlerSourceByOperationId = ({
571
571
  operationsDoc,
572
572
  }
573
573
 
574
- const result = NetlifyGraph.generateCustomHandlerSource(generateHandlerPayload)
574
+ const result = await NetlifyGraph.generateCustomHandlerSource(generateHandlerPayload)
575
575
 
576
576
  return result
577
577
  }
@@ -585,15 +585,15 @@ const generateHandlerSourceByOperationId = ({
585
585
  * @param {string} input.operationId The operationId to use when generating the handler
586
586
  * @param {object} input.handlerOptions The options to use when generating the handler
587
587
  * @param {(message: string) => void=} input.logger A function that if provided will be used to log messages
588
- * @returns {Array<{filePath: string, name:string, prettierSuccess: boolean}> | undefined} An array of the generated handler filepaths
588
+ * @returns {Promise<Array<{filePath: string, name:string, prettierSuccess: boolean}> | undefined>} An array of the generated handler filepaths
589
589
  */
590
- const generateHandlerByOperationId = ({ generate, handlerOptions, netlifyGraphConfig, operationId, schema }) => {
590
+ const generateHandlerByOperationId = async ({ generate, handlerOptions, netlifyGraphConfig, operationId, schema }) => {
591
591
  let currentOperationsDoc = readGraphQLOperationsSourceFile(netlifyGraphConfig)
592
592
  if (currentOperationsDoc.trim().length === 0) {
593
593
  currentOperationsDoc = NetlifyGraph.defaultExampleOperationsDoc
594
594
  }
595
595
 
596
- const result = generateHandlerSourceByOperationId({
596
+ const result = await generateHandlerSourceByOperationId({
597
597
  generate,
598
598
  handlerOptions,
599
599
  netlifyGraphConfig,
@@ -669,9 +669,9 @@ const generateHandlerByOperationId = ({ generate, handlerOptions, netlifyGraphCo
669
669
  * @param {string} input.operationName The name of the operation to use when generating the handler
670
670
  * @param {object} input.handlerOptions The options to use when generating the handler
671
671
  * @param {(message: string) => void} input.logger A function that if provided will be used to log messages
672
- * @returns
672
+ * @returns {Promise<void>}
673
673
  */
674
- const generateHandlerByOperationName = ({
674
+ const generateHandlerByOperationName = async ({
675
675
  generate,
676
676
  handlerOptions,
677
677
  logger,
@@ -702,7 +702,7 @@ const generateHandlerByOperationName = ({
702
702
  return
703
703
  }
704
704
 
705
- generateHandlerByOperationId({
705
+ await generateHandlerByOperationId({
706
706
  logger,
707
707
  generate,
708
708
  netlifyGraphConfig,
@@ -224,6 +224,8 @@ const configGithub = async ({ command, repoName, repoOwner, siteId }) => {
224
224
  })
225
225
  await saveNetlifyToml({ repositoryRoot, config, configPath, baseDir, buildCmd, buildDir, functionsDir })
226
226
 
227
+ log()
228
+
227
229
  const octokit = getGitHubClient(token)
228
230
  const [deployKey, githubRepo] = await Promise.all([
229
231
  addDeployKey({ api, octokit, repoOwner, repoName }),
@@ -1,38 +1,10 @@
1
- const fetch = require('node-fetch')
2
-
3
- // TODO: use static `import` after migrating this repository to pure ES modules
4
- const netlifyPluginsList = import('@netlify/plugins-list')
5
-
6
- // 1 minute
7
- const PLUGINS_LIST_TIMEOUT = 6e4
8
-
9
- const getPluginsList = async () => {
10
- const { pluginsList, pluginsUrl } = await netlifyPluginsList
11
- try {
12
- const response = await fetch(pluginsUrl, { timeout: PLUGINS_LIST_TIMEOUT })
13
- return await response.json()
14
- } catch {
15
- return pluginsList
16
- }
17
- }
18
-
19
- const getPluginInfo = (list, packageName) => list.find(({ package }) => package === packageName)
20
-
21
1
  const isPluginInstalled = (configPlugins, plugin) =>
22
2
  configPlugins.some(({ package: configPlugin }) => configPlugin === plugin)
23
3
 
24
4
  const getRecommendPlugins = (frameworkPlugins, config) =>
25
5
  frameworkPlugins.filter((plugin) => !isPluginInstalled(config.plugins, plugin))
26
6
 
27
- const getPluginsToInstall = ({ installSinglePlugin, plugins, recommendedPlugins }) => {
28
- if (Array.isArray(plugins)) {
29
- return plugins.map((plugin) => ({ package: plugin }))
30
- }
31
-
32
- return installSinglePlugin === true ? [{ package: recommendedPlugins[0] }] : []
33
- }
34
-
35
7
  const getUIPlugins = (configPlugins) =>
36
8
  configPlugins.filter(({ origin }) => origin === 'ui').map(({ package }) => ({ package }))
37
9
 
38
- module.exports = { getPluginsList, getPluginInfo, getRecommendPlugins, getPluginsToInstall, getUIPlugins }
10
+ module.exports = { getRecommendPlugins, getUIPlugins }
@@ -1,7 +1,6 @@
1
1
  // @ts-check
2
2
  const { existsSync } = require('fs')
3
3
  const { writeFile } = require('fs').promises
4
- const { EOL } = require('os')
5
4
  const path = require('path')
6
5
  const process = require('process')
7
6
 
@@ -10,11 +9,12 @@ const inquirer = require('inquirer')
10
9
  const isEmpty = require('lodash/isEmpty')
11
10
 
12
11
  const { normalizeBackslash } = require('../../lib/path')
12
+ const { log } = require('../command-helpers')
13
13
  const { chalk, error: failAndExit, warn } = require('../command-helpers')
14
14
 
15
15
  const { getFrameworkInfo } = require('./frameworks')
16
16
  const { detectNodeVersion } = require('./node-version')
17
- const { getPluginInfo, getPluginsList, getPluginsToInstall, getRecommendPlugins, getUIPlugins } = require('./plugins')
17
+ const { getRecommendPlugins, getUIPlugins } = require('./plugins')
18
18
 
19
19
  const normalizeDir = ({ baseDirectory, defaultValue, dir }) => {
20
20
  if (dir === undefined) {
@@ -55,14 +55,7 @@ const getDefaultSettings = ({
55
55
  }
56
56
  }
57
57
 
58
- const getPromptInputs = async ({
59
- defaultBaseDir,
60
- defaultBuildCmd,
61
- defaultBuildDir,
62
- defaultFunctionsDir,
63
- frameworkName,
64
- recommendedPlugins,
65
- }) => {
58
+ const getPromptInputs = ({ defaultBaseDir, defaultBuildCmd, defaultBuildDir }) => {
66
59
  const inputs = [
67
60
  defaultBaseDir !== undefined && {
68
61
  type: 'input',
@@ -83,50 +76,9 @@ const getPromptInputs = async ({
83
76
  message: 'Directory to deploy (blank for current dir):',
84
77
  default: defaultBuildDir,
85
78
  },
86
- {
87
- type: 'input',
88
- name: 'functionsDir',
89
- message: 'Netlify functions folder:',
90
- default: defaultFunctionsDir,
91
- },
92
79
  ].filter(Boolean)
93
80
 
94
- if (recommendedPlugins.length === 0) {
95
- return inputs
96
- }
97
-
98
- const pluginsList = await getPluginsList()
99
-
100
- const prefix = `Seems like this is a ${formatTitle(frameworkName)} site.${EOL}❇️ `
101
- if (recommendedPlugins.length === 1) {
102
- const { name } = getPluginInfo(pluginsList, recommendedPlugins[0])
103
- return [
104
- ...inputs,
105
- {
106
- type: 'confirm',
107
- name: 'installSinglePlugin',
108
- message: `${prefix}We're going to install this Build Plugin: ${formatTitle(
109
- `${name} plugin`,
110
- )}${EOL}➡️ OK to install?`,
111
- default: true,
112
- },
113
- ]
114
- }
115
-
116
- const infos = recommendedPlugins.map((packageName) => getPluginInfo(pluginsList, packageName))
117
- return [
118
- ...inputs,
119
- {
120
- type: 'checkbox',
121
- name: 'plugins',
122
- message: `${prefix}We're going to install these plugins: ${infos
123
- .map(({ name }) => `${name} plugin`)
124
- .map(formatTitle)
125
- .join(', ')}${EOL}➡️ OK to install??`,
126
- choices: infos.map((info) => ({ name: `${info.name} plugin`, value: info.package })),
127
- default: infos.map((info) => info.package),
128
- },
129
- ]
81
+ return inputs.filter(Boolean)
130
82
  }
131
83
 
132
84
  // `repositoryRoot === siteRoot` means the base directory wasn't detected by @netlify/config, so we use cwd()
@@ -154,25 +106,24 @@ const getBuildSettings = async ({ config, env, repositoryRoot, siteRoot }) => {
154
106
  frameworkBuildDir,
155
107
  frameworkPlugins,
156
108
  })
157
- const { baseDir, buildCmd, buildDir, functionsDir, installSinglePlugin, plugins } = await inquirer.prompt(
158
- await getPromptInputs({
109
+
110
+ if (recommendedPlugins.length !== 0) {
111
+ log(`Configuring ${formatTitle(frameworkName)} runtime...`)
112
+ log()
113
+ }
114
+
115
+ const { baseDir, buildCmd, buildDir } = await inquirer.prompt(
116
+ getPromptInputs({
117
+ defaultBaseDir,
159
118
  defaultBuildCmd,
160
119
  defaultBuildDir,
161
- defaultFunctionsDir,
162
- defaultBaseDir,
163
- recommendedPlugins,
164
- frameworkName,
165
120
  }),
166
121
  )
167
- const pluginsToInstall = getPluginsToInstall({
168
- plugins,
169
- installSinglePlugin,
170
- recommendedPlugins,
171
- })
172
122
 
123
+ const pluginsToInstall = recommendedPlugins.map((plugin) => ({ package: plugin }))
173
124
  const normalizedBaseDir = baseDir ? normalizeBackslash(baseDir) : undefined
174
125
 
175
- return { baseDir: normalizedBaseDir, buildCmd, buildDir, functionsDir, pluginsToInstall }
126
+ return { baseDir: normalizedBaseDir, buildCmd, buildDir, functionsDir: defaultFunctionsDir, pluginsToInstall }
176
127
  }
177
128
 
178
129
  const getNetlifyToml = ({