From 005fcb8ffaaad6a72d3a70c70be9d3699bab4ddf Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Mon, 29 Apr 2024 10:32:34 +0100 Subject: [PATCH 01/10] update cli docs for lsp (#445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek Iwańczuk --- runtime/manual/tools/lsp.md | 52 +++++++++++++++++++++++++++++++++++++ sidebars/runtime.js | 5 ++++ 2 files changed, 57 insertions(+) create mode 100644 runtime/manual/tools/lsp.md diff --git a/runtime/manual/tools/lsp.md b/runtime/manual/tools/lsp.md new file mode 100644 index 000000000..dd0020788 --- /dev/null +++ b/runtime/manual/tools/lsp.md @@ -0,0 +1,52 @@ +# deno lsp + +Starts the Deno language server. The language server is used by editors to provide features like intellisense, code formatting, and more. + +## Command + +`deno lsp [OPTIONS]` + +## Synopsis + +```bash +deno lsp [-q|--quiet] + +deno lsp -h|--help +``` + +## Description + +The 'deno lsp' subcommand provides a way for code editors and IDEs to interact with Deno using the Language Server Protocol. + +Usually humans do not use this subcommand directly. For example, 'deno lsp' can provide IDEs with go-to-definition support and automatic code formatting. + +Read more about [how to connect editors and IDEs to 'deno lsp']( +https://deno.land/manual@v1.42.4/getting_started/setup_your_environment#editors-and-ides). + +## Arguments + +There are no required arguments for this command. + +## Options + +- `-q, --quiet` + + Suppress diagnostic output + +- `-h, --help` + + Prints help information + +## Examples + +- Run the command + +```bash +deno lsp +``` + +- Run the command 2 + +```bash +deno lsp2 +``` diff --git a/sidebars/runtime.js b/sidebars/runtime.js index 59ecd16ad..cb566c5ff 100644 --- a/sidebars/runtime.js +++ b/sidebars/runtime.js @@ -180,6 +180,11 @@ const sidebars = { label: "deno lint", id: "manual/tools/linter", }, + { + type: "doc", + label: "deno lsp", + id: "manual/tools/lsp", + }, { type: "doc", label: "deno repl", From 285ac78c948d474dae2f4726f8d4c52dedf924c6 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Mon, 29 Apr 2024 10:33:49 +0100 Subject: [PATCH 02/10] add docs for coverage command (#410) --- runtime/manual/tools/coverage.md | 149 +++++++++++++++++++++++++++++++ sidebars/runtime.js | 5 ++ 2 files changed, 154 insertions(+) create mode 100644 runtime/manual/tools/coverage.md diff --git a/runtime/manual/tools/coverage.md b/runtime/manual/tools/coverage.md new file mode 100644 index 000000000..ebab9404a --- /dev/null +++ b/runtime/manual/tools/coverage.md @@ -0,0 +1,149 @@ +# deno coverage + +Print coverage reports from coverage profiles. + +## Command + +`deno coverage [OPTIONS] ` + +## Synopsis + +```bash +deno coverage [--ignore=] [--include=] [-q|--quiet] [--exclude=] [--lcov] [--output=] [--html] [--detailed] [-h|--help] + +deno coverage -h|--help +``` + +## Description + +Print coverage reports from coverage profiles. + +By default, when you run `deno test --coverage` a coverage profile will be generated in the `/coverage` directory in the current working directory. +Subsequently you can run `deno coverage` to print a coverage report to stdout. + +```bash +deno test --coverage +deno coverage +``` + +## Inclusions and Exclusions + +By default coverage includes any of your code that exists on the local file system, and it's imports. + +You can customize the inclusions and exclusions by using the `--include` and `--exclude` options. + +You can expand the coverage to include files that are not on the local file system by using the `--include` option and customizing the regex pattern. + +```bash +deno coverage --include="^file:|https:" +``` + +The default inclusion pattern should be sufficient for most use cases, but you can customize it to be more specific about which files are included in your coverage report. + +Files that contain `test.js`, `test.ts`, `test.jsx`, or `test.tsx` in their name are excluded by default. + +This is equivalent to: + +```bash +deno coverage --exclude="test\.(js|mjs|ts|jsx|tsx)$" +``` + +This default setting prevents your test code from contributing to your coverage report. +For a URL to match it must match the include pattern and not match the exclude pattern. + +## Output Formats + +By default we support Deno's own coverage format - but you can also output coverage reports in the lcov format, or in html. + +```bash +deno coverage --lcov --output=cov.lcov +``` + +This lcov file can be used with other tools that support the lcov format. + +```bash +deno coverage --html +``` + +This will output a coverage report as a html file + +## Arguments + +`COVERAGE` + +The name of the coverage profile to use. +This coverage profile will be created as a result of running `deno test --coverage` and appears as a directory in your workspace. + +## Options + +- `--ignore=` + + Ignore coverage files + +- `--include=` + + Include source files in the report + + [default: ^file:] + +- `-q, --quiet` + + Suppress diagnostic output + +- `--exclude=` + + Exclude source files from the report + + [default: test\.(js|mjs|ts|jsx|tsx)$] + +- `--lcov` + + Output coverage report in lcov format + +- `--output=` + + Exports the coverage report in lcov format to the given file. + Filename should be passed along with '=' For example '--output=foo.lcov' + + If no `--output` option is specified then the report is written to stdout. + +- `--html` + + Output coverage report in HTML format in the given directory + +- `--detailed` + + Output coverage report in detailed format in the terminal. + +- `-h, --help` + + Print help (see a summary with '-h') + +## Examples + +- Generate a coverage report from the default coverage profile in your workspace + +```bash +deno test --coverage +deno coverage +``` + +- Generate a coverage report from a coverage profile with a custom name + +```bash +deno test --coverage=custom_profile_name +deno coverage custom_profile_name +``` + +- Only include coverage that matches a specific pattern - in this case, only include tests from main.ts + +```bash +deno coverage --include="main.ts" +``` + +- Export test coverage from the default coverage profile to an lcov file + +```bash +deno test --coverage +deno coverage --lcov --output=cov.lcov +``` diff --git a/sidebars/runtime.js b/sidebars/runtime.js index cb566c5ff..f63887077 100644 --- a/sidebars/runtime.js +++ b/sidebars/runtime.js @@ -140,6 +140,11 @@ const sidebars = { label: "deno compile", id: "manual/tools/compiler", }, + { + type: "doc", + label: "deno coverage", + id: "manual/tools/coverage", + }, { type: "doc", label: "deno doc", From e58c2c5410593abbfe788248d3b1d96a17b6ed64 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Mon, 29 Apr 2024 11:07:58 +0100 Subject: [PATCH 03/10] add docs for types (#447) --- runtime/manual/tools/types.md | 46 +++++++++++++++++++++++++++++++++++ sidebars/runtime.js | 5 ++++ 2 files changed, 51 insertions(+) create mode 100644 runtime/manual/tools/types.md diff --git a/runtime/manual/tools/types.md b/runtime/manual/tools/types.md new file mode 100644 index 000000000..52f7d7c15 --- /dev/null +++ b/runtime/manual/tools/types.md @@ -0,0 +1,46 @@ +# deno types + +Prints runtime TypeScript declarations. + +## Command + +`deno types [OPTIONS]` - Generate types into stdout. + +## Synopsis + +```bash +deno types [-q|--quiet] [OPTIONS] + +deno types -h|--help +``` + +## Description + +Generates types suitable for use with Deno runtime. +The types are printed to stdout and can be redirected to a file or used in a pipeline. + +```bash +deno types > lib.deno.d.ts +``` + +## Arguments + +There are no arguments for this command. + +## Options + +- `-q, --quiet` + + Suppress diagnostic output + +- `-h, --help` + + Print help (see a summary with '-h') + +## Examples + +- Save Deno type definitions into a d.ts file + +```bash +deno types > lib.deno.d.ts +``` diff --git a/sidebars/runtime.js b/sidebars/runtime.js index f63887077..33ab47e74 100644 --- a/sidebars/runtime.js +++ b/sidebars/runtime.js @@ -210,6 +210,11 @@ const sidebars = { label: "deno task", id: "manual/tools/task_runner", }, + { + type: "doc", + label: "deno types", + id: "manual/tools/types", + }, { type: "doc", label: "deno upgrade", From 4317cbfa156619a3afbbbcf4a0fa1b0eb6b149a3 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Mon, 29 Apr 2024 14:33:36 +0100 Subject: [PATCH 04/10] new docs for publish (#405) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Bartek Iwańczuk --- runtime/manual/tools/publish.md | 137 ++++++++++++++++++++++++++++++++ sidebars/runtime.js | 5 ++ 2 files changed, 142 insertions(+) create mode 100644 runtime/manual/tools/publish.md diff --git a/runtime/manual/tools/publish.md b/runtime/manual/tools/publish.md new file mode 100644 index 000000000..d6d246355 --- /dev/null +++ b/runtime/manual/tools/publish.md @@ -0,0 +1,137 @@ +# deno publish + +*This applies to `deno` v1.42.0. and above.* + +Publish a package or workspace to [JSR](https://jsr.io/). + +## Command + +`deno publish [OPTIONS]` - Publish the current working directory's package or workspace. + +## Synopsis + +```bash +deno publish [--token ] [-c|--config ] [-q|--quiet] +[--no-config] [--dry-run] [--allow-slow-types] [--allow-dirty] +[--no-provenance] [--check[=]] [--no-check[=]] + +deno publish -h|--help +``` + +## Description + +The `deno publish` command is used to [publish a package or workspace](https://jsr.io/docs/publishing-packages) to [JSR](https://jsr.io/). + +The command will upload the package to the registry and make it available for others to use. + +## Package Requirements + +Your package must have a `name` and `version` and an `exports` field in its `deno.json` or `jsr.json` file. + +- The `name` field must be unique and follow the `@/` convention. +- The `version` field must be a valid semver version. +- The `exports` field must point to the main entry point of the package. + +Example: + +```json title="deno.json" +{ + "name": "@scope_name/package_name", + "version": "1.0.0", + "exports": "./main.ts" +} +``` + +Before you publish your package, you must create it in the registry by visiting [JSR - Publish a package](https://jsr.io/new). + +## Arguments + +There are no required arguments for this command - it should be run from within your package or workspace directory. + +## Options + +- `--token ` + + The API token to use when publishing. If unset, interactive authentication will be used + +- `-c, --config ` + + The configuration file can be used to configure different aspects of + deno including TypeScript, linting, and code formatting. Typically the + configuration file will be called `deno.json` or `deno.jsonc` and + automatically detected; in that case this flag is not necessary. + See [https://deno.land/manual@v1.41.3/getting_started/configuration_file](https://deno.land/manual@v1.41.3/getting_started/configuration_file) + +- `-q, --quiet` + + Suppress diagnostic output + +- `--no-config` + + Disable automatic loading of the configuration file. + +- `--dry-run` + + Prepare the package for publishing performing all checks and validations without uploading + +- `--allow-slow-types` + + Allow publishing with slow types + +- `--allow-dirty` + + Allow publishing if the repository has uncommitted changed + +- `--no-provenance` + + Disable provenance attestation. Enabled by default on Github actions, publicly links the package to where it was built and published from. + +- `--check[=]` + + Set type-checking behavior. This subcommand type-checks local modules by + default, so adding --check is redundant. + If the value of '--check=all' is supplied, diagnostic errors from remote modules + will be included. + + Alternatively, the 'deno check' subcommand can be used. + +- `--no-check[=]` + + Skip type-checking. If the value of '--no-check=remote' is supplied, + diagnostic errors from remote modules will be ignored + +- `-h, --help` + + Print help (see a summary with '-h') + +## Examples + +- Publish your current workspace + +```bash +deno publish +``` + +- Publish your current workspace with a specific token, bypassing interactive authentication + +```bash +deno publish --token c00921b1-0d4f-4d18-b8c8-ac98227f9275 +``` + +- Publish and check for errors in remote modules + +```bash +deno publish --check=all +``` + +- Perform a dry run to simulate publishing. + +```bash +deno publish --dry-run +``` + +- Publish using settings from a specific configuration file + +```bash +deno publish --config custom-config.json +``` diff --git a/sidebars/runtime.js b/sidebars/runtime.js index 33ab47e74..e8982131c 100644 --- a/sidebars/runtime.js +++ b/sidebars/runtime.js @@ -184,6 +184,11 @@ const sidebars = { type: "doc", label: "deno lint", id: "manual/tools/linter", + }, + { + type: "doc", + label: "deno publish", + id: "manual/tools/publish", }, { type: "doc", From a84f8f309a0249e79832a134db7477e0761a5c9f Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 30 Apr 2024 15:02:22 +0100 Subject: [PATCH 05/10] Cli docs test (#446) --- runtime/manual/tools/test.md | 329 +++++++++++++++++++++++++++++++++++ sidebars/runtime.js | 5 + 2 files changed, 334 insertions(+) create mode 100644 runtime/manual/tools/test.md diff --git a/runtime/manual/tools/test.md b/runtime/manual/tools/test.md new file mode 100644 index 000000000..632fc9606 --- /dev/null +++ b/runtime/manual/tools/test.md @@ -0,0 +1,329 @@ +# deno test + +Run tests using Deno's built-in test runner. + +## Command + +`deno test [OPTIONS] [files]... [-- [SCRIPT_ARG]...]` + +## Synopsis + +```bash +deno test [--no-check[=]] [--import-map ] [-q|--quiet] +[--no-remote] [--no-npm] [--node-modules-dir[=]] +[--vendor[=]][-c|--config ] [--no-config] +[-r|--reload[=...]] [--lock []] [--lock-write] +[--no-lock] [--cert ] [--allow-read[=...]] [--deny-read[=...]] +[--allow-write[=...]] [--deny-write[=...]] +[--allow-net[=...]] [--deny-net[=...]] +[--allow-env[=...]] [--deny-env[=...]] +[--allow-run[=...]] [--deny-run[=...]] +[--allow-ffi[=...]] [--deny-ffi[=...]] [--allow-hrtime] [--deny-hrtime] [--allow-all] [--no-prompt] [--inspect[=]] +[--inspect-brk[=]] [--inspect-wait[=]] +[--cached-only] [--location ] [--v8-flags[=...]] +[--seed ] [--check[=]] [--ignore=...] +[--no-run] [--trace-leaks] [--doc] [--fail-fast[=]] [--allow-none] +[--filter ] [--shuffle[=]] [--coverage[=] [--parallel] +[--watch] [--watch-exclude[=...]] [--no-clear-screen] [--junit-path ] [--reporter ] [--env[=]] ... [-- [SCRIPT_ARG]...] + +deno test -h|--help +``` + +## Description + +Evaluate the given modules, run all tests declared with 'Deno.test()' and report +results to standard output: + +```bash +deno test +``` + +Directory arguments are expanded to all contained files matching the glob +`{__,_.,}test.{js,mjs,ts,mts,jsx,tsx}` + +The test runner is rich in functionality and supports a number of options. + +It can be executed in watch mode (`--watch`), supports parallel execution (`--parallel`), and can be configured to run tests in a random order with (`--shuffle`). Additionally, there is built in support for code coverage (`--coverage`) and leak detection (`--trace-leaks`). + +## Arguments + +`FILES` + +List of file names to run + +`SCRIPT_ARG` + +Arguments passed to script files + +## Options + +- `--no-check[=]`\ + Skip type-checking. If the value of '--no-check=remote' is supplied, diagnostic errors from remote modules will be ignored. + +- `--import-map `\ + Load [import map](https://docs.deno.com/runtime/manual/basics/import_maps) file from local file or remote URL. + +- `-q, --quiet` + Suppress diagnostic output + +- `--no-remote`\ + Do not resolve remote modules + +- `--no-npm`\ + Do not resolve npm modules + +- `--node-modules-dir[=]`\ + Enables or disables the use of a local node_modules folder for npm packages. + [possible values: true, false] + +- `--vendor[=]`\ + UNSTABLE: Enables or disables the use of a local vendor folder for remote modules and node_modules folder for npm packages. + [possible values: true, false] + +- `-c, --config ` + The [configuration file](https://deno.land/manual/getting_started/configuration_file) can be used to configure different aspects of deno including TypeScript, linting, and code formatting. Typically the configuration file will be called `deno.json` or `deno.jsonc` and automatically detected; in that case this flag is not necessary. + +- `--no-config`\ + Disable automatic loading of the configuration file. + +- `-r, --reload[=...]` + Reload source code cache (recompile TypeScript) + + `--reload` + Reload everything + `--reload=jsr:@std/http/file-server` + Reload only standard modules + `--reload=jsr:@std/http/file-server,jsr:@std/assert/assert-equals` + Reloads specific modules + `--reload=npm:` + Reload all npm modules + `--reload=npm:chalk` + Reload specific npm module + +- `--lock []`\ + Check the specified lock file. If value is not provided, defaults to "deno.lock" in the current working directory. + +- `--lock-write`\ + Force overwriting the lock file. + +- `--no-lock`\ + Disable auto discovery of the lock file. + +- `--cert `\ + Load certificate authority from PEM encoded file + +- `--no-prompt`\ + Always throw if required permission wasn't passed + +- `--inspect[=]`\ + Activate inspector on host:port (default: 127.0.0.1:9229) + +- `--inspect-brk[=]`\ + Activate inspector on host:port, wait for debugger to connect and break at the start of user script + +- `--inspect-wait[=]`\ + Activate inspector on host:port and wait for debugger to connect before running user code + +- `--cached-only`\ + Require that remote dependencies are already cached + +- `--location `\ + Value of `globalThis.location` used by some web APIs + +- `--v8-flags[=...]`\ + To see a list of all available flags use `--v8-flags=--help`. Any flags set with this flag are appended after the `DENO_V8_FLAGS` environmental variable + +- `--seed `\ + Set the random number generator seed + +- `--check[=]`\ + Set type-checking behavior. This subcommand type-checks local modules by default, so adding `--check` is redundant. If the value of '--check=all' is supplied, diagnostic errors from remote modules will be included. Alternatively, the 'deno check' subcommand can be used. + +- `--ignore=...`\ + Ignore files + +- `--no-run`\ + Cache test modules, but don't run tests + +- `--trace-leaks`\ + Enable tracing of leaks. Useful when debugging leaking ops in test, but impacts test execution time. + +- `--doc`\ + Type-check code blocks in JSDoc and Markdown + +- `--fail-fast[=]`\ + Stop after N errors. Defaults to stopping after first failure. + +- `--allow-none`\ + Don't return error code if no test files are found + +- `--filter `\ + Run tests with this string or pattern in the test name + +- `--shuffle[=]`\ + Shuffle the order in which the tests are run + +- `--coverage[=]`\ + Collect coverage profile data into DIR. If DIR is not specified, it uses `coverage/`. + +- `--parallel`\ + Run test modules in parallel. Parallelism defaults to the number of available CPUs or the value in the DENO_JOBS environment variable. + +- `--watch`\ + Watch for file changes and restart process automatically. Only local files from entry point module graph are watched. + +- `--watch-exclude[=...]`\ + Exclude provided files/patterns from watch mode + +- `--no-clear-screen`\ + Do not clear terminal screen when under watch mode + +- `--junit-path `\ + Write a JUnit XML test report to PATH. Use `-` to write to stdout which is the default when PATH is not provided. + +- `--reporter `\ + Select reporter to use. Default to 'pretty'. + [possible values: pretty, dot, junit, tap] + +- `--env[=]`\ + UNSTABLE: Load environment variables from local file. Only the first environment variable with a given key is used. Existing process environment variables are not overwritten. + +- `-h, --help`\ + Prints help information + +
+ Permissions Options + - `--allow-read[=...]`\ + Allow [file system read access](https://deno.land/manual/basics/permissions). Optionally specify allowed paths. + Examples: `--allow-read`, `--allow-read="/etc,/var/log.txt"` + + - `--deny-read[=...]`\ + Deny [file system read access](https://deno.land/manual/basics/permissions). Optionally specify denied paths. + Examples: `--deny-read`, `--deny-read="/etc,/var/log.txt"` + + - `--allow-write[=...]`\ + Allow [file system write access](https://deno.land/manual/basics/permissions). Optionally specify allowed paths. + Examples: `--allow-write`, `--allow-write="/etc,/var/log.txt"` + + - `--deny-write[=...]`\ + Deny [file system write access](https://deno.land/manual/basics/permissions). Optionally specify denied paths. + Examples: `--deny-write`, `--deny-write="/etc,/var/log.txt"` + + - `--allow-net[=...]` \ + Allow [network access](https://deno.land/manual/basics/permissions). Optionally specify allowed IP addresses and host names, with ports as necessary. + Examples: `--allow-net`, `--allow-net="localhost:8080,deno.land"` + + - `--deny-net[=...]`\ + Deny [network access](https://deno.land/manual/basics/permissions). Optionally specify denied IP addresses and host names, with ports as necessary. + Examples: `--deny-net`, `--deny-net="localhost:8080,deno.land"` + + - `--unsafely-ignore-certificate-errors[=...]`\ + DANGER: Disables verification of TLS certificates + + - `--allow-env[=...]`\ + Allow [access to system environment information](https://deno.land/manual/basics/permissions). Optionally specify accessible environment variables. + Examples: `--allow-env`, `--allow-env="PORT,HOME,PATH"` + + - `--deny-env[=...]`\ + Deny [access to system environment information](https://deno.land/manual/basics/permissions). Optionally specify accessible environment variables. + Examples: `--deny-env`, `--deny-env="PORT,HOME,PATH"` + + - `--allow-sys[=...]`\ + Allow [access to OS information](https://deno.land/manual/basics/permissions). Optionally allow + specific APIs by function name. + Examples: `--allow-sys`, `--allow-sys="systemMemoryInfo,osRelease"` + + - `--deny-sys[=...]`\ + Deny [access to OS information](https://deno.land/manual/basics/permissions). Optionally deny + specific APIs by function name. + Examples: `--deny-sys`, `--deny-sys="systemMemoryInfo,osRelease"` + + - `--allow-run[=...]`\ + Allow [running subprocesses](https://deno.land/manual/basics/permissions). Optionally + specify allowed runnable program names. + Examples: `--allow-run`, `--allow-run="whoami,ps"` + + - `--deny-run[=...]`\ + Deny [running subprocesses](https://deno.land/manual/basics/permissions). Optionally specify denied runnable program names. + Examples: `--deny-run`, `--deny-run="whoami,ps"` + + - `--allow-ffi[=...]`\ + (Unstable) Allow loading dynamic libraries. Optionally specify [allowed directories or files](https://deno.land/manual/basics/permissions). + Examples: `--allow-ffi`, `--allow-ffi="./libfoo.so"` + + - `--deny-ffi[=...]`\ + (Unstable) Deny [loading dynamic libraries](https://deno.land/manual/basics/permissions). Optionally specify denied directories or files. + Examples: `--deny-ffi`, `--deny-ffi="./libfoo.so"` + + - `--allow-hrtime`\ + Allow [high-resolution time measurement](https://deno.land/manual/basics/permissions). Note: this can enable timing attacks and fingerprinting. + + - `--deny-hrtime`\ + Deny [high-resolution time measurement](https://deno.land/manual/basics/permissions). Note: this can prevent + timing attacks and fingerprinting. + + - `-A, --allow-all`\ + Allow [all permissions](https://deno.land/manual/basics/permissions). +
+ +## Examples + +- Run tests + +```bash +deno test +``` + +- Run tests in specific files + +```bash +deno test src/fetch_test.ts src/signal_test.ts +``` + +- Run tests where glob matches + +```bash +deno test src/*.test.ts +``` + +- Run tests and skip type-checking + +```bash +deno test --no-check +``` + +- Run tests, re-running on file change + +```bash +deno test --watch +``` + +- Reload everything + +```bash +--reload +``` + +- Reload only standard modules + +```bash +--reload=jsr:@std/http/file-server +``` + +- Reloads specific modules + +```bash +--reload=jsr:@std/http/file-server,jsr:@std/assert/assert-equals +``` + +- Reload all npm modules + +```bash +--reload=npm: +``` + +- Reload specific npm module + +```bash +--reload=npm:chalk +``` diff --git a/sidebars/runtime.js b/sidebars/runtime.js index e8982131c..b8984416a 100644 --- a/sidebars/runtime.js +++ b/sidebars/runtime.js @@ -215,6 +215,11 @@ const sidebars = { label: "deno task", id: "manual/tools/task_runner", }, + { + type: "doc", + label: "deno test", + id: "manual/tools/test", + }, { type: "doc", label: "deno types", From b00a03e5709fa33b63a592f5d8fc17ec3d78e26b Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Tue, 30 Apr 2024 15:46:59 +0100 Subject: [PATCH 06/10] add link to API reference in the site header (#449) --- docusaurus.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docusaurus.config.js b/docusaurus.config.js index 98c25785e..54857942c 100644 --- a/docusaurus.config.js +++ b/docusaurus.config.js @@ -138,6 +138,11 @@ const config = { label: "Subhosting", activeBaseRegex: `^/subhosting`, }, + { + href: "https://deno.land/api?unstable=true", + label: "API Reference", + position: "right", + }, { href: "https://www.deno.com", label: "deno.com", From e262af2d87ace8589fed483f90020faeee472d21 Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Wed, 1 May 2024 19:52:05 +0900 Subject: [PATCH 07/10] chore: update for 1.43.0 (#450) Co-authored-by: Divy Srivastava --- replacements.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/replacements.json b/replacements.json index c84865443..e21482b25 100644 --- a/replacements.json +++ b/replacements.json @@ -1,4 +1,4 @@ { - "CLI_VERSION": "1.42.4", - "STD_VERSION": "0.223.0" + "CLI_VERSION": "1.43.0", + "STD_VERSION": "0.224.0" } From 1238de71ef9b53be2b7432240d756f9c03771519 Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Wed, 1 May 2024 12:05:11 +0100 Subject: [PATCH 08/10] add docs for uninstall (#444) --- runtime/manual/tools/uninstall.md | 58 +++++++++++++++++++++++++++++++ sidebars/runtime.js | 5 +++ 2 files changed, 63 insertions(+) create mode 100644 runtime/manual/tools/uninstall.md diff --git a/runtime/manual/tools/uninstall.md b/runtime/manual/tools/uninstall.md new file mode 100644 index 000000000..a1e03e258 --- /dev/null +++ b/runtime/manual/tools/uninstall.md @@ -0,0 +1,58 @@ +# deno uninstall + +Uninstalls an executable script in the installation root's bin directory. + +## Command + +`deno uninstall [OPTIONS] ` - Uninstalls `name`. + +## Synopsis + +```bash +deno uninstall [--root ] [-g|--global] [-q|--quiet] + +deno uninstall -h|--help +``` + +## Description + +When uninstalling, the installation root is determined in the following order: + +- --root option +- DENO_INSTALL_ROOT environment variable +- $HOME/.deno + +## Arguments + +`NAME` + +The name of the script to uninstall. + +## Options + +- `--root ` + Installation root + +- `-g, --global` + Remove globally installed package or module + +- `-q, --quiet` + Suppress diagnostic output + +- `-h, --help` + + Prints help information + +## Examples + +- Uninstall `serve` + +```bash +deno uninstall serve +``` + +- Uninstall `serve` from a specific installation root + +```bash +deno uninstall --root /usr/local serve +``` diff --git a/sidebars/runtime.js b/sidebars/runtime.js index b8984416a..dcfaed7e5 100644 --- a/sidebars/runtime.js +++ b/sidebars/runtime.js @@ -225,6 +225,11 @@ const sidebars = { label: "deno types", id: "manual/tools/types", }, + { + type: "doc", + label: "deno uninstall", + id: "manual/tools/uninstall", + }, { type: "doc", label: "deno upgrade", From 4cb3ca6e1d0354fa6dd28f840ac3e09046c1bcfe Mon Sep 17 00:00:00 2001 From: denobot <33910674+denobot@users.noreply.github.com> Date: Thu, 2 May 2024 07:20:17 +0900 Subject: [PATCH 09/10] chore: update for 1.43.1 (#454) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: bartlomieju Co-authored-by: Bartek Iwańczuk --- .github/workflows/update_versions.yml | 2 +- replacements.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update_versions.yml b/.github/workflows/update_versions.yml index 52aecaf0f..ac8e4f6d7 100644 --- a/.github/workflows/update_versions.yml +++ b/.github/workflows/update_versions.yml @@ -25,4 +25,4 @@ jobs: run: | git config user.email "${{ github.actor }}@users.noreply.github.com" git config user.name "${{ github.actor }}" - deno run -A .github/workflows/update_versions.ts --create-pr + deno run -A --no-lock .github/workflows/update_versions.ts --create-pr diff --git a/replacements.json b/replacements.json index e21482b25..d63ac701e 100644 --- a/replacements.json +++ b/replacements.json @@ -1,4 +1,4 @@ { - "CLI_VERSION": "1.43.0", + "CLI_VERSION": "1.43.1", "STD_VERSION": "0.224.0" } From 9e0ba3233472600b183042104dc48528183bd28c Mon Sep 17 00:00:00 2001 From: Jo Franchetti Date: Mon, 6 May 2024 10:54:34 +0100 Subject: [PATCH 10/10] remove skypack references (#429) --- deploy/manual/dynamodb.md | 2 +- deploy/tutorials/discord-slash.md | 2 +- deploy/tutorials/tutorial-firebase.md | 6 +++--- runtime/manual/advanced/jsx_dom/jsx.md | 10 +++++----- runtime/manual/advanced/typescript/types.md | 18 +----------------- .../manual/basics/connecting_to_databases.md | 2 +- 6 files changed, 12 insertions(+), 28 deletions(-) diff --git a/deploy/manual/dynamodb.md b/deploy/manual/dynamodb.md index cc6939d33..9e896fad9 100644 --- a/deploy/manual/dynamodb.md +++ b/deploy/manual/dynamodb.md @@ -53,7 +53,7 @@ import { DynamoDBClient, GetItemCommand, PutItemCommand, -} from "https://cdn.skypack.dev/@aws-sdk/client-dynamodb?dts"; +} from "https://esm.sh/@aws-sdk/client-dynamodb?dts"; // Create a client instance by providing your region information. // The credentials are automatically obtained from environment variables which diff --git a/deploy/tutorials/discord-slash.md b/deploy/tutorials/discord-slash.md index 7d5b4d17b..5d6721f32 100644 --- a/deploy/tutorials/discord-slash.md +++ b/deploy/tutorials/discord-slash.md @@ -72,7 +72,7 @@ request with someone's slash command. } from "https://deno.land/x/sift@0.6.0/mod.ts"; // TweetNaCl is a cryptography library that we use to verify requests // from Discord. - import nacl from "https://cdn.skypack.dev/tweetnacl@v1.0.3?dts"; + import nacl from "https://esm.sh/tweetnacl@v1.0.3?dts"; // For all requests to "/" endpoint, we want to invoke home() handler. serve({ diff --git a/deploy/tutorials/tutorial-firebase.md b/deploy/tutorials/tutorial-firebase.md index e388265e3..6a013bd0f 100644 --- a/deploy/tutorials/tutorial-firebase.md +++ b/deploy/tutorials/tutorial-firebase.md @@ -180,9 +180,9 @@ libraries for Firebase under deploy. Currently v9 is in still in beta for Firebase, so we will use v8 in this tutorial: ```js title="firebase.js" -import firebase from "https://cdn.skypack.dev/firebase@8.7.0/app"; -import "https://cdn.skypack.dev/firebase@8.7.0/auth"; -import "https://cdn.skypack.dev/firebase@8.7.0/firestore"; +import firebase from "https://esm.sh/firebase@8.7.0/app"; +import "https://esm.sh/firebase@8.7.0/auth"; +import "https://esm.sh/firebase@8.7.0/firestore"; ``` We are also going to use [oak](https://deno.land/x/oak) as the middleware diff --git a/runtime/manual/advanced/jsx_dom/jsx.md b/runtime/manual/advanced/jsx_dom/jsx.md index f3acf755c..d6029fb21 100644 --- a/runtime/manual/advanced/jsx_dom/jsx.md +++ b/runtime/manual/advanced/jsx_dom/jsx.md @@ -100,15 +100,15 @@ would configure the following, in the configuration file: In situations where the import source plus `/jsx-runtime` or `/jsx-dev-runtime` is not resolvable to the correct module, an import map can be used to instruct Deno where to find the module. An import map can also be used to make the import -source "cleaner". For example, if you wanted to use Preact from skypack.dev and -have skypack.dev include all the type information, you could setup an import map -like this: +source "cleaner". For example, if you wanted to use Preact from +(esm.sh)[https://esm.sh/] and include all the type information, you could setup +an import map like this: ```json { "imports": { - "preact/jsx-runtime": "https://cdn.skypack.dev/preact/jsx-runtime?dts", - "preact/jsx-dev-runtime": "https://cdn.skypack.dev/preact/jsx-dev-runtime?dts" + "preact/jsx-runtime": "https://esm.sh/preact/jsx-runtime?dts", + "preact/jsx-dev-runtime": "https://esm.sh/preact/jsx-dev-runtime?dts" } } ``` diff --git a/runtime/manual/advanced/typescript/types.md b/runtime/manual/advanced/typescript/types.md index 968c9b03c..b35850467 100644 --- a/runtime/manual/advanced/typescript/types.md +++ b/runtime/manual/advanced/typescript/types.md @@ -233,29 +233,13 @@ file, its resolution follow the normal import rules of Deno. For a lot of the `.d.ts` files that are generated and available on the web, they may not be compatible with Deno. -To overcome this problem, some solution providers, like the -[Skypack CDN](https://www.skypack.dev/), will automatically bundle type -declarations just like they provide bundles of JavaScript as ESM. - -### Deno Friendly CDNs - -There are CDNs which host JavaScript modules that integrate well with Deno. - -- [esm.sh](https://esm.sh) is a CDN which provides type declarations by default +[esm.sh](https://esm.sh) is a CDN which provides type declarations by default (via the `X-TypeScript-Types` header). It can be disabled by appending `?no-dts` to the import URL: ```ts import React from "https://esm.sh/react?no-dts"; ``` -- [Skypack.dev](https://docs.skypack.dev/skypack-cdn/code/deno) is another CDN - which also provides type declarations (via the `X-TypeScript-Types` header) - when you append `?dts` as a query string to your remote module import - statements. Here's an example: - - ```ts - import React from "https://cdn.skypack.dev/react?dts"; - ``` ## Behavior of JavaScript when type checking diff --git a/runtime/manual/basics/connecting_to_databases.md b/runtime/manual/basics/connecting_to_databases.md index ae87204e1..7545e6fe4 100644 --- a/runtime/manual/basics/connecting_to_databases.md +++ b/runtime/manual/basics/connecting_to_databases.md @@ -124,7 +124,7 @@ db.close(); To connect to Firebase with Deno, import the [firestore npm module](https://firebase.google.com/docs/firestore/quickstart) -with the [skypak CDN](https://www.skypack.dev/). To learn more about using npm +with the [ESM CDN](https://esm.sh/). To learn more about using npm modules in Deno with a CDN, see [Using npm packages with CDNs](../node/cdns.md). ### Connect to Firebase with the firestore npm module