Commit graph

7708 commits

Author SHA1 Message Date
Yoshiya Hinosawa
41fc04c00c
feat(fmt): support formatting of embedded css, html, and sql (#29014)
This commit adds the formatting of CSS, HTML, and SQL which are embedded in
Tagged Template Literal strings. The embedded languages are detected by
the tag name of the literal.

```ts
// triggers CSS formatting
const Div = styled.div`
  margin: 5px;
  padding: ${padding}px;
`;

// triggers HTML formatting
document.body.innerHTML = html`
  <main>
    <h1>Hello ${name}!<h1>
  </main>
`;

// triggers SQL formatting when `--unstable-sql` passed
const query = sql`
  SELECT
    ${table}.${field}
  FROM
    ${table};
`
```

See https://github.com/dprint/dprint-plugin-typescript/pull/701 for more
details
2025-04-29 22:17:55 +09:00
Yoshiya Hinosawa
e142382350
feat(fmt): add fmt options (#28946)
This commit adds 14 new options from dprint-plugin-typescript:
- quoteProps
- newLineKind
- useBraces
- bracePosition
- singleBodyPosition
- nextControlFlowPosition
- trailingCommas
- operatorPosition
- jsx.bracketPosition
- jsx.forceNewLinesSurroundingContent
- jsx.multiLineParens
- typeLiteral.separatorKind
- spaceAround
- spaceSurroundingProperties

related: https://github.com/denoland/deno_config/pull/162
2025-04-29 21:31:08 +09:00
snek
2221cf3e7c
feat: deno_core 0.344.0 (#29089)
- new ops init api
  - fix op order
- remove deno_os_worker since extensions must now match the snapshot
exactly
- isatty test change
2025-04-29 13:15:08 +02:00
Nayeem Rahman
d77d0491ce
fix(lsp): add npm reqs to installer on resolution (#29061) 2025-04-28 23:12:12 +01:00
HasanAlrimawi
e028e26b9c
feat: add --open to deno serve to open server in browser (#25340)
Change:
Supported --open flag with deno serve -> (deno serve --open
somescript.ts/js).
The action that takes place is openning the browser on the address that
the server is running on.

Signed-off-by: HasanAlrimawi <141642411+HasanAlrimawi@users.noreply.github.com>
2025-04-28 21:14:44 +00:00
Nayeem Rahman
ad0ebb57ee
fix(lsp): normalize all uris originating from client (#29019) 2025-04-28 21:00:14 +01:00
Aapo Alasuutari
56282c1d9f
fix(ext/ffi): unexport brand from dts (#28503)
This is technically **BREAKING** as it removes a public API, but the
brand is type-only and the chance of anyone actually relying on this
seems very unlikely.

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2025-04-28 18:54:21 +00:00
Nayeem Rahman
f44329fc56
feat(info): include deno version (#29080) 2025-04-28 18:41:30 +01:00
snek
f360d61d64
fix: move otel logic into otel (#29073)
cleanup
229228ae0d
2025-04-28 15:09:15 +02:00
Bartek Iwańczuk
a33dae6a2a
feat: allow forcing in-memory SQLite dbs (#29026)
This commit adds two env vars:
- "DENO_CACHE_DB_MODE"
- "DENO_KV_DB_MODE"

Both of these env vars accept either "disk" or "memory" values and
control the modes of backing databases for Web Cache API and
"Deno.openKv()" API.

By default both APIs use disk backed DBs, but they can be changed to use
in-memory
DB, making them effectively ephemeral.
2025-04-28 09:06:38 +00:00
Laurence Rowe
229228ae0d
fix(otel): only start deno_telemetry thread when needed (#29065)
Closes #29064
2025-04-27 12:57:18 -04:00
Leo Kettmeir
0134f268cb
fix: better error message for bare run in file-like case (#29055)
Fixes #28996
2025-04-26 15:54:41 +02:00
David Sherret
ace8d2efb9
fix: correct reported typescript version (#29053)
https://github.com/denoland/deno/pull/29041#issuecomment-2831398138
2025-04-25 21:27:29 +00:00
Bartek Iwańczuk
094b1f82db
feat(cache): add DENO_EMIT_CACHE_MODE (#29025)
This commit adds support for `DENO_EMIT_CACHE_MODE` env var that accepts
either `normal` or `disable` values, allowing to disable caching of
transpiled sources - ie. transpilation will happen on each run.
2025-04-25 16:01:10 +00:00
ctrl+d
f9a024a748
feat(ext/net): add signal option to Deno.connect() (#27113)
Ref #26819

An optional **timeout** parameter has been added to the
**Deno.connect()** interface. This parameter allows specifying a timeout
(in milliseconds) within which the application must establish a
connection. If the timeout is exceeded without successfully connecting,
the operation is automatically aborted with an error. If the parameter
is not provided, the default behavior remains unchanged (no timeout).
Currently, the timeout functionality is implemented only for TCP
connections. Other connection types are not affected by this change.

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-25 20:25:50 +05:30
David Sherret
1c6a2445c3
feat: TypeScript 5.8 (#29041)
* https://github.com/denoland/TypeScript/pull/18

Closes https://github.com/denoland/deno/issues/28711
2025-04-25 10:09:31 -04:00
Divy Srivastava
6f4472c5dc
feat(ext/fetch): support localAddress option in custom HTTP client (#28781)
Fixes https://github.com/denoland/deno/issues/27376
Fixes https://github.com/denoland/deno/issues/23373

Example usage:

```js
const client = Deno.createHttpClient({
  localAddress: "127.0.0.2",
});
const response = await fetch("http://localhost:4545/local_addr", {
  client,
});
```
2025-04-25 18:03:24 +05:30
Bartek Iwańczuk
189ccffdb9
feat: Codegen feature flags (#28920)
This commit adds "deno_features" crate that contains definitions of all
unstable features in Deno.

Based on these definitions, both Rust and JS code is generated ensuring
that the two are always in sync.

In addition some of flag handling was rewritten to use the generated
definitions, instead of hand rolling these flag definitions.

---------

Co-authored-by: snek <snek@deno.com>
2025-04-25 08:33:45 +00:00
Bartek Iwańczuk
4924731ac3
chore: align crates versions (#29018)
Aligns version between `deno`, `denort` and `deno_lib` crates.

Removes `cli/lib/version.txt` and some build-script shenanigans to
override crate version.
2025-04-25 07:15:09 +00:00
denobot
6e86063c03
chore: forward v2.2.12 release commit to main (#29044)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2025-04-24 20:22:57 -04:00
Luca Casonato
7b908e5873
fix: correctly style rust logs with colors (#29040)
We upgraded `env_logger`, which uses a new color detection backend that
is backwards incompatible with the old backend and does not detect
GitHub Actions as a terminal that supports color. We now force
env_logger to respect the color decision that `deno_terminal` has
already made.
2025-04-24 15:06:14 -04:00
David Sherret
2eeccf1045
fix(compile): use a memory mapped file for fallback (#29039) 2025-04-24 17:19:52 +00:00
Divy Srivastava
e1329df448
v2.3.0-rc.3 (#29032) 2025-04-24 09:16:26 +05:30
David Sherret
3d16eb8ff3
fix(compile): temporarily fallback to reading resource data from file on windows (#29024)
Temp hacky fix for https://github.com/denoland/deno/issues/28982
2025-04-23 22:08:15 -04:00
Nayeem Rahman
74425ddb0b
fix(lsp): discard completions from non-exported npm files (#28962) 2025-04-23 21:34:57 +01:00
David Sherret
bbe24337b9
fix: remove warnings for bare node builtins (#29000) 2025-04-23 15:30:59 -04:00
0hm☘️🏳️‍⚧️
c26b39a0aa
fix(cli): Display error on invalid OTEL_EXPORTER_OTLP_PROTOCOL value (#28796)
#28646

Edit:

Hi apologies for the delayed explanation @marvinhagemeister.

The reason the error message wasn't appearing was due to the
initialization order. The logging system was being initialized after the
telemetry system. This created a problem: if telemetry failed during its
own initialization, the logging system wasn't yet ready to capture and
report the error.

My solution was to simply move the log initialization to occur before
the telemetry initialization. This resolves the issue, ensuring any
telemetry setup errors are correctly logged.
2025-04-23 11:15:29 +02:00
Divy Srivastava
4f5ac0acfc
v2.3.0-rc.2 (#29006) 2025-04-23 11:22:59 +05:30
David Sherret
edba5ff3c8
fix(compile): read resource name in executable as uppercase on Windows (#29005)
* https://github.com/denoland/sui/pull/40 (this is the fix)
* https://github.com/denoland/sui/pull/39
* https://github.com/denoland/sui/pull/38

Closes https://github.com/denoland/deno/issues/28982

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-04-23 04:59:59 +00:00
Bartek Iwańczuk
ff6fe8254c
v2.3.0-rc.1 (#28998) 2025-04-22 16:45:41 +02:00
Leo Kettmeir
b77871e0c8
fix(publish): support virtual: and cloudflare: schemes (#28922)
For https://github.com/jsr-io/jsr/pull/1035
2025-04-22 01:41:32 -07:00
Asher Gomez
66185e0d1d
fix(coverage): improve responsiveness of HTML reporter on small screens (#28993) 2025-04-22 13:23:27 +09:00
Nathan Whitaker
de3ce49f29
perf(lockfile): slightly terser lockfile formatting, remove old lockfile code (#28992)
Basically just update deno_lockfile, deno_npm, and eszip, and then adapt
to those changes. The main changes were the removal of the lockfile v4
resolution snapshot loading, and a terser formatting for the `os` and
`cpu` fields in the lockfile.
2025-04-22 01:12:16 +00:00
Nayeem Rahman
e7c8870010
fix(lsp): use markup content variant for hover response (#28987) 2025-04-22 00:41:36 +01:00
Nayeem Rahman
74fd529219
fix(lsp): show a diagnostic for managed npm non-existent subpaths (#28981) 2025-04-22 00:41:22 +01:00
Nathan Whitaker
713bf3266b
fix(npm): only print deprecation warnings on first install (#28990)
Fixes https://github.com/denoland/deno/issues/28933.

This was a regression from the packument refactor.
2025-04-21 20:18:38 +00:00
Leo Kettmeir
79e36b0ccd
feat(doc): add darkmode for HTML output (#28989) 2025-04-21 13:02:50 -07:00
Nayeem Rahman
d26be98377
fix(lsp): remove redirect diagnostic (#28988) 2025-04-21 19:14:00 +01:00
David Sherret
104514b06d
fix(compile): error when cannot extract binary section (#28986)
We were silently failing on failure here.
2025-04-21 15:21:37 +00:00
Bartek Iwańczuk
5bee29223d
fix: use proper version for v2.3.0-rc.0 (#28967)
Unfortunately
c1e037b816
built as v2.1.11 because I missed that this file needs to be updated as
well.
2025-04-19 09:29:30 +00:00
Bartek Iwańczuk
c1e037b816
v2.3.0-rc.0 (#28955) 2025-04-19 09:09:41 +02:00
Nathan Whitaker
dbb5373eab
fix(lockfile): re-fetch packuments if version not found, properly pass patch packages (#28964)
Fixes two issues:
- If a cached packument was out of date and missing a version from the
lockfile, we would fail. Instead we should try again with a forced
re-fetch
- We weren't threading through the workspace patch packages correctly
2025-04-18 23:08:15 +00:00
Nathan Whitaker
6ce1e9b7f7
fix(install): error gracefully if user passes --no-config to deno install <package> (#28965)
Fixes #28090. Fixes #28961.
2025-04-18 22:13:20 +00:00
Divy Srivastava
750476486a
fix: don't show panic traces for non-official builds (#28931)
Don't show panic trace URLs during development. `panic-trace` feature is
only enabled in CI.
2025-04-18 17:37:48 +02:00
denobot
9591c11633
chore: forward v2.2.11 release commit to main (#28958)
This is the release commit being forwarded back to main for 2.2.11

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-18 17:21:06 +02:00
Yoshiya Hinosawa
83f15ece09
feat(test): create coverage reports when --coverage specified in deno test (#28260)
This PR updates the behavior of `deno test --coverage` option. Now if
`--coverage` option is specified, `deno test` command automatically
shows summary report in the terminal, and generates the lcov report in
`$coverage_dir/lcov.info` and html report in `$coverage_dir/html/`

This change also adds `--coverage-raw-data-only` flag, which prevents
the above reports generated, instead only generates the raw json
coverage data (which is the same as current behavior)
2025-04-18 18:56:14 +09:00
Nayeem Rahman
0bb16651c0
chore(lsp): fix semantic cache cleanup exemptions (#28951) 2025-04-18 01:17:00 +00:00
Nathan Whitaker
4f7117a081
perf(npm): don't try to cache npm packages we've already cached (#28938)
With `nodeModulesDir: auto` (and `none`, to a lesser extent), we
frequently repeatedly try to cache npm packages during resolution. On a
(private) fresh project, I counted that `sync_resolution_with_fs` was
called 478 times over the course of a fresh build. This reduces the
number of calls to 8, and doing so speeds things up substantially.

```
❯ hyperfine --warmup 2 -N "deno task build" "../deno/target/release-lite/deno task build"
Benchmark 1: deno task build
  Time (mean ± σ):      3.652 s ±  0.042 s    [User: 3.285 s, System: 2.399 s]
  Range (min … max):    3.587 s …  3.712 s    10 runs

Benchmark 2: ../deno/target/release-lite/deno task build
  Time (mean ± σ):      1.356 s ±  0.007 s    [User: 1.961 s, System: 1.108 s]
  Range (min … max):    1.345 s …  1.372 s    10 runs

Summary
  ../deno/target/release-lite/deno task build ran
    2.69 ± 0.03 times faster than deno task build
```
2025-04-17 21:10:51 +00:00
Nathan Whitaker
f411ccd692
feat(lockfile): default to lockfile v5 (#28950)
Closes #28916
2025-04-17 13:27:37 -07:00
David Sherret
16d305449d
feat(compile): support for ffi and node native addons (#28934)
This extracts out the shared libraries and `.node` native modules to a
temp file and opens them from there. **This means that this
implementation will not work in every scenario.** For example, a library
could require other files that only exist in the in-memory file system.
To solve that, we'll introduce
https://github.com/denoland/deno/issues/28918 later or adapt this
solution to solve more issues.

Additionally, this will not work when run on readonly file systems.
2025-04-17 16:01:12 -04:00