1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-04 08:54:20 -05:00
Commit graph

4233 commits

Author SHA1 Message Date
Yiyu Lin
896dd56b7a
refactor(cli,core,ext,rt): remove some unnecessary clone or malloc (#17274) 2023-01-05 14:29:50 -05:00
Geert-Jan Zwiers
4e6b78cb43
refactor(cli): clean up clones (#17268) 2023-01-05 12:33:09 -05:00
denobot
fa271b70db
chore: forward v1.29.2 release commit to main (#17277)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-05 16:48:19 +01:00
David Sherret
0ee64ad847
fix: upgrade deno_ast to 0.23 (#17269)
Closes #17172
Closes #15669
Closes #8529
2023-01-04 18:54:54 -05:00
Yiyu Lin
319f607476
chore(cli,ext,rt): remove some unnecessary clone or malloc (#17261) 2023-01-04 13:20:36 +01:00
Yiyu Lin
2da882137e
docs(cli): do not need gen doc for cli (#17260) 2023-01-04 13:19:58 +01:00
Asher Gomez
1b001d1b18
fix(permissions): process URL in Deno.FfiPermissionDescriptor.path for revoke() and request() (#17094)
Previously, `Deno.permissions.[revoke|request]()` wouldn't correctly
process the `path: URL` when `name` was `ffi`. This change fixes that
behaviour and adds a new function, `formDescriptor()`, to ensure `URL`
arguments are consistently handled across
`Deno.permissions.[query|revoke|request]()`.
2023-01-03 21:50:14 +01:00
Bartek Iwańczuk
c1ffd3d2cb
fix(lsp): don't error if completionItem/resolve request fails (#17250) 2023-01-03 18:13:21 +01:00
Fenix
501472f06b
fix(cli): bundle command support shebang file (#17113) 2023-01-03 16:19:28 +00:00
Leo Kettmeir
7716449d41
fix(lsp): treat empty string config value as None (#17227)
Fixes #14630
2023-01-03 16:59:48 +01:00
David Sherret
421ec90a8e
fix(declaration): change Deno.open example to not use Deno.close(rid) (#17218) 2023-01-03 10:48:03 -05:00
Geert-Jan Zwiers
8a9f5c152e
refactor(lsp): reduce number of clones (#17254)
This PR optimizes the code in the language server by performing less
cloning of data.
2023-01-03 11:41:50 +01:00
David Sherret
10e4b2e140
chore: update copyright year to 2023 (#17247)
Yearly tradition of creating extra noise in git.
2023-01-02 21:00:42 +00:00
Geert-Jan Zwiers
f729576b2d
refactor: cleanup redundant call (#17226) 2022-12-30 20:04:17 -08:00
Bartek Iwańczuk
98bbf87742
fix(lsp): less agressive completion triggers (#17225)
Closes https://github.com/denoland/deno/issues/17056
Closes https://github.com/denoland/deno/issues/17055
2022-12-30 14:11:50 +01:00
Bartek Iwańczuk
218d7ab778
fix(lsp): completions for private variables (#17220) 2022-12-29 22:22:47 +01:00
Bartek Iwańczuk
ef5f8cd265
fix(lsp): "Add all missing imports" uses correct specifiers (#17216)
This commit fixes "Add all missing imports" quick fix; before
it was replacing all occurrences with the same specifier. Now
every line returned from TSC is processed individually.
2022-12-29 21:07:09 +01:00
Bartek Iwańczuk
bece1ce057
feat(unstable): Add Deno.Conn.ref()/unref() (#17170)
This commit adds "Deno.Conn.ref()" and "Deno.Conn.unref()" methods.

These methods can be used to make connection block or not block the
event loop from finishing. Refing/unrefing only influences "read" 
operations - ie. scheduling writes to a connection _do_ keep event 
loop alive.

Required for https://github.com/denoland/deno/issues/16710
2022-12-28 10:29:48 +01:00
Kamil Ogórek
7ce2b58bcf
feat(unstable): Add "Deno.osUptime()" API (#17179)
This PR adds support for `Deno.osUptime` which reports number of seconds
since os was booted. It will allow us to be compatible with Node's `os.uptime` -
https://nodejs.org/api/os.html#osuptime

Partially based on
https://docs.rs/uptime_lib/latest/src/uptime_lib/lib.rs.html
2022-12-27 00:16:12 +01:00
Ikko Ashimine
1a3665b612
chore(npm): fix typo in local.rs (#17186) 2022-12-26 17:24:25 +09:00
Bartek Iwańczuk
208c91b68f
fix(core): run macrotasks and next ticks after polling dynamic imports (#17173)
This commit fixes handling of rejected promises in dynamic imports
evaluation.

Previously we were running callbacks for next ticks and macrotasks
_before_ polling
dynamic imports and checked for unhandled rejections immediately after.
This is wrong,
as `unhandledrejection` event is dispatched and its callbacks are run as
macrotasks.

This commit changes order of actions performed by the event loop to
following:
- poll async ops
- poll dynamic imports
- run next tick callbacks
- run macrotask callbacks
- check for unhandled promise rejections
2022-12-23 19:46:24 +01:00
Kamil Ogórek
2a61b5fdd4
fix(ext/fetch): Guard against invalid URL before its used by reqwest (#17164) 2022-12-23 17:39:14 +01:00
Geert-Jan Zwiers
e58cdbcb4b
fix: add missing verb in description (#17163) 2022-12-22 14:51:22 +01:00
Kamil Ogórek
6a47ffa4d3
fix(core): Do not print errors prop for non-AggregateError errors (#17123)
This commit fixes formatting of JSError with "errors" property. Before this
commit all instances of "Error" were treated as if they were "AggregateError"
if they had "errors" property. After this commit only actual instances of 
"AggregateError" are formatted in such a way, while instances of "Error"
that have "errors" property are formatted without showing details of "errors".
2022-12-21 01:18:49 +01:00
David Sherret
423474caa8
fix(lsp/format): language formatter used should be based on language id (#17148)
Closes #11897
2022-12-20 15:19:35 -05:00
Bartek Iwańczuk
748ce0a435
chore: update node compat layer to std@0.170.0 (#17147)
Fixed a performance regression for express server
2022-12-20 18:23:02 +01:00
David Sherret
8165cded14
fix: ignore local lockfile for deno install and uninstall (#17145)
Closes #17116
2022-12-20 12:00:57 -05:00
David Sherret
a06f59981b
fix(npm): resolve npm specifiers when root redirected (#17144)
Closes #17136
2022-12-20 11:40:26 -05:00
Luca Casonato
8e947bb674
fix(ext/http): close stream on resp body error (#17126)
Previously, errored streaming response bodies did not cause the HTTP
stream to be aborted. It instead caused the stream to be closed gracefully,
which had the result that the client could not detect the difference
between a successful response and an errored response.

This commit fixes the issue by aborting the stream on error.
2022-12-20 08:46:45 +00:00
Kamil Ogórek
199144daf0
fix(cli): allow for specifying noErrorTruncation compiler option (#17127)
Fixes https://github.com/denoland/deno/issues/16568
2022-12-19 20:29:44 -05:00
David Sherret
54d40e008a
perf(lsp): concurrent reads and exclusive writes (#17135) 2022-12-19 20:22:17 -05:00
Leo Kettmeir
1e0017d8fc
fix(lsp/testing): fallback name for non-analyzable tests in collector (#17120)
Closes #17054. 
The fallback is `Test lineNumber:columnNumber`
2022-12-19 20:58:36 +01:00
Leo Kettmeir
80955dfa61
fix: display URL in invalid URL error (#17128) 2022-12-19 20:58:02 +01:00
David Sherret
2ff27a1f93
fix: hide progress bars when showing permission prompt (#17130)
Also adds download bytes progress when downloading remote specifiers.

Closes #16860
2022-12-19 14:31:19 -05:00
Kamil Ogórek
118a35f3bc
fix(cli): do not clear screen for non-TTY environments in watch mode (#17129) 2022-12-19 12:59:32 -05:00
David Sherret
2afac5bf78
refactor(progress bars): global control for drawing (#17091)
This PR adds the concept of a global `DrawThread`, which can receive
multiple renderers to draw information on the screen (note: the
underlying thread is released back to tokio when it's not rendering). It
also separates the concept of progress bars from the existing "draw
thread". This makes it trivial for us to do stuff like show permission
prompts and progress bars at the same time in the future.

The reason this is global is because the process' tty stderr is also a
global concept.
2022-12-19 11:19:33 -05:00
Bartek Iwańczuk
383d40a33b
fix(npm): conditional exports with --node-modules-dir (#17111)
This commit fixes conditional exports in `require()` implementation
if `--node-modules-dir` flag is used.
2022-12-19 17:09:54 +01:00
Luca Casonato
d1f6b51990
test(ext/fetch): fix test in release mode (#17125) 2022-12-19 15:18:14 +01:00
Luca Casonato
43b6390629
fix(ext/fetch): handle errors in req body stream (#17081)
Right now an error in a request body stream causes an uncatchable
global promise rejection. This PR fixes this to instead propagate the
error correctly into the promise returned from `fetch`.

It additionally fixes errored readable stream bodies being treated as
successfully completed bodies by Rust.
2022-12-19 12:49:00 +01:00
Leo Kettmeir
84b70dd2fb
chore(lsp/testing): refactor collectors test (#17104) 2022-12-19 03:56:26 +01:00
Leo Kettmeir
1d18b65edc
fix(runtime): expose extensions_with_js from WorkerOptions (#17109)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-12-19 03:55:50 +01:00
Pig Fang
59dedf217f
fix(init): update comment style (#17074)
The output of `init` are commands, so this should be treated as a "Shell
script". In Shell script, comments must start with `#`, not `//`. (This
also makes the commands example easier to be copied to somewhere.)
2022-12-17 23:26:25 +01:00
David Sherret
e9ecfdd20a
fix(runtime): Deno.memoryUsage().rss should return correct value (#17088)
This commit changes implementation of "Deno.memoryUsage()" to return
correct value for "rss" field. To do that we implement a specialized function
per os to retrieve this information.
2022-12-17 23:25:51 +01:00
linbingquan
f46df3e359
chore: update to Rust 1.66.0 (#17078) 2022-12-17 23:20:15 +01:00
David Sherret
f2c9cc500c
fix(lint): column number for pretty reporting was off by 1 (#17107)
Closes #17086
2022-12-17 16:00:33 -05:00
Leo Kettmeir
4e01f25ad2
fix(lsp/testing): support not needing to declare first arg function in test declaration (#17097) 2022-12-17 16:16:05 +01:00
sigmaSd
c39550fe52
fix(repl): doing two history searches exiting with ctrl+c should not exit repl (#17079)
fix https://github.com/denoland/deno/issues/16147
2022-12-16 18:39:52 -05:00
Bartek Iwańczuk
efcb93f8b9
fix(npm): fix require resolution if using --node-modules-dir (#17087)
In our `require()` implementation we use a special logic to resolve
"base path" when looking for matching packages, however this logic
is in contradiction to what needs to happen if there's a local
"node_modules"
directory used. This commit changes require implementation to be aware
if we're running off of global node modules cache or a local one.
2022-12-16 23:41:51 +01:00
David Sherret
058610b458
fix(install): use a hidden file for the lockfile and config (#17084)
Closes #17083
2022-12-16 22:24:06 +01:00
Bartek Iwańczuk
a202e38316
refactor(core): allow to listen for notifications in LocalInspectorSession (#17040) 2022-12-16 20:12:06 +01:00
Bartek Iwańczuk
ff71ef8175
fix(repl): errors shouldn't terminate repl (#17082)
This commit changes REPL to never surface errors coming
from code execution, but instead print them as errors
to the REPL itself.
2022-12-16 17:11:10 +01:00
Leo Kettmeir
d7f4298015
fix(lsp): handle template literal as first arg in test function (#17076) 2022-12-16 14:53:30 +01:00
David Sherret
9e977cd6aa
fix(npm): improve exports resolution when type checking (#17071)
Closes #17012
2022-12-15 21:15:25 -05:00
David Sherret
28cc18b516
fix(regression): ensure progress information is shown when downloading remote modules (#17069) 2022-12-15 22:23:50 +01:00
denobot
b9527f5020
chore: forward v1.29.1 release commit to main (#17067)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2022-12-15 13:30:55 -05:00
Leo Kettmeir
50c7526526
fix: re-add Response.json static method (#17061)
Same as #16040
2022-12-15 10:33:19 -05:00
Bartek Iwańczuk
585ec1218f
Revert "feat(ops): Fast zero copy string arguments (#16777)" (#17063)
This reverts commit 9b2b8df927.

Closes https://github.com/dsherret/ts-morph/issues/1372
Closes https://github.com/denoland/deno/issues/16979
2022-12-15 15:26:10 +00:00
denobot
0d4e4af7ac
1.29.0 (#17052)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-12-15 00:22:54 +01:00
David Sherret
9f82abb4b4
fix(upgrade/windows): correct command in windows access denied message (#17049) 2022-12-14 16:21:43 -05:00
David Sherret
9e9e8f1e38
fix: upgrade to TS 4.9.4 (#17048) 2022-12-14 13:00:51 -05:00
David Sherret
4a64ca8501
chore: fix recent regression with deno upgrade not handling redirects (#17045) 2022-12-14 08:47:18 -05:00
David Sherret
392cca87a8
fix(fmt): panic in yaml header with multi-byte characters (#17042)
Closes #17010
2022-12-13 23:36:02 +00:00
David Sherret
878590b773
fix(npm): support loose node semver ranges like >= ^x.x.x (#17037) 2022-12-13 13:01:42 -05:00
Divy Srivastava
ac4b5de656
feat(napi): improve napi coverage (#16198) 2022-12-13 19:56:53 +05:30
Leo Kettmeir
76a9df1ed8
docs: use example & default tags (#17032) 2022-12-13 14:14:41 +01:00
Bartek Iwańczuk
435948e470
feat(repl): support npm packages (#16770)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-12-13 13:53:32 +01:00
Leo Kettmeir
5d9bb8b4b0
feat: support createNew in Deno.writeFile (#17023) 2022-12-13 05:12:49 +01:00
Leo Kettmeir
a2ba573e77
fix: default to "inherit" for Deno.Command#spawn()'s stdout & stderr (#17025) 2022-12-13 05:12:19 +01:00
David Sherret
8972ebc9cc
fix: always derive http client from cli flags (#17029)
I'm not sure how to test this. It doesn't seem to have an existing test.

Closes #15921
2022-12-12 21:30:44 -05:00
Bartek Iwańczuk
8c026dab92
feat: improve download progress bar (#16984)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-12-12 20:52:10 -05:00
Bartek Iwańczuk
4a17c93088
feat: add --inspect-wait flag (#17001)
This commit adds new "--inspect-wait" flag which works similarly
to "--inspect-brk" in that it waits for inspector session to be
established before running code. However it doesn't break on the first
statement of user code, but instead runs it as soon as a session
is established.
2022-12-12 15:33:30 +01:00
Geert-Jan Zwiers
890b065310
feat(cli): support deno bench in the config file (#16608)
This PR adds the ability to set `include/exclude` fields for `deno
bench` in the configuration file.
2022-12-10 02:30:47 +01:00
sigmaSd
4eb8e875fd
feat(init): Generate main_bench.ts by default (#16786)
This commit changes "deno init" to generate "main_bench.ts" file
which scaffold two example bench cases.
2022-12-10 00:34:08 +01:00
Bartek Iwańczuk
6794d9fe5d
feat(init): Use jsonc for configuration file (#17002)
Generate "deno.jsonc" instead of "deno.json" when running "deno init"
subcommand.
2022-12-09 23:55:03 +01:00
David Sherret
653aebfa1a
fix: respect the --quiet flag in more cases (#16998) 2022-12-09 10:54:24 -05:00
Bartek Iwańczuk
cb6700fa5a
unstable: remove Deno.spawn, Deno.spawnSync, Deno.spawnChild APIs (#16893)
This commit removes three unstable Deno APIs:
- "Deno.spawn()"
- "Deno.spawnSync()"
- "Deno.spawnChild()"

These APIs were replaced by a unified "Deno.Command" API.
2022-12-09 16:43:36 +01:00
David Sherret
6541a0a9fd
refactor: cleanup main.rs (#16996)
1. Extracts out some code from main.rs
2. Inlines all the `x_command` functions in main.rs
2022-12-09 09:40:48 -05:00
Lino Le Van
a9d2154110
fix(cli/upgrade): properly cleanup after finished (#16930)
Co-authored-by: kidonng <kidonng@users.noreply.github.com>
2022-12-08 17:48:48 -05:00
David Sherret
01afb672e1
chore: fix pty_complete_imports test (#16992)
This test doesn't run on the CI.
2022-12-08 16:56:47 +00:00
David Sherret
91443bbc0b
fix(compile): ensure import map is used when specified in deno config file (#16990)
Closes #14246
2022-12-08 11:50:09 -05:00
Bartek Iwańczuk
a6b5d05311
feat(init): Generate deno.json by default (#16389)
Updates `deno init` subcommand to create a `deno.json` when initializing
a new project.

Slightly changes the output, to make it more readable.
2022-12-08 06:34:28 +01:00
Roj
44b2b950fd
feat(cli): support configuring the lock file in the config file (#16781)
This allows the user to completely opt out from the lock file or rename
it without having to use `--no-lock` and/or `--lock` in all commands.

## Don’t Use Lock File

```json
{
  "lock": false
}
```

## Use Lock File With a Different Name

```json
{
  "lock": "deno2.lock"
}
```

The CLI args `--no-lock` and `--lock` will always override what is in
the config file.

Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2022-12-08 00:13:45 +01:00
David Sherret
dac30af151
feat(fmt): improve width calculation (#16982)
Formats code according to Unicode Standard Annex #11 rules
(https://crates.io/crates/unicode-width).

This aligns `deno fmt` more with prettier.
2022-12-07 17:32:24 -05:00
David Sherret
f8bcf6be28
feat(npm): add support for NPM_CONFIG_REGISTRY (#16980) 2022-12-07 16:10:50 -05:00
Bartek Iwańczuk
1a472ad06b
feat(repl): run "deno repl" with no permissions (#16795)
This commit changes "deno repl" command to run with no permissions by
default and accept "--allow-*" flags. 

This change is dictated by the fact that currently there is no way to
run REPL with limited permissions. Technically it's a breaking 
change in the CLI command, but there's agreement in the team 
that it has merit and it's a good solution.

Running just "deno" command still starts the REPL with full permissions
allowed, but now a banner is printed to inform users about that:
2022-12-07 20:21:18 +01:00
David Sherret
192f07bb7e
feat(flags): add deno check --all as new preferred alias for --remote (#16702)
Closes #16374
2022-12-07 13:33:26 -05:00
David Sherret
9c1ab39e19
feat: ignore node_modules and .git folders when collecting files everywhere (#16862)
We currently only do this for fmt. This makes it so they're excluded by
default, but you can still opt into these directories by explicitly
specifying them.
2022-12-07 13:10:10 -05:00
David Sherret
f4385866f8
feat: upgrade to TypeScript 4.9.3 (#16973)
Updated from: https://github.com/denoland/TypeScript/pull/2
2022-12-07 12:59:59 -05:00
David Sherret
5dbc07935d
fix(test): handle scenario where --trace-ops would cause an unhandled promise rejection (#16970)
Closes #16969
2022-12-06 15:58:18 -05:00
David Sherret
c03e0f3853
refactor: remove deno_graph::Locker usage (#16877)
This is just a straight refactor and doesn't make any improvements to
the code that could now be made.

Closes #16493
2022-12-06 14:12:51 -05:00
Bartek Iwańczuk
3e47a27f4f
tests: Refactor inspector tests (#16967)
This commit adds "InspectorTester" struct which is used in
inspector tests - it encapsulated various functionalities that
we need (like reading/writing to WebSocket), but also adds
better error handling which should help with debugging flaky
tests.
2022-12-06 18:55:29 +01:00
Luca Casonato
923370f18f
fix(ext/fetch): new Request should soft clone (#16869)
Previously the inner request object of the original and the new request
were the same, causing the requests to be entangled and mutable changes
to one to be visible to the other. This fixes that.
2022-12-06 09:39:04 +01:00
David Sherret
3973ceb634
fix(npm): dependency types were sometimes not being resolved when package had no types entry (#16958)
Closes #16957
2022-12-05 20:09:31 -05:00
Bartek Iwańczuk
79285fa83b
npm: ensure runtime exceptions are surfaced when debugger is attached (#16943)
Currently runtime exception are only displayed at the program end in
terminal, which makes it only a partial fix, as a full fix requires
https://github.com/denoland/rusty_v8/pull/1149 which adds new bindings 
to the inspector that allows to notify it about thrown exceptions.
This will be handled in a follow up commit.
2022-12-06 02:00:10 +01:00
David Sherret
a7dd28a07c
fix(task): improve word parsing (#16911)
Ref https://github.com/denoland/deno_task_shell/pull/67
2022-12-05 19:02:20 -05:00
David Sherret
2fab4583ef
fix(test): improve how --fail-fast shuts down when hitting limit (#16956)
Closes #15650
2022-12-05 16:17:49 -05:00
Bartek Iwańczuk
3863aaf8ae
refactor: remove references to Deno.core in bootstrap code (#16937)
Prerequisite for https://github.com/denoland/deno/pull/16881
2022-12-05 17:11:57 +01:00
Bartek Iwańczuk
918518b506
napi: respect --quiet flag in unimplemented warnings (#16935) 2022-12-05 14:25:25 +01:00
Bartek Iwańczuk
83b6085604
revert: Inspector changes (#16939)
Reverts 66dc54a7f and e2a0c3f0

Closes https://github.com/denoland/deno/issues/16926
2022-12-04 21:08:53 +01:00
阿豪
8b5b327b18
feat(ext/ffi): better type hints for Deno.dlopen (#16874) 2022-12-03 17:45:35 +05:30