Commit graph

13475 commits

Author SHA1 Message Date
Yoshiya Hinosawa
83f15ece09
feat(test): create coverage reports when --coverage specified in deno test (#28260)
This PR updates the behavior of `deno test --coverage` option. Now if
`--coverage` option is specified, `deno test` command automatically
shows summary report in the terminal, and generates the lcov report in
`$coverage_dir/lcov.info` and html report in `$coverage_dir/html/`

This change also adds `--coverage-raw-data-only` flag, which prevents
the above reports generated, instead only generates the raw json
coverage data (which is the same as current behavior)
2025-04-18 18:56:14 +09:00
Nayeem Rahman
0bb16651c0
chore(lsp): fix semantic cache cleanup exemptions (#28951) 2025-04-18 01:17:00 +00:00
Nathan Whitaker
4f7117a081
perf(npm): don't try to cache npm packages we've already cached (#28938)
With `nodeModulesDir: auto` (and `none`, to a lesser extent), we
frequently repeatedly try to cache npm packages during resolution. On a
(private) fresh project, I counted that `sync_resolution_with_fs` was
called 478 times over the course of a fresh build. This reduces the
number of calls to 8, and doing so speeds things up substantially.

```
❯ hyperfine --warmup 2 -N "deno task build" "../deno/target/release-lite/deno task build"
Benchmark 1: deno task build
  Time (mean ± σ):      3.652 s ±  0.042 s    [User: 3.285 s, System: 2.399 s]
  Range (min … max):    3.587 s …  3.712 s    10 runs

Benchmark 2: ../deno/target/release-lite/deno task build
  Time (mean ± σ):      1.356 s ±  0.007 s    [User: 1.961 s, System: 1.108 s]
  Range (min … max):    1.345 s …  1.372 s    10 runs

Summary
  ../deno/target/release-lite/deno task build ran
    2.69 ± 0.03 times faster than deno task build
```
2025-04-17 21:10:51 +00:00
Nathan Whitaker
f411ccd692
feat(lockfile): default to lockfile v5 (#28950)
Closes #28916
2025-04-17 13:27:37 -07:00
David Sherret
16d305449d
feat(compile): support for ffi and node native addons (#28934)
This extracts out the shared libraries and `.node` native modules to a
temp file and opens them from there. **This means that this
implementation will not work in every scenario.** For example, a library
could require other files that only exist in the in-memory file system.
To solve that, we'll introduce
https://github.com/denoland/deno/issues/28918 later or adapt this
solution to solve more issues.

Additionally, this will not work when run on readonly file systems.
2025-04-17 16:01:12 -04:00
Nayeem Rahman
0cb2ec22a4
feat(lsp): jupyter cell continuity using classic scripts (#28769) 2025-04-17 19:39:32 +01:00
Asher Gomez
24debe9546
docs: contributing guidelines (#28945)
Consolidates https://docs.deno.com/runtime/contributing/ and
https://docs.deno.com/runtime/contributing/building_from_source/ into a
single contributing guidelines document. Having this document within the
codebase should hopefully increase its visibility and chances of being
kept up-to-date.

Towards https://github.com/denoland/docs/issues/1601
2025-04-17 12:17:24 -04:00
Luca Casonato
c12709196c
fix: support vsock in DENO_SERVE_ADDRESS (#28941) 2025-04-17 13:49:47 +02:00
Yoshiya Hinosawa
560e8cf0e3
docs(test): document DENO_COVERAGE_DIR in help message (#28939) 2025-04-17 14:33:51 +09:00
Yoshiya Hinosawa
016b02d374
fix(ext/node): add assert property to test context object (#28904) 2025-04-17 14:32:48 +09:00
Asher Gomez
e12d9b4946
docs: move WPT guide to tests/wpt (#28695)
Part of https://github.com/denoland/docs/issues/1602

An argument could be made that this documentation should instead be
under a WPT section within `tests/README.md`.

Closes #27081
2025-04-16 21:54:28 -04:00
Manish Sahani
252ea8e289
fix: remove unnecessary whitespace in prompt function (#28868) 2025-04-16 17:49:06 +00:00
Dan Dascalescu
bfbf9018f4
fix(task): document source of tasks, fix punctuation (#28413)
Signed-off-by: Dan Dascalescu <ddascalescu+github@gmail.com>
2025-04-16 17:29:31 +00:00
Leo Kettmeir
066a205d5f
feat(unstable/webgpu): add deviceStartCapture and deviceStopCapture (#28192)
This is achieved by adding a new `Deno.webgpu` namespace which will be
used for non-spec functionality, which for now will be marked as
unstable
2025-04-16 17:26:28 +00:00
Ryan Dahl
1820fee427
docs: fix DENO_TLS_CA_STORE help text (#28124) 2025-04-16 17:18:01 +00:00
Yoshiya Hinosawa
202f5f3910
feat(test): support DENO_COVERAGE_DIR env var (#28291)
This PR adds support of `DENO_COVERAGE_DIR` for controlling coverage
output.
2025-04-16 12:47:28 -04:00
Marvin Hagemeister
a5b407c390
chore: make node test-process-cpuUsage pass (#28912)
We used a different error message by referring to the first parameter as
`previousValue` instead of `prevValue`. Node uses `prevValue` in the
error message.
2025-04-16 08:28:18 +02:00
MujahedSafaa
302a5dd12a
fix: resolve shebang parse error in deno doc --test (#26079)
The bug has been fixed by updating the regex to ensure that the shebang
characters (#!) are no longer excluded. This allows the shebang to be
retained and parsed correctly.

---------

Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2025-04-16 00:56:04 -04:00
Bartek Iwańczuk
27651d3c77
refactor(ext/node): use Promise.withResolvers (#28917) 2025-04-15 17:33:53 -04:00
Gowtham K
9b2c02fc29
fix(install/global): do not append bin to DENO_INSTALL_ROOT when ends with bin (#26446)
This PR fixes the issue where the PathBuf appends /bin even if bin dir
already exists referenced in this issue
2025-04-15 21:31:28 +00:00
David Sherret
3071aa2759
feat(compile): ability to exclude embedded files (#28805)
For now, just simple path excluding (no glob support).

```
> deno compile --include folder --exclude folder/sub_folder main.ts
```
2025-04-15 19:10:37 +00:00
Yoshiya Hinosawa
e0fc1e19ad
feat(cli): deno check maps to deno check . (#28655)
Now `deno check` without arguments maps to `deno check .`
2025-04-15 14:50:33 -04: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
David Sherret
a5d39b085d
feat(fmt/lint): add --permit-no-files (#28753)
Closes https://github.com/denoland/deno/issues/28728
2025-04-15 17:57:34 +00:00
Ben Heidemann
f465961964
feat(coverage): add coverage ignore comments (#26590) 2025-04-15 17:56:55 +00:00
David Sherret
ef431b2336
feat(runtime): add Deno.build.standalone for telling if running in self-contained executable (#28750) 2025-04-15 17:44:28 +00:00
David Sherret
6a3db6ce47
fix: better cjs vs esm module detection and upgrade swc (#28810)
Upgrades swc.

* https://github.com/swc-project/swc/issues/10109
* https://github.com/denoland/deno_ast/pull/299
* https://github.com/denoland/deno_ast/pull/294
* https://github.com/denoland/deno_ast/pull/300
*
c8291e6926

Closes #28316
Closes https://github.com/denoland/deno/issues/28440
2025-04-15 17:21:29 +00:00
David Sherret
c539e20f9f
fix(npm): panic when using tag with patched package (#28900) 2025-04-15 00:08:47 -04:00
Yoshiya Hinosawa
8908ec31bf
chore: use 'deno test' command when 'node:test' is imported in run_node_test script (#28885) 2025-04-15 09:54:25 +09:00
Nathan Whitaker
951137a445
chore: don't shallow clone in publish job (#28899)
This should make the "forward release commit" CI job actually work. The
issue was that actions/checkout by default does a shallow clone
(fetch-deptg == 1), so then when we tried to cherry-pick it would fail
due to missing the history. That's why the cherry-pick would work fine
locally, but fail every time in CI
2025-04-14 23:52:40 +00:00
denobot
2e826dfc9d
chore: forward v2.2.10 release commit to main (#28897)
This is the release commit being forwarded back to main for 2.2.10

Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com>
Co-authored-by: Nathan Whitaker <nathan@deno.com>
2025-04-14 16:10:16 -07:00
Nathan Whitaker
914549292e
fix(install): read extra package info from node_modules and fallback to registry (#28893)
Fixes #28891

We were checking if the node_modules entry for the package was present,
but then reading from the global cache.

Instead, read from the package.json in node_modules. As a fallback(which
in theory should only really happen if the node_modules dir is somehow
messed up), take the more expensive (but likely to work) path of reading
from the registry.json.
2025-04-14 19:32:27 +00: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
Yoshiya Hinosawa
6e49a4b3bd
docs: fix stability note of isTerminal and setRaw (#28886) 2025-04-15 00:00:31 +09:00
Ryan Dahl
9c201aee7d
feat(serve): env var DENO_SERVE_ADDRESS for configuring default listen address (#28877) 2025-04-14 12:15:26 +00:00
Divy Srivastava
cc8b5217f3
fix(ext/node): querystring fallback to default decoder (#28838)
Enables the full `tests/node_compat/test/parallel/test-querystring.js`
test
2025-04-14 15:17:28 +05:30
Yoshiya Hinosawa
3a6cdc2516
chore(ext/node): fix run_all_test script for windows (#28883) 2025-04-14 15:46:26 +09:00
Yoshiya Hinosawa
1dfd444901
fix(ext/node): add basic support of suite/describe in node:test (#28847) 2025-04-14 15:44:03 +09:00
Yoshiya Hinosawa
372705a4d7
fix(ext/node): export test as property of default export (#28881) 2025-04-14 14:19:22 +09:00
Yoshiya Hinosawa
09fe6f8257
test(ext/node): skip running test-http-agent-maxtotalsockets.js on darwin (#28817) 2025-04-14 11:46:06 +09:00
ryu
8309ecdfc2
fix(fmt): upgrade malva to 0.11.2 (#28871) 2025-04-13 10:03:36 -07:00
David Sherret
e04224c64c
chore: update Releases.md with lts versions (#28866) 2025-04-12 10:42:59 -07:00
Nayeem Rahman
98b7554aaf
chore: forward v2.2.9 release commit to main (#28859) 2025-04-11 22:45:54 +00:00
snek
e73ed03373
fix: vsock nits (#28851) 2025-04-11 12:11:03 -07:00
David Sherret
5b25eeda57
fix(task): support backticks and basic tilde expansion (#28832)
* https://github.com/denoland/deno_task_shell/pull/147
* https://github.com/denoland/deno_task_shell/pull/146

Closes https://github.com/denoland/deno/issues/26676
Closes https://github.com/denoland/deno/issues/28807
2025-04-11 15:48:14 +00:00
Divy Srivastava
d74a6943a5
fix(ext/node): verbose zlib error messages (#28831) 2025-04-11 17:17:32 +05:30
snek
9da231dc7a
feat: support linux vsock (#28725)
impl support for vsock
https://man7.org/linux/man-pages/man7/vsock.7.html
2025-04-11 07:35:05 +02:00
Nathan Whitaker
7218113d24
fix(lockfile): handling of peer deps when migrating to lockfile v5 (#28844) 2025-04-10 22:29:44 +00:00
Nathan Whitaker
4dbe803e2b
fix(lockfile): omit tarball url from lockfile if it's the default (#28842)
This is where deno_lockfile gets the info for the transform from 4->5.
So while we were doing this optimization on new v5 lockfiles, we weren't
doing it correctly for ones migrated from earlier versions.

Testing this is kinda hard because our tests don't use the default
registry, hmm
2025-04-10 14:45:46 -07:00
Nayeem Rahman
95eb216801
fix(lsp): exclude unmapped npm cache paths from auto-imports (#28841) 2025-04-10 19:13:34 +00:00