@opennextjs/cloudflare 1.20.0 → 1.20.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
  import path from "node:path";
3
3
  import { patchCode } from "@opennextjs/aws/build/patch/astCodePatcher.js";
4
4
  import { getCrossPlatformPathRegex } from "@opennextjs/aws/utils/regex.js";
5
+ import { normalizePath } from "../../../utils/normalize-path.js";
5
6
  const inlineChunksRule = `
6
7
  rule:
7
8
  kind: call_expression
@@ -230,6 +231,8 @@ export const patchTurbopackRuntime = {
230
231
  }),
231
232
  contentFilter: /loadRuntimeChunkPath/,
232
233
  patchCode: async ({ code, tracedFiles, filePath }) => {
234
+ tracedFiles = tracedFiles.map(normalizePath);
235
+ filePath = normalizePath(filePath);
233
236
  const mappings = discoverExternalModuleMappings(filePath);
234
237
  const externalImportRule = buildExternalImportRule(mappings, tracedFiles, code);
235
238
  let patched = patchCode(code, externalImportRule);
@@ -73,7 +73,10 @@ export async function getDeploymentMapping(buildOpts, config, workerEnvVars) {
73
73
  }
74
74
  const apiToken = envVars.CF_WORKERS_SCRIPTS_API_TOKEN;
75
75
  const accountId = envVars.CF_ACCOUNT_ID;
76
- const client = new Cloudflare({ apiToken });
76
+ const client = new Cloudflare({
77
+ apiToken,
78
+ defaultHeaders: { "Accept-Encoding": "identity" },
79
+ });
77
80
  const scriptName = envVars.CF_WORKER_NAME;
78
81
  const deployedVersions = await listWorkerVersions(scriptName, {
79
82
  client,
@@ -1,4 +1,3 @@
1
- import { posix, sep } from "node:path";
2
1
  export function normalizePath(path) {
3
- return path.replaceAll(sep, posix.sep);
2
+ return path.replaceAll("\\", "/");
4
3
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opennextjs/cloudflare",
3
3
  "description": "Cloudflare builder for next apps",
4
- "version": "1.20.0",
4
+ "version": "1.20.2",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "opennextjs-cloudflare": "dist/cli/index.js"
@@ -44,7 +44,7 @@
44
44
  "dependencies": {
45
45
  "@ast-grep/napi": "^0.40.5",
46
46
  "@dotenvx/dotenvx": "1.31.0",
47
- "@opennextjs/aws": "4.0.2",
47
+ "@opennextjs/aws": "4.1.0",
48
48
  "ci-info": "^4.2.0",
49
49
  "cloudflare": "^4.4.1",
50
50
  "comment-json": "^4.5.1",
@@ -70,7 +70,7 @@
70
70
  "eslint-plugin-unicorn": "^55.0.0",
71
71
  "globals": "^15.9.0",
72
72
  "mock-fs": "^5.4.1",
73
- "next": "^15.5.18",
73
+ "next": "^15.5.21",
74
74
  "picomatch": "^4.0.2",
75
75
  "rclone.js": "^0.6.6",
76
76
  "rimraf": "^6.0.1",
@@ -79,7 +79,7 @@
79
79
  "vitest": "^4.1.4"
80
80
  },
81
81
  "peerDependencies": {
82
- "next": ">=15.5.18 <16 || >=16.2.6",
82
+ "next": ">=15.5.21 <16 || >=16.2.11",
83
83
  "rclone.js": "^0.6.6",
84
84
  "wrangler": "^4.86.0"
85
85
  },