Skip to content

Commit

Permalink
Merge branch 'main' into denobyexample
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisjofrank authored May 7, 2024
2 parents 48d31cd + 9e0ba32 commit 4a1633a
Show file tree
Hide file tree
Showing 16 changed files with 821 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion deploy/manual/dynamodb.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion deploy/tutorials/discord-slash.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ request with someone's slash command.
} from "https://deno.land/x/[email protected]/mod.ts";
// TweetNaCl is a cryptography library that we use to verify requests
// from Discord.
import nacl from "https://cdn.skypack.dev/[email protected]?dts";
import nacl from "https://esm.sh/[email protected]?dts";

// For all requests to "/" endpoint, we want to invoke home() handler.
serve({
Expand Down
6 changes: 3 additions & 3 deletions deploy/tutorials/tutorial-firebase.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]/app";
import "https://cdn.skypack.dev/[email protected]/auth";
import "https://cdn.skypack.dev/[email protected]/firestore";
import firebase from "https://esm.sh/[email protected]/app";
import "https://esm.sh/[email protected]/auth";
import "https://esm.sh/[email protected]/firestore";
```

We are also going to use [oak](https://deno.land/x/oak) as the middleware
Expand Down
5 changes: 5 additions & 0 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ const config = {
label: "Examples",
activeBaseRegex: `^/examples`,
},
{
href: "https://deno.land/api?unstable=true",
label: "API Reference",
position: "right",
},
{
href: "https://www.deno.com",
label: "deno.com",
Expand Down
4 changes: 2 additions & 2 deletions replacements.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"CLI_VERSION": "1.42.4",
"STD_VERSION": "0.223.0"
"CLI_VERSION": "1.43.1",
"STD_VERSION": "0.224.0"
}
10 changes: 5 additions & 5 deletions runtime/manual/advanced/jsx_dom/jsx.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
```
Expand Down
18 changes: 1 addition & 17 deletions runtime/manual/advanced/typescript/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion runtime/manual/basics/connecting_to_databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
149 changes: 149 additions & 0 deletions runtime/manual/tools/coverage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# deno coverage

Print coverage reports from coverage profiles.

## Command

`deno coverage [OPTIONS] <COVERAGE>`

## Synopsis

```bash
deno coverage [--ignore=<ignore>] [--include=<regex>] [-q|--quiet] [--exclude=<regex>] [--lcov] [--output=<output>] [--html] [--detailed] [-h|--help] <COVERAGE>

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>`

Ignore coverage files

- `--include=<regex>`

Include source files in the report

[default: ^file:]

- `-q, --quiet`

Suppress diagnostic output

- `--exclude=<regex>`

Exclude source files from the report

[default: test\.(js|mjs|ts|jsx|tsx)$]

- `--lcov`

Output coverage report in lcov format

- `--output=<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
```
52 changes: 52 additions & 0 deletions runtime/manual/tools/lsp.md
Original file line number Diff line number Diff line change
@@ -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/[email protected]/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
```
Loading

0 comments on commit 4a1633a

Please sign in to comment.