diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 4bdf5614314..f18097a7baf 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -13,7 +13,7 @@ "@fastify/static": "^6.6.0", "@netlify/build": "^29.6.7", "@netlify/config": "^20.3.5", - "@netlify/edge-bundler": "^8.11.1", + "@netlify/edge-bundler": "^8.12.1", "@netlify/framework-info": "^9.8.5", "@netlify/local-functions-proxy": "^1.1.1", "@netlify/zip-it-and-ship-it": "^8.9.0", @@ -2114,6 +2114,46 @@ "node": "^14.16.0 || >=16.0.0" } }, + "node_modules/@netlify/build/node_modules/@netlify/edge-bundler": { + "version": "8.11.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.11.1.tgz", + "integrity": "sha512-pj3myy714qX0OuPwtRTfBgaQ2fZwj5qkpACyeXtrsVcaHRNnE0l7cymfZ0fS0a/xkINj9fcyTEtZBahDuuLT2g==", + "dependencies": { + "@import-maps/resolve": "^1.0.1", + "ajv": "^8.11.2", + "ajv-errors": "^3.0.0", + "better-ajv-errors": "^1.2.0", + "common-path-prefix": "^3.0.0", + "del": "^7.0.0", + "env-paths": "^3.0.0", + "execa": "^6.0.0", + "find-up": "^6.3.0", + "get-port": "^6.1.2", + "glob-to-regexp": "^0.4.1", + "is-path-inside": "^4.0.0", + "jsonc-parser": "^3.2.0", + "node-fetch": "^3.1.1", + "node-stream-zip": "^1.15.0", + "p-retry": "^5.1.1", + "p-wait-for": "^4.1.0", + "path-key": "^4.0.0", + "regexp-tree": "^0.1.24", + "semver": "^7.3.5", + "tmp-promise": "^3.0.3", + "uuid": "^9.0.0" + }, + "engines": { + "node": "^14.16.0 || >=16.0.0" + } + }, + "node_modules/@netlify/build/node_modules/@netlify/edge-bundler/node_modules/uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/@netlify/build/node_modules/@sindresorhus/is": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", @@ -2136,6 +2176,29 @@ "node": ">=14.16" } }, + "node_modules/@netlify/build/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@netlify/build/node_modules/ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "peerDependencies": { + "ajv": "^8.0.1" + } + }, "node_modules/@netlify/build/node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -2161,11 +2224,43 @@ "node": ">=14.16" } }, + "node_modules/@netlify/build/node_modules/del": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-7.0.0.tgz", + "integrity": "sha512-tQbV/4u5WVB8HMJr08pgw0b6nG4RGt/tj+7Numvq+zqcvUFeMaIWWOUFltiU+6go8BSO2/ogsB4EasDaj0y68Q==", + "dependencies": { + "globby": "^13.1.2", + "graceful-fs": "^4.2.10", + "is-glob": "^4.0.3", + "is-path-cwd": "^3.0.0", + "is-path-inside": "^4.0.0", + "p-map": "^5.5.0", + "rimraf": "^3.0.2", + "slash": "^4.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/build/node_modules/emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "node_modules/@netlify/build/node_modules/env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/build/node_modules/escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -2225,6 +2320,40 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@netlify/build/node_modules/get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@netlify/build/node_modules/glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + }, + "node_modules/@netlify/build/node_modules/globby": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", + "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "dependencies": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/build/node_modules/got": { "version": "12.6.0", "resolved": "https://registry.npmjs.org/got/-/got-12.6.0.tgz", @@ -2280,6 +2409,28 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@netlify/build/node_modules/is-path-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-3.0.0.tgz", + "integrity": "sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@netlify/build/node_modules/is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/build/node_modules/is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", @@ -2291,6 +2442,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@netlify/build/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, "node_modules/@netlify/build/node_modules/lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -2324,6 +2480,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@netlify/build/node_modules/node-fetch": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, "node_modules/@netlify/build/node_modules/normalize-url": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", @@ -2424,6 +2597,20 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@netlify/build/node_modules/p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "dependencies": { + "p-timeout": "^5.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/build/node_modules/parse-ms": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", @@ -2540,6 +2727,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@netlify/build/node_modules/slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@netlify/build/node_modules/string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -3252,9 +3450,9 @@ } }, "node_modules/@netlify/edge-bundler": { - "version": "8.11.1", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.11.1.tgz", - "integrity": "sha512-pj3myy714qX0OuPwtRTfBgaQ2fZwj5qkpACyeXtrsVcaHRNnE0l7cymfZ0fS0a/xkINj9fcyTEtZBahDuuLT2g==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.12.1.tgz", + "integrity": "sha512-3L8BoWHZ9R11ID2DqMy3QkLhBrhnvGERaZ76WCt63Vtv3WcEK/91WTSxq3q9n+rMta3oKNEYVnMOOmgZBU3Zdg==", "dependencies": { "@import-maps/resolve": "^1.0.1", "ajv": "^8.11.2", @@ -3441,9 +3639,9 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node_modules/@netlify/edge-bundler/node_modules/node-fetch": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz", - "integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", @@ -25820,6 +26018,42 @@ "yargs": "^17.6.0" }, "dependencies": { + "@netlify/edge-bundler": { + "version": "8.11.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.11.1.tgz", + "integrity": "sha512-pj3myy714qX0OuPwtRTfBgaQ2fZwj5qkpACyeXtrsVcaHRNnE0l7cymfZ0fS0a/xkINj9fcyTEtZBahDuuLT2g==", + "requires": { + "@import-maps/resolve": "^1.0.1", + "ajv": "^8.11.2", + "ajv-errors": "^3.0.0", + "better-ajv-errors": "^1.2.0", + "common-path-prefix": "^3.0.0", + "del": "^7.0.0", + "env-paths": "^3.0.0", + "execa": "^6.0.0", + "find-up": "^6.3.0", + "get-port": "^6.1.2", + "glob-to-regexp": "^0.4.1", + "is-path-inside": "^4.0.0", + "jsonc-parser": "^3.2.0", + "node-fetch": "^3.1.1", + "node-stream-zip": "^1.15.0", + "p-retry": "^5.1.1", + "p-wait-for": "^4.1.0", + "path-key": "^4.0.0", + "regexp-tree": "^0.1.24", + "semver": "^7.3.5", + "tmp-promise": "^3.0.3", + "uuid": "^9.0.0" + }, + "dependencies": { + "uuid": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.0.tgz", + "integrity": "sha512-MXcSTerfPa4uqyzStbRoTgt5XIe3x5+42+q1sDuy3R5MDk66URdLMOZe5aPX/SQd+kuYAh0FdP/pO28IkQyTeg==" + } + } + }, "@sindresorhus/is": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-5.3.0.tgz", @@ -25833,6 +26067,23 @@ "defer-to-connect": "^2.0.1" } }, + "ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-3.0.0.tgz", + "integrity": "sha512-V3wD15YHfHz6y0KdhYFjyy9vWtEVALT9UrxfN3zqlI6dMioHnJrqOYfyPKol3oqrnCM9uwkcdCwkJ0WUcbLMTQ==", + "requires": {} + }, "cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -25852,11 +26103,31 @@ "responselike": "^3.0.0" } }, + "del": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/del/-/del-7.0.0.tgz", + "integrity": "sha512-tQbV/4u5WVB8HMJr08pgw0b6nG4RGt/tj+7Numvq+zqcvUFeMaIWWOUFltiU+6go8BSO2/ogsB4EasDaj0y68Q==", + "requires": { + "globby": "^13.1.2", + "graceful-fs": "^4.2.10", + "is-glob": "^4.0.3", + "is-path-cwd": "^3.0.0", + "is-path-inside": "^4.0.0", + "p-map": "^5.5.0", + "rimraf": "^3.0.2", + "slash": "^4.0.0" + } + }, "emoji-regex": { "version": "9.2.2", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" }, + "env-paths": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", + "integrity": "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A==" + }, "escape-string-regexp": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", @@ -25892,6 +26163,28 @@ "resolved": "https://registry.npmjs.org/filter-obj/-/filter-obj-3.0.0.tgz", "integrity": "sha512-oQZM+QmVni8MsYzcq9lgTHD/qeLqaG8XaOPOW7dzuSafVxSUlH1+1ZDefj2OD9f2XsmG5lFl2Euc9NI4jgwFWg==" }, + "get-port": { + "version": "6.1.2", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-6.1.2.tgz", + "integrity": "sha512-BrGGraKm2uPqurfGVj/z97/zv8dPleC6x9JBNRTrDNtCkkRF4rPwrQXFgL7+I+q8QSdU4ntLQX2D7KIxSy8nGw==" + }, + "glob-to-regexp": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz", + "integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw==" + }, + "globby": { + "version": "13.1.3", + "resolved": "https://registry.npmjs.org/globby/-/globby-13.1.3.tgz", + "integrity": "sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw==", + "requires": { + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.11", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^4.0.0" + } + }, "got": { "version": "12.6.0", "resolved": "https://registry.npmjs.org/got/-/got-12.6.0.tgz", @@ -25929,11 +26222,26 @@ "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-5.0.0.tgz", "integrity": "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg==" }, + "is-path-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-3.0.0.tgz", + "integrity": "sha512-kyiNFFLU0Ampr6SDZitD/DwUo4Zs1nSdnygUBqsu3LooL00Qvb5j+UnvApUn/TTj1J3OuE6BTdQ5rudKmU2ZaA==" + }, + "is-path-inside": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-4.0.0.tgz", + "integrity": "sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==" + }, "is-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==" }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, "lowercase-keys": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-3.0.0.tgz", @@ -25949,6 +26257,16 @@ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-4.0.0.tgz", "integrity": "sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg==" }, + "node-fetch": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", + "requires": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + } + }, "normalize-url": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-8.0.0.tgz", @@ -26004,6 +26322,14 @@ "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-5.1.0.tgz", "integrity": "sha512-auFDyzzzGZZZdHz3BtET9VEz0SE/uMEAx7uWfGPucfzEwwe/xH0iVeZibQmANYE/hp9T2+UUZT5m+BKyrDp3Ew==" }, + "p-wait-for": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-wait-for/-/p-wait-for-4.1.0.tgz", + "integrity": "sha512-i8nE5q++9h8oaQHWltS1Tnnv4IoMDOlqN7C0KFG2OdbK0iFJIt6CROZ8wfBM+K4Pxqfnq4C4lkkpXqTEpB5DZw==", + "requires": { + "p-timeout": "^5.0.0" + } + }, "parse-ms": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-3.0.0.tgz", @@ -26069,6 +26395,11 @@ "lowercase-keys": "^3.0.0" } }, + "slash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-4.0.0.tgz", + "integrity": "sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==" + }, "string-width": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", @@ -26558,9 +26889,9 @@ } }, "@netlify/edge-bundler": { - "version": "8.11.1", - "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.11.1.tgz", - "integrity": "sha512-pj3myy714qX0OuPwtRTfBgaQ2fZwj5qkpACyeXtrsVcaHRNnE0l7cymfZ0fS0a/xkINj9fcyTEtZBahDuuLT2g==", + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/@netlify/edge-bundler/-/edge-bundler-8.12.1.tgz", + "integrity": "sha512-3L8BoWHZ9R11ID2DqMy3QkLhBrhnvGERaZ76WCt63Vtv3WcEK/91WTSxq3q9n+rMta3oKNEYVnMOOmgZBU3Zdg==", "requires": { "@import-maps/resolve": "^1.0.1", "ajv": "^8.11.2", @@ -26687,9 +27018,9 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, "node-fetch": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.0.tgz", - "integrity": "sha512-BKwRP/O0UvoMKp7GNdwPlObhYGB5DQqwhEDQlNKuoqwVYSxkSZCSbHjnFFmUEtwSKRPU4kNK8PbDYYitwaE3QA==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.1.tgz", + "integrity": "sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==", "requires": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", diff --git a/package.json b/package.json index 27e77eef5d4..3c9780f47a5 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "@fastify/static": "^6.6.0", "@netlify/build": "^29.6.7", "@netlify/config": "^20.3.5", - "@netlify/edge-bundler": "^8.11.1", + "@netlify/edge-bundler": "^8.12.1", "@netlify/framework-info": "^9.8.5", "@netlify/local-functions-proxy": "^1.1.1", "@netlify/zip-it-and-ship-it": "^8.9.0", diff --git a/src/lib/edge-functions/bootstrap.mjs b/src/lib/edge-functions/bootstrap.mjs new file mode 100644 index 00000000000..f416ae2d303 --- /dev/null +++ b/src/lib/edge-functions/bootstrap.mjs @@ -0,0 +1,5 @@ +import { env } from 'process' + +const latestBootstrapURL = 'https://640b5b066a2b9b0008e88cb0--edge.netlify.com/bootstrap/index-combined.ts' + +export const getBootstrapURL = () => env.NETLIFY_EDGE_BOOTSTRAP || latestBootstrapURL diff --git a/src/lib/edge-functions/proxy.mjs b/src/lib/edge-functions/proxy.mjs index f1d4cdea63f..4bd7f948213 100644 --- a/src/lib/edge-functions/proxy.mjs +++ b/src/lib/edge-functions/proxy.mjs @@ -10,6 +10,7 @@ import { getGeoLocation } from '../geo-location.mjs' import { getPathInProject } from '../settings.mjs' import { startSpinner, stopSpinner } from '../spinner.mjs' +import { getBootstrapURL } from './bootstrap.mjs' import { DIST_IMPORT_MAP_PATH } from './consts.mjs' import headers from './headers.mjs' import { getInternalFunctions } from './internal.mjs' @@ -108,7 +109,7 @@ export const initializeProxy = async ({ await registry.initialize() const url = new URL(req.url, `http://${LOCAL_HOST}:${mainPort}`) - const { functionNames, orphanedDeclarations } = await registry.matchURLPath(url.pathname) + const { functionNames, orphanedDeclarations } = registry.matchURLPath(url.pathname) // If the request matches a config declaration for an Edge Function without // a matching function file, we warn the user. @@ -165,6 +166,7 @@ const prepareServer = async ({ const distImportMapPath = getPathInProject([DIST_IMPORT_MAP_PATH]) const runIsolate = await bundler.serve({ ...getDownloadUpdateFunctions(), + bootstrapURL: getBootstrapURL(), debug: env.NETLIFY_DENO_DEBUG === 'true', distImportMapPath, formatExportTypeError: (name) => diff --git a/src/lib/edge-functions/registry.mjs b/src/lib/edge-functions/registry.mjs index 49a9a7773b1..41557df8918 100644 --- a/src/lib/edge-functions/registry.mjs +++ b/src/lib/edge-functions/registry.mjs @@ -3,40 +3,9 @@ import { fileURLToPath } from 'url' import { NETLIFYDEVERR, NETLIFYDEVLOG, chalk, log, warn, watchDebounced } from '../../utils/command-helpers.mjs' -// TODO: Import from `@netlify/edge-bundler` once it exports this type. -/** - * @typedef InSourceDeclaration - * @type {object} - * @property {string} [cache] - * @property {string} function - * @property {string | string[]} [path] - * @property {string | string[]} [excludedPath] - */ - -/** - * @typedef EdgeFunction - * @type {object} - * @property {string} name - * @property {string} path - */ - -/** - * @typedef EdgeFunctionDeclarationWithPath - * @type {object} - * @property {string} function - * @property {string} path - * @property {string=} name - */ - -/** - * @typedef EdgeFunctionDeclarationWithPattern - * @type {object} - * @property {string} function - * @property {string} pattern - * @property {string=} name - */ - -/** @typedef {(EdgeFunctionDeclarationWithPath | EdgeFunctionDeclarationWithPattern)} EdgeFunctionDeclaration */ +/** @typedef {import('@netlify/edge-bundler').Declaration} Declaration */ +/** @typedef {import('@netlify/edge-bundler').EdgeFunction} EdgeFunction */ +/** @typedef {import('@netlify/edge-bundler').FunctionConfig} FunctionConfig */ /** @typedef {Awaited>} RunIsolate */ export class EdgeFunctionsRegistry { @@ -48,7 +17,7 @@ export class EdgeFunctionsRegistry { * @param {string[]} opts.directories * @param {Record} opts.env * @param {() => Promise} opts.getUpdatedConfig - * @param {EdgeFunction[]} opts.internalFunctions + * @param {Declaration[]} opts.internalFunctions * @param {string} opts.projectDir * @param {RunIsolate} opts.runIsolate */ @@ -80,11 +49,6 @@ export class EdgeFunctionsRegistry { */ this.getUpdatedConfig = getUpdatedConfig - /** - * @type {EdgeFunction[]} - */ - this.internalFunctions = internalFunctions - /** * @type {RunIsolate} */ @@ -96,14 +60,19 @@ export class EdgeFunctionsRegistry { this.buildError = null /** - * @type {EdgeFunctionDeclaration[]} + * @type {Declaration[]} */ - this.declarationsFromConfig = this.getDeclarationsFromConfig(config) + this.declarationsFromDeployConfig = internalFunctions /** - * @type {InSourceDeclaration[]} + * @type {Record} */ - this.declarationsFromSource = [] + this.declarationsFromSource = {} + + /** + * @type {Declaration[]} + */ + this.declarationsFromTOML = EdgeFunctionsRegistry.getDeclarationsFromTOML(config) /** * @type {Record} @@ -152,7 +121,10 @@ export class EdgeFunctionsRegistry { } this.buildError = null - this.declarationsFromSource = functions.map((func, index) => ({ function: func.name, ...functionsConfig[index] })) + this.declarationsFromSource = functions.reduce( + (acc, func, index) => ({ ...acc, [func.name]: functionsConfig[index] }), + {}, + ) this.processGraph(graph) } catch (error) { @@ -169,14 +141,7 @@ export class EdgeFunctionsRegistry { (existingFunc) => func.name === existingFunc.name && func.path === existingFunc.path, ) - if (functionExists) { - return - } - - const hasDeclaration = this.declarationsFromConfig.some((declaration) => declaration.function === func.name) - - // We only load the function if there's a config declaration for it. - return hasDeclaration + return !functionExists }) const deletedFunctions = this.functions.filter((existingFunc) => { const functionExists = functionsFound.some( @@ -207,14 +172,10 @@ export class EdgeFunctionsRegistry { } } - getDeclarationsFromConfig(config) { - const { edge_functions: userFunctions = [] } = config - - // The order is important, since we want to run user-defined functions - // before internal functions. - const declarations = [...userFunctions, ...this.internalFunctions] + static getDeclarationsFromTOML(config) { + const { edge_functions: edgeFunctions = [] } = config - return declarations + return edgeFunctions } static getEnvironmentVariables(envConfig) { @@ -296,10 +257,15 @@ export class EdgeFunctionsRegistry { /** * @param {string} urlPath */ - async matchURLPath(urlPath) { - const declarations = this.mergeDeclarations() + matchURLPath(urlPath) { + const declarations = this.bundler.mergeDeclarations( + this.declarationsFromTOML, + this.declarationsFromSource, + this.declarationsFromDeployConfig, + ) const manifest = this.bundler.generateManifest({ declarations, + functionConfig: this.declarationsFromSource, functions: this.functions, }) const routes = [...manifest.routes, ...manifest.post_cache_routes].map((route) => ({ @@ -315,7 +281,7 @@ export class EdgeFunctionsRegistry { return !isExcluded }) .map((route) => route.function) - const orphanedDeclarations = await this.matchURLPathAgainstOrphanedDeclarations(urlPath) + const orphanedDeclarations = this.matchURLPathAgainstOrphanedDeclarations(urlPath) return { functionNames, orphanedDeclarations } } @@ -326,9 +292,10 @@ export class EdgeFunctionsRegistry { // a config declaration exists without a matching function file. To do that // we compute a list of functions from the declarations (the `path` doesn't // really matter). - const functions = this.declarationsFromConfig.map((declaration) => ({ name: declaration.function, path: '' })) + const functions = this.declarationsFromTOML.map((declaration) => ({ name: declaration.function, path: '' })) const manifest = this.bundler.generateManifest({ - declarations: this.declarationsFromConfig, + declarations: this.declarationsFromTOML, + functionConfig: this.declarationsFromSource, functions, }) @@ -352,46 +319,6 @@ export class EdgeFunctionsRegistry { return functionNames } - // Merges declarations coming from the config and from the function sources. - mergeDeclarations() { - const declarations = [...this.declarationsFromConfig] - - this.declarationsFromSource.forEach((declarationFromSource) => { - const { path: pathOrPaths, ...configProps } = declarationFromSource - - // Find any declarations in the config for the function. - const indexes = declarations - .filter(({ function: func }) => func === declarationFromSource.function) - .map((_, index) => index) - - // If the in-source declaration doesn't have a path, add its properties - // to any existing declarations for the function. - if (pathOrPaths === undefined) { - indexes.forEach((index) => { - declarations[index] = { ...declarations[index], ...configProps } - }) - } else { - // The in-source declaration has a path, and those take precedence. - // Discard any config declarations first. - indexes.forEach((index) => { - declarations.splice(index, 1) - }) - - // The path may be an array or a string, so let's normalize that first. - const paths = Array.isArray(pathOrPaths) ? pathOrPaths : [pathOrPaths] - - // Create a new declaration for each path. - paths.forEach((path) => { - declarations.push({ ...configProps, path }) - }) - } - }) - - const filteredDeclarations = declarations.filter((declaration) => 'path' in declaration || 'pattern' in declaration) - - return filteredDeclarations - } - processGraph(graph) { if (!graph) { warn('Could not process edge functions dependency graph. Live reload will not be available.') @@ -462,7 +389,7 @@ export class EdgeFunctionsRegistry { onChange: async () => { const newConfig = await this.getUpdatedConfig() - this.declarationsFromConfig = this.getDeclarationsFromConfig(newConfig) + this.declarationsFromTOML = EdgeFunctionsRegistry.getDeclarationsFromTOML(newConfig) await this.checkForAddedOrDeletedFunctions() }, @@ -486,6 +413,8 @@ export class EdgeFunctionsRegistry { } findDisplayName(func) { - return this.declarationsFromConfig?.find((declaration) => declaration.function === func)?.name + const declarations = [...this.declarationsFromTOML, ...this.declarationsFromDeployConfig] + + return declarations.find((declaration) => declaration.function === func)?.name } }