0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-10 06:07:03 -04:00
Commit graph

1612 commits

Author SHA1 Message Date
David Sherret
2292eb1c92
fix(node): support re-exported esm modules in cjs export analysis (#28379)
Adds support for re-exporting an ES module from a CJS one and then
importing the CJS module from ESM. Also fixes a bug where require esm
wasn't working in deno compile.
2025-03-05 16:37:46 -05:00
Nathan Whitaker
0c0757fe66
fix(install): exclude npm workspace packages from graph roots in install (#28401)
Fixes #28374.
2025-03-05 20:41:05 +00:00
Marvin Hagemeister
be73f11f83
fix(unstable): lint plugin !== wrongly parsed as != (#28403)
That's an emberassing typo. The `!==` operator was wrongly converted to
`!=`.

Fixes https://github.com/denoland/deno/issues/28397
2025-03-05 20:14:50 +00:00
Marvin Hagemeister
7f7b51c414
fix(unstable): wrong node with shorthand ObjectPattern + AssignPattern (#28402)
We did not serialize the `AssignmentPattern` node inside `ObjectPattern`
properties.

```ts
({ a = b } = {})
```

This is a bit different in SWC and looks like I got confused with the
different AST formats.

Fixes https://github.com/denoland/deno/issues/28399
2025-03-05 20:12:19 +00:00
David Sherret
731a238d34
fix(install): support "file:" dependencies in local package.json (#28396)
This adds support for installing `file:` dependencies in a local
package.json.

In order to use these, you must not set `--node-modules-dir=...` when
using a package.json and it should use the default of
`--node-modules-dir=manual`.

Closes https://github.com/denoland/deno/issues/18701
2025-03-05 14:08:05 -05:00
Mohammad Sulaiman
865ec7c4f4
fix(run): skip the cjs suggestion for mjs/mts modules (#26698)
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-03-05 17:29:41 +00:00
Marvin Hagemeister
1f6f561979
fix(unstable): lint plugin fix :has(), :is/where/matches and :not() selectors (#28348)
This PR adds support for `:has/:is/:where()` and `:not()`. The latter
was already present, but found a bunch of issues with it and I'd say
that it didn't really work before this PR.


Fixes https://github.com/denoland/deno/issues/28335
2025-03-04 16:04:39 +01:00
Marvin Hagemeister
842a906295
fix(unstable): lint plugin child combinator not working with groups (#28360)
Internally, we use a group node for array-like children, which is hidden
from the user. When we're asking for a parent of a node we need to take
group nodes into account and walk over them.

Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
2025-03-03 21:44:04 +01:00
David Sherret
bf060427b9
fix(node): require esm should prefer module.exports export (#28376) 2025-03-03 15:03:12 -05:00
David Sherret
a566d8bd10
fix: add "module.exports" export to ESM CJS wrapper module (#28373) 2025-03-03 16:47:39 +00:00
Marvin Hagemeister
9bcbef6d2f
fix(unstable): lint plugin swapped exported and source for ExportAllDeclaration (#28357)
The `source` and `exported` property were swapped for the
`ExportAllDeclaration` node.

Fixes one issue reported at
https://github.com/denoland/deno/issues/28355
2025-03-03 11:03:29 +01:00
Marvin Hagemeister
287bde1f72
fix(unstable): lint plugin ObjectPattern inconsistencies (#28359)
Fixes inconsistencies with `ObjectPattern` node to match TSESTree.

Fixes one issue reported in
https://github.com/denoland/deno/issues/28355
2025-03-03 11:02:52 +01:00
David Sherret
2a803fe2de
fix(check/npm): move not found errors inside npm packages to tsc diagnostics (#28337) 2025-02-28 10:06:20 -05:00
Marvin Hagemeister
3a1f3455b0
feat(unstable): lint plugins support field selectors (#28324)
This PR adds support for field selectors (`.<field>`) in the lint plugin
API. This is supported in ESLint as well, but was missing in our
implementation.

```css
/* Only search the test expression of an IfStatement */
IfStatement.test
```

Fixes https://github.com/denoland/deno/issues/28314
2025-02-28 15:10:02 +01:00
Marvin Hagemeister
b4aa3e6d1e
fix(unstable): lint plugin regex attribute selector not working (#28340)
The code to support regex matching on attribute values was already
there. I just forgot to wire it up properly in the selector matching
code.

Fixes https://github.com/denoland/deno/issues/28336
2025-02-28 12:59:41 +01:00
Nayeem Rahman
eea5eb1c40
fix(lsp): include prefix and suffix for rename edits (#28327) 2025-02-27 21:34:32 +00:00
Luca Casonato
aa55efaa13
fix(otel): don't throw when calling setActiveSpan at root (#28323)
When calling `setActiveSpan` at the module root, or with `options.root =
true`, the function would internally throw.
2025-02-27 18:47:09 +01:00
Dimitris Apostolou
cdf6ea32c4
chore: prefer workspace dependencies in order to avoid duplicate crates (#28281) 2025-02-26 14:55:47 +00:00
Nayeem Rahman
0f76f6c211
perf(lsp): don't set resolver npm reqs if unchanged (#28302) 2025-02-25 21:56:50 +00:00
Nathan Whitaker
ee4c14a550
chore: update to rust 1.85 (#28236)
Updates to use rust 1.85. Doesn't move to the 2024 edition, as that's a
fair bit more involved.

A nice side benefit is that the new rustc version seems to lead to a
slight reduction in binary size (at least on mac):

```
    FILE SIZE   
 -------------- 
  +4.3%  +102Ki    __DATA_CONST,__const
  [NEW] +69.3Ki    __TEXT,__literals
  [NEW] +68.5Ki    Rebase Info
  +5.0% +39.9Ki    __TEXT,__unwind_info
   +57% +8.85Ki    [__TEXT]
  [NEW] +8.59Ki    Lazy Binding Info
  [NEW] +5.16Ki    __TEXT,__stub_helper
  [NEW] +3.58Ki    Export Info
  [NEW] +3.42Ki    __DATA,__la_symbol_ptr
  -0.1%    -726    [12 Others]
 -21.4% -3.10Ki    [__DATA_CONST]
 -95.8% -3.39Ki    __DATA_CONST,__got
 -20.9% -3.43Ki    [__DATA]
  -0.5% -4.52Ki    Code Signature
 -100.0% -11.6Ki    [__LINKEDIT]
  -1.0% -43.5Ki    Symbol Table
  -1.6% -44.0Ki    __TEXT,__gcc_except_tab
  -0.2% -48.1Ki    __TEXT,__const
  -3.3% -78.6Ki    __TEXT,__eh_frame
  -0.7%  -320Ki    __TEXT,__text
  -1.5%  -334Ki    String Table
  -0.5%  -586Ki    TOTAL
```
2025-02-25 08:50:01 -08:00
Divy Srivastava
e66ef32a8f
fix(ext/node): SQLite reset guards to prevent database locks (#28298)
Fixes https://github.com/denoland/deno/issues/28295
2025-02-25 19:27:55 +05:30
Marvin Hagemeister
f9166797d2
fix(lint): plugins ignored when no rust rule active (#28269)
When all Rust-based rules where filtered out we were bailing out early
instead of checking if there are plugin rules we need to run. This meant
we errored out with a "No lint rules to run" message, even though plugin
rules were active.

Fixes https://github.com/denoland/deno/issues/28267
2025-02-24 23:35:49 +01:00
Bartek Iwańczuk
93a1bb738a
fix(lint): give access to SourceCode in 'deno test' (#28278)
Closes https://github.com/denoland/deno/issues/28273
2025-02-24 17:21:16 +01:00
Leo Kettmeir
0fbab02d0f
fix: add info suggestion for unsafely-ignore-certificate-errors and add --help=full (#28203)
For #27865
2025-02-24 08:20:59 -08:00
Divy Srivastava
7fa8fc4b26
fix(ext/node): descriptive sqlite error messages (#28272)
Fixes https://github.com/denoland/deno/issues/28259
2025-02-24 17:55:36 +05:30
Nayeem Rahman
0dc3e87cb7
fix(fmt): support "--ext vto" and "--ext njk" (#28262) 2025-02-24 12:09:53 +00:00
David Sherret
2212d7d814
chore: mark worker_large_output as flaky (#28241) 2025-02-22 01:30:04 +00:00
David Sherret
62262d611c
chore: mark inspector break tests as flaky (#28239) 2025-02-22 00:54:42 +00:00
Nathan Whitaker
d20c6b5b7d
fix(install): don't error on unknown media types in install (#28234)
Fixes https://github.com/denoland/deno/issues/28223

This is kind of an ugly fix, but it works, and I think is the easiest
way to handle the fact that when caching the module graph we might
encounter imports that won't actually error at runtime (for instance in
files that will be bundled).
2025-02-21 12:20:55 -08:00
Nayeem Rahman
876bac445a
fix(lsp): close server on exit notification (#28232) 2025-02-21 20:02:56 +00:00
David Sherret
a9f404e479
fix(check): regression - implicit jsxImportSource was not resolving (#28228) 2025-02-21 14:09:57 -05:00
Marvin Hagemeister
063299353d
fix(unstable): lint plugin :exit called at wrong time (#28229)
The `:exit` selectors were called at the wrong time during visiting.

They need to be called when going upwards and a node and all its
children have been fully visited. Instead we called it when the node +
all its sibling were visited which is wrong.

Fixes https://github.com/denoland/deno/issues/28227
2025-02-21 17:50:26 +00:00
Divy Srivastava
648ee8f0e7
fix(ext/node): decipherIv() range error on invalid final block length (#28215)
Fixes https://github.com/denoland/deno/issues/28208
2025-02-21 04:48:38 +00:00
David Sherret
4523ddd8d7
fix(publish): support jsx/tsx (#28188) 2025-02-20 22:39:51 +00:00
Nathan Whitaker
73c4ce33da
chore: fix more flakey otel tests (#28211)
There are a couple others that flake for the same reason, that I missed
2025-02-20 14:24:48 -08:00
Nathan Whitaker
ce4e788430
fix(outdated): hint to use --latest if new versions are available in outdated --update (#28190) 2025-02-20 23:24:07 +01:00
Nathan Whitaker
e5de22b0b5
fix(coverage): exclude scripts with invalid URLs from raw coverage output (#28210)
Fixes https://github.com/denoland/deno/issues/28206.

Basically if you execute a script with `node:vm`, this produces a
"script" with the file name `evalmachine.<anonymous>`, which ends up
producing coverage like

```json
{
  "scriptId": "319",
  "url": "evalmachine.<anonymous>",
  "functions": [
    {
      "functionName": "",
      "ranges": [{ "startOffset": 0, "endOffset": 18, "count": 1 }],
      "isBlockCoverage": true
    }
  ]
}
```

We assume that the `url` field here (the specifier of the script) is a
valid URL, and so we error out when processing that coverage.

There are two potential fixes: either don't write the coverage files for
those scripts, or ignore the errors when we process the data. I went
with the former here.
2025-02-20 23:23:43 +01:00
Nathan Whitaker
3fdde62ba2
chore: fix otel test flakiness (#28209)
The bucket counts can vary run to run. Also don't hardcode the port
2025-02-20 21:06:42 +00:00
David Sherret
03e4234962
fix(check): remove instability in loading lib files (#28202)
Also reduces memory usage.

Closes #28201
2025-02-20 12:41:58 -05:00
Divy Srivastava
c1276d8fa0
fix(ext/node): rewrite SQLite named parameter handing (#28197)
Allow bare named params and handle invalid param name. Also adds
`StatementSync#setAllowBareNamedParameters`

Fixes https://github.com/denoland/deno/issues/28183
2025-02-20 18:34:34 +05:30
Divy Srivastava
664d50fab8
fix(ext/node): Fix handling of sqlite large integers (#28193)
Use `v8::Number` instead of `v8::Integer` to handle > i32::MAX.

Fixes https://github.com/denoland/deno/issues/28187
2025-02-20 16:32:46 +05:30
Leo Kettmeir
64abe902e5
fix: don't panic when running with // as a filepath (#28189)
Fixes #28128
2025-02-19 19:29:11 -08:00
Nathan Whitaker
08f5e797b6
fix(check/lsp): fall back to @types/* packages if npm package doesn't have types (#28185)
Fixes https://github.com/denoland/deno/issues/27569.
Fixes https://github.com/denoland/deno/issues/27215.

This PR makes it so type resolution falls back to looking for definitely
typed packages (`@types/foo`) if a given NPM package does not contain
type declarations.

One complication is choosing _which_ version of the `@types/*` package
to use, if the project depends on multiple versions. The heuristic here
is to try to match the major and minor versions, falling back to the
latest version. So if you have
```
@types/foo: 0.1.0, 0.2.0, 3.1.0, 3.1.2, 4.0.0
foo: 3.1.0
```
we would choose `@types/foo@3.1.2` when resolving types for `foo`.

---

Note that this only uses `@types/` packages if you _already_ depend on
them. So a follow up to this PR could be to add a diagnostic and
quickfix to install `@types/foo` if we don't find types for `foo`.
2025-02-19 23:55:06 +00:00
Leo Kettmeir
bf79971c95
feat(http): add otel metrics (#28034)
Signed-off-by: Leo Kettmeir <crowlkats@toaxl.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
2025-02-18 14:19:52 -08:00
David Sherret
f62fc9e81f
fix(check): npm resolution errors to tsc diagnostics (#28174)
Closes https://github.com/denoland/deno/issues/27188
2025-02-18 21:44:49 +00:00
David Sherret
116def7fad
feat(bench): add warmup and n for controlling number of iterations (#28123)
```ts
Deno.bench("benchmark", { warmup: 10_000, n: 1000 }, () => {
  ...
});
```

Closes #17649
2025-02-18 12:44:43 -05:00
Gowtham K
9b9eeabcc8
fix(node/sqlite): sqlite named parameters (#28154)
This PR introduces support for named parameters in SQLite queries, as
outlined in #28134
2025-02-18 22:03:39 +05:30
snek
6206343b54
fix: handle all values for buffers in turbocall codegen (#28170)
Now that ArrayBuffer/ArrayBufferView is a generic Value type, we have to
handle it being passed any value. To do this, thread
FastApiCallbackOptions through the function, and add error raising
logic.

If we run conversion and the value is not valid, we return `isize::MAX`,
and then in cranelift we use this value to know that we should branch to
the error logic.

An example compilation looks like this:
```rust
extern "C" fn print_buffer(ptr: *const u8, len: usize);
```

```clif
function %print_buffer_wrapper(i64, i64, i64, i64) system_v {
    sig0 = (i64, i64) system_v
    sig1 = (i64) -> i64 system_v
    sig2 = (i64) system_v

block0(v0: i64, v1: i64, v2: i64, v3: i64):
    v4 = iconst.i64 0x6525_9198_2d00 ; turbocall_ab_contents
    v5 = call_indirect sig1, v4(v1)
    v6 = iconst.i64 0x7fff_ffff_ffff_ffff
    v7 = icmp eq v5, v6
    brif v7, block1, block2

block2:
    v8 = iconst.i64 0x7558_4c0c_0700 ; sym.ptr
    call_indirect sig0, v8(v5, v2)
    return

block1 cold:
    v9 = iconst.i64 0x6525_9198_2d70 ; turbocall_raise
    call_indirect sig2, v9(v3)
    return
}
```

Also cleaned up all the `unwrap`s and added some logging.
2025-02-18 16:24:25 +00:00
Divy Srivastava
4ab380e0a7
fix(ext/node): implement StatementSync#iterate (#28168)
Fixes https://github.com/denoland/deno/issues/28130
2025-02-18 21:26:17 +05:30
Leo Kettmeir
17a51c401a
feat(jupyter): make GPUTexture and GPUBuffer displayable (#28117) 2025-02-18 00:29:45 -08:00