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

683 commits

Author SHA1 Message Date
Luca Casonato
08e5606c34
fix(ext/node): rewrite digest handling (#24392)
Previously we had many different code paths all
handling digests in different places, all with
wildly different digest support. This commit
rewrites this to use a single digest handling
mechanism for all digest operations.

It adds various aliases for digest algorithms,
like node does. For example
`sha1WithRSAEncryption` is an alias for `sha1`.

It also adds support for `md5-sha1` digests in
various places.
2024-07-05 10:10:22 +02:00
Divy Srivastava
b290fd01f3
fix(ext/node): http chunked writes hangs (#24428)
Fixes https://github.com/denoland/deno/issues/24239
2024-07-05 08:49:42 +05:30
Bartek Iwańczuk
0bbfd6fb3d
feat: Deprecate --lock-write flag (#24436)
This commit deprecates `--lock-write` flag by removing it from
the help output and printing a warning message when it's used.

Users should use `--frozen=false` instead which was added
in https://github.com/denoland/deno/pull/24355.

Towards https://github.com/denoland/deno/issues/24167.
2024-07-05 04:38:12 +02:00
David Sherret
f396b3d1c8
fix(publish): unfurling should always be done with the package json (#24435)
Closes https://github.com/denoland/deno/issues/24430
2024-07-05 00:41:01 +00:00
Marvin Hagemeister
96b527b8df
fix(node/http): don't throw on .address() before .listen() (#24432)
It's perfectly valid to access `server.address()` before calling
`.listen()`. Until a server actively listens on a socket Node will
return `null` here, but we threw a "Cannot access property 'port' of
undefined" instead.

This was discovered when inspecting failures in Koa's test suite with
Deno.
2024-07-04 18:28:48 +02:00
Filip Skokan
f632b4a92e
feat(ext/crypto): make deriveBits length parameter optional and nullable (#24426)
Updates SubtleCrypto.prototype.deriveBits as per
https://github.com/w3c/webcrypto/pull/345

(WPT update in https://github.com/web-platform-tests/wpt/pull/43400)
2024-07-04 21:10:51 +05:30
David Sherret
147411e64b
feat: npm workspace and better Deno workspace support (#24334)
Adds much better support for the unstable Deno workspaces as well as
support for npm workspaces. npm workspaces is still lacking in that we
only install packages into the root node_modules folder. We'll make it
smarter over time in order for it to figure out when to add node_modules
folders within packages.

This includes a breaking change in config file resolution where we stop
searching for config files on the first found package.json unless it's
in a workspace. For the previous behaviour, the root deno.json needs to
be updated to be a workspace by adding `"workspace":
["./path-to-pkg-json-folder-goes-here"]`. See details in
https://github.com/denoland/deno_config/pull/66

Closes #24340
Closes #24159
Closes #24161
Closes #22020
Closes #18546
Closes #16106
Closes #24160
2024-07-04 00:54:33 +00:00
Nayeem Rahman
dd6d19e120
fix(lsp): correct scope attribution for injected @types/node (#24404) 2024-07-03 20:25:42 +01:00
Bartek Iwańczuk
3242e2718f
feat: Upgrade to TypeScript 5.5.2 (#24326)
This commit upgrades TypeScript to 5.5.2.

https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/
2024-07-03 16:09:54 +02:00
Satya Rohith
496ea5903b
fix(ext/node): don't wait for end() call to send http client request (#24390)
Closes https://github.com/denoland/deno/issues/24232
Closes https://github.com/denoland/deno/issues/24215
2024-07-03 19:00:39 +05:30
Nathan Whitaker
dadc606419
fix(ext/node): Add fs.lutimes / fs.lutimesSync (#23172)
Part of #18218


- Adds `fs.lutimes` and `fs.lutimesSync` to our node polyfills. To do
this I added methods to the `FileSystem` trait + ops to expose the
functionality to JS.
- Exports `fs._toUnixTimestamp`. Node exposes an internal util
`toUnixTimestamp` from the fs module to be used by unit tests (so we
need it for the unit test to pass unmodified). It's weird because it's
only supposed to be used internally but it's still publicly accessible
- Matches up error handling and timestamp handling for fs.futimes and
fs.utimes with node
- Enables the node_compat utimes test - this exercises futimes, lutimes,
and utimes.
2024-07-02 19:33:32 -07:00
HasanAlrimawi
3324d7203e
fix(compile): prevent setting unstable feature twice (#24381)
Prevent panic when enabling a feature that is already enabled by
removing duplicate features.

Closes #22015

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-02 23:15:10 +00:00
Nathan Whitaker
c13b6d1413
feat(cli): Add --frozen flag to error out if lockfile is out of date (#24355)
Closes #18296.

Adds a `--frozen` (alias `--frozen-lockfile`) flag that errors out if
the lockfile is out of date. This is useful for running in CI (where an
out of date lockfile is usually a mistake) or to prevent accidental
changes in dependencies.

![Screenshot 2024-06-26 at 7 11
13 PM](https://github.com/denoland/deno/assets/17734409/538404b8-b422-4f05-89e8-4c9b1c248576)
2024-07-02 15:00:16 -07:00
Kenta Moriuchi
f78a60e882
feat(ext/web): add Blob.prototype.bytes() (#24148) 2024-07-02 16:04:08 +02:00
Bartek Iwańczuk
8db420d552
chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24388)
Reland of https://github.com/denoland/deno/pull/24056 that doesn't
suffer from the problem that was discovered in
https://github.com/denoland/deno/pull/24261.

It uses upgraded `hyper` and `hyper-util` that fixed the previous
problem in https://github.com/hyperium/hyper/pull/3691.
2024-07-02 02:09:47 +02:00
David Sherret
6f30ef88a2
fix(windows): check USERPROFILE env var for finding home directory (#24384) 2024-07-01 18:17:17 -04:00
Nayeem Rahman
38a6be2e8e
fix(lsp): respect lockfile redirects entries for resolution (#24365) 2024-07-01 22:08:32 +01:00
Divy Srivastava
cd4a0072dc
BREAKING(unstable/ffi): remove callback reentrant flag (#24367)
Closes https://github.com/denoland/deno/issues/22947

This option is no longer needed as fast calls are now allowed to
re-enter the isolate
2024-07-01 09:36:33 +05:30
Leo Kettmeir
ec9963570b
chore: update deno_doc (#24308) 2024-06-28 05:03:51 -07:00
Nayeem Rahman
67dcd6db51
feat(lsp): ts language service scopes (#24345) 2024-06-26 23:47:01 +01:00
Bartek Iwańczuk
2a2ff96be1
fix(ext/node): discover .npmrc in user's homedir (#24021)
This commit adds discovery of `.npmrc` files in user's homedir.

This is not a perfect fix as it doesn't merge multiple `.npmrc` files
together as per https://github.com/denoland/deno/issues/23954
but allows to fallback if no `.npmrc` file is discovered in the project
root.
2024-06-27 00:17:00 +02:00
David Sherret
0da01c0ca6
refactor: move PackageJson to deno_config (#24348) 2024-06-26 21:24:10 +00:00
ud2
86e0292733
perf(ext/node): improve Buffer.from(buffer) (#24352)
Benchmark code from #24341.

```shellsession
$ deno run --allow-hrtime bench.mjs
6479.111583
$ target/release/deno run --allow-hrtime bench.mjs
962.753875
$ node bench.mjs
855.174875
```
2024-06-26 17:11:56 -04:00
Divy Srivastava
a1ff1a453c
fix(ext/websocket): drop connection when close frame not ack (#24301)
Fixes #24292
2024-06-25 19:09:02 +05:30
Satya Rohith
13aa1d70e9
fix(ext/node): ignore stream error during enqueue (#24243) 2024-06-25 17:02:40 +05:30
Satya Rohith
b71a859188
test(node_compat): enable more stream-writable tests (#24328) 2024-06-25 09:36:40 +00:00
Luca Casonato
1e8a6b94b1
fix(ext/node): rewrite crypto.Hash (#24302)
Changes in this PR:

- Added new fixed size hash algorithms (blake2b512, blake2s256,
sha512-224, sha512-256, sha3-224, sha3-256, sha3-384, sha3-512, sm3)
- Added variable size hash algorithms (the concept), with the algorithms
shake128 and shake256
- Use cppgc instead of resources for the hasher
- Enable Node's crypto.Hash tests and fix found bugs
2024-06-24 11:47:12 +02:00
Divy Srivastava
416df1e895
fix(ext/node): add ServerResponse#appendHeader (#24216) 2024-06-21 19:21:59 +05:30
Luca Casonato
e6756c3e66
fix(ext/node): don't panic on invalid utf-8 in pem (#24303) 2024-06-21 10:25:07 +00:00
Divy Srivastava
0b65d027a1
fix(ext/node): use cppgc for node:zlib (#24267) 2024-06-20 10:31:53 +05:30
Bartek Iwańczuk
b94707af7d
Revert "chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)" (#24262)
This reverts commit fb31eaa9ca.

Reverting because users reported spurious errors when downloading
dependencies - https://github.com/denoland/deno/issues/24260.

Closes https://github.com/denoland/deno/issues/24260
2024-06-19 16:09:17 +02:00
Divy Srivastava
8dd7beb7c6
fix(ext/node): Add SIGPOLL and SIGUNUSED signals (#24259) 2024-06-19 13:41:09 +05:30
Divy Srivastava
209b286813
fix(ext/node): Add Dirent.path and Dirent.parentPath (#24257) 2024-06-19 12:51:01 +05:30
Nayeem Rahman
810474d8b7
fix(lsp): use import map from workspace root (#24246)
Follow up to #24206 which broke deno_std intellisense.
2024-06-19 00:00:17 +02:00
Tom Alcorn
5289c69271
fix(ext/web): fix AbortSignal.timeout() leak (#23842)
<!--
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.
-->

Fixes #20663.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-19 07:47:05 +10:00
David Sherret
cba212b9c6
perf(node): ensure cjs wrapper module has deterministic output (#24248) 2024-06-18 17:24:18 -04:00
Luca Casonato
7b5c514763
fix(ext/console): bump default max str lengthto 10_00 (#24245) 2024-06-18 19:00:16 +02:00
Divy Srivastava
10ac3bb091
fix(ext/node): make process.versions own property (#24240) 2024-06-18 16:33:03 +05:30
Satya Rohith
8c4b33db0d
feat(ext/node): add BlockList & SocketAddress classes (#24229)
Closes https://github.com/denoland/deno/issues/24059
2024-06-18 10:46:13 +00:00
Asher Gomez
6819c3d7f6
fix(ext/node): use Deno.FsFile.statSync() (#24234) 2024-06-17 22:40:05 +00:00
Nayeem Rahman
5dec3fd4b7
feat(lsp): multi deno.json resolver scopes (#24206) 2024-06-17 21:54:23 +01:00
Bartek Iwańczuk
78b12a43b3
fix(ext/node): better support for node:diagnostics_channel module (#24088)
Closes https://github.com/denoland/deno/issues/24060
2024-06-15 00:07:02 +02:00
Bartek Iwańczuk
184a85eaec
fix(inspector): crash on "Debugger.setBlackboxPatterns" (#24204)
Closes https://github.com/denoland/deno/issues/24196

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-14 23:52:21 +02:00
Satya Rohith
0f48313565
chore: upgrade to rust 1.79 (#24207) 2024-06-14 17:10:57 +05:30
Divy Srivastava
e19ee6eecc
fix(ext/node): server.close() does graceful shutdown (#24184) 2024-06-14 06:38:50 +05:30
Nathan Whitaker
368eb9073b
fix(napi): Read reference ownership before calling finalizer to avoid crash (#24203)
Fixes #23493.

What was happening here was that napi-rs was freeing the napi reference
([here](19e3488efc/crates/napi/src/bindgen_runtime/mod.rs (L62)))
during its finalize callback (which we call
[here](fb31eaa9ca/cli/napi/js_native_api.rs (L132))).
We then were [reading the `ownership`
field](fb31eaa9ca/cli/napi/js_native_api.rs (L136))
of that freed reference.

For some reason on arm macs the freed memory gets zeroed, so the value
of `ownership` was `0` when we read it (i.e. it was
`ReferenceOwnership::Runtime`). We then freed it again (since we thought
we owned it), causing the segfault.
2024-06-13 22:31:42 +00:00
David Sherret
4ec9250c40
fix(npm): use more relaxed package.json version constraint parsing (#24202) 2024-06-13 18:29:27 -04:00
Bartek Iwańczuk
fb31eaa9ca
chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)
This commit updates Deno to use `reqwest` at 0.12.4
and `rustls` at 0.22. Other related crates were updated
as well to match versions accepted by `reqwest` and `rustls`.

Note: we are not using the latest available `rustls` yet,
but this upgrade was non-trivial already, so a bump to
0.23 for `rustls` will be done in a separate commit.

Closes #23370

---------

Signed-off-by: Ryan Dahl <ry@tinyclouds.org>
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-13 22:41:26 +02:00
Luca Casonato
d89ff73f9c
tests: update wpt (#24198) 2024-06-13 09:48:06 -04:00
Nathan Whitaker
a7531361ef
fix(cli): Explicitly cache NPM packages during deno install (#24190)
Fixes a regression introduced in
https://github.com/denoland/deno/pull/24170, where we wouldn't actually
set up the node modules dir on `deno install` if there was an up to date
deno lockfile present.

Previously we were relying on the fact that resolving pending module
resolution called `cache_packages` (which sets up the node modules dir).
When pending resolutions were removed, and the `resolve_pending`
function with it, we also removed the `cache_packages` call needed to
set up node modules.
2024-06-12 16:06:41 -07:00