diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-05-27 10:33:15 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-27 10:33:15 -0400 |
commit | a96844118c24d870abfe5332547dab99dc53d09c (patch) | |
tree | 194bde1661ad66e41efc912ccbb151edf268c643 /cli/tests/testdata | |
parent | be59e93220e24a2e66ae2843a136e61eab9d8ac3 (diff) |
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).
Diffstat (limited to 'cli/tests/testdata')
4 files changed, 16 insertions, 0 deletions
diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main.out b/cli/tests/testdata/compile/node_modules_symlink_outside/main.out new file mode 100644 index 000000000..61c83cba4 --- /dev/null +++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main.out @@ -0,0 +1,2 @@ +4 +5 diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main.ts b/cli/tests/testdata/compile/node_modules_symlink_outside/main.ts new file mode 100644 index 000000000..45f681f7c --- /dev/null +++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main.ts @@ -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")); diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out new file mode 100644 index 000000000..7602a4002 --- /dev/null +++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_file.out @@ -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. diff --git a/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out new file mode 100644 index 000000000..883a3f262 --- /dev/null +++ b/cli/tests/testdata/compile/node_modules_symlink_outside/main_compile_folder.out @@ -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'. |