From 9534e6e1131542653c4e266f712c4067af2c8ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 17 Nov 2023 02:28:38 +0100 Subject: feat(unstable): Workspaces support (#20410) This commit adds unstable workspace support. This is extremely bare-bones and minimal first-pass at this. With this change `deno.json` supports specifying `workspaces` key, that accepts a list of subdirectories. Each workspace can have its own import map. It's required to specify a `"name"` and `"version"` properties in the configuration file for the workspace: ```jsonc // deno.json { "workspaces": [ "a", "b" }, "imports": { "express": "npm:express@5" } } ``` ``` jsonc // a/deno.json { "name": "a", "version": "1.0.2", "imports": { "kleur": "npm:kleur" } } ``` ```jsonc // b/deno.json { "name": "b", "version": "0.51.0", "imports": { "chalk": "npm:chalk" } } ``` `--unstable-workspaces` flag is required to use this feature: ``` $ deno run --unstable-workspaces mod.ts ``` --------- Co-authored-by: David Sherret --- cli/tests/integration/run_tests.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'cli/tests/integration') diff --git a/cli/tests/integration/run_tests.rs b/cli/tests/integration/run_tests.rs index c24464eba..306d4df67 100644 --- a/cli/tests/integration/run_tests.rs +++ b/cli/tests/integration/run_tests.rs @@ -4759,3 +4759,32 @@ itest!(explicit_resource_management { args: "run --quiet --check run/explicit_resource_management/main.ts", output: "run/explicit_resource_management/main.out", }); + +itest!(workspaces_basic { + args: "run -L debug -A --unstable-workspaces main.ts", + output: "run/workspaces/basic/main.out", + cwd: Some("run/workspaces/basic/"), + copy_temp_dir: Some("run/workspaces/basic/"), + envs: env_vars_for_npm_tests(), + http_server: true, +}); + +itest!(workspaces_member_outside_root_dir { + args: "run -A --unstable-workspaces main.ts", + output: "run/workspaces/member_outside_root_dir/main.out", + cwd: Some("run/workspaces/member_outside_root_dir/"), + copy_temp_dir: Some("run/workspaces/member_outside_root_dir/"), + envs: env_vars_for_npm_tests(), + http_server: true, + exit_code: 1, +}); + +itest!(workspaces_nested_member { + args: "run -A --unstable-workspaces main.ts", + output: "run/workspaces/nested_member/main.out", + cwd: Some("run/workspaces/nested_member/"), + copy_temp_dir: Some("run/workspaces/nested_member/"), + envs: env_vars_for_npm_tests(), + http_server: true, + exit_code: 1, +}); -- cgit v1.2.3