diff --git a/src/plugin_files.rs b/src/plugin_files.rs index 0f6dc05..8867162 100644 --- a/src/plugin_files.rs +++ b/src/plugin_files.rs @@ -83,6 +83,7 @@ fn deno_json(p: &Package) -> String { "version": "0.1.0", "license": "MIT", "exports": "./src/index.ts", + "nodeModulesDir": "auto", "imports": {{ "@green-tea/core": "npm:@green-tea/core@{CORE_VERSION}" }}, diff --git a/tests/plugin.rs b/tests/plugin.rs index 4dc36e8..e26c726 100644 --- a/tests/plugin.rs +++ b/tests/plugin.rs @@ -192,6 +192,9 @@ fn package_jsr_writes_the_tree_into_dir() { let deno = std::fs::read_to_string(pkg.join("deno.json")).unwrap(); assert!(deno.contains("\"name\": \"@acme/plugin-algo\""), "{deno}"); assert!(deno.contains("npm:@green-tea/core@26.9.0-beta.2"), "{deno}"); + // Without it `deno test` needs a `deno install` first, and then fails to + // type-check `node:assert` for want of @types/node. + assert!(deno.contains("\"nodeModulesDir\": \"auto\""), "{deno}"); let pj = std::fs::read_to_string(pkg.join("package.json")).unwrap(); assert!(pj.contains("\"private\": true"), "{pj}"); assert!(pj.contains("\"devDependencies\""), "{pj}");