From b5e67311fead3cdbffa7337ec659d386b6b70493 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 31 Oct 2025 10:23:42 +0000 Subject: [PATCH 01/13] bump wrangler and open-next adapter --- apps/site/package.json | 4 +- pnpm-lock.yaml | 200 +++++++++++++++++++++++------------------ 2 files changed, 115 insertions(+), 89 deletions(-) diff --git a/apps/site/package.json b/apps/site/package.json index d886d8c478670..9f85477bd6209 100644 --- a/apps/site/package.json +++ b/apps/site/package.json @@ -83,7 +83,7 @@ "@flarelabs-net/wrangler-build-time-fs-assets-polyfilling": "^0.0.1", "@next/eslint-plugin-next": "15.5.4", "@node-core/remark-lint": "workspace:*", - "@opennextjs/cloudflare": "^1.6.4", + "@opennextjs/cloudflare": "^1.11.0", "@playwright/test": "^1.56.1", "@testing-library/user-event": "~14.6.1", "@types/mdast": "^4.0.4", @@ -108,7 +108,7 @@ "typescript": "catalog:", "typescript-eslint": "~8.45.0", "user-agent-data-types": "0.4.2", - "wrangler": "^4.33.1" + "wrangler": "^4.45.3" }, "imports": { "#site/*": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9a276a0bc639b..c90751eadc915 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -227,8 +227,8 @@ importers: specifier: workspace:* version: link:../../packages/remark-lint '@opennextjs/cloudflare': - specifier: ^1.6.4 - version: 1.6.4(wrangler@4.33.1) + specifier: ^1.11.0 + version: 1.11.0(wrangler@4.45.3) '@playwright/test': specifier: ^1.56.1 version: 1.56.1 @@ -302,8 +302,8 @@ importers: specifier: 0.4.2 version: 0.4.2 wrangler: - specifier: ^4.33.1 - version: 4.33.1 + specifier: ^4.45.3 + version: 4.45.3 packages/i18n: devDependencies: @@ -1050,41 +1050,41 @@ packages: resolution: {integrity: sha512-+tv3z+SPp+gqTIcImN9o0hqE9xyfQjI1XD9pL6NuKjua9B1y7mNYv0S9cP+QEbA4ppVgGZEmKOvHX5G5Ei1CVA==} engines: {node: '>=18.0.0'} - '@cloudflare/unenv-preset@2.7.0': - resolution: {integrity: sha512-0JbEj+KTCQ4nTIWg2q8Bou+fPxzG6/zwU5O/w6Cld6WEjLl+716foT+2bjg48h09hMtjTKkJdAh1m4LybBKGCg==} + '@cloudflare/unenv-preset@2.7.8': + resolution: {integrity: sha512-Ky929MfHh+qPhwCapYrRPwPVHtA2Ioex/DbGZyskGyNRDe9Ru3WThYZivyNVaPy5ergQSgMs9OKrM9Ajtz9F6w==} peerDependencies: - unenv: 2.0.0-rc.19 - workerd: ^1.20250816.0 + unenv: 2.0.0-rc.21 + workerd: ^1.20250927.0 peerDependenciesMeta: workerd: optional: true - '@cloudflare/workerd-darwin-64@1.20250823.0': - resolution: {integrity: sha512-yRLJc1cQNqQYcDViOk7kpTXnR5XuBP7B/Ms5KBdlQ6eTr2Vsg9mfKqWKInjzY8/Cx+p+Sic2Tbld42gcYkiM2A==} + '@cloudflare/workerd-darwin-64@1.20251011.0': + resolution: {integrity: sha512-0DirVP+Z82RtZLlK2B+VhLOkk+ShBqDYO/jhcRw4oVlp0TOvk3cOVZChrt3+y3NV8Y/PYgTEywzLKFSziK4wCg==} engines: {node: '>=16'} cpu: [x64] os: [darwin] - '@cloudflare/workerd-darwin-arm64@1.20250823.0': - resolution: {integrity: sha512-KJnikUe6J29Ga1QMPKNCc8eHD56DdBlu5XE5LoBH/AYRrbS5UI1d5F844hUWoFKJb8KRaPIH9F849HZWfNa1vw==} + '@cloudflare/workerd-darwin-arm64@1.20251011.0': + resolution: {integrity: sha512-1WuFBGwZd15p4xssGN/48OE2oqokIuc51YvHvyNivyV8IYnAs3G9bJNGWth1X7iMDPe4g44pZrKhRnISS2+5dA==} engines: {node: '>=16'} cpu: [arm64] os: [darwin] - '@cloudflare/workerd-linux-64@1.20250823.0': - resolution: {integrity: sha512-4QFXq4eDWEAK5QjGxRe0XUTBax1Fgarc08HETL6q0y/KPZp2nOTLfjLjklTn/qEiztafNFoJEIwhkiknHeOi/g==} + '@cloudflare/workerd-linux-64@1.20251011.0': + resolution: {integrity: sha512-BccMiBzFlWZyFghIw2szanmYJrJGBGHomw2y/GV6pYXChFzMGZkeCEMfmCyJj29xczZXxcZmUVJxNy4eJxO8QA==} engines: {node: '>=16'} cpu: [x64] os: [linux] - '@cloudflare/workerd-linux-arm64@1.20250823.0': - resolution: {integrity: sha512-sODSrSVe4W/maoBu76qb0sJGBhxhSM2Q2tg/+G7q1IPgRZSzArMKIPrW6nBnmBrrG1O0X6aoAdID6w5hfuEM4g==} + '@cloudflare/workerd-linux-arm64@1.20251011.0': + resolution: {integrity: sha512-79o/216lsbAbKEVDZYXR24ivEIE2ysDL9jvo0rDTkViLWju9dAp3CpyetglpJatbSi3uWBPKZBEOqN68zIjVsQ==} engines: {node: '>=16'} cpu: [arm64] os: [linux] - '@cloudflare/workerd-windows-64@1.20250823.0': - resolution: {integrity: sha512-WaNqUOXUnrcEI+i2NI4+okA9CrJMI9n2XTfVtDg/pLvcA/ZPTz23MEFMZU1splr4SslS1th1NBO38RMPnDB4rA==} + '@cloudflare/workerd-windows-64@1.20251011.0': + resolution: {integrity: sha512-RIXUQRchFdqEvaUqn1cXZXSKjpqMaSaVAkI5jNZ8XzAw/bw2bcdOVUtakrflgxDprltjFb0PTNtuss1FKtH9Jg==} engines: {node: '>=16'} cpu: [x64] os: [win32] @@ -1848,9 +1848,6 @@ packages: resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/source-map@0.3.10': - resolution: {integrity: sha512-0pPkgz9dY+bijgistcTTJ5mR+ocqRXLuhXHYdzoMmmoJ2C9S46RCm2GMUbatPEUK9Yjy26IrAy8D/M00lLkv+Q==} - '@jridgewell/source-map@0.3.11': resolution: {integrity: sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==} @@ -2069,15 +2066,15 @@ packages: '@open-draft/until@2.1.0': resolution: {integrity: sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg==} - '@opennextjs/aws@3.7.4': - resolution: {integrity: sha512-s50dmKrgQ62GliffoI/hGGQVb3q/7ZN5VRa4jJw0ZsEGLfk25XuAulO/ySCYeE7/A23KoAYuhafnKr/h+vxOeQ==} + '@opennextjs/aws@3.8.5': + resolution: {integrity: sha512-elpMb0fJZc0a1VtymedFa7P1lYcyOmt+Pwqyacpq2C/SvbETIeBlW/Xle/vY95ICtccKUxITI8MtonrCo2+2/Q==} hasBin: true - '@opennextjs/cloudflare@1.6.4': - resolution: {integrity: sha512-vGEHr1+Dli4BSrs+CM+b2bnXoUdY/GUFiLfdH28UTRHggLMG7cL49M39LtzIVR5D8eqzZ38PDB2CZMn1LJ2gSw==} + '@opennextjs/cloudflare@1.11.0': + resolution: {integrity: sha512-2QVZLjCr3hPwkcGEetLarTZvlNIHsGV3j2+i+KNsjFIBgvsnxhmRqJbT0u8J9cVMFKNh19hSOTOmUKs1T3DWig==} hasBin: true peerDependencies: - wrangler: ^4.24.4 + wrangler: ^4.38.0 '@opentelemetry/api-logs@0.206.0': resolution: {integrity: sha512-yIVDu9jX//nV5wSMLZLdHdb1SKHIMj9k+wQVFtln5Flcgdldz9BkHtavvExQiJqBZg2OpEEJEZmzQazYztdz2A==} @@ -3572,6 +3569,9 @@ packages: '@types/parse-json@4.0.2': resolution: {integrity: sha512-dISoDXWWQwUquiKsyZ4Ng+HX2KsPL7LyHKHQwgGFEA3IaKac4Obd+h2a/a6waisAoepJlBcx9paWqjA8/HVjCw==} + '@types/rclone.js@0.6.3': + resolution: {integrity: sha512-BssKAAVRY//fxGKso8SatyOwiD7X0toDofNnVxZlIXmN7UHrn2UBTxldNAjgUvWA91qJyeEPfKmeJpZVhLugXg==} + '@types/react@19.2.2': resolution: {integrity: sha512-6mDvHUFSjyT2B2yeNx2nUgMxh9LtOWvkhIU3uePn2I2oyNymUAX1NIsdgviM4CH+JSrp2D2hsMvJOkxY+0wNRA==} @@ -4016,6 +4016,10 @@ packages: engines: {node: '>=0.4.0'} hasBin: true + adm-zip@0.5.16: + resolution: {integrity: sha512-TGw5yVi4saajsSEgz25grObGHEUaDrniwvA2qwSC060KfqGPdglhvPMA2lPIoxs3PQIItj2iag35fONcQqgUaQ==} + engines: {node: '>=12.0'} + agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} @@ -6165,10 +6169,6 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.1.0: - resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} - engines: {node: 20 || >=22} - lru-cache@11.2.2: resolution: {integrity: sha512-F9ODfyqML2coTIsQpSkRHnLSZMtkU8Q+mSfcaIyKwy58u+8k5nvAYeiNhsyMARvzNcXJ9QfWVrcPsC9e9rAxtg==} engines: {node: 20 || >=22} @@ -6466,8 +6466,8 @@ packages: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - miniflare@4.20250823.1: - resolution: {integrity: sha512-qjbF69XXyHXk4R//q0a9MLraKE9MLKZ/94k6jKcfouJ0g+se7VyMzCBryeWA534+ZAlNM4Ay5gqYr1v3Wk6ctQ==} + miniflare@4.20251011.1: + resolution: {integrity: sha512-Qbw1Z8HTYM1adWl6FAtzhrj34/6dPRDPwdYOx21dkae8a/EaxbMzRIPbb4HKVGMVvtqbK1FaRCgDLVLolNzGHg==} engines: {node: '>=18.0.0'} hasBin: true @@ -7140,6 +7140,12 @@ packages: resolution: {integrity: sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==} engines: {node: '>= 0.8'} + rclone.js@0.6.6: + resolution: {integrity: sha512-Dxh34cab/fNjFq5SSm0fYLNkGzG2cQSBy782UW9WwxJCEiVO4cGXkvaXcNlgv817dK8K8PuQ+NHUqSAMMhWujQ==} + engines: {node: '>=12'} + os: [darwin, freebsd, linux, openbsd, sunos, win32] + hasBin: true + react-docgen-typescript@2.4.0: resolution: {integrity: sha512-ZtAp5XTO5HRzQctjPU0ybY0RRCQO19X/8fxn3w7y2VVTUbGHDKULPTL4ky3vB05euSgG5NpALhEhDPvQ56wvXg==} peerDependencies: @@ -8181,12 +8187,12 @@ packages: resolution: {integrity: sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==} engines: {node: '>=14.0'} - undici@7.15.0: - resolution: {integrity: sha512-7oZJCPvvMvTd0OlqWsIxTuItTpJBpU1tcbVl24FMn3xt3+VSunwUasmfPJRE57oNO1KsZ4PgA1xTdAX4hq8NyQ==} + undici@7.14.0: + resolution: {integrity: sha512-Vqs8HTzjpQXZeXdpsfChQTlafcMQaaIwnGwLam1wudSSjlJeQ3bw1j+TLPePgrCnCpUXx7Ba5Pdpf5OBih62NQ==} engines: {node: '>=20.18.1'} - unenv@2.0.0-rc.19: - resolution: {integrity: sha512-t/OMHBNAkknVCI7bVB9OWjUUAwhVv9vsPIAGnNUxnu3FxPQN11rjh0sksLMzc3g7IlTgvHmOTl4JM7JHpcv5wA==} + unenv@2.0.0-rc.21: + resolution: {integrity: sha512-Wj7/AMtE9MRnAXa6Su3Lk0LNCfqDYgfwVjwRFVum9U7wsto1imuHqk4kTm7Jni+5A0Hn7dttL6O/zjvUvoo+8A==} unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} @@ -8483,17 +8489,17 @@ packages: wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} - workerd@1.20250823.0: - resolution: {integrity: sha512-95lToK9zeaC7bX5ZmlP/wz6zqoUPBk3hhec1JjEMGZrxsXY9cPRkjWNCcjDctQ17U97vjMcY/ymchgx7w8Cfmg==} + workerd@1.20251011.0: + resolution: {integrity: sha512-Dq35TLPEJAw7BuYQMkN3p9rge34zWMU2Gnd4DSJFeVqld4+DAO2aPG7+We2dNIAyM97S8Y9BmHulbQ00E0HC7Q==} engines: {node: '>=16'} hasBin: true - wrangler@4.33.1: - resolution: {integrity: sha512-8x/3Tbt+/raBMm0+vRyAHSGu2kF1QjeiSrx47apgPk/AzSBcXI9YuUUdGrKnozMYZlEbOxdBQOMyuRRDTyNmOg==} + wrangler@4.45.3: + resolution: {integrity: sha512-0ddEA9t4HeBgSVTVTcqtBHl7Z5CorWZ8tGgTQCP5XuL+9E1TJRwS6t/zzG51Ruwjb17SZYCaLchoM8V629S8cw==} engines: {node: '>=18.0.0'} hasBin: true peerDependencies: - '@cloudflare/workers-types': ^4.20250823.0 + '@cloudflare/workers-types': ^4.20251011.0 peerDependenciesMeta: '@cloudflare/workers-types': optional: true @@ -9804,25 +9810,25 @@ snapshots: dependencies: mime: 3.0.0 - '@cloudflare/unenv-preset@2.7.0(unenv@2.0.0-rc.19)(workerd@1.20250823.0)': + '@cloudflare/unenv-preset@2.7.8(unenv@2.0.0-rc.21)(workerd@1.20251011.0)': dependencies: - unenv: 2.0.0-rc.19 + unenv: 2.0.0-rc.21 optionalDependencies: - workerd: 1.20250823.0 + workerd: 1.20251011.0 - '@cloudflare/workerd-darwin-64@1.20250823.0': + '@cloudflare/workerd-darwin-64@1.20251011.0': optional: true - '@cloudflare/workerd-darwin-arm64@1.20250823.0': + '@cloudflare/workerd-darwin-arm64@1.20251011.0': optional: true - '@cloudflare/workerd-linux-64@1.20250823.0': + '@cloudflare/workerd-linux-64@1.20251011.0': optional: true - '@cloudflare/workerd-linux-arm64@1.20250823.0': + '@cloudflare/workerd-linux-arm64@1.20251011.0': optional: true - '@cloudflare/workerd-windows-64@1.20250823.0': + '@cloudflare/workerd-windows-64@1.20251011.0': optional: true '@cspotcode/source-map-support@0.8.1': @@ -9866,7 +9872,7 @@ snapshots: dotenv: 16.6.1 eciesjs: 0.4.15 execa: 5.1.1 - fdir: 6.4.6(picomatch@4.0.3) + fdir: 6.5.0(picomatch@4.0.3) ignore: 5.3.2 object-treeify: 1.1.33 picomatch: 4.0.3 @@ -10415,11 +10421,6 @@ snapshots: '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/source-map@0.3.10': - dependencies: - '@jridgewell/gen-mapping': 0.3.13 - '@jridgewell/trace-mapping': 0.3.31 - '@jridgewell/source-map@0.3.11': dependencies: '@jridgewell/gen-mapping': 0.3.13 @@ -10759,7 +10760,7 @@ snapshots: '@open-draft/until@2.1.0': {} - '@opennextjs/aws@3.7.4': + '@opennextjs/aws@3.8.5': dependencies: '@ast-grep/napi': 0.35.0 '@aws-sdk/client-cloudfront': 3.398.0 @@ -10782,15 +10783,17 @@ snapshots: - aws-crt - supports-color - '@opennextjs/cloudflare@1.6.4(wrangler@4.33.1)': + '@opennextjs/cloudflare@1.11.0(wrangler@4.45.3)': dependencies: '@dotenvx/dotenvx': 1.31.0 - '@opennextjs/aws': 3.7.4 + '@opennextjs/aws': 3.8.5 + '@types/rclone.js': 0.6.3 cloudflare: 4.5.0 enquirer: 2.4.1 glob: 11.0.3 + rclone.js: 0.6.6 ts-tqdm: 0.8.6 - wrangler: 4.33.1 + wrangler: 4.45.3 yargs: 18.0.0 transitivePeerDependencies: - aws-crt @@ -12510,6 +12513,10 @@ snapshots: '@types/parse-json@4.0.2': {} + '@types/rclone.js@0.6.3': + dependencies: + '@types/node': 22.18.6 + '@types/react@19.2.2': dependencies: csstype: 3.1.3 @@ -12956,6 +12963,8 @@ snapshots: acorn@8.15.0: {} + adm-zip@0.5.16: {} + agent-base@7.1.4: {} agentkeepalive@4.6.0: @@ -13310,7 +13319,7 @@ snapshots: cliui@9.0.1: dependencies: string-width: 7.2.0 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 wrap-ansi: 9.0.2 cloudflare@4.5.0: @@ -13902,7 +13911,7 @@ snapshots: eslint: 9.36.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)))(eslint-plugin-import@2.32.0)(eslint@9.36.0(jiti@2.6.1)) - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4(eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)))(eslint-plugin-import@2.32.0)(eslint@9.36.0(jiti@2.6.1)))(eslint@9.36.0(jiti@2.6.1)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.36.0(jiti@2.6.1)) eslint-plugin-react: 7.37.5(eslint@9.36.0(jiti@2.6.1)) eslint-plugin-react-hooks: 5.2.0(eslint@9.36.0(jiti@2.6.1)) @@ -13939,7 +13948,7 @@ snapshots: tinyglobby: 0.2.15 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4(eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)))(eslint-plugin-import@2.32.0)(eslint@9.36.0(jiti@2.6.1)))(eslint@9.36.0(jiti@2.6.1)) eslint-plugin-import-x: 4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)) transitivePeerDependencies: - supports-color @@ -13955,7 +13964,7 @@ snapshots: tinyglobby: 0.2.14 unrs-resolver: 1.11.1 optionalDependencies: - eslint-plugin-import: 2.32.0(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)) + eslint-plugin-import: 2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)) eslint-plugin-import-x: 4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)) transitivePeerDependencies: - supports-color @@ -13982,6 +13991,17 @@ snapshots: - bluebird - supports-color + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@9.36.0(jiti@2.6.1)): + dependencies: + debug: 3.2.7 + optionalDependencies: + '@typescript-eslint/parser': 8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3) + eslint: 9.36.0(jiti@2.6.1) + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)))(eslint-plugin-import@2.32.0)(eslint@9.36.0(jiti@2.6.1)) + transitivePeerDependencies: + - supports-color + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)): dependencies: debug: 3.2.7 @@ -13992,6 +14012,7 @@ snapshots: eslint-import-resolver-typescript: 4.4.4(eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)))(eslint-plugin-import@2.32.0)(eslint@9.36.0(jiti@2.6.1)) transitivePeerDependencies: - supports-color + optional: true eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)): dependencies: @@ -14011,7 +14032,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4(eslint-plugin-import-x@4.16.1(@typescript-eslint/utils@8.46.1(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint@9.36.0(jiti@2.6.1)))(eslint-plugin-import@2.32.0)(eslint@9.36.0(jiti@2.6.1)))(eslint@9.36.0(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -14022,7 +14043,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.36.0(jiti@2.6.1) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@9.36.0(jiti@2.6.1)) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -14040,7 +14061,7 @@ snapshots: - eslint-import-resolver-webpack - supports-color - eslint-plugin-import@2.32.0(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3))(eslint-import-resolver-typescript@4.4.4)(eslint@9.36.0(jiti@2.6.1)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -14062,6 +14083,8 @@ snapshots: semver: 6.3.1 string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 + optionalDependencies: + '@typescript-eslint/parser': 8.45.0(eslint@9.36.0(jiti@2.6.1))(typescript@5.8.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -15493,8 +15516,6 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.1.0: {} - lru-cache@11.2.2: {} lru-cache@5.1.1: @@ -16061,7 +16082,7 @@ snapshots: min-indent@1.0.1: {} - miniflare@4.20250823.1: + miniflare@4.20251011.1: dependencies: '@cspotcode/source-map-support': 0.8.1 acorn: 8.14.0 @@ -16070,8 +16091,8 @@ snapshots: glob-to-regexp: 0.4.1 sharp: 0.33.5 stoppable: 1.1.0 - undici: 7.15.0 - workerd: 1.20250823.0 + undici: 7.14.0 + workerd: 1.20251011.0 ws: 8.18.0 youch: 4.1.0-beta.10 zod: 3.22.3 @@ -16429,7 +16450,7 @@ snapshots: path-scurry@2.0.0: dependencies: - lru-cache: 11.1.0 + lru-cache: 11.2.2 minipass: 7.1.2 path-to-regexp@6.3.0: {} @@ -16689,6 +16710,11 @@ snapshots: iconv-lite: 0.6.3 unpipe: 1.0.0 + rclone.js@0.6.6: + dependencies: + adm-zip: 0.5.16 + mri: 1.2.0 + react-docgen-typescript@2.4.0(typescript@5.8.3): dependencies: typescript: 5.8.3 @@ -17536,7 +17562,7 @@ snapshots: dependencies: color: 4.2.3 detect-libc: 2.1.2 - semver: 7.7.2 + semver: 7.7.3 optionalDependencies: '@img/sharp-darwin-arm64': 0.33.5 '@img/sharp-darwin-x64': 0.33.5 @@ -18038,7 +18064,7 @@ snapshots: terser@5.16.9: dependencies: - '@jridgewell/source-map': 0.3.10 + '@jridgewell/source-map': 0.3.11 acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 @@ -18259,9 +18285,9 @@ snapshots: dependencies: '@fastify/busboy': 2.1.1 - undici@7.15.0: {} + undici@7.14.0: {} - unenv@2.0.0-rc.19: + unenv@2.0.0-rc.21: dependencies: defu: 6.1.4 exsolve: 1.0.7 @@ -18721,24 +18747,24 @@ snapshots: wordwrap@1.0.0: {} - workerd@1.20250823.0: + workerd@1.20251011.0: optionalDependencies: - '@cloudflare/workerd-darwin-64': 1.20250823.0 - '@cloudflare/workerd-darwin-arm64': 1.20250823.0 - '@cloudflare/workerd-linux-64': 1.20250823.0 - '@cloudflare/workerd-linux-arm64': 1.20250823.0 - '@cloudflare/workerd-windows-64': 1.20250823.0 + '@cloudflare/workerd-darwin-64': 1.20251011.0 + '@cloudflare/workerd-darwin-arm64': 1.20251011.0 + '@cloudflare/workerd-linux-64': 1.20251011.0 + '@cloudflare/workerd-linux-arm64': 1.20251011.0 + '@cloudflare/workerd-windows-64': 1.20251011.0 - wrangler@4.33.1: + wrangler@4.45.3: dependencies: '@cloudflare/kv-asset-handler': 0.4.0 - '@cloudflare/unenv-preset': 2.7.0(unenv@2.0.0-rc.19)(workerd@1.20250823.0) + '@cloudflare/unenv-preset': 2.7.8(unenv@2.0.0-rc.21)(workerd@1.20251011.0) blake3-wasm: 2.1.5 esbuild: 0.25.4 - miniflare: 4.20250823.1 + miniflare: 4.20251011.1 path-to-regexp: 6.3.0 - unenv: 2.0.0-rc.19 - workerd: 1.20250823.0 + unenv: 2.0.0-rc.21 + workerd: 1.20251011.0 optionalDependencies: fsevents: 2.3.3 transitivePeerDependencies: From 451d065c60befd182699ec022f47b5d5a6187084 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 31 Oct 2025 14:06:23 +0000 Subject: [PATCH 02/13] for the open-next incremental cache use R2 with regional cache instead of kv --- apps/site/open-next.config.ts | 9 +++++++-- apps/site/wrangler.jsonc | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/apps/site/open-next.config.ts b/apps/site/open-next.config.ts index d7dbb2ff9ddda..2d2633b96b89c 100644 --- a/apps/site/open-next.config.ts +++ b/apps/site/open-next.config.ts @@ -1,8 +1,13 @@ import type { OpenNextConfig } from '@opennextjs/cloudflare'; import { defineCloudflareConfig } from '@opennextjs/cloudflare'; -import incrementalCache from '@opennextjs/cloudflare/overrides/incremental-cache/kv-incremental-cache'; +import r2IncrementalCache from '@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache'; +import { withRegionalCache } from '@opennextjs/cloudflare/overrides/incremental-cache/regional-cache'; -const cloudflareConfig = defineCloudflareConfig({ incrementalCache }); +const cloudflareConfig = defineCloudflareConfig({ + incrementalCache: withRegionalCache(r2IncrementalCache, { + mode: 'long-lived', + }), +}); const openNextConfig: OpenNextConfig = { ...cloudflareConfig, diff --git a/apps/site/wrangler.jsonc b/apps/site/wrangler.jsonc index 3ceafca8647b7..24fcf7f9de26d 100644 --- a/apps/site/wrangler.jsonc +++ b/apps/site/wrangler.jsonc @@ -33,10 +33,10 @@ "fs": "./.wrangler/fs-assets-polyfilling/polyfills/node/fs.ts", "fs/promises": "./.wrangler/fs-assets-polyfilling/polyfills/node/fs/promises.ts", }, - "kv_namespaces": [ + "r2_buckets": [ { - "binding": "NEXT_INC_CACHE_KV", - "id": "69b7422d56dd4244bc0127b69ecdc36f", + "binding": "NEXT_INC_CACHE_R2_BUCKET", + "bucket_name": "next-cache-r2-for-open-next-website", }, ], } From 77a9433c24a96e3d95e13cf107df28be557a4872 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 31 Oct 2025 14:22:39 +0000 Subject: [PATCH 03/13] add open-next DO queue --- apps/site/open-next.config.ts | 2 ++ apps/site/wrangler.jsonc | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/apps/site/open-next.config.ts b/apps/site/open-next.config.ts index 2d2633b96b89c..983c3c04aeff1 100644 --- a/apps/site/open-next.config.ts +++ b/apps/site/open-next.config.ts @@ -2,11 +2,13 @@ import type { OpenNextConfig } from '@opennextjs/cloudflare'; import { defineCloudflareConfig } from '@opennextjs/cloudflare'; import r2IncrementalCache from '@opennextjs/cloudflare/overrides/incremental-cache/r2-incremental-cache'; import { withRegionalCache } from '@opennextjs/cloudflare/overrides/incremental-cache/regional-cache'; +import doQueue from '@opennextjs/cloudflare/overrides/queue/do-queue'; const cloudflareConfig = defineCloudflareConfig({ incrementalCache: withRegionalCache(r2IncrementalCache, { mode: 'long-lived', }), + queue: doQueue, }); const openNextConfig: OpenNextConfig = { diff --git a/apps/site/wrangler.jsonc b/apps/site/wrangler.jsonc index 24fcf7f9de26d..69afe07d5a0e2 100644 --- a/apps/site/wrangler.jsonc +++ b/apps/site/wrangler.jsonc @@ -39,4 +39,18 @@ "bucket_name": "next-cache-r2-for-open-next-website", }, ], + "durable_objects": { + "bindings": [ + { + "name": "NEXT_CACHE_DO_QUEUE", + "class_name": "DOQueueHandler", + }, + ], + }, + "migrations": [ + { + "tag": "v1", + "new_sqlite_classes": ["DOQueueHandler"], + }, + ], } From b0d8f903425616ce244d5ea20ff88f45304b82f5 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 31 Oct 2025 14:23:14 +0000 Subject: [PATCH 04/13] enable open-next cache interception --- apps/site/open-next.config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/site/open-next.config.ts b/apps/site/open-next.config.ts index 983c3c04aeff1..8d5833c350194 100644 --- a/apps/site/open-next.config.ts +++ b/apps/site/open-next.config.ts @@ -9,6 +9,7 @@ const cloudflareConfig = defineCloudflareConfig({ mode: 'long-lived', }), queue: doQueue, + enableCacheInterception: true, }); const openNextConfig: OpenNextConfig = { From 16290e93b8d3eed877efe7e235c4ff564dbba9bd Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Fri, 31 Oct 2025 18:09:28 +0000 Subject: [PATCH 05/13] add open-next custom image loader --- apps/site/cloudflare-image-loader.ts | 22 +++++++ apps/site/next.config.mjs | 95 ++++++++++++++++------------ 2 files changed, 78 insertions(+), 39 deletions(-) create mode 100644 apps/site/cloudflare-image-loader.ts diff --git a/apps/site/cloudflare-image-loader.ts b/apps/site/cloudflare-image-loader.ts new file mode 100644 index 0000000000000..04b873f7224b6 --- /dev/null +++ b/apps/site/cloudflare-image-loader.ts @@ -0,0 +1,22 @@ +import type { ImageLoaderProps } from 'next/image'; + +const normalizeSrc = (src: string) => { + return src.startsWith('/') ? src.slice(1) : src; +}; + +export default function cloudflareLoader({ + src, + width, + quality, +}: ImageLoaderProps) { + if (process.env.NODE_ENV === 'development') { + // Serve the original image when using `next dev` + return src; + } + const params = [`width=${width}`]; + if (quality) { + params.push(`quality=${quality}`); + } + const paramsString = params.join(','); + return `/cdn-cgi/image/${paramsString}/${normalizeSrc(src)}`; +} diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index 7396448b79b18..8ac232ca316ac 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -13,44 +13,61 @@ const nextConfig = { // is being built on a subdirectory (e.g. /nodejs-website) basePath: BASE_PATH, // Vercel/Next.js Image Optimization Settings - images: { - // We disable image optimisation during static export builds - unoptimized: ENABLE_STATIC_EXPORT, - // We add it to the remote pattern for the static images we use from multiple sources - // to be marked as safe sources (these come from Markdown files) - remotePatterns: [ - { - protocol: 'https', - hostname: 'avatars.githubusercontent.com', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'bestpractices.coreinfrastructure.org', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'raw.githubusercontent.com', - port: '', - pathname: '/nodejs/**', - }, - { - protocol: 'https', - hostname: 'user-images.githubusercontent.com', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'website-assets.oramasearch.com', - port: '', - pathname: '/**', - }, - ], - }, + images: + // If we're building for the Cloudflare deployment we want to use the custom cloudflare image loader + // + // Important: The custom loader ignores `remotePatterns` as those are configured as allowed source origins + // (https://developers.cloudflare.com/images/transform-images/sources/) + // in the Cloudflare dashboard itself instead (to the exact same values present in `remotePatterns` below). + // + // TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being + // defined in the worker building script, ideally the open-next + // adapter should set it itself when it invokes the Next.js build + // process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE` + // definition in the package.json script. + process.env.OPEN_NEXT_CLOUDFLARE + ? { + loader: 'custom', + loaderFile: './cloudflare-image-loader.ts', + } + : { + // We disable image optimisation during static export builds + unoptimized: ENABLE_STATIC_EXPORT, + // We add it to the remote pattern for the static images we use from multiple sources + // to be marked as safe sources (these come from Markdown files) + remotePatterns: [ + { + protocol: 'https', + hostname: 'avatars.githubusercontent.com', + port: '', + pathname: '/**', + }, + { + protocol: 'https', + hostname: 'bestpractices.coreinfrastructure.org', + port: '', + pathname: '/**', + }, + { + protocol: 'https', + hostname: 'raw.githubusercontent.com', + port: '', + pathname: '/nodejs/**', + }, + { + protocol: 'https', + hostname: 'user-images.githubusercontent.com', + port: '', + pathname: '/**', + }, + { + protocol: 'https', + hostname: 'website-assets.oramasearch.com', + port: '', + pathname: '/**', + }, + ], + }, serverExternalPackages: ['twoslash'], outputFileTracingIncludes: { // Twoslash needs TypeScript declarations to function, and, by default, Next.js @@ -111,7 +128,7 @@ const nextConfig = { // TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being // defined in the worker building script, ideally the open-next // adapter should set it itself when it invokes the Next.js build - // process, onces it does that remove the manual `OPEN_NEXT_CLOUDFLARE` + // process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE` // definition in the package.json script. deploymentId: process.env.OPEN_NEXT_CLOUDFLARE ? (await import('@opennextjs/cloudflare')).getDeploymentId() From 65b4b4b39306e307764a4e1afb986bbbabe3d122 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 12:42:45 +0000 Subject: [PATCH 06/13] add inline comment for regional cache --- apps/site/open-next.config.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/site/open-next.config.ts b/apps/site/open-next.config.ts index 8d5833c350194..6785cc5e54f3d 100644 --- a/apps/site/open-next.config.ts +++ b/apps/site/open-next.config.ts @@ -5,6 +5,11 @@ import { withRegionalCache } from '@opennextjs/cloudflare/overrides/incremental- import doQueue from '@opennextjs/cloudflare/overrides/queue/do-queue'; const cloudflareConfig = defineCloudflareConfig({ + /** + * The regional cache implementation with R2 (instead of a KV one) is is chosen here + * for both R2's strong consistency alongside the regional cache performance gains. + * @see https://opennext.js.org/cloudflare/caching + */ incrementalCache: withRegionalCache(r2IncrementalCache, { mode: 'long-lived', }), From a259564523e07e224b93a17a4f706872d9be0577 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 12:49:34 +0000 Subject: [PATCH 07/13] define `OPEN_NEXT_CLOUDFLARE` variable in `next.consstants.mjs` --- apps/site/next.config.mjs | 20 +++++++------------- apps/site/next.constants.mjs | 11 +++++++++++ 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index 8ac232ca316ac..25f5ca1a1615a 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -1,7 +1,11 @@ 'use strict'; import createNextIntlPlugin from 'next-intl/plugin'; -import { BASE_PATH, ENABLE_STATIC_EXPORT } from './next.constants.mjs'; +import { + BASE_PATH, + ENABLE_STATIC_EXPORT, + OPEN_NEXT_CLOUDFLARE, +} from './next.constants.mjs'; import { redirects, rewrites } from './next.rewrites.mjs'; /** @type {import('next').NextConfig} */ @@ -20,12 +24,7 @@ const nextConfig = { // (https://developers.cloudflare.com/images/transform-images/sources/) // in the Cloudflare dashboard itself instead (to the exact same values present in `remotePatterns` below). // - // TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being - // defined in the worker building script, ideally the open-next - // adapter should set it itself when it invokes the Next.js build - // process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE` - // definition in the package.json script. - process.env.OPEN_NEXT_CLOUDFLARE + OPEN_NEXT_CLOUDFLARE ? { loader: 'custom', loaderFile: './cloudflare-image-loader.ts', @@ -125,12 +124,7 @@ const nextConfig = { }, // If we're building for the Cloudflare deployment we want to set // an appropriate deploymentId (needed for skew protection) - // TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being - // defined in the worker building script, ideally the open-next - // adapter should set it itself when it invokes the Next.js build - // process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE` - // definition in the package.json script. - deploymentId: process.env.OPEN_NEXT_CLOUDFLARE + deploymentId: OPEN_NEXT_CLOUDFLARE ? (await import('@opennextjs/cloudflare')).getDeploymentId() : undefined, }; diff --git a/apps/site/next.constants.mjs b/apps/site/next.constants.mjs index 8e77460d643e9..ff6b75f6d9339 100644 --- a/apps/site/next.constants.mjs +++ b/apps/site/next.constants.mjs @@ -193,3 +193,14 @@ export const EOL_VERSION_IDENTIFIER = 'End-of-life'; */ export const VULNERABILITIES_URL = 'https://raw.githubusercontent.com/nodejs/security-wg/main/vuln/core/index.json'; + +/** + * Whether the build process is targeting the Cloudflare open-next build or not. + * + * TODO: The `OPEN_NEXT_CLOUDFLARE` environment variable is being + * defined in the worker building script, ideally the open-next + * adapter should set it itself when it invokes the Next.js build + * process, once it does that remove the manual `OPEN_NEXT_CLOUDFLARE` + * definition in the package.json script. + */ +export const OPEN_NEXT_CLOUDFLARE = process.env.OPEN_NEXT_CLOUDFLARE; From 302ba1b9b5d08591a18ad7fae4656e0d9f99349c Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 12:54:38 +0000 Subject: [PATCH 08/13] avoid ternaries in `next.config.mjs` --- apps/site/next.config.mjs | 121 +++++++++++++++++++++----------------- 1 file changed, 66 insertions(+), 55 deletions(-) diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index 25f5ca1a1615a..e8828342afcb3 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -17,56 +17,7 @@ const nextConfig = { // is being built on a subdirectory (e.g. /nodejs-website) basePath: BASE_PATH, // Vercel/Next.js Image Optimization Settings - images: - // If we're building for the Cloudflare deployment we want to use the custom cloudflare image loader - // - // Important: The custom loader ignores `remotePatterns` as those are configured as allowed source origins - // (https://developers.cloudflare.com/images/transform-images/sources/) - // in the Cloudflare dashboard itself instead (to the exact same values present in `remotePatterns` below). - // - OPEN_NEXT_CLOUDFLARE - ? { - loader: 'custom', - loaderFile: './cloudflare-image-loader.ts', - } - : { - // We disable image optimisation during static export builds - unoptimized: ENABLE_STATIC_EXPORT, - // We add it to the remote pattern for the static images we use from multiple sources - // to be marked as safe sources (these come from Markdown files) - remotePatterns: [ - { - protocol: 'https', - hostname: 'avatars.githubusercontent.com', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'bestpractices.coreinfrastructure.org', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'raw.githubusercontent.com', - port: '', - pathname: '/nodejs/**', - }, - { - protocol: 'https', - hostname: 'user-images.githubusercontent.com', - port: '', - pathname: '/**', - }, - { - protocol: 'https', - hostname: 'website-assets.oramasearch.com', - port: '', - pathname: '/**', - }, - ], - }, + images: getImagesConfig(), serverExternalPackages: ['twoslash'], outputFileTracingIncludes: { // Twoslash needs TypeScript declarations to function, and, by default, Next.js @@ -122,12 +73,72 @@ const nextConfig = { 'shiki', ], }, - // If we're building for the Cloudflare deployment we want to set - // an appropriate deploymentId (needed for skew protection) - deploymentId: OPEN_NEXT_CLOUDFLARE - ? (await import('@opennextjs/cloudflare')).getDeploymentId() - : undefined, + deploymentId: await getDeploymentId(), }; +function getImagesConfig() { + if (OPEN_NEXT_CLOUDFLARE) { + // If we're building for the Cloudflare deployment we want to use the custom cloudflare image loader + // + // Important: The custom loader ignores `remotePatterns` as those are configured as allowed source origins + // (https://developers.cloudflare.com/images/transform-images/sources/) + // in the Cloudflare dashboard itself instead (to the exact same values present in `remotePatterns` below). + // + return { + loader: 'custom', + loaderFile: './cloudflare-image-loader.ts', + }; + } + + return { + // We disable image optimisation during static export builds + unoptimized: ENABLE_STATIC_EXPORT, + // We add it to the remote pattern for the static images we use from multiple sources + // to be marked as safe sources (these come from Markdown files) + remotePatterns: [ + { + protocol: 'https', + hostname: 'avatars.githubusercontent.com', + port: '', + pathname: '/**', + }, + { + protocol: 'https', + hostname: 'bestpractices.coreinfrastructure.org', + port: '', + pathname: '/**', + }, + { + protocol: 'https', + hostname: 'raw.githubusercontent.com', + port: '', + pathname: '/nodejs/**', + }, + { + protocol: 'https', + hostname: 'user-images.githubusercontent.com', + port: '', + pathname: '/**', + }, + { + protocol: 'https', + hostname: 'website-assets.oramasearch.com', + port: '', + pathname: '/**', + }, + ], + }; +} + +async function getDeploymentId() { + if (OPEN_NEXT_CLOUDFLARE) { + // If we're building for the Cloudflare deployment we want to set + // an appropriate deploymentId (needed for skew protection) + return await import('@opennextjs/cloudflare').getDeploymentId(); + } + + return undefined; +} + const withNextIntl = createNextIntlPlugin('./i18n.tsx'); export default withNextIntl(nextConfig); From 57d3a4a1cdb6718c59577fa0f407425db066d968 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 13:02:51 +0000 Subject: [PATCH 09/13] update cloudflare-build-and-deployment --- docs/cloudflare-build-and-deployment.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/cloudflare-build-and-deployment.md b/docs/cloudflare-build-and-deployment.md index 61ff12fb06c3b..f614b6c65e0ed 100644 --- a/docs/cloudflare-build-and-deployment.md +++ b/docs/cloudflare-build-and-deployment.md @@ -19,8 +19,9 @@ Key configurations include: - This is currently set to `fb4a2d0f103c6ff38854ac69eb709272`, which is the ID of a Cloudflare account controlled by Node.js, and used for testing. - `build`: Defines the build command to generate the Node.js filesystem polyfills required for the application to run on Cloudflare Workers. This uses the [`@flarelabs/wrangler-build-time-fs-assets-polyfilling`](https://github.com/flarelabs-net/wrangler-build-time-fs-assets-polyfilling) package. - `alias`: Maps aliases for the Node.js filesystem polyfills generated during the build process. -- `kv_namespaces`: Contains a single KV binding definition for `NEXT_INC_CACHE_KV`. This is used to implement the Next.js incremental cache. - - This is currently set up to a KV in the aforementioned Cloudflare testing account. +- `r2_buckets`: Contains a single R2 binding definition for `NEXT_INC_CACHE_R2_BUCKET`. This is used to implement the Next.js incremental cache. + - This is currently set up to a R2 bucket in the aforementioned Cloudflare testing account. +- `durable_objects`: Contains a single DurableObject binding definition for `NEXT_CACHE_DO_QUEUE`. This is used to implement the Open-next cache queue. ### OpenNext Configuration From 277143b4fd80113fb85221a3400f3ce0deefa4a0 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 13:15:19 +0000 Subject: [PATCH 10/13] move image-loader file inside cloudflare directory --- .../{cloudflare-image-loader.ts => cloudflare/image-loader.ts} | 0 apps/site/next.config.mjs | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) rename apps/site/{cloudflare-image-loader.ts => cloudflare/image-loader.ts} (100%) diff --git a/apps/site/cloudflare-image-loader.ts b/apps/site/cloudflare/image-loader.ts similarity index 100% rename from apps/site/cloudflare-image-loader.ts rename to apps/site/cloudflare/image-loader.ts diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index e8828342afcb3..69d157a0562bc 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -86,7 +86,7 @@ function getImagesConfig() { // return { loader: 'custom', - loaderFile: './cloudflare-image-loader.ts', + loaderFile: './cloudflare/image-loader.ts', }; } From 7e6aca390f4a276779a79c3f76d3f4f4455aebbd Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 14:50:06 +0000 Subject: [PATCH 11/13] add missing parenthesis --- apps/site/next.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/site/next.config.mjs b/apps/site/next.config.mjs index 69d157a0562bc..32033f19f936d 100644 --- a/apps/site/next.config.mjs +++ b/apps/site/next.config.mjs @@ -134,7 +134,7 @@ async function getDeploymentId() { if (OPEN_NEXT_CLOUDFLARE) { // If we're building for the Cloudflare deployment we want to set // an appropriate deploymentId (needed for skew protection) - return await import('@opennextjs/cloudflare').getDeploymentId(); + return (await import('@opennextjs/cloudflare')).getDeploymentId(); } return undefined; From 95b437c80a28e73253602115a52fc2f0595d0829 Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 15:58:50 +0000 Subject: [PATCH 12/13] add env variables for R2 cache batch uploads --- .github/workflows/tmp-cloudflare-open-next-deploy.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/tmp-cloudflare-open-next-deploy.yml b/.github/workflows/tmp-cloudflare-open-next-deploy.yml index 73e35b99c522b..4eaea12b33097 100644 --- a/.github/workflows/tmp-cloudflare-open-next-deploy.yml +++ b/.github/workflows/tmp-cloudflare-open-next-deploy.yml @@ -64,3 +64,8 @@ jobs: env: CF_WORKERS_SCRIPTS_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} + CLOUDFLARE_ACCOUNT_ID: fb4a2d0f103c6ff38854ac69eb709272 + # Note the R2_* env variables below are useful for speeding up the assets upload + # process, see: https://opennext.js.org/cloudflare/cli#populatecache-command + R2_ACCESS_KEY_ID: ${{ env.R2_ACCESS_KEY_ID }} + R2_SECRET_ACCESS_KEY`: ${{ secrets.R2_SECRET_ACCESS_KEY }} From ecc8a53933d9d320c9eb9cd6993678113354f04e Mon Sep 17 00:00:00 2001 From: Dario Piotrowicz Date: Tue, 4 Nov 2025 16:03:35 +0000 Subject: [PATCH 13/13] remove extra backtick --- .github/workflows/tmp-cloudflare-open-next-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tmp-cloudflare-open-next-deploy.yml b/.github/workflows/tmp-cloudflare-open-next-deploy.yml index 4eaea12b33097..0a6d7072c2a6a 100644 --- a/.github/workflows/tmp-cloudflare-open-next-deploy.yml +++ b/.github/workflows/tmp-cloudflare-open-next-deploy.yml @@ -68,4 +68,4 @@ jobs: # Note the R2_* env variables below are useful for speeding up the assets upload # process, see: https://opennext.js.org/cloudflare/cli#populatecache-command R2_ACCESS_KEY_ID: ${{ env.R2_ACCESS_KEY_ID }} - R2_SECRET_ACCESS_KEY`: ${{ secrets.R2_SECRET_ACCESS_KEY }} + R2_SECRET_ACCESS_KEY: ${{ secrets.R2_SECRET_ACCESS_KEY }}