mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
feat(workspace): support object config (#24483)
This adds object config for the workspace config: ```json { "workspace": { "members": ["./member-1", "./member-2"] } } ``` This is a more verbose version of `"workspace": ["./member-1", "./member-2"]`. Although we don't need it at the moment, it makes the naming of `"workspace"` more clear and leaves the object open for more config in the future. Closes https://github.com/denoland/deno/issues/24456
This commit is contained in:
parent
3674f4536b
commit
e5c3c21e95
4 changed files with 26 additions and 9 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1307,9 +1307,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_config"
|
name = "deno_config"
|
||||||
version = "0.20.2"
|
version = "0.20.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "acd69b394ee336e02ac28cf412a543f9e83d79c8e6584a530940712fa6c01885"
|
checksum = "96119386ea33783e2a35a3f0c5a960f88edda53f34df9594c9bb8017dcae2367"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"deno_semver",
|
"deno_semver",
|
||||||
|
|
|
@ -101,7 +101,7 @@ console_static_text = "=0.8.1"
|
||||||
data-encoding = "2.3.3"
|
data-encoding = "2.3.3"
|
||||||
data-url = "=0.3.0"
|
data-url = "=0.3.0"
|
||||||
deno_cache_dir = "=0.10.0"
|
deno_cache_dir = "=0.10.0"
|
||||||
deno_config = { version = "=0.20.2", default-features = false }
|
deno_config = { version = "=0.20.4", default-features = false }
|
||||||
dlopen2 = "0.6.1"
|
dlopen2 = "0.6.1"
|
||||||
ecb = "=0.1.2"
|
ecb = "=0.1.2"
|
||||||
elliptic-curve = { version = "0.13.4", features = ["alloc", "arithmetic", "ecdh", "std", "pem"] }
|
elliptic-curve = { version = "0.13.4", features = ["alloc", "arithmetic", "ecdh", "std", "pem"] }
|
||||||
|
|
|
@ -1534,11 +1534,12 @@ impl ConfigData {
|
||||||
|
|
||||||
let workspace = config_file
|
let workspace = config_file
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.and_then(|c| c.json.workspace.as_ref().map(|w| (c, w)));
|
.and_then(|c| c.to_workspace_config().ok().flatten().map(|w| (c, w)));
|
||||||
let is_workspace_root = workspace.is_some();
|
let is_workspace_root = workspace.is_some();
|
||||||
let workspace_members = if let Some((config, workspace)) = workspace {
|
let workspace_members = if let Some((config, workspace)) = workspace {
|
||||||
Arc::new(
|
Arc::new(
|
||||||
workspace
|
workspace
|
||||||
|
.members
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|p| {
|
.flat_map(|p| {
|
||||||
let dir_specifier = config.specifier.join(p).ok()?;
|
let dir_specifier = config.specifier.join(p).ok()?;
|
||||||
|
|
|
@ -605,11 +605,27 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"workspace": {
|
"workspace": {
|
||||||
"type": "array",
|
"oneOf": [
|
||||||
"items": {
|
{
|
||||||
"type": "string"
|
"type": "array",
|
||||||
},
|
"items": {
|
||||||
"description": "The members of this workspace."
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": "The members of this workspace."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"members": {
|
||||||
|
"type": "array",
|
||||||
|
"items": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"description": "The members of this workspace."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue