Skip to content

Commit 5468174

Browse files
committed
Merge pull request #26 from surfly/dependabot/npm_and_yarn/tar-fs-3.1.0
Bump tar-fs from 3.0.8 to 3.1.0
2 parents dc50732 + 2d1ca46 commit 5468174

File tree

4 files changed

+9
-15
lines changed

4 files changed

+9
-15
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ jobs:
1717
- run: npm ci
1818
- run: npm run compile
1919
- run: npm run prepare:test
20-
- run: npm run test
20+
- run: npm run test:unit

lib/api/bundle/mappers/script.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ export const transpilerScripts = new Transpiler(async (code, _, loader, resolveD
5555
}, (args) => {
5656
const normalizedImportPath = normalize(join(args.resolveDir, args.path));
5757
const isSharedPath = (path) => {
58-
const sharedDirPath = join(SRC_PATH, "shared");
59-
return path.slice(0, sharedDirPath.length) === sharedDirPath;
58+
const rootPath = normalize(join(SRC_PATH, "shared"));
59+
return path.slice(0, rootPath.length) === rootPath;
6060
};
6161
if (isSharedPath(normalizedImportPath))
6262
return {
@@ -77,8 +77,6 @@ export const transpilerScripts = new Transpiler(async (code, _, loader, resolveD
7777
path: inferredPath
7878
};
7979
}
80-
if (normalizedImportPath.slice(0, args.resolveDir.length) !== args.resolveDir)
81-
throw new SyntaxError(`Absolute and relative imports from outer directories not allowed: ${args.resolveDir}: "${args.path}"`);
8280
return null;
8381
});
8482
}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/api/bundle/mappers/script.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,9 @@ export const transpilerScripts = new Transpiler(async (code: string, _, loader:
9393
const normalizedImportPath: string = normalize(join(args.resolveDir, args.path));
9494

9595
const isSharedPath = (path: string) => {
96-
const sharedDirPath = join(SRC_PATH, "shared");
97-
return path.slice(0, sharedDirPath.length) === sharedDirPath;
96+
const rootPath = normalize(join(SRC_PATH, "shared"));
97+
return path.slice(0, rootPath.length) === rootPath;
9898
};
99-
10099
if(isSharedPath(normalizedImportPath))
101100
return {
102101
path: normalizedImportPath
@@ -120,10 +119,7 @@ export const transpilerScripts = new Transpiler(async (code: string, _, loader:
120119
};
121120
}
122121

123-
if(normalizedImportPath.slice(0, args.resolveDir.length) !== args.resolveDir)
124-
throw new SyntaxError(
125-
`Absolute and relative imports from outer directories not allowed: ${args.resolveDir}: "${args.path}"`
126-
);
122+
// TODO: Constrain cross-target dir imports
127123

128124
return null;
129125
});

0 commit comments

Comments
 (0)