Commit graph

2210 commits

Author SHA1 Message Date
David Sherret
539e41b8d4
fix(npm): respect etag for npm packument caching (#29130)
Stores the etag in a `_deno.etag` property on the json object of the
packument.
2025-05-02 09:49:05 -04:00
snek
bc1ced8260
refactor: allow lazy main module (#28929)
implement lazy(?) mode. an unconfigured jsruntime is created if
DENO_UNSTABLE_CONTROL_SOCK is present, and later passed into deno_runtime to be
configured and used.
2025-04-30 19:59:20 +00:00
Nayeem Rahman
8c57929058
fix(lsp): ignore 'for await' diagnostics in jupyter cells (#29114) 2025-04-30 17:24:52 +01:00
snek
78758f257b
feat: DENO_SERVE_ADDRESS duplicate option (#29109)
if `duplicate` is passed in DENO_SERVE_ADDRESS, use its value to create
a second listener instead of overriding the options the user passed.
2025-04-30 14:04:19 +00:00
Nayeem Rahman
2508286d7a
fix(lsp): prefer relative auto-import specifier against import map (#29098) 2025-04-30 05:50:17 +01:00
David Sherret
2b746c3137
feat(check): support erasableSyntaxOnly for type checking (#29097)
Only when using `--check` or `deno check`. Doesn't have this hooked up
as part of the swc emit.
2025-04-30 02:38:07 +00:00
Nathan Whitaker
05574665b2
fix(ext/node): work correctly with wrapper Response objects, use correct rawHeaders structure (#29056)
Fixes https://github.com/denoland/deno/issues/28022

Basically drizzle-kit studio uses hono with the node-server adapter.
That creates wrapper objects for responses that forward property getters
to the underlying response (the one we provided). However, in deno.serve
we were assuming that the response was actually the same response we
initially gave and crashed when it wasn't. instead, just call the
property getters if we can't find the inner response.

The raw headers bug is that we were exposing the `rawHeaders` field on
`Incoming` as a `Headers` object, instead it's supposed to be a flat
array of the header keys + values. I.e. `["Content-Type:",
"application/json", "Host:", "http://localhost"]`
2025-04-30 00:14:29 +00:00
siaeyy
1a171f10df
fix(ext/node): handle "ttl" option in "dns" module (#27676)
Closes #27669

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-29 22:49:10 +00:00
Nathan Whitaker
6d0035411b
feat(clean): deno clean --except <paths>, remove all cache data except what's needed to run paths (#28424)
Closes https://github.com/denoland/deno/issues/27229.


TODO:
- [x] Tests
- [x] Make some changes to `deno_cache_dir` so we can get the paths for
the local http cache
- [x] Right now this leaves the node modules setup cache in an incorrect
state (removes the symlinks, but doesn't update the setup cache)
- [ ] ~~Handle code cache and other sqlite caches?~~
2025-04-29 22:42:17 +00:00
Yoshiya Hinosawa
58b679a1d6
feat(check): detect tsconfig.json at workspace root (#29092)
This PR adds detection of `tsconfig.json` at the root of a workspace
when there exists either a deno.json or package.json. If a project
already has `deno.json` with a `compilerOptions` value the
`tsconfig.json` is ignored.
2025-04-29 21:54:22 +00:00
David Sherret
490c9c9099
fix: break unstable lockfile v5 to remove "has" from property names (#29095)
Lockfile v5 hasn't stabilized yet, so going to do this breaking change
in order to make the property names shorter.
2025-04-29 14:17:54 -04:00
David Sherret
5357bc0b9b
fix(npm): support registries that have no shasums or integrity (#29093)
This was actually fixed via the deno_npm and lockfile updates, but it
would be good to have an explicit entry for this in the release notes so
labeling this as a "fix"

Closes https://github.com/denoland/deno/issues/27758
2025-04-29 12:16:55 -04:00
Efe
49dbe697e5
fix(compile): pass default v8 args during compile (#29084) 2025-04-29 10:13:54 -04:00
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
Divy Srivastava
81a4f9e502
fix(ext/node): implement DatabaseSync#loadExtension (#29050)
Requires full `--allow-ffi`

Fixes https://github.com/denoland/deno/issues/29030
2025-04-29 12:30:21 +00: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
Nayeem Rahman
ad0ebb57ee
fix(lsp): normalize all uris originating from client (#29019) 2025-04-28 21:00:14 +01:00
Nayeem Rahman
f44329fc56
feat(info): include deno version (#29080) 2025-04-28 18:41:30 +01:00
Bartek Iwańczuk
f2ae7a19f4
fix: make --allow-env stronger that --deny-env (#29079) 2025-04-28 19:28:38 +02:00
Divy Srivastava
e0813f2255
fix(ext/node): throw NotCapable on process.env accessor (#28280)
Fixes https://github.com/denoland/deno/issues/28125

Additionally "FORCE_COLOR" env var can now be accessed 
without `--allow-env` check.
---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-28 14:28:01 +00:00
Yoshiya Hinosawa
84b192ee5d
fix(ext/node): fix deepStrictEqual(-0, 0) (#29060) 2025-04-27 22:19:36 +09:00
Luca Casonato
733ffd9dd9
fix(otel): recording metrics with more than 3 attributes (#28898)
We were calling `op_otel_metric_attribute3` with the wrong arguments.
2025-04-26 20:15:21 +02: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
Lach
ec8e683de9
fix(otel): support attributes on links and events (#28584) 2025-04-25 18:26:33 +02: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
Yoshiya Hinosawa
a44ed9bbe4
chore(ext/node): pass v8 flags (--expose-gc and --expose-externalize-string) to node test script (#29046) 2025-04-25 21:22:25 +09:00
Lucas Wasilewski
9ed2fad9ed
feat(ext/http): Show that is also listening on localhost (#28171)
Closes #27722

This will show `Listening on http://0.0.0.0:8000 (http://localhost:8000)`

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-25 08:36:20 +00:00
Bert Belder
90e90cda34
feat: code sign deno.exe (#28963)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-04-25 08:27:12 +02:00
ctrl+d
cf02f770aa
fix(ext/node): fix handling of abort signal in readFile (#29028)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-25 14:48:12 +09:00
David Sherret
2eeccf1045
fix(compile): use a memory mapped file for fallback (#29039) 2025-04-24 17:19:52 +00:00
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
snek
d843a93e65
fix: fix bugs with rendering of authority in serve urls (#29009)
- preserve authority from protocol
- reject some invalid combinations of request lines (e.g. `GET *`)
- modify rendering of OPTIONS and CONNECT so that they don't cause `new
URL` to raise.
2025-04-23 11:23:15 +02:00
Sebastien Guillemot
40c5dff82f
fix(ext/node): update node version in process object (#27044)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-23 10:55:32 +09:00
Jim Buzbee
1feb2b6421
fix(ext/node): honor flags with respect to reuseAddress when binding to a UDP socket (#28156)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-04-22 17:49:14 +09: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
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
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