From 340cfc064367f72434e33e3af5855f7966d6f206 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Wed, 30 Apr 2025 17:27:03 -0400 Subject: [PATCH 01/10] ci: build with deno v2 --- .github/workflows/deno-test.yml | 4 ++-- .github/workflows/pre-release.yml | 2 +- .github/workflows/release-please.yml | 2 +- .github/workflows/run-tests.yml | 6 +++--- .github/workflows/size-check.yml | 2 +- .github/workflows/test-e2e.yml | 2 +- deno.json | 2 +- edge-runtime/lib/middleware.ts | 4 ++-- edge-runtime/lib/response.ts | 2 +- tools/build-helpers.js | 3 +-- 10 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deno-test.yml b/.github/workflows/deno-test.yml index 803abf8e3a..24a76be0e5 100644 --- a/.github/workflows/deno-test.yml +++ b/.github/workflows/deno-test.yml @@ -11,8 +11,8 @@ jobs: - name: Setup Deno uses: denoland/setup-deno@v1 with: - deno-version: v1.x.x + deno-version: v2.x.x - name: Vendor Deno modules - run: deno vendor edge-runtime/vendor.ts --output=edge-runtime/vendor --force + run: deno --allow-import edge-runtime/vendor.ts - name: Test run: deno test -A edge-runtime/ diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index c523c269c4..e7a20467a6 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -24,7 +24,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v1.46.3 + deno-version: v2.3.1 - name: Extract tag and version id: extract run: |- diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 16f08ab457..4e88dcc883 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -32,7 +32,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v1.46.3 + deno-version: v2.3.1 - name: Build run: npm run build if: ${{ steps.release.outputs.release_created }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 96bce88839..d5bf8525e7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -68,7 +68,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v1.46.3 + deno-version: v2.3.1 - name: 'Install dependencies' run: npm ci - name: 'Prepare Netlify CLI' @@ -151,7 +151,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/edge-bundler/blob/e55f825bd985d3c92e21d1b765d71e70d5628fba/node/bridge.ts#L17 - deno-version: v1.46.3 + deno-version: v2.3.1 - name: 'Install dependencies' run: npm ci - name: 'Build' @@ -218,7 +218,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v1.46.3 + deno-version: v2.3.1 - name: 'Install dependencies' run: npm ci - name: 'Build' diff --git a/.github/workflows/size-check.yml b/.github/workflows/size-check.yml index 7a61c3308c..52b887fa62 100644 --- a/.github/workflows/size-check.yml +++ b/.github/workflows/size-check.yml @@ -24,7 +24,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v1.46.3 + deno-version: v2.3.1 - run: npm ci - name: Package size report diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 1e9d847535..1cb1006440 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -165,7 +165,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v1.46.3 + deno-version: v2.3.1 - name: install runtime run: npm install --ignore-scripts diff --git a/deno.json b/deno.json index 561c910ed5..fa5e81d84c 100644 --- a/deno.json +++ b/deno.json @@ -7,5 +7,5 @@ "imports": { "@netlify/edge-functions": "https://edge.netlify.com/v1/index.ts" }, - "importMap": "./edge-runtime/vendor/import_map.json" + "vendor": true } diff --git a/edge-runtime/lib/middleware.ts b/edge-runtime/lib/middleware.ts index f2ed78e861..cca1ae82b9 100644 --- a/edge-runtime/lib/middleware.ts +++ b/edge-runtime/lib/middleware.ts @@ -1,7 +1,7 @@ import type { Context } from '@netlify/edge-functions' -import type { ElementHandlers } from '../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' -import { getCookies } from '../vendor/deno.land/std@0.175.0/http/cookie.ts' +import type { ElementHandlers } from '../../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' +import { getCookies } from '../../vendor/deno.land/std@0.175.0/http/cookie.ts' type NextDataTransform = (data: T) => T diff --git a/edge-runtime/lib/response.ts b/edge-runtime/lib/response.ts index 31bb7ead7b..fc600b796a 100644 --- a/edge-runtime/lib/response.ts +++ b/edge-runtime/lib/response.ts @@ -2,7 +2,7 @@ import type { Context } from '@netlify/edge-functions' import { HTMLRewriter, type TextChunk, -} from '../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' +} from '../../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' import { updateModifiedHeaders } from './headers.ts' import type { StructuredLogger } from './logging.ts' diff --git a/tools/build-helpers.js b/tools/build-helpers.js index 0d2feb0f06..e614544a7a 100644 --- a/tools/build-helpers.js +++ b/tools/build-helpers.js @@ -38,8 +38,7 @@ export async function vendorDeno({ } console.log(`๐Ÿ“ฆ Vendoring Deno modules for '${vendorSource}' into '${vendorDest}'...`) - // --output=${vendorDest} - await execaCommand(`deno vendor ${vendorSource} --force`, { + await execaCommand(`deno --allow-import ${vendorSource}`, { cwd, }) From ca966a261c081606d00e863297c6f0b69f1aa658 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 10:20:29 -0400 Subject: [PATCH 02/10] chore: fix typo in comment --- tools/build-helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build-helpers.js b/tools/build-helpers.js index e614544a7a..3a582e3af6 100644 --- a/tools/build-helpers.js +++ b/tools/build-helpers.js @@ -49,7 +49,7 @@ export async function vendorDeno({ // see https://github.com/denoland/deno/issues/14123 // to workaround this we copy the wasm files manually // (note Deno 2 allows to vendor wasm files, but it also require modules to import them and not fetch and instantiate them - // se being able to drop downloading is dependent on implementation of wasm handling in external modules as well) + // so being able to drop downloading is dependent on implementation of wasm handling in external modules as well) await Promise.all( wasmFilesToDownload.map(async (urlString) => { const url = new URL(urlString) From b1c51944881c8ad33a3a6417c0f733a1bce16f1a Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 10:20:54 -0400 Subject: [PATCH 03/10] fix: update deno paths to use remote urls --- edge-runtime/lib/logging.ts | 2 +- edge-runtime/lib/middleware.ts | 4 ++-- edge-runtime/lib/response.ts | 5 +---- edge-runtime/lib/routing.ts | 6 +++--- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/edge-runtime/lib/logging.ts b/edge-runtime/lib/logging.ts index b2b60f2a12..62d24bf892 100644 --- a/edge-runtime/lib/logging.ts +++ b/edge-runtime/lib/logging.ts @@ -2,4 +2,4 @@ export { logger, LogLevel, StructuredLogger, -} from '../vendor/v1-7-0--edge-utils.netlify.app/logger/mod.ts' +} from 'https://v1-7-0--edge-utils.netlify.app/logger/mod.ts' diff --git a/edge-runtime/lib/middleware.ts b/edge-runtime/lib/middleware.ts index cca1ae82b9..910aa90bfc 100644 --- a/edge-runtime/lib/middleware.ts +++ b/edge-runtime/lib/middleware.ts @@ -1,7 +1,7 @@ import type { Context } from '@netlify/edge-functions' -import type { ElementHandlers } from '../../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' -import { getCookies } from '../../vendor/deno.land/std@0.175.0/http/cookie.ts' +import type { ElementHandlers } from 'https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts' +import { getCookies } from 'https://deno.land/x/std@0.175.0/http/cookie.ts' type NextDataTransform = (data: T) => T diff --git a/edge-runtime/lib/response.ts b/edge-runtime/lib/response.ts index fc600b796a..54546367dc 100644 --- a/edge-runtime/lib/response.ts +++ b/edge-runtime/lib/response.ts @@ -1,8 +1,5 @@ import type { Context } from '@netlify/edge-functions' -import { - HTMLRewriter, - type TextChunk, -} from '../../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' +import { HTMLRewriter, type TextChunk } from 'https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts' import { updateModifiedHeaders } from './headers.ts' import type { StructuredLogger } from './logging.ts' diff --git a/edge-runtime/lib/routing.ts b/edge-runtime/lib/routing.ts index e9fbaf137c..804b6c5315 100644 --- a/edge-runtime/lib/routing.ts +++ b/edge-runtime/lib/routing.ts @@ -5,10 +5,10 @@ * Some types have been re-implemented to be more compatible with Deno or avoid chains of dependent files */ -import type { Key } from '../vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts' +import type { Key } from 'https://deno.land/x/path_to_regexp@v6.2.1/index.ts' -import { compile, pathToRegexp } from '../vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts' -import { getCookies } from '../vendor/deno.land/std@0.175.0/http/cookie.ts' +import { compile, pathToRegexp } from 'https://deno.land/x/path_to_regexp@v6.2.1/index.ts' +import { getCookies } from 'https://deno.land/std@0.175.0/http/cookie.ts' /* โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” From 6e05f7cd5019c49a1f31f19bd2efef55b2983120 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 10:26:31 -0400 Subject: [PATCH 04/10] test: ensure vendor runs before edge function tests --- tools/build-helpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build-helpers.js b/tools/build-helpers.js index 3a582e3af6..29ec16bd6f 100644 --- a/tools/build-helpers.js +++ b/tools/build-helpers.js @@ -34,7 +34,7 @@ export async function vendorDeno({ if (initEmptyDenoJson) { const denoJsonPath = join(cwd, 'deno.json') console.log(`๐Ÿงน Generating clean '${denoJsonPath}`) - await writeFile(denoJsonPath, '{}') + await writeFile(denoJsonPath, '{ "vendor": true }') } console.log(`๐Ÿ“ฆ Vendoring Deno modules for '${vendorSource}' into '${vendorDest}'...`) From ae4a6479aa4cf6c6b38f6a9a7cb34839176029ed Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 10:28:19 -0400 Subject: [PATCH 05/10] fix: move deno.json to edge-runtime directory --- deno.json => edge-runtime/deno.json | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename deno.json => edge-runtime/deno.json (100%) diff --git a/deno.json b/edge-runtime/deno.json similarity index 100% rename from deno.json rename to edge-runtime/deno.json From 1b84e7454b9cfbcc9f138024e942eca393c583e6 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 10:43:54 -0400 Subject: [PATCH 06/10] ci: standardize the deno version across workflows --- .github/workflows/deno-test.yml | 5 ++++- .github/workflows/pre-release.yml | 2 +- .github/workflows/release-please.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/size-check.yml | 7 +++++-- .github/workflows/test-e2e.yml | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deno-test.yml b/.github/workflows/deno-test.yml index 24a76be0e5..a1973418e7 100644 --- a/.github/workflows/deno-test.yml +++ b/.github/workflows/deno-test.yml @@ -8,11 +8,14 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Setup Deno uses: denoland/setup-deno@v1 with: - deno-version: v2.x.x + deno-version: v2.2.4 + - name: Vendor Deno modules run: deno --allow-import edge-runtime/vendor.ts + - name: Test run: deno test -A edge-runtime/ diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index e7a20467a6..aa70fbf540 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -24,7 +24,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v2.3.1 + deno-version: v2.2.4 - name: Extract tag and version id: extract run: |- diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 4e88dcc883..403968e214 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -32,7 +32,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v2.3.1 + deno-version: v2.2.4 - name: Build run: npm run build if: ${{ steps.release.outputs.release_created }} diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d5bf8525e7..d5e4732bbf 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -151,7 +151,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/edge-bundler/blob/e55f825bd985d3c92e21d1b765d71e70d5628fba/node/bridge.ts#L17 - deno-version: v2.3.1 + deno-version: v2.2.4 - name: 'Install dependencies' run: npm ci - name: 'Build' diff --git a/.github/workflows/size-check.yml b/.github/workflows/size-check.yml index 52b887fa62..480775fe8c 100644 --- a/.github/workflows/size-check.yml +++ b/.github/workflows/size-check.yml @@ -20,12 +20,15 @@ jobs: node-version: '18.x' cache: 'npm' cache-dependency-path: '**/package-lock.json' + - name: Install Deno uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v2.3.1 - - run: npm ci + deno-version: v2.2.4 + + - name: 'Install dependencies' + run: npm ci - name: Package size report uses: pkg-size/action@v1 diff --git a/.github/workflows/test-e2e.yml b/.github/workflows/test-e2e.yml index 1cb1006440..7375ee69c6 100644 --- a/.github/workflows/test-e2e.yml +++ b/.github/workflows/test-e2e.yml @@ -165,7 +165,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v2.3.1 + deno-version: v2.2.4 - name: install runtime run: npm install --ignore-scripts From dbd8ea9a757d557a25456545ecec93a181c61a42 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 10:45:26 -0400 Subject: [PATCH 07/10] ci: build dependencies before running deno tests --- .github/workflows/deno-test.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/deno-test.yml b/.github/workflows/deno-test.yml index a1973418e7..8c623369ae 100644 --- a/.github/workflows/deno-test.yml +++ b/.github/workflows/deno-test.yml @@ -9,11 +9,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: 'Install Node' + uses: actions/setup-node@v4 + with: + node-version: '18.x' + cache: 'npm' + cache-dependency-path: '**/package-lock.json' + - name: Setup Deno uses: denoland/setup-deno@v1 with: deno-version: v2.2.4 + - name: 'Install dependencies' + run: npm ci + - name: Vendor Deno modules run: deno --allow-import edge-runtime/vendor.ts From 42b9dc77869ef00e22f69b106cba27e891eba27e Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 11:52:23 -0400 Subject: [PATCH 08/10] fix: use --vendor instead of vendor config to ensure vendor runs at next runtime publish time (instead of site deploy time) --- .github/workflows/deno-test.yml | 2 +- edge-runtime/deno.json | 3 +-- edge-runtime/lib/logging.ts | 2 +- edge-runtime/lib/middleware.ts | 4 ++-- edge-runtime/lib/response.ts | 5 ++++- edge-runtime/lib/routing.ts | 6 +++--- tools/build-helpers.js | 4 ++-- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/deno-test.yml b/.github/workflows/deno-test.yml index 8c623369ae..e3fa92b6ec 100644 --- a/.github/workflows/deno-test.yml +++ b/.github/workflows/deno-test.yml @@ -25,7 +25,7 @@ jobs: run: npm ci - name: Vendor Deno modules - run: deno --allow-import edge-runtime/vendor.ts + run: deno --allow-import --vendor edge-runtime/vendor.ts - name: Test run: deno test -A edge-runtime/ diff --git a/edge-runtime/deno.json b/edge-runtime/deno.json index fa5e81d84c..28e8ea6c3c 100644 --- a/edge-runtime/deno.json +++ b/edge-runtime/deno.json @@ -6,6 +6,5 @@ }, "imports": { "@netlify/edge-functions": "https://edge.netlify.com/v1/index.ts" - }, - "vendor": true + } } diff --git a/edge-runtime/lib/logging.ts b/edge-runtime/lib/logging.ts index 62d24bf892..b2b60f2a12 100644 --- a/edge-runtime/lib/logging.ts +++ b/edge-runtime/lib/logging.ts @@ -2,4 +2,4 @@ export { logger, LogLevel, StructuredLogger, -} from 'https://v1-7-0--edge-utils.netlify.app/logger/mod.ts' +} from '../vendor/v1-7-0--edge-utils.netlify.app/logger/mod.ts' diff --git a/edge-runtime/lib/middleware.ts b/edge-runtime/lib/middleware.ts index 910aa90bfc..f2ed78e861 100644 --- a/edge-runtime/lib/middleware.ts +++ b/edge-runtime/lib/middleware.ts @@ -1,7 +1,7 @@ import type { Context } from '@netlify/edge-functions' -import type { ElementHandlers } from 'https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts' -import { getCookies } from 'https://deno.land/x/std@0.175.0/http/cookie.ts' +import type { ElementHandlers } from '../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' +import { getCookies } from '../vendor/deno.land/std@0.175.0/http/cookie.ts' type NextDataTransform = (data: T) => T diff --git a/edge-runtime/lib/response.ts b/edge-runtime/lib/response.ts index 54546367dc..31bb7ead7b 100644 --- a/edge-runtime/lib/response.ts +++ b/edge-runtime/lib/response.ts @@ -1,5 +1,8 @@ import type { Context } from '@netlify/edge-functions' -import { HTMLRewriter, type TextChunk } from 'https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts' +import { + HTMLRewriter, + type TextChunk, +} from '../vendor/deno.land/x/htmlrewriter@v1.0.0/src/index.ts' import { updateModifiedHeaders } from './headers.ts' import type { StructuredLogger } from './logging.ts' diff --git a/edge-runtime/lib/routing.ts b/edge-runtime/lib/routing.ts index 804b6c5315..e9fbaf137c 100644 --- a/edge-runtime/lib/routing.ts +++ b/edge-runtime/lib/routing.ts @@ -5,10 +5,10 @@ * Some types have been re-implemented to be more compatible with Deno or avoid chains of dependent files */ -import type { Key } from 'https://deno.land/x/path_to_regexp@v6.2.1/index.ts' +import type { Key } from '../vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts' -import { compile, pathToRegexp } from 'https://deno.land/x/path_to_regexp@v6.2.1/index.ts' -import { getCookies } from 'https://deno.land/std@0.175.0/http/cookie.ts' +import { compile, pathToRegexp } from '../vendor/deno.land/x/path_to_regexp@v6.2.1/index.ts' +import { getCookies } from '../vendor/deno.land/std@0.175.0/http/cookie.ts' /* โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” diff --git a/tools/build-helpers.js b/tools/build-helpers.js index 29ec16bd6f..f1563b353e 100644 --- a/tools/build-helpers.js +++ b/tools/build-helpers.js @@ -34,11 +34,11 @@ export async function vendorDeno({ if (initEmptyDenoJson) { const denoJsonPath = join(cwd, 'deno.json') console.log(`๐Ÿงน Generating clean '${denoJsonPath}`) - await writeFile(denoJsonPath, '{ "vendor": true }') + await writeFile(denoJsonPath, '{}') } console.log(`๐Ÿ“ฆ Vendoring Deno modules for '${vendorSource}' into '${vendorDest}'...`) - await execaCommand(`deno --allow-import ${vendorSource}`, { + await execaCommand(`deno --allow-import --vendor ${vendorSource}`, { cwd, }) From 0cbab5de496e15eda1f44d177d04ebeb168e7607 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 12:04:10 -0400 Subject: [PATCH 09/10] fix: explicit vendoring of type files --- edge-runtime/vendor.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/edge-runtime/vendor.ts b/edge-runtime/vendor.ts index d49037792f..3618996263 100644 --- a/edge-runtime/vendor.ts +++ b/edge-runtime/vendor.ts @@ -14,3 +14,11 @@ import 'https://deno.land/x/path_to_regexp@v6.2.1/index.ts' import 'https://deno.land/x/htmlrewriter@v1.0.0/src/index.ts' import 'https://v1-7-0--edge-utils.netlify.app/logger/mod.ts' + +// Types +import 'https://deno.land/std@0.175.0/node/_global.d.ts' +import 'https://deno.land/std@0.175.0/node/_events.d.ts' +import 'https://deno.land/std@0.175.0/node/_stream.d.ts' +import 'https://deno.land/std@0.175.0/node/internal/buffer.d.ts' +import 'https://deno.land/std@0.175.0/types.d.ts' +import 'https://deno.land/x/htmlrewriter@v1.0.0/src/types.d.ts' From 13460790cba261c05331e40577130859aae387b7 Mon Sep 17 00:00:00 2001 From: Mateusz Bocian Date: Tue, 5 Aug 2025 13:31:27 -0400 Subject: [PATCH 10/10] ci: missed standardizing a couple of deno versions --- .github/workflows/run-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d5e4732bbf..9c70539529 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -68,7 +68,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v2.3.1 + deno-version: v2.2.4 - name: 'Install dependencies' run: npm ci - name: 'Prepare Netlify CLI' @@ -218,7 +218,7 @@ jobs: uses: denoland/setup-deno@v1 with: # Should match the `DENO_VERSION_RANGE` from https://github.com/netlify/build/blob/main/packages/edge-bundler/node/bridge.ts#L20 - deno-version: v2.3.1 + deno-version: v2.2.4 - name: 'Install dependencies' run: npm ci - name: 'Build'