From 3114421eac584a21ab974e10728b0b131b498e5e Mon Sep 17 00:00:00 2001 From: mattvr <4052466+mattvr@users.noreply.github.com> Date: Fri, 26 Jul 2024 00:51:07 -1000 Subject: [PATCH] update deno.land/std usage to jsr.io/@std (#587) Co-authored-by: Luca Casonato Co-authored-by: Luca Casonato --- .github/workflows/update_versions.ts | 11 -- README.md | 18 -- _components/Footer.tsx | 2 +- by-example/byte-manipulation.ts | 2 +- by-example/command-line-arguments.ts | 4 +- by-example/create-remove-directories.ts | 4 +- by-example/cron.ts | 2 +- by-example/deleting-files.ts | 2 +- by-example/deno-version.ts | 2 +- by-example/dns-queries.ts | 2 +- by-example/environment-variables.ts | 2 +- by-example/hashing.ts | 2 +- by-example/http-server-files.ts | 4 +- by-example/http-server.ts | 2 +- by-example/import-export.ts | 11 +- by-example/kv-watch.ts | 2 +- by-example/kv.ts | 2 +- by-example/moving-renaming-files.ts | 2 +- by-example/os-signals.ts | 2 +- by-example/path-operations.ts | 4 +- by-example/permissions.ts | 4 +- by-example/queues.ts | 2 +- by-example/reading-files.ts | 6 +- by-example/streaming-files.ts | 4 +- by-example/subprocesses-output.ts | 2 +- by-example/subprocesses-spawn.ts | 2 +- by-example/symlinks.ts | 4 +- by-example/tcp-connector.ts | 2 +- by-example/tcp-listener.ts | 2 +- by-example/temporary-files.ts | 4 +- by-example/tls-connector.ts | 2 +- by-example/tls-listener.ts | 2 +- by-example/udp-connector.ts | 2 +- by-example/udp-listener.ts | 2 +- by-example/ulid.ts | 4 +- by-example/url-parsing.ts | 2 +- by-example/uuids.ts | 2 +- by-example/walking-directories.ts | 4 +- by-example/watching-files.ts | 4 +- by-example/writing-files.ts | 6 +- by-example/writing-tests.ts | 4 +- deno.lock | 135 +++++++++++++- deploy/api/index.md | 44 ++--- deploy/api/runtime-fs.md | 36 ++-- deploy/api/runtime-sockets.md | 6 +- deploy/kv/manual/cron.md | 8 +- deploy/kv/manual/data_modeling_typescript.md | 2 +- deploy/kv/manual/index.md | 25 ++- deploy/kv/manual/operations.md | 15 +- deploy/kv/manual/queue_overview.md | 34 ++-- deploy/kv/tutorials/webhook_processor.md | 4 +- deploy/manual/ci_github.md | 2 +- deploy/manual/pricing-and-limits.md | 10 +- deploy/tutorials/static-site.md | 2 +- deploy/tutorials/tutorial-http-server.md | 6 +- deploy/tutorials/vite.md | 13 +- examples.page.tsx | 5 +- replacements.json | 3 +- .../manual/advanced/continuous_integration.md | 4 +- runtime/manual/advanced/jsx_dom/css.md | 2 +- runtime/manual/advanced/jsx_dom/deno_dom.md | 4 +- runtime/manual/advanced/jsx_dom/jsdom.md | 21 +-- runtime/manual/advanced/jsx_dom/linkedom.md | 17 +- .../manual/advanced/migrate_deprecations.md | 87 +++++---- runtime/manual/basics/debugging_your_code.md | 8 +- runtime/manual/basics/env_variables.md | 2 +- .../manual/basics/modules/module_metadata.md | 27 +-- .../basics/modules/reloading_modules.md | 13 +- runtime/manual/basics/permissions.md | 2 +- runtime/manual/basics/testing/assertions.md | 29 ++- .../testing/behavior_driven_development.md | 72 ++++--- runtime/manual/basics/testing/index.md | 12 +- runtime/manual/basics/testing/mocking.md | 94 ++++------ .../manual/basics/testing/snapshot_testing.md | 35 +--- runtime/manual/getting_started/first_steps.md | 6 +- runtime/manual/node/_category_.json | 8 - runtime/manual/node/how_to_with_npm/prisma.md | 15 +- runtime/manual/references/_category_.json | 8 - .../references/contributing/architecture.md | 18 +- .../manual/references/contributing/index.md | 10 +- .../references/contributing/style_guide.md | 14 +- runtime/manual/references/index.md | 4 +- .../manual/references/vscode_deno/index.md | 2 +- runtime/manual/runtime/builtin_apis.md | 79 ++++---- runtime/manual/runtime/http_server_apis.md | 8 +- runtime/manual/runtime/index.md | 14 +- runtime/manual/runtime/permission_apis.md | 4 +- runtime/manual/runtime/stability.md | 47 ++--- runtime/manual/runtime/web_platform_apis.md | 10 +- runtime/manual/runtime/workers.md | 2 +- runtime/manual/tools/benchmarker.md | 4 +- runtime/manual/tools/bundler.md | 8 +- runtime/manual/tools/cache.md | 4 +- runtime/manual/tools/check.md | 75 +------- runtime/manual/tools/compiler.md | 6 +- runtime/manual/tools/dependency_inspector.md | 176 +++++++++--------- runtime/manual/tools/repl.md | 35 ++-- runtime/manual/tools/script_installer.md | 2 + runtime/manual/tools/unstable_flags.md | 14 +- runtime/tutorials/fetch_data.md | 9 +- runtime/tutorials/file_server.md | 20 +- runtime/tutorials/file_system_events.md | 4 +- runtime/tutorials/hashbang.md | 2 +- runtime/tutorials/how_to_with_npm/prisma.md | 15 +- runtime/tutorials/module_metadata.md | 27 +-- runtime/tutorials/os_signals.md | 6 +- runtime/tutorials/read_write_files.md | 15 +- runtime/tutorials/subprocess.md | 10 +- runtime/tutorials/tcp_echo.md | 10 +- runtime/tutorials/tcp_server.md | 2 +- runtime/tutorials/unix_cat.md | 20 +- static/examples/local.ts | 1 + 112 files changed, 792 insertions(+), 849 deletions(-) delete mode 100644 runtime/manual/node/_category_.json delete mode 100644 runtime/manual/references/_category_.json create mode 100644 static/examples/local.ts diff --git a/.github/workflows/update_versions.ts b/.github/workflows/update_versions.ts index 71d9e82e4..08bd82099 100644 --- a/.github/workflows/update_versions.ts +++ b/.github/workflows/update_versions.ts @@ -13,15 +13,12 @@ interface ReplacementsData { const replacementsFile = $.path("replacements.json"); const latestCliVersion = (await getLatestTagForRepo("deno")).replace("v", ""); -const latestStdVersion = await getLatestStdVersion(); $.log(`cli version: ${latestCliVersion}`); -$.log(`std version: ${latestStdVersion}`); const replacements = replacementsFile.readJsonSync(); replacements.CLI_VERSION = latestCliVersion; -replacements.STD_VERSION = latestStdVersion; replacementsFile.writeJsonPrettySync(replacements); @@ -39,14 +36,6 @@ async function getLatestTagForRepo(name: string) { return latestRelease.tag_name; } -async function getLatestStdVersion() { - $.logStep(`Fetching latest version number of std`); - const latestRelease = await $.request(`https://deno.com/versions.json`).json< - { std: string[] } - >(); - return latestRelease.std[0]; -} - async function tryCreatePr() { // check for local changes await $`git add .`; diff --git a/README.md b/README.md index 8f7580c7b..273d8a6fb 100644 --- a/README.md +++ b/README.md @@ -84,24 +84,6 @@ a feature or API was released in. For example - in the Node 20 docs, the [register function](https://nodejs.org/dist/latest-v20.x/docs/api/module.html#moduleregister) is marked as being added in version `20.6.0`. -## Including version numbers in code and content - -It may occasionally be desirable to dynamically include the current Deno CLI or -standard library version in content or code samples. We can accomplish this -using the `replacements.json` file at the root of this repository. - -Any values you would like to change once, and then have appear dynamically in a -number of generated files, should be included in `replacements.json`. - -In code samples (fenced with backticks), you can include a `$` character, -followed by the replacement variable name, directly within the code sample. When -the markdown is transformed, the current version number will be replaced within -it. - -```ts -import { copy } from "https://deno.land/std@$STD_VERSION/fs/copy.ts"; -``` - ## Contribution We are very grateful for any help you can offer to improve Deno's documentation! diff --git a/_components/Footer.tsx b/_components/Footer.tsx index 0111027a7..4e9a0da4c 100644 --- a/_components/Footer.tsx +++ b/_components/Footer.tsx @@ -33,7 +33,7 @@ const data = [ }, { label: "Standard Library", - href: "https://deno.land/std", + href: "https://jsr.io/@std", }, ], }, diff --git a/by-example/byte-manipulation.ts b/by-example/byte-manipulation.ts index f19dbcfe6..6dadde139 100644 --- a/by-example/byte-manipulation.ts +++ b/by-example/byte-manipulation.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli * @run - * @resource {$std/bytes} Doc: std/bytes + * @resource {https://jsr.io/@std/bytes/doc} Doc: @std/bytes * @group Encoding * * When working with lower-level data we often deal diff --git a/by-example/command-line-arguments.ts b/by-example/command-line-arguments.ts index a2ff0c360..6d38bdc10 100644 --- a/by-example/command-line-arguments.ts +++ b/by-example/command-line-arguments.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run Deno Sushi --help --version=1.0.0 --no-color - * @resource {https://deno.land/api?s=Deno.args} Doc: Deno.args - * @resource {$std/cli/parse_args.ts} Doc: std/cli + * @resource {https://docs.deno.com/api/deno/~/Deno.args} Doc: Deno.args + * @resource {https://jsr.io/@std/cli/doc/parse-args/~} Doc: @std/cli * @group CLI * * Command line arguments are often used to pass configuration options to a diff --git a/by-example/create-remove-directories.ts b/by-example/create-remove-directories.ts index 9b3118ef4..7973775d3 100644 --- a/by-example/create-remove-directories.ts +++ b/by-example/create-remove-directories.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run --allow-write - * @resource {https://deno.land/api?s=Deno.mkdir} Doc: Deno.mkdir - * @resource {https://deno.land/api?s=Deno.remove} Doc: Deno.remove + * @resource {https://docs.deno.com/api/deno/~/Deno.mkdir} Doc: Deno.mkdir + * @resource {https://docs.deno.com/api/deno/~/Deno.remove} Doc: Deno.remove * @group File System * * Creating and removing directories is a common task. Deno has a number of diff --git a/by-example/cron.ts b/by-example/cron.ts index fdf6bdb72..2c80b5b1d 100644 --- a/by-example/cron.ts +++ b/by-example/cron.ts @@ -4,7 +4,7 @@ * @tags cli, deploy * @run --unstable * @resource {https://docs.deno.com/deploy/kv/manual/cron} Deno Cron user guide - * @resource {https://deno.land/api?s=Deno.cron&unstable=} Deno Cron Runtime API docs + * @resource {https://docs.deno.com/api/deno/~/Deno.cron} Deno Cron Runtime API docs * @group Scheduled Tasks * * Deno Cron is a cron task scheduler built into the Deno runtime and works with diff --git a/by-example/deleting-files.ts b/by-example/deleting-files.ts index 3b8f19fcb..5650397d3 100644 --- a/by-example/deleting-files.ts +++ b/by-example/deleting-files.ts @@ -2,7 +2,7 @@ * @title Deleting Files * @difficulty beginner * @tags cli - * @resource {https://deno.land/api?s=Deno.remove} Doc: Deno.remove + * @resource {https://docs.deno.com/api/deno/~/Deno.remove} Doc: Deno.remove * @group File System * * Removing files and directories is a common task. Deno has a number of diff --git a/by-example/deno-version.ts b/by-example/deno-version.ts index 10f0ac1e4..e518cb350 100644 --- a/by-example/deno-version.ts +++ b/by-example/deno-version.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli * @run - * @resource {https://deno.land/api?s=Deno.version} Doc: Deno.version + * @resource {https://docs.deno.com/api/deno/~/Deno.version} Doc: Deno.version * @group CLI * * How to examine the version of Deno being used. diff --git a/by-example/dns-queries.ts b/by-example/dns-queries.ts index 57e80d50f..8ca40b7f4 100644 --- a/by-example/dns-queries.ts +++ b/by-example/dns-queries.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli, deploy * @run --allow-net - * @resource {https://deno.land/api?s=Deno.resolveDns} Doc: Deno.resolveDns + * @resource {https://docs.deno.com/api/deno/~/Deno.resolveDns} Doc: Deno.resolveDns * @resource {https://developer.mozilla.org/en-US/docs/Glossary/DNS} MDN: DNS * @group Network * diff --git a/by-example/environment-variables.ts b/by-example/environment-variables.ts index 7bdc4c161..cc592faed 100644 --- a/by-example/environment-variables.ts +++ b/by-example/environment-variables.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli, deploy * @run --allow-env - * @resource {https://deno.land/api?s=Deno.env} Doc: Deno.env + * @resource {https://docs.deno.com/api/deno/~/Deno.env} Doc: Deno.env * @resource {https://docs.deno.com/deploy/manual/environment-variables} Deploy Docs: Environment Variables * @group System * diff --git a/by-example/hashing.ts b/by-example/hashing.ts index 1f557301a..6a90212e9 100644 --- a/by-example/hashing.ts +++ b/by-example/hashing.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli, deploy * @run --allow-read - * @resource {https://deno.land/api?s=SubtleCrypto} Doc: crypto.subtle + * @resource {https://docs.deno.com/api/web/~/SubtleCrypto} Doc: crypto.subtle * @resource {https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest} MDN: Cryptographic Digests * @group Cryptography * diff --git a/by-example/http-server-files.ts b/by-example/http-server-files.ts index 8cc240c7f..c438557e3 100644 --- a/by-example/http-server-files.ts +++ b/by-example/http-server-files.ts @@ -3,8 +3,8 @@ * @difficulty intermediate * @tags cli, deploy * @run --allow-net --allow-read - * @resource {https://deno.land/api?s=Deno.serve} Doc: Deno.serve - * @resource {$std/http/file_server.ts} Doc: std/http/file_server + * @resource {https://docs.deno.com/api/deno/~/Deno.serve} Doc: Deno.serve + * @resource {https://jsr.io/@std/http#file-server} Doc: @std/http/file-server * @resource {/examples/http-server} Example: HTTP Server: Hello World * @group Network * diff --git a/by-example/http-server.ts b/by-example/http-server.ts index 81df77759..ae7b0948c 100644 --- a/by-example/http-server.ts +++ b/by-example/http-server.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli, deploy * @run --allow-net - * @resource {https://deno.land/api?s=Deno.serve} Doc: Deno.serve + * @resource {https://docs.deno.com/api/deno/~/Deno.serve} Doc: Deno.serve * @resource {https://developer.mozilla.org/en-US/docs/Web/API/Response} MDN: Response * @playground https://dash.deno.com/playground/example-helloworld * @group Network diff --git a/by-example/import-export.ts b/by-example/import-export.ts index 5dec69626..70209b723 100644 --- a/by-example/import-export.ts +++ b/by-example/import-export.ts @@ -35,7 +35,10 @@ sayHello("World"); import * as util from "./util.ts"; util.sayHello("World"); -// Imports don't have to be relative, they can also reference absolute file or -// https URLs. -import { VERSION } from "https://deno.land/std/version.ts"; -console.log(VERSION); +// Imports don't have to be relative, they can also reference absolute file, +// https, or [JSR](https://jsr.io) URLs. +import { camelCase } from "jsr:@luca/cases@1"; +console.log(camelCase("hello world")); // helloWorld + +import OpenAI from "https://deno.land/x/openai@v4.53.0/mod.ts"; +const client = new OpenAI(); diff --git a/by-example/kv-watch.ts b/by-example/kv-watch.ts index 9b6f4ce8c..396146608 100644 --- a/by-example/kv-watch.ts +++ b/by-example/kv-watch.ts @@ -4,7 +4,7 @@ * @tags cli, deploy * @run --unstable * @resource {https://docs.deno.com/deploy/kv/manual} Deno KV user guide - * @resource {https://deno.land/api?unstable=&s=Deno.Kv} Deno KV Runtime API docs + * @resource {https://docs.deno.com/api/deno/~/Deno.Kv} Deno KV Runtime API docs * @group Databases * * Deno KV watch allows you to detect changes to your KV database, making diff --git a/by-example/kv.ts b/by-example/kv.ts index 29d150b16..2ad66bf9a 100644 --- a/by-example/kv.ts +++ b/by-example/kv.ts @@ -4,7 +4,7 @@ * @tags cli, deploy * @run --unstable * @resource {https://docs.deno.com/deploy/kv/manual} Deno KV user guide - * @resource {https://deno.land/api?unstable=&s=Deno.Kv} Deno KV Runtime API docs + * @resource {https://docs.deno.com/api/deno/~/Deno.Kv} Deno KV Runtime API docs * @group Databases * * Deno KV is a key/value database built in to the Deno runtime, and works with diff --git a/by-example/moving-renaming-files.ts b/by-example/moving-renaming-files.ts index 832fb230b..d14d39df1 100644 --- a/by-example/moving-renaming-files.ts +++ b/by-example/moving-renaming-files.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli * @run --allow-read=./ --allow-write=./ - * @resource {https://deno.land/api?s=Deno.rename} Doc: Deno.rename + * @resource {https://docs.deno.com/api/deno/~/Deno.rename} Doc: Deno.rename * @group File System * * An example of how to move and rename files and directories in Deno. diff --git a/by-example/os-signals.ts b/by-example/os-signals.ts index f2527bb20..cb188b4bc 100644 --- a/by-example/os-signals.ts +++ b/by-example/os-signals.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli * @run - * @resource {https://deno.land/api?s=Deno.addSignalListener} Doc: Deno.addSignalListener + * @resource {https://docs.deno.com/api/deno/~/Deno.addSignalListener} Doc: Deno.addSignalListener * @group System * * You can listen for OS signals using the `Deno.addSignalListener` function. diff --git a/by-example/path-operations.ts b/by-example/path-operations.ts index 753ba3a4e..383942fad 100644 --- a/by-example/path-operations.ts +++ b/by-example/path-operations.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run --allow-read - * @resource {$std/path} Deno: std/path - * @resource {https://deno.land/api?s=Deno.cwd} Deno: Deno.cwd + * @resource {https://jsr.io/@std/path/doc} Doc: @std/path + * @resource {https://docs.deno.com/api/deno/~/Deno.cwd} Deno: Deno.cwd * @group File System * * Many applications need to manipulate file paths in one way or another. diff --git a/by-example/permissions.ts b/by-example/permissions.ts index 57bcbb0ad..840b01f7c 100644 --- a/by-example/permissions.ts +++ b/by-example/permissions.ts @@ -3,7 +3,7 @@ * @difficulty beginner * @tags cli * @run - * @resource {https://deno.land/api?s=Deno.Permissions} Doc: Deno.Permissions + * @resource {https://docs.deno.com/api/deno/~/Deno.Permissions} Doc: Deno.Permissions * @group CLI * * There are times where depending on the state of permissions @@ -42,7 +42,7 @@ console.log(readStatus.state); // In the case that we no longer need a permission, it is also possible // to revoke a process's access to that permission. This is useful when // a process starts running untrusted code. -import { assert } from "$std/assert/assert.ts"; +import { assert } from "jsr:@std/assert@1/assert.ts"; const runStatus = await Deno.permissions.revoke({ name: "run" }); assert(runStatus.state !== "granted"); diff --git a/by-example/queues.ts b/by-example/queues.ts index 52be0cd3c..4c9796f0f 100644 --- a/by-example/queues.ts +++ b/by-example/queues.ts @@ -4,7 +4,7 @@ * @tags cli, deploy * @run --unstable * @resource {https://docs.deno.com/deploy/kv/manual/queue_overview} Deno Queues user guide - * @resource {https://deno.land/api?s=Deno.Kv&unstable=} Deno Queues Runtime API docs + * @resource {https://docs.deno.com/api/deno/~/Deno.Kv} Deno Queues Runtime API docs * @group Scheduled Tasks * * Deno Queues, built on Deno KV, allow you to offload parts of your application diff --git a/by-example/reading-files.ts b/by-example/reading-files.ts index b83d425bc..13f9c220b 100644 --- a/by-example/reading-files.ts +++ b/by-example/reading-files.ts @@ -3,9 +3,9 @@ * @difficulty beginner * @tags cli, deploy * @run --allow-read - * @resource {https://deno.land/api?s=Deno.readFile} Doc: Deno.readFile - * @resource {https://deno.land/api?s=Deno.open} Doc: Deno.open - * @resource {https://deno.land/api?s=Deno.FsFile} Doc: Deno.FsFile + * @resource {https://docs.deno.com/api/deno/~/Deno.readFile} Doc: Deno.readFile + * @resource {https://docs.deno.com/api/deno/~/Deno.open} Doc: Deno.open + * @resource {https://docs.deno.com/api/deno/~/Deno.FsFile} Doc: Deno.FsFile * @group File System * * Many applications need to read files from disk. Deno provides a simple diff --git a/by-example/streaming-files.ts b/by-example/streaming-files.ts index 8aee542cd..086731865 100644 --- a/by-example/streaming-files.ts +++ b/by-example/streaming-files.ts @@ -3,8 +3,8 @@ * @difficulty intermediate * @tags cli * @run --allow-read --allow-write - * @resource {https://deno.land/api?s=Deno.open} Doc: Deno.open - * @resource {https://deno.land/api?s=Deno.FsFile} Doc: Deno.FsFile + * @resource {https://docs.deno.com/api/deno/~/Deno.open} Doc: Deno.open + * @resource {https://docs.deno.com/api/deno/~/Deno.FsFile} Doc: Deno.FsFile * @group File System * * Sometimes we need more granular control over file operations. diff --git a/by-example/subprocesses-output.ts b/by-example/subprocesses-output.ts index 095f35031..932c07969 100644 --- a/by-example/subprocesses-output.ts +++ b/by-example/subprocesses-output.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-run - * @resource {https://deno.land/api?s=Deno.Command} Doc: Deno.Command + * @resource {https://docs.deno.com/api/deno/~/Deno.Command} Doc: Deno.Command * @group System * * We don't often write programs in isolation. In a lot of cases we want diff --git a/by-example/subprocesses-spawn.ts b/by-example/subprocesses-spawn.ts index d59209cf5..d44317858 100644 --- a/by-example/subprocesses-spawn.ts +++ b/by-example/subprocesses-spawn.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-run - * @resource {https://deno.land/api?s=Deno.Command} Doc: Deno.Command + * @resource {https://docs.deno.com/api/deno/~/Deno.Command} Doc: Deno.Command * @group System * * For more complex usecases, we don't simply want the output of some diff --git a/by-example/symlinks.ts b/by-example/symlinks.ts index 24f2d2fc5..c813563d4 100644 --- a/by-example/symlinks.ts +++ b/by-example/symlinks.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run --allow-write --allow-read - * @resource {https://deno.land/api?s=Deno.writeTextFile} Doc: Deno.writeTextFile - * @resource {https://deno.land/api?s=Deno.symlink} Doc: Deno.symlink + * @resource {https://docs.deno.com/api/deno/~/Deno.writeTextFile} Doc: Deno.writeTextFile + * @resource {https://docs.deno.com/api/deno/~/Deno.symlink} Doc: Deno.symlink * @group File System * * Creating and resolving symlink is a common task. Deno has a number of diff --git a/by-example/tcp-connector.ts b/by-example/tcp-connector.ts index 93c34e655..1ec655b75 100644 --- a/by-example/tcp-connector.ts +++ b/by-example/tcp-connector.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-net - * @resource {https://deno.land/api?s=Deno.connect} Doc: Deno.connect + * @resource {https://docs.deno.com/api/deno/~/Deno.connect} Doc: Deno.connect * @resource {/examples/tcp-listener} Example: TCP Listener * @group Network * diff --git a/by-example/tcp-listener.ts b/by-example/tcp-listener.ts index 75c854af9..8e322114b 100644 --- a/by-example/tcp-listener.ts +++ b/by-example/tcp-listener.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-net - * @resource {https://deno.land/api?s=Deno.listen} Doc: Deno.listen + * @resource {https://docs.deno.com/api/deno/~/Deno.listen} Doc: Deno.listen * @group Network * * An example of a TCP listener on localhost that will log the message if written to and close the connection if connected to. diff --git a/by-example/temporary-files.ts b/by-example/temporary-files.ts index 230ba9d23..0760a33d5 100644 --- a/by-example/temporary-files.ts +++ b/by-example/temporary-files.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run --allow-read --allow-write - * @resource {https://deno.land/api?s=Deno.makeTempFile} Doc: Deno.makeTempFile - * @resource {https://deno.land/api?s=Deno.makeTempDir} Doc: Deno.makeTempDir + * @resource {https://docs.deno.com/api/deno/~/Deno.makeTempFile} Doc: Deno.makeTempFile + * @resource {https://docs.deno.com/api/deno/~/Deno.makeTempDir} Doc: Deno.makeTempDir * @group File System * * Temporary files and directories are used to store data that is not intended diff --git a/by-example/tls-connector.ts b/by-example/tls-connector.ts index 69f3ab245..1e70fa727 100644 --- a/by-example/tls-connector.ts +++ b/by-example/tls-connector.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-net --allow-read - * @resource {https://deno.land/api?s=Deno.connectTls} Doc: Deno.connectTls + * @resource {https://docs.deno.com/api/deno/~/Deno.connectTls} Doc: Deno.connectTls * @resource {/examples/tls-listener.ts} Example: TCP/TLS Listener * @group Network * diff --git a/by-example/tls-listener.ts b/by-example/tls-listener.ts index 14d5bbe1e..1adfb2278 100644 --- a/by-example/tls-listener.ts +++ b/by-example/tls-listener.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-net --allow-read - * @resource {https://deno.land/api?s=Deno.listenTls} Doc: Deno.listenTls + * @resource {https://docs.deno.com/api/deno/~/Deno.listenTls} Doc: Deno.listenTls * @group Network * * An example of a TCP listener using TLS on localhost that will log the message if written to and close the connection if connected to. diff --git a/by-example/udp-connector.ts b/by-example/udp-connector.ts index 752b723ef..9e0cb3776 100644 --- a/by-example/udp-connector.ts +++ b/by-example/udp-connector.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-net --unstable - * @resource {https://deno.land/api?s=Deno.connect} Doc: Deno.connect + * @resource {https://docs.deno.com/api/deno/~/Deno.connect} Doc: Deno.connect * @resource {/examples/udp-listener.ts} Example: UDP Listener * @group Network * diff --git a/by-example/udp-listener.ts b/by-example/udp-listener.ts index 114a82cf9..063500c6e 100644 --- a/by-example/udp-listener.ts +++ b/by-example/udp-listener.ts @@ -3,7 +3,7 @@ * @difficulty intermediate * @tags cli * @run --allow-net --unstable - * @resource {https://deno.land/api?s=Deno.listenDatagram} Doc: Deno.listenDatagram + * @resource {https://docs.deno.com/api/deno/~/Deno.listenDatagram} Doc: Deno.listenDatagram * @resource {/examples/udp-connector.ts} Example: UDP Connector * @group Network * diff --git a/by-example/ulid.ts b/by-example/ulid.ts index 40d83dd0c..b8f73946d 100644 --- a/by-example/ulid.ts +++ b/by-example/ulid.ts @@ -28,13 +28,13 @@ console.log(ulid(timestamp)); console.log(ulid(timestamp)); // Given a ULID, you can get the timestamp back out -import { decodeTime } from "$std/ulid/mod.ts"; +import { decodeTime } from "jsr:@std/ulid@0.224/mod.ts"; const myULID = ulid(); console.log(decodeTime(myULID)); // Optionally, if you're not on a distributed system and want monotonic ULIDs, // you can use the monotonic ULID generator instead. -import { monotonicUlid } from "$std/ulid/mod.ts"; +import { monotonicUlid } from "jsr:@std/ulid@0.224/mod.ts"; console.log(monotonicUlid(150000)); // 000XAL6S41ACTAV9WEVGEMMVR8 console.log(monotonicUlid(150000)); // 000XAL6S41ACTAV9WEVGEMMVR9 console.log(monotonicUlid(150000)); // 000XAL6S41ACTAV9WEVGEMMVRA diff --git a/by-example/url-parsing.ts b/by-example/url-parsing.ts index 4c9661c82..b8662a4ec 100644 --- a/by-example/url-parsing.ts +++ b/by-example/url-parsing.ts @@ -28,7 +28,7 @@ console.log(url.pathname); // /manual/introduction console.log(url.protocol); // https: // When parsing a url we often need to read the search parameters. -url = new URL("https://deno.land/api?s=Deno.readFile"); +url = new URL("https://docs.deno.com/api/deno/~/Deno.readFile"); console.log(url.searchParams.get("s")); // Deno.readFile diff --git a/by-example/uuids.ts b/by-example/uuids.ts index 15dee2903..2a2759f12 100644 --- a/by-example/uuids.ts +++ b/by-example/uuids.ts @@ -4,7 +4,7 @@ * @tags cli, deploy, web * @run * @resource {https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID} MDN: crypto.randomUUID - * @resource {$std/uuid/mod.ts} Doc: std/uuid + * @resource {https://jsr.io/@std/uuid/doc} Doc: @std/uuid * @group Cryptography * * UUIDs (universally unique identifier) can be used to uniquely identify some diff --git a/by-example/walking-directories.ts b/by-example/walking-directories.ts index 5e1cc6229..adb44fc4a 100644 --- a/by-example/walking-directories.ts +++ b/by-example/walking-directories.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run --allow-read - * @resource {https://deno.land/api?s=Deno.readDir} Doc: Deno.readDir - * @resource {$std/fs/walk.ts} Doc: std/walk + * @resource {https://docs.deno.com/api/deno/~/Deno.readDir} Doc: Deno.readDir + * @resource {https://jsr.io/@std/fs/doc/walk/~} Doc: @std/fs/walk * @group File System * * When doing something like filesystem routing, it is diff --git a/by-example/watching-files.ts b/by-example/watching-files.ts index 090e44244..d4a0364e2 100644 --- a/by-example/watching-files.ts +++ b/by-example/watching-files.ts @@ -3,9 +3,9 @@ * @difficulty beginner * @tags cli * @run --allow-read - * @resource {https://deno.land/api?s=Deno.watchFs} Doc: Deno.watchFs + * @resource {https://docs.deno.com/api/deno/~/Deno.watchFs} Doc: Deno.watchFs * @resource {https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of} MDN: for await of - * @resource {$std/async/debounce.ts} Doc: std/debounce + * @resource {https://jsr.io/@std/async/doc/debounce/~} Doc: @std/async/debounce * @group File System * * When creating frameworks or CLI tools, it is often necessary to watch the filesystem for changes. diff --git a/by-example/writing-files.ts b/by-example/writing-files.ts index a48600d64..222b2e70e 100644 --- a/by-example/writing-files.ts +++ b/by-example/writing-files.ts @@ -3,9 +3,9 @@ * @difficulty beginner * @tags cli * @run --allow-read --allow-write - * @resource {https://deno.land/api?s=Deno.writeFile} Doc: Deno.writeFile - * @resource {https://deno.land/api?s=Deno.create} Doc: Deno.create - * @resource {https://deno.land/api?s=Deno.FsFile} Doc: Deno.FsFile + * @resource {https://docs.deno.com/api/deno/~/Deno.writeFile} Doc: Deno.writeFile + * @resource {https://docs.deno.com/api/deno/~/Deno.create} Doc: Deno.create + * @resource {https://docs.deno.com/api/deno/~/Deno.FsFile} Doc: Deno.FsFile * @resource {https://developer.mozilla.org/en-US/docs/Web/API/TextEncoder} MDN: TextEncoder * @group File System * diff --git a/by-example/writing-tests.ts b/by-example/writing-tests.ts index 2794402e7..827375b60 100644 --- a/by-example/writing-tests.ts +++ b/by-example/writing-tests.ts @@ -3,8 +3,8 @@ * @difficulty beginner * @tags cli * @run deno test --allow-read --allow-write - * @resource {https://deno.land/api?s=Deno.test} Doc: Deno.test - * @resource {$std/testing/asserts.ts} Doc: std/testing/asserts + * @resource {https://docs.deno.com/api/deno/~/Deno.test} Doc: Deno.test + * @resource {https://jsr.io/@std/assert/doc} Doc: @std/assert * @group CLI * * One of the most common tasks in developing software is writing tests for diff --git a/deno.lock b/deno.lock index f4fcd521b..354199991 100644 --- a/deno.lock +++ b/deno.lock @@ -14,6 +14,7 @@ "jsr:@std/cli": "jsr:@std/cli@0.224.7", "jsr:@std/cli@0.224.7": "jsr:@std/cli@0.224.7", "jsr:@std/cli@^0.224.7": "jsr:@std/cli@0.224.7", + "jsr:@std/cli@^1.0.0": "jsr:@std/cli@1.0.0", "jsr:@std/collections@^1.0.0-rc.1": "jsr:@std/collections@1.0.0", "jsr:@std/collections@^1.0.4": "jsr:@std/collections@1.0.4", "jsr:@std/crypto": "jsr:@std/crypto@0.224.0", @@ -26,6 +27,7 @@ "jsr:@std/encoding@1.0.0-rc.2": "jsr:@std/encoding@1.0.0-rc.2", "jsr:@std/encoding@1.0.1": "jsr:@std/encoding@1.0.1", "jsr:@std/encoding@^0.224.0": "jsr:@std/encoding@0.224.3", + "jsr:@std/encoding@^1.0.1": "jsr:@std/encoding@1.0.1", "jsr:@std/fmt": "jsr:@std/fmt@0.225.4", "jsr:@std/fmt@0.225.4": "jsr:@std/fmt@0.225.4", "jsr:@std/fmt@0.225.6": "jsr:@std/fmt@0.225.6", @@ -41,6 +43,7 @@ "jsr:@std/html@0.224.2": "jsr:@std/html@0.224.2", "jsr:@std/http": "jsr:@std/http@0.224.5", "jsr:@std/http@0.224.5": "jsr:@std/http@0.224.5", + "jsr:@std/http@1.0.0-rc.5": "jsr:@std/http@1.0.0-rc.5", "jsr:@std/internal@^1.0.0": "jsr:@std/internal@1.0.0", "jsr:@std/io@^0.224.2": "jsr:@std/io@0.224.2", "jsr:@std/io@^0.224.3": "jsr:@std/io@0.224.3", @@ -48,15 +51,19 @@ "jsr:@std/jsonc@0.224.3": "jsr:@std/jsonc@0.224.3", "jsr:@std/log@0.224.3": "jsr:@std/log@0.224.3", "jsr:@std/log@0.224.5": "jsr:@std/log@0.224.5", - "jsr:@std/media-types@^1.0.0-rc.1": "jsr:@std/media-types@1.0.1", + "jsr:@std/media-types@^1.0.0-rc.1": "jsr:@std/media-types@1.0.2", + "jsr:@std/media-types@^1.0.2": "jsr:@std/media-types@1.0.2", "jsr:@std/net@^0.224.3": "jsr:@std/net@0.224.5", + "jsr:@std/net@^1.0.0-rc.2": "jsr:@std/net@1.0.0-rc.2", "jsr:@std/path": "jsr:@std/path@0.225.2", "jsr:@std/path@0.225.2": "jsr:@std/path@0.225.2", "jsr:@std/path@1.0.0": "jsr:@std/path@1.0.0", "jsr:@std/path@1.0.0-rc.1": "jsr:@std/path@1.0.0-rc.1", "jsr:@std/path@1.0.0-rc.2": "jsr:@std/path@1.0.0-rc.2", + "jsr:@std/path@^1.0.1": "jsr:@std/path@1.0.1", "jsr:@std/streams@^0.224.4": "jsr:@std/streams@0.224.5", "jsr:@std/streams@^0.224.5": "jsr:@std/streams@0.224.5", + "jsr:@std/streams@^1.0.0-rc.4": "jsr:@std/streams@1.0.0-rc.4", "jsr:@std/toml": "jsr:@std/toml@0.224.1", "jsr:@std/toml@0.224.1": "jsr:@std/toml@0.224.1", "jsr:@std/toml@1.0.0": "jsr:@std/toml@1.0.0", @@ -128,6 +135,9 @@ "@std/cli@0.224.7": { "integrity": "654ca6477518e5e3a0d3fabafb2789e92b8c0febf1a1d24ba4b567aba94b5977" }, + "@std/cli@1.0.0": { + "integrity": "3c38f1da21bff0d25a9e6d97139ef2eb9ba334b5910da92c0169b44f38655f08" + }, "@std/collections@1.0.0": { "integrity": "8e4e07ce1df7badae20b80f2678c3ca3bc14cae5514c4e1817a4668ba8b1adf2" }, @@ -210,6 +220,18 @@ "jsr:@std/streams@^0.224.5" ] }, + "@std/http@1.0.0-rc.5": { + "integrity": "c2f5a7dbf1b54ddda946ca0ea01f47fc66b8909a0629de81752c37a9d20e2462", + "dependencies": [ + "jsr:@std/cli@^1.0.0", + "jsr:@std/encoding@^1.0.1", + "jsr:@std/fmt@^1.0.0-rc.1", + "jsr:@std/media-types@^1.0.2", + "jsr:@std/net@^1.0.0-rc.2", + "jsr:@std/path@^1.0.1", + "jsr:@std/streams@^1.0.0-rc.4" + ] + }, "@std/internal@1.0.0": { "integrity": "ac6a6dfebf838582c4b4f61a6907374e27e05bedb6ce276e0f1608fe84e7cd9a" }, @@ -253,12 +275,18 @@ "@std/media-types@1.0.1": { "integrity": "f2ddc3497be0bd87ac0c9b9b26bb454f76bdc45e1b9a12146af47fab3ba2828c" }, + "@std/media-types@1.0.2": { + "integrity": "abb78dc8f7d88141cba8c4d60fc1e8b421e5c7b0d7c84f2f708bc666cad46784" + }, "@std/net@0.224.3": { "integrity": "a6257b9a35a4f299a0a9d4a4b76aef1f90ad05572374c5267c6c51a2ec41dfba" }, "@std/net@0.224.5": { "integrity": "9c2ae90a5c3dc7771da5ae5e13b6f7d5d0b316c1954c5d53f2bfc1129fb757ff" }, + "@std/net@1.0.0-rc.2": { + "integrity": "7f127a563825c8f3a237994cb979d4cf7991af557cfbdfb08d46ccfee40ce724" + }, "@std/path@0.225.2": { "integrity": "0f2db41d36b50ef048dcb0399aac720a5348638dd3cb5bf80685bf2a745aa506", "dependencies": [ @@ -274,9 +302,15 @@ "@std/path@1.0.0-rc.2": { "integrity": "39f20d37a44d1867abac8d91c169359ea6e942237a45a99ee1e091b32b921c7d" }, + "@std/path@1.0.1": { + "integrity": "e061ff02c28481ca49e3a14981875c345e9fc7e973190672782cd0ac8af70428" + }, "@std/streams@0.224.5": { "integrity": "bcde7818dd5460d474cdbd674b15f6638b9cd73cd64e52bd852fba2bd4d8ec91" }, + "@std/streams@1.0.0-rc.4": { + "integrity": "ee3efcfaab0e4929781bd18cc457496009d8b13c2cebd196e78000b61886fb40" + }, "@std/toml@0.224.1": { "integrity": "c364b9ca3b18207223c4e2a1f652ef2970ff80967f7575ddf89b6b0565a17148", "dependencies": [ @@ -1837,6 +1871,12 @@ } }, "redirects": { + "https://cdn.skypack.dev/-/@octokit/graphql@v4.8.0-EbMgAhtBEVS5THey9fbY/dist=es2019,mode=types/index.d.ts": "https://cdn.skypack.dev/-/@octokit/graphql@v4.8.0-EbMgAhtBEVS5THey9fbY/dist=es2019,mode=types/dist-types/index.d.ts", + "https://cdn.skypack.dev/-/@octokit/openapi-types@v11.2.0-gu1h7aCgAJhI0Ck7YfZg/dist=es2019,mode=types/index.d.ts": "https://cdn.skypack.dev/-/@octokit/openapi-types@v11.2.0-gu1h7aCgAJhI0Ck7YfZg/dist=es2019,mode=types/types.d.ts", + "https://cdn.skypack.dev/-/@octokit/request-error@v2.1.0-eEdMdUdHjpMHPFvA4aCp/dist=es2019,mode=types/index.d.ts": "https://cdn.skypack.dev/-/@octokit/request-error@v2.1.0-eEdMdUdHjpMHPFvA4aCp/dist=es2019,mode=types/dist-types/index.d.ts", + "https://cdn.skypack.dev/-/@octokit/request@v5.6.3-8MiyZSoy8B73C1K9nYC8/dist=es2019,mode=types/index.d.ts": "https://cdn.skypack.dev/-/@octokit/request@v5.6.3-8MiyZSoy8B73C1K9nYC8/dist=es2019,mode=types/dist-types/index.d.ts", + "https://cdn.skypack.dev/-/@octokit/types@v6.33.0-CLItWMbWROrzbdY30nuK/dist=es2019,mode=types/index.d.ts": "https://cdn.skypack.dev/-/@octokit/types@v6.33.0-CLItWMbWROrzbdY30nuK/dist=es2019,mode=types/dist-types/index.d.ts", + "https://cdn.skypack.dev/-/@octokit/types@v6.34.0-YyJmQq3Ajv0ACapsoOVh/dist=es2019,mode=types/index.d.ts": "https://cdn.skypack.dev/-/@octokit/types@v6.34.0-YyJmQq3Ajv0ACapsoOVh/dist=es2019,mode=types/dist-types/index.d.ts", "https://deno.land/std/version.ts": "https://deno.land/std@0.224.0/version.ts", "https://deno.land/x/r2d2/mod.ts": "https://deno.land/x/r2d2@v2.0.0/mod.ts" }, @@ -2040,6 +2080,19 @@ "https://cdn.jsdelivr.net/gh/lumeland/lume@f705c16c43913a0861b3fc88c723024d2d9e3069/plugins/vento.ts": "03b2121ca5e14b589d9add0a390e0c0c4e591436617ef899011440325c878392", "https://cdn.jsdelivr.net/gh/lumeland/lume@f705c16c43913a0861b3fc88c723024d2d9e3069/plugins/yaml.ts": "21b1604304240d4de42b2ba0fcfd81b8330fcff8b365a1ee4ff164de6ef3de75", "https://cdn.jsdelivr.net/gh/lumeland/lume@f705c16c43913a0861b3fc88c723024d2d9e3069/types.ts": "516bec311f10083c5b1d8109e8afd17f02b49cc62c45dca53706f286cb855dba", + "https://cdn.skypack.dev/-/@octokit/auth-token@v2.5.0-63e6RmuUEnR1eflFvHL4/dist=es2019,mode=imports/optimized/@octokit/auth-token.js": "5247df74f0bd63d994d1ab5b52265761cf2eb1b67f12171a030ebef4027d5eb6", + "https://cdn.skypack.dev/-/@octokit/core@v3.6.0-OHRgZVmYvb8jBujJr5vE/dist=es2019,mode=imports/optimized/@octokit/core.js": "a1f82f18dccc5b09d753690a8addd839e4fe0b5a6f6831b17437f136c8921db3", + "https://cdn.skypack.dev/-/@octokit/endpoint@v6.0.12-uRrGy3NGbXOw4pbkNPpd/dist=es2019,mode=imports/optimized/@octokit/endpoint.js": "c446189a38ca8fad5137feec7ec6c16b9964783e8563a007894e459d56844dc9", + "https://cdn.skypack.dev/-/@octokit/graphql@v4.8.0-EbMgAhtBEVS5THey9fbY/dist=es2019,mode=imports/optimized/@octokit/graphql.js": "334633396812283703411d0edc56f5cef3b5eff80eeb3d2a1a6878d2cf445dc6", + "https://cdn.skypack.dev/-/@octokit/request-error@v2.1.0-eEdMdUdHjpMHPFvA4aCp/dist=es2019,mode=imports/optimized/@octokit/request-error.js": "72409dbe6dabfeed08701e925eb837aa7965c58cdeed3dcedd345d0037965837", + "https://cdn.skypack.dev/-/@octokit/request@v5.6.3-8MiyZSoy8B73C1K9nYC8/dist=es2019,mode=imports/optimized/@octokit/request.js": "f118ddba5422f667538941a8e18870e5faf9066dd235c0548f539bc555f0b0b3", + "https://cdn.skypack.dev/-/before-after-hook@v2.2.2-pi5OVaqfPuA5i8u2q0Od/dist=es2019,mode=imports/optimized/before-after-hook.js": "d8dc01095d8c3892f00eafc8a9a6ccdcad3502aa91bbdbcf575916ab203e08f4", + "https://cdn.skypack.dev/-/deprecation@v2.3.1-uvOjAQiALAZPHmrlznlP/dist=es2019,mode=imports/optimized/deprecation.js": "193048b24ad63bc08fa2acbc65df7b57ddd8421aec8abf378e38e6978b5c0b33", + "https://cdn.skypack.dev/-/is-plain-object@v5.0.0-8mrVMp9y5RYdpZYGe1Tt/dist=es2019,mode=imports/optimized/is-plain-object.js": "c3fcee678ef371dba4c260b766215ad645777e698f6f857738b6c4b98ad34b93", + "https://cdn.skypack.dev/-/once@v1.4.0-dZva3nt1fLBY6vpXF5Hj/dist=es2019,mode=imports/optimized/once.js": "2ecef4cecb6b0f4aec108af8e23b1d23304494bea8fc569464a6c2a11fda6486", + "https://cdn.skypack.dev/-/universal-user-agent@v6.0.0-fUAPE3UH5QP7qG0fd0dH/dist=es2019,mode=imports/optimized/universal-user-agent.js": "24df9219684b303ca065c02733e601d11b3ed63a35ec8e473094006d65f6ded9", + "https://cdn.skypack.dev/-/wrappy@v1.0.2-e8nLh7Qms0NRhbAbUpJP/dist=es2019,mode=imports/optimized/wrappy.js": "01dc1f36207f5400dad37bac2acddb2de0466953f289b8c84b7100e8b160fbb2", + "https://cdn.skypack.dev/@octokit/core@3?dts": "7a987f1931a3102f29bb54a0ee09a9d4c99555e6a4cae98dd1e0127c9929dd36", "https://deno.land/std@0.160.0/_util/assert.ts": "e94f2eb37cebd7f199952e242c77654e43333c1ac4c5c700e929ea3aa5489f74", "https://deno.land/std@0.160.0/_util/os.ts": "8a33345f74990e627b9dfe2de9b040004b08ea5146c7c9e8fe9a29070d193934", "https://deno.land/std@0.160.0/async/abortable.ts": "87aa7230be8360c24ad437212311c9e8d4328854baec27b4c7abb26e85515c06", @@ -2096,6 +2149,38 @@ "https://deno.land/std@0.170.0/path/posix.ts": "b859684bc4d80edfd4cad0a82371b50c716330bed51143d6dcdbe59e6278b30c", "https://deno.land/std@0.170.0/path/separator.ts": "fe1816cb765a8068afb3e8f13ad272351c85cbc739af56dacfc7d93d710fe0f9", "https://deno.land/std@0.170.0/path/win32.ts": "7cebd2bda6657371adc00061a1d23fdd87bcdf64b4843bb148b0b24c11b40f69", + "https://deno.land/std@0.179.0/_util/asserts.ts": "178dfc49a464aee693a7e285567b3d0b555dc805ff490505a8aae34f9cfb1462", + "https://deno.land/std@0.179.0/_util/os.ts": "d932f56d41e4f6a6093d56044e29ce637f8dcc43c5a90af43504a889cf1775e3", + "https://deno.land/std@0.179.0/bytes/copy.ts": "939d89e302a9761dcf1d9c937c7711174ed74c59eef40a1e4569a05c9de88219", + "https://deno.land/std@0.179.0/fmt/colors.ts": "938c5d44d889fb82eff6c358bea8baa7e85950a16c9f6dae3ec3a7a729164471", + "https://deno.land/std@0.179.0/fs/_util.ts": "65381f341af1ff7f40198cee15c20f59951ac26e51ddc651c5293e24f9ce6f32", + "https://deno.land/std@0.179.0/fs/copy.ts": "14214efd94fc3aa6db1e4af2b4b9578e50f7362b7f3725d5a14ad259a5df26c8", + "https://deno.land/std@0.179.0/fs/empty_dir.ts": "c3d2da4c7352fab1cf144a1ecfef58090769e8af633678e0f3fabaef98594688", + "https://deno.land/std@0.179.0/fs/ensure_dir.ts": "dc64c4c75c64721d4e3fb681f1382f803ff3d2868f08563ff923fdd20d071c40", + "https://deno.land/std@0.179.0/fs/ensure_file.ts": "c38602670bfaf259d86ca824a94e6cb9e5eb73757fefa4ebf43a90dd017d53d9", + "https://deno.land/std@0.179.0/fs/ensure_link.ts": "c0f5b2f0ec094ed52b9128eccb1ee23362a617457aa0f699b145d4883f5b2fb4", + "https://deno.land/std@0.179.0/fs/ensure_symlink.ts": "5006ab2f458159c56d689b53b1e48d57e05eeb1eaf64e677f7f76a30bc4fdba1", + "https://deno.land/std@0.179.0/fs/eol.ts": "f1f2eb348a750c34500741987b21d65607f352cf7205f48f4319d417fff42842", + "https://deno.land/std@0.179.0/fs/exists.ts": "b8c8a457b71e9d7f29b9d2f87aad8dba2739cbe637e8926d6ba6e92567875f8e", + "https://deno.land/std@0.179.0/fs/expand_glob.ts": "e4f56259a0a70fe23f05215b00de3ac5e6ba46646ab2a06ebbe9b010f81c972a", + "https://deno.land/std@0.179.0/fs/mod.ts": "bc3d0acd488cc7b42627044caf47d72019846d459279544e1934418955ba4898", + "https://deno.land/std@0.179.0/fs/move.ts": "4cb47f880e3f0582c55e71c9f8b1e5e8cfaacb5e84f7390781dd563b7298ec19", + "https://deno.land/std@0.179.0/fs/walk.ts": "ea95ffa6500c1eda6b365be488c056edc7c883a1db41ef46ec3bf057b1c0fe32", + "https://deno.land/std@0.179.0/io/buf_reader.ts": "90a7adcb3638d8e1361695cdf844d58bcd97c41711dc6f9f8acc0626ebe097f5", + "https://deno.land/std@0.179.0/io/buffer.ts": "e2b7564f684dad625cab08f5106f33572d325705d19a36822b3272fbdfb8f726", + "https://deno.land/std@0.179.0/path/_constants.ts": "e49961f6f4f48039c0dfed3c3f93e963ca3d92791c9d478ac5b43183413136e0", + "https://deno.land/std@0.179.0/path/_interface.ts": "6471159dfbbc357e03882c2266d21ef9afdb1e4aa771b0545e90db58a0ba314b", + "https://deno.land/std@0.179.0/path/_util.ts": "d7abb1e0dea065f427b89156e28cdeb32b045870acdf865833ba808a73b576d0", + "https://deno.land/std@0.179.0/path/common.ts": "ee7505ab01fd22de3963b64e46cff31f40de34f9f8de1fff6a1bd2fe79380000", + "https://deno.land/std@0.179.0/path/glob.ts": "d479e0a695621c94d3fd7fe7abd4f9499caf32a8de13f25073451c6ef420a4e1", + "https://deno.land/std@0.179.0/path/mod.ts": "4b83694ac500d7d31b0cdafc927080a53dc0c3027eb2895790fb155082b0d232", + "https://deno.land/std@0.179.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d", + "https://deno.land/std@0.179.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1", + "https://deno.land/std@0.179.0/path/win32.ts": "d186344e5583bcbf8b18af416d13d82b35a317116e6460a5a3953508c3de5bba", + "https://deno.land/std@0.179.0/semver/mod.ts": "409a2691f5a411c34e917c1e6d445a6d1d53f3fadf660e44a99dd0bf9b2ef412", + "https://deno.land/std@0.179.0/streams/read_all.ts": "bfa220b0e1d06fa4d0cb5178baba8f8b466019a7411511982bfa2320ca292815", + "https://deno.land/std@0.179.0/streams/reader_from_stream_reader.ts": "3fda9390ec8520c8a9ea2aba2579208b18880a7663d7a9feec8f193b7af14e41", + "https://deno.land/std@0.179.0/streams/write_all.ts": "3b2e1ce44913f966348ce353d02fa5369e94115181037cd8b602510853ec3033", "https://deno.land/std@0.203.0/bytes/bytes_list.ts": "ecf5098c230b793970f43c06e8f30d70b937c031658365aeb3de9a8ae4d406a3", "https://deno.land/std@0.203.0/bytes/concat.ts": "d26d6f3d7922e6d663dacfcd357563b7bf4a380ce5b9c2bbe0c8586662f25ce2", "https://deno.land/std@0.203.0/collections/chunk.ts": "f82c52a82ad9338018570c42f6de0fb132fcb14914c31a444e360ac104d7b55b", @@ -2205,6 +2290,40 @@ "https://deno.land/x/cliffy@v0.25.7/table/row.ts": "5f519ba7488d2ef76cbbf50527f10f7957bfd668ce5b9169abbc44ec88302645", "https://deno.land/x/cliffy@v0.25.7/table/table.ts": "ec204c9d08bb3ff1939c5ac7412a4c9ed7d00925d4fc92aff9bfe07bd269258d", "https://deno.land/x/cliffy@v0.25.7/table/utils.ts": "187bb7dcbcfb16199a5d906113f584740901dfca1007400cba0df7dcd341bc29", + "https://deno.land/x/dax@0.30.0/mod.ts": "321cedcadf8ba261aef0083d0e50edcc76486822e0f62b64ec364e92ef246e42", + "https://deno.land/x/dax@0.30.0/src/command.ts": "0cb8a5ba2748423355e7e86e6150aba3b2672b09700715a551fcbd21df49f159", + "https://deno.land/x/dax@0.30.0/src/command_handler.ts": "d32dafb16ec21d673aef9eb1dfde435ab5b139a2d0f0de5c6afa6c849121b3bd", + "https://deno.land/x/dax@0.30.0/src/commands/args.ts": "a138aef24294e3cbf13cef08f4836d018e8dd99fd06ad82e7e7f08ef680bbc1d", + "https://deno.land/x/dax@0.30.0/src/commands/cd.ts": "15a75fb42646445fb6a061af1f52c63253c7c45accdbc801a92a5b00f1cf212c", + "https://deno.land/x/dax@0.30.0/src/commands/cp_mv.ts": "58205a82a9404e444c7c5caf98b5dd2b350c668c0b421546a038b76ea8b6a53d", + "https://deno.land/x/dax@0.30.0/src/commands/echo.ts": "2af0b8f33a688a972540848487cb6a045debe504edcc5eb40bd9eb4aad6058c4", + "https://deno.land/x/dax@0.30.0/src/commands/exit.ts": "36759cba6494062891216794bffa61803a6d547fe05a5a5da76a7daa31b8968a", + "https://deno.land/x/dax@0.30.0/src/commands/export.ts": "b6ecad1203cfe606d69da6c16736f31acf211e864e6822484d85cea1cb7d5528", + "https://deno.land/x/dax@0.30.0/src/commands/mkdir.ts": "9381ecdc0e0203d941f89027b6ef2865393bf0a66670bf5f5aaa6a49669244c7", + "https://deno.land/x/dax@0.30.0/src/commands/pwd.ts": "5438aea979027bfa5c64c2a7f1073389735ea986f6abe2174ec21bcb70a2156f", + "https://deno.land/x/dax@0.30.0/src/commands/rm.ts": "d911ff4e2e0b3d3c5d426c7b735313741ad762d9e25a743f101a1b05447eecf8", + "https://deno.land/x/dax@0.30.0/src/commands/sleep.ts": "61e454eb033912f19c2a15e8c15462fcc5cbc343c1fb4979093b9042899e7016", + "https://deno.land/x/dax@0.30.0/src/commands/test.ts": "e54fcfd68cabe9b7743de7015eabcd6c8509c02def41477edc2fcd90b92050ce", + "https://deno.land/x/dax@0.30.0/src/commands/touch.ts": "5953dbde8732da47ade9b7554a638ea06a8b67a59842e638fb79f7aebe392650", + "https://deno.land/x/dax@0.30.0/src/common.ts": "c0e809c591400dbadb25197f2819c59fec6b897c94c1aba6a026d5d1eee9cb53", + "https://deno.land/x/dax@0.30.0/src/console/confirm.ts": "d9128d10b77fcc0a8df2784f71c79df68f5c8e00a34b04547b9ba9ddf1c97f96", + "https://deno.land/x/dax@0.30.0/src/console/logger.ts": "e0ab5025915cef70df03681c756e211f25bb2e4331f82ed4256b17ddd9e794ea", + "https://deno.land/x/dax@0.30.0/src/console/mod.ts": "29ae1f8250b74a477e26a3b6ccf647badf5d8f8e2a9e6c4aa0d5df9e3bbbb273", + "https://deno.land/x/dax@0.30.0/src/console/multiSelect.ts": "31003744e58f45f720271bd034d8cfba1055c954ba02d77a2f2eb21e4c1ed55a", + "https://deno.land/x/dax@0.30.0/src/console/progress/format.ts": "15ddbb8051580f88ed499281e12ca6f881f875ab73268d7451d7113ee130bd7d", + "https://deno.land/x/dax@0.30.0/src/console/progress/interval.ts": "80188d980a27c2eb07c31324365118af549641442f0752fe7c3b0c91832e5046", + "https://deno.land/x/dax@0.30.0/src/console/progress/mod.ts": "df1017c87a33c3b0152422e753ea203aa706b9e5570a3930a6fce6f86ee2bcf5", + "https://deno.land/x/dax@0.30.0/src/console/prompt.ts": "78c645b41a7562133d05a10901ae4d682cb22bfaf0b5a21cc8475ca2a946aee1", + "https://deno.land/x/dax@0.30.0/src/console/select.ts": "c9d7124d975bf34d52ea1ac88fd610ed39db8ee6505b9bb53f371cef2f56c6ab", + "https://deno.land/x/dax@0.30.0/src/console/utils.ts": "954c99397dcd2cb3f1ccf50055085f17c9ffb31b25b3c5719776de81e23935f4", + "https://deno.land/x/dax@0.30.0/src/deps.ts": "821301a75ab979c78099b1f3fc55825873dffb2cfa8fb2ffc44039b0c7747ea1", + "https://deno.land/x/dax@0.30.0/src/lib/mod.ts": "c8e9ca527dacf1e5a0132f07c6d0e4b4bc6f86b6c83694316fb5805f325dd9fe", + "https://deno.land/x/dax@0.30.0/src/lib/rs_lib.generated.js": "22f6813fc63f7ae7f01f2fdec892f66831d858fc376fd57ab018be9a78bbb5fd", + "https://deno.land/x/dax@0.30.0/src/path.ts": "5c37b98316d883e119d064230baa3bfe9d11cbb9b8012a71357d9de0de8071f9", + "https://deno.land/x/dax@0.30.0/src/pipes.ts": "3aa984c0d031f4221953e228ba89452a86068a80d2811fddb9c60737cd4ab174", + "https://deno.land/x/dax@0.30.0/src/request.ts": "66a1b19301e0e3b918b8982836ce1d071e2555e7d02a4c31cec8f9d3221c5f9d", + "https://deno.land/x/dax@0.30.0/src/result.ts": "db83149d543f8b0625319f5169ec654faca6da42a046e75e7722a00cc5a7ea72", + "https://deno.land/x/dax@0.30.0/src/shell.ts": "55e60cc0017a4a31833c390971381cce3875a17bc3b6430dfd976d035831871f", "https://deno.land/x/deno_dom@v0.1.47/build/deno-wasm/deno-wasm.js": "d6841a06342eb6a2798ef28de79ad69c0f2fa349fa04d3ca45e5fcfbf50a9340", "https://deno.land/x/deno_dom@v0.1.47/deno-dom-wasm.ts": "0669396686fb207f1354af33df6aabe2189b4eceafdb1bf7f3d6bbb2637b6b03", "https://deno.land/x/deno_dom@v0.1.47/src/api.ts": "0ff5790f0a3eeecb4e00b7d8fbfa319b165962cf6d0182a65ba90f158d74f7d7", @@ -2230,6 +2349,7 @@ "https://deno.land/x/denoflate@1.2.1/mod.ts": "f5628e44b80b3d80ed525afa2ba0f12408e3849db817d47a883b801f9ce69dd6", "https://deno.land/x/denoflate@1.2.1/pkg/denoflate.js": "b9f9ad9457d3f12f28b1fb35c555f57443427f74decb403113d67364e4f2caf4", "https://deno.land/x/denoflate@1.2.1/pkg/denoflate_bg.wasm.js": "d581956245407a2115a3d7e8d85a9641c032940a8e810acbd59ca86afd34d44d", + "https://deno.land/x/dir@1.5.1/data_local_dir/mod.ts": "91eb1c4bfadfbeda30171007bac6d85aadacd43224a5ed721bbe56bc64e9eb66", "https://deno.land/x/esbuild@v0.21.5/mod.js": "f391d2907ca95fff70cc0bea3eb690d1687d069e6559cad1017af942f7b76d4d", "https://deno.land/x/esbuild@v0.23.0/mod.js": "46f2e569b50e4d1f1b379b2f9785a9b9437d52911b849df8797d9ca40ce3e1c9", "https://deno.land/x/lume@v2.2.2/cli.ts": "71f6e24caf5eb661fb1b903ed6a914718a08ee6711daa689dc61fa5e5a37c54c", @@ -2352,6 +2472,7 @@ "https://deno.land/x/lume_markdown_plugins@v0.7.0/toc/anchors.ts": "8a4a1c6b2c63156622695ceba57fa7100a6e5f109c9a383a1dcaf755233c8184", "https://deno.land/x/lume_markdown_plugins@v0.7.0/toc/mod.ts": "8c7aa6e1dcfabda4264503495a3875388108cd9a5a94b54853b45a8e8cba9f78", "https://deno.land/x/lume_markdown_plugins@v0.7.0/utils.ts": "6e6c3c394709eff39080562732c2dafe404f225253aaded937133ea694c4b735", + "https://deno.land/x/outdent@v0.8.0/src/index.ts": "6dc3df4108d5d6fedcdb974844d321037ca81eaaa16be6073235ff3268841a22", "https://deno.land/x/postgres@v0.17.0/client.ts": "348779c9f6a1c75ef1336db662faf08dce7d2101ff72f0d1e341ba1505c8431d", "https://deno.land/x/postgres@v0.17.0/client/error.ts": "0817583b666fd546664ed52c1d37beccc5a9eebcc6e3c2ead20ada99b681e5f7", "https://deno.land/x/postgres@v0.17.0/connection/auth.ts": "1070125e2ac4ca4ade36d69a4222d37001903092826d313217987583edd61ce9", @@ -2414,6 +2535,7 @@ "https://deno.land/x/vento@v0.12.8/src/loader.ts": "eb01b0dca7ea8bcdcdfd30b1f90f2fad28fb7f2cfd943900322a85bfaa86130c", "https://deno.land/x/vento@v0.12.8/src/tokenizer.ts": "e7830fbc644a3b30cf852d0685f9797e4826ad399a3e0277beebce577b54934c", "https://deno.land/x/vento@v0.12.8/src/transformer.ts": "587a0b107a2bd1437a3093c4c44c07e4fdf3abfaaf8e845767b69bd34a039154", + "https://deno.land/x/which@0.2.2/mod.ts": "fd5335ef1c89bda4c7942d69dd8f895270207ba0384a97c4862ac65bba1f2343", "https://deno.land/x/xml@5.4.10/mod.ts": "b59e5c0dd9fe7ed597c21c39aacf089aa82fe5c5eaad3f411a43a9c104359f4e", "https://deno.land/x/xml@5.4.10/parse.ts": "f0946674c3717e78da15f3dfc02b3635f8425c8a721d0a589a15648df227f4ad", "https://deno.land/x/xml@5.4.10/stringify.ts": "be3805e8a708f8fbc6d7b0b8b2e6de73870b286b0b38db39adad46aa73841d8e", @@ -2422,7 +2544,16 @@ "https://deno.land/x/xml@5.4.7/mod.ts": "b59e5c0dd9fe7ed597c21c39aacf089aa82fe5c5eaad3f411a43a9c104359f4e", "https://deno.land/x/xml@5.4.7/parse.ts": "70334eee74b738d8c4cf1f44b3a05834c3f0ba4dc4e09eea84a2286fd86bcf89", "https://deno.land/x/xml@5.4.7/stringify.ts": "8d1a48125ed65a0158aed333688c4eed77120316ac0f2c2c92d216dbcb092033", - "https://deno.land/x/xml@5.4.7/wasm_xml_parser/wasm_xml_parser.js": "924706e40c2a0dfd21d9665d56fb098122e0955e3d8ad5e14c1931b4dfd25eaa" + "https://deno.land/x/xml@5.4.7/wasm_xml_parser/wasm_xml_parser.js": "924706e40c2a0dfd21d9665d56fb098122e0955e3d8ad5e14c1931b4dfd25eaa", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/cargo.ts": "c686a658dca9ef5865a67ed3967affdc0d3e30c1b0b98ac85e17bf11843b46c2", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/crate.ts": "74cbb318b4c839e9d15e226af4d797ce5cf3ff133e58fad46afbf2993e52f38b", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/crates_io.ts": "847ec5a47af16a0f7fdabbf958803c01cc2ce7c1ae1d6b3d296d9dc2978aa58b", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/deps.ts": "dafe7bb98b807bd91571747883523ca98d6657b9be96297cfa4aefb941842adc", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/github_actions.ts": "50db34240dac53b83401972b7123a3eef69f6bb94b794a0cc438212474b4b66d", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/helpers.ts": "71be90a0ecef229f0075782014f0f8402de112a467494b314e3cdb193f568e0a", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/mod.ts": "94c53674853b68977c3452262130d6430bdae2dfb5777b04c708d52fd9a73739", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/releases_md.ts": "4debb10b57849e20f97a58354773db22c2887b6a6a58134869366265729eb2e0", + "https://raw.githubusercontent.com/denoland/automation/0.19.2/repo.ts": "046f848101b200f240796063ad7b956f85feddd4b46d1be59eac15a67f9a5e8b" }, "workspace": { "dependencies": [ diff --git a/deploy/api/index.md b/deploy/api/index.md index 25ddfb33e..541091425 100644 --- a/deploy/api/index.md +++ b/deploy/api/index.md @@ -53,39 +53,39 @@ Deploy. > Note: only stable APIs of Deno are made available in Deploy. -- [`Deno.env`](https://doc.deno.land/deno/stable/~/Deno.env) - Interact with +- [`Deno.env`](https://docs.deno.com/api/deno/~/Deno.env) - Interact with environment variables (secrets). - `get(key: string): string | undefined` - get the value of an environment variable. - `toObject(): { [key: string]: string }` - get all environment variables as an object. -- [`Deno.connect`](https://doc.deno.land/deno/stable/~/Deno.connect) - Connect - to TCP sockets. -- [`Deno.connectTls`](https://doc.deno.land/deno/stable/~/Deno.connectTls) - +- [`Deno.connect`](https://docs.deno.com/api/deno/~/Deno.connect) - Connect to + TCP sockets. +- [`Deno.connectTls`](https://docs.deno.com/api/deno/~/Deno.connectTls) - Connect to TCP sockets using TLS. -- [`Deno.startTls`](https://doc.deno.land/deno/stable/~/Deno.startTls) - Start - TLS handshake from an existing TCP connection. -- [`Deno.resolveDns`](https://doc.deno.land/deno/stable/~/Deno.resolveDns) - - Make DNS queries +- [`Deno.startTls`](https://docs.deno.com/api/deno/~/Deno.startTls) - Start TLS + handshake from an existing TCP connection. +- [`Deno.resolveDns`](https://docs.deno.com/api/deno/~/Deno.resolveDns) - Make + DNS queries - File system API - - [`Deno.cwd`](https://doc.deno.land/deno/stable/~/Deno.cwd) - Get the current + - [`Deno.cwd`](hhttps://docs.deno.com/api/deno/~/Deno.cwd) - Get the current working directory - - [`Deno.readDir`](https://doc.deno.land/deno/stable/~/Deno.readDir) - Get + - [`Deno.readDir`](https://docs.deno.com/api/deno/~/Deno.readDir) - Get directory listings - - [`Deno.readFile`](https://doc.deno.land/deno/stable/~/Deno.readFile) - Read - a file into memory - - [`Deno.readTextFile`](https://doc.deno.land/deno/stable/~/Deno.readTextFile) - + - [`Deno.readFile`](https://docs.deno.com/api/deno/~/Deno.readFile) - Read a + file into memory + - [`Deno.readTextFile`](https://docs.deno.com/api/deno/~/Deno.readTextFile) - Read a text file into memory - - [`Deno.open`](https://doc.deno.land/deno/stable/~/Deno.open) - Open a file - for streaming reading - - [`Deno.stat`](https://doc.deno.land/deno/stable/~/Deno.stat) - Get file - system entry information - - [`Deno.lstat`](https://doc.deno.land/deno/stable/~/Deno.lstat) - Get file + - [`Deno.open`](https://docs.deno.com/api/deno/~/Deno.open) - Open a file for + streaming reading + - [`Deno.stat`](https://docs.deno.com/api/deno/~/Deno.stat) - Get file system + entry information + - [`Deno.lstat`](https://docs.deno.com/api/deno/~/Deno.lstat) - Get file system entry information without following symlinks - - [`Deno.realPath`](https://doc.deno.land/deno/stable/~/Deno.realPath) - Get - the real path of a file after resolving symlinks - - [`Deno.readLink`](https://doc.deno.land/deno/stable/~/Deno.readLink) - Get - the target path for the given symlink + - [`Deno.realPath`](https://docs.deno.com/api/deno/~/Deno.realPath) - Get the + real path of a file after resolving symlinks + - [`Deno.readLink`](https://docs.deno.com/api/deno/~/Deno.readLink) - Get the + target path for the given symlink ## Future support diff --git a/deploy/api/runtime-fs.md b/deploy/api/runtime-fs.md index f4cf0bb40..105fcb705 100644 --- a/deploy/api/runtime-fs.md +++ b/deploy/api/runtime-fs.md @@ -35,7 +35,7 @@ of your GitHub repository. `Deno.readDir()` allows you to list the contents of a directory. The function is fully compatible with -[Deno](https://doc.deno.land/deno/stable/~/Deno.readDir). +[Deno](https://docs.deno.com/api/deno/~/Deno.readDir). ```ts function Deno.readDir(path: string | URL): AsyncIterable @@ -73,10 +73,9 @@ Deno.serve(handler); `Deno.readFile()` allows you to read a file fully into memory. The function definition is similar to -[Deno](https://doc.deno.land/deno/stable/~/Deno.readFile), but it doesn't -support -[`ReadFileOptions`](https://doc.deno.land/deno/stable/~/Deno.ReadFileOptions) -for the time being. Support will be added in the future. +[Deno](https://docs.deno.com/api/deno/~/Deno.readFile), but it doesn't support +[`ReadFileOptions`](https://docs.deno.com/api/deno/~/Deno.ReadFileOptions) for +the time being. Support will be added in the future. ```ts function Deno.readFile(path: string | URL): Promise @@ -169,9 +168,9 @@ Deno.serve(handleRequest); ``` The path provided to the -[`Deno.readFile`](https://deno.land/api@v1.31.1?s=Deno.readFile) API is relative -to the root of the repository. You can also specify absolute paths, if they are -inside `Deno.cwd`. +[`Deno.readFile`](https://docs.deno.com/api/deno/~/Deno.readFile) API is +relative to the root of the repository. You can also specify absolute paths, if +they are inside `Deno.cwd`. ## Deno.readTextFile @@ -204,9 +203,9 @@ handle can then be used to read the contents of the file. See handle. The function definition is similar to -[Deno](https://doc.deno.land/deno/stable/~/Deno.open), but it doesn't support -[`OpenOptions`](https://doc.deno.land/deno/stable/~/Deno.OpenOptions) for the -time being. Support will be added in the future. +[Deno](https://docs.deno.com/api/deno/~/Deno.open), but it doesn't support +[`OpenOptions`](https://docs.deno.com/api/deno/~/Deno.OpenOptions) for the time +being. Support will be added in the future. ```ts function Deno.open(path: string | URL): Promise @@ -237,10 +236,9 @@ Deno.serve(handler); used to read chunks of the file using the `read()` method. The file handle can be closed using the `close()` method. -The interface is similar to -[Deno](https://doc.deno.land/deno/stable/~/Deno.File), but it doesn't support -writing to the file, or seeking. Support for the latter will be added in the -future. +The interface is similar to [Deno](https://docs.deno.com/api/deno/~/Deno.File), +but it doesn't support writing to the file, or seeking. Support for the latter +will be added in the future. ```ts class File { @@ -278,7 +276,7 @@ function close(): void; [`Deno.FileInfo`](#fileinfo) object. Symlinks are followed. The function definition is the same as -[Deno](https://doc.deno.land/deno/stable/~/Deno.stat). It does not return +[Deno](https://docs.deno.com/api/deno/~/Deno.stat). It does not return modification time, access time, or creation time values. ```ts @@ -311,7 +309,7 @@ Deno.serve(handler); `Deno.lstat()` is similar to `Deno.stat()`, but it does not follow symlinks. The function definition is the same as -[Deno](https://doc.deno.land/deno/stable/~/Deno.lstat). It does not return +[Deno](https://docs.deno.com/api/deno/~/Deno.lstat). It does not return modification time, access time, or creation time values. ```ts @@ -345,7 +343,7 @@ interface FileInfo { symlinks. The function definition is the same as -[Deno](https://doc.deno.land/deno/stable/~/Deno.realPath). +[Deno](https://docs.deno.com/api/deno/~/Deno.realPath). ```ts function Deno.realPath(path: string | URL): Promise @@ -373,7 +371,7 @@ Deno.serve(handler); `Deno.readLink()` returns the target path for a symlink. The function definition is the same as -[Deno](https://doc.deno.land/deno/stable/~/Deno.readLink). +[Deno](https://docs.deno.com/api/deno/~/Deno.readLink). ```ts function Deno.readLink(path: string | URL): Promise diff --git a/deploy/api/runtime-sockets.md b/deploy/api/runtime-sockets.md index 8e21fd399..b6ce3c0b2 100644 --- a/deploy/api/runtime-sockets.md +++ b/deploy/api/runtime-sockets.md @@ -12,8 +12,8 @@ use databases like PostgreSQL, SQLite, MongoDB, etc., with Deploy. Make outbound TCP connections. The function definition is same as -[Deno](https://doc.deno.land/deno/stable/~/Deno.connect) with the limitation -that `transport` option can only be `tcp` and `hostname` cannot be localhost or +[Deno](https://docs.deno.com/api/deno/~/Deno.connect) with the limitation that +`transport` option can only be `tcp` and `hostname` cannot be localhost or empty. ```ts @@ -57,7 +57,7 @@ Deno.serve(handler); Make outbound TLS connections. The function definition is the same as -[Deno](https://doc.deno.land/deno/stable/~/Deno.connectTls) with the limitation +[Deno](https://docs.deno.com/api/deno/~/Deno.connectTls) with the limitation that hostname cannot be localhost or empty. ```ts diff --git a/deploy/kv/manual/cron.md b/deploy/kv/manual/cron.md index f863bc890..80ac371f1 100644 --- a/deploy/kv/manual/cron.md +++ b/deploy/kv/manual/cron.md @@ -6,7 +6,7 @@ oldUrl: -The [`Deno.cron`](https://deno.land/api?s=Deno.cron&unstable=) interface enables +The [`Deno.cron`](https://docs.deno.com/api/deno/~/Deno.cron) interface enables you to configure JavaScript or TypeScript code that executes on a configurable schedule using [cron syntax](https://en.wikipedia.org/wiki/Cron). In the example below, we configure a block of JavaScript code that will execute every minute. @@ -62,12 +62,12 @@ Below are some design details and limitations to be aware of when using ### Tasks must be defined at the top level module scope -The [`Deno.cron`](https://deno.land/api?s=Deno.cron&unstable=) interface is +The [`Deno.cron`](https://docs.deno.com/api/deno/~/Deno.cron) interface is designed to support static definition of cron tasks based on pre-defined schedules. All `Deno.cron` tasks must be defined at the top-level of a module. Any nested `Deno.cron` definitions (e.g. inside -[`Deno.serve`](https://deno.land/api?s=Deno.serve&unstable=) handler) will -result in an error or will be ignored. +[`Deno.serve`](https://docs.deno.com/api/deno/~/Deno.serve) handler) will result +in an error or will be ignored. If you need to schedule tasks dynamically during your Deno program execution, you can use the [Deno Queues](./queue_overview) APIs. diff --git a/deploy/kv/manual/data_modeling_typescript.md b/deploy/kv/manual/data_modeling_typescript.md index 12b1c2eff..29c217efd 100644 --- a/deploy/kv/manual/data_modeling_typescript.md +++ b/deploy/kv/manual/data_modeling_typescript.md @@ -80,7 +80,7 @@ console.log(ac.fullName); ``` You can also specify an optional -[type parameter](https://deno.land/api?s=Deno.Kv&p=prototype.get&unstable) for +[type parameter](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.get) for `get`: ```ts diff --git a/deploy/kv/manual/index.md b/deploy/kv/manual/index.md index 8df48831a..8d8828973 100644 --- a/deploy/kv/manual/index.md +++ b/deploy/kv/manual/index.md @@ -9,7 +9,7 @@ oldUrl: **Deno KV** is a [key-value database](https://en.wikipedia.org/wiki/Key%E2%80%93value_database) built directly into the Deno runtime, available in the -[`Deno.Kv` namespace](https://deno.land/api?unstable&s=Deno.Kv). It can be used +[`Deno.Kv` namespace](https://docs.deno.com/api/deno/~/Deno.Kv). It can be used for many kinds of data storage use cases, but excels at storing simple data structures that benefit from very fast reads and writes. Deno KV is available in the Deno CLI and on [Deno Deploy](./on_deploy). @@ -21,8 +21,8 @@ Let's walk through the key features of Deno KV. ## Opening a database In your Deno program, you can get a reference to a KV database using -[`Deno.openKv()`](https://deno.land/api?unstable=&s=Deno.openKv). You may pass -in an optional file system path to where you'd like to store your database, +[`Deno.openKv()`](https://docs.deno.com/api/deno/~/Deno.openKv). You may pass in +an optional file system path to where you'd like to store your database, otherwise one will be created for you based on the current working directory of your script. @@ -39,7 +39,7 @@ JavaScript object literal or a `string`, `number`, `bigint`, or `boolean`. Values can be arbitrary JavaScript objects. In this example, we create a key-value pair representing a user's UI preferences, and save it with -[`kv.set()`](https://deno.land/api?s=Deno.Kv&unstable=&p=prototype.set). +[`kv.set()`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.set). ```ts const kv = await Deno.openKv(); @@ -54,7 +54,7 @@ const result = await kv.set(["preferences", "ada"], prefs); ``` Once a key-value pair is set, you can read it from the database with -[`kv.get()`](https://deno.land/api?s=Deno.Kv&unstable=&p=prototype.get): +[`kv.get()`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.get): ```ts const entry = await kv.get(["preferences", "ada"]); @@ -64,7 +64,7 @@ console.log(entry.versionstamp); ``` Both `get` and `list` [operations](./operations) return a -[KvEntry](https://deno.land/api?s=Deno.KvEntry&unstable=) object with the +[KvEntry](https://docs.deno.com/api/deno/~/Deno.KvEntry) object with the following properties: - `key` - the array key you used to set the value @@ -79,7 +79,7 @@ new generated value. ## Listing several key-value pairs To get values for a finite number of keys, you may use -[`kv.getMany()`](https://deno.land/api?s=Deno.Kv&unstable=&p=prototype.getMany). +[`kv.getMany()`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.getMany). Pass in several keys as arguments, and you'll receive an array of values for each key. Note that **values and versionstamps can be `null`** if no value exists for the given key(s). @@ -100,9 +100,8 @@ result[1].versionstamp; // null Often, it is useful to retrieve a list of key-value pairs from all keys that share a given prefix. This type of operation is possible using -[`kv.list()`](https://deno.land/api?s=Deno.Kv&unstable=&p=prototype.list). In -this example, we get a list of key-value pairs that share the `"preferences"` -prefix. +[`kv.list()`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.list). In this +example, we get a list of key-value pairs that share the `"preferences"` prefix. ```ts const kv = await Deno.openKv(); @@ -132,8 +131,8 @@ writes are always performed in strong consistency mode. ## Deleting key-value pairs You can delete a key from the database using -[`kv.delete()`](https://deno.land/api?s=Deno.Kv&unstable=&p=prototype.delete). -No action is taken if no value is found for the given key. +[`kv.delete()`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.delete). No +action is taken if no value is found for the given key. ```ts const kv = await Deno.openKv(); @@ -244,7 +243,7 @@ by your code. Learn more about Deno KV on Deno Deploy [here](./on_deploy). ## Testing -By default, [`Deno.openKv()`](https://deno.land/api?unstable=&s=Deno.openKv) +By default, [`Deno.openKv()`](https://docs.deno.com/api/deno/~/Deno.openKv) creates or opens a persistent store based on the path from which the script that invoked it was run. This isn't usually desireable for tests, which need to produce the same behavior when run many times in a row. diff --git a/deploy/kv/manual/operations.md b/deploy/kv/manual/operations.md index 1ee4c8aab..25060aeab 100644 --- a/deploy/kv/manual/operations.md +++ b/deploy/kv/manual/operations.md @@ -262,8 +262,7 @@ The `watch` operation accepts an array of keys, and returns a [`ReadableStream`](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream), which emits a new value whenever any of the watched keys change their `versionstamp`. The emitted value is an array of -[Deno.KvEntryMaybe](https://deno.land/api?s=Deno.KvEntryMaybe&unstable=) -objects. +[Deno.KvEntryMaybe](https://docs.deno.com/api/deno/~/Deno.KvEntryMaybe) objects. Note that the returned stream does not return every single intermediate state of the watched keys, but keeps you up to date with the latest state of keys. This @@ -284,9 +283,9 @@ for await (const entries of stream) { } ``` -[get]: https://deno.land/api?s=Deno.Kv&p=prototype.get&unstable -[getMany]: https://deno.land/api?s=Deno.Kv&p=prototype.getMany&unstable -[list]: https://deno.land/api?s=Deno.Kv&p=prototype.list&unstable -[set]: https://deno.land/api?s=Deno.Kv&p=prototype.set&unstable -[delete]: https://deno.land/api?s=Deno.Kv&p=prototype.delete&unstable -[mutate]: https://deno.land/api?s=Deno.AtomicOperation&p=prototype.mutate&unstable +[get]: https://docs.deno.com/api/deno/~/Deno.Kv.prototype.get +[getMany]: https://docs.deno.com/api/deno/~/Deno.Kv.prototype.getMany +[list]: https://docs.deno.com/api/deno/~/Deno.Kv.prototype.list +[set]: https://docs.deno.com/api/deno/~/Deno.Kv.prototype.set +[delete]: https://docs.deno.com/api/deno/~/Deno.Kv.prototype.delete +[mutate]: https://docs.deno.com/api/deno/~/Deno.AtomicOperation.prototype.mutate diff --git a/deploy/kv/manual/queue_overview.md b/deploy/kv/manual/queue_overview.md index 99e131c6d..c862c003a 100644 --- a/deploy/kv/manual/queue_overview.md +++ b/deploy/kv/manual/queue_overview.md @@ -12,15 +12,14 @@ messages. Queues can be used to offload tasks in a web application, or to schedule units of work for a time in the future. The primary APIs you'll use with queues are in the `Deno.Kv` namespace as -[`enqueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.enqueue) -and -[`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue). +[`enqueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.enqueue) and +[`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue). ## Enqueue a message To enqueue a message for processing, use the `enqueue` method on an instance of -[`Deno.Kv`](https://deno.land/api?unstable=true&s=Deno.Kv). In the example -below, we show what it might look like to enqueue a notification for delivery. +[`Deno.Kv`](https://docs.deno.com/api/deno/~/Deno.Kv). In the example below, we +show what it might look like to enqueue a notification for delivery. ```ts title="queue_example.ts" // Describe the shape of your message object (optional) @@ -71,7 +70,7 @@ console.log("Found failed notification for:", r.value?.forUser); You can configure a JavaScript function that will process items added to your queue with the `listenQueue` method on an instance of -[`Deno.Kv`](https://deno.land/api?unstable=true&s=Deno.Kv). +[`Deno.Kv`](https://docs.deno.com/api/deno/~/Deno.Kv). ```ts title="listen_example.ts" // Define the shape of the object we expect as a message in the queue @@ -154,7 +153,7 @@ await kv The runtime guarantees at-least-once delivery. This means that for majority of enqueued messages, the -[`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue) +[`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue) handler will be invoked once for each message. In some failure scenarios, the handler may be invoked multiple times for the same message to ensure delivery. It's important to design your applications such that duplicate messages are @@ -168,13 +167,13 @@ once per message. See ### Automatic retries -[`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue) +[`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue) handler is invoked to process your queued messages when they're ready for delivery. If your handler throws an exception the runtime will automatically retry to call the handler again until it succeeds or until maximum retry attempts are reached. The message is considered to be succesfully processed once the -[`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue) +[`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue) handler invocation completes succesfully. The message will be dropped if the handler consistently fails on retries. @@ -194,26 +193,25 @@ build applications that scale to handle large workloads. When using queues with Deno Deploy, isolates are automatically spun up on demand to invoke your -[`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue) +[`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue) handler when a message becomes available for processing. Defining -[`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue) +[`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue) handler is the only requirement to enable queue processing in your Deno Deploy application, no additional configuration is needed. ### Queue size limit The maximum number of undelivered queue messages is limited to 100,000. -[`enqueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.enqueue) -method will fail with an error if the queue is full. +[`enqueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.enqueue) method +will fail with an error if the queue is full. ### Pricing details and limits -- [`enqueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.enqueue) - is treated just like other - [`Deno.Kv`](https://deno.land/api?unstable=true&s=Deno.Kv) write operations. - Enqueued messages consume KV storage and write units. +- [`enqueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.enqueue) is + treated just like other [`Deno.Kv`](https://docs.deno.com/api/deno/~/Deno.Kv) + write operations. Enqueued messages consume KV storage and write units. - Messages delivered through - [`listenQueue`](https://deno.land/api?unstable=true&s=Deno.Kv&p=prototype.listenQueue) + [`listenQueue`](https://docs.deno.com/api/deno/~/Deno.Kv.prototype.listenQueue) consume requests and KV write units. - See [Pricing details](https://deno.com/deploy/pricing) for more information. diff --git a/deploy/kv/tutorials/webhook_processor.md b/deploy/kv/tutorials/webhook_processor.md index 39a8101fe..589eec2d4 100644 --- a/deploy/kv/tutorials/webhook_processor.md +++ b/deploy/kv/tutorials/webhook_processor.md @@ -40,8 +40,8 @@ configuration under "Settings" for your repository. Our webhook handler function is relatively simple - without comments, it's only 23 lines of code total. It connects to a Deno KV database, sets up a queue listener to process incoming messages, and sets up a simple server with -[`Deno.serve`](https://deno.land/api?s=Deno.serve) which responds to incoming -webhook requests. +[`Deno.serve`](https://docs.deno.com/api/deno/~/Deno.serve) which responds to +incoming webhook requests. Read along with the comments below to see what's happening at each step. diff --git a/deploy/manual/ci_github.md b/deploy/manual/ci_github.md index acc872d8a..a324a7541 100644 --- a/deploy/manual/ci_github.md +++ b/deploy/manual/ci_github.md @@ -94,7 +94,7 @@ See [deployctl README](https://github.com/denoland/deployctl/blob/main/action/README.md) for more details. -[fileserver]: https://deno.land/std/http/file_server.ts +[fileserver]: https://jsr.io/@std/http#file-server [ghapp]: https://github.com/apps/deno-deploy [deploy-action]: https://github.com/denoland/deployctl/blob/main/action/README.md [ahead-of-time builds]: https://fresh.deno.dev/docs/concepts/ahead-of-time-builds diff --git a/deploy/manual/pricing-and-limits.md b/deploy/manual/pricing-and-limits.md index d48962bb9..55ebcdd44 100644 --- a/deploy/manual/pricing-and-limits.md +++ b/deploy/manual/pricing-and-limits.md @@ -20,11 +20,11 @@ deployment (source files and static files) **should not exceed 1 gigabyte**. ## TLS proxying TLS termination is required for outgoing connections to port 443 (the port used -for HTTPS). Using [Deno.connect](https://deno.land/api?s=Deno.connect) to -connect to these ports is prohibited. If you need to establish a TLS connection -to port 443, please use -[Deno.connectTls](https://deno.land/api?s=Deno.connectTls) instead. `fetch` is -not impacted by this restriction. +for HTTPS). Using [Deno.connect](https://docs.deno.com/api/deno/~/Deno.connect) +to connect to these ports is prohibited. If you need to establish a TLS +connection to port 443, please use +[Deno.connectTls](https://docs.deno.com/api/deno/~/Deno.connectTls) instead. +`fetch` is not impacted by this restriction. This restriction is in place because connecting to port 443 without terminating TLS is frequently used in TLS-over-TLS proxies, which are prohibited on Deno diff --git a/deploy/tutorials/static-site.md b/deploy/tutorials/static-site.md index b48c29464..17794d08f 100644 --- a/deploy/tutorials/static-site.md +++ b/deploy/tutorials/static-site.md @@ -39,7 +39,7 @@ You have now a html page that says "Hello" and has a logo. To deploy this repo on Deno Deploy, from the `static-site` repository, run: ```console -deployctl deploy --project= https://deno.land/std@0.220.0/http/file_server.ts +deployctl deploy --project= jsr:@std/http@1.0.0-rc.5/file-server ``` To give a little more explanation of these commands: Because this is a static diff --git a/deploy/tutorials/tutorial-http-server.md b/deploy/tutorials/tutorial-http-server.md index d90cccd5d..ca4a0e7d4 100644 --- a/deploy/tutorials/tutorial-http-server.md +++ b/deploy/tutorials/tutorial-http-server.md @@ -11,7 +11,7 @@ Deno Deploy playground to deploy and edit this script. ## Step 1: Write the HTTP server script A simple HTTP server can be written with a single line of code in Deno using -[`Deno.serve`](https://deno.land/api?s=Deno.serve): +[`Deno.serve`](https://docs.deno.com/api/deno/~/Deno.serve): ```js title="One-line HTTP server" Deno.serve(() => new Response("Hello, world!")); @@ -19,8 +19,8 @@ Deno.serve(() => new Response("Hello, world!")); While this type of server is useful for getting started, `Deno.serve` is capable of supporting more advanced usage as well -([API reference docs](https://deno.land/api?s=Deno.serve)). Below is an example -of a more complex server that takes advantage of other API features. +([API reference docs](https://docs.deno.com/api/deno/~/Deno.serve)). Below is an +example of a more complex server that takes advantage of other API features. ```ts title="More complex Hello World server" Deno.serve({ diff --git a/deploy/tutorials/vite.md b/deploy/tutorials/vite.md index 4a07e9d8d..f8886f2fd 100644 --- a/deploy/tutorials/vite.md +++ b/deploy/tutorials/vite.md @@ -42,12 +42,11 @@ Now that we have everything in place, let's deploy your new project! 7. Set the **Root directory** to `dist` 8. Click **Deploy Project** -> NB. The entrypoint that is set will be -> `https://deno.land/std@0.224.0/http/file_server.ts`. Note that this is not a -> file that exists in the Vite repo itself. Instead, it is an external program. -> When run, this program uploads all the static asset files in your current repo -> (`vite-project/dist`) to Deno Deploy. Then when you navigate to the deployment -> URL, it serves up the local directory. +> NB. The entrypoint that is set will be `jsr:@std/http@1.0.0-rc.5/file-server`. +> Note that this is not a file that exists in the Vite repo itself. Instead, it +> is an external program. When run, this program uploads all the static asset +> files in your current repo (`vite-project/dist`) to Deno Deploy. Then when you +> navigate to the deployment URL, it serves up the local directory. ### `deployctl` @@ -56,5 +55,5 @@ Deploy. ```console cd /dist -deployctl deploy --project= https://deno.land/std@0.224.0/http/file_server.ts +deployctl deploy --project= jsr:@std/http@1.0.0-rc.5/file-server ``` diff --git a/examples.page.tsx b/examples.page.tsx index 4674bf7b7..33a2ab80b 100644 --- a/examples.page.tsx +++ b/examples.page.tsx @@ -409,9 +409,6 @@ export interface ExampleSnippet { } export function parseExample(id: string, file: string): Example { - // Substitute $std/ with the full import url - file = file.replaceAll("$std/", "https://deno.land/std@0.207.0/"); - // Extract the multi line JS doc comment at the top of the file const [, jsdoc, rest] = file.match(/^\s*\/\*\*(.*?)\*\/\s*(.*)/s) || []; @@ -549,7 +546,7 @@ export function parseExample(id: string, file: string): Example { const additionalResources: [string, string][] = []; for (const resource of resources) { - // @resource {https://deno.land/std/http/server.ts} std/http/server.ts + // @resource {https://jsr.io/@std/http/server/~/} std/http/server const [_, url, title] = resource.match(/^\{(.*?)\}\s(.*)/) || []; if (!url || !title) { throw new Error(`Invalid resource: ${resource}`); diff --git a/replacements.json b/replacements.json index e1e6035b8..62c64dd09 100644 --- a/replacements.json +++ b/replacements.json @@ -1,4 +1,3 @@ { - "CLI_VERSION": "1.45.3", - "STD_VERSION": "0.224.0" + "CLI_VERSION": "1.45.3" } diff --git a/runtime/manual/advanced/continuous_integration.md b/runtime/manual/advanced/continuous_integration.md index 504b6ada5..2cc7c6b3d 100644 --- a/runtime/manual/advanced/continuous_integration.md +++ b/runtime/manual/advanced/continuous_integration.md @@ -183,10 +183,10 @@ Now, if the contents of `deno.lock` are changed, a new cache will be made and used in subsequent pipeline runs thereafter. To demonstrate, let's say you have a project that uses the logger from -`deno.land/std`: +[`@std/log`](https://jsr.io/@std/log): ```ts -import * as log from "https://deno.land/std@0.224.0/log/mod.ts"; +import * as log from "jsr:@std/log@0.224.5"; ``` In order to increment this version, you can update the `import` statement and diff --git a/runtime/manual/advanced/jsx_dom/css.md b/runtime/manual/advanced/jsx_dom/css.md index 0953ba717..a42d91a11 100644 --- a/runtime/manual/advanced/jsx_dom/css.md +++ b/runtime/manual/advanced/jsx_dom/css.md @@ -29,7 +29,7 @@ Then we will stringify the modified CSS AST and output it to the console: ```ts import * as css from "https://esm.sh/css@3.0.0"; -import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assert } from "jsr:@std/assert@1"; declare global { interface AbortSignal { diff --git a/runtime/manual/advanced/jsx_dom/deno_dom.md b/runtime/manual/advanced/jsx_dom/deno_dom.md index ed0ee794c..3ef5bf916 100644 --- a/runtime/manual/advanced/jsx_dom/deno_dom.md +++ b/runtime/manual/advanced/jsx_dom/deno_dom.md @@ -21,8 +21,8 @@ structure based on it. It will then query that DOM structure, picking out the first heading it encounters and print out the text content of that heading: ```ts -import { DOMParser } from "https://deno.land/x/deno_dom/deno-dom-wasm.ts"; -import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { DOMParser } from "jsr:@b-fuze/deno-dom@0.1.47"; +import { assert } from "jsr:@std/assert@1"; const document = new DOMParser().parseFromString( ` diff --git a/runtime/manual/advanced/jsx_dom/jsdom.md b/runtime/manual/advanced/jsx_dom/jsdom.md index 623ccd25c..397eef839 100644 --- a/runtime/manual/advanced/jsx_dom/jsdom.md +++ b/runtime/manual/advanced/jsx_dom/jsdom.md @@ -25,23 +25,11 @@ This means if you want strong typing and intelligent auto-completion in your editor while using the Deno language server, you have to perform some extra steps. -### Defining an `import_map.json` - -You need to map the bare specifier `"jsdom"` to the imported version of jsdom. -This allows Deno to correctly apply the types to the import in the way they were -specified. - -```json -{ - "jsdom": "https://esm.sh/jsdom" -} -``` - ### Setting up a configuration file You will want to set up a `deno.jsonc` configuration file in the root of your workspace with both TypeScript library information as well as specifying the -import map defined above: +dependencies we'll be using: ```jsonc { @@ -53,7 +41,10 @@ import map defined above: "dom.asynciterable" ] }, - "importMap": "./import_map.json" + "imports": { + "jsdom": "npm:jsdom", + "@std/assert": "jsr:@std/assert@1" + } } ``` @@ -68,7 +59,7 @@ first heading it encounters and print out the text content of that heading: ```ts import { JSDOM } from "jsdom"; -import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assert } from "@std/assert"; const { window: { document } } = new JSDOM( ` diff --git a/runtime/manual/advanced/jsx_dom/linkedom.md b/runtime/manual/advanced/jsx_dom/linkedom.md index 02fc5e7b2..898c56c3e 100644 --- a/runtime/manual/advanced/jsx_dom/linkedom.md +++ b/runtime/manual/advanced/jsx_dom/linkedom.md @@ -13,17 +13,6 @@ currently deno-dom is slower than LinkeDOM in some cases, both are significantly faster than jsdom, so if you require correctness or features not related to server side rendering, consider deno-dom. -While LinkeDOM works under the Deno CLI, it does not type check. While the -provided types work well when using an editor like VSCode, attempting to -strictly type check them, like Deno does by default, at runtime, it will fail. -This is the same if you were to use `tsc` to type check the code. The maintainer -has indicated they aren't interested in -[fixing this issue](https://github.com/WebReflection/linkedom/issues/87). This -means for Deno, you need to use the `--no-check=remote` to avoid diagnostics -stopping the execution of your programme. - -LinkedDOM runs under Deno Deploy, along with deno_dom, but jsdom does not. - ## Basic example This example will take a test string and parse it as HTML and generate a DOM @@ -31,8 +20,8 @@ structure based on it. It will then query that DOM structure, picking out the first heading it encounters and print out the text content of that heading: ```ts -import { DOMParser } from "https://esm.sh/linkedom"; -import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { DOMParser } from "npm:linkedom"; +import { assert } from "jsr:@std/assert@1"; const document = new DOMParser().parseFromString( ` @@ -68,7 +57,7 @@ a `window` scope you can use to access API's outside of the scope of the `document`. For example: ```ts -import { parseHTML } from "https://esm.sh/linkedom"; +import { parseHTML } from "npm:linkedom"; const { document, customElements, HTMLElement } = parseHTML(` diff --git a/runtime/manual/advanced/migrate_deprecations.md b/runtime/manual/advanced/migrate_deprecations.md index 876e40c05..db0d6b1be 100644 --- a/runtime/manual/advanced/migrate_deprecations.md +++ b/runtime/manual/advanced/migrate_deprecations.md @@ -66,7 +66,8 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.Conn.rid` -Use [`Deno.Conn`](https://deno.land/api?s=Deno.Conn) instance methods instead. +Use [`Deno.Conn`](https://docs.deno.com/api/deno/~/Deno.Conn) instance methods +instead. ```diff - await Deno.read(conn.rid, buffer); @@ -93,7 +94,7 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.ListenTlsOptions.certChain` Use -[`Deno.ConnectTlsOptions.cert`](https://deno.land/api?s=Deno.ConnectTlsOptions#prop_cert) +[`Deno.TlsCertifiedKeyPem.cert`](https://docs.deno.com/api/deno/~/Deno.TlsCertifiedKeyPem#property_cert) instead. ```diff @@ -113,7 +114,7 @@ See [deno#22274](https://github.com/denoland/deno/pull/22274) for details. ### `Deno.ConnectTlsOptions.certFile` Use -[`Deno.ConnectTlsOptions.cert`](https://deno.land/api?s=Deno.ConnectTlsOptions#prop_cert) +[`Deno.TlsCertifiedKeyPem.cert`](https://docs.deno.com/api/deno/~/Deno.TlsCertifiedKeyPem#property_cert) instead. ```diff @@ -133,7 +134,7 @@ See [deno#22274](https://github.com/denoland/deno/pull/22274) for details. ### `Deno.ConnectTlsOptions.privateKey` Use -[`Deno.ConnectTlsOptions.key`](https://deno.land/api?s=Deno.ConnectTlsOptions#prop_key) +[`Deno.TlsCertifiedKeyPem.cert`](https://docs.deno.com/api/deno/~/Deno.TlsCertifiedKeyPem#property_key) instead. ```diff @@ -182,7 +183,7 @@ See [deno#9294](https://github.com/denoland/deno/issues/9294) for details. ### `Deno.File` -Use [`Deno.FsFile`](https://deno.land/api?s=Deno.FsFile) instead. +Use [`Deno.FsFile`](https://docs.deno.com/api/deno/~/Deno.FsFile) instead. ```diff - function foo(file: Deno.File) { @@ -195,7 +196,8 @@ See [deno#13661](https://github.com/denoland/deno/issues/13661) for details. ### `Deno.flock()` -Use [`Deno.FsFile.lock()`](https://deno.land/api?s=Deno.FsFile&p=prototype.lock) +Use +[`Deno.FsFile.lock()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.lock) instead. ```diff @@ -208,7 +210,7 @@ See [deno#22178](https://github.com/denoland/deno/issues/22178) for details. ### `Deno.flockSync()` Use -[`Deno.FsFile.lockSync()`](https://deno.land/api?s=Deno.FsFile&p=prototype.lockSync) +[`Deno.FsFile.lockSync()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.lockSync) instead. ```diff @@ -221,7 +223,7 @@ See [deno#22178](https://github.com/denoland/deno/issues/22178) for details. ### `Deno.fstatSync()` Use -[`Deno.FsFile.statSync()`](https://deno.land/api?s=Deno.FsFile&p=prototype.statSync) +[`Deno.FsFile.statSync()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.statSync) instead. ```diff @@ -233,7 +235,8 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.fstat()` -Use [`Deno.FsFile.stat()`](https://deno.land/api?s=Deno.FsFile&p=prototype.stat) +Use +[`Deno.FsFile.stat()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.stat) instead. ```diff @@ -245,8 +248,8 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.FsWatcher.rid` -Use [`Deno.FsWatcher`](https://deno.land/api?s=Deno.FsWatcher) instance methods -instead. +Use [`Deno.FsWatcher`](https://docs.deno.com/api/deno/~/Deno.FsWatcher) instance +methods instead. ```diff - Deno.close(watcher.rid); @@ -258,7 +261,7 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.ftruncateSync()` Use -[`Deno.FsFile.truncateSync()`](https://deno.land/api?s=Deno.FsFile&p=prototype.truncateSync) +[`Deno.FsFile.truncateSync()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.truncateSync) instead. ```diff @@ -271,7 +274,7 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.ftruncate()` Use -[`Deno.FsFile.truncate()`](https://deno.land/api?s=Deno.FsFile&p=prototype.truncate) +[`Deno.FsFile.truncate()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.truncate) instead. ```diff @@ -284,7 +287,7 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.funlock()` Use -[`Deno.FsFile.unlock()`](https://deno.land/api?s=Deno.FsFile&p=prototype.unlock) +[`Deno.FsFile.unlock()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.unlock) instead. ```diff @@ -297,7 +300,7 @@ See [deno#22178](https://github.com/denoland/deno/issues/22178) for details. ### `Deno.funlockSync()` Use -[`Deno.FsFile.unlockSync()`](https://deno.land/api?s=Deno.FsFile&p=prototype.unlockSync) +[`Deno.FsFile.unlockSync()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.unlockSync) instead. ```diff @@ -310,7 +313,7 @@ See [deno#22178](https://github.com/denoland/deno/issues/22178) for details. ### `Deno.futimeSync()` Use -[`Deno.FsFile.utimeSync()`](https://deno.land/api?s=Deno.FsFile&p=prototype.utimeSync) +[`Deno.FsFile.utimeSync()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.utimeSync) instead. ```diff @@ -323,7 +326,7 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.futime()` Use -[`Deno.FsFile.utime()`](https://deno.land/api?s=Deno.FsFile&p=prototype.utime) +[`Deno.FsFile.utime()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.utime) instead. ```diff @@ -396,8 +399,8 @@ See [deno#9795][deno#9795] for details. ### `Deno.Listener.rid` -Use [`Deno.Listener`](https://deno.land/api?s=Deno.Listener) instance methods -instead. +Use [`Deno.Listener`](https://docs.deno.com/api/deno/~/Deno.Listener) instance +methods instead. ```diff - Deno.close(listener.rid); @@ -409,7 +412,7 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.ListenTlsOptions.certFile` Pass the certificate file contents to -[`Deno.ListenTlsOptions.cert`](https://deno.land/api?s=Deno.ListenTlsOptions#prop_cert) +[`Deno.ListenTlsOptions.cert`](https://docs.deno.com/api/deno/~/Deno.ListenTlsOptions#property_cert) instead. ```diff @@ -426,7 +429,7 @@ See [deno#12639](https://github.com/denoland/deno/issues/12639) for details. ### `Deno.ListenTlsOptions.keyFile` Pass the key file contents to -[`Deno.ListenTlsOptions.key`](https://deno.land/api?s=Deno.ListenTlsOptions#prop_key) +[`Deno.ListenTlsOptions.key`](https://docs.deno.com/api/deno/~/Deno.ListenTlsOptions#property_key) instead. ```diff @@ -538,7 +541,8 @@ See [deno#9795][deno#9795] for details. ### `Deno.run()` -Use [`new Deno.Command()`](https://deno.land/api?s=Deno.Command) instead. +Use [`new Deno.Command()`](https://docs.deno.com/api/deno/~/Deno.Command) +instead. ```diff - const process = Deno.run({ cmd: [ "echo", "hello world" ], stdout: "piped" }); @@ -560,7 +564,7 @@ See [deno#16516](https://github.com/denoland/deno/pull/16516) for details. ### `Deno.seekSync()` Use -[`Deno.FsFile.seekSync()`](https://deno.land/api?s=Deno.FsFile&p=prototype.seekSync) +[`Deno.FsFile.seekSync()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.seekSync) instead. ```diff @@ -572,7 +576,8 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.seek()` -Use [`Deno.FsFile.seek()`](https://deno.land/api?s=Deno.FsFile&p=prototype.seek) +Use +[`Deno.FsFile.seek()`](https://docs.deno.com/api/deno/~/Deno.FsFile.prototype.seek) instead. ```diff @@ -584,7 +589,7 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.serveHttp()` -Use [`Deno.serve()`](https://deno.land/api?s=Deno.serve) instead. +Use [`Deno.serve()`](https://docs.deno.com/api/deno/~/Deno.serve) instead. ```diff - const conn = Deno.listen({ port: 80 }); @@ -602,7 +607,8 @@ details. ### `Deno.Server` -Use [`Deno.HttpServer`](https://deno.land/api?s=Deno.HttpServer) instead. +Use [`Deno.HttpServer`](https://docs.deno.com/api/deno/~/Deno.HttpServer) +instead. ```diff - function foo(server: Deno.Server) { @@ -616,7 +622,7 @@ See [deno#20840](https://github.com/denoland/deno/issues/20840) for details. ### `Deno.shutdown` Use -[`Deno.Conn.closeWrite()`](https://deno.land/api?s=Deno.Conn#method_closeWrite_0) +[`Deno.Conn.closeWrite()`](https://docs.deno.com/api/deno/~/Deno.Conn#method_closeWrite_0) instead. ```diff @@ -628,8 +634,8 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.stderr.rid` -Use [`Deno.stderr`](https://deno.land/api?s=Deno.stderr) instance methods -instead. +Use [`Deno.stderr`](https://docs.deno.com/api/deno/~/Deno.stderr) instance +methods instead. ```diff - await Deno.write(Deno.stderr.rid, data); @@ -650,7 +656,8 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.stdin.rid` -Use [`Deno.stdin`](https://deno.land/api?s=Deno.stdin) instance methods instead. +Use [`Deno.stdin`](https://docs.deno.com/api/deno/~/Deno.stdin) instance methods +instead. ```diff - await Deno.read(Deno.stdin.rid, buffer); @@ -671,8 +678,8 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.stdout.rid` -Use [`Deno.stdout`](https://deno.land/api?s=Deno.stdout) instance methods -instead. +Use [`Deno.stdout`](https://docs.deno.com/api/deno/~/Deno.stdout) instance +methods instead. ```diff - await Deno.read(Deno.stdout.rid, buffer); @@ -693,8 +700,8 @@ See [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.TcpConn.rid` -Use [`Deno.TcpConn`](https://deno.land/api?s=Deno.TcpConn) instance methods -instead. +Use [`Deno.TcpConn`](https://docs.deno.com/api/deno/~/Deno.TcpConn) instance +methods instead. ```diff - await Deno.read(tcpConn.rid, buffer); @@ -720,8 +727,8 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.TlsConn.rid` -Use [`Deno.TlsConn`](https://deno.land/api?s=Deno.TlsConn) instance methods -instead. +Use [`Deno.TlsConn`](https://docs.deno.com/api/deno/~/Deno.TlsConn) instance +methods instead. ```diff - await Deno.read(tlsConn.rid, buffer); @@ -747,8 +754,8 @@ See the [Deno 1.40 blog post][Deno 1.40 blog post] for details. ### `Deno.UnixConn.rid` -Use [`Deno.UnixConn`](https://deno.land/api?s=Deno.UnixConn) instance methods -instead. +Use [`Deno.UnixConn`](https://docs.deno.com/api/deno/~/Deno.UnixConn) instance +methods instead. ```diff - await Deno.read(unixConn.rid, buffer); @@ -870,8 +877,8 @@ See [deno#9795][deno#9795] for details. ### `new Deno.FsFile()` -Use [`Deno.openSync()`](https://deno.land/api?s=Deno.openSync) or -[`Deno.open()`](https://deno.land/api?s=Deno.open) instead. +Use [`Deno.openSync()`](https://docs.deno.com/api/deno/~/Deno.openSync) or +[`Deno.open()`](https://docs.deno.com/api/deno/~/Deno.open) instead. ```diff - const file = new Deno.FsFile(3); diff --git a/runtime/manual/basics/debugging_your_code.md b/runtime/manual/basics/debugging_your_code.md index e6311540a..e5e870d4f 100644 --- a/runtime/manual/basics/debugging_your_code.md +++ b/runtime/manual/basics/debugging_your_code.md @@ -52,16 +52,14 @@ deno run --inspect-brk your_script.ts ## Example with Chrome DevTools Let's try debugging a program using Chrome Devtools. For this, we'll use -[file_server.ts](https://deno.land/std/http/file_server.ts) from `std`, a static -file server. +[@std/http/file-server](https://jsr.io/@std/http#file-server), a static file +server. Use the `--inspect-brk` flag to break execution on the first line: ```shell -$ deno run --inspect-brk --allow-read --allow-net https://deno.land/std@0.224.0/http/file_server.ts +$ deno run --inspect-brk --allow-read --allow-net jsr:@std/http@1.0.0-rc.5/file-server Debugger listening on ws://127.0.0.1:9229/ws/1e82c406-85a9-44ab-86b6-7341583480b1 -Download https://deno.land/std@0.224.0/http/file_server.ts -Compile https://deno.land/std@0.224.0/http/file_server.ts ... ``` diff --git a/runtime/manual/basics/env_variables.md b/runtime/manual/basics/env_variables.md index 40100000a..9dc37b5c4 100644 --- a/runtime/manual/basics/env_variables.md +++ b/runtime/manual/basics/env_variables.md @@ -7,7 +7,7 @@ There are a few ways to use environment variables in Deno: ## Built-in `Deno.env` The Deno runtime offers built-in support for environment variables with -[`Deno.env`](https://deno.land/api@v1.25.3?s=Deno.env). +[`Deno.env`](https://docs.deno.com/api/deno/~/Deno.env). `Deno.env` has getter and setter methods. Here is example usage: diff --git a/runtime/manual/basics/modules/module_metadata.md b/runtime/manual/basics/modules/module_metadata.md index 8e5efc9d0..32882a544 100644 --- a/runtime/manual/basics/modules/module_metadata.md +++ b/runtime/manual/basics/modules/module_metadata.md @@ -8,24 +8,27 @@ oldUrl: - [import.meta](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta) can provide information on the context of the module. -- The boolean [import.meta.main](https://deno.land/api?s=ImportMeta#prop_main) +- The boolean + [import.meta.main](https://docs.deno.com/api/web/~/ImportMeta#property_main) will let you know if the current module is the program entry point. -- The string [import.meta.url](https://deno.land/api?s=ImportMeta#prop_url) will - give you the URL of the current module. - The string - [import.meta.filename](https://deno.land/api?s=ImportMeta#prop_filename) will - give you the fully resolved path to the current module. _For local modules - only_. + [import.meta.url](https://docs.deno.com/api/web/~/ImportMeta#property_url) + will give you the URL of the current module. - The string - [import.meta.dirname](https://deno.land/api?s=ImportMeta#prop_dirname) will - give you the fully resolved path to the directory containing the current + [import.meta.filename](https://docs.deno.com/api/web/~/ImportMeta#property_filename) + will give you the fully resolved path to the current module. _For local + modules only_. +- The string + [import.meta.dirname](https://docs.deno.com/api/web/~/ImportMeta#property_dirname) + will give you the fully resolved path to the directory containing the current module. _For local modules only_. -- The [import.meta.resolve](https://deno.land/api?s=ImportMeta#prop_resolve) +- The + [import.meta.resolve](https://docs.deno.com/api/web/~/ImportMeta#property_resolve) allows you to resolve specifier relative to the current module. This function takes into account an import map (if one was provided on startup). -- The string [Deno.mainModule](https://deno.land/api?s=Deno.mainModule) will - give you the URL of the main module entry point, i.e. the module invoked by - the deno runtime. +- The string [Deno.mainModule](https://docs.deno.com/api/deno/~/Deno.mainModule) + will give you the URL of the main module entry point, i.e. the module invoked + by the deno runtime. ## Example diff --git a/runtime/manual/basics/modules/reloading_modules.md b/runtime/manual/basics/modules/reloading_modules.md index a4a31fc66..1d52927c4 100644 --- a/runtime/manual/basics/modules/reloading_modules.md +++ b/runtime/manual/basics/modules/reloading_modules.md @@ -22,17 +22,6 @@ deno cache --reload my_module.ts Sometimes we want to upgrade only some modules. You can control it by passing an argument to a `--reload` flag. -

- To reload all 0.224.0 standard modules: -

- -```bash -deno cache --reload=https://deno.land/std@0.224.0 my_module.ts -``` - -To reload specific modules (in this example - colors and file system copy) use a -comma to separate URLs. - ```bash -deno cache --reload=https://deno.land/std@0.224.0/fs/copy.ts,https://deno.land/std@0.224.0/fmt/colors.ts my_module.ts +deno cache --reload=jsr:@std/fs my_module.ts ``` diff --git a/runtime/manual/basics/permissions.md b/runtime/manual/basics/permissions.md index 49e74aec7..90b6fa31a 100644 --- a/runtime/manual/basics/permissions.md +++ b/runtime/manual/basics/permissions.md @@ -44,7 +44,7 @@ The following permissions are available: interfaces from the following list: `hostname`, `osRelease`, `osUptime`, `loadavg`, `networkInterfaces`, `systemMemoryInfo`, `uid`, and `gid`. These strings map to functions in the `Deno` namespace that provide OS info, like - [Deno.systemMemoryInfo](https://deno.land/api?s=Deno.SystemMemoryInfo). + [Deno.systemMemoryInfo](https://docs.deno.com/api/deno/~/Deno.SystemMemoryInfo). - **--allow-hrtime** Allow high-resolution time measurement. High-resolution time can be used in timing attacks and fingerprinting. - **--allow-net=\** Allow network access. You can specify an diff --git a/runtime/manual/basics/testing/assertions.md b/runtime/manual/basics/testing/assertions.md index bac263f0e..67b15a9ed 100644 --- a/runtime/manual/basics/testing/assertions.md +++ b/runtime/manual/basics/testing/assertions.md @@ -3,11 +3,11 @@ title: "Assertions" --- To help developers write tests the Deno standard library comes with a built-in -[assertions module](https://deno.land/std/assert/mod.ts) which can be imported -from `https://deno.land/std/assert/mod.ts`. +[assertions module](https://jsr.io/@std/assert) which can be imported from +`jsr:@std/assert@1`. ```js -import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assert } from "htjsr:@std/assert@1"; Deno.test("Hello Test", () => { assert("Hello"); @@ -16,7 +16,7 @@ Deno.test("Hello Test", () => { > ⚠️ Some popular assertion libraries, like [Chai](https://www.chaijs.com/), can > be used in Deno too, for example usage see -> https://deno.land/std/testing/chai_example.ts. +> [chai_example.ts](https://gist.github.com/lucacasonato/002dbcf6bb974cc788678b89257ecc01). The assertions module provides 14 assertions: @@ -36,7 +36,7 @@ The assertions module provides 14 assertions: - `assertRejects(fn: () => Promise, ErrorClass?: Constructor, msgIncludes?: string | undefined, msg?: string | undefined): Promise` In addition to the above assertions, the -[snapshot module](https://deno.land/std/testing/snapshot.ts) also exposes an +[snapshot module](https://jsr.io/@std/testing/doc/snapshot/~) also exposes an `assertSnapshot` function. The documentation for this module can be found [here](./snapshot_testing.md). @@ -127,10 +127,7 @@ That's especially true when working with decimal numbers, where `assertStrictEquals()` may work in some cases but not in others: ```ts -import { - assertStrictEquals, - assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertStrictEquals, assertThrows } from "jsr:@std/assert@1"; Deno.test("Test Assert Strict Equals with float numbers", () => { assertStrictEquals(0.25 + 0.25, 0.25); @@ -144,10 +141,7 @@ close enough to be considered equals. Default tolerance is set to `1e-7` though it is possible to change it by passing a third optional parameter. ```ts -import { - assertAlmostEquals, - assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertAlmostEquals, assertThrows } from "jsr:@std/assert@1"; Deno.test("Test Assert Almost Equals", () => { assertAlmostEquals(0.1 + 0.2, 0.3); @@ -163,7 +157,7 @@ To check if an object is an instance of a specific constructor, you can use the passed in variable has a specific type: ```ts -import { assertInstanceOf } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertInstanceOf } from "jsr:@std/assert@1"; Deno.test("Test Assert Instance Type", () => { const variable = new Date() as unknown; @@ -306,14 +300,13 @@ Deno.test("Test Assert Equal Fail Custom Message", () => { ## Custom Tests -While Deno comes with powerful -[assertions modules](https://deno.land/std/assert/mod.ts) but there is always -something specific to the project you can add. Creating +While Deno comes with powerful [assertions modules](https://jsr.io/@jsr/assert) +but there is always something specific to the project you can add. Creating `custom assertion function` can improve readability and reduce the amount of code. ```ts -import { AssertionError } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { AssertionError } from "jsr:@std/assert@1"; function assertPowerOf(actual: number, expected: number, msg?: string): void { let received = actual; diff --git a/runtime/manual/basics/testing/behavior_driven_development.md b/runtime/manual/basics/testing/behavior_driven_development.md index e2ea72152..448bb7842 100644 --- a/runtime/manual/basics/testing/behavior_driven_development.md +++ b/runtime/manual/basics/testing/behavior_driven_development.md @@ -2,9 +2,10 @@ title: "Behavior-Driven Development" --- -With the [bdd.ts](https://deno.land/std/testing/bdd.ts) module you can write -your tests in a familiar format for grouping tests and adding setup/teardown -hooks used by other JavaScript testing frameworks like Jasmine, Jest, and Mocha. +With the [@std/testing/bdd](https://jsr.io/@std/testing/doc/bdd/~) module you +can write your tests in a familiar format for grouping tests and adding +setup/teardown hooks used by other JavaScript testing frameworks like Jasmine, +Jest, and Mocha. The `describe` function creates a block that groups together several related tests. The `it` function registers an individual test case. @@ -86,15 +87,38 @@ following sections there are examples of how the same test could be written with both styles. ```ts -// https://deno.land/std/testing/bdd_examples/user_test.ts +// user.ts +export class User { + static users: Map = new Map(); + age?: number; + + constructor(public name: string) { + if (User.users.has(name)) { + throw new Deno.errors.AlreadyExists(`User ${name} already exists`); + } + User.users.set(name, this); + } + + getAge(): number { + if (!this.age) { + throw new Error("Age unknown"); + } + return this.age; + } + + setAge(age: number) { + this.age = age; + } +} +``` + +```ts import { assertEquals, assertStrictEquals, assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { - User, -} from "https://deno.land/std@0.224.0/testing/bdd_examples/user.ts"; +} from "jsr:@std/assert@1"; +import { User } from "./user.ts"; Deno.test("User.users initially empty", () => { assertEquals(User.users.size, 0); @@ -133,21 +157,13 @@ the new test suite it creates. The hooks can be created within it or be added to the options argument for describe. ```ts -// https://deno.land/std/testing/bdd_examples/user_nested_test.ts import { assertEquals, assertStrictEquals, assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { - afterEach, - beforeEach, - describe, - it, -} from "https://deno.land/std@0.224.0/testing/bdd.ts"; -import { - User, -} from "https://deno.land/std@0.224.0/testing/bdd_examples/user.ts"; +} from "jsr:@std/assert@1"; +import { afterEach, beforeEach, describe, it } from "@std/testing@0.225.3/bdd"; +import { User } from "./user.ts"; describe("User", () => { it("users initially empty", () => { @@ -197,16 +213,13 @@ callback. The gives you the ability to have test grouping without any extra indentation in front of the grouped tests. ```ts -// https://deno.land/std/testing/bdd_examples/user_flat_test.ts import { assertEquals, assertStrictEquals, assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { describe, it } from "https://deno.land/std@0.224.0/testing/bdd.ts"; -import { - User, -} from "https://deno.land/std@0.224.0/testing/bdd_examples/user.ts"; +} from "jsr:@std/assert@1"; +import { describe, it } from "@std/testing@0.225.3/bdd"; +import { User } from "./user.ts"; const userTests = describe("User"); @@ -256,16 +269,13 @@ be useful if you'd like to create deep groupings without all the extra indentation in front of each line. ```ts -// https://deno.land/std/testing/bdd_examples/user_mixed_test.ts import { assertEquals, assertStrictEquals, assertThrows, -} from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { describe, it } from "https://deno.land/std@0.224.0/testing/bdd.ts"; -import { - User, -} from "https://deno.land/std@0.224.0/testing/bdd_examples/user.ts"; +} from "jsr:@std/assert@1"; +import { describe, it } from "jsr:@std/testing@0.225.3/bdd"; +import { User } from "./user.ts"; describe("User", () => { it("users initially empty", () => { diff --git a/runtime/manual/basics/testing/index.md b/runtime/manual/basics/testing/index.md index 167320da5..ce5d0c1a2 100644 --- a/runtime/manual/basics/testing/index.md +++ b/runtime/manual/basics/testing/index.md @@ -13,7 +13,7 @@ Firstly, let's create a file `url_test.ts` and register a test case using ```ts // url_test.ts -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertEquals } from "jsr:@std/assert@1"; Deno.test("url test", () => { const url = new URL("./foo.js", "https://deno.land/"); @@ -39,7 +39,7 @@ switching between the forms (eg. when you need to quickly focus a single test for debugging, using `only: true` option): ```ts -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertEquals } from "jsr:@std/assert@1"; // Compact form: name and function Deno.test("hello world #1", () => { @@ -90,7 +90,7 @@ You can also test asynchronous code by passing a test function that returns a promise. For this you can use the `async` keyword when defining a function: ```ts -import { delay } from "https://deno.land/std@0.224.0/async/delay.ts"; +import { delay } from "jsr:@std/async@1/delay"; Deno.test("async hello world", async () => { const x = 1 + 2; @@ -110,7 +110,7 @@ The test steps API provides a way to report distinct steps within a test and do setup and teardown code within that test. ```ts -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertEquals } from "jsr:@std/assert@1"; import { Client } from "https://deno.land/x/postgres@v0.15.0/mod.ts"; interface User { @@ -458,7 +458,7 @@ around `bar` and call `foo(spy)` in the testing code: ```js import sinon from "npm:sinon"; -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertEquals } from "jsr:@std/assert@1"; import { bar, foo } from "./my_file.js"; Deno.test("calls bar during execution of foo", () => { @@ -498,7 +498,7 @@ And then `import` in a test file: ```js import sinon from "npm:sinon"; -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertEquals } from "jsr:@std/assert@1"; import { foo, funcs } from "./my_file.js"; Deno.test("calls bar during execution of foo", () => { diff --git a/runtime/manual/basics/testing/mocking.md b/runtime/manual/basics/testing/mocking.md index 807ff954c..cf03c36ca 100644 --- a/runtime/manual/basics/testing/mocking.md +++ b/runtime/manual/basics/testing/mocking.md @@ -16,8 +16,7 @@ need a way to spy on the `multiply` function. There are a few ways to achieve this with Spies, one is to have the `square` function take the `multiply` as a parameter. -```ts -// https://deno.land/std/testing/mock_examples/parameter_injection.ts +```ts title="math.ts" export function multiply(a: number, b: number): number { return a * b; } @@ -34,18 +33,14 @@ This way, we can call `square(multiply, value)` in the application code or wrap a spy function around the `multiply` function and call `square(multiplySpy, value)` in the testing code. -```ts -// https://deno.land/std/testing/mock_examples/parameter_injection_test.ts +```ts title="math_test.ts" import { assertSpyCall, assertSpyCalls, spy, -} from "https://deno.land/std@0.224.0/testing/mock.ts"; -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { - multiply, - square, -} from "https://deno.land/std@0.224.0/testing/mock_examples/parameter_injection.ts"; +} from "jsr:@std/testing@0.225.3/mock"; +import { assertEquals } from "jsr:@std/assert@1"; +import { multiply, square } from "./math.ts"; Deno.test("square calls multiply and returns results", () => { const multiplySpy = spy(multiply); @@ -69,8 +64,7 @@ exported `_internals` object has the `multiply` function we want to call as a method and the `square` function calls `_internals.multiply` instead of `multiply`. -```ts -// https://deno.land/std/testing/mock_examples/internals_injection.ts +```ts title="math_with_internals.ts" export function multiply(a: number, b: number): number { return a * b; } @@ -87,18 +81,14 @@ code. Then spy on the `multiply` method on the `_internals` object in the testing code to be able to spy on how the `square` function calls the `multiply` function. -```ts -// https://deno.land/std/testing/mock_examples/internals_injection_test.ts +```ts title="math_with_internals_test.ts" import { assertSpyCall, assertSpyCalls, spy, -} from "https://deno.land/std@0.224.0/testing/mock.ts"; -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { - _internals, - square, -} from "https://deno.land/std@0.224.0/testing/mock_examples/internals_injection.ts"; +} from "jsr:@std/testing@0.225.3/mock"; +import { assertEquals } from "jsr:@std/assert@1"; +import { _internals, square } from "./math_with_internals.ts"; Deno.test("square calls multiply and returns results", () => { const multiplySpy = spy(_internals, "multiply"); @@ -153,8 +143,7 @@ similar to the second spying technique example but instead of passing the call through to the original `randomInt` function, we are going to replace `randomInt` with a function that returns pre-defined values. -```ts -// https://deno.land/std/testing/mock_examples/random.ts +```ts title="random.ts" export function randomInt(lowerBound: number, upperBound: number): number { return lowerBound + Math.floor(Math.random() * (upperBound - lowerBound)); } @@ -170,19 +159,15 @@ The mock module includes some helper functions to make creating common stubs easy. The `returnsNext` function takes an array of values we want it to return on consecutive calls. -```ts -// https://deno.land/std/testing/mock_examples/random_test.ts +```ts title="random_test.ts" import { assertSpyCall, assertSpyCalls, returnsNext, stub, -} from "https://deno.land/std@0.224.0/testing/mock.ts"; -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; -import { - _internals, - randomMultiple, -} from "https://deno.land/std@0.224.0/testing/mock_examples/random.ts"; +} from "jsr:@std/testing@0.225.3/mock"; +import { assertEquals } from "jsr:@std/assert@1"; +import { _internals, randomMultiple } from "./random.ts"; Deno.test("randomMultiple uses randomInt to generate random multiples between -10 and 10 times the value", () => { const randomIntStub = stub(_internals, "randomInt", returnsNext([-3, 3])); @@ -219,8 +204,7 @@ you fake time, you could simulate how your function would behave over time starting from any point in time. Below is an example where we want to test that the callback is called every second. -```ts -// https://deno.land/std/testing/mock_examples/interval.ts +```ts title="interval.ts" export function secondInterval(cb: () => void): number { return setInterval(cb, 1000); } @@ -232,34 +216,26 @@ and `clearInterval` globals are replaced with versions that use the fake time until real time is restored. You can control how time ticks forward with the `tick` method on the `FakeTime` instance. -```ts -// https://deno.land/std/testing/mock_examples/interval_test.ts -import { - assertSpyCalls, - spy, -} from "https://deno.land/std@0.224.0/testing/mock.ts"; -import { FakeTime } from "https://deno.land/std@0.224.0/testing/time.ts"; -import { secondInterval } from "https://deno.land/std@0.224.0/testing/mock_examples/interval.ts"; +```ts title="interval_test.ts" +import { assertSpyCalls, spy } from "jsr:@std/testing@0.225.3/mock"; +import { FakeTime } from "jsr:@std/testing@0.225.3/time.ts"; +import { secondInterval } from "./interval.ts"; Deno.test("secondInterval calls callback every second and stops after being cleared", () => { - const time = new FakeTime(); - - try { - const cb = spy(); - const intervalId = secondInterval(cb); - assertSpyCalls(cb, 0); - time.tick(500); - assertSpyCalls(cb, 0); - time.tick(500); - assertSpyCalls(cb, 1); - time.tick(3500); - assertSpyCalls(cb, 4); - - clearInterval(intervalId); - time.tick(1000); - assertSpyCalls(cb, 4); - } finally { - time.restore(); - } + using time = new FakeTime(); + + const cb = spy(); + const intervalId = secondInterval(cb); + assertSpyCalls(cb, 0); + time.tick(500); + assertSpyCalls(cb, 0); + time.tick(500); + assertSpyCalls(cb, 1); + time.tick(3500); + assertSpyCalls(cb, 4); + + clearInterval(intervalId); + time.tick(1000); + assertSpyCalls(cb, 4); }); ``` diff --git a/runtime/manual/basics/testing/snapshot_testing.md b/runtime/manual/basics/testing/snapshot_testing.md index 928c677f3..e895e8f2e 100644 --- a/runtime/manual/basics/testing/snapshot_testing.md +++ b/runtime/manual/basics/testing/snapshot_testing.md @@ -3,7 +3,7 @@ title: "Snapshot Testing" --- The Deno standard library comes with a -[snapshot module](https://deno.land/std/testing/snapshot.ts), which enables +[snapshot module](https://jsr.io/@std/testing/doc/snapshot/~), which enables developers to write tests which assert a value against a reference snapshot. This reference snapshot, is a serialized representation of the original value and is stored alongside the test file. @@ -22,9 +22,7 @@ to a reference snapshot, which is stored alongside the test file in the `__snapshots__` directory. ```ts title="example_test.ts" -import { - assertSnapshot, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; +import { assertSnapshot } from "jsr:@std/testing@0.225.3/snapshot"; Deno.test("isSnapshotMatch", async function (t): Promise { const a = { @@ -91,9 +89,7 @@ The `assertSnapshot` function can also be called with an options object which offers greater flexibility and enables some non standard use cases. ```ts -import { - assertSnapshot, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; +import { assertSnapshot } from "jsr:@std/testing@0.225.3/snapshot"; Deno.test("isSnapshotMatch", async function (t): Promise { const a = { @@ -119,11 +115,8 @@ update mode, and in assert mode will be compared to the snapshot stored in the snapshot file. ```ts title="example_test.ts" -import { - assertSnapshot, - serialize, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; -import { stripColor } from "https://deno.land/std@0.224.0/fmt/colors.ts"; +import { assertSnapshot, serialize } from "jsr:@std/testing@0.225.3/snapshot"; +import { stripColor } from "jsr:@std/fmt@0.225.6/colors"; /** * Serializes `actual` and removes ANSI escape codes. @@ -207,9 +200,7 @@ the test step will be used. However, if specified, the `name` option will be used instead. ```ts title="example_test.ts" -import { - assertSnapshot, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; +import { assertSnapshot } from "jsr:@std/testing@0.225.3/snapshot"; Deno.test("isSnapshotMatch", async function (t): Promise { const a = { @@ -247,9 +238,7 @@ error message, which includes the diff for failed snapshots. You can configure default options for `assertSnapshot`. ```ts title="example_test.ts" -import { - createAssertSnapshot, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; +import { createAssertSnapshot } from "jsr:@std/testing@0.225.3/snapshot"; const assertSnapshot = createAssertSnapshot({ // options @@ -265,10 +254,8 @@ It is possible to "extend" an `assertSnapshot` function which has been configured with default options. ```ts title="example_test.ts" -import { - createAssertSnapshot, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; -import { stripColor } from "https://deno.land/std@0.224.0/fmt/colors.ts"; +import { createAssertSnapshot } from "jsr:@std/testing@0.225.3/snapshot"; +import { stripColor } from "jsr:@std/fmt@0.225.6/colors"; const assertSnapshot = createAssertSnapshot({ dir: ".snaps", @@ -308,9 +295,7 @@ whenever the object is passed to `assertSnapshot`. This can be useful in many cases. One example is shown in the code snippet below. ```ts title="example_test.ts" -import { - assertSnapshot, -} from "https://deno.land/std@0.224.0/testing/snapshot.ts"; +import { assertSnapshot } from "jsr:@std/testing@0.225.3/snapshot"; class HTMLTag { constructor( diff --git a/runtime/manual/getting_started/first_steps.md b/runtime/manual/getting_started/first_steps.md index 06a7a6d55..33687274d 100644 --- a/runtime/manual/getting_started/first_steps.md +++ b/runtime/manual/getting_started/first_steps.md @@ -71,7 +71,7 @@ For APIs that don't exist as a web standard (like accessing variables from the system environment, or manipulating the file system), those APIs are exposed in the [Deno namespace](../runtime/builtin_apis.md). Replace the contents of `hello.ts` with the following code, which will start -[an HTTP server](https://deno.land/api?s=Deno.serve) on +[an HTTP server](https://docs.deno.com/api/deno/~/Deno.serve) on [localhost:8000](http://localhost:8000). ```ts @@ -278,8 +278,8 @@ Create a `deno.json` file with the following contents. ```js title="deno.json" { "imports": { - // The dollar sign in front of "std" isn't special - it's an optional - // convention to show that $std is an alias set up in an import map + // The dollar sign in front of "assert" isn't special - it's an optional + // convention to show that $assert is an alias set up in an import map "$assert": "jsr:@std/assert@^1.0.0" } } diff --git a/runtime/manual/node/_category_.json b/runtime/manual/node/_category_.json deleted file mode 100644 index 028bd1979..000000000 --- a/runtime/manual/node/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Node and npm modules", - "position": 4, - "link": { - "type": "doc", - "id": "index" - } -} diff --git a/runtime/manual/node/how_to_with_npm/prisma.md b/runtime/manual/node/how_to_with_npm/prisma.md index 33eb347ae..63b721e6d 100644 --- a/runtime/manual/node/how_to_with_npm/prisma.md +++ b/runtime/manual/node/how_to_with_npm/prisma.md @@ -103,9 +103,6 @@ And in `./prisma/seed.ts`: ```ts import { Prisma, PrismaClient } from "../generated/client/deno/edge.ts"; -import { load } from "https://deno.land/std@0.224.0/dotenv/mod.ts"; - -const envVars = await load(); const prisma = new PrismaClient({ datasources: { @@ -148,9 +145,14 @@ await prisma.$disconnect(); We can now run `seed.ts` with: ```shell -deno run -A prisma/seed.ts +deno run -A --env prisma/seed.ts ``` +> [!TIP] +> +> The `--env` flag is used to tell Deno to load environment variables from the +> `.env` file. + After doing so, your Prisma dashboard should show the new dinosaurs: ![New dinosaurs are in Prisma dashboard](../../images/how-to/prisma/1-dinosaurs-in-prisma.png) @@ -171,9 +173,6 @@ Then, in your `main.ts` file: ```ts import { PrismaClient } from "./generated/client/deno/edge.ts"; import { Application, Router } from "https://deno.land/x/oak@v11.1.0/mod.ts"; -import { load } from "https://deno.land/std@0.224.0/dotenv/mod.ts"; - -const envVars = await load(); /** * Initialize. @@ -251,7 +250,7 @@ await app.listen({ port: 8000 }); Now, let's run it: ```shell -deno run -A main.ts +deno run -A --env main.ts ``` Let's visit `localhost:8000/dinosaurs`: diff --git a/runtime/manual/references/_category_.json b/runtime/manual/references/_category_.json deleted file mode 100644 index ffcde14e1..000000000 --- a/runtime/manual/references/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "References", - "position": 9, - "link": { - "type": "doc", - "id": "index" - } -} diff --git a/runtime/manual/references/contributing/architecture.md b/runtime/manual/references/contributing/architecture.md index 943064da8..64811a46d 100644 --- a/runtime/manual/references/contributing/architecture.md +++ b/runtime/manual/references/contributing/architecture.md @@ -4,15 +4,15 @@ title: "Internal Details" ## Deno and Linux analogy -| **Linux** | **Deno** | -| ------------------------------: | :------------------------------- | -| Processes | Web Workers | -| Syscalls | Ops | -| File descriptors (fd) | [Resource ids (rid)](#resources) | -| Scheduler | Tokio | -| Userland: libc++ / glib / boost | https://deno.land/std/ | -| /proc/\$\$/stat | [Deno.metrics()](#metrics) | -| man pages | deno types | +| **Linux** | **Deno** | +| ------------------------------: | :--------------------------------- | +| Processes | Web Workers | +| Syscalls | Ops | +| File descriptors (fd) | [Resource ids (rid)](#resources) | +| Scheduler | Tokio | +| Userland: libc++ / glib / boost | https://jsr.io/@std | +| /proc/\$\$/stat | [Deno.metrics()](#metrics) | +| man pages | deno types / https://docs.deno.com | ### Resources diff --git a/runtime/manual/references/contributing/index.md b/runtime/manual/references/contributing/index.md index 2ba9abe0e..f961fad28 100644 --- a/runtime/manual/references/contributing/index.md +++ b/runtime/manual/references/contributing/index.md @@ -98,17 +98,11 @@ Languages: **Rust** ### [`deno_doc`](https://github.com/denoland/deno_doc) -Documentation generator that powers `deno doc` subcommand and -https://doc.deno.land +Documentation generator that powers `deno doc` subcommand, and reference +documentation on https://docs.deno.com/api, and https://jsr.io. Languages: **Rust** -### [`docland`](https://github.com/denoland/docland) - -Frontend for documentation generator: https://doc.deno.land - -Languages: **TypeScript**, TSX, CSS - ### [`rusty_v8`](https://github.com/denoland/rusty_v8) Rust bindings for the V8 JavaScript engine. Very technical and low-level. diff --git a/runtime/manual/references/contributing/style_guide.md b/runtime/manual/references/contributing/style_guide.md index 4cb867f48..4395c3c50 100644 --- a/runtime/manual/references/contributing/style_guide.md +++ b/runtime/manual/references/contributing/style_guide.md @@ -181,10 +181,12 @@ export function pwrite(options: PWrite) {} ``` Note: When one of the arguments is a function, you can adjust the order -flexibly. See examples like [Deno.serve](https://deno.land/api?s=Deno.serve), -[Deno.test](https://deno.land/api?s=Deno.test), -[Deno.addSignalListener](https://deno.land/api?s=Deno.addSignalListener). See -also [this post](https://twitter.com/jaffathecake/status/1646798390355697664). +flexibly. See examples like +[Deno.serve](https://docs.deno.com/api/deno/~/Deno.serve), +[Deno.test](https://docs.deno.com/api/deno/~/Deno.test), +[Deno.addSignalListener](https://docs.deno.com/api/deno/~/Deno.addSignalListener). +See also +[this post](https://twitter.com/jaffathecake/status/1646798390355697664). ### Export all interfaces that are used as parameters to an exported member @@ -322,7 +324,7 @@ foo() returns bar object ... ok Example of test: ```ts -import { assertEquals } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assertEquals } from "@std/assert"; import { foo } from "./mod.ts"; Deno.test("foo() returns bar object", function () { @@ -358,7 +360,7 @@ export function foo(): string { #### Do not depend on external code. -`https://deno.land/std/` is intended to be baseline functionality that all Deno +`https://jsr.io/@std` is intended to be baseline functionality that all Deno programs can rely on. We want to guarantee to users that this code does not include potentially unreviewed third-party code. diff --git a/runtime/manual/references/index.md b/runtime/manual/references/index.md index 1b2ae14c8..ddc7df4a8 100644 --- a/runtime/manual/references/index.md +++ b/runtime/manual/references/index.md @@ -4,8 +4,8 @@ title: "References" This chapter contains links to reference manuals and sheets, including: -- [Deno Standard APIs](https://deno.land/api) -- [Standard Library](https://deno.land/std?doc) +- [Deno built-in APIs](https://docs.deno.com/api/deno/) +- [Standard Library](https://jsr.io/@std) - [Deno-native third party modules](https://deno.land/x) - [Full Guide to Using Visual Studio Code](./vscode_deno/index.md) - [Node to Deno Cheatsheet](./cheatsheet.md) diff --git a/runtime/manual/references/vscode_deno/index.md b/runtime/manual/references/vscode_deno/index.md index 092d976f7..fe6227b43 100644 --- a/runtime/manual/references/vscode_deno/index.md +++ b/runtime/manual/references/vscode_deno/index.md @@ -193,7 +193,7 @@ editor. When you have a block of code that provides a test, like: ```ts -import { assert } from "https://deno.land/std@0.224.0/assert/mod.ts"; +import { assert } from "jsr:@std/assert@1"; Deno.test({ name: "a test case", diff --git a/runtime/manual/runtime/builtin_apis.md b/runtime/manual/runtime/builtin_apis.md index 29c4e1b3c..b78608e59 100644 --- a/runtime/manual/runtime/builtin_apis.md +++ b/runtime/manual/runtime/builtin_apis.md @@ -1,5 +1,5 @@ --- -title: "Deno namespace APIs" +title: "Deno Namespace APIs" oldUrl: /runtime/manual/runtime/ --- @@ -8,40 +8,13 @@ APIs for reading from files, opening TCP sockets, serving HTTP, and executing subprocesses, etc. For a full list of Deno Built-in APIs, see the -[reference](https://deno.land/api?s=Deno). Below we highlight some of the most -important. - -## Errors - -The Deno runtime comes with [20 error classes](https://deno.land/api#Errors) -that can be raised in response to a number of conditions. - -Some examples are: - -```sh -Deno.errors.NotFound; -Deno.errors.WriteZero; -``` - -They can be used as below: - -```ts -try { - const file = await Deno.open("./some/file.txt"); -} catch (error) { - if (error instanceof Deno.errors.NotFound) { - console.error("the file was not found"); - } else { - // otherwise re-throw - throw error; - } -} -``` +[reference](https://docs.deno.com/api/deno/~/Deno). Below we highlight some of +the most important. ## File System The Deno runtime comes with -[various functions for working with files and directories](https://deno.land/api#File_System). +[various functions for working with files and directories](https://docs.deno.com/api/deno/file-system). You will need to use --allow-read and --allow-write permissions to gain access to the file system. @@ -53,31 +26,49 @@ functions. - [Reading a text file (`Deno.readTextFile`)](../../tutorials/read_write_files.md#reading-a-text-file) - [Writing a text file (`Deno.writeTextFile`)](../../tutorials/read_write_files.md#writing-a-text-file) -## I/O +## Network The Deno runtime comes with -[built-in functions for working with resources and I/O](https://deno.land/api#I/O). +[built-in functions for dealing with connections to network ports](https://docs.deno.com/api/deno/network). Refer to the links below for code examples for common functions. -- [Closing resources (`Deno.close`)](https://doc.deno.land/deno/stable/~/Deno.close) -- [Seeking a certain position within the resource (`Deno.seek`)](https://doc.deno.land/deno/stable/~/Deno.seek) +- [Connect to the hostname and port (`Deno.connect`)](https://docs.deno.com/api/deno/~/Deno.connect) +- [Announcing on the local transport address (`Deno.listen`)](https://docs.deno.com/api/deno/~/Deno.listen) -## Network +## Subprocesses The Deno runtime comes with -[built-in functions for dealing with connections to network ports](https://deno.land/api#Network). +[built-in functions for spinning up subprocesses](https://docs.deno.com/api/deno/sub-process). -Refer to the links below for code examples for common functions. +Refer to the links below for code samples of how to create a subprocess. -- [Connect to the hostname and port (`Deno.connect`)](https://doc.deno.land/deno/stable/~/Deno.connect) -- [Announcing on the local transport address (`Deno.listen`)](https://doc.deno.land/deno/stable/~/Deno.listen) +- [Creating a subprocess (`Deno.Command`)](../../tutorials/subprocess.md) -## Sub Process +## Errors The Deno runtime comes with -[built-in functions for spinning up subprocesses](https://deno.land/api#Sub_Process). +[20 error classes](https://docs.deno.com/api/deno/errors) that can be raised in +response to a number of conditions. -Refer to the links below for code samples of how to create a subprocess. +Some examples are: -- [Creating a subprocess (`Deno.Command`)](../../tutorials/subprocess.md) +```sh +Deno.errors.NotFound; +Deno.errors.WriteZero; +``` + +They can be used as below: + +```ts +try { + const file = await Deno.open("./some/file.txt"); +} catch (error) { + if (error instanceof Deno.errors.NotFound) { + console.error("the file was not found"); + } else { + // otherwise re-throw + throw error; + } +} +``` diff --git a/runtime/manual/runtime/http_server_apis.md b/runtime/manual/runtime/http_server_apis.md index 2760c3a6c..d6512b041 100644 --- a/runtime/manual/runtime/http_server_apis.md +++ b/runtime/manual/runtime/http_server_apis.md @@ -4,10 +4,10 @@ title: "HTTP Server APIs" Deno currently has two HTTP Server APIs: -- [`Deno.serve`](https://deno.land/api?s=Deno.serve): native, _higher-level_, - supports HTTP/1.1 and HTTP2, this is the preferred API to write HTTP servers - in Deno. -- [`Deno.serveHttp`](https://deno.land/api?s=Deno.serveHttp): native, +- [`Deno.serve`](https://docs.deno.com/api/deno/~/Deno.serve): native, + _higher-level_, supports HTTP/1.1 and HTTP2, this is the preferred API to + write HTTP servers in Deno. +- [`Deno.serveHttp`](https://docs.deno.com/api/deno/~/Deno.serveHttp): native, _low-level_, supports HTTP/1.1 and HTTP2. - [A "Hello World" server](#a-hello-world-server) - [Inspecting the incoming request](#inspecting-the-incoming-request) diff --git a/runtime/manual/runtime/index.md b/runtime/manual/runtime/index.md index 18e16955a..0f3bc68e2 100644 --- a/runtime/manual/runtime/index.md +++ b/runtime/manual/runtime/index.md @@ -2,10 +2,8 @@ title: "Runtime" --- -Documentation for all runtime functions (Web APIs + `Deno` global) can be found -at [`/api`](https://deno.land/api) or with adding the _unstable_ APIs which are -enabled via the `--unstable` flag at -[`/api?unstable`](https://deno.land/api?unstable=true). +Documentation for all runtime functions (Web APIs + `Deno` global + Node APIs) +can be found at [`/api`](https://docs.deno.com/api/deno/). ## Web Platform APIs @@ -26,3 +24,11 @@ For more details, view the chapter on [Built-in APIs](./builtin_apis.md). The TypeScript definitions for the Deno namespaces can be found in the [`lib.deno.ns.d.ts`](https://github.com/denoland/deno/blob/$CLI_VERSION/cli/tsc/dts/lib.deno.ns.d.ts) file. + +## Node APIs + +Deno also provides compatibility with Node.js APIs. For example, the `node:fs` +module can be imported and used in Deno, like it would be in Node.js. + +For more details, view the chapter on +[Node Compatibility](../node/node_specifiers.md). diff --git a/runtime/manual/runtime/permission_apis.md b/runtime/manual/runtime/permission_apis.md index 4f4fb6e03..dabbd24cc 100644 --- a/runtime/manual/runtime/permission_apis.md +++ b/runtime/manual/runtime/permission_apis.md @@ -38,8 +38,8 @@ const desc5 = { name: "hrtime" } as const; ``` > ⚠️ See -> [`PermissionDescriptor`](https://deno.land/api?s=Deno.PermissionDescriptor) in -> API reference for more details. +> [`PermissionDescriptor`](https://docs.deno.com/api/deno/~/Deno.PermissionDescriptor) +> in API reference for more details. > ⚠️ In 1.30 and onwards, synchronous API counterparts (ex. > `Deno.permissions.querySync`) exist for all the APIs described below. diff --git a/runtime/manual/runtime/stability.md b/runtime/manual/runtime/stability.md index b0c8a387f..12e97488e 100644 --- a/runtime/manual/runtime/stability.md +++ b/runtime/manual/runtime/stability.md @@ -5,30 +5,23 @@ title: "Stability" As of Deno 1.0.0, the `Deno` namespace APIs are stable. That means we will strive to make code working under 1.0.0 continue to work in future versions. -However, not all of Deno's features are ready for production yet. Features which -are not ready, because they are still in draft phase, are locked behind the -`--unstable` command line flag. - -```shell -deno run --unstable mod_which_uses_unstable_stuff.ts -``` - -Passing this flag does a few things: - -- It enables the use of unstable APIs during runtime. -- It adds the - [`lib.deno.unstable.d.ts`](https://doc.deno.land/https://raw.githubusercontent.com/denoland/deno/main/cli/tsc/dts/lib.deno.unstable.d.ts) - file to the list of TypeScript definitions that are used for type checking. - This includes the output of `deno types`. - -You should be aware that many unstable APIs have **not undergone a security -review**, are likely to have **breaking API changes** in the future, and are -**not ready for production**. - -## Standard modules - -Deno's standard modules (https://deno.land/std) are not yet stable. We currently -version the standard modules differently from the CLI to reflect this. Note that -unlike the `Deno` namespace, the use of the standard modules do not require the -`--unstable` flag (unless the standard module itself makes use of an unstable -Deno feature). +When introducing new APIs, these are first marked as unstable. This means that +the API may change in the future. These APIs are not available to use unless you +explicitly pass an unstable flag, like `--unstable-kv`. +[Learn more about `--unstable-*` flags](/runtime/manual/tools/unstable_flags). + +There are also some non-runtime features of Deno that are considered unstable, +and are locked behind unstable flags. For example, the +`--unstable-sloppy-imports` flag is used to enable `import`ing code without +specifying file extensions. + +## Standard library + +The Deno standard library (https://jsr.io/@std) is partially stable. All +standard library modules that are version 1.0.0 or higher are considered stable. +All other modules (0.x) are considered unstable, and may change in the future. + +Using unstable standard library modules is not recommended for production code, +but it is a great way to experiment with new features and provide feedback to +the Deno team. It is not necessary to use any unstable flags to use unstable +standard library modules. diff --git a/runtime/manual/runtime/web_platform_apis.md b/runtime/manual/runtime/web_platform_apis.md index ea941a970..7a2463c60 100644 --- a/runtime/manual/runtime/web_platform_apis.md +++ b/runtime/manual/runtime/web_platform_apis.md @@ -20,8 +20,7 @@ Here's a partial list of supported web platform APIs in Deno: - [Channel Messaging API](https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API) - [Compression Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API) - [Console](https://developer.mozilla.org/en-US/docs/Web/API/Console) -- [DOM APIs](https://deno.land/api@v1.26.0#DOM_APIs) -- [DOM `CustomEvent`, `EventTarget` and `EventListener`](#customevent-eventtarget-and-eventlistener) +- [Event API](https://docs.deno.com/api/web/events) - [Encoding API](https://developer.mozilla.org/en-US/docs/Web/API/Encoding_API) - [Fetch API](#fetch-api) - [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) @@ -39,8 +38,9 @@ Here's a partial list of supported web platform APIs in Deno: - [Web Workers API](https://developer.mozilla.org/en-US/docs/Web/API/Worker) - [`WebSocket`](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) -You can find the Deno reference for these APIs [here](https://deno.land/api). To -check if a Web Platform API is available in Deno, click on +You can find the Deno reference for these APIs +[here](https://docs.deno.com/api/web/). To check if a Web Platform API is +available in Deno, click on [the interface on MDN](https://developer.mozilla.org/en-US/docs/Web/API#interfaces) and refer to [its Browser Compatibility table](https://developer.mozilla.org/en-US/docs/Web/API/AbortController#browser_compatibility) @@ -125,7 +125,7 @@ Notes on fetching local files: - Response bodies are streamed from the Rust side, so large files are available in chunks, and can be cancelled. -## `CustomEvent`, `EventTarget` and `EventListener` +## `CustomEvent` and `EventTarget` ## Overview diff --git a/runtime/manual/runtime/workers.md b/runtime/manual/runtime/workers.md index c781664e6..e90d2336d 100644 --- a/runtime/manual/runtime/workers.md +++ b/runtime/manual/runtime/workers.md @@ -34,7 +34,7 @@ it's just an unfortunate interaction of features, and it also happens in all browsers that support module workers. ```ts -import { delay } from "https://deno.land/std@0.224.0/async/delay.ts"; +import { delay } from "jsr:@std/async@1/delay"; // First await: waits for a second, then continues running the module. await delay(1000); diff --git a/runtime/manual/tools/benchmarker.md b/runtime/manual/tools/benchmarker.md index 7235eaa0f..0541c1ed3 100644 --- a/runtime/manual/tools/benchmarker.md +++ b/runtime/manual/tools/benchmarker.md @@ -100,8 +100,6 @@ you want to measure. Everything outside of the section between these two calls will be excluded from the measurement. ```ts -import { readAll } from "https://deno.land/std@0.224.0/io/read_all.ts"; - Deno.bench("foo", async (b) => { // Open a file that we will act upon. const file = await Deno.open("a_big_data_file.txt"); @@ -111,7 +109,7 @@ Deno.bench("foo", async (b) => { b.start(); // Now let's measure how long it takes to read all of the data from the file. - await readAll(file); + await new Response(file.readable).arrayBuffer(); // End measurement here. b.end(); diff --git a/runtime/manual/tools/bundler.md b/runtime/manual/tools/bundler.md index 9bec753f0..7259a1938 100644 --- a/runtime/manual/tools/bundler.md +++ b/runtime/manual/tools/bundler.md @@ -14,10 +14,10 @@ Use [deno_emit](https://github.com/denoland/deno_emit), Deno, which includes all dependencies of the specified input. For example: ```bash -deno bundle https://deno.land/std/examples/colors.ts colors.bundle.js -Bundle https://deno.land/std/examples/colors.ts -Download https://deno.land/std/examples/colors.ts -Download https://deno.land/std/fmt/colors.ts +deno bundle https://deno.land/std@0.190.0/examples/colors.tsts colors.bundle.js +Bundle https://deno.land/std@0.190.0/examples/colors.ts +Download https://deno.land/std@0.190.0/examples/colors.ts +Download https://deno.land/std@0.190.0/fmt/colors.ts Emit "colors.bundle.js" (9.83KB) ``` diff --git a/runtime/manual/tools/cache.md b/runtime/manual/tools/cache.md index 9d83688cf..78704d3ec 100644 --- a/runtime/manual/tools/cache.md +++ b/runtime/manual/tools/cache.md @@ -146,13 +146,13 @@ detected from it's imports. - Cache the dependencies of a module ```bash -deno cache https://deno.land/std/http/file_server.ts +deno cache jsr:@std/http@0.225.3/file-server ``` - Force a cache update ```bash -deno cache --reload https://deno.land/std/http/file_server.ts +deno cache --reload jsr:@std/http@0.225.3/file-server ``` - Cache a known npm module diff --git a/runtime/manual/tools/check.md b/runtime/manual/tools/check.md index 4764122f9..384b08c8e 100644 --- a/runtime/manual/tools/check.md +++ b/runtime/manual/tools/check.md @@ -23,32 +23,19 @@ deno check -h|--help Type-check without execution. -```bash -deno check https://deno.land/std/http/file_server.ts +```ts name="example.ts" +const x: string = 1 + 1n; ``` -Unless `--reload` is specified, this command will not re-download already cached -dependencies. - -## Cache Location - -Modules cached are stored in `$DENO_DIR`, a centralized directory. Its location -varies by OS. For instance, on macOS, it's typically -`/Users/user/Library/Caches/deno`. - -You can see the cache location by running `deno info` with no arguments. - -## Cache Invalidation - -Future runs of this module will trigger no downloads or compilation unless the -`--reload` option is specified. +```bash +deno check example.ts +``` ## Arguments `FILE` - The module entrypoint. -The module entrypoint can be a local file or a remote URL. Dependencies are -detected from it's imports. +The module entrypoint can be a local file or a remote URL. ## Options @@ -135,50 +122,8 @@ detected from it's imports. ## Examples -- Cache the dependencies of a module - -```bash -deno check https://deno.land/std/http/file_server.ts -``` - -- Force a cache update - -```bash -deno check --reload https://deno.land/std/http/file_server.ts -``` - -- Cache a known npm module - -```bash -deno check npm:express -``` - -- Reload everything - -```bash -deno check --reload -``` - -- Reload only standard modules +- Type check a local file -```bash -deno check --reload=https://deno.land/std -``` - -- Reloads specific modules - -```bash -deno check --reload=https://deno.land/std/fs/utils.ts,https://deno.land/std/fmt/colors.ts -``` - -- Reload all npm modules - -```bash -deno check --reload=npm: -``` - -- Reload specific npm module - -```bash -deno check --reload=npm:chalk -``` + ```bash + deno check example.ts + ``` diff --git a/runtime/manual/tools/compiler.md b/runtime/manual/tools/compiler.md index 2aed28e72..33b292ff1 100644 --- a/runtime/manual/tools/compiler.md +++ b/runtime/manual/tools/compiler.md @@ -10,7 +10,7 @@ self-contained executable. ``` If you omit the `OUT` parameter, the name of the executable file will be -inferred. +inferred from the script name. ## Flags @@ -19,14 +19,14 @@ execute the script must be specified at compilation time. This includes permission flags. ```console -> deno compile --allow-read --allow-net https://deno.land/std/http/file_server.ts +> deno compile --allow-read --allow-net jsr:@std/http@1.0.0-rc.5/file-server ``` [Script arguments](../getting_started/command_line_interface.md#script-arguments) can be partially embedded. ```console -> deno compile --allow-read --allow-net https://deno.land/std/http/file_server.ts -p 8080 +> deno compile --allow-read --allow-net jsr:@std/http@1.0.0-rc.5/file-server -p 8080 > ./file_server --help ``` diff --git a/runtime/manual/tools/dependency_inspector.md b/runtime/manual/tools/dependency_inspector.md index 916d35821..ad00e0838 100644 --- a/runtime/manual/tools/dependency_inspector.md +++ b/runtime/manual/tools/dependency_inspector.md @@ -5,99 +5,93 @@ title: "`deno info`, dependency inspector" `deno info [URL]` will inspect an ES module and all of its dependencies. ```shell -deno info https://deno.land/std@0.178.0/http/file_server.ts -Download https://deno.land/std@0.178.0/http/file_server.ts -... -local: /home/deno/.cache/deno/deps/https/deno.land/cca7626bf190e39a7fec3bc79f68f356f8010f6d78afdcb43daae4accbfd4155 +$ deno info jsr:@std/http@1.0.0-rc.5/file-server +local: /home/lucacasonato/.cache/deno/deps/https/jsr.io/3a0e5ef03d2090c75c81daf771ed9a73009518adfe688c333dc11d8006dc3598 +emit: /home/lucacasonato/.cache/deno/gen/https/jsr.io/3a0e5ef03d2090c75c81daf771ed9a73009518adfe688c333dc11d8006dc3598.js type: TypeScript -dependencies: 52 unique -size: 651.67KB +dependencies: 40 unique +size: 326.42KB -https://deno.land/std@0.178.0/http/file_server.ts (19.08KB) -├─┬ https://deno.land/std@0.178.0/path/mod.ts (1.32KB) -│ ├── https://deno.land/std@0.178.0/_util/os.ts (644B) -│ ├─┬ https://deno.land/std@0.178.0/path/win32.ts (27.84KB) -│ │ ├── https://deno.land/std@0.178.0/path/_interface.ts (728B) -│ │ ├── https://deno.land/std@0.178.0/path/_constants.ts (1.97KB) -│ │ ├─┬ https://deno.land/std@0.178.0/path/_util.ts (4.9KB) -│ │ │ ├── https://deno.land/std@0.178.0/path/_interface.ts * -│ │ │ └── https://deno.land/std@0.178.0/path/_constants.ts * -│ │ └── https://deno.land/std@0.178.0/_util/asserts.ts (854B) -│ ├─┬ https://deno.land/std@0.178.0/path/posix.ts (13.53KB) -│ │ ├── https://deno.land/std@0.178.0/path/_interface.ts * -│ │ ├── https://deno.land/std@0.178.0/path/_constants.ts * -│ │ └── https://deno.land/std@0.178.0/path/_util.ts * -│ ├─┬ https://deno.land/std@0.178.0/path/common.ts (1.16KB) -│ │ └─┬ https://deno.land/std@0.178.0/path/separator.ts (259B) -│ │ └── https://deno.land/std@0.178.0/_util/os.ts * -│ ├── https://deno.land/std@0.178.0/path/separator.ts * -│ ├── https://deno.land/std@0.178.0/path/_interface.ts * -│ └─┬ https://deno.land/std@0.178.0/path/glob.ts (12.39KB) -│ ├── https://deno.land/std@0.178.0/_util/os.ts * -│ ├── https://deno.land/std@0.178.0/_util/os.ts * -│ ├── https://deno.land/std@0.178.0/path/separator.ts * -│ ├── https://deno.land/std@0.178.0/path/win32.ts * -│ └── https://deno.land/std@0.178.0/path/posix.ts * -├─┬ https://deno.land/std@0.178.0/media_types/content_type.ts (2.78KB) -│ ├─┬ https://deno.land/std@0.178.0/media_types/parse_media_type.ts (3.39KB) -│ │ └── https://deno.land/std@0.178.0/media_types/_util.ts (3.27KB) -│ ├─┬ https://deno.land/std@0.178.0/media_types/type_by_extension.ts (906B) -│ │ └─┬ https://deno.land/std@0.178.0/media_types/_db.ts (1.25KB) -│ │ ├── https://deno.land/std@0.178.0/media_types/vendor/mime-db.v1.52.0.ts (182.13KB) -│ │ └── https://deno.land/std@0.178.0/media_types/_util.ts * -│ ├─┬ https://deno.land/std@0.178.0/media_types/get_charset.ts (1.17KB) -│ │ ├── https://deno.land/std@0.178.0/media_types/parse_media_type.ts * -│ │ ├── https://deno.land/std@0.178.0/media_types/_util.ts * -│ │ └── https://deno.land/std@0.178.0/media_types/_db.ts * -│ ├─┬ https://deno.land/std@0.178.0/media_types/format_media_type.ts (1.72KB) -│ │ └── https://deno.land/std@0.178.0/media_types/_util.ts * -│ └── https://deno.land/std@0.178.0/media_types/_db.ts * -├─┬ https://deno.land/std@0.178.0/http/server.ts (21.18KB) -│ └─┬ https://deno.land/std@0.178.0/async/mod.ts (465B) -│ ├─┬ https://deno.land/std@0.178.0/async/abortable.ts (3.95KB) -│ │ └── https://deno.land/std@0.178.0/async/deferred.ts (1.51KB) -│ ├─┬ https://deno.land/std@0.178.0/async/deadline.ts (1.04KB) -│ │ └── https://deno.land/std@0.178.0/async/deferred.ts * -│ ├── https://deno.land/std@0.178.0/async/debounce.ts (2.18KB) -│ ├── https://deno.land/std@0.178.0/async/deferred.ts * -│ ├── https://deno.land/std@0.178.0/async/delay.ts (1.8KB) -│ ├─┬ https://deno.land/std@0.178.0/async/mux_async_iterator.ts (2.45KB) -│ │ └── https://deno.land/std@0.178.0/async/deferred.ts * -│ ├── https://deno.land/std@0.178.0/async/pool.ts (3.13KB) -│ ├── https://deno.land/std@0.178.0/async/tee.ts (2.1KB) -│ └── https://deno.land/std@0.178.0/async/retry.ts (2.35KB) -├── https://deno.land/std@0.178.0/http/http_status.ts (9.96KB) -├─┬ https://deno.land/std@0.178.0/flags/mod.ts (22.05KB) -│ └── https://deno.land/std@0.178.0/_util/asserts.ts * -├── https://deno.land/std@0.178.0/_util/asserts.ts * -├── https://deno.land/std@0.178.0/fmt/colors.ts (12.13KB) -├─┬ https://deno.land/std@0.178.0/http/util.ts (1020B) -│ ├── https://deno.land/std@0.178.0/http/http_status.ts * -│ └─┬ https://deno.land/std@0.178.0/collections/deep_merge.ts (10.98KB) -│ └── https://deno.land/std@0.178.0/collections/_utils.ts (790B) -├─┬ https://deno.land/std@0.178.0/crypto/crypto.ts (11.88KB) -│ ├─┬ https://deno.land/std@0.178.0/crypto/_wasm/mod.ts (1.11KB) -│ │ └── https://deno.land/std@0.178.0/crypto/_wasm/lib/deno_std_wasm_crypto.generated.mjs (238.72KB) -│ ├─┬ https://deno.land/std@0.178.0/crypto/timing_safe_equal.ts (983B) -│ │ └── https://deno.land/std@0.178.0/_util/asserts.ts * -│ └─┬ https://deno.land/std@0.178.0/crypto/_fnv/mod.ts (621B) -│ ├─┬ https://deno.land/std@0.178.0/crypto/_fnv/fnv32.ts (825B) -│ │ └── https://deno.land/std@0.178.0/crypto/_fnv/util.ts (1.44KB) -│ └─┬ https://deno.land/std@0.178.0/crypto/_fnv/fnv64.ts (1.02KB) -│ └── https://deno.land/std@0.178.0/crypto/_fnv/util.ts * -├─┬ https://deno.land/std@0.178.0/crypto/to_hash_string.ts (1021B) -│ ├── https://deno.land/std@0.178.0/encoding/hex.ts (2.23KB) -│ └── https://deno.land/std@0.178.0/encoding/base64.ts (2.48KB) -├─┬ https://deno.land/std@0.178.0/crypto/_util.ts (1.06KB) -│ └─┬ https://deno.land/std@0.178.0/crypto/mod.ts (439B) -│ ├── https://deno.land/std@0.178.0/crypto/crypto.ts * -│ ├─┬ https://deno.land/std@0.178.0/crypto/keystack.ts (5.37KB) -│ │ ├── https://deno.land/std@0.178.0/crypto/timing_safe_equal.ts * -│ │ └─┬ https://deno.land/std@0.178.0/encoding/base64url.ts (1.95KB) -│ │ └── https://deno.land/std@0.178.0/encoding/base64.ts * -│ ├── https://deno.land/std@0.178.0/crypto/timing_safe_equal.ts * -│ └── https://deno.land/std@0.178.0/crypto/to_hash_string.ts * -└── https://deno.land/std@0.178.0/version.ts (371B) +https://jsr.io/@std/http/1.0.0-rc.5/file_server.ts (24.74KB) +├─┬ https://jsr.io/@std/path/1.0.1/posix/join.ts (862B) +│ ├── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts (307B) +│ └─┬ https://jsr.io/@std/path/1.0.1/posix/normalize.ts (1.31KB) +│ ├─┬ https://jsr.io/@std/path/1.0.1/_common/normalize.ts (263B) +│ │ └── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ ├─┬ https://jsr.io/@std/path/1.0.1/_common/normalize_string.ts (2.25KB) +│ │ └── https://jsr.io/@std/path/1.0.1/_common/constants.ts (1.97KB) +│ └─┬ https://jsr.io/@std/path/1.0.1/posix/_util.ts (391B) +│ └── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +├── https://jsr.io/@std/path/1.0.1/posix/normalize.ts * +├─┬ https://jsr.io/@std/path/1.0.1/extname.ts (906B) +│ ├── https://jsr.io/@std/path/1.0.1/_os.ts (736B) +│ ├─┬ https://jsr.io/@std/path/1.0.1/posix/extname.ts (2.28KB) +│ │ ├── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +│ │ ├── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ │ └── https://jsr.io/@std/path/1.0.1/posix/_util.ts * +│ └─┬ https://jsr.io/@std/path/1.0.1/windows/extname.ts (2.5KB) +│ ├── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +│ ├── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ └─┬ https://jsr.io/@std/path/1.0.1/windows/_util.ts (828B) +│ └── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +├─┬ https://jsr.io/@std/path/1.0.1/join.ts (926B) +│ ├── https://jsr.io/@std/path/1.0.1/_os.ts * +│ ├── https://jsr.io/@std/path/1.0.1/posix/join.ts * +│ └─┬ https://jsr.io/@std/path/1.0.1/windows/join.ts (2.41KB) +│ ├── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ ├── https://jsr.io/@std/path/1.0.1/windows/_util.ts * +│ └─┬ https://jsr.io/@std/path/1.0.1/windows/normalize.ts (3.84KB) +│ ├── https://jsr.io/@std/path/1.0.1/_common/normalize.ts * +│ ├── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +│ ├── https://jsr.io/@std/path/1.0.1/_common/normalize_string.ts * +│ └── https://jsr.io/@std/path/1.0.1/windows/_util.ts * +├─┬ https://jsr.io/@std/path/1.0.1/relative.ts (1.08KB) +│ ├── https://jsr.io/@std/path/1.0.1/_os.ts * +│ ├─┬ https://jsr.io/@std/path/1.0.1/posix/relative.ts (3.25KB) +│ │ ├── https://jsr.io/@std/path/1.0.1/posix/_util.ts * +│ │ ├─┬ https://jsr.io/@std/path/1.0.1/posix/resolve.ts (1.84KB) +│ │ │ ├── https://jsr.io/@std/path/1.0.1/_common/normalize_string.ts * +│ │ │ ├── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ │ │ └── https://jsr.io/@std/path/1.0.1/posix/_util.ts * +│ │ └─┬ https://jsr.io/@std/path/1.0.1/_common/relative.ts (287B) +│ │ └── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ └─┬ https://jsr.io/@std/path/1.0.1/windows/relative.ts (4.24KB) +│ ├── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +│ ├─┬ https://jsr.io/@std/path/1.0.1/windows/resolve.ts (5.02KB) +│ │ ├── https://jsr.io/@std/path/1.0.1/_common/constants.ts * +│ │ ├── https://jsr.io/@std/path/1.0.1/_common/normalize_string.ts * +│ │ ├── https://jsr.io/@std/path/1.0.1/_common/assert_path.ts * +│ │ └── https://jsr.io/@std/path/1.0.1/windows/_util.ts * +│ └── https://jsr.io/@std/path/1.0.1/_common/relative.ts * +├─┬ https://jsr.io/@std/path/1.0.1/resolve.ts (1.02KB) +│ ├── https://jsr.io/@std/path/1.0.1/_os.ts * +│ ├── https://jsr.io/@std/path/1.0.1/posix/resolve.ts * +│ └── https://jsr.io/@std/path/1.0.1/windows/resolve.ts * +├─┬ https://jsr.io/@std/path/1.0.1/constants.ts (705B) +│ └── https://jsr.io/@std/path/1.0.1/_os.ts * +├─┬ https://jsr.io/@std/media-types/1.0.2/content_type.ts (3.09KB) +│ ├─┬ https://jsr.io/@std/media-types/1.0.2/parse_media_type.ts (3.54KB) +│ │ └── https://jsr.io/@std/media-types/1.0.2/_util.ts (3.18KB) +│ ├─┬ https://jsr.io/@std/media-types/1.0.2/get_charset.ts (1.45KB) +│ │ ├── https://jsr.io/@std/media-types/1.0.2/parse_media_type.ts * +│ │ ├── https://jsr.io/@std/media-types/1.0.2/_util.ts * +│ │ └─┬ https://jsr.io/@std/media-types/1.0.2/_db.ts (1.34KB) +│ │ ├── https://jsr.io/@std/media-types/1.0.2/vendor/db.ts (190.69KB) +│ │ └── https://jsr.io/@std/media-types/1.0.2/_util.ts * +│ ├─┬ https://jsr.io/@std/media-types/1.0.2/format_media_type.ts (2.45KB) +│ │ └── https://jsr.io/@std/media-types/1.0.2/_util.ts * +│ ├── https://jsr.io/@std/media-types/1.0.2/_db.ts * +│ └─┬ https://jsr.io/@std/media-types/1.0.2/type_by_extension.ts (1.15KB) +│ └── https://jsr.io/@std/media-types/1.0.2/_db.ts * +├─┬ https://jsr.io/@std/http/1.0.0-rc.5/etag.ts (6.46KB) +│ └─┬ https://jsr.io/@std/encoding/1.0.1/base64.ts (3.18KB) +│ └── https://jsr.io/@std/encoding/1.0.1/_validate_binary_like.ts (798B) +├── https://jsr.io/@std/http/1.0.0-rc.5/status.ts (13.39KB) +├── https://jsr.io/@std/streams/1.0.0-rc.4/byte_slice_stream.ts (2.57KB) +├── https://jsr.io/@std/cli/1.0.0/parse_args.ts (21.94KB) +├── https://jsr.io/@std/http/1.0.0-rc.5/deno.json (415B) +├── https://jsr.io/@std/fmt/1.0.0-rc.1/bytes.ts (5.3KB) +└── https://jsr.io/@std/net/1.0.0-rc.2/get_network_address.ts (1.68KB) ``` Dependency inspector works with any local or remote ES modules. diff --git a/runtime/manual/tools/repl.md b/runtime/manual/tools/repl.md index a12394080..340c1001c 100644 --- a/runtime/manual/tools/repl.md +++ b/runtime/manual/tools/repl.md @@ -52,15 +52,15 @@ into the REPL. This is useful for importing some code you commonly use in the REPL, or modifying the runtime in some way: ```console -$ deno repl --allow-net --eval 'import { assert } from "https://deno.land/std/assert/mod.ts"' -Deno 1.36.0 +$ deno repl --allow-net --eval 'import { assert } from "jsr:@std/assert@1"' +Deno 1.45.3 exit using ctrl+d, ctrl+c, or close() > assert(true) undefined > assert(false) Uncaught AssertionError - at assert (https://deno.land/std@0.197.0/assert/assert.ts:7:11) - at :2:1 + at assert (https://jsr.io/@std/assert/1.0.0/assert.ts:21:11) + at :1:22 ``` ## `--eval-file` flag @@ -76,14 +76,14 @@ If `--eval` is also specified, then `--eval-file` files are run before the `--eval` code. ```console -$ deno repl --eval-file=https://examples.deno.land/hello-world.ts,https://deno.land/std/encoding/ascii85.ts -Download https://examples.deno.land/hello-world.ts -Hello, World! -Download https://deno.land/std/encoding/ascii85.ts -Deno 1.20.5 +$ deno repl --eval-file=https://docs.deno.com/examples/welcome.ts,https://docs.deno.com/examples/local.ts +Download https://docs.deno.com/examples/welcome.ts +Welcome to Deno! +Download https://docs.deno.com/examples/local.ts +Deno 1.45.3 exit using ctrl+d or close() -> rfc1924 // local (not exported) variable defined in ascii85.ts -"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~" +> local // this variable is defined locally in local.ts, but not exported +"This is a local variable inside of local.ts" ``` ### Relative Import Path Resolution @@ -95,15 +95,10 @@ This can cause "Module not found" errors when `--eval-file` is used with module files: ```console -$ deno repl --eval-file=https://deno.land/std/hash/md5.ts -error in --eval-file file https://deno.land/std/hash/md5.ts. Uncaught TypeError: Module not found "file:///home/encoding/hex.ts". +$ deno repl --eval-file=https://jsr.io/@std/encoding/1.0.0/ascii85.ts +error in --eval-file file https://jsr.io/@std/encoding/1.0.0/ascii85.ts. Uncaught TypeError: Module not found "file:///home/_validate_binary_like.ts". at async :2:13 -Deno 1.20.5 -exit using ctrl+d or close() -> close() -$ deno repl --eval-file=https://deno.land/std/encoding/hex.ts -Download https://deno.land/std/encoding/hex.ts -Deno 1.20.5 +Deno 1.45.3 exit using ctrl+d or close() > ``` @@ -115,7 +110,7 @@ Tab completions are crucial feature for quick navigation in REPL. After hitting ```console $ deno repl -Deno 1.14.3 +Deno 1.45.3 exit using ctrl+d or close() > Deno.read readTextFile readFile readDirSync readLinkSync readAll read diff --git a/runtime/manual/tools/script_installer.md b/runtime/manual/tools/script_installer.md index 92886cac5..f036ffc9c 100644 --- a/runtime/manual/tools/script_installer.md +++ b/runtime/manual/tools/script_installer.md @@ -2,6 +2,8 @@ title: "`deno install`, script installer" --- + + Deno provides `deno install` to easily install and distribute executable code. `deno install [OPTIONS...] [URL] [SCRIPT_ARGS...]` will install the script diff --git a/runtime/manual/tools/unstable_flags.md b/runtime/manual/tools/unstable_flags.md index aed6d04fe..6120639cb 100644 --- a/runtime/manual/tools/unstable_flags.md +++ b/runtime/manual/tools/unstable_flags.md @@ -219,19 +219,17 @@ Enable unstable FFI APIs - Enable unstable file system APIs in the `Deno` namespace. These APIs include: -- [`Deno.flock`](https://deno.land/api?unstable=&s=Deno.flock) -- [`Deno.flockSync`](https://deno.land/api?unstable=&s=Deno.flockSync) -- [`Deno.funlock`](https://deno.land/api?unstable=&s=Deno.funlock) -- [`Deno.funlockSync`](https://deno.land/api?unstable=&s=Deno.funlockSync) -- [`Deno.umask`](https://deno.land/api?unstable=&s=Deno.umask) +- [`Deno.flock`](https://docs.deno.com/api/deno/~/Deno.flock) +- [`Deno.flockSync`](https://docs.deno.com/api/deno/~/Deno.flockSync) +- [`Deno.funlock`](https://docs.deno.com/api/deno/~/Deno.funlock) +- [`Deno.funlockSync`](https://docs.deno.com/api/deno/~/Deno.funlockSync) +- [`Deno.umask`](https://docs.deno.com/api/deno/~/Deno.umask) ## `--unstable-net` Enable unstable net APIs in the `Deno` namespace. These APIs include: -- [`Deno.DatagramConn`](https://deno.land/api?unstable=&s=Deno.DatagramConn) -- Many more - for the latest list, check the "Show Unstable API" checkbox in the - [API reference](https://deno.land/api?unstable=) +- [`Deno.DatagramConn`](https://docs.deno.com/api/deno/~/Deno.DatagramConn) ## `--unstable` diff --git a/runtime/tutorials/fetch_data.md b/runtime/tutorials/fetch_data.md index bf93a8986..c7d9eb06b 100644 --- a/runtime/tutorials/fetch_data.md +++ b/runtime/tutorials/fetch_data.md @@ -61,10 +61,11 @@ try { Like in browsers, sending and receiving large files is possible thanks to the [Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API). -[`Deno.FsFile`](https://deno.land/api?s=Deno.FsFile) API provides two -properties: [`readable`](https://deno.land/api?s=Deno.FsFile#prop_readable) and -[`writable`](https://deno.land/api?s=Deno.FsFile#prop_writable), which can be -used to convert a Deno file into a writable or readable stream. +[`Deno.FsFile`](https://docs.deno.com/api/deno/~/Deno.FsFile) API provides two +properties: +[`readable`](https://docs.deno.com/api/deno/~/Deno.FsFile#property_readable) and +[`writable`](https://docs.deno.com/api/deno/~/Deno.FsFile#property_writable), +which can be used to convert a Deno file into a writable or readable stream. **Command:** `deno run --allow-read --allow-write --allow-net fetch_file.ts` diff --git a/runtime/tutorials/file_server.md b/runtime/tutorials/file_server.md index b7d175f22..c32e2e648 100644 --- a/runtime/tutorials/file_server.md +++ b/runtime/tutorials/file_server.md @@ -6,8 +6,8 @@ oldUrl: ## Concepts -- Use [Deno.open](https://deno.land/api?s=Deno.open) to read a file's content in - chunks. +- Use [Deno.open](https://docs.deno.com/api/deno/~/Deno.open) to read a file's + content in chunks. - Transform a Deno file into a [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream). - Use Deno's integrated HTTP server to run your own file server. @@ -64,24 +64,24 @@ async function handleHttp(conn: Deno.Conn) { ## Using the `std/http` file server The Deno standard library provides you with a -[file server](https://deno.land/std/http/file_server.ts) so that you don't have +[file server](https://jsr.io/@std/http/doc/file-server/~) so that you don't have to write your own. To use it, first install the remote script to your local file system. This will install the script to the Deno installation root's bin directory, e.g. -`/home/alice/.deno/bin/file_server`. +`/home/alice/.deno/bin/file-server`. ```shell -deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts +deno install --allow-net --allow-read jsr:@std/http@1.0.0-rc.5/file-server ``` You can now run the script with the simplified script name. Run it: ```shell -$ file_server . -Downloading https://deno.land/std/http/file_server.ts... +$ file-server . [...] -HTTP server listening on http://0.0.0.0:4507/ +Listening on: +- Local: http://0.0.0.0:4507 ``` Now go to [http://0.0.0.0:4507/](http://0.0.0.0:4507/) in your web browser to @@ -90,7 +90,7 @@ see your local directory contents. The complete list of options are available via: ```shell -file_server --help +file-server --help ``` Example output: @@ -99,7 +99,7 @@ Example output: Deno File Server Serves a local directory in HTTP. INSTALL: - deno install --allow-net --allow-read https://deno.land/std/http/file_server.ts + deno install --allow-net --allow-read jsr:@std/http@1.0.0-rc.5/file_server USAGE: file_server [path] [options] OPTIONS: diff --git a/runtime/tutorials/file_system_events.md b/runtime/tutorials/file_system_events.md index 2a444778a..9dfeb9dd9 100644 --- a/runtime/tutorials/file_system_events.md +++ b/runtime/tutorials/file_system_events.md @@ -6,8 +6,8 @@ oldUrl: ## Concepts -- Use [Deno.watchFs](https://deno.land/api?s=Deno.watchFs) to watch for file - system events. +- Use [Deno.watchFs](https://docs.deno.com/api/deno/~/Deno.watchFs) to watch for + file system events. - Results may vary between operating systems. ## Example diff --git a/runtime/tutorials/hashbang.md b/runtime/tutorials/hashbang.md index 538a63098..ddbe3c791 100644 --- a/runtime/tutorials/hashbang.md +++ b/runtime/tutorials/hashbang.md @@ -71,5 +71,5 @@ $ ./my_script Hello! ``` -[Deno.env]: https://deno.land/api?s=Deno.env +[Deno.env]: https://docs.deno.com/api/deno/~/Deno.env [env]: https://www.man7.org/linux/man-pages/man1/env.1.html diff --git a/runtime/tutorials/how_to_with_npm/prisma.md b/runtime/tutorials/how_to_with_npm/prisma.md index d43ff5171..0e5f6c0e8 100644 --- a/runtime/tutorials/how_to_with_npm/prisma.md +++ b/runtime/tutorials/how_to_with_npm/prisma.md @@ -101,9 +101,6 @@ And in `./prisma/seed.ts`: ```ts import { Prisma, PrismaClient } from "../generated/client/deno/edge.ts"; -import { load } from "https://deno.land/std@0.224.0/dotenv/mod.ts"; - -const envVars = await load(); const prisma = new PrismaClient({ datasourceUrl: envVars.DATABASE_URL, @@ -142,9 +139,14 @@ await prisma.$disconnect(); We can now run `seed.ts` with: ```shell -deno run -A prisma/seed.ts +deno run -A --env prisma/seed.ts ``` +> [!TIP] +> +> The `--env` flag is used to tell Deno to load environment variables from the +> `.env` file. + After doing so, you should be able to see your data on Prisma Studio by running the following command: @@ -172,9 +174,6 @@ Then, in your `main.ts` file: ```ts import { PrismaClient } from "./generated/client/deno/edge.ts"; import { Application, Router } from "https://deno.land/x/oak@v11.1.0/mod.ts"; -import { load } from "https://deno.land/std@0.224.0/dotenv/mod.ts"; - -const envVars = await load(); /** * Initialize. @@ -252,7 +251,7 @@ await app.listen({ port: 8000 }); Now, let's run it: ```shell -deno run -A main.ts +deno run -A --env main.ts ``` Let's visit `localhost:8000/dinosaurs`: diff --git a/runtime/tutorials/module_metadata.md b/runtime/tutorials/module_metadata.md index 8e5efc9d0..32882a544 100644 --- a/runtime/tutorials/module_metadata.md +++ b/runtime/tutorials/module_metadata.md @@ -8,24 +8,27 @@ oldUrl: - [import.meta](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import.meta) can provide information on the context of the module. -- The boolean [import.meta.main](https://deno.land/api?s=ImportMeta#prop_main) +- The boolean + [import.meta.main](https://docs.deno.com/api/web/~/ImportMeta#property_main) will let you know if the current module is the program entry point. -- The string [import.meta.url](https://deno.land/api?s=ImportMeta#prop_url) will - give you the URL of the current module. - The string - [import.meta.filename](https://deno.land/api?s=ImportMeta#prop_filename) will - give you the fully resolved path to the current module. _For local modules - only_. + [import.meta.url](https://docs.deno.com/api/web/~/ImportMeta#property_url) + will give you the URL of the current module. - The string - [import.meta.dirname](https://deno.land/api?s=ImportMeta#prop_dirname) will - give you the fully resolved path to the directory containing the current + [import.meta.filename](https://docs.deno.com/api/web/~/ImportMeta#property_filename) + will give you the fully resolved path to the current module. _For local + modules only_. +- The string + [import.meta.dirname](https://docs.deno.com/api/web/~/ImportMeta#property_dirname) + will give you the fully resolved path to the directory containing the current module. _For local modules only_. -- The [import.meta.resolve](https://deno.land/api?s=ImportMeta#prop_resolve) +- The + [import.meta.resolve](https://docs.deno.com/api/web/~/ImportMeta#property_resolve) allows you to resolve specifier relative to the current module. This function takes into account an import map (if one was provided on startup). -- The string [Deno.mainModule](https://deno.land/api?s=Deno.mainModule) will - give you the URL of the main module entry point, i.e. the module invoked by - the deno runtime. +- The string [Deno.mainModule](https://docs.deno.com/api/deno/~/Deno.mainModule) + will give you the URL of the main module entry point, i.e. the module invoked + by the deno runtime. ## Example diff --git a/runtime/tutorials/os_signals.md b/runtime/tutorials/os_signals.md index 335f95ce2..12d10a5d6 100644 --- a/runtime/tutorials/os_signals.md +++ b/runtime/tutorials/os_signals.md @@ -8,9 +8,9 @@ oldUrl: ## Concepts -- [Deno.addSignalListener()](https://deno.land/api?s=Deno.addSignalListener) can - be used to capture and monitor OS signals. -- [Deno.removeSignalListener()](https://deno.land/api?s=Deno.removeSignalListener) +- [Deno.addSignalListener()](https://docs.deno.com/api/deno/~/Deno.addSignalListener) + can be used to capture and monitor OS signals. +- [Deno.removeSignalListener()](https://docs.deno.com/api/deno/~/Deno.removeSignalListener) can be used to stop watching the signal. ## Set up an OS signal listener diff --git a/runtime/tutorials/read_write_files.md b/runtime/tutorials/read_write_files.md index b34821b7c..55e40f9c7 100644 --- a/runtime/tutorials/read_write_files.md +++ b/runtime/tutorials/read_write_files.md @@ -7,12 +7,13 @@ oldUrl: ## Concepts - Deno's runtime API provides the - [Deno.readTextFile](https://deno.land/api?s=Deno.readTextFile) and - [Deno.writeTextFile](https://deno.land/api?s=Deno.writeTextFile) asynchronous - functions for reading and writing entire text files. + [Deno.readTextFile](https://docs.deno.com/api/deno/~/Deno.readTextFile) and + [Deno.writeTextFile](https://docs.deno.com/api/deno/~/Deno.writeTextFile) + asynchronous functions for reading and writing entire text files. - Like many of Deno's APIs, synchronous alternatives are also available. See - [Deno.readTextFileSync](https://deno.land/api?s=Deno.readTextFileSync) and - [Deno.writeTextFileSync](https://deno.land/api?s=Deno.writeTextFileSync). + [Deno.readTextFileSync](https://docs.deno.com/api/deno/~/Deno.readTextFileSync) + and + [Deno.writeTextFileSync](https://docs.deno.com/api/deno/~/Deno.writeTextFileSync). - Use `--allow-read` and `--allow-write` permissions to gain access to the file system. @@ -20,8 +21,8 @@ oldUrl: Interacting with the filesystem to read and write files is a common requirement. Deno provides a number of ways to do this via the -[standard library](https://deno.land/std) and the -[Deno runtime API](https://deno.land/api). +[standard library](https://jsr.io/@std) and the +[Deno runtime API](https://docs.deno.com/api/deno/). As highlighted in the [Fetch Data example](./fetch_data.md), Deno restricts access to Input / Output by default for security reasons. Therefore when diff --git a/runtime/tutorials/subprocess.md b/runtime/tutorials/subprocess.md index b499761f0..0f270f427 100644 --- a/runtime/tutorials/subprocess.md +++ b/runtime/tutorials/subprocess.md @@ -7,13 +7,13 @@ oldUrl: ## Concepts - Deno is capable of spawning a subprocess via - [Deno.Command](https://deno.land/api?s=Deno.Command). + [Deno.Command](https://docs.deno.com/api/deno/~/Deno.Command). - `--allow-run` permission is required to spawn a subprocess. - Spawned subprocesses do not run in a security sandbox. - Communicate with the subprocess via the - [stdin](https://deno.land/api?s=Deno.stdin), - [stdout](https://deno.land/api?s=Deno.stdout) and - [stderr](https://deno.land/api?s=Deno.stderr) streams. + [stdin](https://docs.deno.com/api/deno/~/Deno.stdin), + [stdout](https://docs.deno.com/api/deno/~/Deno.stdout) and + [stderr](https://docs.deno.com/api/deno/~/Deno.stderr) streams. ## Simple example @@ -70,7 +70,7 @@ This example is the equivalent of running `yes &> ./process_output` in bash. import { mergeReadableStreams, -} from "https://deno.land/std@0.224.0/streams/merge_readable_streams.ts"; +} from "jsr:@std/streams@1.0.0-rc.4/merge-readable-streams"; // create the file to attach the process to const file = await Deno.open("./process_output.txt", { diff --git a/runtime/tutorials/tcp_echo.md b/runtime/tutorials/tcp_echo.md index 122dae93f..5a5a2e772 100644 --- a/runtime/tutorials/tcp_echo.md +++ b/runtime/tutorials/tcp_echo.md @@ -7,10 +7,12 @@ oldUrl: ## Concepts - Listening for TCP port connections with - [Deno.listen](https://deno.land/api?s=Deno.listen). -- Use [Deno.Conn.readable](https://deno.land/api?s=Deno.Conn#prop_readable) and - [Deno.Conn.writable](https://deno.land/api?s=Deno.Conn#prop_writable) to take - inbound data and redirect it to be outbound data. + [Deno.listen](https://docs.deno.com/api/deno/~/Deno.listen). +- Use + [Deno.Conn.readable](https://docs.deno.com/api/deno/~/Deno.Conn#property_readable) + and + [Deno.Conn.writable](https://docs.deno.com/api/deno/~/Deno.Conn#property_writable) + to take inbound data and redirect it to be outbound data. ## Example diff --git a/runtime/tutorials/tcp_server.md b/runtime/tutorials/tcp_server.md index f4b117c33..f85750f59 100644 --- a/runtime/tutorials/tcp_server.md +++ b/runtime/tutorials/tcp_server.md @@ -21,7 +21,7 @@ For security reasons, Deno does not allow programs to access the network without explicit permission. To allow accessing the network, use a command-line flag: ```shell -deno run --allow-net https://deno.land/std/examples/echo_server.ts +deno run --allow-net https://deno.land/std@0.190.0/examples/echo_server.ts ``` To test it, try sending data to it with `netcat` (or `telnet` on Windows): diff --git a/runtime/tutorials/unix_cat.md b/runtime/tutorials/unix_cat.md index 384091725..9d605341b 100644 --- a/runtime/tutorials/unix_cat.md +++ b/runtime/tutorials/unix_cat.md @@ -7,15 +7,15 @@ oldUrl: ## Concepts - Use the Deno runtime API to output the contents of a file to the console. -- [Deno.args](https://deno.land/api?s=Deno.args) accesses the command line - arguments. -- [Deno.open](https://deno.land/api?s=Deno.open) is used to get a handle to a - file. -- [Deno.stdout.writable](https://deno.land/api?s=Deno.stdout.writable) is used - to get a writable stream to the console standard output. -- [Deno.FsFile.readable](https://deno.land/api?s=Deno.FsFile#prop_readable) is - used to get a readable stream from the file. (This readable stream closes the - file when it is finished reading, so it is not necessary to close the file +- [Deno.args](https://docs.deno.com/api/deno/~/Deno.args) accesses the command + line arguments. +- [Deno.open](https://docs.deno.com/api/deno/~/Deno.open) is used to get a + handle to a file. +- [Deno.stdout.writable](https://docs.deno.com/api/deno/~/Deno.stdout.writable) + is used to get a writable stream to the console standard output. +- [Deno.FsFile.readable](https://docs.deno.com/api/deno/~/Deno.FsFile#property_readable) + is used to get a readable stream from the file. (This readable stream closes + the file when it is finished reading, so it is not necessary to close the file explicitly.) - Modules can be run directly from remote URLs. @@ -37,5 +37,5 @@ for (const filename of Deno.args) { To run the program: ```shell -deno run --allow-read https://deno.land/std/examples/cat.ts /etc/passwd +deno run --allow-read https://deno.land/std@0.190.0/examples/cat.ts /etc/passwd ``` diff --git a/static/examples/local.ts b/static/examples/local.ts new file mode 100644 index 000000000..2c4b00c15 --- /dev/null +++ b/static/examples/local.ts @@ -0,0 +1 @@ +const local = "This is a local variable inside of local.ts";