netlify-cli 17.7.0 → 17.8.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,24 +1,24 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "17.7.0",
3
+ "version": "17.8.1",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "17.7.0",
9
+ "version": "17.8.1",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
13
  "@bugsnag/js": "7.20.2",
14
14
  "@fastify/static": "6.10.2",
15
- "@netlify/blobs": "6.3.0",
16
- "@netlify/build": "29.27.0",
15
+ "@netlify/blobs": "6.3.1",
16
+ "@netlify/build": "29.29.0",
17
17
  "@netlify/build-info": "7.11.1",
18
18
  "@netlify/config": "20.10.0",
19
19
  "@netlify/edge-bundler": "10.1.3",
20
20
  "@netlify/local-functions-proxy": "1.1.1",
21
- "@netlify/zip-it-and-ship-it": "9.26.2",
21
+ "@netlify/zip-it-and-ship-it": "9.26.4",
22
22
  "@octokit/rest": "19.0.13",
23
23
  "ansi-escapes": "6.2.0",
24
24
  "ansi-styles": "6.2.1",
@@ -284,6 +284,19 @@
284
284
  "node": ">=6.0.0"
285
285
  }
286
286
  },
287
+ "node_modules/@babel/types": {
288
+ "version": "7.23.3",
289
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz",
290
+ "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==",
291
+ "dependencies": {
292
+ "@babel/helper-string-parser": "^7.22.5",
293
+ "@babel/helper-validator-identifier": "^7.22.20",
294
+ "to-fast-properties": "^2.0.0"
295
+ },
296
+ "engines": {
297
+ "node": ">=6.9.0"
298
+ }
299
+ },
287
300
  "node_modules/@bugsnag/browser": {
288
301
  "version": "7.20.2",
289
302
  "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz",
@@ -798,29 +811,30 @@
798
811
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
799
812
  },
800
813
  "node_modules/@netlify/blobs": {
801
- "version": "6.3.0",
802
- "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.0.tgz",
803
- "integrity": "sha512-EcgttqwH7kmK5B9RO8hRwAx/pkO9RwfFoRl+B38UNiFN6L4T46Q9Vhxnp3EzXQxn7Le1RpwFnXhd+UAhyZod+g==",
814
+ "version": "6.3.1",
815
+ "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.1.tgz",
816
+ "integrity": "sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg==",
804
817
  "engines": {
805
818
  "node": "^14.16.0 || >=16.0.0"
806
819
  }
807
820
  },
808
821
  "node_modules/@netlify/build": {
809
- "version": "29.27.0",
810
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.27.0.tgz",
811
- "integrity": "sha512-olo97YFbaprhTECbzMl/6MuAPmB835wmAz+uSkG22unkbG19kmUibjcxQhLzArrhJa5YIOei2Xnkh9qWnJZxTw==",
822
+ "version": "29.29.0",
823
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.29.0.tgz",
824
+ "integrity": "sha512-xvDJY3lCGVDpGqKvB0vDYt9777p6xR+a3GmKxA2JoJHLn3yidXm+X76Ef73kngGVcwU7FumQNx8nb8vzd1kKYg==",
812
825
  "dependencies": {
813
826
  "@bugsnag/js": "^7.0.0",
814
827
  "@honeycombio/opentelemetry-node": "^0.5.0",
828
+ "@netlify/blobs": "^6.3.1",
815
829
  "@netlify/cache-utils": "^5.1.5",
816
830
  "@netlify/config": "^20.10.0",
817
831
  "@netlify/edge-bundler": "10.1.3",
818
832
  "@netlify/framework-info": "^9.8.10",
819
- "@netlify/functions-utils": "^5.2.41",
833
+ "@netlify/functions-utils": "^5.2.42",
820
834
  "@netlify/git-utils": "^5.1.1",
821
835
  "@netlify/plugins-list": "^6.72.0",
822
836
  "@netlify/run-utils": "^5.1.1",
823
- "@netlify/zip-it-and-ship-it": "9.26.2",
837
+ "@netlify/zip-it-and-ship-it": "9.26.4",
824
838
  "@opentelemetry/api": "^1.4.1",
825
839
  "@opentelemetry/core": "^1.17.1",
826
840
  "@sindresorhus/slugify": "^2.0.0",
@@ -841,11 +855,13 @@
841
855
  "log-process-errors": "^8.0.0",
842
856
  "map-obj": "^5.0.0",
843
857
  "memoize-one": "^6.0.0",
858
+ "node-fetch": "^3.3.2",
844
859
  "os-name": "^5.0.0",
845
860
  "p-event": "^5.0.0",
846
861
  "p-every": "^2.0.0",
847
862
  "p-filter": "^3.0.0",
848
863
  "p-locate": "^6.0.0",
864
+ "p-map": "^6.0.0",
849
865
  "p-reduce": "^3.0.0",
850
866
  "path-exists": "^5.0.0",
851
867
  "path-type": "^5.0.0",
@@ -872,6 +888,14 @@
872
888
  },
873
889
  "engines": {
874
890
  "node": "^14.16.0 || >=16.0.0"
891
+ },
892
+ "peerDependencies": {
893
+ "@netlify/opentelemetry-sdk-setup": "^1.0.1"
894
+ },
895
+ "peerDependenciesMeta": {
896
+ "@netlify/opentelemetry-sdk-setup": {
897
+ "optional": true
898
+ }
875
899
  }
876
900
  },
877
901
  "node_modules/@netlify/build-info": {
@@ -1164,6 +1188,23 @@
1164
1188
  "url": "https://github.com/sponsors/sindresorhus"
1165
1189
  }
1166
1190
  },
1191
+ "node_modules/@netlify/build/node_modules/node-fetch": {
1192
+ "version": "3.3.2",
1193
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
1194
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
1195
+ "dependencies": {
1196
+ "data-uri-to-buffer": "^4.0.0",
1197
+ "fetch-blob": "^3.1.4",
1198
+ "formdata-polyfill": "^4.0.10"
1199
+ },
1200
+ "engines": {
1201
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
1202
+ },
1203
+ "funding": {
1204
+ "type": "opencollective",
1205
+ "url": "https://opencollective.com/node-fetch"
1206
+ }
1207
+ },
1167
1208
  "node_modules/@netlify/build/node_modules/normalize-url": {
1168
1209
  "version": "8.0.0",
1169
1210
  "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz",
@@ -1239,6 +1280,17 @@
1239
1280
  "url": "https://github.com/sponsors/sindresorhus"
1240
1281
  }
1241
1282
  },
1283
+ "node_modules/@netlify/build/node_modules/p-map": {
1284
+ "version": "6.0.0",
1285
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz",
1286
+ "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw==",
1287
+ "engines": {
1288
+ "node": ">=16"
1289
+ },
1290
+ "funding": {
1291
+ "url": "https://github.com/sponsors/sindresorhus"
1292
+ }
1293
+ },
1242
1294
  "node_modules/@netlify/build/node_modules/path-exists": {
1243
1295
  "version": "5.0.0",
1244
1296
  "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
@@ -2265,11 +2317,11 @@
2265
2317
  }
2266
2318
  },
