1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

fix(install): cache type only module deps in deno install (#26497)

Fixes https://github.com/denoland/deno/issues/26180.
This commit is contained in:
Nathan Whitaker 2024-10-23 15:01:45 -07:00 committed by GitHub
parent 92ed4d38db
commit 69e1d7a4ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 40 additions and 0 deletions

View file

@ -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(),
}
}

View file

@ -0,0 +1,3 @@
export interface Foo {
bar: string;
}

View file

@ -0,0 +1,3 @@
import type { Foo } from "./foo.ts";
export const foo: Foo = { bar: "foo" };

View file

@ -0,0 +1,5 @@
{
"exports": {
".": "./mod.ts"
}
}

View file

@ -0,0 +1,5 @@
{
"versions": {
"1.0.0": {}
}
}

View file

@ -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"
}
]
}

View file

@ -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]

View file

@ -0,0 +1,3 @@
import { foo } from "jsr:@denotest/type-only-import";
console.log(foo.bar);

View file

@ -0,0 +1,2 @@
Check [WILDCARD]main.ts
foo