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

425 commits

Author SHA1 Message Date
Brenley Dueck
a189c5393e
feat(lint): add a report lint config setting (#16045)
Builds off this PR to add a "report" setting to deno.json which can be
"pretty", "compact", or "json".
2022-10-25 14:21:20 +02:00
David Sherret
bcfe279fba
feat(unstable/npm): initial type checking of npm specifiers (#16332) 2022-10-21 15:20:18 +00:00
Aapo Alasuutari
e2be70b035
feat(ext/ffi): Make op_ffi_ptr_of fast (#16297)
Makes `op_ffi_ptr_of` fast. One of the tests changed from printing
`false` to `true` as the fast `&[u8]` slice path creates the slice with
a null pointer. Thus the `op_ffi_ptr_of` will now return a null pointer
value whereas previously it returned a dangling pointer value.
2022-10-20 09:37:37 +05:30
Aapo Alasuutari
722ea20e86
perf(ext/ffi): Fast UnsafePointerView read functions (#16351)
This PR makes pointer read methods of `Deno.UnsafePointerView` Fast API
compliant, with the exception of `getCString` which cannot be made fast
with current V8 Fast API.
2022-10-20 09:35:56 +05:30
Bartek Iwańczuk
973069b341
feat: Add new lockfile format (#16349)
Introduces a new lockfile format that will be used to support locking
"npm" dependencies.

Currently the format looks as follows:

```
// This file is automatically generated by Deno, do not edit its contents
// manually. This file should be commited to your repository.
{
  "version": "2",
  "remote": {
    "https://deno.land/std@0.160.0/http/server.ts": "asdwetsw44523asdfgfas..",
    "https://deno.land/std@0.160.0/http/file_server.ts": "asdwetsw44523asdfgfas.."
  }
}

```

A follow up PR will add "npm" key that will be used to store information
related
to "npm" dependencies and their resolution.

The new format is used when `--lock-write` is present, if user tries to
load
a lock file using the old format it will still work.
2022-10-19 23:30:44 +02:00
Luca Matei Pintilie
1a0c7edeba
feat: introduce navigator.language (#12322)
Link to the spec:
https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-language-dev

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-18 15:33:35 +02:00
Bartek Iwańczuk
23bb0abc23
feat(task): remove warning about being unstable (#16281)
`deno task` has been in use for a few months now. It was very
well received and there are not many complaints. I feel like
this warning might be discouraging for some users and we don't
really plan to make drastic changes to it (besides adding support
for globs in unspecified future).
2022-10-18 14:39:04 +02:00
David Sherret
74be01273c
chore: upgrade internal deno_std to 0.160 (#16333) 2022-10-17 22:57:31 +00:00
David Sherret
698ae4bfed
feat(unstable/npm): support providing npm dist-tag in npm package specifier (#16293) 2022-10-17 09:16:19 -04:00
Cre3per
cf1be5e76f
fix: add error cause in recursive cause tail (#16306) 2022-10-16 21:16:46 +02:00
Kitson Kelly
7d78f58187
feat: support inlay hints (#16287)
Closes: #11853
2022-10-16 13:39:43 +11:00
David Sherret
872dc9b1df
feat(unstable/task): add INIT_CWD env var (#16110) 2022-10-15 16:46:28 -04:00
Kitson Kelly
afcea6c233
fix(lsp): properly handle snippets on completions (#16274)
Fixes #15367
2022-10-14 23:04:38 +11:00
Matt Ezell
06ccb6d41e
chore: Added onbeforeunload to window type definition (#16251) 2022-10-13 10:47:47 +02:00
Bartek Iwańczuk
0b4a6c4d08
chore: remove 'fix_exotic_specifier' test (#16143)
It's a test that's been flaky for a week, and after offline discussion,
we're no longer sure what it's testing.
2022-10-04 14:24:35 +02:00
Bartek Iwańczuk
fde938116d
feat(unstable): add support for npm specifier cli arguments for 'deno cache' (#16141)
This commit adds support for npm specifier in "deno cache" subcommand.

```
$ deno cache --unstable npm:vite npm:chalk https://deno.land/std/http/file_server.ts
```

Besides downloading requested npm package(s), it will also download
necessary code from "std/node/".
2022-10-03 23:26:42 +02:00
Bartek Iwańczuk
5b097fd7e5
fix(npm): better error is version is specified after subpath (#16131) 2022-10-03 19:10:53 +02:00
Bartek Iwańczuk
8e1b2fca59
fix(npm): panic on invalid package name (#16123) 2022-10-03 17:45:01 +02:00
Bartek Iwańczuk
048c06f84f
fix(npm): handle json files in require (#16125) 2022-10-01 22:21:19 +02:00
David Sherret
fcb20ab952
chore: fix flaky integration::lint::compact (#16075) 2022-09-28 13:52:10 -04:00
David Sherret
d677ba67f5
feat(npm): functionality to support child_process.fork (#15891) 2022-09-28 13:04:16 -04:00
Brenley Dueck
23125b275f
feat(lint): add --compact flag for terse output (#15926) 2022-09-28 18:47:48 +02:00
Luca Casonato
70bc0eb72b
feat(unstable): Deno.setRaw -> Deno.stdin.setRaw (#15797)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-28 15:03:56 +02:00
David Sherret
716005a0d4
feat(npm): add flag for creating and resolving npm packages to a local node_modules folder (#15971) 2022-09-22 11:17:02 -04:00
Bartek Iwańczuk
9a216806d5
feat(npm): add support for --reload=npm: and --reload=npm:<package> (#15972) 2022-09-22 10:39:58 -04:00
Kitson Kelly
73e89844ba
feat(cli): update to TypeScript 4.8 (#15064) 2022-09-20 07:00:01 +10:00
David Sherret
1464b756a4
refactor: move out test files from root testdata directory into sub directories (#15949) 2022-09-19 10:32:21 -04:00
David Sherret
a4a894fa1e
fix(doc): deno doc should parse modules if they haven't been parsed before (#15941) 2022-09-18 13:59:33 -04:00
Yoshiya Hinosawa
d7b27ed63b
fix(ext/node): fix builtin module module (#15904) 2022-09-17 20:35:32 +09:00
Divy Srivastava
6154188786
perf(ext/console): avoid wrapConsole when not inspecting (#15931) 2022-09-17 15:34:43 +05:30
Colin Ihrig
19deec4494
fix(ops): add node.js env variable allowlist (#15893)
This commit allows the Node compatibility layer to skip
environment variable permission checks when --unstable
is passed and the variable name is one that Node uses.

Fixes: https://github.com/denoland/deno/issues/15890
2022-09-14 11:59:20 -04:00
Bartek Iwańczuk
7b98282993
fix(npm): binary entrypoint for .js or no extension (#15900) 2022-09-14 10:41:47 -04:00
Bartek Iwańczuk
233d5422fd
fix(npm): use shim from deno_node crate for 'module' built-in module (#15881) 2022-09-12 18:11:32 -04:00
David Sherret
98454c1eb8
fix(npm): support cjs resolution of package subpath with package.json (#15855) 2022-09-12 15:47:54 -04:00
David Sherret
a3a4760831
fix(npm): align Deno importing Node cjs with Node esm importing cjs (#15879) 2022-09-12 14:28:51 -04:00
David Sherret
dee9f0acaf
fix(npm): align Node esm code importing cjs with Node (#15838) 2022-09-10 15:00:45 -04:00
David Sherret
3b0de03b59
fix(npm): remove export binding to match node (#15837) 2022-09-10 11:38:11 -04:00
Bartek Iwańczuk
6c179daff0
fix(npm): recursive translation of reexports, remove window global in node code (#15806)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-09-08 22:01:48 +02:00
David Sherret
9e6917426a
fix: upgrade deno_ast to 0.19 (#15808) 2022-09-07 15:06:18 -04:00
Bartek Iwańczuk
4a250b2f25
feat: add --no-npm flag to disable npm: imports (#15673)
This commit adds "--no-npm" flag, it's similar to "--no-remote"
flag. This flag makes Deno error out if "npm:" specifier is encountered.
2022-09-07 15:33:51 +02:00
Divy Srivastava
7f4b043f32
fix(test): unflake wasm_unreachable test (#15794) 2022-09-07 16:21:18 +05:30
Nayeem Rahman
5819fef2d5
test: fix bad resource fixture (#15792) 2022-09-07 09:49:34 +05:30
Divy Srivastava
d2a408f452
perf(runtime): short-circuit queue_async_op for Poll::Ready (#15773) 2022-09-06 23:08:37 +05:30
David Sherret
08a6af398f
fix(cli): allow using file resource synchronously while being used async (#15747) 2022-09-04 22:33:06 -04:00
Bartek Iwańczuk
e324151520
BREAKING(unstable): remove --compat mode (#15678)
This commit removes "compat" mode. We shipped support for "npm:" specifier
support in v1.25 and that is preferred way to interact with Node code that we
will iterate and improve upon.
2022-09-03 18:19:30 +02:00
Bartek Iwańczuk
fc4025c878
fix(npm): add more context to errors when file doesn't exist (#15749) 2022-09-03 15:43:35 +02:00
Bartek Iwańczuk
223403e899
feat(info): add information about npm modules cache (#15750) 2022-09-03 15:31:01 +02:00
Nayeem Rahman
4f8dea100e
refactor(test): grab runTests() and runBenchmarks() from __bootstrap (#15420) 2022-09-02 19:44:45 +02:00
David Sherret
03e6727a04
fix(npm): correct exact matching of pre-release versions (#15745) 2022-09-02 11:21:40 -04:00
David Sherret
e1d7d7b0e3
fix(npm): better node version and version requirement compatibility (#15714) 2022-09-01 11:50:12 -04:00
Bartek Iwańczuk
adec4f575e
fix(npm): translate CJS to ESM with name clashes for files and dirs (#15697) 2022-08-31 00:31:59 +02:00
David Sherret
5f251b283b
fix(npm): prefer importing esm from esm (#15676) 2022-08-30 14:09:22 -04:00
Bartek Iwańczuk
54be07d05e
fix(npm): skip extracting pax_global_header from tarballs (#15677) 2022-08-30 17:15:41 +02:00
Danny Povolotski
5e0fa5dd88
fix(ext/websocket): fix closing of WebSocketStream with unread messages (#15632) 2022-08-30 03:43:17 +02:00
Bartek Iwańczuk
2851a98072
fix(npm): conditional exports with wildcards (#15652) 2022-08-29 19:15:20 +02:00
David Sherret
ec98d86d21
fix(npm): handle cjs re-exports with the same name as an export (#15626) 2022-08-26 14:34:35 -04:00
Yoshiya Hinosawa
9b324b1cf4
fix(ext/node): fix global in node env (#15622) 2022-08-26 23:39:05 +09:00
David Sherret
f583a7ebf4
chore(npm): add test for esm npm binary package (#15609) 2022-08-26 09:17:48 -04:00
David Sherret
376665d115
fix: avoid global declaration collisions in cjs (#15608)
* Use a default stack size * 2 in debug for Windows because swc using so much stack size. We should look into this more later though.
2022-08-25 20:24:18 -04:00
David Sherret
348291f5ec
fix(npm): always require --unstable flag even for esm (#15583) 2022-08-24 13:44:38 -04:00
Luca Casonato
33c4d45328
fix: resolve jsxImportSource relative to module (#15561)
Previously `jsxImportSource` was resolved relative to the config file
during graph building, and relative to the emitted module during
runtime.

This is now fixed so that the JSX import source is resolved relative to
the module both during graph building and at runtime.
2022-08-24 19:36:05 +02:00
David Sherret
684aabbc25
feat: support subpaths in npm package references (#15578) 2022-08-24 11:25:32 -04:00
Bartek Iwańczuk
5268fa0e0f
fix(unstable): various resolution bugs for npm: specifiers (#15546)
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-24 14:54:20 +02:00
David Sherret
452df99222
feat(npm): support packages with multiple command names (#15565) 2022-08-23 22:01:21 -04:00
David Sherret
e7367044d9
feat: binary npm commands (#15542) 2022-08-23 10:39:19 -04:00
David Sherret
362af63c6f
fix(cache): do not attempt to emit non-emitable files (#15562) 2022-08-23 10:30:14 -04:00
Bartek Iwańczuk
c66386dbd2
feat(unstable): Respect --cached-only flags for npm: specifiers (#15512)
This commit changes "npm:" specifier handling to respect "--cached-only" flags and adds "Download" messages for npm registry api calls.

Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-22 17:35:04 +02:00
Nayeem Rahman
97954003cc
feat: queueMicrotask() error handling (#15522)
Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158).
2022-08-21 20:16:42 +02:00
Nayeem Rahman
e39d4e3e7f
fix(core/runtime): always cancel termination in exception handling (#15514) 2022-08-21 13:57:10 +02:00
David Sherret
87f80ff6be
feat(unstable): initial support for npm specifiers (#15484)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-20 11:31:33 -04:00
Kitson Kelly
a2ab5eee01
docs: add category tag for built-in APIs (#15480) 2022-08-17 13:12:24 +10:00
Bartek Iwańczuk
5a4f84a0e1
chore: upgrade rusty_v8 to 0.48.1 (#15310) 2022-08-15 14:12:11 +02:00
David Sherret
8eed24cd3d
fix(coverage): ensure coverage is only collected in certain situations (#15467) 2022-08-12 15:21:17 -04:00
Aapo Alasuutari
2164f6b1eb
perf(ops): Monomorphic sync op calls (#15337)
Welcome to better optimised op calls! Currently opSync is called with parameters of every type and count. This most definitely makes the call megamorphic. Additionally, it seems that spread params leads to V8 not being able to optimise the calls quite as well (apparently Fast Calls cannot be used with spread params).

Monomorphising op calls should lead to some improved performance. Now that unwrapping of sync ops results is done on Rust side, this is pretty simple:

```
opSync("op_foo", param1, param2);
// -> turns to
ops.op_foo(param1, param2);
```

This means sync op calls are now just directly calling the native binding function. When V8 Fast API Calls are enabled, this will enable those to be called on the optimised path.

Monomorphising async ops likely requires using callbacks and is left as an exercise to the reader.
2022-08-11 15:56:56 +02:00
Nayeem Rahman
578f12d531
fix(cli): allow configurations files to also be json modules (#15444)
Closes #15440
2022-08-11 07:33:42 +10:00
Kayla Washburn
08061b60d9
fix: allow setting globalThis.location when no --location is provided (#15448) 2022-08-10 12:57:30 -06:00
Kitson Kelly
1c2ec1f48f
fix: update deno_graph to fix importing config as JSON module (#15388)
Ref: denoland/deno_graph#166
2022-08-10 07:27:22 +10:00
Bartek Iwańczuk
1f54d87789
feat: add ext/node for require support (#15362)
This commit adds "ext/node" extension that implementes CommonJS module system.

In the future this extension might be extended to actually contain implementation of
Node compatibility layer in favor of "deno_std/node".

Currently this functionality is not publicly exposed, it is available via "Deno[Deno.internal].require"
namespace and is meant to be used by other functionality to be landed soon.

This is a minimal first pass, things that still don't work:

support for dynamic imports in CJS
conditional exports
2022-08-09 21:06:01 +02:00
Nayeem Rahman
34328690dc
fix(test): output parallel test results independently (#15399) 2022-08-04 12:38:40 -04:00
Nayeem Rahman
2e2c623882
fix(test): race condition for cancelled tests (#15233) 2022-08-02 10:55:11 -04:00
Kitson Kelly
09d14b1b57
fix(lsp): use correct commit chars for completions (#15366)
Fixes: #15252
2022-08-02 08:54:17 +10:00
Bartek Iwańczuk
20a89d46c4
fix(core): BorrowMutError in nested error (#15352) 2022-07-30 16:09:42 +02:00
Bartek Iwańczuk
504d2936ec
fix: unhandledrejection handling for sync throw in top level (#15279)
Fixes an edge in "unhandledrejection" event that prevent synchronous
errors being surfaced when throw from a top-level scope.
2022-07-23 00:40:42 +02:00
Bartek Iwańczuk
4e71a9424e
fix: proper typings for unhandledrejection event (#15271) 2022-07-21 23:54:53 +02:00
Satya Rohith
6c3d9b981f
fix(cli): unset jsxFragmentFactory & jsxFactory options (#15264) 2022-07-21 14:44:18 +05:30
David Sherret
26cea0e2ca
feat(test): add --parallel flag, soft deprecate --jobs (#15259)
Co-authored-by: mrkldshv <markladyshev@gmail.com>
2022-07-20 17:36:54 -04:00
Bartek Iwańczuk
d53936eb7d
Reland "feat: add "unhandledrejection" event support" (#15211) 2022-07-20 20:28:19 +02:00
Nayeem Rahman
6e350b2b7c
chore(cli): Ignore "experimentalDecorators" and "moduleDetection" options (#15202) 2022-07-20 16:59:56 +02:00
Bartek Iwańczuk
d17b3906bf
chore: use import.meta.resolve() in tests (#15256) 2022-07-20 16:56:53 +02:00
Dante Issaias
2b1f145c3e
chore(ext): update webgpu (#15059) 2022-07-20 02:22:26 +02:00
Leo Kettmeir
2eb27c92db
fix: WebSocketStream ping event causes pending promises (#15235) 2022-07-18 22:49:49 +02:00
Roj
70d1ecaeaa
feat(cli): support configuring the test tool in the config file (#15079) 2022-07-18 15:12:19 -04:00
Bartek Iwańczuk
999cbfb52b
feat: import.meta.resolve() (#15074)
This commit adds new "import.meta.resolve()" API which
allows to resolve specifiers relative to the module the API
is called in. This API supports resolving using import maps.
2022-07-18 20:05:26 +02:00
Bartek Iwańczuk
89c1ad0303
fix: revert changes to test output for uncaught errors (#15231) 2022-07-18 18:58:13 +02:00
Nayeem Rahman
45c49034a7
BREAKING(unstable): Improve Deno.spawn() stdio API (#14919)
- "SpawnOutput" extends "ChildStatus" instead of composing it
- "SpawnOutput::stdout", "SpawnOutput::stderr", "Child::stdin", 
"Child::stdout" and "Child::stderr" are no longer optional, instead 
made them getters that throw at runtime if that stream wasn't set 
to "piped". 
- Remove the complicated "<T extends SpawnOptions = SpawnOptions>" 
which we currently need to give proper type hints for the availability of 
these fields. Their typings for these would get increasingly complex 
if it became dependent on more options (e.g. "SpawnOptions::pty" 
which if set should make the stdio streams unavailable)
2022-07-18 15:16:12 +02:00
Nayeem Rahman
22a4998e29
refactor: allocate IDs for tests (#14729) 2022-07-15 13:09:22 -04:00
Mark Ladyshau
ee0c0586b3
feat(cli/test): add DENO_JOBS env variable for test subcommand (#14929) 2022-07-15 10:29:55 -04:00
Bartek Iwańczuk
f9b692e68e
Revert "feat: add "unhandledrejection" event support (#12994) (#15080)" (#15210)
This reverts commit 1a7259b04b.
2022-07-15 01:06:20 +02:00
Bartek Iwańczuk
1a7259b04b
feat: add "unhandledrejection" event support (#12994) (#15080)
Relanding #12994 

This commit adds support for "unhandledrejection" event.

This event will trigger event listeners registered using:

"globalThis.addEventListener("unhandledrejection")
"globalThis.onunhandledrejection"
This is done by registering a default handler using
"Deno.core.setPromiseRejectCallback" that allows to
handle rejected promises in JavaScript instead of Rust.

This commit will make it possible to polyfill
"process.on("unhandledRejection")" in the Node compat
layer.

Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
2022-07-14 22:39:20 +02:00
Rafael Ávila de Espíndola
a34ed568e9
fix(cli): expand tsc roots when using checkJs (#15164)
A JS file can still point to a TS file, so we need to expand the roots
in the checkJs case too.

Fixes: #15163
2022-07-14 10:40:47 -04:00