2267
2319
  "node_modules/@netlify/functions-utils": {
2268
- "version": "5.2.41",
2269
- "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.41.tgz",
2270
- "integrity": "sha512-rvp11NquyVQ4d5rK6W6cP4M3iKyuOATqfEGlC7jLUZjMeNp4bQ5gPb5RaqqG5MHPY0KmdELMGGGgUxmCbh+Qxw==",
2320
+ "version": "5.2.42",
2321
+ "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.42.tgz",
2322
+ "integrity": "sha512-ltZ5Vtop8IiJOgSnKApxZdXArOq4cLDs9WpZ3Xoa1lJDojjyPvAH6Vpp3DxFAdi9a8pzYK70vTb048SzMwffnA==",
2271
2323
  "dependencies": {
2272
- "@netlify/zip-it-and-ship-it": "9.26.2",
2324
+ "@netlify/zip-it-and-ship-it": "9.26.4",
2273
2325
  "cpy": "^9.0.0",
2274
2326
  "path-exists": "^5.0.0"
2275
2327
  },
@@ -2689,9 +2741,9 @@
2689
2741
  }
2690
2742
  },
2691
2743
  "node_modules/@netlify/serverless-functions-api": {
2692
- "version": "1.12.0",
2693
- "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.0.tgz",
2694
- "integrity": "sha512-LJt2gHzLQMgJLsLG9Chbu2Pxxi7Yzbj3Xcd9QlThvUlD7kf4nAr3lzzRJMZqo77rVNmfQX11W1uvGMSlduiKeA==",
2744
+ "version": "1.12.1",
2745
+ "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.1.tgz",
2746
+ "integrity": "sha512-+G9cTltqfH54dF4dLqoEOV2P4qTIY8dM9blUVqg+NtVTXyuadzgpHqtffhVeyeLytVnTx1238kWJUe+sV3bnlg==",
2695
2747
  "dependencies": {
2696
2748
  "@netlify/node-cookies": "^0.1.0",
2697
2749
  "urlpattern-polyfill": "8.0.2"
@@ -2701,14 +2753,14 @@
2701
2753
  }
2702
2754
  },
2703
2755
  "node_modules/@netlify/zip-it-and-ship-it": {
2704
- "version": "9.26.2",
2705
- "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.26.2.tgz",
2706
- "integrity": "sha512-tsQbSfgOTEfZmSnUbCJiHDVyYDRN1gQQEWjAmJ90YI60ZloT4j7B4HlBt0gshU9pPCiDxoHhQMCk5pHg7//CSw==",
2756
+ "version": "9.26.4",
2757
+ "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.26.4.tgz",
2758
+ "integrity": "sha512-lGdmHz5ppP6VmVEuvuL5nKP7a3/dUGRLBotqs2x/lwp35/1lbR+CIbXV6y8IYc4yn1hDfDtp+Lcqe6Np2KcFtg==",
2707
2759
  "dependencies": {
2708
2760
  "@babel/parser": "^7.22.5",
2709
2761
  "@babel/types": "7.23.3",
2710
2762
  "@netlify/binary-info": "^1.0.0",
2711
- "@netlify/serverless-functions-api": "^1.12.0",
2763
+ "@netlify/serverless-functions-api": "^1.12.1",
2712
2764
  "@vercel/nft": "^0.23.0",
2713
2765
  "archiver": "^6.0.0",
2714
2766
  "common-path-prefix": "^3.0.0",
@@ -2745,19 +2797,6 @@
2745
2797
  "node": "^14.18.0 || >=16.0.0"
2746
2798
  }
2747
2799
  },
2748
- "node_modules/@netlify/zip-it-and-ship-it/node_modules/@babel/types": {
2749
- "version": "7.23.3",
2750
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz",
2751
- "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==",
2752
- "dependencies": {
2753
- "@babel/helper-string-parser": "^7.22.5",
2754
- "@babel/helper-validator-identifier": "^7.22.20",
2755
- "to-fast-properties": "^2.0.0"
2756
- },
2757
- "engines": {
2758
- "node": ">=6.9.0"
2759
- }
2760
- },
2761
2800
  "node_modules/@netlify/zip-it-and-ship-it/node_modules/@esbuild/android-arm": {
2762
2801
  "version": "0.19.6",
2763
2802
  "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz",
@@ -16637,6 +16676,16 @@
16637
16676
  "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
16638
16677
  "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw=="
16639
16678
  },
16679
+ "@babel/types": {
16680
+ "version": "7.23.3",
16681
+ "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz",
16682
+ "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==",
16683
+ "requires": {
16684
+ "@babel/helper-string-parser": "^7.22.5",
16685
+ "@babel/helper-validator-identifier": "^7.22.20",
16686
+ "to-fast-properties": "^2.0.0"
16687
+ }
16688
+ },
16640
16689
  "@bugsnag/browser": {
16641
16690
  "version": "7.20.2",
16642
16691
  "resolved": "https://registry.npmjs.org/@bugsnag/browser/-/browser-7.20.2.tgz",
@@ -17046,26 +17095,27 @@
17046
17095
  "integrity": "sha512-4wMPu9iN3/HL97QblBsBay3E1etIciR84izI3U+4iALY+JHCrI+a2jO0qbAZ/nxKoegypYEaiiqWXylm+/zfrw=="
17047
17096
  },
17048
17097
  "@netlify/blobs": {
17049
- "version": "6.3.0",
17050
- "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.0.tgz",
17051
- "integrity": "sha512-EcgttqwH7kmK5B9RO8hRwAx/pkO9RwfFoRl+B38UNiFN6L4T46Q9Vhxnp3EzXQxn7Le1RpwFnXhd+UAhyZod+g=="
17098
+ "version": "6.3.1",
17099
+ "resolved": "https://registry.npmjs.org/@netlify/blobs/-/blobs-6.3.1.tgz",
17100
+ "integrity": "sha512-JjLz3WW7Wp6NVwQtDxPpWio4L3u9pnnDXnQ7Q16zgAFE9IA1rSjZVSsyOQrtkiBQIxaJ1Zr5eky8vrXJ5mdRWg=="
17052
17101
  },
17053
17102
  "@netlify/build": {
17054
- "version": "29.27.0",
17055
- "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.27.0.tgz",
17056
- "integrity": "sha512-olo97YFbaprhTECbzMl/6MuAPmB835wmAz+uSkG22unkbG19kmUibjcxQhLzArrhJa5YIOei2Xnkh9qWnJZxTw==",
17103
+ "version": "29.29.0",
17104
+ "resolved": "https://registry.npmjs.org/@netlify/build/-/build-29.29.0.tgz",
17105
+ "integrity": "sha512-xvDJY3lCGVDpGqKvB0vDYt9777p6xR+a3GmKxA2JoJHLn3yidXm+X76Ef73kngGVcwU7FumQNx8nb8vzd1kKYg==",
17057
17106
  "requires": {
17058
17107
  "@bugsnag/js": "^7.0.0",
17059
17108
  "@honeycombio/opentelemetry-node": "^0.5.0",
17109
+ "@netlify/blobs": "^6.3.1",
17060
17110
  "@netlify/cache-utils": "^5.1.5",
17061
17111
  "@netlify/config": "^20.10.0",
17062
17112
  "@netlify/edge-bundler": "10.1.3",
17063
17113
  "@netlify/framework-info": "^9.8.10",
17064
- "@netlify/functions-utils": "^5.2.41",
17114
+ "@netlify/functions-utils": "^5.2.42",
17065
17115
  "@netlify/git-utils": "^5.1.1",
17066
17116
  "@netlify/plugins-list": "^6.72.0",
17067
17117
  "@netlify/run-utils": "^5.1.1",
17068
- "@netlify/zip-it-and-ship-it": "9.26.2",
17118
+ "@netlify/zip-it-and-ship-it": "9.26.4",
17069
17119
  "@opentelemetry/api": "^1.4.1",
17070
17120
  "@opentelemetry/core": "^1.17.1",
17071
17121
  "@sindresorhus/slugify": "^2.0.0",
@@ -17086,11 +17136,13 @@
17086
17136
  "log-process-errors": "^8.0.0",
17087
17137
  "map-obj": "^5.0.0",
17088
17138
  "memoize-one": "^6.0.0",
17139
+ "node-fetch": "^3.3.2",
17089
17140
  "os-name": "^5.0.0",
17090
17141
  "p-event": "^5.0.0",
17091
17142
  "p-every": "^2.0.0",
17092
17143
  "p-filter": "^3.0.0",
17093
17144
  "p-locate": "^6.0.0",
17145
+ "p-map": "^6.0.0",
17094
17146
  "p-reduce": "^3.0.0",
17095
17147
  "path-exists": "^5.0.0",
17096
17148
  "path-type": "^5.0.0",
@@ -17245,6 +17297,16 @@
17245
17297
  "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz",
17246
17298
  "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg=="
17247
17299
  },
17300
+ "node-fetch": {
17301
+ "version": "3.3.2",
17302
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
17303
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
17304
+ "requires": {
17305
+ "data-uri-to-buffer": "^4.0.0",
17306
+ "fetch-blob": "^3.1.4",
17307
+ "formdata-polyfill": "^4.0.10"
17308
+ }
17309
+ },
17248
17310
  "normalize-url": {
17249
17311
  "version": "8.0.0",
17250
17312
  "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz",
@@ -17287,6 +17349,11 @@
17287
17349
  "p-limit": "^4.0.0"
17288
17350
  }
17289
17351
  },
