0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
Commit graph

332 commits

Author SHA1 Message Date
Nayeem Rahman
be15cf285d
feat(cli): Add deno cache --test and --worker (#7920) 2020-10-23 13:31:49 +02:00
Kitson Kelly
ab898556a4
refactor(cli): move bundle check to new infrastructure (#8071) 2020-10-23 22:05:41 +11:00
Kitson Kelly
7e2c7fb6c5
refactor(cli): migrate run and cache to new infrastructure (#7996)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-23 11:50:15 +11:00
Bartek Iwańczuk
c5c48f845a
feat(lint): stabilize "deno lint" subcommand (#8075)
This commit stabilizes "deno lint" by removing
the need to pass --unstable flag.

--unstable is still required when using --json flag.
2020-10-22 21:52:37 +02:00
Divy Srivastava
d592c128cf
chores(cli/fmt): make --ignore stable (#7922)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-10-22 19:04:35 +02:00
Kitson Kelly
0fb39f9176
feat(cli): add types for WeakRef/FinalizationRegistry (#8056)
Fixes #8051
2020-10-21 21:57:01 +11:00
Nayeem Rahman
070d99645f
chore: Rename --importmap to --import-map (#7032)
--importmap still works as an alias to --import-map
but is not visible in CLI help output.
2020-10-20 14:30:59 +02:00
Nayeem Rahman
7aba07cc77
fix(cli/worker): Print error stacks from the origin Worker (#7987)
Fixes #4728
2020-10-20 15:05:42 +11:00
Kitson Kelly
57e95032c8
feat(cli): add support for bundle --no-check (#8023)
Fixes #6686
2020-10-20 14:10:42 +11:00
Absebo
1474d5d76d
fix(cli): Handling of relative importmaps while using watch (#7950) 2020-10-19 23:53:39 +02:00
Nayeem Rahman
3f5513758d
feat(cli/installer): Add missing flags for deno install (#7601)
This commit adds support for following flags:
- deno install --importmap
- deno install --no-remote
- deno install --lock
- deno install --lock-write
- deno install --cached-only
- deno install --v8-flags
- deno install --seed
2020-10-19 21:19:20 +02:00
Casper Beyer
9d664f8375
fix(cli/repl): ignore pair matching inside literals (#8037) 2020-10-19 19:13:23 +02:00
Casper Beyer
35028db5e5
fix(cli/repl): unterminated string literal should invalidate (#7896)
This adds the grave character to the pair matching so that template
string literals trigger multi-line edits.
2020-10-19 16:54:50 +02:00
Casper Beyer
f5c23f8058
fix(cli/repl): write all results to stdout (#7893)
This writes all evaluaton results to stdout regardless if the result is
an error or not.

This matches the behavior of other read-eval-print-loops like Node.
2020-10-19 13:41:25 +02:00
Kitson Kelly
bbe4474d39
fix(cli): ModuleGraph2 properly handles redirects (#7981) 2020-10-16 10:34:55 +11:00
Bartek Iwańczuk
12e700bddf
fix(test): return error when awaiting unresolved promise (#7968)
This commit fixes test runner by awaitning "Deno.runTests()" call,
which ensures proper error is returned when there's an unresolved
promise that's being awaited.
2020-10-14 15:19:13 +02:00
Bartek Iwańczuk
135053486c
fix: top-level-await module execution (#7946)
This commit changes implementation of top-level-await in "deno_core".

Previously promise returned from module evaluation was not awaited,
leading to out-of-order execution of modules that have TLA. It's been
fixed by changing "JsRuntime::mod_evaluate" to be an async function
that resolves when the promise returned from module evaluation also
resolves. When waiting for promise resolution event loop is polled
repeatedly, until there are no more dynamic imports or pending
ops.
2020-10-14 14:04:09 +02:00
Yoshiya Hinosawa
0dcaea72ae
feat: add alert, confirm, and prompt (#7507)
This commit adds "alert", "confirm" and "prompt" functions from web standards.
2020-10-13 15:31:59 +02:00
Valentin Anger
fede13f2eb
feat(cli): support importmap flag with deno doc subcommand (#7821)
Fixes #7783
2020-10-12 10:05:46 +11:00
Ryan Dahl
08bb8b3d53
Fix 100% CPU idling problem by reverting #7672 (#7911)
* Revert "refactor: Worker is not a Future (#7895)"

This reverts commit f4357f0ff9.

* Revert "refactor(core): JsRuntime is not a Future (#7855)"

This reverts commit d8879feb8c.

* Revert "fix(core): module execution with top level await (#7672)"

This reverts commit c7c7677825.
2020-10-10 11:41:11 +02:00
Bartek Iwańczuk
c7c7677825
fix(core): module execution with top level await (#7672)
This commit fixes implementation of top level await in "deno_core".

Previously promise returned from module execution was ignored causing to execute
modules out-of-order.

With this commit promise returned from module execution is stored on "JsRuntime"
and event loop is polled until the promise resolves.
2020-10-06 10:18:22 +02:00
Casper Beyer
5cd29b37f7
feat(cli/repl): enable await and let re-declarations (#7784)
This enables `replMode` during evaluations which allows for top level
await and let re-declarations.
2020-10-02 13:17:47 +02:00
Casper Beyer
6825d7f13d
fix(cli/repl): use a default referrer when empty (#7794)
This makes use of a default referrer when its empty in repl mode so that
dynamic imports work in the global evaluation context.

Co-authored-by: Bartek Iwanczuk <biwanczuk@gmail.com>
2020-10-02 13:13:23 +02:00
Casper Beyer
4c779b5e8c
refactor(repl): use an inspector session (#7763)
This ports the REPL over to Rust and makes use of an inspector session to run a REPL on top of any isolate which lets make full use of rustylines various things like validators and completors without having to introduce a bunch of hard to test internal ops and glue code.

An accidental but good side effect of this is that the multiple line input we previously had is now an editable multi-line input prompt that is correctly stored in the history as a single entry.
2020-10-02 01:14:55 +02:00
Kitson Kelly
e077b93d77
refactor: add concept of 'legacy' compiler to enable non-breaking refactoring (#7762) 2020-10-01 20:33:15 +10:00
Kitson Kelly
dcd0595058
fix: check cached versions during transpile (#7760)
Fixes: #7759
2020-09-30 21:46:42 +10:00
Kitson Kelly
7c62b7b043
fix(cli): use global_state file_fetcher when using SpecifierHandler (#7748)
Fixes: #7709
2020-09-30 17:22:58 +10:00
Luca Casonato
ebcb032c6b
fix: no check recognizes require (#7720) 2020-09-27 14:16:18 -04:00
Kitson Kelly
751bb45a0a
fix: ignore fileExists in tsc host (#7635)
Fixes #7630
2020-09-23 11:39:20 +10:00
Bartek Iwańczuk
dd1cd4d952
fix: clearing timers race condition (#7617) 2020-09-22 19:33:29 +02:00
Casper Beyer
9caeff3208
fix(cli/repl): interpret object literals as expressions (#7591) 2020-09-21 16:09:53 -04:00
Bartek Iwańczuk
92edc36442
refactor: use futures and serde_json from deno_core (#7614) 2020-09-21 18:36:37 +02:00
William Perron
42772845f6
fix(info): add --importmap flag (#7424) 2020-09-21 15:07:19 +02:00
Yusuke Tanaka
db5004f200
fix(fmt,lint): do not print number of checked files when --quiet is enabled (#7579) 2020-09-20 13:49:22 +02:00
tokiedokie
4c2920ddd7
fix(cli/fmt): canonicalize files in current dir (#7508) 2020-09-18 13:03:37 -04:00
Casper Beyer
de95fbebc4
fix(cli/repl): format evaluation results with the object specifier (#7561) 2020-09-18 12:47:08 -04:00
Ryan Dahl
104aebdfb5
Re-export deno_core::url (#7525)
Also re-exports deno_core::futures and deno_core::serde_json but these are not yet used in the CLI.
2020-09-16 14:28:07 -04:00
Ryan Dahl
c3ef358c01 Remove unnecessary extern statements 2020-09-16 13:29:42 -04:00
tokiedokie
04d3472257
refactor(cli/tests): change std_path to root_path in std_tests() (#7438) 2020-09-15 06:26:57 +02:00
Bartek Iwańczuk
a65bcadcf2
test: reenable TS decorator test (#7471) 2020-09-14 18:59:54 +02:00
tokiedokie
e688a701e2
test(cli/tests/https_import): use ts file in localhost instead of remote (#7431) 2020-09-14 13:18:00 +02:00
Nayeem Rahman
f874b83aa0
test(cli/tests/unit): Enable color for js_unit_tests (#7443) 2020-09-14 12:46:50 +02:00
Casper Beyer
755cfa98eb
feat(unstable): deno test --coverage (#6901)
This commit adds basic support for collecting coverage
data using "deno test". 

Currently the report is only a text added to the end
of output from "deno test".
2020-09-13 15:01:30 +02:00
Bartek Iwańczuk
b216d48e5f
upgrade: deno_doc, deno_lint, dprint, swc (#7434)
upgrades:
- swc_ecmascript 0.7.7
- dprint-plugin-typescript 0.31.3
- deno_lint 0.2.0
- deno_doc 0.1.9

Split std_lint test into std_lint and unit_test_lint.

Added lint ignores to CommonJS files in std/node.
2020-09-13 14:15:38 +02:00
Bert Belder
bf70442b08
upgrade: rusty_v8 0.10.0 / V8 8.7.75 (#7429) 2020-09-13 13:43:50 +02:00
Luca Casonato
daa780e2cf
fix(WebSocket): no panic on failed connect + handle promise rejection via error event (#7437) 2020-09-13 11:52:20 +02:00
Luca Casonato
82d0f7ec84
chore: remove --no-check from deno info (#7439) 2020-09-12 23:34:54 +02:00
Luca Casonato
d048f58f05
chore: add systemMemoryInfo unstable diagnostic (#7435) 2020-09-12 16:12:14 +02:00
Bartek Iwańczuk
60dbc6b294
Revert "feat(unstable): Support data: urls (#5157)" (#7432)
This reverts commit e3319f34a6.
2020-09-12 11:08:00 +02:00
Valentin Anger
e3319f34a6
feat(unstable): Support data: urls (#5157) 2020-09-11 22:40:48 +02:00
Bartek Iwańczuk
a3282aa9ed
feat(unstable): deno run --watch (#7382)
Co-authored-by: Sebastian Seedorf <mail@sebse.de>
2020-09-11 18:19:49 +02:00
Yusuke Tanaka
857f9b32e0
feat(fmt, lint): show number of checked files (#7312) 2020-09-09 16:45:31 +02:00
Nayeem Rahman
b17a5fbcfa
fix(op_crates/web): Use "deno:" URLs for internal script specifiers (#7383) 2020-09-09 14:23:57 +02:00
KrisChambers
1cd2267500
feat(info): Dependency count and sizes (#6786)
This commit changes "deno info" subcommand logic.

- Modules are no longer loaded into V8 isolate - analysis
  is done using ModuleGraph.
- Removed deno_core::Deps structure.
- Modules are no longer type-checked and transpiled - 
  "compiled" file is shown only if it is already available.
- Added number of unique dependencies for root module.
- Changed tree output:
  - file size is shown next to the dependency
  - repeated dependencies are marked with "*"
  - used less spaces in prefix to save terminal width
2020-09-07 15:59:47 +02:00
crowlKats
8c880d3261
feat: Implement WebSocket API (#7051) 2020-09-05 10:39:25 -04:00
tokiedokie
fcee4265c6
support env_logger / RUST_LOG (#7142) 2020-09-03 16:16:49 -04:00
Ryan Dahl
a4439800e6
Remove unnecessary stdout pipes in tests (#7322) 2020-09-02 18:31:22 +02:00
Yusuke Tanaka
fa65e49bc6
feat(lint): Add support for reading input from stdin (#7263) 2020-08-31 13:53:42 +02:00
Valentin Anger
31f32ed8c4
Move benchmarks to Rust (#7134)
All benchmarks are done in Rust and can be invoked with
`cargo bench`.

Currently this has it's own "harness" that behaves like
`./tools/benchmark.py` did.
Because of this tests inside `cli/bench` are currently not run.
This should be switched to the language provided harness
once the `#[bench]` attribute has been stabilized.
2020-08-28 09:03:50 -04:00
Luca Casonato
a7fd3a4f58
fix(cli): revert "never type check deno info #6978" (#7199) 2020-08-26 20:27:06 +02:00
Bartek Iwańczuk
2600d5ac09
fix(doc): stack overflow for .d.ts files (#7167) 2020-08-23 15:48:35 +02:00
Nayeem Rahman
015fa0bd41
refactor: permissions (#7074) 2020-08-18 16:29:32 -04:00
Bert Belder
b308a774e8
Fix nightly and Windows-only clippy warnings (#7095) 2020-08-18 20:50:52 +02:00
Casper Beyer
4b3a3d9d0f
Enable WebAssembly.instantiateStreaming (#7043) 2020-08-14 13:48:37 -04:00
souldzin
d6cee70695
feat: Add "--json" flag to deno lint (#6940)
Co-authored-by: JackSkylark <jdslaughter44@gmail.com>
2020-08-13 17:30:46 +02:00
Divy Srivastava
6706eb5515
feat: add "--ignore" to deno lint (#6934) 2020-08-12 15:47:44 +02:00
Ryan Dahl
7d01fcbb77
Remove unnecessary drop calls (#7007) 2020-08-10 17:31:05 -04:00
Nayeem Rahman
52c1017a74
feat: Stabilize Deno.mainModule (#6993) 2020-08-10 16:41:51 -04:00
Bert Belder
f17eb634fa
test(cli/inspector_port_collision): skip test on WSL (#6991) 2020-08-08 22:06:44 +02:00
Bert Belder
9806933f57
test(cli/inspector_port_collision): fail rather than hang (#6991) 2020-08-08 22:06:44 +02:00
Bert Belder
f22b7dc783
fix(cli): show error on unrecognized V8 flag, exit on --help (#6980) 2020-08-08 21:23:21 +02:00
Nayeem Rahman
479164d287
fix(deno info): Never type check (#6978) 2020-08-07 16:46:54 -04:00
Luca Casonato
9d50c5c1a6
feat: hash file names in gen cache (#6911) 2020-08-03 14:55:03 +02:00
Divy Srivastava
0da4779b17
feat(unstable): add "--ignore" flag to deno fmt (#6890) 2020-07-30 12:09:08 -04:00
Bartek Iwańczuk
b45f9a7357
fix: deno-types directive should have higher precedence than X-TypeScript-Types header (#6761) 2020-07-24 14:21:36 +02:00
Bartek Iwańczuk
b449964d1a
refactor: remove more compiler runtime code (#6841) 2020-07-23 15:29:36 +02:00
Bartek Iwańczuk
fa61956f03
Port internal TS code to JS (#6793)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-07-19 19:49:44 +02:00
Bartek Iwańczuk
6e34f6a7cc
fix: providing empty source code for missing compiled files (#6760)
This commit adds a fallback mechanism for absent compiled source file.

Because imported type declaration files are not emitted by TS compiler
and their imports are not elided users often hit "No such file or directory"
error. With this commit in such situation an empty source file will be
provided to V8 with a warning to the user suggesting using "import type"/
"export type" syntax instead.
2020-07-17 15:50:17 +02:00
Bartek Iwańczuk
73a9036089
fix: panic for runtime error in TS compiler (#6758) 2020-07-15 14:23:17 +02:00
David Sherret
cde4dbb351
Use dprint for internal formatting (#6682) 2020-07-14 15:24:17 -04:00
Maayan Hanin
d619e3c7ac
fix(cli): don't panic when no "HOME" env var is set (#6728) 2020-07-13 18:24:54 +02:00
uki00a
4731f4800c
fix(Deno.ppid): improve error message when --unstable is missing (#6717) 2020-07-13 14:00:56 +02:00
Oscar Linde
3be2064803
feat(cli): add DENO_CERT environment variable (#6370) 2020-07-12 19:18:27 -04:00
Bartek Iwańczuk
a26b4a9f1e
chore: reenable ignored integration tests (#6703) 2020-07-11 18:29:55 +02:00
Maayan Hanin
edb7a0eead
fix(cli): panic when stdio is null on windows (#6528)
Fixes: #6409
2020-07-09 21:06:51 +02:00
Emmanuel
cbbd944359
feat(cli): json option for "deno info" (#6372) 2020-07-08 10:50:12 -04:00
Kitson Kelly
82aabb657a
feat: add --no-check option (#6456)
This commit adds a "--no-check" option to following subcommands:
- "deno cache"
- "deno info"
- "deno run"
- "deno test"

The "--no-check" options allows to skip type checking step and instead 
directly transpiles TS sources to JS sources. 

This solution uses `ts.transpileModule()` API and is just an interim
solution before implementing it fully in Rust.
2020-07-08 11:26:39 +02:00
Takahiko Inayama
14a44464a6
feat: add lockfile support to bundle (#6624) 2020-07-07 13:05:28 +02:00
uki00a
ab4c574f52
fix: Deno.setRaw shouldn't panic on ENOTTY (#6630) 2020-07-06 18:26:34 -04:00
crowlKats
2b52e3daf1
feat: deno upgrade --output (#6352) 2020-07-06 18:21:26 -04:00
Bartek Iwańczuk
d1289db1c3
chore: re-enable tests using media_types (#6642) 2020-07-05 23:09:50 -04:00
Ryan Dahl
5f9e600c5b
chore: port http_server.py to rust (#6364) 2020-07-04 13:05:01 -04:00
Bartek Iwańczuk
cc12e86fe3
refactor: lock file (#6569)
- refactor lock file creation
- provide deterministic output in lock file (alphabetically sorted)
- dynamic imports are checked against lock file
2020-07-02 17:54:51 +02:00
Andrey Filatkin
a690a20679
fix(cli/upgrade): upgrade fails on Windows with space in temp path (#6522) 2020-06-29 09:13:07 -04:00
Ryan Dahl
42464e922d
'Compile' messages changed to 'Check' messages (#6504) 2020-06-26 16:59:08 -04:00
Kitson Kelly
70463bac7d
fix: Omit buildinfo when --reload passed (#6489) 2020-06-26 08:23:25 -04:00
Kitson Kelly
6f09b8de41
Restore stats for incremental compile (#6474) 2020-06-25 15:50:16 +02:00
Bartek Iwańczuk
3cbd1075c7
Incremental compilation for TypeScript (#6428)
This commit adds incremental compilation capabilities to internal TS compiler.

Instead of using "ts.createProgram()" API for compilation step (during deno 
startup), "ts.createIncrementalProgram()" API is used instead.

Thanks to TS' ".tsbuildinfo" file that already stores all necessary metadata
for compilation I was able to remove our own invention that is ".graph" file. 
".tsbuildinfo" file is stored alongside compiled source and is used to 
cache-bust outdated dependencies, facilitated by the "version" field. 
The value for "version" field is computed in Rust during loading of module 
graph and is basically a hash of the file contents.

Please keep in mind that incremental compilation is only used for initial 
compilation (or dynamic imports compilation) - bundling and runtime compiler 
APIs haven't been changed at all.

Due to problems with source map I changed compilation settings to inline 
source map (inlineSourceMap instead of sourceMap).
2020-06-24 16:59:12 +02:00
Kitson Kelly
1d8fc39494
Add ability to output compiler performance information (#6434) 2020-06-24 11:58:23 +02:00
uki00a
345a5b3dff
fix: "deno test" should respect NO_COLOR=true (#6371) 2020-06-19 12:10:31 +02:00