mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
fix(compile): inline symlinks as files outside node_modules dir and warn for directories (#19285)
If a symlink within the `node_modules` directory lies outside that directory, it will now warn and inline the file. For directories, it will just warn for now. Probably fixes #19251 (I'm still unable to reproduce).
This commit is contained in:
parent
be59e93220
commit
a96844118c
7 changed files with 229 additions and 39 deletions
2
cli/tests/testdata/compile/node_modules_symlink_outside/main.out
vendored
Normal file
2
cli/tests/testdata/compile/node_modules_symlink_outside/main.out
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
4
|
||||
5
|
6
cli/tests/testdata/compile/node_modules_symlink_outside/main.ts
vendored
Normal file
6
cli/tests/testdata/compile/node_modules_symlink_outside/main.ts
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
import { getValue, setValue } from "npm:@denotest/esm-basic";
|
||||
|
||||
setValue(4);
|
||||
|
||||
console.log(getValue());
|
||||
console.log(Deno.readTextFileSync("./node_modules/test.txt"));
|
2
cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out
vendored
Normal file
2
cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out
vendored
Normal file
|
@ -0,0 +1,2 @@
|
|||
Compile file:///[WILDCARD]/node_modules_symlink_outside/main.ts to [WILDCARD]
|
||||
Symlink target is outside '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules'. Inlining symlink at '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules[WILDCARD]test.txt' to '[WILDCARD]node_modules_symlink_outside[WILDCARD]test.txt' as file.
|
6
cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out
vendored
Normal file
6
cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
Download http://localhost:4545/npm/registry/@denotest/esm-basic
|
||||
Download http://localhost:4545/npm/registry/@denotest/esm-basic/1.0.0.tgz
|
||||
Initialize @denotest/esm-basic@1.0.0
|
||||
Check file:///[WILDCARD]/node_modules_symlink_outside/main.ts
|
||||
Compile file:///[WILDCARD]/node_modules_symlink_outside/main.ts to [WILDCARD]
|
||||
Symlink target is outside '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules'. Excluding symlink at '[WILDCARD]node_modules_symlink_outside[WILDCARD]node_modules[WILDCARD]some_folder' with target '[WILDCARD]node_modules_symlink_outside[WILDCARD]some_folder'.
|
Loading…
Add table
Add a link
Reference in a new issue