@callstack/repack-dev-server 5.1.1 → 5.1.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.
package/dist/createServer.js
CHANGED
|
@@ -76,11 +76,25 @@ export async function createServer(config) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
else {
|
|
79
|
-
instance.log.
|
|
79
|
+
instance.log.debug(message);
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
|
+
// we need to let `Network.loadNetworkResource` event pass
|
|
85
|
+
// through the InspectorProxy interceptor, otherwise it will
|
|
86
|
+
// prevent fetching source maps over the network for MF2 remotes
|
|
87
|
+
unstable_customInspectorMessageHandler: (connection) => {
|
|
88
|
+
return {
|
|
89
|
+
handleDeviceMessage: () => { },
|
|
90
|
+
handleDebuggerMessage: (msg) => {
|
|
91
|
+
if (msg.method === 'Network.loadNetworkResource') {
|
|
92
|
+
connection.device.sendMessage(msg);
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
},
|
|
84
98
|
unstable_experiments: {
|
|
85
99
|
// @ts-expect-error removed in 0.76, keep this for backkwards compatibility
|
|
86
100
|
enableNewDebugger: true,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseSourceFilename(filename: string, rootDir: string): string;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
export function parseSourceFilename(filename, rootDir) {
|
|
3
|
+
const prefix = filename.split('/')[0];
|
|
4
|
+
let filepath = filename;
|
|
5
|
+
// Handle [projectRoot] and [projectRoot^N] prefixes
|
|
6
|
+
const projectRootMatch = prefix.match(/^\[projectRoot(?:\^(\d+))?\]$/);
|
|
7
|
+
if (projectRootMatch) {
|
|
8
|
+
const upLevels = projectRootMatch[1];
|
|
9
|
+
if (upLevels) {
|
|
10
|
+
// For [projectRoot^N], go up N levels from rootDir
|
|
11
|
+
const upPath = '../'.repeat(Number(upLevels));
|
|
12
|
+
filepath = filepath.replace(`${prefix}/`, rootDir + '/' + upPath);
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
// For plain [projectRoot], just replace with rootDir
|
|
16
|
+
filepath = filepath.replace('[projectRoot]', rootDir);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return path.resolve(filepath);
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@callstack/repack-dev-server",
|
|
3
3
|
"description": "A bundler-agnostic development server for React Native applications as part of @callstack/repack.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "5.1.
|
|
5
|
+
"version": "5.1.2",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.js",
|
|
8
8
|
"types": "./dist/index.d.ts",
|