From 0e4d1cb5f9a3645f6da480b2b8540568fa69d675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 27 Mar 2024 17:51:52 +0000 Subject: feat(init): use jsr specifier for @std/assert (#23073) This commit changes "deno init" subcommand to use "jsr:" specifier for standard library "assert" module. It is unversioned, but we will change it to `@^1` once `@std/assert` release version 1.0. This allows us to start decoupling `deno` and `deno_std` release. The release scripts have been updated to take that into account. --- cli/deno_std.rs | 5 ----- cli/main.rs | 1 - cli/tools/init/mod.rs | 9 +++++---- cli/tools/init/templates/main_test.ts | 2 +- 4 files changed, 6 insertions(+), 11 deletions(-) delete mode 100644 cli/deno_std.rs (limited to 'cli') diff --git a/cli/deno_std.rs b/cli/deno_std.rs deleted file mode 100644 index cef67711d..000000000 --- a/cli/deno_std.rs +++ /dev/null @@ -1,5 +0,0 @@ -// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. - -// WARNING: Ensure this is the only deno_std version reference as this -// is automatically updated by the version bump workflow. -pub const CURRENT_STD_URL_STR: &str = "https://deno.land/std@0.220.0/"; diff --git a/cli/main.rs b/cli/main.rs index 32e40ff51..ecf171e72 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -4,7 +4,6 @@ mod args; mod auth_tokens; mod cache; mod cdp; -mod deno_std; mod emit; mod errors; mod factory; diff --git a/cli/tools/init/mod.rs b/cli/tools/init/mod.rs index 7222a762f..fb2e6e7af 100644 --- a/cli/tools/init/mod.rs +++ b/cli/tools/init/mod.rs @@ -2,7 +2,6 @@ use crate::args::InitFlags; use crate::colors; -use crate::deno_std; use deno_core::anyhow::Context; use deno_core::error::AnyError; use log::info; @@ -46,9 +45,11 @@ pub fn init_project(init_flags: InitFlags) -> Result<(), AnyError> { let main_ts = include_str!("./templates/main.ts"); create_file(&dir, "main.ts", main_ts)?; - let main_test_ts = include_str!("./templates/main_test.ts") - .replace("{CURRENT_STD_URL}", deno_std::CURRENT_STD_URL_STR); - create_file(&dir, "main_test.ts", &main_test_ts)?; + create_file( + &dir, + "main_test.ts", + include_str!("./templates/main_test.ts"), + )?; create_file(&dir, "deno.json", include_str!("./templates/deno.json"))?; info!("✅ {}", colors::green("Project initialized")); diff --git a/cli/tools/init/templates/main_test.ts b/cli/tools/init/templates/main_test.ts index 505b1abb0..26af2582b 100644 --- a/cli/tools/init/templates/main_test.ts +++ b/cli/tools/init/templates/main_test.ts @@ -1,4 +1,4 @@ -import { assertEquals } from "{CURRENT_STD_URL}assert/mod.ts"; +import { assertEquals } from "jsr:@std/assert"; import { add } from "./main.ts"; Deno.test(function addTest() { -- cgit v1.2.3