Commit graph

480 commits

Author SHA1 Message Date
Satya Rohith 02d0ff58d2
refactor(tests): move worker_threads itests to spec tests (#23648) 2024-05-03 05:52:47 +00:00
David Sherret 3e98ea4e69
chore(tests/specs): ability to have sub tests in file (#23667)
Allows writing named sub-tests. These are:

1. Filterable on the command line via `cargo test ...`
2. Run in parallel
3. Use a fresh temp and deno dir for each test (unlike steps)
2024-05-03 10:19:42 +05:30
David Sherret b7945a218e
chore: move cert itests to spec tests (#23607) 2024-05-03 00:43:12 +00:00
Bartek Iwańczuk cf0579c7d4
test: npm registry handles two test scopes (#23663)
This commit updates our testing npm registry to handle
additional `@denotest2` scope in addition to `@denotest`
scope. I might have to update it further in the future to handle
additional scopes, but it's good enough for now.
2024-05-03 00:00:38 +00:00
Leo Kettmeir 1b27b58396
fix(test): proper type checking for files with doc tests (#23654)
Closes https://github.com/denoland/deno/issues/23430

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-05-02 18:13:51 +00:00
Satya Rohith 56ba7f3c23
fix(ext/node): support delete process.env.var (#23647)
Closes https://github.com/denoland/deno/issues/23641
2024-05-02 06:40:22 +00:00
Matt Mastracci 505130d813
chore(cli): add permission test (#23633) 2024-05-01 13:17:05 -06:00
David Sherret e0069c87c0
chore: make a couple repl tests less flaky (#23636)
These were both failing for me from time to time locally.
2024-05-01 16:37:17 +00:00
David Sherret 56bf634fa9
fix(node): require.resolve - fallback to global cache when bare specifier from paths not found (#23618)
Part of #22607 (probably closes it, but I haven't done thorough testing)

Makes it so that `require.resolve` with `paths` specified will fallback
to using the global cache when the paths can't be found when using a
global cache (not when using a node_modules folder)
2024-04-30 23:41:29 -04:00
David Sherret f2216c90a7
chore: fix flaky module graph cache tests (#23623) 2024-05-01 01:36:52 +00:00
Nayeem Rahman ac9e07bdfa
chore(lsp): revert import map pre-resolution for jsxImportSource (#23619) 2024-05-01 01:44:20 +01:00
Luca Casonato 6cdf81db7c
feat(cli): add support for jsxImportSourceTypes (#23419)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-04-30 18:12:35 +00:00
Satya Rohith 0156f82e73
fix(ext/node): support multiple message listeners on MessagePort (#23600)
Closes https://github.com/denoland/deno/issues/23561
2024-04-30 16:59:39 +05:30
Kenta Moriuchi 783533d2e3
FUTURE: remove import assertions support for JavaScript (#23541)
Ref #17944, https://github.com/swc-project/swc/issues/8893

TypeScript removes the `assert` keywords in the transpile, so this PR
only works for JavaScript files
2024-04-29 22:43:05 +02:00
David Sherret 4384a126bb
fix: handle specifying an import map in an ancestor dir of deno.json (#23602)
* https://github.com/denoland/deno_config/pull/51

Closes https://github.com/denoland/deno/issues/21440
2024-04-29 14:32:27 -04:00
David Sherret 48daf2dc88
chore: add tests for moduleGraph2 (#23603)
Also did some renames from underscores to hyphens
2024-04-29 14:09:58 -04:00
Matt Mastracci 56fec538e1
fix(ext/http): ensure signal is created iff requested (#23601)
This correctly creates the `AbortSignal` regardless of when we request
it. If the signal is requested after the request has completed, the
signal is created in the aborted state.

Using GC counts, we can see a reduction in object creation:

This PR: 440
deno 1.42.4: 1650
deno 1.43.0+b02ffec: 874
2024-04-29 09:40:02 -06:00
David Sherret da52058a94
chore: migrate bench, publish, and more itests to spec tests (#23584) 2024-04-29 10:08:27 -04:00
Divy Srivastava b02ffec37c
fix(ext/node): exporting rsa public keys (#23596)
Initial support for exporting rsa public KeyObject.

Current assumption is that RSA keys are stored in pkcs1 der format in
key storage.

Ref https://github.com/denoland/deno/issues/23471 
Ref https://github.com/denoland/deno/issues/18928
Ref https://github.com/denoland/deno/issues/21124
2024-04-29 19:16:38 +05:30
Satya Rohith b8444066ea
fix(ext/node): support NODE_DEBUG env (#23583) 2024-04-29 09:36:53 +00:00
Satya Rohith 455cf1743f
fix(ext/node): add support for MessagePort.removeListener/off (#23598)
Closes https://github.com/denoland/deno/issues/23564
2024-04-29 08:53:54 +00:00
David Sherret 651e3e9e6d
fix(compile): certain jsr specifiers sometimes can't load (#23567)
When returning a jsr specifier for resolve it seems like deno core does
not work properly and hangs.

Closes https://github.com/denoland/deno/issues/23551
Closes https://github.com/denoland/deno/issues/23139
2024-04-27 21:11:57 +00:00
Yoshiya Hinosawa 8178f758bc
fix(ext/node): support process.stdin.unref() (#22865)
This PR adds private `[REF]()` and `[UNREF]()` methods to Stdin class,
and call them from Node.js polyfill layer (`TTY` class). This enables
`process.stdin.unref()` and `process.stdin.ref()` for the case when
stdin is terminal.

closes #21796
2024-04-27 20:25:18 +09:00
Bartek Iwańczuk e3d79c1703
test: cleanup npm test registry code (#23578)
Required for https://github.com/denoland/deno/pull/23560
2024-04-26 22:55:43 +02:00
Leo Kettmeir c519355624
feat(ci): category & unstable tags checker (#23568) 2024-04-26 09:04:29 -07:00
Bartek Iwańczuk 0b0af5c635
test: update for private npm registry test server (#23572)
Factored out from https://github.com/denoland/deno/pull/23560 to make it
easier to review.
2024-04-26 15:41:53 +00:00
Matt Mastracci 8c9caeb418
chore: rework TLS code in test server (#23566)
In order to make the reqwest/rustls upgrade more straightforward, we
refactor the test server to depend on deno_tls.
2024-04-25 17:00:04 -04:00
Bartek Iwańczuk 115dedde22
fix: unref stdin read (#23534)
Closes https://github.com/denoland/deno_core/issues/648

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-04-25 05:32:01 +00:00
David Sherret f3284529f1
feat(jsr): support importing from jsr via HTTPS specifiers (except for type checking) (#23513)
Closes https://github.com/jsr-io/jsr/issues/322
2024-04-24 21:43:34 +00:00
Leo Kettmeir 5a7414e163
chore: update deno_doc (#23544) 2024-04-24 20:34:21 +00:00
Nayeem Rahman ac71d876d7
fix(lsp): inherit missing fmt and lint config from parent scopes (#23547) 2024-04-24 22:14:01 +02:00
Matt Mastracci 2f8825a935
feat: Add deno serve subcommand (#23511)
By default, `deno serve` will assign port 8000 (like `Deno.serve`).
Users may choose a different port using `--port`.

`deno serve /tmp/file.ts`

`server.ts`:
```ts
export default {
  fetch(req) {
    return new Response("hello world!\n");
  },
};
```
2024-04-24 19:45:49 +00:00
David Sherret ded6afccf2
fix(publish): --dry-publish should error for gitignored excluded files (#23540)
Files that were gitignored only were not included in the diagnostic.
2024-04-24 18:52:05 +00:00
Matt Mastracci da70608700
fix(ext/net): check for TLS using undefined rather than using ReflectHas (#23538)
Fixes #23537
2024-04-24 14:27:15 -04:00
Matt Mastracci eed2598e6c
feat(ext/http): Implement request.signal for Deno.serve (#23425)
When the response has been successfully send, we abort the
`Request.signal` property to indicate that all resources associated with
this transaction may be torn down.
2024-04-24 14:03:37 -04:00
Matt Mastracci b60822f6e0
chore: use deno_unsync through deno_core (#23532) 2024-04-24 16:57:34 +00:00
Bartek Iwańczuk b424959d3e
fix(ext/node): worker_threads copies env object (#23536)
Most common argument to `env` option for `worker_threads.Worker` will be
`process.env`.

In Deno `process.env` is a `Proxy` which can't be cloned using
structured clone algorithm.

So to be safe, I'm creating a copy of actual object before it's sent to
the worker thread.

Ref #23522
2024-04-24 16:17:28 +00:00
Bartek Iwańczuk 90a167a1a2
test: add private npm registry (#23510)
This commit adds a "private npm registry" to the test server. This
registry requires to send an appropriate Authorization header.

Towards https://github.com/denoland/deno/issues/16105
2024-04-23 22:54:34 +02:00
Kenta Moriuchi aff7a64544
fix: Float16Array support (#23512)
Ref #23490, #23277

* remove `--js-float16array` flag (This flag has already added to
deno_core)
* add some `Float16Array` support
2024-04-23 22:54:19 +02:00
Nathan Whitaker 8a367d3cc3
fix(cli): Don't panic on invalid emit options (#23463)
Fixes #23456.
2024-04-23 08:50:50 -07:00
Bartek Iwańczuk 35220f0069
fix(workspace): provide workspace members as 'imports' in import map (#23492)
This commit changes the workspace support to provide all workspace
members to be available as imports based on their names and versions.

Closes https://github.com/denoland/deno/issues/23343
2024-04-23 17:21:06 +02:00
Bartek Iwańczuk b0d3b20f23
feat: enable Float16Array support (#23490)
Closes https://github.com/denoland/deno/issues/23450
2024-04-23 15:18:27 +00:00
Nayeem Rahman 5990f05360
fix(lsp): remove Document::open_data on close (#23483) 2024-04-22 19:24:00 +01:00
Marvin Hagemeister 9686a8803e
feat: add jsx precompile skip element option (#23457)
<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
This PR wires up a new `jsxPrecompileSkipElements` option in
`compilerOptions` that can be used to exempt a list of elements from
being precompiled with the `precompile` JSX transform.
2024-04-22 17:07:36 +02:00
Nathan Whitaker aac7a8cb7c
perf(lsp): Batch "$projectChanged" notification in with the next JS request (#23451)
The actual handling of `$projectChanged` is quick, but JS requests are
not. The cleared caches only get repopulated on the next actual request,
so just batch the change notification in with the next actual request.

No significant difference in benchmarks on my machine, but this speeds
up `did_change` handling and reduces our total number of JS requests (in
addition to coalescing multiple JS change notifs into one).
2024-04-22 08:03:16 -07:00
Asher Gomez 2f5a6a8514
FUTURE(ext/net): remove Deno.ConnectTlsOptions.(certFile|certChain|privateKey) (#23270)
Towards #23089

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-04-21 03:03:44 +00:00
Bartek Iwańczuk 14ae4f897f
fix(ext/node): define http.maxHeaderSize (#23479)
Closes https://github.com/denoland/deno/issues/23432
2024-04-21 07:31:23 +05:30
Asher Gomez 98e2f6d50b
FUTURE(ext/net): remove Deno.ListenTlsOptions.(keyFile|certFile) (#23271)
Towards #23089

---------

Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-04-21 01:58:59 +00:00
David Sherret 695f314a91
feat(task): support running npm binary commands in deno.json (#23478)
npm binary commands like `vite` from a `node_modules/.bin` folder will
now execute when defined in a deno.json

Closes https://github.com/denoland/deno/issues/23477
2024-04-20 20:13:46 -04:00
welfuture e55087f57a
fix: Fix some typos in comments (#23470)
Signed-off-by: welfuture <wellfuture@qq.com>
2024-04-21 01:54:07 +02:00