diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-07-14 13:22:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-14 13:22:43 -0400 |
commit | 8754a01d43782654c3d32945f6d58f7a40c01b69 (patch) | |
tree | 0a9efcd2e195a6194134b98373ddccdac9c8e991 /cli/tools/init/mod.rs | |
parent | e0cfc9da39e1d05e6a95c89c41cff8ae34fcbd66 (diff) |
fix(init): use bare specifier for `jsr:@std/assert` (#24581)
Closes #24580
Diffstat (limited to 'cli/tools/init/mod.rs')
-rw-r--r-- | cli/tools/init/mod.rs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/cli/tools/init/mod.rs b/cli/tools/init/mod.rs index b043ab2c4..bc83bfa2b 100644 --- a/cli/tools/init/mod.rs +++ b/cli/tools/init/mod.rs @@ -39,7 +39,7 @@ pub fn init_project(init_flags: InitFlags) -> Result<(), AnyError> { create_file( &dir, "mod_test.ts", - r#"import { assertEquals } from "jsr:@std/assert"; + r#"import { assertEquals } from "@std/assert"; import { add } from "./mod.ts"; Deno.test(function addTest() { @@ -53,11 +53,14 @@ Deno.test(function addTest() { "deno.json", &json!({ "name": project_name, - "version": "1.0.0", - "exports": "./mod.ts", + "version": "0.1.0", "tasks": { "dev": "deno test --watch mod.ts" - } + }, + "imports": { + "@std/assert": "jsr:@std/assert@1" + }, + "exports": "./mod.ts" }), )?; } else { @@ -77,7 +80,7 @@ if (import.meta.main) { create_file( &dir, "main_test.ts", - r#"import { assertEquals } from "jsr:@std/assert"; + r#"import { assertEquals } from "@std/assert"; import { add } from "./main.ts"; Deno.test(function addTest() { @@ -92,6 +95,9 @@ Deno.test(function addTest() { &json!({ "tasks": { "dev": "deno run --watch main.ts" + }, + "imports": { + "@std/assert": "jsr:@std/assert@1" } }), )?; |