@module-federation/metro 0.0.0-codex-node24-dev-node20-compat-ci-20260713063237 → 0.0.0-codex-rspress-codeblock-transform-20260724100038

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.
@@ -1,3 +1,6 @@
1
+ // This file is injected as a self-contained Metro runtime module. Keep all
2
+ // runtime logic in this file and do not add imports.
3
+
1
4
  // join two paths
2
5
  // e.g. /a/b/ + /c/d -> /a/b/c/d
3
6
  function joinComponents(prefix: string, suffix: string) {
@@ -14,6 +17,13 @@ function isUrl(url: string) {
14
17
  return url.match(/^https?:\/\//);
15
18
  }
16
19
 
20
+ // normalize Windows separators and encode parent segments to prevent URL sanitization
21
+ // macOS: /../../node_modules -> /..%2F..%2Fnode_modules
22
+ // Windows: /..\..\node_modules -> /..%2F..%2Fnode_modules
23
+ function encodeBundlePath(bundlePath: string) {
24
+ return bundlePath.replaceAll('\\', '/').replaceAll('../', '..%2F');
25
+ }
26
+
17
27
  // get bundle id from the bundle path
18
28
  // e.g. /a/b.bundle?platform=ios -> a/b
19
29
  // e.g. http://host:8081/a/b.bundle -> a/b
@@ -99,8 +109,7 @@ function buildLoadBundleAsyncWrapper() {
99
109
  bundlePath = joinComponents(publicPath, bundlePath);
100
110
  }
101
111
 
102
- // ../../node_modules/ -> ..%2F..%2Fnode_modules/ so that it's not automatically sanitized
103
- const encodedBundlePath = bundlePath.replaceAll('../', '..%2F');
112
+ const encodedBundlePath = encodeBundlePath(bundlePath);
104
113
 
105
114
  let result;
106
115
  if (cacheHandler) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@module-federation/metro",
3
- "version": "0.0.0-codex-node24-dev-node20-compat-ci-20260713063237",
3
+ "version": "0.0.0-codex-rspress-codeblock-transform-20260724100038",
4
4
  "description": "Module Federation for Metro bundler",
5
5
  "keywords": [
6
6
  "module-federation",
@@ -57,9 +57,9 @@
57
57
  },
58
58
  "dependencies": {
59
59
  "@expo/metro-runtime": "^5.0.4",
60
- "@module-federation/runtime": "0.0.0-codex-node24-dev-node20-compat-ci-20260713063237",
61
- "@module-federation/sdk": "0.0.0-codex-node24-dev-node20-compat-ci-20260713063237",
62
- "@module-federation/dts-plugin": "0.0.0-codex-node24-dev-node20-compat-ci-20260713063237"
60
+ "@module-federation/dts-plugin": "0.0.0-codex-rspress-codeblock-transform-20260724100038",
61
+ "@module-federation/sdk": "0.0.0-codex-rspress-codeblock-transform-20260724100038",
62
+ "@module-federation/runtime": "0.0.0-codex-rspress-codeblock-transform-20260724100038"
63
63
  },
64
64
  "peerDependencies": {
65
65
  "@babel/types": "^7.25.0",
@@ -81,8 +81,8 @@
81
81
  },
82
82
  "devDependencies": {
83
83
  "@rslib/core": "^0.23.2",
84
- "@typescript-eslint/eslint-plugin": "8.54.0",
85
- "@typescript-eslint/parser": "8.54.0",
84
+ "@typescript-eslint/eslint-plugin": "8.56.1",
85
+ "@typescript-eslint/parser": "8.56.1",
86
86
  "@types/node": "^20.19.5",
87
87
  "@types/react": "^19.1.0",
88
88
  "memfs": "4.46.0",