From 21c2252af6b0a9f030b9b8b8bbf13aab5c1e995c Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Mon, 2 Dec 2024 17:14:27 +0100 Subject: [PATCH 1/2] feat(task): support optional command (#144) Make the task's `command` property optional. There are valid reasons to have a task that has no command, but task dependencies. This is often used to group tasks. See https://github.com/denoland/deno/issues/27165 --- src/deno_json/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/deno_json/mod.rs b/src/deno_json/mod.rs index 09b6379..63891e1 100644 --- a/src/deno_json/mod.rs +++ b/src/deno_json/mod.rs @@ -451,7 +451,7 @@ pub struct PatchConfigParseError(#[source] serde_json::Error); #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] pub struct TaskDefinition { - pub command: String, + pub command: Option, #[serde(default)] pub dependencies: Vec, #[serde(default)] @@ -462,7 +462,7 @@ pub struct TaskDefinition { impl From<&str> for TaskDefinition { fn from(value: &str) -> Self { Self { - command: value.to_string(), + command: Some(value.to_string()), dependencies: vec![], description: None, } @@ -499,7 +499,7 @@ impl TaskDefinition { { let task_def = match value { serde_json::Value::String(command) => TaskDefinition { - command, + command: Some(command), dependencies: Vec::new(), description: None, }, @@ -1734,7 +1734,7 @@ mod tests { tasks_config["client"], TaskDefinition { description: Some("Build client project".to_string()), - command: "deno run -A client.js".to_string(), + command: Some("deno run -A client.js".to_string()), dependencies: vec!["build".to_string()] } ); From bf8ca4315b9f1f5de4aa1706f550ec6030048900 Mon Sep 17 00:00:00 2001 From: denobot Date: Mon, 2 Dec 2024 16:18:03 +0000 Subject: [PATCH 2/2] 0.40.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4855660..525d465 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,7 +72,7 @@ checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "deno_config" -version = "0.39.3" +version = "0.40.0" dependencies = [ "anyhow", "deno_package_json", diff --git a/Cargo.toml b/Cargo.toml index 5e2f77f..9735c68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "deno_config" description = "Config file implementation for the Deno CLI" -version = "0.39.3" +version = "0.40.0" edition = "2021" authors = ["the Deno authors"] license = "MIT"