17352
+ "p-map": {
17353
+ "version": "6.0.0",
17354
+ "resolved": "https://registry.npmjs.org/p-map/-/p-map-6.0.0.tgz",
17355
+ "integrity": "sha512-T8BatKGY+k5rU+Q/GTYgrEf2r4xRMevAN5mtXc2aPc4rS1j3s+vWTaO2Wag94neXuCAUAs8cxBL9EeB5EA6diw=="
17356
+ },
17290
17357
  "path-exists": {
17291
17358
  "version": "5.0.0",
17292
17359
  "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz",
@@ -17930,11 +17997,11 @@
17930
17997
  }
17931
17998
  },
17932
17999
  "@netlify/functions-utils": {
17933
- "version": "5.2.41",
17934
- "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.41.tgz",
17935
- "integrity": "sha512-rvp11NquyVQ4d5rK6W6cP4M3iKyuOATqfEGlC7jLUZjMeNp4bQ5gPb5RaqqG5MHPY0KmdELMGGGgUxmCbh+Qxw==",
18000
+ "version": "5.2.42",
18001
+ "resolved": "https://registry.npmjs.org/@netlify/functions-utils/-/functions-utils-5.2.42.tgz",
18002
+ "integrity": "sha512-ltZ5Vtop8IiJOgSnKApxZdXArOq4cLDs9WpZ3Xoa1lJDojjyPvAH6Vpp3DxFAdi9a8pzYK70vTb048SzMwffnA==",
17936
18003
  "requires": {
17937
- "@netlify/zip-it-and-ship-it": "9.26.2",
18004
+ "@netlify/zip-it-and-ship-it": "9.26.4",
17938
18005
  "cpy": "^9.0.0",
17939
18006
  "path-exists": "^5.0.0"
17940
18007
  },
@@ -18171,23 +18238,23 @@
18171
18238
  }
18172
18239
  },
18173
18240
  "@netlify/serverless-functions-api": {
18174
- "version": "1.12.0",
18175
- "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.0.tgz",
18176
- "integrity": "sha512-LJt2gHzLQMgJLsLG9Chbu2Pxxi7Yzbj3Xcd9QlThvUlD7kf4nAr3lzzRJMZqo77rVNmfQX11W1uvGMSlduiKeA==",
18241
+ "version": "1.12.1",
18242
+ "resolved": "https://registry.npmjs.org/@netlify/serverless-functions-api/-/serverless-functions-api-1.12.1.tgz",
18243
+ "integrity": "sha512-+G9cTltqfH54dF4dLqoEOV2P4qTIY8dM9blUVqg+NtVTXyuadzgpHqtffhVeyeLytVnTx1238kWJUe+sV3bnlg==",
18177
18244
  "requires": {
18178
18245
  "@netlify/node-cookies": "^0.1.0",
18179
18246
  "urlpattern-polyfill": "8.0.2"
18180
18247
  }
18181
18248
  },
