@callstack/repack-dev-server 5.1.2 → 5.1.3

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/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.2",
5
+ "version": "5.1.3",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export declare function parseSourceFilename(filename: string, rootDir: string): string;
@@ -1,20 +0,0 @@
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
- }