1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-18 13:22:55 -05:00
Commit graph

12903 commits

Author SHA1 Message Date
Yoshiya Hinosawa
07737b03bc
fix(ext/node): accept file descriptor in fs.readFile(Sync) (#27252)
closes #27123
2024-12-06 20:18:08 +09:00
Yoshiya Hinosawa
1ee13a3544
chore: add script to check remaining node compat cases (#27122) 2024-12-06 15:22:33 +09:00
denobot
2e2d3173d1
chore: forward v2.1.3 release commit to main (#27248)
This is the release commit being forwarded back to main for 2.1.3

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-12-06 02:12:57 +01:00
Nathan Whitaker
ffac282805
fix(install): use locked version of jsr package when fetching exports (#27237)
Fixes #27193.
2024-12-05 18:55:35 +00:00
Marvin Hagemeister
f098dd02f7
fix(task): --recursive option not working (#27183)
We didn't handle the `--recursive` option properly in `deno task`. This
PR addresses that.

Fixes https://github.com/denoland/deno/issues/27174
2024-12-05 19:00:35 +01:00
Bartek Iwańczuk
ab4568a03d
fix: clear dep analysis when module loading is done (#27204)
Closes https://github.com/denoland/deno/issues/26663
2024-12-05 15:48:50 +00:00
Yoshiya Hinosawa
3bae68eda6
test(ext/node): fix flaky node/http2.createServer() test (#27208) 2024-12-06 00:25:16 +09:00
Luca Casonato
ae5c743f33
chore: update hickory dns crates (#27137) 2024-12-05 14:11:35 +00:00
ud2
25aed5071f
fix(unstable/temporal): respect locale in Duration.prototype.toLocaleString (#27000)
Adds a temporary polyfill for `Duration.prototype.toLocaleString()`
that will be removed once native support in V8 lands.
2024-12-05 13:55:50 +00:00
Marvin Hagemeister
e8d731c05f
fix(node/worker_threads): data url not encoded properly with eval (#27184)
When using the `eval` option on Node's `worker_threads` the code is
passed as a `data:` URL. But we didn't encode the actual code for that,
which lead to syntax errors when including characters not allowed in an
URL.

Fixes a part of https://github.com/denoland/deno/issues/27167
2024-12-05 14:30:43 +01:00
David Sherret
a26b873a7d
refactor: remove usages of deno_core::resolve_import for resolving redirects (#27234)
This was doing an allocation for reparsing the specifier. Might as well
do `.join` here and it means I can extract out this file fetcher code to
deno_cache_dir more easily.
2024-12-04 17:39:58 -05:00
Nathan Whitaker
e718e3f471
fix(outdated): allow --latest without --update (#27227)
Ref #27025.

it does nothing (it's the default behavior) but it doesn't hurt to allow
it
2024-12-04 18:32:48 +00:00
David Sherret
f0586238fc
fix(task): kill descendants when killing task process on Windows (#27163) 2024-12-04 12:19:06 -05:00
David Sherret
f863a623c9
fix: improve auto-imports for npm packages (#27224)
Improves auto-imports when using `"nodeModulesDir": "auto"`
2024-12-04 12:05:34 -05:00
snek
5c17bb4287
fix(unstable): otel context with multiple keys (#27230)
`SafeMap` treats its argument as an object with a "length" and index
properties, rather than a generic iterator, so every time we cloned it,
it was dropping all the data.
2024-12-04 13:14:37 +00:00
Marvin Hagemeister
120b3811eb
fix(task): don't panic with filter on missing task argument (#27180)
We were panicing when running `deno task --filter foo` without a task
argument.

Fixes https://github.com/denoland/deno/issues/27177
2024-12-04 13:06:09 +01:00
Yoshiya Hinosawa
fb24fd37c9
test: add node compat test cases (#27134)
This PR enables node compat test cases found passing by using the tool
added in #27122

The percentage of passing test case increases from 16.16% to 30.43% by
this change.
2024-12-04 11:37:20 +09:00
Yoshiya Hinosawa
32b4c37c05
test(ext/node): reduce race condition in test case (#27207) 2024-12-04 11:29:31 +09:00
David Sherret
8cd257de3d
refactor: remove CliNpmRegistryApi (#27222)
Extracts more code out of the CLI.
2024-12-03 19:44:56 -05:00
Marvin Hagemeister
d5b63bb642
fix(task): only pass args to root task (#27213)
When we run `deno task` with args like `deno task foo arg` the argument
should only be passed to the root task, not to its dependencies.

Fixes https://github.com/denoland/deno/issues/27206
2024-12-03 16:35:46 +01:00
Marvin Hagemeister
2fbc5fea83
fix(node/fs): support recursive option in readdir (#27179)
We didn't support the `recursive` option of
`fs.readdir()/fs.readdirSync()`.

Fixes https://github.com/denoland/deno/issues/27175
2024-12-03 10:28:20 +01:00
Ian Bull
b78c851a94
refactor(ext/web): align error messages (#25871)
Aligns the error messages in the ext/web folder to be in-line with the
Deno style guide.
2024-12-03 03:30:39 +00:00
David Sherret
c1dcf1b618
refactor: add deno_npm_cache crate (#27200)
Extracting out more code from the CLI for reuse elsewhere (still more
work to do, but this is a start).

This is the code for extracting npm tarballs and saving information in
the npm cache in the global deno_dir.
2024-12-03 02:10:16 +00:00
David Sherret
70d69a8828
chore: fix cjs_with_deps test to use a temp dir (#27199)
It was creating a node_modules directory.
2024-12-03 02:37:40 +01:00
Bartek Iwańczuk
53936eda11
fix(fmt): stable formatting of HTML files with JS (#27164)
Closes https://github.com/denoland/deno/issues/26407
Closes https://github.com/denoland/deno/issues/26763
Closes https://github.com/denoland/deno/issues/26560
Closes https://github.com/denoland/deno/issues/26744
Closes https://github.com/denoland/deno/issues/27030
2024-12-03 02:04:55 +01:00
Bartek Iwańczuk
76571fd5a5
chore: upgrade deno_lint to 0.68.2 (#27197) 2024-12-02 21:53:00 +00:00
snek
7c036772df
feat(unstable): add metrics to otel (#27143)
Refs: https://github.com/denoland/deno/issues/26852

Initial support for exporting metrics.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-12-02 20:45:41 +01:00
David Sherret
6dd2d5e49e
refactor: upgrade to deno_npm 0.26 (#27194) 2024-12-02 16:00:31 +00:00
Mathias Lykkegaard Lorenzen
f9a6cc3f03
chore: export variables from node compat tools script (#27189) 2024-12-03 00:05:59 +09:00
Bartek Iwańczuk
1d49b3cb0f
fix: support workspace:^ and workspace:~ version constraints (#27096)
This commit adds support for understanding "workpace:^"
and "workspace:~" version constraints in npm/pnpm workspaces.

This is done by upgrading various crates to their latest versions.

Closes https://github.com/denoland/deno/issues/26726

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-30 00:54:26 +01:00
David Sherret
f6248601f4
fix(task): forward signals to spawned sub-processes on unix (#27141)
Closes https://github.com/denoland/deno/issues/18445
2024-11-29 17:36:43 -05:00
Ian Bull
8626ec7c25
refactor(ext/fs): align error messages (#25414)
Aligns the error messages in the ext/fs folder to be in-line with the
Deno style guide.
2024-11-28 18:47:07 +00:00
Marvin Hagemeister
3553aa9132
fix(publish): error on missing name field (#27131)
This PR improves the error output on publish when the `name` filed is
missing:

```json
{
  "exports": "./mod.ts",
  "version": "0.0.1"
}
```

Before:

```sh
deno publish --dry-run
error: You did not specify an entrypoint in file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json. Add `exports` mapping in the configuration file, eg:
{
  "name": "@scope/name",
  "version": "0.0.0",
  "exports": "<path_to_entrypoint>"
}
```

After:

```sh
deno publish --dry-run
error: Missing 'name' field in 'file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json'.
```

Fixes https://github.com/denoland/deno/issues/27116
2024-11-28 18:11:36 +01:00
denobot
12aea2014a
chore: forward v2.1.2 release commit to main (#27136)
This is the release commit being forwarded back to main for 2.1.2

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-28 17:00:24 +00:00
Marvin Hagemeister
39722f190a
fix(node/timers): error when passing id to clearTimeout/clearInterval (#27130)
As pointed out in https://github.com/denoland/deno/issues/27126 we used
a variable which could potentially be of type `number` instead of the
`Timeout` class instance. Ensure that we're always setting `_destroyed`
on the class instead instead.

Fixes https://github.com/denoland/deno/issues/27126
2024-11-28 15:11:51 +01:00
Marvin Hagemeister
026bbc4a9e
fix(init): support scoped npm packages (#27128)
The naming scheme for create npm packages varies depending on whether
they are scoped or not. We only supported unscoped packages prior to
this PR. This PR adds support for all the following cases which npm
supports:

- `foo` -> `create-foo`
- `@foo/bar` -> `@foo/create-bar`
- `@foo` -> `@foo/create`
- `@foo@2.0.0` -> `@foo/create@2.0.0`
- `@foo/bar@2.0.0` -> `@foo/create-bar@2.0.0`

See https://docs.npmjs.com/cli/v8/commands/npm-init#description

Fixes https://github.com/denoland/deno/issues/27127
2024-11-28 15:07:32 +01:00
Luca Casonato
32e260d55a
fix: support bun specifiers in JSR publish (#24588)
Fixes https://github.com/denoland/deno/issues/26989

---------

Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-11-28 14:51:24 +01:00
Divy Srivastava
1af2d2474e
fix(ext/node): tls.connect socket upgrades (#27125)
Fixes https://github.com/denoland/deno/issues/27087
Fixes https://github.com/denoland/deno/issues/26685
Fixes https://github.com/denoland/deno/issues/26660
2024-11-28 17:59:20 +05:30
David Sherret
f161adf19e
perf(compile): read embedded files as static references when UTF-8 and reading as strings (#27033) 2024-11-27 21:28:41 -05:00
Nathan Whitaker
76daa03aa9
fix(info): resolve bare specifier pointing to workspace member (#27020)
Fixes https://github.com/denoland/deno/issues/26721

Previously, we were applying only the import map, which would result in
`@scope/foo` expanding to (e.g.) `jsr:@scope/foo@1.0.0`. Since that
didn't exist it would error and fail to resolve.
2024-11-27 13:54:26 -08:00
Leo Kettmeir
16e16690af
fix(ext/webgpu): use correct variable name (#27108) 2024-11-27 18:31:15 +00:00
David Sherret
6fb0e10252
chore: fix lint step due to node compat test changes (#27111)
Seems due to merging this:
https://github.com/denoland/deno/actions/runs/12052779514/job/33606893423
2024-11-27 17:20:20 +00:00
Marvin Hagemeister
9bc36aa79b
fix(node/http): casing ignored in ServerResponse.hasHeader() (#27105)
We didn't respect casing when checking if a HTTP header is present in
Node's `ServerResponse.hasHeader()`. This lead to us returning incorrect
results when the header was present. Koa assumed that the `Content-Type`
header wasn't present when it actually was and defaulted to a different
`Content-Type` value.

Fixes https://github.com/denoland/deno/issues/27101
2024-11-27 17:56:13 +01:00
Bartek Iwańczuk
93adf37bdf
fix(task): strip ansi codes and control chars when printing tasks (#27100) 2024-11-27 15:54:15 +00:00
Yoshiya Hinosawa
e943c6a25d
test(ext/node): enable parallel/test-fs-promises-file-handle-stat.js (#27074) 2024-11-27 23:51:23 +09:00
David Sherret
2bbfef137c
feat(unstable): repurpose --unstable-detect-cjs to attempt loading more modules as cjs (#27094)
This resurrects the `--unstable-detect-cjs` flag (which became stable),
and repurposes it to attempt loading .js/.jsx/.ts/.tsx files as CJS in
the following additional scenarios:

1. There is no package.json
1. There is a package.json without a "type" field

Also cleans up the implementation of this in the LSP a lot by hanging
`resolution_mode()` off `Document` (didn't think about doing that until
now).
2024-11-27 09:50:38 -05:00
Divy Srivastava
1e51b650be
perf(ext/webstorage): use object wrap for Storage (#26931)
![image](https://github.com/user-attachments/assets/3f86e2fd-9026-4965-8f3b-512423362f1e)


Depends on:
- https://github.com/denoland/deno_core/pull/970
- https://github.com/denoland/deno_core/pull/976
- https://github.com/denoland/deno_core/pull/980
- https://github.com/denoland/deno_core/pull/981

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-27 16:11:57 +05:30
Leo Kettmeir
7400181ecb
fix(tools/doc): HTML resolve main entrypoint from config file (#27103)
Fixes #26901
2024-11-27 02:15:15 -08:00
Marvin Hagemeister
927352bd4e
fix(node/fs): add missing stat path argument validation (#27086)
We didn't validate the `path` argument that's passed to `fs.stat()` and
`fs.statSync()` which lead to wrong errors being thrown. The
`@rollup/plugin-node-resolve` code calls it with `undefined` quite a lot
which lead to `nitro` and `nuxt` failing.

Fixes https://github.com/denoland/deno/issues/26700

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-11-27 08:35:39 +01:00
Leo Kettmeir
42b71d82db
chore(lint): add .out file reference checker (#27078)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-26 20:53:20 -08:00