Skip to content

Commit fae3e71

Browse files
Merge branch 'main' into docs/deno-spawn-apis
2 parents 6b4c835 + c7eb526 commit fae3e71

File tree

12 files changed

+163
-34
lines changed

12 files changed

+163
-34
lines changed

examples/_data.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ export const sidebar = [
166166
"https://www.youtube.com/watch?v=oxVwTT-rZRo&list=PLvvLnBDNuTEov9EBIp3MMfHlBxaKGRWTe&index=6",
167167
type: "video",
168168
},
169+
{
170+
title: "Temporal API",
171+
href: "/examples/temporal/",
172+
type: "example",
173+
},
169174
{
170175
title: "Better debugging with the console API",
171176
href: "/examples/debugging_with_console_tutorial/",
@@ -1077,11 +1082,6 @@ export const sidebar = [
10771082
href: "/examples/udp_connector/",
10781083
type: "example",
10791084
},
1080-
{
1081-
title: "Temporal API",
1082-
href: "/examples/temporal/",
1083-
type: "example",
1084-
},
10851085
{
10861086
title: "Importing text",
10871087
href: "/examples/importing_text/",

examples/scripts/temporal.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
* @title Temporal API
33
* @difficulty beginner
44
* @tags cli
5-
* @run --unstable-temporal <url>
5+
* @run <url>
66
* @resource {https://docs.deno.com/api/web/~/Temporal} Temporal API reference documentation
77
* @resource {https://tc39.es/proposal-temporal/docs} Temporal API proposal documentation
8-
* @group Unstable APIs
8+
* @group Web APIs
99
*/
1010

1111
// Get the current date

runtime/_data.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ export const sidebar = [
128128
title: "deno compile",
129129
href: "/runtime/reference/cli/compile/",
130130
},
131+
{
132+
title: "deno create",
133+
href: "/runtime/reference/cli/create/",
134+
},
131135
{
132136
title: "deno completions",
133137
href: "/runtime/reference/cli/completions/",

runtime/fundamentals/configuration.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,22 @@ import * as module_2 from "@example/my-package/module2";
527527

528528
## Permissions
529529

530-
Deno 2.5+ supports storing permission sets in the config file.
530+
Deno 2.5+ supports storing
531+
[permission](/runtime/fundamentals/security/#permissions) sets in the config
532+
file.
531533

532534
### Named permissions
533535

534-
Permissions can be defined in key value pairs under the `"permissions"` key:
536+
Permissions can be defined as key-value pairs under arbitrarily-named permission
537+
sets under the `"permissions"` key. Within each set,
538+
539+
- the key is the name of a
540+
[permission](/runtime/fundamentals/security/#permissions) that would follow
541+
`--allow-` or `--deny-` in the CLI invocation (i.e. `read`, `write`, `net`,
542+
`env`, `sys`, `run`, `ffi`, `import`)
543+
- the value is a boolean (`true` / `false` correspond to allow / deny), an array
544+
of strings representing paths, domains etc., or an object with `allow`,
545+
`deny`, and/or `ignore` boolean key-value pairs.
535546

536547
```jsonc
537548
{
@@ -547,7 +558,8 @@ Permissions can be defined in key value pairs under the `"permissions"` key:
547558
}
548559
```
549560

550-
Then used by specifying the `--permission-set=<name>` or `-P=<name>` flag:
561+
Permission sets can be used by specifying the `--permission-set=<name>` or
562+
`-P=<name>` flag:
551563

552564
```sh
553565
$ deno run -P=read-data main.ts

runtime/fundamentals/debugging.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,3 +201,16 @@ including:
201201
For full details on Deno's OpenTelemetry integration, including custom metrics,
202202
traces, and configuration options, see the
203203
[OpenTelemetry documentation](/runtime/fundamentals/open_telemetry).
204+
205+
## TLS session debugging
206+
207+
Set the `SSLKEYLOGFILE` environment variable to log TLS session keys to a file.
208+
This enables you to decrypt and inspect encrypted network traffic with tools
209+
like [Wireshark](https://www.wireshark.org/):
210+
211+
```sh
212+
SSLKEYLOGFILE=./keys.log deno run -N main.ts
213+
```
214+
215+
Then load `keys.log` in Wireshark (Edit > Preferences > Protocols > TLS >
216+
(Pre)-Master-Secret log filename) to decrypt captured TLS traffic.

runtime/reference/cli/check.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ openGraphTitle: "deno check"
77
description: "Download and type-check code without execution"
88
---
99

10-
## Example
10+
## Examples
1111

12-
Type-check without execution.
12+
Type-check a TypeScript file without execution:
1313

1414
```ts title="example.ts"
1515
const x: string = 1 + 1n;
@@ -18,3 +18,13 @@ const x: string = 1 + 1n;
1818
```bash
1919
deno check example.ts
2020
```
21+
22+
## Type-checking JavaScript files
23+
24+
If you have a JavaScript-only project and want to type-check it with Deno, you
25+
can use the `--check-js` flag instead of adding `// @ts-check` to every file or
26+
setting `compilerOptions.checkJs` in your `deno.json`:
27+
28+
```bash
29+
deno check --check-js main.js
30+
```

runtime/reference/cli/compile.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ addons or native code that reads relative files.
152152

153153
The extraction directory is chosen in order of preference:
154154

155-
1. `<exe_dir>/<exe_name>.fs/<hash>/` (next to the compiled binary)
155+
1. `<exe_dir>/.<exe_name>/<hash>/` (next to the compiled binary)
156156
2. Platform data directory fallback:
157157
- Linux: `$XDG_DATA_HOME/<exe_name>/<hash>` or
158158
`~/.local/share/<exe_name>/<hash>`

runtime/reference/cli/create.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: "deno create, scaffold a new project"
3+
command: create
4+
openGraphLayout: "/open_graph/cli-commands.jsx"
5+
openGraphTitle: "deno create"
6+
description: "Scaffold a new project from a template package"
7+
---
8+
9+
The `deno create` command scaffolds a new project from a template package. It
10+
works with both [JSR](https://jsr.io/) and [npm](https://www.npmjs.com/)
11+
packages that provide project templates.
12+
13+
## Usage
14+
15+
```sh
16+
deno create [OPTIONS] [PACKAGE] [-- [ARGS]...]
17+
```
18+
19+
By default, unprefixed package names are resolved from JSR. You can use the
20+
`npm:` or `jsr:` prefix to be explicit, or use the `--npm` / `--jsr` flags.
21+
22+
## How it works
23+
24+
Package resolution differs between npm and JSR:
25+
26+
- **npm packages** use the `create-` naming convention. Running
27+
`deno create npm:vite` resolves to the `create-vite` package on npm and
28+
executes its main entry point.
29+
- **JSR packages** use the `./create` export. Any JSR package can act as a
30+
template by defining a `./create` entry point in its `deno.json`:
31+
32+
```json title="deno.json"
33+
{
34+
"name": "@my-scope/my-template",
35+
"version": "1.0.0",
36+
"exports": {
37+
".": "./mod.ts",
38+
"./create": "./create.ts"
39+
}
40+
}
41+
```
42+
43+
When you run `deno create @my-scope/my-template`, Deno looks for the `./create`
44+
export and runs it as the scaffolding script.
45+
46+
## Examples
47+
48+
Create a project from a JSR package:
49+
50+
```sh
51+
deno create @fresh/init
52+
```
53+
54+
Create a project from an npm package:
55+
56+
```sh
57+
deno create npm:vite my-app
58+
```
59+
60+
Using the `--npm` flag to treat unprefixed names as npm packages:
61+
62+
```sh
63+
deno create --npm create-vite my-app
64+
```
65+
66+
Pass arguments to the template package:
67+
68+
```sh
69+
deno create @fresh/init -- --force
70+
```
71+
72+
## Flags
73+
74+
- `--npm` - Treat unprefixed package names as npm packages
75+
- `--jsr` - Treat unprefixed package names as JSR packages (default)
76+
- `-y, --yes` - Bypass the prompt and run with full permissions

runtime/reference/cli/fmt.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ enclosed in triple backticks and have a language attribute.
5757

5858
:::
5959

60+
## Checking formatting in CI
61+
62+
Use `--check` to verify files are formatted without modifying them. Add
63+
`--fail-fast` to stop on the first unformatted file instead of reporting all of
64+
them, which is useful in large codebases:
65+
66+
```sh
67+
deno fmt --check --fail-fast
68+
```
69+
6070
## Ignoring Code
6171

6272
### JavaScript / TypeScript / JSONC

runtime/reference/cli/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ below for more information on each subcommand.
4545
completions
4646
- [deno coverage](/runtime/reference/cli/coverage/) - generate test coverage
4747
reports
48+
- [deno create](/runtime/reference/cli/create/) - scaffold a new project from a
49+
template
4850
- [deno doc](/runtime/reference/cli/doc/) - generate documentation for a module
4951
- [deno deploy](/runtime/reference/cli/deploy) - Manage and publish your
5052
projects on the web

0 commit comments

Comments
 (0)