1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-07 22:58:24 -05:00
Commit graph

12948 commits

Author SHA1 Message Date
Bartek Iwańczuk
e9af7f8ebd
refactor: Use 'await using' in serve_test (#27532)
To make sure the servers are torn down when they throw an error during
test execution.
2025-01-02 23:56:36 +00:00
David Sherret
2092f0c697
fix(permissions): implicit --allow-import when using --cached-only (#27530)
`--cached-only` cannot communicate with a remote server

Closes https://github.com/denoland/deno/issues/27498
2025-01-02 16:55:03 -05:00
David Sherret
0457c38d4f
refactor: remove use of home crate (#27516)
The two places mentioned in the issue are now consolidated.

Closes https://github.com/denoland/deno/issues/24385
2025-01-02 10:06:35 -05:00
David Sherret
225c3dea87
refactor: update some fs_util functions to use sys_traits (#27515)
This is in preparation for extracting out these functions from the CLI
crate.

A side benefit is these functions will now work in Wasm.
2025-01-02 10:06:12 -05:00
David Sherret
9215aa60a6
refactor(node/npm): separate out permission check from npm resolvers (#27511)
Decouples permissions from the npm resolvers (towards moving the
resolvers out of the cli crate)
2025-01-02 10:05:52 -05:00
Nayeem Rahman
79c0b2ce73
fix(lsp): css preprocessor formatting (#27526) 2025-01-02 13:31:47 +00:00
Nathan Whitaker
7d66018874
chore: fix windows pre release CI job (#27518)
See
https://github.com/denoland/deno/actions/runs/12563186693/job/35024695065.
Broke in #27507.
2024-12-31 23:08:15 +00:00
David Sherret
8e618e1b2a
fix(npm): deterministically output tags to initialized file (#27514)
The tags were being sorted in a random order due to the package_reqs
hashmap
2024-12-31 20:36:57 +00:00
Nathan Whitaker
2965413374
perf: build denort with panic = "abort" for releases (#27507)
This PR changes CI to build denort with a separate, new build profile
`release-slim` that disables unwinding and strips symbols. This reduces
the size of denort by about 10%

current denort:

```
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  58.1%  39.3Mi  57.9%  39.3Mi    __TEXT,__text
  31.5%  21.3Mi  31.4%  21.3Mi    __TEXT,__const
   2.5%  1.68Mi   2.5%  1.68Mi    __DATA_CONST,__const
   2.4%  1.62Mi   2.4%  1.62Mi    __TEXT,__eh_frame
   2.4%  1.60Mi   2.4%  1.60Mi    __TEXT,__gcc_except_tab
   0.9%   610Ki   0.9%   610Ki    __TEXT,__cstring
   0.8%   536Ki   0.8%   536Ki    Code Signature
   0.7%   507Ki   0.7%   507Ki    __TEXT,__unwind_info
   0.3%   207Ki   0.3%   207Ki    Function Start Addresses
   0.2%   165Ki   0.2%   165Ki    __DATA,__data
   0.0%       0   0.2%   153Ki    __DATA,__bss
   0.1%  51.0Ki   0.1%  51.0Ki    Rebase Info
   0.1%  45.3Ki   0.1%  45.3Ki    __TEXT,__literals
   0.0%  31.4Ki   0.1%  36.8Ki    [15 Others]
   0.0%  25.6Ki   0.0%  25.7Ki    [__TEXT]
   0.0%  19.3Ki   0.0%  20.2Ki    [__DATA]
   0.0%  8.11Ki   0.0%  8.11Ki    Lazy Binding Info
   0.0%       8   0.0%  8.08Ki    [__LINKEDIT]
   0.0%  6.84Ki   0.0%  6.84Ki    Symbol Table
   0.0%  5.55Ki   0.0%  5.55Ki    String Table
   0.0%  5.53Ki   0.0%  5.53Ki    __TEXT,__ustring
 100.0%  67.6Mi 100.0%  67.8Mi    TOTAL
```

built with this PR:

```
    FILE SIZE        VM SIZE    
 --------------  -------------- 
  59.6%  36.6Mi  59.5%  36.6Mi    __TEXT,__text
  34.6%  21.3Mi  34.5%  21.3Mi    __TEXT,__const
   2.7%  1.68Mi   2.7%  1.68Mi    __DATA_CONST,__const
   1.0%   610Ki   1.0%   610Ki    __TEXT,__cstring
   0.8%   487Ki   0.8%   487Ki    Code Signature
   0.3%   193Ki   0.3%   193Ki    Function Start Addresses
   0.3%   165Ki   0.3%   165Ki    __DATA,__data
   0.0%       0   0.2%   153Ki    __DATA,__bss
   0.2%   152Ki   0.2%   152Ki    __TEXT,__unwind_info
   0.1%  69.5Ki   0.1%  69.5Ki    __TEXT,__eh_frame
   0.1%  50.9Ki   0.1%  50.9Ki    Rebase Info
   0.1%  45.3Ki   0.1%  45.3Ki    __TEXT,__literals
   0.1%  34.1Ki   0.1%  39.5Ki    [15 Others]
   0.0%  19.3Ki   0.0%  20.2Ki    [__DATA]
   0.0%  19.6Ki   0.0%  19.7Ki    [__TEXT]
   0.0%  16.6Ki   0.0%  16.6Ki    __TEXT,__gcc_except_tab
   0.0%  8.09Ki   0.0%  8.09Ki    Lazy Binding Info
   0.0%       8   0.0%  7.69Ki    [__LINKEDIT]
   0.0%  6.83Ki   0.0%  6.83Ki    Symbol Table
   0.0%  5.77Ki   0.0%  5.77Ki    [__DATA_CONST]
   0.0%  5.53Ki   0.0%  5.53Ki    __TEXT,__ustring
 100.0%  61.4Mi 100.0%  61.6Mi    TOTAL
```

A caveat is that this will increase release build times in CI since it
requires building twice - once with unwinding and once without
2024-12-31 11:19:00 -08:00
Kenta Moriuchi
8fb073d7b4
chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
David Sherret
ac7b33a340
chore: cargo fmt - turn on group_imports=StdExternalCrate (#26646) 2024-12-31 12:13:39 -05:00
David Sherret
88bd5f09f7
perf(fs/windows): stat - only open file once (#27487) 2024-12-31 11:29:51 -05:00
David Sherret
4638caa740
refactor: do not use deno_fs::FileSystem everywhere (#27508)
This changes the cli to mostly use `std::fs` via `sys_traits` instead of
the implemention of `deno_fs::FileSystem`.
2024-12-31 11:29:07 -05:00
Bartek Iwańczuk
1cd36009b0
fix(ext/node): support private key export in JWK format (#27325)
Closes https://github.com/denoland/deno/issues/26643

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-12-31 13:49:02 +01:00
Je Xia
7b491a28df
fix(node): Add missing inspector/promises (#27491)
Add missing `inspector/promises` in node builtin module list, that
causes types checking error.
2024-12-31 11:06:21 +01:00
Marvin Hagemeister
a844d96ee9
chore(lint): remove manual AST field counter (#27449)
Addresses the review feedback in
https://github.com/denoland/deno/pull/27416 .

- Hoist the buffer max size variable to make it less confusing
- Remove manual AST field counter in favour of an explicit "commit
schema" step which writes the actual field count.
2024-12-31 08:59:41 +01:00
David Sherret
c391ad315e
refactor: use sys_traits (#27480) 2024-12-30 12:38:20 -05:00
David Sherret
fd8400eaec
perf(node/fs/copy): reduce metadata lookups copying directory (#27495) 2024-12-30 00:36:29 -05:00
Divy Srivastava
5194222e02
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
2024-12-28 12:44:37 +05:30
Marvin Hagemeister
fdd0edf23c
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.
2024-12-27 22:46:29 +01:00
Yoshiya Hinosawa
c45d0dadb3
fix(ext/node): add support of any length IV for aes-(128|256)-gcm ciphers (#27476) 2024-12-27 17:46:01 +09:00
Divy Srivastava
6061f22abd
fix(ext/node): RangeError timingSafeEqual with different byteLength (#27470)
Fixes https://github.com/denoland/deno/issues/27214
2024-12-27 11:20:49 +05:30
Luca Casonato
f4e321342f
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>
2024-12-26 09:01:39 +01:00
Yoshiya Hinosawa
91150706d8
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
2024-12-26 13:24:28 +09:00
Nathan Whitaker
a9ab7a80da
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.
2024-12-24 05:48:00 +00:00
Marvin Hagemeister
1a809b8115
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)`
2024-12-23 08:45:47 +01:00
Yoshiya Hinosawa
3cc861cdca
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`
2024-12-23 13:59:04 +09:00
Yoshiya Hinosawa
2e58e088b0
fix(ext/fs): do not throw for bigint ctime/mtime/atime (#27453) 2024-12-23 13:56:37 +09:00
David Sherret
e6869d7fa6
fix(node): handle cjs exports with escaped chars (#27438)
Closes https://github.com/denoland/deno/issues/27422
2024-12-21 10:00:18 -05:00
Marvin Hagemeister
26425a137b
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>
2024-12-21 00:58:03 +01:00
David Sherret
77e1af79bd
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.
2024-12-20 17:35:02 -05:00
David Sherret
ece718eb3e
perf: upgrade to deno_semver 0.7 (#27426) 2024-12-20 21:14:37 +00:00
Bartek Iwańczuk
c30f3450c6
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>
2024-12-20 17:43:03 +00:00
snek
65b647909d
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.
-->
2024-12-20 13:48:48 +01:00
Filip Stevanovic
23f7032d56
fix(ext/node): add truncate method to the FileHandle class (#27389) 2024-12-20 13:23:51 +09:00
Nayeem Rahman
feb94d09e7
fix(lsp): rewrite imports for 'Move to a new file' action (#27427) 2024-12-20 02:33:35 +00:00
David Sherret
3c147d6be1
fix(publish): infer literal types in const contexts (#27425)
* https://github.com/denoland/deno_graph/pull/555
2024-12-19 18:53:33 +00:00
Marvin Hagemeister
351e79642a
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.
2024-12-19 18:10:58 +00:00
David Sherret
074444ab6c
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
2024-12-19 12:53:52 -05:00
Yoshiya Hinosawa
350d9dce41
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
2024-12-19 17:39:20 +09:00
denobot
55d345baed
chore: release ext/ crates (#27419)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-12-19 03:39:02 +01:00
Filip Stevanovic
8fc4796ed5
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
2024-12-18 14:52:37 -08:00
Sean McArthur
b1c685f4b7
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
2024-12-18 23:04:29 +01:00
snek
ae74407412
chore: upgrade libc (#27414)
need to do this for quic and they deprecated this method in libc without
actually providing an alternative so :/
2024-12-18 14:47:21 +01:00
Bartek Iwańczuk
8590aa9cee
fix(ext/node): sort list of built-in modules alphabetically (#27410) 2024-12-18 14:44:53 +01:00
Bartek Iwańczuk
14e4064986
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
2024-12-18 03:32:37 +01:00
Nathan Whitaker
9d7174e434
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
```
2024-12-17 23:56:03 +00:00
Nayeem Rahman
2820ba1e22
fix(lsp): include "node:" prefix for node builtin auto-imports (#27404) 2024-12-17 18:55:17 +00:00
Bartek Iwańczuk
d632ec9e70
fix: deno_resolver crate without 'sync' feature (#27403) 2024-12-17 18:36:32 +01:00
denobot
ee9f24cdcd
chore: release "deno_*" crates (#27402)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-12-17 17:03:58 +01:00