1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-22 15:10:44 -05:00
Commit graph

12926 commits

Author SHA1 Message Date
Divy Srivastava
f00965456f fix(ext/node): convert brotli chunks with proper byte offset (#27455)
Fixes https://github.com/denoland/deno/issues/27029
Fixes https://github.com/denoland/deno/issues/26086
2025-01-09 15:19:14 -05:00
Marvin Hagemeister
3b02d9b603 fix(unstable): don't error on non-existing attrs or type attr (#27456)
When running selectors for JS linting plugins we would error when
encountering an unknown attribute name:

```js
// selector
Foo[non-existant]

// error
Error: Missing string id: <number>
```

This was caused by using `0` as the invalid marker, but also overloading
`0` with an actual node type. So the fix is to reserve `0` as the
invalid marker and move the property type to the next index.
2025-01-09 15:19:14 -05:00
Yoshiya Hinosawa
13c240c41d fix(ext/node): add support of any length IV for aes-(128|256)-gcm ciphers (#27476) 2025-01-09 15:19:14 -05:00
Divy Srivastava
9302840e6c fix(ext/node): RangeError timingSafeEqual with different byteLength (#27470)
Fixes https://github.com/denoland/deno/issues/27214
2025-01-09 15:19:13 -05:00
Luca Casonato
7ad45db55f feat(unstable): add OTEL MeterProvider (#27240)
This commit replaces `Deno.telemetry.MetricsExporter` with
`Deno.telemetry.MeterProvider`.

Signed-off-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: snek <snek@deno.com>
2025-01-09 15:19:13 -05:00
Yoshiya Hinosawa
1aefb16fd4 fix(ext/node): make getCiphers return supported ciphers (#27466)
Currently we only supports 7 ciphers (`aes-(128|192|256)-ecb` and
`aes-(128|256)-(cbc|gcm)`) in `node:crypto`, but `crypto.getCiphers`
returns other supported cipher names. That confuses `npm:openpgp`
package and causes https://github.com/denoland/deno/issues/26875.

This PR makes `getCiphers` return actually supported cipher names.

With this change, the example given in #26875 can create private and
public key files.

closes #26875
2025-01-09 15:19:13 -05:00
Nathan Whitaker
90c8d27dc3 fix: incorrect memory info free/available bytes on mac (#27460)
Fixes https://github.com/denoland/deno/issues/27435

For some reason this was dividing by 1024 (as if the unit was KB, and we
wanted bytes) but the page size is already in bytes.
2025-01-09 15:19:13 -05:00
Marvin Hagemeister
9bea68b51a feat(unstable): support selectors in JS lint plugins (#27452)
This PR adds support for using selectors in the JS linting plugin API.
Supported at the moment are:

- `Foo Bar` (descendant)
- `Foo > Bar` (child combinator)
- `Foo + Foo` (next sibling)
- `Foo ~ Foo` (subsequent sibling)
- `[attr]`, `[attr=value]` (attribute selectors, supported operators:
`=`, `!=`, `<`, `>`, `<=`, `>=`)
- `:first-child`
- `:last-child`
- `:nth-child(2)`, `:nth-child(2n + 1)`
2025-01-09 15:19:13 -05:00
Yoshiya Hinosawa
0eb7f11a84 fix(ext/fetch): better error message when body resource is unavailable (#27429)
fixes #27132

When the body resource is unavailable when start reading it, the error
message is `Bad Resource ID` and that doesn't tell what's wrong very
well.

This PR changes that error message to `Cannot read body as underlying
resource unavailable`
2025-01-09 15:19:13 -05:00
Yoshiya Hinosawa
5c4dd747e0 fix(ext/fs): do not throw for bigint ctime/mtime/atime (#27453) 2025-01-09 15:19:13 -05:00
David Sherret
78827c77f9 fix(node): handle cjs exports with escaped chars (#27438)
Closes https://github.com/denoland/deno/issues/27422
2025-01-09 15:19:12 -05:00
Marvin Hagemeister
ae83bdf86f feat(unstable): add JS linting plugin infrastructure (#27416)
This PR extracts the core part of
https://github.com/denoland/deno/pull/27203 to make it easier to review
and land in parts.

It contains:
-  The JS plugin code the deserializes and walks the buffer
- The Rust portion to serialize SWC to the buffer format (a bunch of
nodes are still todos, but imo these can land anytime later)
- Basic lint plugin types, without the AST node types to make this PR
easier to review
- Added more code comments to explain the format etc.


More fixes and changes will be done in follow-up PRs.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-09 15:19:12 -05:00
David Sherret
131a4ea816 perf: remove now needless canonicalization getting closest package.json (#27437)
This is no longer required because we now store everything in the file
system for deno compile instead of in an eszip.
2025-01-09 15:19:12 -05:00
David Sherret
e417475a0c perf: upgrade to deno_semver 0.7 (#27426) 2025-01-09 15:19:12 -05:00
Bartek Iwańczuk
bd1437d5ec perf: don't store duplicate info for ops in the snapshot (#27430)
Mostly for changes from https://github.com/denoland/deno_core/pull/1010

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2025-01-09 15:19:12 -05:00
snek
39e319e33f feat(unstable): Implement QUIC (#21942)
Implements a QUIC interface, loosely based on the WebTransport API (a
future change could add the WebTransport API, built on top of this one).

[quinn](https://docs.rs/quinn/latest/quinn/) is used for the underlying
QUIC implementation, for a few reasons:
- A cloneable "handle" api which fits quite nicely into deno resources.
- Good collaboration with the rust ecosystem, especially rustls.
- I like it.

<!--
Before submitting a PR, please read https://deno.com/manual/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.
-->
2025-01-09 15:19:12 -05:00
Filip Stevanovic
17878e79fd fix(ext/node): add truncate method to the FileHandle class (#27389) 2025-01-09 15:19:12 -05:00
Nayeem Rahman
cffee2c719 fix(lsp): rewrite imports for 'Move to a new file' action (#27427) 2025-01-09 15:19:11 -05:00
David Sherret
e73627958d fix(publish): infer literal types in const contexts (#27425)
* https://github.com/denoland/deno_graph/pull/555
2025-01-09 15:19:11 -05:00
Marvin Hagemeister
f0f605ce7b fix(task): support tasks without commands (#27191)
Support running tasks that have no command and only dependencies. This
is useful for when you want to group tasks only.
2025-01-09 15:19:11 -05:00
David Sherret
f003040df5 fix(compile): be more deterministic when compiling the same code in different directories (#27395)
Additionaly, this no longer unnecessarily stores the source twice for
file specifiers and fixes some sourcemap issues.

Closes https://github.com/denoland/deno/issues/27284
2025-01-09 15:19:11 -05:00
Yoshiya Hinosawa
cc8e339c25 fix(ext/node): do not exit worker thread when there is pending async op (#27378)
This change fixes the premature exit of worker threads when there are still
remaining pending ops.

This change reuses the idea of #22647 (unref'ing `op_worker_recv_message` in
worker threads if closeOnIdle specified) and uses
`web_worker.has_message_event_listener` check in the opposite way as
#22944. (Now we continue the worker when `has_message_event_listener` is
true instead of stopping it when `has_message_event_listener` is false.

closes #23061
closes #26154
2025-01-09 15:19:11 -05:00
denobot
1e38520e4e chore: release ext/ crates (#27419)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-09 15:19:11 -05:00
Filip Stevanovic
a71c268271 fix(ext/node): Fix fs.access/fs.promises.access with X_OK mode parameter on Windows (#27407)
- Fixes an issue on Windows where the `fs.constants.X_OK` flag caused
`fs.access` and `fs.promises.access` to incorrectly throw a "permission
denied" error
- Introduced formatting changes due to the formatting tool
- Fixed the issue by always removing the `X_OK` bit from the mode
variable m (not sure if it's necessary to check for the presence of it
in the `mode` param first?)
- Updated unit tests to handle the mentioned constant
- `X_OK` bit is ignored in the Node implementation and should behave
like `F_OK`

fs constants Node documentation:
https://nodejs.org/api/fs.html#fsconstants

fixes https://github.com/denoland/deno/issues/27405
2025-01-09 15:19:11 -05:00
Sean McArthur
e943e4287f fix(ext/fetch): retry some http/2 errors (#27417)
This brings some of the HTTP/2 retry behavior from reqwest to
`ext/fetch`. It will retry very specific HTTP/2 errors once, if the body
is able to be used again.

Closes #27332
2025-01-09 15:19:10 -05:00
snek
e482c77a31 chore: upgrade libc (#27414)
need to do this for quic and they deprecated this method in libc without
actually providing an alternative so :/
2025-01-09 15:19:10 -05:00
Bartek Iwańczuk
028a84672d fix(ext/node): sort list of built-in modules alphabetically (#27410) 2025-01-09 15:19:10 -05:00
Bartek Iwańczuk
2c3e31bc10 fix(task): properly handle task name wildcards with --recursive (#27396)
This commit fixes `deno task` by checking if the provided
task name actually has a wildcard char ("*").

Previously, if the "--recursive" flag was passed, the task name
was treated as a regex, which lead to a situation where exact task
name resulted in a regex that matched all tasks with the specific
prefix.

This commit fixes it, by checking if the provided task name, is an exact
name, or is it a wildcard match.

Closes https://github.com/denoland/deno/issues/27370
Closes https://github.com/denoland/deno/issues/27401
Closes https://github.com/denoland/deno/issues/27408
2025-01-09 15:19:10 -05:00
Nathan Whitaker
3b66473981 fix(outdated): ensure "Latest" version is greater than "Update" version (#27390)
Fixes #27038.

Previously, for NPM packages the latest version was the version with the
"latest" tag. For JSR packages, the latest version was the greatest
version that matched a `*` version requirement. Unfortunately, that
doesn't work well with pre-release versions.

This PR changes it so that the latest version is always > the currently
requested version.
For NPM: if "latest" tag > current then "latest" tag; otherwise the
greatest version that is >= current
For JSR: greatest version >= current

This is the most reasonable behavior I could come up with. For example,

```
versions:
2.0.0-beta.2
2.0.0-beta.1
1.0.0 => "latest" tag

with a version req `^2.0.0-beta.1`

previously:
"Update" column => 2.0.0-beta.2
"Latest" column => 1.0.0

now:
"Update" column => 2.0.0-beta.2
"Latest" column => 2.0.0-beta.2
```
2025-01-09 15:19:10 -05:00
Nayeem Rahman
28fb691f4e fix(lsp): include "node:" prefix for node builtin auto-imports (#27404) 2025-01-09 15:19:10 -05:00
Bartek Iwańczuk
9529d2a77f fix: deno_resolver crate without 'sync' feature (#27403) 2025-01-09 15:19:10 -05:00
denobot
11df8e3257 chore: release "deno_*" crates (#27402)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-09 15:19:10 -05:00
Yusuke Tanaka
7db9448cdf feat(permission): separate PermissionDeniedError to Retryable and Fatal (#27282)
This commit separates `PermissionDeniedError` into two kinds;
`Retryable` and `Fatal`.

The existing `PermissionDeniedError`s fall into `Retryable`, since
permission errors can be resolved by retrying with proper permissions in
Deno CLI. The motivation of adding `Fatal` is that in some environments
some operations are just disabled; for instance, in Deno Deploy, any
write operations to filesystem can never be granted, in which case
`Fatal` kind becomes useful.

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-09 15:19:09 -05:00
Bartek Iwańczuk
18304a674d refactor(lint): renames and code flattening (#27386)
Working on loading plugin configuration for
https://github.com/denoland/deno/pull/27203
I encountered a lot of complexity, so did some drive-by cleanups to make
it easier to grok the code and have fewer duplicate names.
2025-01-09 15:19:09 -05:00
David Sherret
d7e93cfff6 refactor: use capacity_builder for writing deno compile data section (#27393) 2025-01-09 15:19:09 -05:00
David Sherret
48b760c38b refactor: extract out FileFetcher to deno_cache_dir (#27263) 2025-01-09 15:19:09 -05:00
Nayeem Rahman
83c00ea092 fix(lsp): respect "typescript.suggestionActions.enabled" setting (#27373) 2025-01-09 15:19:09 -05:00
Divy Srivastava
0ac82d6fea fix: upgrade deno_doc to 0.161.3 (#27377)
upgrades itoa requirement to `1.0.14`. needed for #27308
2025-01-09 15:19:09 -05:00
David Sherret
c85e9ffbc6 fix(compile): display embedded file sizes and total (#27360)
Merging as a fix so that LTS gets this as it's a useful diagnostic tool.

The 1MB unique is because we deduplicate files that we store (ex. some
packages have the same file multiple times so we store that once).
2025-01-09 15:19:09 -05:00
Divy Srivastava
2e0c4a38d6 fix: FastString v8_string() should error when cannot allocated (#27375)
Upgrades deno_core to 0.326.0
2025-01-09 15:19:08 -05:00
Bartek Iwańczuk
fbf569fdfa refactor: add 'sync' feature to deno_resolver crate (#27357) 2025-01-09 15:19:08 -05:00
David Sherret
30c8575715 ci: restore cargo home cache before rust install (#27356)
I think this makes more sense. We'll see if it makes it faster. It was
taking 1m 22s to install rust.
2025-01-09 15:19:08 -05:00
Nathan Whitaker
d373e2fb93 fix(outdated): support updating dependencies in external import maps (#27339)
Fixes #27331.

The support for it was already in `outdated`, but forgot to wire up the
updating part

Needs #27337
2025-01-09 15:19:08 -05:00
Nathan Whitaker
457f64a6c6 fix(lockfile): include dependencies listed in external import map in lockfile (#27337) 2025-01-09 15:19:08 -05:00
Nayeem Rahman
cb36d8a606 fix(lsp): sql and component file formatting (#27350) 2025-01-09 15:19:08 -05:00
Yusuke Tanaka
771f72f7e2 chore: bump hyper-util to 0.1.10 (#27330)
This commit upgrades hyper-util to 0.1.10, the current latest version.

This also removes exact version specifier in hyper-util to allow library
consumers (e.g. one who wants to use `deno_fetch` as a dependency) to
decide which version to use as long as its version is 0.1.z where z >=
10.

Specifically, hyper-util 0.1.10 is required by Deno Deploy to tweak
`http2_max_header_list_size` (see [hyper-util v0.1.10
changelog](https://github.com/hyperium/hyper-util/releases/tag/v0.1.10))
2025-01-09 15:19:08 -05:00
Bartek Iwańczuk
6755ca9ab3 Revert "ci: use self-hosted mac arm runner only on main branch (#27347)" (#27354)
This reverts commit 3ddbea62c2.

Looks like VMs are now slightly different than before and require
additional setup. Reverting for now to unblock `main` branch.
2025-01-09 15:19:07 -05:00
Kenta Moriuchi
a9748b2228 feat(ext/web): add [[ErrorData]] slot to DOMException (#27342) 2025-01-09 15:19:07 -05:00
Bartek Iwańczuk
7d2f888322 ci: use self-hosted mac arm runner only on main branch (#27347)
We can have 2 concurrent runs now, so
it's worth trying it out on `main`.
2025-01-09 15:19:07 -05:00
David Sherret
a61b0b75a7 ci: try fix cache (#27348) 2025-01-09 15:19:07 -05:00