1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-19 12:16:17 -05:00
Commit graph

12993 commits

Author SHA1 Message Date
David Sherret
0b033140c0
refactor: move CliNpmResolver to deno_resolver::npm::NpmResolver (#27659)
As title. After this PR all npm resolution will be out of the CLI crate.
2025-01-14 10:01:05 -05:00
Marvin Hagemeister
3fb8fc1ba7
feat(unstable): refactor js lint plugin AST (#27615)
This PR changes the underlying buffer backed AST format we use for
JavaScript-based linting plugins. It adds support for various new types,
makes traversal code a lot easier and is more polished compared to
previous iterations.

Here is a quick summary (in no particular order):

- Node prop data is separate from traversal, which makes traversal code
so much easier to reason about. Previously, it was interleaved with node
prop data
- spans are in a separate table as well, as they are rarely needed.
- schema is separate from SWC conversion logic, which makes 
- supports recursive plain objects
- supports numbers
- supports bigint
- supports regex
- adds all SWC nodes

Apologies, this is kinda a big PR, but it's worth it imo.

_Marking as draft because I need to update some tests tomorrow._
2025-01-14 13:31:02 +01:00
David Sherret
1e95c20561
refactor: deno_config 0.45 (#27660) 2025-01-14 13:00:31 +01:00
siaeyy
a1f50a7422
fix(node/fs): add utimes method to the FileHandle class (#27582) 2025-01-14 18:08:22 +09:00
Aaron Ang
9cb089f6db
fix(ext/node): add writev method to FileHandle (#27563)
Part of #25554
2025-01-14 18:01:14 +09:00
David Sherret
7616429436
fix(compile/windows): better handling of deno_dir on different drive letter than code (#27654)
Closes https://github.com/denoland/deno/issues/27651
2025-01-13 22:29:21 -05:00
David Sherret
9dbb99a83c
refactor: create NpmInstaller (#27626)
This separates npm resolution code from npm installation (more work
towards moving resolution code out of the CLI and cleaning up this
code).
2025-01-13 17:35:18 -05:00
TateKennington
5a39f2f096
fix(node): Prevent node:child_process from always inheriting the parent environment (#27343) (#27340)
Fixes #27343

Currently the node:child_process polyfill is always passing the full
parent environment to all spawned subprocesses. In the case where
`options.env` is provided those keys are overridden but the rest of the
parent environment is still passed through.

On Node the behaviour is for child processes to only inherit the parent
environment when `options.env` isn't specified. When `options.env` is
specified the child process inherits only those keys.

This PR updates the internal node child_process polyfill so that the
`clearEnv` argument is set to true when spawning the subprocess to
prevent the parent environment always being inherited by default. It
also fixes an issue where `normalizeSpawnArguments` wasn't returning the
`env` option if `options.env` was unset.
2025-01-13 13:46:56 -08:00
David Sherret
2a2b39eb2e
fix(compile): store embedded fs case sensitivity (#27653) 2025-01-13 12:02:37 -05:00
Benjamin Swerdlow
714b40262e
refactor(node_resolver): make conditions_from_resolution_mode configurable (#27596) 2025-01-13 11:34:37 -05:00
Nayeem Rahman
f912aac2cb
fix(lsp): handle pathless untitled URIs (#27637) 2025-01-13 15:31:08 +00:00
Yoshiya Hinosawa
2091691164
fix(ext/node): apply @npmcli/agent workaround to npm-check-updates (#27639)
See the comment
https://github.com/denoland/deno/pull/25470#issuecomment-2435077722 for
the reason why we do this workaround to make `make-fetch-happen` work in
Deno

This PR applies the same workaround to `npm-check-updates` package.
`npm-check-updates` internally uses
[`npm-registry-fetch`](https://www.npmjs.com/package/npm-registry-fetch)
which uses
[`make-fetch-happen`](https://www.npmjs.com/package/make-fetch-happen)
(the problematic package) for making http request to npm registry.

The detection of `make-fetch-happen` doesn't work for
`npm-check-updates` because we use call stack at `net.Socket`
constructor to check if it's called from `make-fetch-happen`, but
`npm-check-updates` bundles its dependency and the check doesn't work.

This PR adds the check of `npm-check-updates` string in call stack in
net.Socket constructor to trigger the workaroud.

closes #27629
2025-01-13 18:11:26 +09:00
Nathan Whitaker
70c822bfe2
fix(lsp/check): don't resolve unknown media types to a .js extension (#27631)
Fixes https://github.com/denoland/deno/issues/25762. Note that some of
the things in that issue are not resolved (vite/client types not working
properly which has other root causes), but the wildcard module
augmentation specifically is fixed by this.

We were telling TSC that files with unknown media types had an extension
of `.js`, so the ambient module declarations weren't applying. Instead,
just don't resolve them, so the ambient declaration applies.
2025-01-11 03:26:01 +00:00
David Sherret
f6dcc13537
fix(regression): show bare-node-builtin hint when using an import map (#27632) 2025-01-11 01:39:43 +00:00
David Sherret
c27248a8f3
refactor: remove CliNpmReqResolver trait in deno_resolver (#27616) 2025-01-10 14:48:43 -05:00
Rajhans Jadhao
1dd5bd667c
fix(ext/node): use primordials in ext/node/polyfills/_fs_common.ts (#27589)
Related to #24236
2025-01-10 13:51:50 +01:00
David Sherret
475793f94d
refactor: implement NpmPackageFolderResolver in deno_resolver (#27614) 2025-01-10 00:01:47 +00:00
David Sherret
34beeb7703
refactor(npm): move SloppyImportsCachedFs to deno_resolver (#27610) 2025-01-09 18:30:48 -05:00
denobot
8bafb182ef
chore: forward v2.1.5 release commit to main (#27613)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2025-01-09 17:38:18 -05:00
Ryan Dahl
1d64670f9c
docs: added jsdoc for window.close() (#27608) 2025-01-09 15:05:39 -05:00
David Sherret
966370c908
refactor(npm): move InNpmPackageChecker code to deno_resolver (#27609)
As title. Will allow consumers to create this struct and use our
behaviour.

Closes #27409
2025-01-09 14:04:52 -05:00
Nayeem Rahman
318f524c5c
fix(lsp): use verbatim specifier for URL auto-imports (#27605) 2025-01-09 17:54:14 +00:00
David Sherret
093f3ba565
refactor(npm): extract out some npm fs resolution code from the cli (#27607)
Moves the npm fs resolvers into the deno_resolution crate.

This does not entirely move things out, but is a step in that direction.
2025-01-09 12:10:07 -05:00
David Sherret
ce0968ef3a
refactor(npm): split some resolution from installation (#27595)
This splits away some npm resolution code from installation. It will
allow for more easily extracting out resolution code in the future.
2025-01-08 23:46:37 +00:00
Leo Kettmeir
ea30e188a8
refactor: update deno_core for error refactor (#26867)
Closes #26171

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2025-01-08 14:52:32 -08:00
Tatsuya Kawano
814da49dff
fix(ext/net): update moka cache to avoid potential panic in Deno.resolveDns on some laptops with Ryzen CPU (#27572) 2025-01-08 16:48:23 -05:00
David Sherret
fc2788bfd7
fix(jsr): Wasm imports fail to load (#27594)
* https://github.com/denoland/deno_graph/pull/562

Closes https://github.com/denoland/deno/issues/27593
2025-01-08 19:46:15 +00:00
Divy Srivastava
fffa3804aa
fix(ext/node): Fix os.cpus() on Linux (#27592)
Populate `speed` using current scaling frequency and fix times
multiplier.

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

<table>
<tr>
<th>Node.js</th>
<th>Deno</th>
</tr>
<tr>
<td>

```
> os.cpus()
[
  {
    model: 'AMD Ryzen 5 7530U with Radeon Graphics',
    speed: 1396,
    times: {
      user: 1769930,
      nice: 20,
      sys: 525630,
      idle: 41325700,
      irq: 110060
    }
  },
```

</td>
<td>

```
> os.cpus()
[
  {
    model: "AMD Ryzen 5 7530U with Radeon Graphics",
    speed: 1630,
    times: [Object: null prototype] {
      user: 1795620,
      nice: 20,
      sys: 537840,
      idle: 41589390,
      irq: 111230
    }
  },
```

</td>
</tr>
</table>
2025-01-08 22:09:55 +05:30
Divy Srivastava
e233173653
fix(ext/websocket): Fix close code without reason (#27578)
Fixes https://github.com/denoland/deno/issues/27566

The close code wasn't sent if reason was None, defaulting to 1005. This
patch allows sending close code without reason.
2025-01-08 20:07:47 +05:30
Yusuke Tanaka
1661ddd9ca
fix(ext/node): have process global available in Node context (#27562)
This commit makes `process` global always available in Node context.

`process` global was previously available explicitly in `deno_node`, but then
got removed in #25291 and made globally available regardless of whether it's in
Deno or Node context, so this commit does not have any effect on Deno CLI.
However, for users who want to use `deno_node` ext only, it makes sense to have
`process` available to simulate the Node environment individually.

This change may bring some negative performance impact. To measure how large the
impact would be, a very simple benchmark was performed whose results can be
found at https://github.com/magurotuna/process_global_bench.
2025-01-08 13:14:57 +09:00
Marvin Hagemeister
cabdfa8c2d
fix(lint): fix single char selectors being ignored (#27576)
The selector splitting code that's used for JS linting plugins didn't
properly account for selectors being a single character. This can happen
in the case of `*`.

Instead of comparing against the length, we'll now check if the
remaining string portion is not empty, which is more robust. It also
allows us to detect trailing whitespace, which we didn't before.
2025-01-08 00:21:50 +01:00
David Sherret
3f5cad38aa
fix(no-slow-types): handle rest param with internal assignments (#27581)
Closes #27575
2025-01-07 12:34:34 -08:00
Nayeem Rahman
b5e4a303d5
fix(lsp): don't skip dirs with enabled subdirs (#27580) 2025-01-07 19:04:06 +00:00
Nikolay Karadzhov
8cda4cf53d
feat(node/fs): Add a chmod method to the FileHandle class (#27522)
Add the chmod method to the FileHandle class in node compat as part of
#25554
2025-01-07 14:58:14 +01:00
Bartek Iwańczuk
b7fb5a5547
Revert "perf: build denort with panic = "abort" for releases (#27507)" (#27573)
Also reverts #27518

The reason is that it takes too long to build these two
binaries on Mac ARM runners as it stands.

We're gonna try to reland this next week, after sorting out
situation with these runners.
2025-01-07 02:32:51 +00:00
Bartek Iwańczuk
b6f2646c1c
refactor: make IncrementalCache accept a CacheDBHash (#27570) 2025-01-06 23:56:36 +00:00
Bartek Iwańczuk
6750aa61eb
ci: increase timeout to 240 minutes (#27571)
With https://github.com/denoland/deno/pull/27507 landed we need to do
two builds that don't really share much codegen units.

This should be reverted once we move to self-hosted runner on `main`
(https://github.com/denoland/deno/pull/27568)
2025-01-06 22:33:52 +00:00
Yoshiya Hinosawa
888ab9f4f7
test(ext/node): disable flaky dgram tests (#27549)
Closes #27316
2025-01-06 23:18:45 +01:00
Luca Casonato
f483996658
feat(unstable): no config npm:@opentelemetry/api integration (#27541)
After this PR, one does not need to import `jsr:@deno/otel` anymore.
2025-01-06 17:00:32 +01:00
snek
ccd375802a
refactor(quic): introduce endpoint, 0rtt, cleanup (#27444)
A QUIC endpoint is a UDP socket which multiplexes QUIC sessions, which
may be initiated in either direction. This PR exposes endpoints and
moves things around as needed.

Now that endpoints can be reused between client connections, we have a
way to share tls tickets between them and allow 0rtt. This interface
currently works by conditionally returning a promise.

Also cleaned up the rust op names, fixed some lingering problems in the
data transmission, and switched to explicit error types.
2025-01-06 15:24:59 +01:00
Luca Casonato
4b35ba6b13
feat(unstable): replace SpanExporter with TracerProvider (#27473) 2025-01-06 14:28:29 +01:00
Yoshiya Hinosawa
9ad0d4c3db
fix(ext/http): improve error message when underlying resource of request body unavailable (#27463)
The error message is currently `Bad Resource ID`. This commit changes it to
`Cannot read request body as underlying resource unavailable`

closes #27133
2025-01-06 16:12:21 +09:00
Kitson Kelly
7cabd02c59
fix(kv): improve backoff error message and inline documentation (#27537)
Ref: #27536
2025-01-04 00:04:14 +01:00
David Sherret
89c92b84fa
fix(check): move module not found errors to typescript diagnostics (#27533)
Instead of hard erroring, we now surface module not found errors as
TypeScript diagnostics (we have yet to show the source code of the
error, but something we can improve over time).
2025-01-03 21:49:56 +00:00
Nayeem Rahman
18b813b93f
fix(check): line-break between diagnostic message chain entries (#27543) 2025-01-03 18:30:41 +00:00
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