summaryrefslogtreecommitdiff
path: root/cli/args/flags.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-11-17 02:28:38 +0100
committerGitHub <noreply@github.com>2023-11-17 01:28:38 +0000
commit9534e6e1131542653c4e266f712c4067af2c8ec0 (patch)
tree1a74cccdcdb6bb12c10ab3e2a34d93fd8c4ccc55 /cli/args/flags.rs
parent544923afdc67e9946453901642746f37f22c8e24 (diff)
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 <dsherret@gmail.com>
Diffstat (limited to 'cli/args/flags.rs')
-rw-r--r--cli/args/flags.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/args/flags.rs b/cli/args/flags.rs
index 235743bda..6d1e41a19 100644
--- a/cli/args/flags.rs
+++ b/cli/args/flags.rs
@@ -431,6 +431,7 @@ pub struct Flags {
pub unstable: bool,
pub unstable_bare_node_builtins: bool,
pub unstable_byonm: bool,
+ pub unstable_workspaces: bool,
pub unstable_features: Vec<String>,
pub unsafely_ignore_certificate_errors: Option<Vec<String>>,
pub v8_flags: Vec<String>,
@@ -871,6 +872,7 @@ pub fn flags_from_vec(args: Vec<String>) -> clap::error::Result<Flags> {
flags.unstable_bare_node_builtins =
matches.get_flag("unstable-bare-node-builtins");
flags.unstable_byonm = matches.get_flag("unstable-byonm");
+ flags.unstable_workspaces = matches.get_flag("unstable-workspaces");
if matches.get_flag("quiet") {
flags.log_level = Some(Level::Error);
@@ -984,6 +986,15 @@ fn clap_root() -> Command {
.value_parser(FalseyValueParser::new())
.action(ArgAction::SetTrue)
.global(true),
+ )
+ .arg(
+ Arg::new("unstable-workspaces")
+ .long("unstable-workspaces")
+ .help("Enable unstable 'workspaces' feature")
+ .env("DENO_UNSTABLE_WORKSPACES")
+ .value_parser(FalseyValueParser::new())
+ .action(ArgAction::SetTrue)
+ .global(true),
);
for (flag_name, help, _) in crate::UNSTABLE_GRANULAR_FLAGS {