From b304e208b6dddf25a4f6c5bb9ec23894956ca2de Mon Sep 17 00:00:00 2001 From: Victor Berchet Date: Wed, 23 Oct 2024 09:02:03 +0200 Subject: [PATCH] feat(cloudflare): use querystring and url from workerd See https://github.com/cloudflare/workerd/releases/tag/v1.20241022.0 --- package.json | 2 +- pnpm-lock.yaml | 62 +++++++++++++++++++++++++++++++++++++-- src/presets/cloudflare.ts | 4 ++- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 32a63a4..bacd5fd 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "prettier": "^3.3.3", "typescript": "^5.6.3", "unbuild": "^2.0.0", - "workerd": "^1.20241011.1", + "workerd": "^1.20241022.0", "wrangler": "^3.81.0" }, "packageManager": "pnpm@9.12.2" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 77d0eba..be9cbd6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,8 +58,8 @@ importers: specifier: ^2.0.0 version: 2.0.0(typescript@5.6.3) workerd: - specifier: ^1.20241011.1 - version: 1.20241011.1 + specifier: ^1.20241022.0 + version: 1.20241022.0 wrangler: specifier: ^3.81.0 version: 3.81.0 @@ -159,30 +159,60 @@ packages: cpu: [x64] os: [darwin] + '@cloudflare/workerd-darwin-64@1.20241022.0': + resolution: {integrity: sha512-1NNYun37myMTgCUiPQEJ0cMal4mKZVTpkD0b2tx9hV70xji+frVJcSK8YVLeUm1P+Rw1d/ct8DMgQuCpsz3Fsw==} + engines: {node: '>=16'} + cpu: [x64] + os: [darwin] + '@cloudflare/workerd-darwin-arm64@1.20241011.1': resolution: {integrity: sha512-c26TYtS0e3WZ09nL/a8YaEqveCsTlgDm12ehPMNua9u68sh1KzETMl2G45O934m8UrI3Rhpv2TTecO0S5b9exA==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] + '@cloudflare/workerd-darwin-arm64@1.20241022.0': + resolution: {integrity: sha512-FOO/0P0U82EsTLTdweNVgw+4VOk5nghExLPLSppdOziq6IR5HVgP44Kmq5LdsUeHUhwUmfOh9hzaTpkNzUqKvw==} + engines: {node: '>=16'} + cpu: [arm64] + os: [darwin] + '@cloudflare/workerd-linux-64@1.20241011.1': resolution: {integrity: sha512-pl4xvHNXnm3cYh5GwHadOTQRWt4Ih/gzCOb6RW4n78oNQQydFvpwqYAjbYk32y485feLhdTKXut/MgZAyWnKyQ==} engines: {node: '>=16'} cpu: [x64] os: [linux] + '@cloudflare/workerd-linux-64@1.20241022.0': + resolution: {integrity: sha512-RsNc19BQJG9yd+ngnjuDeG9ywZG+7t1L4JeglgceyY5ViMNMKVO7Zpbsu69kXslU9h6xyQG+lrmclg3cBpnhYA==} + engines: {node: '>=16'} + cpu: [x64] + os: [linux] + '@cloudflare/workerd-linux-arm64@1.20241011.1': resolution: {integrity: sha512-I4HAF2Qe8xgIjAdE53viT2fDdHXkrb3Be0L3eWeeP5SEkOtQ4cHLqsOV7yhUWOJpHiI1XCDcf+wdfn0PB/EngQ==} engines: {node: '>=16'} cpu: [arm64] os: [linux] + '@cloudflare/workerd-linux-arm64@1.20241022.0': + resolution: {integrity: sha512-x5mUXpKxfsosxcFmcq5DaqLs37PejHYVRsNz1cWI59ma7aC4y4Qn6Tf3i0r9MwQTF/MccP4SjVslMU6m4W7IaA==} + engines: {node: '>=16'} + cpu: [arm64] + os: [linux] + '@cloudflare/workerd-windows-64@1.20241011.1': resolution: {integrity: sha512-oVr1Cb7NkDpukd7v68FdxOH8vaHRSzHkX9uE/IttHd2yPK6mwOS220nIxK9UMcx5CwZmrgphRwtZwSYVk/lREQ==} engines: {node: '>=16'} cpu: [x64] os: [win32] + '@cloudflare/workerd-windows-64@1.20241022.0': + resolution: {integrity: sha512-eBCClx4szCOgKqOlxxbdNszMqQf3MRG1B9BRIqEM/diDfdR9IrZ8l3FaEm+l9gXgPmS6m1NBn40aWuGBl8UTSw==} + engines: {node: '>=16'} + cpu: [x64] + os: [win32] + '@cloudflare/workers-shared@0.6.0': resolution: {integrity: sha512-rfUCvb3hx4AsvdUZsxgk9lmgEnQehqV3jdtXLP/Xr0+P56n11T/0nXNMzmn7Nnv+IJFOV6X9NmFhuMz4sBPw7w==} engines: {node: '>=16.7.0'} @@ -2438,6 +2468,11 @@ packages: engines: {node: '>=16'} hasBin: true + workerd@1.20241022.0: + resolution: {integrity: sha512-jyGXsgO9DRcJyx6Ovv7gUyDPc3UYC2i/E0p9GFUg6GUzpldw4Y93y9kOmdfsOnKZ3+lY53veSiUniiBPE6Q2NQ==} + engines: {node: '>=16'} + hasBin: true + wrangler@3.81.0: resolution: {integrity: sha512-sa5dhLJAMmYtl/dJWDJ92sdnKj0VUC0DYBfGqbhd5xn7CDdn1oGhICDXtx2E6BNhQ1L+4d9oAcP/oQvOs5gKLA==} engines: {node: '>=16.17.0'} @@ -2619,18 +2654,33 @@ snapshots: '@cloudflare/workerd-darwin-64@1.20241011.1': optional: true + '@cloudflare/workerd-darwin-64@1.20241022.0': + optional: true + '@cloudflare/workerd-darwin-arm64@1.20241011.1': optional: true + '@cloudflare/workerd-darwin-arm64@1.20241022.0': + optional: true + '@cloudflare/workerd-linux-64@1.20241011.1': optional: true + '@cloudflare/workerd-linux-64@1.20241022.0': + optional: true + '@cloudflare/workerd-linux-arm64@1.20241011.1': optional: true + '@cloudflare/workerd-linux-arm64@1.20241022.0': + optional: true + '@cloudflare/workerd-windows-64@1.20241011.1': optional: true + '@cloudflare/workerd-windows-64@1.20241022.0': + optional: true + '@cloudflare/workers-shared@0.6.0': dependencies: mime: 3.0.0 @@ -4795,6 +4845,14 @@ snapshots: '@cloudflare/workerd-linux-arm64': 1.20241011.1 '@cloudflare/workerd-windows-64': 1.20241011.1 + workerd@1.20241022.0: + optionalDependencies: + '@cloudflare/workerd-darwin-64': 1.20241022.0 + '@cloudflare/workerd-darwin-arm64': 1.20241022.0 + '@cloudflare/workerd-linux-64': 1.20241022.0 + '@cloudflare/workerd-linux-arm64': 1.20241022.0 + '@cloudflare/workerd-windows-64': 1.20241022.0 + wrangler@3.81.0: dependencies: '@cloudflare/kv-asset-handler': 0.3.4 diff --git a/src/presets/cloudflare.ts b/src/presets/cloudflare.ts index 81cc238..f8c39ec 100644 --- a/src/presets/cloudflare.ts +++ b/src/presets/cloudflare.ts @@ -3,7 +3,7 @@ import type { Preset } from "../types"; // Built-in APIs provided by workerd. // https://developers.cloudflare.com/workers/runtime-apis/nodejs/ // https://github.com/cloudflare/workerd/tree/main/src/node -// Last checked: 2024-10-15 +// Last checked: 2024-10-22 const cloudflareNodeCompatModules = [ "_stream_duplex", "_stream_passthrough", @@ -15,11 +15,13 @@ const cloudflareNodeCompatModules = [ "diagnostics_channel", "events", "path", + "querystring", "stream", "stream/consumers", "stream/promises", "stream/web", "string_decoder", + "url", "util/types", "zlib", ];