fix(new): default runtime is node (framework is node-first)

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-07-12 13:13:02 -05:00
1 parent 3f86841d4b
commit 685c51b7e0
2 files changed
+20 -4

No files matched your search

+1 -1
View File
@@ -14,7 +14,7 @@ pub enum Command {
name: String,
#[arg(long)]
template_url: Option<String>,
#[arg(long, default_value = "deno", value_parser = ["node", "deno", "bun"])]
#[arg(long, default_value = "node", value_parser = ["node", "deno", "bun"])]
runtime: String,
},
/// Detect the runtime and run the project in watch mode
+19 -3
View File
@@ -17,15 +17,31 @@ fn new_scaffolds_into_named_dir() {
}
#[test]
fn new_default_runtime_is_deno() {
fn new_default_runtime_is_node() {
let d = tempdir().unwrap();
Command::cargo_bin("matcha")
.unwrap()
.current_dir(d.path())
.args(["new", "my-api"])
.args(["new", "demo"])
.assert()
.success();
let root = d.path().join("my-api");
let root = d.path().join("demo");
let pkg = std::fs::read_to_string(root.join("package.json")).unwrap();
assert!(pkg.contains("\"name\": \"demo\""));
assert!(root.join("tsconfig.json").exists());
assert!(!root.join("deno.json").exists());
}
#[test]
fn new_with_deno_runtime_produces_deno_json() {
let d = tempdir().unwrap();
Command::cargo_bin("matcha")
.unwrap()
.current_dir(d.path())
.args(["new", "demo-deno", "--runtime", "deno"])
.assert()
.success();
let root = d.path().join("demo-deno");
assert!(root.join("deno.json").exists());
assert!(!root.join("package.json").exists());
}