mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 07:14:47 -05:00
docs: manual updates for 1.4 features and changes (#7440)
This commit is contained in:
parent
755cfa98eb
commit
f06724f238
5 changed files with 49 additions and 11 deletions
|
@ -87,6 +87,13 @@ However:
|
|||
There exist logical groups of flags that are shared between related subcommands.
|
||||
We discuss these below.
|
||||
|
||||
### Watch mode
|
||||
|
||||
You can supply the `--watch` flag to `deno run` to enable the built in file
|
||||
watcher. When Deno starts up with this flag it watches the entrypoint, and all
|
||||
local files the entrypoint statically imports. Whenever one of these files is
|
||||
changed on disk, the program will automatically be restarted.
|
||||
|
||||
### Integrity flags
|
||||
|
||||
Affect commands which can download resources to the cache: `deno cache`,
|
||||
|
|
|
@ -16,9 +16,9 @@ import { queue } from "./collections.ts";
|
|||
|
||||
### `--no-check` option
|
||||
|
||||
When using `deno run`, `deno test`, `deno cache`, `deno info`, or `deno bundle`
|
||||
you can specify the `--no-check` flag to disable TypeScript type checking. This
|
||||
can significantly reduce the time that program startup takes. This can be very
|
||||
When using `deno run`, `deno test`, `deno cache`, or `deno bundle` you can
|
||||
specify the `--no-check` flag to disable TypeScript type checking. This can
|
||||
significantly reduce the time that program startup takes. This can be very
|
||||
useful when type checking is provided by your editor and you want startup time
|
||||
to be as fast as possible (for example when restarting the program automatically
|
||||
with a file watcher).
|
||||
|
@ -31,9 +31,11 @@ To export a type in a different file use
|
|||
`export type { AnInterface } from "./mod.ts";`. To import a type use
|
||||
`import type { AnInterface } from "./mod.ts";`. You can check that you are using
|
||||
`import type` and `export type` where necessary by setting the `isolatedModules`
|
||||
TypeScript compiler option to `true`. You can see an example `tsconfig.json`
|
||||
with this option
|
||||
TypeScript compiler option to `true`, and the `importsNotUsedAsValues` to
|
||||
`error`. You can see an example `tsconfig.json` with this option
|
||||
[in the standard library](https://github.com/denoland/deno/blob/master/std/tsconfig_test.json).
|
||||
These settings will be enabled by default in the future. They are already the
|
||||
default in Deno 1.4 or above when using `--unstable`.
|
||||
|
||||
Because there is no type information when using `--no-check`, `const enum` is
|
||||
not supported because it is type-directed. `--no-check` also does not support
|
||||
|
|
|
@ -204,3 +204,29 @@ failure, you can specify the `--failfast` flag when running the suite.
|
|||
```shell
|
||||
deno test --failfast
|
||||
```
|
||||
|
||||
## Test coverage
|
||||
|
||||
Deno will automatically determine test coverage for your code if you specify the
|
||||
`--coverage` flag when starting `deno test`. Coverage is determined on a line by
|
||||
line basis, and is acquired directly from the JavaScript runtime (V8). Because
|
||||
of this, this coverage is very accurate.
|
||||
|
||||
When all tests are done running a summary of coverage per file is printed to
|
||||
stdout. In the future there will be support for `lcov` output too.
|
||||
|
||||
```
|
||||
$ git clone git@github.com:denosaurs/deno_brotli.git && cd deno_brotli
|
||||
$ deno test --coverage --unstable
|
||||
Debugger listening on ws://127.0.0.1:9229/ws/5a593019-d185-478b-a928-ebc33e5834be
|
||||
Check file:///home/deno/deno_brotli/.deno.test.ts
|
||||
running 2 tests
|
||||
test compress ... ok (26ms)
|
||||
test decompress ... ok (13ms)
|
||||
|
||||
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out (40ms)
|
||||
|
||||
test coverage:
|
||||
file:///home/deno/deno_brotli/mod.ts 100.000%
|
||||
file:///home/deno/deno_brotli/wasm.js 100.000%
|
||||
```
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
## Documentation Generator
|
||||
|
||||
`deno doc` followed by a list of one or more source files will print the JSDoc
|
||||
documentation for each of the module's **exported** members. Currently, only
|
||||
exports in the style `export <declaration>` and `export ... from ...` are
|
||||
supported.
|
||||
documentation for each of the module's **exported** members.
|
||||
|
||||
For example, given a file `add.ts` with the contents:
|
||||
|
||||
|
@ -29,5 +27,5 @@ function add(x: number, y: number): number
|
|||
|
||||
Use the `--json` flag to output the documentation in JSON format. This JSON
|
||||
format is consumed by the
|
||||
[deno doc website](https://github.com/denoland/doc_website) and used to generate
|
||||
module documentation.
|
||||
[deno doc website](https://github.com/denoland/doc_website) and is used to
|
||||
generate module documentation.
|
||||
|
|
|
@ -51,9 +51,12 @@ For more detail, run `deno lint --help`.
|
|||
- `no-extra-boolean-cast`
|
||||
- `no-extra-non-null-assertion`
|
||||
- `no-extra-semi`
|
||||
- `no-fallthrough`
|
||||
- `no-func-assign`
|
||||
- `no-inner-declarations`
|
||||
- `no-global-assign`
|
||||
- `no-import-assign`
|
||||
- `no-inferrable-types`
|
||||
- `no-inner-declarations`
|
||||
- `no-invalid-regexp`
|
||||
- `no-irregular-whitespace`
|
||||
- `no-misused-new`
|
||||
|
@ -63,12 +66,14 @@ For more detail, run `deno lint --help`.
|
|||
- `no-obj-calls`
|
||||
- `no-octal`
|
||||
- `no-prototype-builtins`
|
||||
- `no-redeclare`
|
||||
- `no-regex-spaces`
|
||||
- `no-self-assign`
|
||||
- `no-setter-return`
|
||||
- `no-shadow-restricted-names`
|
||||
- `no-this-alias`
|
||||
- `no-this-before-super`
|
||||
- `no-undef`
|
||||
- `no-unreachable`
|
||||
- `no-unsafe-finally`
|
||||
- `no-unsafe-negation`
|
||||
|
|
Loading…
Reference in a new issue