diff options
| author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-03 20:54:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-04 00:54:33 +0000 |
| commit | 147411e64b22fe74cb258125acab83f9182c9f81 (patch) | |
| tree | a1f63dcbf0404c20534986b10f02b649df5a3ad5 /tests/specs/run/no_deno_json | |
| parent | dd6d19e12051fac2ea5639f621501f4710a1b8e1 (diff) | |
feat: npm workspace and better Deno workspace support (#24334)
Adds much better support for the unstable Deno workspaces as well as
support for npm workspaces. npm workspaces is still lacking in that we
only install packages into the root node_modules folder. We'll make it
smarter over time in order for it to figure out when to add node_modules
folders within packages.
This includes a breaking change in config file resolution where we stop
searching for config files on the first found package.json unless it's
in a workspace. For the previous behaviour, the root deno.json needs to
be updated to be a workspace by adding `"workspace":
["./path-to-pkg-json-folder-goes-here"]`. See details in
https://github.com/denoland/deno_config/pull/66
Closes #24340
Closes #24159
Closes #24161
Closes #22020
Closes #18546
Closes #16106
Closes #24160
Diffstat (limited to 'tests/specs/run/no_deno_json')
| -rw-r--r-- | tests/specs/run/no_deno_json/__test__.jsonc | 71 | ||||
| -rw-r--r-- | tests/specs/run/no_deno_json/no_package_json.out | 4 | ||||
| -rw-r--r-- | tests/specs/run/no_deno_json/noconfig.out | 1 |
3 files changed, 43 insertions, 33 deletions
diff --git a/tests/specs/run/no_deno_json/__test__.jsonc b/tests/specs/run/no_deno_json/__test__.jsonc index 67867f023..5da0209b9 100644 --- a/tests/specs/run/no_deno_json/__test__.jsonc +++ b/tests/specs/run/no_deno_json/__test__.jsonc @@ -1,36 +1,43 @@ { "tempDir": true, - "steps": [{ - // --no-config - "args": "run -L debug -A --no-config noconfig.ts", - "output": "noconfig.out", - "cwd": "code" - }, { - // --no-npm - "args": "run -L debug -A --no-npm noconfig.ts", - "output": "noconfig.out", - "cwd": "code" - }, { - // not auto-discovered with env var - "args": "run -L debug -A noconfig.ts", - "output": "noconfig.out", - "cwd": "code", - "envs": { - "DENO_NO_PACKAGE_JSON": "1" + "tests": { + "no_config": { + // --no-config + "args": "run -L debug -A --no-config noconfig.ts", + "output": "noconfig.out", + "cwd": "code" + }, + "no_npm": { + // --no-npm + "args": "run -L debug -A --no-npm noconfig.ts", + "output": "noconfig.out", + "cwd": "code" + }, + "no_pkg_json_env_var": { + // not auto-discovered with env var + "args": "run -L debug -A noconfig.ts", + "output": "no_package_json.out", + "cwd": "code", + "envs": { + "DENO_NO_PACKAGE_JSON": "1" + } + }, + "no_pkg_json_imports": { + // this should not use --quiet because we should ensure no package.json install occurs + "args": "run -A no_package_json_imports.ts", + "output": "no_package_json_imports.out", + "cwd": "code" + }, + "auto_discovered": { + // auto-discovered node_modules relative package.json + "args": "run -A main.js", + "output": "code/sub_dir/main.out", + "cwd": "code/sub_dir" + }, + "auto_discovered_arg": { + // auto-discovered for local script arg + "args": "run -L debug -A code/main.ts", // notice this is not in the sub dir + "output": "main.out" } - }, { - // this should not use --quiet because we should ensure no package.json install occurs - "args": "run -A no_package_json_imports.ts", - "output": "no_package_json_imports.out", - "cwd": "code" - }, { - // auto-discovered node_modules relative package.json - "args": "run -A main.js", - "output": "code/sub_dir/main.out", - "cwd": "code/sub_dir" - }, { - // auto-discovered for local script arg - "args": "run -L debug -A code/main.ts", // notice this is not in the sub dir - "output": "main.out" - }] + } } diff --git a/tests/specs/run/no_deno_json/no_package_json.out b/tests/specs/run/no_deno_json/no_package_json.out new file mode 100644 index 000000000..b9f9a6dea --- /dev/null +++ b/tests/specs/run/no_deno_json/no_package_json.out @@ -0,0 +1,4 @@ +[WILDCARD]package.json auto-discovery is disabled +[WILDCARD] +success +[WILDCARD] diff --git a/tests/specs/run/no_deno_json/noconfig.out b/tests/specs/run/no_deno_json/noconfig.out index b9f9a6dea..000ce402b 100644 --- a/tests/specs/run/no_deno_json/noconfig.out +++ b/tests/specs/run/no_deno_json/noconfig.out @@ -1,4 +1,3 @@ -[WILDCARD]package.json auto-discovery is disabled [WILDCARD] success [WILDCARD] |
