1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-01 09:24:20 -04:00
Commit graph

379 commits

Author SHA1 Message Date
Casper Beyer
3078fcf55a
feat(unstable): record raw coverage into a directory (#8642) 2020-12-21 14:04:25 +01:00
Casper Beyer
55dc467b41
test(cli): ensure await all on stdout does not deadlock (#8802) 2020-12-17 15:01:47 +01:00
Kitson Kelly
63a821b78b
fix(cli): make dynamic import errors catchable (#8750)
Fixes #6259
2020-12-15 16:52:55 +11:00
Casper Beyer
ce6b738ac0
fix(repl): recover from invalid input (#8759) 2020-12-14 11:37:08 -05:00
Yosi Pramajaya
84ef9bd21f
fix(cli/compile): error when the output path already exists (#8681) 2020-12-12 20:41:43 +01:00
Bartek Iwańczuk
623bc22ad0
Revert "chore(test): increase file watcher timeout duration on macOS (#8733)" (#8737)
This reverts commit f4cf1b4538.
2020-12-12 16:54:00 +01:00
Yusuke Tanaka
f4cf1b4538
chore(test): increase file watcher timeout duration on macOS (#8733) 2020-12-12 14:32:46 +01:00
Bartek Iwańczuk
65e72b68ac
refactor(cli): decouple ops from ProgramState and Flags (#8659)
This commit does major refactor of "Worker" and "WebWorker",
in order to decouple them from "ProgramState" and "Flags".
The main points of interest are "create_main_worker()" and
"create_web_worker_callback()" functions which are responsible
for creating "Worker" and "WebWorker" in CLI context.
As a result it is now possible to factor out common "runtime"
functionality into a separate crate.
2020-12-11 18:49:26 +01:00
Ryan Dahl
f15b3d84a5
Remove dead code: itest_ignore (#8668) 2020-12-08 20:29:00 -05:00
Nayeem Rahman
b77d6cb29e
chore(std): Remove tsconfig_test.json (#8629)
Ref #8050
2020-12-07 21:49:58 +11:00
Kitson Kelly
301d3e4b68
feat: add mvp language server (#8515)
Resolves #8400
2020-12-07 21:46:39 +11:00
János Veres
93d9f51d16
fix(cli): add hygiene pass to transpile pipeline (#8586)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2020-12-02 20:26:04 +01:00
Bartek Iwańczuk
f49d955601
fix(compile): disable source mapping of errors (#8581)
This commit disables source mapping of errors
for standalone binaries. Since applying source
maps relies on using file fetcher infrastructure
it's not feasible to use it for standalone binaries
that are not supposed to use that infrastructure.
2020-12-01 23:33:44 +01:00
Nayeem Rahman
108972c966
chore(cli/flags): Use deno compile --output for the out file (#8563) 2020-12-01 15:11:02 +01:00
Bartek Iwańczuk
53fa45eb73
disable flaky watch tests (#8557) 2020-12-01 13:32:41 +01:00
Luca Casonato
6aa692fece
feat: deno compile (#8539) 2020-11-30 20:35:12 +01:00
Marcus Hultman
c7276e15e5
feat(unstable): add cbreak option to setRaw (#8383) 2020-11-30 11:08:03 -05:00
crowlKats
973af61d8b
feat(cli/tools/upgrade): canary support (#8476) 2020-11-29 20:00:35 +01:00
Yusuke Tanaka
d9b4182868
fix(watcher): watcher doesn't exit when module resolution fails (#8521)
This commit makes the file watcher continue to work even if module
resolution fails at the initial attempt, allowing us to execute `run`
or `bundle` subcommand when a script has invalid syntax. In such
cases, the watcher observes a single file that is specified as an
command line argument.
2020-11-28 15:18:13 +01:00
William Perron
57f163510a
fix(cli): make output of deno info --json deterministic (#8483)
Fixes #8458
2020-11-27 16:51:47 -05:00
Bartek Iwańczuk
40bf26b37d
test: fix flaky "run_watch" test (#8519) 2020-11-27 20:22:09 +01:00
Ryan Dahl
f60c80e1bd
fix flaky tests by using exec in PTY tests (#8525) 2020-11-27 12:55:58 -05:00
Ryan Dahl
29374db11f
fix test_raw_tty hang (#8520) 2020-11-27 12:08:28 -05:00
Bartek Iwańczuk
22f951aa67
fix: panic in worker when closing at top level (#8510)
Fixes panic occurring in worker when "self.close()" is called
at the top level, ie. worker shuts down while
module evaluation promise hasn't yet resolved.
2020-11-27 14:19:24 +01:00
Bartek Iwańczuk
e84704968e
fix(watch): fix flaky tests for watcher (#8508) 2020-11-26 20:12:26 +01:00
Ryan Dahl
8486b081ae
fix: re-enable test_raw_tty (#8509) 2020-11-26 12:59:03 -05:00
Nayeem Rahman
e7fc7d7151
fix(cli/tsc): allow non-standard extensions on imports (#8464) 2020-11-23 10:20:32 +11:00
Yusuke Tanaka
e3f73d3ec0
feat(unstable): Support --watch flag for bundle and fmt subcommands (#8276)
This commit adds support for "--watch" flag for "bundle" 
and "fmt" subcommands.

In addition to this, it refactors "run --watch" command so that
module resolution will occur every time the file watcher detects 
file addition/deletion, which allows the watcher to observe a file 
that is newly added to the dependency as well.
2020-11-22 21:45:44 +01:00
Nayeem Rahman
7405356e23
chore(cli/flags): Rename --failfast to --fail-fast (#8456) 2020-11-22 15:40:33 +01:00
Nayeem Rahman
14877f7fe2
feat(unstable): Add deno test --no-run (#8093)
This commit adds new flag to "deno test" subcommand
called "--no-run" that allows to preload, cache an type
check.
2020-11-22 14:06:51 +01:00
KNnut
aaf7166a9d
refactor(cli): remove unnecessary format! calls (#8315) 2020-11-09 15:38:29 +01:00
Kitson Kelly
e9edc05bed
fix(cli): ensure that transitory dependencies are emitted (#8275)
Fixes #8111
2020-11-08 07:00:42 +11:00
Kitson Kelly
5f7c80986f
fix(cli): correct libs sent to tsc for unstable worker (#8260)
Fixes #8257
2020-11-06 12:10:19 +11:00
Bartek Iwańczuk
791119d4af
build: rewrite tools/ scripts to deno (#8247)
This commit rewrites scripts in "tools/" directory
to use Deno instead of Python. In return it allows 
to remove huge number of Python packages in "third_party/".
2020-11-05 15:53:21 +01:00
Kitson Kelly
272e9b82eb
fix(cli): inject helpers when transpiling via swc (#8221)
Fixes #8212
2020-11-02 22:33:43 +11:00
Kitson Kelly
fdcc78500c
refactor(cli): migrate runtime compile/bundle to new infrastructure (#8192)
Fixes #8060
2020-11-02 13:51:56 +11:00
Bartek Iwańczuk
4f57ca0daf
fix: panic in bundler (#8168)
This commit fixes panic in bundler which was caused
by not setting thread-local slots.
2020-10-30 12:19:49 +01:00
Sander Hahn
1854c6f73b
fix(cli): prompt works with windows eol and eof (#8149) 2020-10-29 18:35:58 +01:00
Yusuke Tanaka
bfce376c68
refactor(watch): create single watcher for whole process (#8083)
This commit rewrites file watcher used with --watch flag.

Instead of creating new watcher after each restart, only a single
watcher is created for whole process. Additionally debouncing
mechanism has been added to prevent infinite restart loops 
if multiple files were changed in quick succession.

Co-authored-by: bartossh <lenart.consulting@gmail.com>
2020-10-28 12:41:18 +01:00
Kevin (Kun) "Kassimo" Qian
07359b7957
fix(repl): don't hang on unpaired braces (#8151)
Previously, entering a single ']' would cause repl to forever accepting
new lines, due to that `ValidationResult::Invalid` would actually be
consumed by the editor itself while continue building the lines. Instead
we should mark it as `Valid` and send the bad input for evaluation to
get the proper error from V8.

Before:
```
> ]
(you can keep entering new line here, and it will never consume input
until you Ctrl-C)
```

After:
```
> ]
Uncaught SyntaxError: Unexpected token ']'
>
```
2020-10-28 06:03:17 -04:00
Kitson Kelly
e01664d0ae
fix(cli): module graph handles redirects properly (#8159)
Fixes #8154
2020-10-28 20:38:09 +11:00
Kitson Kelly
5af1dcfe29
fix(cli): do not throw on empty typescript files (#8143)
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2020-10-27 13:19:27 +01:00
Kitson Kelly
b03f4a4a1c
fix(cli): restore permission check on workers (#8123)
Fixes #8120
2020-10-27 06:56:00 +11:00
Bartek Iwańczuk
aebbdd5cc2
Revert "feat(lint): stabilize "deno lint" subcommand (#8075)" (#8128)
This reverts commit c5c48f845a.
2020-10-26 13:36:13 +01:00
Kitson Kelly
3d19fb493b
fix(cli): properly handle roots with extensions that don't match media type (#8114) 2020-10-26 07:17:58 +11:00
Kitson Kelly
117fcf61f0
test(cli): dynamic imports not evaluated until runtime (#8102)
Closes #7997
2020-10-25 07:02:11 +11:00
Bartek Iwańczuk
9d36331278
Revert "feat(cli): Add deno cache --test and --worker (#7920)" (#8089)
This reverts commit be15cf285d.
2020-10-23 16:56:25 +02:00
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