18182
18249
  "@netlify/zip-it-and-ship-it": {
18183
- "version": "9.26.2",
18184
- "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.26.2.tgz",
18185
- "integrity": "sha512-tsQbSfgOTEfZmSnUbCJiHDVyYDRN1gQQEWjAmJ90YI60ZloT4j7B4HlBt0gshU9pPCiDxoHhQMCk5pHg7//CSw==",
18250
+ "version": "9.26.4",
18251
+ "resolved": "https://registry.npmjs.org/@netlify/zip-it-and-ship-it/-/zip-it-and-ship-it-9.26.4.tgz",
18252
+ "integrity": "sha512-lGdmHz5ppP6VmVEuvuL5nKP7a3/dUGRLBotqs2x/lwp35/1lbR+CIbXV6y8IYc4yn1hDfDtp+Lcqe6Np2KcFtg==",
18186
18253
  "requires": {
18187
18254
  "@babel/parser": "^7.22.5",
18188
18255
  "@babel/types": "7.23.3",
18189
18256
  "@netlify/binary-info": "^1.0.0",
18190
- "@netlify/serverless-functions-api": "^1.12.0",
18257
+ "@netlify/serverless-functions-api": "^1.12.1",
18191
18258
  "@vercel/nft": "^0.23.0",
18192
18259
  "archiver": "^6.0.0",
18193
18260
  "common-path-prefix": "^3.0.0",
@@ -18218,16 +18285,6 @@
18218
18285
  "yargs": "^17.0.0"
18219
18286
  },
18220
18287
  "dependencies": {
18221
- "@babel/types": {
18222
- "version": "7.23.3",
18223
- "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.3.tgz",
18224
- "integrity": "sha512-OZnvoH2l8PK5eUvEcUyCt/sXgr/h+UWpVuBbOljwcrAgUl6lpchoQ++PHGyQy1AtYnVA6CEq3y5xeEI10brpXw==",
18225
- "requires": {
18226
- "@babel/helper-string-parser": "^7.22.5",
18227
- "@babel/helper-validator-identifier": "^7.22.20",
18228
- "to-fast-properties": "^2.0.0"
18229
- }
18230
- },
18231
18288
  "@esbuild/android-arm": {
18232
18289
  "version": "0.19.6",
18233
18290
  "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.6.tgz",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "17.7.0",
4
+ "version": "17.8.1",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -45,13 +45,13 @@
45
45
  "dependencies": {
46
46
  "@bugsnag/js": "7.20.2",
47
47
  "@fastify/static": "6.10.2",
48
- "@netlify/blobs": "6.3.0",
49
- "@netlify/build": "29.27.0",
48
+ "@netlify/blobs": "6.3.1",
49
+ "@netlify/build": "29.29.0",
50
50
  "@netlify/build-info": "7.11.1",
51
51
  "@netlify/config": "20.10.0",
52
52
  "@netlify/edge-bundler": "10.1.3",
53
53
  "@netlify/local-functions-proxy": "1.1.1",
54
- "@netlify/zip-it-and-ship-it": "9.26.2",
54
+ "@netlify/zip-it-and-ship-it": "9.26.4",
55
55
  "@octokit/rest": "19.0.13",
56
56
  "ansi-escapes": "6.2.0",
57
57
  "ansi-styles": "6.2.1",
@@ -253,7 +253,9 @@ export class EdgeFunctionsRegistry {
253
253
  */
254
254
  processGraph(graph) {
255
255
  if (!graph) {
256
- warn('Could not process edge functions dependency graph. Live reload will not be available.');
256
+ if (this.functions.length !== 0) {
257
+ warn('Could not process edge functions dependency graph. Live reload will not be available.');
258
+ }
257
259
  return;
258
260
  }
259
261
  // Creating a Map from `this.functions` that maps function paths to function
@@ -8,9 +8,7 @@ import { BACKGROUND } from '../../utils/functions/get-functions.js';
8
8
  const TYPESCRIPT_EXTENSIONS = new Set(['.cts', '.mts', '.ts']);
9
9
  const V2_MIN_NODE_VERSION = '18.14.0';
10
10
  // Returns a new set with all elements of `setA` that don't exist in `setB`.
11
- // @ts-expect-error TS(7006) FIXME: Parameter 'setA' implicitly has an 'any' type.
12
11
  const difference = (setA, setB) => new Set([...setA].filter((item) => !setB.has(item)));
13
- // @ts-expect-error TS(7006) FIXME: Parameter 'schedule' implicitly has an 'any' type.
14
12
  const getNextRun = function (schedule) {
15
13
  const cron = CronParser.parseExpression(schedule, {
16
14
  tz: 'Etc/UTC',
@@ -41,60 +39,40 @@ export default class NetlifyFunction {
41
39
  timeoutBackground,
42
40
  // @ts-expect-error TS(7031) FIXME: Binding element 'timeoutSynchronous' implicitly ha... Remove this comment to see the full error message
43
41
  timeoutSynchronous, }) {
44
- // @ts-expect-error TS(2339) FIXME: Property 'blobsContext' does not exist on type 'Ne... Remove this comment to see the full error message
45
- this.blobsContext = blobsContext;
46
- // @ts-expect-error TS(2339) FIXME: Property 'buildError' does not exist on type 'Netl... Remove this comment to see the full error message
47
42
  this.buildError = null;
43
+ // List of the function's source files. This starts out as an empty set
44
+ // and will get populated on every build.
45
+ this.srcFiles = new Set();
46
+ this.blobsContext = blobsContext;
48
47
  // @ts-expect-error TS(2339) FIXME: Property 'config' does not exist on type 'NetlifyF... Remove this comment to see the full error message
49
48
  this.config = config;
50
- // @ts-expect-error TS(2339) FIXME: Property 'directory' does not exist on type 'Netli... Remove this comment to see the full error message
51
49
  this.directory = directory;
52
- // @ts-expect-error TS(2339) FIXME: Property 'errorExit' does not exist on type 'Netli... Remove this comment to see the full error message
53
- this.errorExit = errorExit;
54
- // @ts-expect-error TS(2339) FIXME: Property 'mainFile' does not exist on type 'Netlif... Remove this comment to see the full error message
55
50
  this.mainFile = mainFile;
56
- // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type 'NetlifyFun... Remove this comment to see the full error message
57
51
  this.name = name;
58
- // @ts-expect-error TS(2339) FIXME: Property 'displayName' does not exist on type 'Net... Remove this comment to see the full error message
59
52
  this.displayName = displayName ?? name;
60
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Net... Remove this comment to see the full error message
61
53
  this.projectRoot = projectRoot;
62
54
  // @ts-expect-error TS(2339) FIXME: Property 'runtime' does not exist on type 'Netlify... Remove this comment to see the full error message
63
55
  this.runtime = runtime;
64
- // @ts-expect-error TS(2339) FIXME: Property 'timeoutBackground' does not exist on typ... Remove this comment to see the full error message
65
56
  this.timeoutBackground = timeoutBackground;
66
- // @ts-expect-error TS(2339) FIXME: Property 'timeoutSynchronous' does not exist on ty... Remove this comment to see the full error message
67
57
  this.timeoutSynchronous = timeoutSynchronous;
68
58
  // @ts-expect-error TS(2339) FIXME: Property 'settings' does not exist on type 'Netlif... Remove this comment to see the full error message
69
59
  this.settings = settings;
70
- // Determines whether this is a background function based on the function
71
- // name.
72
- // @ts-expect-error TS(2339) FIXME: Property 'isBackground' does not exist on type 'Ne... Remove this comment to see the full error message
73
60
  this.isBackground = name.endsWith(BACKGROUND);
74
61
  const functionConfig = config.functions && config.functions[name];
75
- // @ts-expect-error TS(2339) FIXME: Property 'schedule' does not exist on type 'Netlif... Remove this comment to see the full error message
76
62
  this.schedule = functionConfig && functionConfig.schedule;
77
- // List of the function's source files. This starts out as an empty set
78
- // and will get populated on every build.
79
- // @ts-expect-error TS(2339) FIXME: Property 'srcFiles' does not exist on type 'Netlif... Remove this comment to see the full error message
80
63
  this.srcFiles = new Set();
81
64
  }
82
65
  get filename() {
83
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
84
66
  if (!this.buildData?.mainFile) {
85
67
  return null;
86
68
  }
87
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
88
69
  return basename(this.buildData.mainFile);
89
70
  }
90
71
  getRecommendedExtension() {
91
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
92
72
  if (this.buildData?.runtimeAPIVersion !== 2) {
93
73
  return;
94
74
  }
95
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
96
75
  const extension = this.buildData?.mainFile ? extname(this.buildData.mainFile) : undefined;
97
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
98
76
  const moduleFormat = this.buildData?.outputModuleFormat;
99
77
  if (moduleFormat === 'esm') {
100
78
  return;
@@ -108,18 +86,14 @@ export default class NetlifyFunction {
108
86
  }
109
87
  hasValidName() {
110
88
  // same as https://github.com/netlify/bitballoon/blob/fbd7881e6c8e8c48e7a0145da4ee26090c794108/app/models/deploy.rb#L482
111
- // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type 'NetlifyFun... Remove this comment to see the full error message
112
89
  // eslint-disable-next-line unicorn/better-regex
113
90
  return /^[A-Za-z0-9_-]+$/.test(this.name);
114
91
  }
115
92
  async isScheduled() {
116
- // @ts-expect-error TS(2339) FIXME: Property 'buildQueue' does not exist on type 'Netl... Remove this comment to see the full error message
117
93
  await this.buildQueue;
118
- // @ts-expect-error TS(2339) FIXME: Property 'schedule' does not exist on type 'Netlif... Remove this comment to see the full error message
119
94
  return Boolean(this.schedule);
120
95
  }
121
96
  isSupported() {
122
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
123
97
  return !(this.buildData?.runtimeAPIVersion === 2 && semver.lt(nodeVersion, V2_MIN_NODE_VERSION));
124
98
  }
125
99
  isTypeScript() {
@@ -132,7 +106,7 @@ export default class NetlifyFunction {
132
106
  if (!(await this.isScheduled())) {
133
107
  return null;
134
108
  }
135
- // @ts-expect-error TS(2339) FIXME: Property 'schedule' does not exist on type 'Netlif... Remove this comment to see the full error message
109
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
136
110
  return getNextRun(this.schedule);
137
111
  }
138
112
  // The `build` method transforms source files into invocable functions. Its
@@ -146,24 +120,17 @@ export default class NetlifyFunction {
146
120
  const buildFunction = await this.runtime.getBuildFunction({
147
121
  // @ts-expect-error TS(2339) FIXME: Property 'config' does not exist on type 'NetlifyF... Remove this comment to see the full error message
148
122
  config: this.config,
149
- // @ts-expect-error TS(2339) FIXME: Property 'directory' does not exist on type 'Netli... Remove this comment to see the full error message
150
123
  directory: this.directory,
151
- // @ts-expect-error TS(2339) FIXME: Property 'errorExit' does not exist on type 'Netli... Remove this comment to see the full error message
152
- errorExit: this.errorExit,
124
+ errorExit,
153
125
  func: this,
154
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Net... Remove this comment to see the full error message
155
126
  projectRoot: this.projectRoot,
156
127
  });
157
- // @ts-expect-error TS(2339) FIXME: Property 'buildQueue' does not exist on type 'Netl... Remove this comment to see the full error message
158
128
  this.buildQueue = buildFunction({ cache });
159
129
  try {
160
- // @ts-expect-error TS(2339) FIXME: Property 'buildQueue' does not exist on type 'Netl... Remove this comment to see the full error message
161
130
  const { includedFiles = [], schedule, srcFiles, ...buildData } = await this.buildQueue;
162
131
  const srcFilesSet = new Set(srcFiles);
163
132
  const srcFilesDiff = this.getSrcFilesDiff(srcFilesSet);
164
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
165
133
  this.buildData = buildData;
166
- // @ts-expect-error TS(2339) FIXME: Property 'buildError' does not exist on type 'Netl... Remove this comment to see the full error message
167
134
  this.buildError = null;
168
135
  // @ts-expect-error TS(2339) FIXME: Property 'srcFiles' does not exist on type 'Netlif... Remove this comment to see the full error message
169
136
  this.srcFiles = srcFilesSet;
@@ -175,24 +142,18 @@ export default class NetlifyFunction {
175
142
  return { includedFiles, srcFilesDiff };
176
143
  }
177
144
  catch (error) {
178
- // @ts-expect-error TS(2339) FIXME: Property 'buildError' does not exist on type 'Netl... Remove this comment to see the full error message
179
145
  this.buildError = error;
180
146
  return { error };
181
147
  }
182
148
  }
183
149
  async getBuildData() {
184
- // @ts-expect-error TS(2339) FIXME: Property 'buildQueue' does not exist on type 'Netl... Remove this comment to see the full error message
185
150
  await this.buildQueue;
186
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
187
151
  return this.buildData;
188
152
  }
189
153
  // Compares a new set of source files against a previous one, returning an
190
154
  // object with two Sets, one with added and the other with deleted files.
191
- // @ts-expect-error TS(7006) FIXME: Parameter 'newSrcFiles' implicitly has an 'any' ty... Remove this comment to see the full error message
192
155
  getSrcFilesDiff(newSrcFiles) {
193
- // @ts-expect-error TS(2339) FIXME: Property 'srcFiles' does not exist on type 'Netlif... Remove this comment to see the full error message
194
156
  const added = difference(newSrcFiles, this.srcFiles);
195
- // @ts-expect-error TS(2339) FIXME: Property 'srcFiles' does not exist on type 'Netlif... Remove this comment to see the full error message
196
157
  const deleted = difference(this.srcFiles, newSrcFiles);
197
158
  return {
198
159
  added,
@@ -201,22 +162,16 @@ export default class NetlifyFunction {
201
162
  }
202
163
  // Invokes the function and returns its response object.
203
164
  async invoke(event = {}, context = {}) {
204
- // @ts-expect-error TS(2339) FIXME: Property 'buildQueue' does not exist on type 'Netl... Remove this comment to see the full error message
205
165
  await this.buildQueue;
206
- // @ts-expect-error TS(2339) FIXME: Property 'buildError' does not exist on type 'Netl... Remove this comment to see the full error message
207
166
  if (this.buildError) {
208
167
  // @ts-expect-error TS(2339) FIXME: Property 'buildError' does not exist on type 'Netl... Remove this comment to see the full error message
209
168
  return { result: null, error: { errorMessage: this.buildError.message } };
210
169
  }
211
- // @ts-expect-error TS(2339) FIXME: Property 'isBackground' does not exist on type 'Ne... Remove this comment to see the full error message
212
170
  const timeout = this.isBackground ? this.timeoutBackground : this.timeoutSynchronous;
213
171
  const environment = {};
214
- // @ts-expect-error TS(2339) FIXME: Property 'blobsContext' does not exist on type 'Ne... Remove this comment to see the full error message
215
172
  if (this.blobsContext) {
216
173
  const payload = JSON.stringify({
217
- // @ts-expect-error TS(2339) FIXME: Property 'blobsContext' does not exist on type 'Ne... Remove this comment to see the full error message
218
174
  url: this.blobsContext.edgeURL,
219
- // @ts-expect-error TS(2339) FIXME: Property 'blobsContext' does not exist on type 'Ne... Remove this comment to see the full error message
220
175
  token: this.blobsContext.token,
221
176
  });
222
177
  // @ts-expect-error TS(2339) FIXME: Property 'blobs' does not exist on type '{}'.
@@ -239,20 +194,15 @@ export default class NetlifyFunction {
239
194
  }
240
195
  /**
241
196
  * Matches all routes agains the incoming request. If a match is found, then the matched route is returned.
242
- * @param {string} rawPath
243
- * @param {string} method
244
197
  * @returns matched route
245
198
  */
246
- // @ts-expect-error TS(7006) FIXME: Parameter 'rawPath' implicitly has an 'any' type.
247
- async matchURLPath(rawPath, method) {
248
- // @ts-expect-error TS(2339) FIXME: Property 'buildQueue' does not exist on type 'Netl... Remove this comment to see the full error message
199
+ async matchURLPath(rawPath, method, hasStaticFile) {
249
200
  await this.buildQueue;
250
201
  let path = rawPath !== '/' && rawPath.endsWith('/') ? rawPath.slice(0, -1) : rawPath;
251
202
  path = path.toLowerCase();
252
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
253
203
  const { routes = [] } = this.buildData;
254
204
  // @ts-expect-error TS(7031) FIXME: Binding element 'expression' implicitly has an 'an... Remove this comment to see the full error message
255
- return routes.find(({ expression, literal, methods }) => {
205
+ const route = routes.find(({ expression, literal, methods }) => {
256
206
  if (methods.length !== 0 && !methods.includes(method)) {
257
207
  return false;
258
208
  }
@@ -265,9 +215,15 @@ export default class NetlifyFunction {
265
215
  }
266
216
  return false;
267
217
  });
218
+ if (!route) {
219
+ return;
220
+ }
221
+ if (route.prefer_static && (await hasStaticFile())) {
222
+ return;
223
+ }
224
+ return route;
268
225
  }
269
226
  get runtimeAPIVersion() {
270
- // @ts-expect-error TS(2339) FIXME: Property 'buildData' does not exist on type 'Netli... Remove this comment to see the full error message
271
227
  return this.buildData?.runtimeAPIVersion ?? 1;
272
228
  }
273
229
  get url() {
@@ -278,7 +234,6 @@ export default class NetlifyFunction {
278
234
  const port = this.settings.port || this.settings.functionsPort;
279
235
  // @ts-expect-error TS(2339) FIXME: Property 'settings' does not exist on type 'Netlif... Remove this comment to see the full error message
280
236
  const protocol = this.settings.https ? 'https' : 'http';
281
- // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type 'NetlifyFun... Remove this comment to see the full error message
282
237
  const url = new URL(`/.netlify/functions/${this.name}`, `${protocol}://localhost:${port}`);
283
238
  return url.href;
284
239
  }
@@ -17,9 +17,7 @@ const ZIP_EXTENSION = '.zip';
17
17
  * @typedef {"buildError" | "extracted" | "loaded" | "missing-types-package" | "reloaded" | "reloading" | "removed"} FunctionEvent
18
18
  */
19
19
  export class FunctionsRegistry {
20
- constructor({
21
- // @ts-expect-error TS(7031) FIXME: Binding element 'blobsContext' implicitly has an '... Remove this comment to see the full error message
22
- blobsContext,
20
+ constructor({ blobsContext,
23
21
  // @ts-expect-error TS(7031) FIXME: Binding element 'capabilities' implicitly has an '... Remove this comment to see the full error message
24
22
  capabilities,
25
23
  // @ts-expect-error TS(7031) FIXME: Binding element 'config' implicitly has an 'any' t... Remove this comment to see the full error message
@@ -27,33 +25,36 @@ export class FunctionsRegistry {
27
25
  // @ts-expect-error TS(7031) FIXME: Binding element 'logLambdaCompat' implicitly has a... Remove this comment to see the full error message
28
26
  logLambdaCompat,
29
27
  // @ts-expect-error TS(7031) FIXME: Binding element 'manifest' implicitly has an 'any'... Remove this comment to see the full error message
30
- manifest,
31
- // @ts-expect-error TS(7031) FIXME: Binding element 'projectRoot' implicitly has an 'a... Remove this comment to see the full error message
32
- projectRoot,
28
+ manifest, projectRoot,
33
29
  // @ts-expect-error TS(7031) FIXME: Binding element 'settings' implicitly has an 'any'... Remove this comment to see the full error message
34
30
  settings,
35
31
  // @ts-expect-error TS(7031) FIXME: Binding element 'timeouts' implicitly has an 'any'... Remove this comment to see the full error message
36
32
  timeouts, }) {
33
+ /**
34
+ * The functions held by the registry
35
+ */
36
+ this.functions = new Map();
37
+ /**
38
+ * File watchers for function files. Maps function names to objects built
39
+ * by the `watchDebounced` utility.
40
+ */
41
+ this.functionWatchers = new Map();
42
+ /**
43
+ * Keeps track of whether we've checked whether `TYPES_PACKAGE` is
44
+ * installed.
45
+ */
46
+ this.hasCheckedTypesPackage = false;
37
47
  // @ts-expect-error TS(2339) FIXME: Property 'capabilities' does not exist on type 'Fu... Remove this comment to see the full error message
38
48
  this.capabilities = capabilities;
39
49
  // @ts-expect-error TS(2339) FIXME: Property 'config' does not exist on type 'Function... Remove this comment to see the full error message
40
50
  this.config = config;
41
- // @ts-expect-error TS(2339) FIXME: Property 'debug' does not exist on type 'Functions... Remove this comment to see the full error message
42
51
  this.debug = debug;
43
- // @ts-expect-error TS(2339) FIXME: Property 'isConnected' does not exist on type 'Fun... Remove this comment to see the full error message
44
52
  this.isConnected = isConnected;
45
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Fun... Remove this comment to see the full error message
46
53
  this.projectRoot = projectRoot;
47
54
  // @ts-expect-error TS(2339) FIXME: Property 'timeouts' does not exist on type 'Functi... Remove this comment to see the full error message
48
55
  this.timeouts = timeouts;
49
56
  // @ts-expect-error TS(2339) FIXME: Property 'settings' does not exist on type 'Functi... Remove this comment to see the full error message
50
57
  this.settings = settings;
51
- /**
52
- * Context object for Netlify Blobs
53
- *
54
- * @type {import("../blobs/blobs.js").BlobsContext}
55
- */
56
- // @ts-expect-error TS(2339) FIXME: Property 'blobsContext' does not exist on type 'Fu... Remove this comment to see the full error message
57
58
  this.blobsContext = blobsContext;
58
59
  /**
59
60
  * An object to be shared among all functions in the registry. It can be
@@ -73,27 +74,6 @@ export class FunctionsRegistry {
73
74
  */
74
75
  // @ts-expect-error TS(2339) FIXME: Property 'directoryWatchers' does not exist on typ... Remove this comment to see the full error message
75
76
  this.directoryWatchers = new Map();
76
- /**
77
- * The functions held by the registry
78
- *
79
- * @type {Map<string, NetlifyFunction>}
80
- */
81
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
82
- this.functions = new Map();
83
- /**
84
- * File watchers for function files. Maps function names to objects built
85
- * by the `watchDebounced` utility.
86
- *
87
- * @type {Map<string, Awaited<ReturnType<watchDebounced>>>}
88
- */
89
- // @ts-expect-error TS(2339) FIXME: Property 'functionWatchers' does not exist on type... Remove this comment to see the full error message
90
- this.functionWatchers = new Map();
91
- /**
92
- * Keeps track of whether we've checked whether `TYPES_PACKAGE` is
93
- * installed.
94
- */
95
- // @ts-expect-error TS(2339) FIXME: Property 'hasCheckedTypesPackage' does not exist o... Remove this comment to see the full error message
96
- this.hasCheckedTypesPackage = false;
97
77
  /**
98
78
  * Whether to log V1 functions as using the "Lambda compatibility mode"
99
79
  *
@@ -111,16 +91,12 @@ export class FunctionsRegistry {
111
91
  this.manifest = manifest;
112
92
  }
113
93
  checkTypesPackage() {
114
- // @ts-expect-error TS(2339) FIXME: Property 'hasCheckedTypesPackage' does not exist o... Remove this comment to see the full error message
115
94
  if (this.hasCheckedTypesPackage) {
116
95
  return;
117
96
  }
118
- // @ts-expect-error TS(2339) FIXME: Property 'hasCheckedTypesPackage' does not exist o... Remove this comment to see the full error message
119
97
  this.hasCheckedTypesPackage = true;
120
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Fun... Remove this comment to see the full error message
121
98
  const require = createRequire(this.projectRoot);
122
99
  try {
123
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Fun... Remove this comment to see the full error message
124
100
  require.resolve(TYPES_PACKAGE, { paths: [this.projectRoot] });
125
101
  }
126
102
  catch (error) {
@@ -135,10 +111,7 @@ export class FunctionsRegistry {
135
111
  * Runs before `scan` and calls any `onDirectoryScan` hooks defined by the
136
112
  * runtime before the directory is read. This gives runtime the opportunity
137
113
  * to run additional logic when a directory is scanned.
138
- *
139
- * @param {string} directory
140
114
  */
141
- // @ts-expect-error TS(7006) FIXME: Parameter 'directory' implicitly has an 'any' type... Remove this comment to see the full error message
142
115
  static async prepareDirectoryScan(directory) {
143
116
  await mkdir(directory, { recursive: true });
144
117
  // We give runtimes the opportunity to react to a directory scan and run
@@ -156,12 +129,7 @@ export class FunctionsRegistry {
156
129
  /**
157
130
  * Builds a function and sets up the appropriate file watchers so that any
158
131
  * changes will trigger another build.
159
- *
160
- * @param {NetlifyFunction} func
161
- * @param {boolean} [firstLoad ]
162
- * @returns
163
132
  */
164
- // @ts-expect-error TS(7006) FIXME: Parameter 'func' implicitly has an 'any' type.
165
133
  async buildFunctionAndWatchFiles(func, firstLoad = false) {
166
134
  if (!firstLoad) {
167
135
  FunctionsRegistry.logEvent('reloading', { func });
@@ -196,16 +164,13 @@ export class FunctionsRegistry {
196
164
  if (!srcFilesDiff) {
197
165
  return;
198
166
  }
199
- // @ts-expect-error TS(2339) FIXME: Property 'functionWatchers' does not exist on type... Remove this comment to see the full error message
200
167
  const watcher = this.functionWatchers.get(func.name);
201
168
  // If there is already a watcher for this function, we need to unwatch any
202
169
  // files that have been removed and watch any files that have been added.
203
170
  if (watcher) {
204
- // @ts-expect-error TS(7006) FIXME: Parameter 'path' implicitly has an 'any' type.
205
171
  srcFilesDiff.deleted.forEach((path) => {
206
172
  watcher.unwatch(path);
207
173
  });
208
- // @ts-expect-error TS(7006) FIXME: Parameter 'path' implicitly has an 'any' type.
209
174
  srcFilesDiff.added.forEach((path) => {
210
175
  watcher.add(path);
211
176
  });
@@ -220,18 +185,13 @@ export class FunctionsRegistry {
220
185
  this.buildFunctionAndWatchFiles(func, false);
221
186
  },
222
187
  });
223
- // @ts-expect-error TS(2339) FIXME: Property 'functionWatchers' does not exist on type... Remove this comment to see the full error message
224
188
  this.functionWatchers.set(func.name, newWatcher);
225
189
  }
226
190
  }
227
191
  /**
228
192
  * Returns a function by name.
229
- *
230
- * @param {string} name
231
193
  */
232
- // @ts-expect-error TS(7006) FIXME: Parameter 'name' implicitly has an 'any' type.
233
194
  get(name) {
234
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
235
195
  return this.functions.get(name);
236
196
  }
237
197
  /**
@@ -240,17 +200,13 @@ export class FunctionsRegistry {
240
200
  * matches the default functions URL (i.e. can only be for a function) but no
241
201
  * function with the given name exists, returns an object with the function
242
202
  * and the route set to `null`. Otherwise, `undefined` is returned,
243
- *
244
- * @param {string} url
245
- * @param {string} method
246
203
  */
247
- // @ts-expect-error TS(7006) FIXME: Parameter 'url' implicitly has an 'any' type.
248
- async getFunctionForURLPath(url, method) {
204
+ async getFunctionForURLPath(urlPath, method, hasStaticFile) {
249
205
  // We're constructing a URL object just so that we can extract the path from
250
206
  // the incoming URL. It doesn't really matter that we don't have the actual
251
207
  // local URL with the correct port.
252
- const urlPath = new URL(url, 'http://localhost').pathname;
253
- const defaultURLMatch = urlPath.match(DEFAULT_FUNCTION_URL_EXPRESSION);
208
+ const url = new URL(`http://localhost${urlPath}`);
209
+ const defaultURLMatch = url.pathname.match(DEFAULT_FUNCTION_URL_EXPRESSION);
254
210
  if (defaultURLMatch) {
255
211
  const func = this.get(defaultURLMatch[2]);
256
212
  if (!func) {
@@ -260,14 +216,13 @@ export class FunctionsRegistry {
260
216
  if (routes.length !== 0) {
261
217
  // @ts-expect-error TS(7006) FIXME: Parameter 'route' implicitly has an 'any' type.
262
218
  const paths = routes.map((route) => chalk.underline(route.pattern)).join(', ');
263
- warn(`Function ${chalk.yellow(func.name)} cannot be invoked on ${chalk.underline(urlPath)}, because the function has the following URL paths defined: ${paths}`);
219
+ warn(`Function ${chalk.yellow(func.name)} cannot be invoked on ${chalk.underline(url.pathname)}, because the function has the following URL paths defined: ${paths}`);
264
220
  return;
265
221
  }
266
222
  return { func, route: null };
267
223
  }
268
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
269
224
  for (const func of this.functions.values()) {
270
- const route = await func.matchURLPath(urlPath, method);
225
+ const route = await func.matchURLPath(url.pathname, method, hasStaticFile);
271
226
  if (route) {
272
227
  return { func, route };
273
228
  }
@@ -352,7 +307,6 @@ export class FunctionsRegistry {
352
307
  // the new location.
353
308
  if (extname(func.mainFile) === ZIP_EXTENSION) {
354
309
  const unzippedDirectory = await this.unzipFunction(func);
355
- // @ts-expect-error TS(2339) FIXME: Property 'debug' does not exist on type 'Functions... Remove this comment to see the full error message
356
310
  if (this.debug) {
357
311
  FunctionsRegistry.logEvent('extracted', { func });
358
312
  }
@@ -360,13 +314,16 @@ export class FunctionsRegistry {
360
314
  // the build data.
361
315
  // @ts-expect-error TS(2339) FIXME: Property 'manifest' does not exist on type 'Functi... Remove this comment to see the full error message
362
316
  const manifestEntry = (this.manifest?.functions || []).find((manifestFunc) => manifestFunc.name === func.name);
363
- func.buildData = manifestEntry?.buildData || {};
317
+ func.buildData = {
318
+ ...manifestEntry?.buildData,
319
+ routes: manifestEntry.routes,
320
+ };
364
321
  // When we look at an unzipped function, we don't know whether it uses
365
- // the legacy entry file format (i.e. `[function name].js`) or the new
366
- // one (i.e. `___netlify-entry-point.js`). Let's look for the new one
322
+ // the legacy entry file format (i.e. `[function name].mjs`) or the new
323
+ // one (i.e. `___netlify-entry-point.mjs`). Let's look for the new one
367
324
  // and use it if it exists, otherwise use the old one.
368
325
  try {
369
- const v2EntryPointPath = join(unzippedDirectory, '___netlify-entry-point.js');
326
+ const v2EntryPointPath = join(unzippedDirectory, '___netlify-entry-point.mjs');
370
327
  await stat(v2EntryPointPath);
371
328
  func.mainFile = v2EntryPointPath;
372
329
  }
@@ -377,7 +334,6 @@ export class FunctionsRegistry {
377
334
  else {
378
335
  this.buildFunctionAndWatchFiles(func, !isReload);
379
336
  }
380
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
381
337
  this.functions.set(name, func);
382
338
  }
383
339
  /**
@@ -419,7 +375,6 @@ export class FunctionsRegistry {
419
375
  });
420
376
  // Before registering any functions, we look for any functions that were on
421
377
  // the previous list but are missing from the new one. We unregister them.
422
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
423
378
  const deletedFunctions = [...this.functions.values()].filter((oldFunc) => {
424
379
  const isFound = functions.some((newFunc) => newFunc.name === oldFunc.name && newFunc.mainFile === oldFunc.mainFile);
425
380
  return !isFound;
@@ -438,12 +393,10 @@ export class FunctionsRegistry {
438
393
  return;
439
394
  }
440
395
  // If this function has already been registered, we skip it.
441
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
442
396
  if (this.functions.has(name)) {
443
397
  return;
444
398
  }
445
399
  const func = new NetlifyFunction({
446
- // @ts-expect-error TS(2339) FIXME: Property 'blobsContext' does not exist on type 'Fu... Remove this comment to see the full error message
447
400
  blobsContext: this.blobsContext,
448
401
  // @ts-expect-error TS(2339) FIXME: Property 'config' does not exist on type 'Function... Remove this comment to see the full error message
449
402
  config: this.config,
@@ -452,7 +405,6 @@ export class FunctionsRegistry {
452
405
  mainFile,
453
406
  name,
454
407
  displayName,
455
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Fun... Remove this comment to see the full error message
456
408
  projectRoot: this.projectRoot,
457
409
  runtime,
458
410
  // @ts-expect-error TS(2339) FIXME: Property 'timeouts' does not exist on type 'Functi... Remove this comment to see the full error message
@@ -469,7 +421,6 @@ export class FunctionsRegistry {
469
421
  await this.registerFunction(name, func, isReload);
470
422
  return func;
471
423
  }));
472
- // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type 'NetlifyFun... Remove this comment to see the full error message
473
424
  const addedFunctionNames = new Set(addedFunctions.filter(Boolean).map((func) => func?.name));
474
425
  deletedFunctions.forEach((func) => {
475
426
  // If a function we've unregistered was also registered in this run, then
@@ -486,10 +437,7 @@ export class FunctionsRegistry {
486
437
  * Creates a watcher that looks at files being added or removed from a
487
438
  * functions directory. It doesn't care about files being changed, because
488
439
  * those will be handled by each functions' watcher.
489
- *
490
- * @param {string} directory
491
440
  */
492
- // @ts-expect-error TS(7006) FIXME: Parameter 'directory' implicitly has an 'any' type... Remove this comment to see the full error message
493
441
  async setupDirectoryWatcher(directory) {
494
442
  // @ts-expect-error TS(2339) FIXME: Property 'directoryWatchers' does not exist on typ... Remove this comment to see the full error message
495
443
  if (this.directoryWatchers.has(directory)) {
@@ -509,32 +457,21 @@ export class FunctionsRegistry {
509
457
  }
510
458
  /**
511
459
  * Removes a function from the registry and closes its file watchers.
512
- *
513
- * @param {NetlifyFunction} func
514
460
  */
515
- // @ts-expect-error TS(7006) FIXME: Parameter 'func' implicitly has an 'any' type.
516
461
  async unregisterFunction(func) {
517
462
  const { name } = func;
518
- // @ts-expect-error TS(2339) FIXME: Property 'functions' does not exist on type 'Funct... Remove this comment to see the full error message
519
463
  this.functions.delete(name);
520
- // @ts-expect-error TS(2339) FIXME: Property 'functionWatchers' does not exist on type... Remove this comment to see the full error message
521
464
  const watcher = this.functionWatchers.get(name);
522
465
  if (watcher) {
523
466
  await watcher.close();
524
467
  }
525
- // @ts-expect-error TS(2339) FIXME: Property 'functionWatchers' does not exist on type... Remove this comment to see the full error message
526
468
  this.functionWatchers.delete(name);
527
469
  }
528
470
  /**
529
471
  * Takes a zipped function and extracts its contents to an internal directory.
530
- *
531
- * @param {NetlifyFunction} func
532
472
  */
533
- // @ts-expect-error TS(7006) FIXME: Parameter 'func' implicitly has an 'any' type.
534
473
  async unzipFunction(func) {
535
- const targetDirectory = resolve(
536
- // @ts-expect-error TS(2339) FIXME: Property 'projectRoot' does not exist on type 'Fun... Remove this comment to see the full error message
537
- this.projectRoot, getPathInProject([SERVE_FUNCTIONS_FOLDER, '.unzipped', func.name]));
474
+ const targetDirectory = resolve(this.projectRoot, getPathInProject([SERVE_FUNCTIONS_FOLDER, '.unzipped', func.name]));
538
475
  await extractZip(func.mainFile, { dir: targetDirectory });
539
476
  return targetDirectory;
540
477
  }
@@ -168,7 +168,7 @@ export const createHandler = function (options) {
168
168
  else {
169
169
  const { error, result } = await func.invoke(event, clientContext);
170
170
  // check for existence of metadata if this is a builder function
171
- if (/^\/.netlify\/(builders)/.test(request.path) && (!result.metadata || !result.metadata.builder_function)) {
171
+ if (/^\/.netlify\/(builders)/.test(request.path) && !result?.metadata?.builder_function) {
172
172
  response.status(400).send({
173
173
  message: 'Function is not an on-demand builder. See https://ntl.fyi/create-builder for how to convert a function to a builder.',
174
174
  });
@@ -259,6 +259,7 @@ export const startFunctionsServer = async (options) => {
259
259
  }
260
260
  const functionsRegistry = new FunctionsRegistry({
261
261
  blobsContext,
262
+ // @ts-expect-error TS(7031) FIXME
262
263
  capabilities,
263
264
  config,
264
265
  debug,
@@ -94,7 +94,7 @@ export const initializeProxy = async function ({ config, settings, }) {
94
94
  if (!sourceImagePath.startsWith('http://') && !sourceImagePath.startsWith('https://')) {
95
95
  // Construct the full URL for relative paths to request from development server
96
96
  const sourceImagePathWithLeadingSlash = sourceImagePath.startsWith('/') ? sourceImagePath : `/${sourceImagePath}`;
97
- const fullImageUrl = `${devServerUrl}/${encodeURIComponent(sourceImagePathWithLeadingSlash)}`;
97
+ const fullImageUrl = `${devServerUrl}${encodeURIComponent(sourceImagePathWithLeadingSlash)}`;
98
98
  console.log(`fullImageUrl: ${fullImageUrl}`);
99
99
  req.url = `/${modifiers}/${fullImageUrl}`;
100
100
  }
@@ -312,8 +312,9 @@ siteInfo, }) {
312
312
  (ct.endsWith('/x-www-form-urlencoded') || ct === 'multipart/form-data')) {
313
313
  return proxy.web(req, res, { target: options.functionsServer });
314
314
  }
315
- const matchingFunction = functionsRegistry && (await functionsRegistry.getFunctionForURLPath(destURL, req.method));
316
315
  const destStaticFile = await getStatic(dest.pathname, options.publicFolder);
316
+ const matchingFunction = functionsRegistry &&
317
+ (await functionsRegistry.getFunctionForURLPath(destURL, req.method, () => Boolean(destStaticFile)));
317
318
  let statusValue;
318
319
  if (match.force ||
319
320
  (!staticFile && ((!options.framework && destStaticFile) || isInternal(destURL) || matchingFunction))) {
@@ -573,11 +574,15 @@ res) => {
573
574
  req.originalBody = ['GET', 'OPTIONS', 'HEAD'].includes(req.method)
574
575
  ? null
575
576
  : await createStreamPromise(req, BYTES_LIMIT);
577
+ if (isImageRequest(req)) {
578
+ return imageProxy(req, res);
579
+ }
576
580
  const edgeFunctionsProxyURL = await edgeFunctionsProxy(req, res);
577
581
  if (edgeFunctionsProxyURL !== undefined) {
578
582
  return proxy.web(req, res, { target: edgeFunctionsProxyURL });
579
583
  }
580
- const functionMatch = functionsRegistry && (await functionsRegistry.getFunctionForURLPath(req.url, req.method));
584
+ const functionMatch = functionsRegistry &&
585
+ (await functionsRegistry.getFunctionForURLPath(req.url, req.method, () => getStatic(decodeURIComponent(reqToURL(req, req.url).pathname), settings.dist)));
581
586
  if (functionMatch) {
582
587
  // Setting an internal header with the function name so that we don't
583
588
  // have to match the URL again in the functions server.
@@ -626,9 +631,6 @@ res) => {
626
631
  (ct.endsWith('/x-www-form-urlencoded') || ct === 'multipart/form-data')) {
627
632
  return proxy.web(req, res, { target: functionsServer });
628
633
  }
629
- if (isImageRequest(req)) {
630
- return imageProxy(req, res);
631
- }
632
634
  proxy.web(req, res, options);
633
635
  };
634
636
  /**