chore: update references to deno_std to use JSR (#23239)

There are more uses of `deno.land/std` in the codebase, but for URL
parsing purposes rather than network calls or documentation.
This commit is contained in:
Asher Gomez 2024-04-11 07:26:35 +10:00 committed by Satya Rohith
parent b8ac027ff4
commit 0cc0cd0bbc
No known key found for this signature in database
GPG Key ID: B2705CF40523EB05
16 changed files with 104 additions and 93 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env -S deno run --allow-write=. --lock=./tools/deno.lock.json
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import * as yaml from "https://deno.land/std@0.173.0/encoding/yaml.ts";
import { stringify } from "jsr:@std/yaml@^0.221/stringify";
// Bump this number when you want to purge the cache.
// Note: the tools/release/01_bump_crate_versions.ts script will update this version
@ -1091,7 +1091,7 @@ const ci = {
export function generate() {
let finalText = `# GENERATED BY ./ci.generate.ts -- DO NOT DIRECTLY EDIT\n\n`;
finalText += yaml.stringify(ci, {
finalText += stringify(ci, {
noRefs: true,
lineWidth: 10_000,
noCompatMode: true,

View File

@ -79,8 +79,8 @@ Learn more about writing and running Deno programs
- **[Deno Docs](https://docs.deno.com)**: official guides and reference docs for
the Deno runtime, [Deno Deploy](https://deno.com/deploy), and beyond.
- **[Deno Standard Library](https://deno.land/std)**: officially supported
common utilities for Deno programs.
- **[Deno Standard Library](https://jsr.io/@std)**: officially supported common
utilities for Deno programs.
- **[deno.land/x](https://deno.land/x)**: registry for third-party Deno modules.
- **[Developer Blog](https://deno.com/blog)**: Product updates, tutorials, and
more from the Deno team.

View File

@ -985,7 +985,8 @@ Docs: https://deno.land/manual@v",
env!("CARGO_PKG_VERSION"),
color_print::cstr!(
"
Modules: https://deno.land/std/ https://deno.land/x/
Standard Library: https://jsr.io/@std
Modules: https://jsr.io/ https://deno.land/x/
Bugs: https://github.com/denoland/deno/issues
To start the REPL:
@ -1319,11 +1320,11 @@ Use an alternative bundler like \"deno_emit\", \"esbuild\" or \"rollup\" instead
Output a single JavaScript file with all dependencies.
deno bundle https://deno.land/std/http/file_server.ts file_server.bundle.js
deno bundle jsr:@std/http/file-server file_server.bundle.js
If no output file is given, the output is written to standard output:
deno bundle https://deno.land/std/http/file_server.ts",
deno bundle jsr:@std/http/file-server",
)
.defer(|cmd| {
compile_args(cmd)
@ -1351,7 +1352,7 @@ fn cache_subcommand() -> Command {
Download and compile a module with all of its static dependencies and save
them in the local cache, without running any code:
deno cache https://deno.land/std/http/file_server.ts
deno cache jsr:@std/http/file-server
Future runs of this module will trigger no downloads or compilation unless
--reload is specified.",
@ -1372,7 +1373,7 @@ fn check_subcommand() -> Command {
.long_about(
"Download and type-check without execution.
deno check https://deno.land/std/http/file_server.ts
deno check jsr:@std/http/file-server
Unless --reload is specified, this command will not re-download already cached dependencies.",
)
@ -1407,8 +1408,8 @@ fn compile_subcommand() -> Command {
.long_about(
"Compiles the given script into a self contained executable.
deno compile -A https://deno.land/std/http/file_server.ts
deno compile --output file_server https://deno.land/std/http/file_server.ts
deno compile -A jsr:@std/http/file-server
deno compile --output file_server jsr:@std/http/file-server
Any flags passed which affect runtime behavior, such as '--unstable',
'--allow-*', '--v8-flags', etc. are encoded into the output executable and
@ -1900,7 +1901,7 @@ fn info_subcommand() -> Command {
Get information about a module:
deno info https://deno.land/std/http/file_server.ts
deno info jsr:@std/http/file-server
The following information is shown:
@ -1949,12 +1950,12 @@ fn install_subcommand() -> Command {
.long_about(
"Installs a script as an executable in the installation root's bin directory.
deno install --global --allow-net --allow-read https://deno.land/std/http/file_server.ts
deno install --global --allow-net --allow-read jsr:@std/http/file-server
deno install -g https://examples.deno.land/color-logging.ts
To change the executable name, use -n/--name:
deno install -g --allow-net --allow-read -n serve https://deno.land/std/http/file_server.ts
deno install -g --allow-net --allow-read -n serve jsr:@std/http/file-server
The executable name is inferred by default:
- Attempt to take the file stem of the URL path. The above example would
@ -1966,7 +1967,7 @@ The executable name is inferred by default:
To change the installation root, use --root:
deno install -g --allow-net --allow-read --root /usr/local https://deno.land/std/http/file_server.ts
deno install -g --allow-net --allow-read --root /usr/local jsr:@std/http/file-server
The installation root is determined, in order of precedence:
- --root option
@ -2243,15 +2244,15 @@ ability to spawn subprocesses.
Grant all permissions:
deno run -A https://deno.land/std/http/file_server.ts
deno run -A jsr:@std/http/file-server
Grant permission to read from disk and listen to network:
deno run --allow-read --allow-net https://deno.land/std/http/file_server.ts
deno run --allow-read --allow-net jsr:@std/http/file-server
Grant permission to read allow-listed files from disk:
deno run --allow-read=/etc https://deno.land/std/http/file_server.ts
deno run --allow-read=/etc jsr:@std/http/file-server
Specifying the filename '-' to read the file from stdin.
@ -2506,7 +2507,7 @@ maps remote specifiers to the downloaded files.
Remote modules and multiple modules may also be specified:
deno vendor main.ts test.deps.ts https://deno.land/std/path/mod.ts",
deno vendor main.ts test.deps.ts jsr:@std/path",
)
.defer(|cmd| cmd
.arg(
@ -3059,9 +3060,9 @@ fn reload_arg() -> Arg {
"Reload source code cache (recompile TypeScript)
--reload
Reload everything
--reload=https://deno.land/std
--reload=jsr:@std/http/file-server
Reload only standard modules
--reload=https://deno.land/std/fs/utils.ts,https://deno.land/std/fmt/colors.ts
--reload=jsr:@std/http/file-server,jsr:@std/assert/assert-equals
Reloads specific modules
--reload=npm:
Reload all npm modules
@ -6772,18 +6773,15 @@ mod tests {
#[test]
fn install() {
let r = flags_from_vec(svec![
"deno",
"install",
"https://deno.land/std/http/file_server.ts"
]);
let r =
flags_from_vec(svec!["deno", "install", "jsr:@std/http/file-server"]);
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Install(InstallFlags {
kind: InstallKind::Global(InstallFlagsGlobal {
name: None,
module_url: "https://deno.land/std/http/file_server.ts".to_string(),
module_url: "jsr:@std/http/file-server".to_string(),
args: vec![],
root: None,
force: false,
@ -6798,7 +6796,7 @@ mod tests {
"deno",
"install",
"-g",
"https://deno.land/std/http/file_server.ts"
"jsr:@std/http/file-server"
]);
assert_eq!(
r.unwrap(),
@ -6806,7 +6804,7 @@ mod tests {
subcommand: DenoSubcommand::Install(InstallFlags {
kind: InstallKind::Global(InstallFlagsGlobal {
name: None,
module_url: "https://deno.land/std/http/file_server.ts".to_string(),
module_url: "jsr:@std/http/file-server".to_string(),
args: vec![],
root: None,
force: false,
@ -6821,14 +6819,14 @@ mod tests {
#[test]
fn install_with_flags() {
#[rustfmt::skip]
let r = flags_from_vec(svec!["deno", "install", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "--name", "file_server", "--root", "/foo", "--force", "--env=.example.env", "https://deno.land/std/http/file_server.ts", "foo", "bar"]);
let r = flags_from_vec(svec!["deno", "install", "--import-map", "import_map.json", "--no-remote", "--config", "tsconfig.json", "--no-check", "--unsafely-ignore-certificate-errors", "--reload", "--lock", "lock.json", "--lock-write", "--cert", "example.crt", "--cached-only", "--allow-read", "--allow-net", "--v8-flags=--help", "--seed", "1", "--inspect=127.0.0.1:9229", "--name", "file_server", "--root", "/foo", "--force", "--env=.example.env", "jsr:@std/http/file-server", "foo", "bar"]);
assert_eq!(
r.unwrap(),
Flags {
subcommand: DenoSubcommand::Install(InstallFlags {
kind: InstallKind::Global(InstallFlagsGlobal {
name: Some("file_server".to_string()),
module_url: "https://deno.land/std/http/file_server.ts".to_string(),
module_url: "jsr:@std/http/file-server".to_string(),
args: svec!["foo", "bar"],
root: Some("/foo".to_string()),
force: true,

View File

@ -194,8 +194,8 @@ pub enum CacheSetting {
/// This is the equivalent of `--reload` in the CLI.
ReloadAll,
/// Only some cached resources should be used. This is the equivalent of
/// `--reload=https://deno.land/std` or
/// `--reload=https://deno.land/std,https://deno.land/x/example`.
/// `--reload=jsr:@std/http/file-server` or
/// `--reload=jsr:@std/http/file-server,jsr:@std/assert/assert-equals`.
ReloadSome(Vec<String>),
/// The usability of a cached value is determined by analyzing the cached
/// headers and other metadata associated with a cached response, reloading

View File

@ -40,7 +40,7 @@ import { core, internals } from "ext:core/mod.js";
const $display = Symbol.for("Jupyter.display");
/** Escape copied from https://deno.land/std@0.192.0/html/entities.ts */
/** Escape copied from https://jsr.io/@std/html/0.221.0/entities.ts */
const rawToEntityEntries = [
["&", "&amp;"],
["<", "&lt;"],

View File

@ -574,7 +574,7 @@ declare namespace Deno {
* Examples:
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test({
* name: "inherit",
@ -589,7 +589,7 @@ declare namespace Deno {
* ```
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test({
* name: "true",
@ -604,7 +604,7 @@ declare namespace Deno {
* ```
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test({
* name: "false",
@ -619,7 +619,7 @@ declare namespace Deno {
* ```
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test({
* name: "localhost:8080",
@ -848,7 +848,7 @@ declare namespace Deno {
* `fn` can be async if required.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test({
* name: "example test",
@ -889,7 +889,7 @@ declare namespace Deno {
* `fn` can be async if required.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test({
* name: "example test",
@ -926,7 +926,7 @@ declare namespace Deno {
* `fn` can be async if required.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test("My test description", () => {
* assertEquals("hello", "hello");
@ -952,7 +952,7 @@ declare namespace Deno {
* `fn` can be async if required. Declared function must have a name.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test(function myTestName() {
* assertEquals("hello", "hello");
@ -975,7 +975,7 @@ declare namespace Deno {
* `fn` can be async if required.
*
* ```ts
* import {assert, fail, assertEquals} from "https://deno.land/std/assert/mod.ts";
* import { assert, fail, assertEquals } from "jsr:@std/assert";
*
* Deno.test("My test description", { permissions: { read: true } }, (): void => {
* assertEquals("hello", "hello");
@ -1002,7 +1002,7 @@ declare namespace Deno {
* `fn` can be async if required.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test(
* {
@ -1040,7 +1040,7 @@ declare namespace Deno {
* `fn` can be async if required. Declared function must have a name.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.test(
* { permissions: { read: true } },
@ -1263,7 +1263,7 @@ declare namespace Deno {
* will await resolution to consider the test complete.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.bench({
* name: "example test",
@ -1302,7 +1302,7 @@ declare namespace Deno {
* will await resolution to consider the test complete.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.bench("My test description", () => {
* assertEquals("hello", "hello");
@ -1330,7 +1330,7 @@ declare namespace Deno {
* will await resolution to consider the test complete.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.bench(function myTestName() {
* assertEquals("hello", "hello");
@ -1355,7 +1355,7 @@ declare namespace Deno {
* will await resolution to consider the test complete.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.bench(
* "My test description",
@ -1392,7 +1392,7 @@ declare namespace Deno {
* will await resolution to consider the test complete.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.bench(
* { name: "My test description", permissions: { read: true } },
@ -1426,7 +1426,7 @@ declare namespace Deno {
* will await resolution to consider the test complete.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/assert/mod.ts";
* import { assertEquals } from "jsr:@std/assert";
*
* Deno.bench(
* { permissions: { read: true } },
@ -1679,10 +1679,8 @@ declare namespace Deno {
* Implementations should not retain a reference to `p`.
*
* Use
* [`itereateReader`](https://deno.land/std/streams/iterate_reader.ts?s=iterateReader)
* from
* [`std/streams/iterate_reader.ts`](https://deno.land/std/streams/iterate_reader.ts)
* to turn a `Reader` into an {@linkcode AsyncIterator}.
* {@linkcode https://jsr.io/@std/io/doc/iterate-reader/~/iterateReader | iterateReader}
* to turn {@linkcode Reader} into an {@linkcode AsyncIterator}.
*/
read(p: Uint8Array): Promise<number | null>;
}
@ -1717,10 +1715,8 @@ declare namespace Deno {
* Implementations should not retain a reference to `p`.
*
* Use
* [`itereateReaderSync`](https://deno.land/std/streams/iterate_reader.ts?s=iterateReaderSync)
* from from
* [`std/streams/iterate_reader.ts`](https://deno.land/std/streams/iterate_reader.ts)
* to turn a `ReaderSync` into an {@linkcode Iterator}.
* {@linkcode https://jsr.io/@std/io/doc/iterate-reader/~/iterateReaderSync | iterateReaderSync}
* to turn {@linkcode ReaderSync} into an {@linkcode Iterator}.
*/
readSync(p: Uint8Array): number | null;
}
@ -1743,9 +1739,8 @@ declare namespace Deno {
* slice data, even temporarily.
*
* This function is one of the lowest
* level APIs and most users should not work with this directly, but rather use
* [`writeAll()`](https://deno.land/std/streams/write_all.ts?s=writeAll) from
* [`std/streams/write_all.ts`](https://deno.land/std/streams/write_all.ts)
* level APIs and most users should not work with this directly, but rather
* use {@linkcode https://jsr.io/@std/io/doc/write-all/~/writeAll | writeAll}
* instead.
*
* Implementations should not retain a reference to `p`.
@ -1978,7 +1973,7 @@ declare namespace Deno {
*
* This function is one of the lowest level APIs and most users should not
* work with this directly, but rather use {@linkcode ReadableStream} and
* {@linkcode https://deno.land/std/streams/mod.ts?s=toArrayBuffer|toArrayBuffer}
* {@linkcode https://jsr.io/@std/streams/doc/to-array-buffer/~/toArrayBuffer | toArrayBuffer}
* instead.
*
* **It is not guaranteed that the full buffer will be read in a single call.**
@ -2010,7 +2005,7 @@ declare namespace Deno {
*
* This function is one of the lowest level APIs and most users should not
* work with this directly, but rather use {@linkcode ReadableStream} and
* {@linkcode https://deno.land/std/streams/mod.ts?s=toArrayBuffer|toArrayBuffer}
* {@linkcode https://jsr.io/@std/streams/doc/to-array-buffer/~/toArrayBuffer | toArrayBuffer}
* instead.
*
* **It is not guaranteed that the full buffer will be read in a single
@ -2549,7 +2544,7 @@ declare namespace Deno {
/** Resolves to a {@linkcode Deno.FileInfo} for the file.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* using file = await Deno.open("hello.txt");
* const fileInfo = await file.stat();
@ -2560,7 +2555,7 @@ declare namespace Deno {
/** Synchronously returns a {@linkcode Deno.FileInfo} for the file.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* using file = Deno.openSync("hello.txt")
* const fileInfo = file.statSync();
@ -3809,7 +3804,7 @@ declare namespace Deno {
* of what it points to.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
* const fileInfo = await Deno.lstat("hello.txt");
* assert(fileInfo.isFile);
* ```
@ -3826,7 +3821,7 @@ declare namespace Deno {
* returned instead of what it points to.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
* const fileInfo = Deno.lstatSync("hello.txt");
* assert(fileInfo.isFile);
* ```
@ -3842,7 +3837,7 @@ declare namespace Deno {
* always follow symlinks.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
* const fileInfo = await Deno.stat("hello.txt");
* assert(fileInfo.isFile);
* ```
@ -3858,7 +3853,7 @@ declare namespace Deno {
* `path`. Will always follow symlinks.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
* const fileInfo = Deno.statSync("hello.txt");
* assert(fileInfo.isFile);
* ```
@ -5111,7 +5106,7 @@ declare namespace Deno {
/** Revokes a permission, and resolves to the state of the permission.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* const status = await Deno.permissions.revoke({ name: "run" });
* assert(status.state !== "granted")
@ -5122,7 +5117,7 @@ declare namespace Deno {
/** Revokes a permission, and returns the state of the permission.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* const status = Deno.permissions.revokeSync({ name: "run" });
* assert(status.state !== "granted")
@ -5200,14 +5195,14 @@ declare namespace Deno {
* ### Revoking
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* const status = await Deno.permissions.revoke({ name: "run" });
* assert(status.state !== "granted")
* ```
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* const status = Deno.permissions.revokeSync({ name: "run" });
* assert(status.state !== "granted")
@ -5313,9 +5308,9 @@ declare namespace Deno {
* [ "Sushi" ]
* ```
*
* If you are looking for a structured way to parse arguments, there is the
* [`std/flags`](https://deno.land/std/flags) module as part of the Deno
* standard library.
* If you are looking for a structured way to parse arguments, there is
* [`parseArgs()`](https://jsr.io/@std/cli/doc/parse-args/~/parseArgs) from
* the Deno Standard Library.
*
* @category Runtime Environment
*/
@ -5535,7 +5530,7 @@ declare namespace Deno {
* Returns a `Deno.FileInfo` for the given file stream.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* const file = await Deno.open("file.txt", { read: true });
* const fileInfo = await Deno.fstat(file.rid);
@ -5555,7 +5550,7 @@ declare namespace Deno {
* stream.
*
* ```ts
* import { assert } from "https://deno.land/std/assert/mod.ts";
* import { assert } from "jsr:@std/assert";
*
* const file = Deno.openSync("file.txt", { read: true });
* const fileInfo = Deno.fstatSync(file.rid);

View File

@ -40,7 +40,7 @@ async function copy(
internals.warnOnDeprecatedApi(
"Deno.copy()",
new Error().stack,
"Use `copy()` from `https://deno.land/std/io/copy.ts` instead.",
"Use `copy()` from `https://jsr.io/@std/io/doc/copy/~` instead.",
);
let n = 0;
const bufSize = options?.bufSize ?? DEFAULT_BUFFER_SIZE;

View File

@ -48,7 +48,7 @@ class Buffer {
internals.warnOnDeprecatedApi(
"new Deno.Buffer()",
new Error().stack,
"Use `Buffer` from `https://deno.land/std/io/buffer.ts` instead.",
"Use `Buffer` from `https://jsr.io/@std/io/doc/buffer/~` instead.",
);
if (ab == null) {
this.#buf = new Uint8Array(0);
@ -238,7 +238,7 @@ async function readAll(r) {
internals.warnOnDeprecatedApi(
"Deno.readAll()",
new Error().stack,
"Use `readAll()` from `https://deno.land/std/io/read_all.ts` instead.",
"Use `readAll()` from `https://jsr.io/@std/io/doc/read-all/~` instead.",
);
const buf = new Buffer();
await buf.readFrom(r);
@ -249,7 +249,7 @@ function readAllSync(r) {
internals.warnOnDeprecatedApi(
"Deno.readAllSync()",
new Error().stack,
"Use `readAllSync()` from `https://deno.land/std/io/read_all.ts` instead.",
"Use `readAllSync()` from `https://jsr.io/@std/io/doc/read-all/~` instead.",
);
const buf = new Buffer();
buf.readFromSync(r);
@ -260,7 +260,7 @@ async function writeAll(w, arr) {
internals.warnOnDeprecatedApi(
"Deno.writeAll()",
new Error().stack,
"Use `writeAll()` from `https://deno.land/std/io/write_all.ts` instead.",
"Use `writeAll()` from `https://jsr.io/@std/io/doc/write-all/~` instead.",
);
let nwritten = 0;
while (nwritten < arr.length) {
@ -272,7 +272,7 @@ function writeAllSync(w, arr) {
internals.warnOnDeprecatedApi(
"Deno.writeAllSync()",
new Error().stack,
"Use `writeAllSync()` from `https://deno.land/std/io/write_all.ts` instead.",
"Use `writeAllSync()` from `https://jsr.io/@std/io/doc/write-all/~` instead.",
);
let nwritten = 0;
while (nwritten < arr.length) {

View File

@ -215,7 +215,7 @@ fn reload_flag() {
#[test]
fn typecheck_declarations_ns() {
let context = TestContext::default();
let context = TestContextBuilder::for_jsr().build();
let args = vec![
"test".to_string(),
"--doc".to_string(),
@ -224,7 +224,12 @@ fn typecheck_declarations_ns() {
.to_string_lossy()
.into_owned(),
];
let output = context.new_command().args_vec(args).split_output().run();
let output = context
.new_command()
.args_vec(args)
.envs(util::env_vars_for_jsr_tests())
.split_output()
.run();
println!("stdout: {}", output.stdout());
println!("stderr: {}", output.stderr());

View File

@ -1400,7 +1400,7 @@ fn lsp_hover() {
"language": "typescript",
"value": "const Deno.args: string[]"
},
"Returns the script arguments to the program.\n\nGive the following command line invocation of Deno:\n\n```sh\ndeno run --allow-read https://examples.deno.land/command-line-arguments.ts Sushi\n```\n\nThen `Deno.args` will contain:\n\n```ts\n[ \"Sushi\" ]\n```\n\nIf you are looking for a structured way to parse arguments, there is the\n[`std/flags`](https://deno.land/std/flags) module as part of the Deno\nstandard library.",
"Returns the script arguments to the program.\n\nGive the following command line invocation of Deno:\n\n```sh\ndeno run --allow-read https://examples.deno.land/command-line-arguments.ts Sushi\n```\n\nThen `Deno.args` will contain:\n\n```ts\n[ \"Sushi\" ]\n```\n\nIf you are looking for a structured way to parse arguments, there is\n[`parseArgs()`](https://jsr.io/@std/cli/doc/parse-args/~/parseArgs) from\nthe Deno Standard Library.",
"\n\n*@category* - Runtime Environment",
],
"range": {

View File

@ -4,12 +4,12 @@ Deno.bench("noop2", { group: "noop", baseline: true }, () => {});
Deno.bench("noop3", { group: "url" }, () => {});
Deno.bench("parse url 2x", { group: "url", baseline: true }, () => {
new URL("https://deno.land/std/http/server.ts");
new URL("https://deno.land/std/http/server.ts");
new URL("https://jsr.io/@std/http/0.221.0/file_server.ts");
new URL("https://jsr.io/@std/http/0.221.0/file_server.ts");
});
Deno.bench("parse url 200x", { group: "url" }, () => {
for (let i = 0; i < 200; i++) {
new URL("https://deno.land/std/http/server.ts");
new URL("https://jsr.io/@std/http/0.221.0/file_server.ts");
}
});

View File

@ -0,0 +1,4 @@
// deno-lint-ignore-file
export function assert(expr: unknown) {
return true;
}

View File

@ -0,0 +1,5 @@
// deno-lint-ignore-file
export function fail() {
return true;
}

View File

@ -18,3 +18,5 @@
*/
export * from "./assert_equals.ts";
export * from "./assert.ts";
export * from "./fail.ts";

View File

@ -1,6 +1,8 @@
{
"exports": {
".": "./mod.ts",
"./assert_equals": "./assert_equals.ts"
"./assert": "./assert.ts",
"./assert-equals": "./assert-equals.ts",
"./fail": "./fail.ts"
}
}

View File

@ -1,4 +1,4 @@
import { ServerRequest } from "https://deno.land/std/http/server.ts";
import { ServerRequest } from "jsr:@std/http/server";
export default (req: ServerRequest) => {
req.respond({ body: `Hello, from Deno v${Deno.version.deno}!` });