Commit graph

382 commits

Author SHA1 Message Date
Daniel Osvaldo R
0f0220e461
fix(ext/node): add fchmod and fchmodSync (#29791)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build libs (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
This PR implements `node:fs` `fchmod` and `fchmodSync`.

Towards https://github.com/denoland/deno/issues/27664 .
2025-06-18 12:48:14 +02:00
Luca Casonato
8362881c09
fix(ext/node): Module.wrap cleanup for npm:v8-code-cache (#29725)
This removes the additional arguments on the function returned by
`Module.wrap`.

Allow libraries that overwrite this behavior (like `v8-code-cache`) to
work correctly.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-06-17 02:32:10 +02:00
Yoshiya Hinosawa
413aa404f9
fix(ext/node): add key length validation in DiffieHellman.prototype.computeSecret (#29757) 2025-06-16 21:32:05 +09:00
Nathan Whitaker
9602e13d53
fix(process,node): roll our own process spawning on windows (#29609)
Fixes #16899.
Fixes https://github.com/denoland/deno/issues/23524.
Fixes https://github.com/denoland/deno/issues/23938.
Fixes https://github.com/denoland/deno/issues/27869.

Unblocks #5501.

This PR adds support for additional stdio pipes to windows, as well as
the detached option in `node:child_process`. I also ported over the
`kill` implementation for windows, which means we now can support
`kill(0)` as well as some other signals.

This means that playwright will now work on windows.

Now that we have a way to support detached processes on all platforms,
we can also easily add a `detached` option to `Deno.Command`, similar to
`child_process.spawn`.

---

The reason for moving away from `std::process::Command` is that the
standard library doesn't expose what we need to control the file
descriptor table of child processes on windows. The implementation here
is based off of parts of `std` and parts of `libuv`, and allows us to
support passing extra pipes in addition to detached processes on
windows.
2025-06-12 02:56:13 +00:00
Bartek Iwańczuk
9812163db2
test: disable _fs_watch_test.ts test case (#29701)
This test was added in https://github.com/denoland/deno/pull/29659 and
an attempt to make it more stable was done in
https://github.com/denoland/deno/pull/29699.

Unfortunately it's still very flaky. Ignoring for now.
2025-06-11 12:51:36 +00:00
Yoshiya Hinosawa
23d19d16ef
test(ext/node): reduce flakiness of _fs_watch_test.ts (#29699) 2025-06-11 16:16:20 +09:00
ctrl+d
e27447943b
fix(ext/node): fix fs.watchFile trigger (#29659)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-06-11 12:37:59 +09:00
Divy Srivastava
8b81644b59
fix(ext/node): enable Buffer pool for strings (#29592)
Part 1 towards enabling `parallel/test-buffer-pool-untransferable.js`
2025-06-05 12:04:32 +09:00
Yoshiya Hinosawa
a756a7bf8e
fix(ext/node): fix prototype of asymmetricKeyDetails of AsymmetricKeyObject (#29576) 2025-06-03 21:45:28 +09:00
Divy Srivastava
fc02cf6a1b
fix(ext/node): various node:sqlite fixes (#29404)
Some checks are pending
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-06-02 10:44:52 -07:00
Bartek Iwańczuk
02404333f1
fix(ext/node): add back perf_hooks.markResourceTiming (#29562)
Adding back a sham for "perf_hooks.markResourceTiming" that was removed
by accident in https://github.com/denoland/deno/pull/29323; a test was
added too, to ensure it doesn't regress in the future.

Closes https://github.com/denoland/deno/issues/29539
2025-06-02 17:53:38 +05:30
Yoshiya Hinosawa
01a6379505
fix(ext/node): print warnings to stderr (#29527)
Some checks are pending
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
2025-06-02 11:36:47 +09:00
Nathan Whitaker
e2e4919347
fix(zlib): don't return a smi from crc32 (#29546)
Some checks are pending
ci / lint debug macos-x86_64 (push) Blocked by required conditions
ci / lint debug windows-x86_64 (push) Blocked by required conditions
ci / test debug linux-x86_64 (push) Blocked by required conditions
ci / test release linux-x86_64 (push) Blocked by required conditions
ci / test debug macos-x86_64 (push) Blocked by required conditions
ci / test release macos-x86_64 (push) Blocked by required conditions
ci / test debug windows-x86_64 (push) Blocked by required conditions
ci / test release windows-x86_64 (push) Blocked by required conditions
ci / test release linux-aarch64 (push) Blocked by required conditions
ci / test debug macos-aarch64 (push) Blocked by required conditions
ci / test release macos-aarch64 (push) Blocked by required conditions
ci / bench release linux-x86_64 (push) Blocked by required conditions
ci / lint debug linux-x86_64 (push) Blocked by required conditions
ci / pre-build (push) Waiting to run
ci / test debug linux-aarch64 (push) Blocked by required conditions
ci / build wasm32 (push) Blocked by required conditions
ci / publish canary (push) Blocked by required conditions
Fixes https://github.com/denoland/deno/issues/29545.
2025-05-30 17:27:58 -07:00
Yoshiya Hinosawa
e56dc01cb8
fix(ext/node): add "internal/http2/util" module (#29474) 2025-05-28 21:46:36 +09:00
Yoshiya Hinosawa
3de21f1b8d
fix(ext/node): add fchown and fchownSync to node:fs (#29408)
Some checks failed
ci / pre-build (push) Has been cancelled
ci / test debug macos-x86_64 (push) Has been cancelled
ci / test release macos-x86_64 (push) Has been cancelled
ci / test debug windows-x86_64 (push) Has been cancelled
ci / test release windows-x86_64 (push) Has been cancelled
ci / test debug linux-aarch64 (push) Has been cancelled
ci / test release linux-aarch64 (push) Has been cancelled
ci / test debug macos-aarch64 (push) Has been cancelled
ci / test release macos-aarch64 (push) Has been cancelled
ci / bench release linux-x86_64 (push) Has been cancelled
ci / lint debug linux-x86_64 (push) Has been cancelled
ci / lint debug macos-x86_64 (push) Has been cancelled
ci / lint debug windows-x86_64 (push) Has been cancelled
ci / test debug linux-x86_64 (push) Has been cancelled
ci / test release linux-x86_64 (push) Has been cancelled
ci / build wasm32 (push) Has been cancelled
ci / publish canary (push) Has been cancelled
2025-05-23 15:00:39 +09:00
Divy Srivastava
ff2354be0b
fix(ext/node): Fix Database#exec should return undefined (#29368) 2025-05-19 19:20:49 -07:00
Divy Srivastava
3c6a99fce3
fix(ext/node): handle null ssl options in node:https (#29365)
Fixes https://github.com/denoland/deno/issues/29364
2025-05-19 07:55:15 +02:00
Divy Srivastava
e6c2ad1431
fix(ext/node): TLS server unref (#29279)
Fixes https://github.com/denoland/deno/issues/29230
2025-05-13 21:38:41 +05:30
Divy Srivastava
acd0c94b46
fix(ext/node): add AES CTR to supported ciphers list (#29273)
Fix https://github.com/denoland/deno/issues/29047
2025-05-13 09:45:36 +05:30
Yoshiya Hinosawa
363223aa6a
fix(ext/node): export CallTracker as named export (#29271) 2025-05-13 10:15:48 +09:00
Divy Srivastava
5044f2f355
fix(ext/node): hold weak reference to sqlite database in instances (#29210)
Deterministic close and releases file lock on Windows.

Fixes https://github.com/denoland/deno/issues/29033
2025-05-10 09:21:53 +05:30
Divy Srivastava
b14e104306
fix(ext/node): use "localhost" as default tls hostname (#29231)
Fixes https://github.com/denoland/deno/issues/29229
2025-05-10 09:21:49 +05:30
Divy Srivastava
9d0a833e7b
fix: bump default @types/node version range to 22.15.14 (#28407)
Fixes https://github.com/denoland/deno/pull/28168#discussion_r1982740706

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-05-08 17:44:22 +00:00
Marvin Hagemeister
ed55e915a2
fix(node:http): ServerResponse.req not set (#29211)
This PR sets `ServerRsposne.req` properly. See
e38ce27f3c/lib/_http_server.js (L201)

Fixes https://github.com/denoland/deno/issues/29209
2025-05-08 18:42:04 +02:00
Satya Rohith
5f139910a1
fix(ext/node): support http over unix sockets (#29182)
Closes https://github.com/denoland/deno/issues/20255

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-05-08 22:07:28 +05:30
Divy Srivastava
5b037f1bed
fix(ext/node): getColorDepth for writable stdio streams (#29176)
Fixes https://github.com/denoland/deno/issues/28605
Fixes https://github.com/denoland/deno/issues/29175

` ../deno/target/debug/deno run -A npm:create-vue@latest DIR` works now
2025-05-06 21:42:14 +05:30
nana4gonta
730f48b170
fix(ext/node): Support mTLS connections node compatibility (#28937)
Support for running Node.js code that requires mTLS connections on Deno.

Ref #21497 

Closes https://github.com/denoland/deno/issues/26472
Closes https://github.com/denoland/deno/issues/29148

---------

Co-authored-by: Satya Rohith <me@satyarohith.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-05-06 14:25:18 +05:30
Divy Srivastava
2edc70e679
fix(ext/node): Fix dns.lookup when promisified with options.all (#29167)
Fixes https://github.com/denoland/deno/issues/29074

Co-authored-by: Satya Rohith <me@satyarohith.com>
2025-05-06 09:16:00 +05:30
Nathan Whitaker
05574665b2
fix(ext/node): work correctly with wrapper Response objects, use correct rawHeaders structure (#29056)
Fixes https://github.com/denoland/deno/issues/28022

Basically drizzle-kit studio uses hono with the node-server adapter.
That creates wrapper objects for responses that forward property getters
to the underlying response (the one we provided). However, in deno.serve
we were assuming that the response was actually the same response we
initially gave and crashed when it wasn't. instead, just call the
property getters if we can't find the inner response.

The raw headers bug is that we were exposing the `rawHeaders` field on
`Incoming` as a `Headers` object, instead it's supposed to be a flat
array of the header keys + values. I.e. `["Content-Type:",
"application/json", "Host:", "http://localhost"]`
2025-04-30 00:14:29 +00:00
siaeyy
1a171f10df
fix(ext/node): handle "ttl" option in "dns" module (#27676)
Closes #27669

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-29 22:49:10 +00:00
Divy Srivastava
e0813f2255
fix(ext/node): throw NotCapable on process.env accessor (#28280)
Fixes https://github.com/denoland/deno/issues/28125

Additionally "FORCE_COLOR" env var can now be accessed 
without `--allow-env` check.
---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-28 14:28:01 +00:00
Yoshiya Hinosawa
84b192ee5d
fix(ext/node): fix deepStrictEqual(-0, 0) (#29060) 2025-04-27 22:19:36 +09:00
ctrl+d
cf02f770aa
fix(ext/node): fix handling of abort signal in readFile (#29028)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-25 14:48:12 +09:00
Jim Buzbee
1feb2b6421
fix(ext/node): honor flags with respect to reuseAddress when binding to a UDP socket (#28156)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-22 17:49:14 +09:00
Divy Srivastava
5867988bae
fix(ext/node): Fix Writable.toWeb() (#28914)
Fixes https://github.com/denoland/deno/issues/28905
2025-04-15 20:10:48 +02:00
Divy Srivastava
01b6da9d9b
fix(ext/node): upgrade node:stream (#28855)
Ref https://github.com/denoland/deno/issues/28836

This PR replaces the _stream.mjs bundle with a file-by-file port instead. A codemod transpiles Node.js internals to ESM. The codemod performs three tasks: translating CJS to ESM, remapping internal dependencies, and hoisting lazy requires as imports.

The process is fully automated through the `update_node_stream.ts` script, simplifying future internal updates. The script checks out Node.js from a specific tag defined in the `tests/node_compat/runner`.

Additionally, the update enables new tests in our Node test runner and adds features (like compose()) that were missing from the outdated bundle.

## Performance

There is a 140KB+ binary size increase on aarch64-apple-darwin and nop startup time stays the same.
2025-04-14 21:35:34 +05:30
Divy Srivastava
0d72316fbf
fix(ext/node): implement finished() for web streams (#28600)
Fixes https://github.com/denoland/deno/issues/28590
2025-04-10 17:23:50 +05:30
Divy Srivastava
b26c30d938
fix(ext/node): return Buffer from crypto cipher APIs (#28826)
Fixes https://github.com/denoland/deno/issues/28633
2025-04-10 08:01:30 +00:00
Arsh
447b5038c0
fix(ext/node): alias shake-128 and shake-256 hash algorithms (#28451)
Fixes #28442

---------

Signed-off-by: Arsh <69170106+lilnasy@users.noreply.github.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-04-10 07:58:44 +00:00
Yoshiya Hinosawa
cb00561e97
fix(ext/node): support input option in spawnSync (#28792) 2025-04-09 13:42:12 +09:00
Sebastien Guillemot
e2341c7949
fix(ext/node): add createReadStream & createWriteStream methods to the FileHandle class (#28700)
Co-authored-by: Nikolay Karadzhov <nkaradzhov89@gmail.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-07 17:13:32 +09:00
Yoshiya Hinosawa
f2d73abdd7
fix(ext/node): better dns.lookup compatibility (#27936) 2025-04-02 11:38:07 +09:00
Divy Srivastava
5bc4266101
fix(ext/node): sqlite handle empty blob being NULL (#28674)
Fixes https://github.com/denoland/deno/issues/28672
2025-04-01 13:50:26 +00:00
Jake Champion
0f40ee7ff4
fix(ext/node): support the optional previousValue parameter for process.cpuUsage() (#28550) 2025-04-01 20:48:09 +09:00
Yoshiya Hinosawa
6c2f7835c0
fix(ext/node): emit 'close' event on ServerResponse object when client aborted the request (#28601) 2025-03-27 10:45:04 +09:00
Divy Srivastava
52d528d21d
fix(ext/node): mkdir() parse file mode (#28609)
Fixes https://github.com/denoland/deno/issues/28604
2025-03-25 09:33:41 +05:30
Yoshiya Hinosawa
d07b7ea6f6
fix(ext/node): propagate 'close' event of IncomingMessage to Socket (#28582) 2025-03-24 10:56:34 +09:00
Divy Srivastava
fb3df15fc8
fix(ext/node): restrict ATTACH DATABASE statement (#28513)
Disable `ATTACH DATABASE` statement in `node:sqlite` since it is not
supervised by Deno's permission system
2025-03-18 22:03:35 +05:30
Divy Srivastava
c638f9ade1
fix(ext/node): reset statement immidiately in run() (#28506)
Fixes https://github.com/denoland/deno/issues/28492
2025-03-15 20:14:24 +05:30
Divy Srivastava
e66ef32a8f
fix(ext/node): SQLite reset guards to prevent database locks (#28298)
Fixes https://github.com/denoland/deno/issues/28295
2025-02-25 19:27:55 +05:30