Skip to content

Commit

Permalink
fix(install): cache type only module deps in deno install (#26497)
Browse files Browse the repository at this point in the history
Fixes #26180.
  • Loading branch information
nathanwhit authored Oct 23, 2024
1 parent 92ed4d3 commit 69e1d7a
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cli/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,9 @@ impl CliOptions {
match self.sub_command() {
DenoSubcommand::Cache(_) => GraphKind::All,
DenoSubcommand::Check(_) => GraphKind::TypesOnly,
DenoSubcommand::Install(InstallFlags {
kind: InstallKind::Local(_),
}) => GraphKind::All,
_ => self.type_check_mode().as_graph_kind(),
}
}
Expand Down
3 changes: 3 additions & 0 deletions tests/registry/jsr/@denotest/type-only-import/1.0.0/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface Foo {
bar: string;
}
3 changes: 3 additions & 0 deletions tests/registry/jsr/@denotest/type-only-import/1.0.0/mod.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { Foo } from "./foo.ts";

export const foo: Foo = { bar: "foo" };
5 changes: 5 additions & 0 deletions tests/registry/jsr/@denotest/type-only-import/1.0.0_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"exports": {
".": "./mod.ts"
}
}
5 changes: 5 additions & 0 deletions tests/registry/jsr/@denotest/type-only-import/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"versions": {
"1.0.0": {}
}
}
10 changes: 10 additions & 0 deletions tests/specs/install/type_only_import/__test__.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"tempDir": true,
"steps": [
{ "args": "install -e main.ts", "output": "install.out" },
{
"args": "run --check --cached-only main.ts",
"output": "run.out"
}
]
}
6 changes: 6 additions & 0 deletions tests/specs/install/type_only_import/install.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Download http://127.0.0.1:4250/@denotest/type-only-import/meta.json
Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0_meta.json
[UNORDERED_START]
Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0/mod.ts
Download http://127.0.0.1:4250/@denotest/type-only-import/1.0.0/foo.ts
[UNORDERED_END]
3 changes: 3 additions & 0 deletions tests/specs/install/type_only_import/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { foo } from "jsr:@denotest/type-only-import";

console.log(foo.bar);
2 changes: 2 additions & 0 deletions tests/specs/install/type_only_import/run.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Check [WILDCARD]main.ts
foo

0 comments on commit 69e1d7a

Please sign in to comment.