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

13226 commits

Author SHA1 Message Date
Yoshiya Hinosawa
0a1b01d5a2
refactor(coverage): simplify CoverageReporter trait (#28219) 2025-02-22 09:04:57 +09:00
David Sherret
ebe4055b2d
refactor(resolver/node): use deno_path_util::is_relative_specifier (#28238)
Should be slightly faster too because it no longer heap allocates.
2025-02-21 23:27:29 +00:00
David Sherret
29c4661d0b
refactor: separate publish from pm subcommands (#28237) 2025-02-21 17:02:33 -05:00
David Sherret
761a9b62ce
refactor(cli): extract TypeChecker to separate module (#28235)
Extracts it out of tools/check.rs to type_checker.rs which makes more
sense because this is used across sub commands.
2025-02-21 21:00:29 +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
Leo Kettmeir
f800f5444a
chore: remove unused dependencies (#28204) 2025-02-21 02:46:56 -08: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
denobot
84fabecc9b
chore: forward v2.2.1 release commit to main (#28213)
This is the release commit being forwarded back to main for 2.2.1

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2025-02-21 01:35:34 +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
Phil Hawksworth
b20f98ccf7
docs: add examples for SubtleCrypto (#28068)
Adds examples for subtleCrypto
(https://docs.deno.com/api/web/~/SubtleCrypto)

- generateKey
- importKey
- exportKey
- sign
- verify
- digest
- encrypt
- decrypt
- deriveBits
- deriveKey
- wrapKey
- unwrapKey

---------

Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-20 22:57:54 +01:00
Jo Franchetti
5b24b67a6e
docs(canvas): Add examples to createImageBitmap jsdocs (#28055)
Adding examples to the JSDocs for createImageBitmap and
formatting/linting file

---------

Co-authored-by: Phil Hawksworth <phil@deno.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-20 21:24:18 +00: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
Jo Franchetti
c6c2fa8cec
docs(console): update console documentation (#28196)
Signed-off-by: Jo Franchetti <jofranchetti@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-20 21:50:57 +01:00
Jo Franchetti
ae8481a2f7
docs(web): update docs for globalThis.caches (#28061)
Co-authored-by: Phil Hawksworth <phil@deno.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-20 20:37:23 +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
David Sherret
3da3fe8f7b
fix: better jsx workspace config resolution (#28186)
* https://github.com/denoland/deno_config/pull/158
2025-02-19 18:50:44 -05:00
David Sherret
743fc4a261
refactor(publish): create ModuleContentProvider (#28177)
Adds a `ModuleContentProvider`. Will use this in a future PR to do more
than specifier unfurling (JSX support).
2025-02-19 14:58:10 -05:00
Kenta Moriuchi
297f85cbb6
chore: update dlint to 0.73.0 for CI (#28169) 2025-02-19 14:07:01 +00:00
Bartek Iwańczuk
e4b8fa5f4f
fix: move extension file declarations to cli/tsc/dts (#28180)
This commits moves all `.d.ts` files from `ext/*` to `cli/tsc/dts`.

Due to TSC snapshot removal, `cargo publish` is now erroring out,
unable to find the declaration files. These files were moved to
"cli/tsc/dts", because it's much easier than keeping them in 
extension directories, while still providing them compressed 
or uncompressed depending on the build type.
2025-02-19 02:53:21 +01:00
Bartek Iwańczuk
e03c990493
fix(ext/cache): add missing Cargo feature (#28178) 2025-02-19 00:29:01 +00:00
denobot
2968816863
2.2.0 (#28175)
Bumped versions for 2.2.0

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-18 23:12:17 +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
3747d2759a
feat: support XDG_CACHE_HOME for deno dir on macos (#28173)
* https://github.com/denoland/deno_cache_dir/pull/73
2025-02-18 14:56:07 -05: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
Bartek Iwańczuk
2f4527562c
fix(init): force --reload if npm or jsr package (#28150)
Ref
https://github.com/denoland/deno/issues/28148#issuecomment-2663189433
2025-02-18 13:43:32 +01:00
Rajhans Jadhao
45777b8eca
fix(ext/node): use primordials in ext/node/polyfills/path/common.ts (#28164)
Related to https://github.com/denoland/deno/issues/24236
2025-02-18 12:51:14 +01:00
Nayeem Rahman
f2a8c300d4
perf(lsp): don't clone asset text (#28165) 2025-02-18 11:46:19 +00:00
Leo Kettmeir
17a51c401a
feat(jupyter): make GPUTexture and GPUBuffer displayable (#28117) 2025-02-18 00:29:45 -08:00
Bartek Iwańczuk
1f169f4b09
fix(lint): don't mark plugin diagnostic as fixable, if it's not (#28147)
A vector with fixes was always created, even if there were no
applicable fixes.
2025-02-17 14:46:55 +00:00
printfn
70d775c57d
fix(unstable/temporal): implement Temporal.ZonedDateTime.getTimeZoneTransition (#27770)
This patches Temporal to support the `getTimeZoneTransition` method on
`ZonedDateTime`.

See https://github.com/denoland/deno/issues/27731.

Co-authored-by: printfn <printfn@users.noreply.github.com>
2025-02-17 14:02:34 +00:00
David Sherret
36933fb0b8
perf(lsp): make auto-imports a little faster (#28106) 2025-02-17 08:55:01 -05:00
David Sherret
fe55e3e573
refactor: better sys trait impls (#28140) 2025-02-16 22:15:53 +01:00
David Sherret
8d86198c69
chore: move tracing build to build job (#28141) 2025-02-16 15:46:13 -05:00
David Sherret
4ff629bb2a
chore: fix dts file for DefinitelyTyped linting (#28114)
Added this so that we only export exports from `Deno.lint`. Required to
pass DefinitelyTyped's linting.
2025-02-16 13:56:17 -05:00
Nathan Whitaker
56f67b5851
refactor: put lsp tracing behind flag (#28118)
To reduce binary size impact

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-02-14 17:17:52 +00:00
snek
979e2f7158
feat: Upgrade V8 to 13.4 (#28080)
- upgrade v8 to 13.4
- turbocall conversion for arraybuffers is now much more complex, so use
cranelift
- misc updates for deprecated fns
- v8 default stack size is too small now, causing stack overflow
exceptions in some tests
- add syscall shim to support new syscall in old sysroot
2025-02-14 11:26:47 +00:00