1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-21 04:52:26 -05:00
Commit graph

13015 commits

Author SHA1 Message Date
Leo Kettmeir
054075730c
refactor: update deno_core and use more concrete errors (#27620)
waiting for https://github.com/denoland/deno_core/pull/1043

Fixes #27672
2025-01-17 09:41:52 -08:00
Yoshiya Hinosawa
b55451b178
fix(ext/node): tls.connect regression (#27707)
The TLS start sequence has been broken since #26661 because of the way
how we wrap TCP handle to create TLS handle.

#26661 introduced happy-eyeballs algorithm and some connection could be
dropped because of happy-eyeball attempt timeout. The current
implementation doesn't consider that case and it could start TLS
handshake with timed out TCP connection. That caused #27652 .

This PR fixes it by changing the initialization steps. Now `wrapHandle`
of TLSSocket set up `afterConnectTls` callback in TCP handle, and
`afterConnect` of TCP handle calls it at `connect` event timing if it
exists. This avoids starting TLS session with timed out connection.

closes #27652
2025-01-18 00:10:26 +09:00
Bartek Iwańczuk
342ccbb99d
ci: use self-hosted mac arm runner on tags (#27708) 2025-01-17 14:31:58 +01:00
Bartek Iwańczuk
0050857f51
refactor: add 'deno_process' crate (#27680)
Untangled the whole `runtime/ops/process.rs` from `ext/node/` and moved
to a separate `ext/process` crate.
2025-01-17 13:30:14 +01:00
Yoshiya Hinosawa
339bc44c58
fix(ext/node): propagate socket error to client request object (#27678)
Co-authored-by: Satya Rohith <me@satyarohith.com>
2025-01-17 12:30:00 +09:00
denobot
94dc5b16f5
chore: forward v2.1.6 release commit to main (#27705)
This is the release commit being forwarded back to main for 2.1.6

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-17 02:09:13 +01:00
Nathan Whitaker
a5ba198b9a
fix(outdated): Use latest tag even when it's the same as the current version (#27699)
Fixes https://github.com/denoland/deno/issues/27696.

Just a `>` that should've been a `>=`. Also made sure to filter out
deprecated versions.
2025-01-16 20:03:25 +00:00
Nathan Whitaker
256950ddb6
fix(outdated): retain strict semver specifier when updating (#27701)
Fixes https://github.com/denoland/deno/issues/27697

If it's a strict bound (e.g. `1.0.0` as opposed to `^1.0.0` or other),
retain the strictness when we update
2025-01-16 19:33:38 +00:00
Nathan Whitaker
464ee9155e
fix(check/lsp): fix bugs with tsc type resolution, allow npm packages to augment ImportMeta (#27690)
Fixes #26224.
Fixes #27042.

There were three bugs here:
- we were only resolving `/// <reference types` directives starting with
`npm:`, which meant we failed to resolve bare specifiers (this broke the
`/// <reference types="vite/client">` directive in most of the vite
templates)
- the `$node_modules` workaround caused us to fail to read files for
tsc. For instance tsc would construct new paths based on specifiers
containing `$node_modules`, and since we hadn't created those we weren't
mapping them back to the original (this broke some type resolution
within `vite/client`)
- our separation of `ImportMeta` across node and deno globals in tsc
meant that npm packages couldn't augment `ImportMeta` (this broke
`vite/client`'s augmentation to add `import.meta.env` and others)


After this, the only remaining issue in the vanilla vite template is our
error on `/vite.svg` (which is an ambient module), and I'll look into
that next.
2025-01-16 19:20:04 +00:00
Bartek Iwańczuk
2debe9c8dd
fix(ext/console): change Temporal color (#27684)
This commit changes output color of `Temporal` instances from
"magenta" to "cyan" to discriminate them from `Date` instances.

Closes https://github.com/denoland/deno/issues/27585
2025-01-16 18:27:54 +00:00
Jo Franchetti
17d6e66ee3
docs: adding jsdocs info for console interface (#27666)
Signed-off-by: Jo Franchetti <jofranchetti@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-01-16 14:48:13 +00:00
Phil Hawksworth
8d2f76ae36
docs: JSDocs examples for prompt, confirm, and alert (#27695)
Adds examples
2025-01-16 14:20:45 +00:00
Phil Hawksworth
e54d467812
docs:Adds examples in JSDocs for localStorage and sessionStorage (#27668)
Improves docs for:

- http://docs.deno.com/api/web/~/localStorage
- http://docs.deno.com/api/web/~/sessionStorage
2025-01-16 12:33:08 +00:00
Muthuraj Ramalingakumar
e49d6f2d45
chore: add missing internal core_import_map file paths (#27691)
Noted this when working locally, will help with vscode intellisense.

fixes: https://github.com/denoland/deno/issues/27689
2025-01-16 04:38:43 +00:00
Nathan Whitaker
32708213d5
fix(check/lsp): correctly resolve compilerOptions.types (#27686)
Fixes https://github.com/denoland/deno/issues/27062

In the LSP we were passing `npm` specifiers to TSC as roots, but TSC
needs fully resolved specifiers (like the actual file path).

In `deno check` we were often excluding the specifiers entirely from the
roots.

In both cases, we need to resolve the specifiers fully and then pass
them to tsc
2025-01-15 18:48:10 -08:00
Bartek Iwańczuk
a02ee7adf9
ci: try to fix caching on Mac ARM (#27685) 2025-01-15 10:09:08 -08:00
David Sherret
05dc69932d
refactor: create deno_lib crate (#27673)
Shifts just some code down for now. I'll do the rest of the refactor in
the next pr, but didn't want to drop a huge refactor.
2025-01-15 09:35:46 -05:00
Bartek Iwańczuk
836a623d99
ci: use self-hosted mac arm runner (#27568) 2025-01-15 11:03:05 +00:00
Masato Yoshioka
b22a50cb0c
fix(ext/node): add chown method to FileHandle class (#27638) 2025-01-15 17:15:07 +09:00
David Sherret
afc23fb2e0
chore: fix ci by removing remote server dependent test (#27674)
This was using the lockfile and esm.sh changed breaking the lockfile. We
could pin to a specific esm.sh version, but ideally we shouldn't have
the test suite dependent on remote servers.
2025-01-15 04:06:57 +00:00
Bartek Iwańczuk
974e2f44b2
refactor: add 'deno_os' crate (#27655)
This commit creates "deno_os" extension crate and moves
numerous ops from "runtime/" crate to the new crate.
2025-01-14 17:29:36 +01:00
Yoshiya Hinosawa
c943f56949
fix(ext/node): fix playwright http client (#27662) 2025-01-15 01:00:55 +09:00
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