0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-01 12:16:11 -05:00
Commit graph

548 commits

Author SHA1 Message Date
David Sherret
8971064546
feat: TypeScript 5.7 (#27857)
Co-authored-by: Kenta Moriuchi <moriken@kimamass.com>
2025-01-31 16:07:42 -05:00
Yoshiya Hinosawa
7643bb71a6
chore: update std in test util (#27892) 2025-01-31 08:52:32 -05:00
Marvin Hagemeister
c44b05cab5
feat(task): add support for task wildcards (#27007)
This PR adds support for passing wildcard tasks. All matched tasks are
sorted in case they have dependencies. Tasks already in the dependency
tree will be pruned so that every task only runs once.

```json
{
  "tasks": {
    "foo-1": "echo 'foo-1'",
    "foo-2": "echo 'foo-2'"
  }
}
```

```sh
$ deno task "foo-*"
Task foo-1 echo 'foo-1'
foo-1
Task foo-2 echo 'foo-2'
foo-2
```

The changes in the PR look a little bigger than they really are due to
formatting. For the most part, I've only needed to hoist up the task
matching logic.

Closes https://github.com/denoland/deno/issues/26944
Closes https://github.com/denoland/deno/issues/21530

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-30 14:37:10 +01:00
Nayeem Rahman
0dd334b512
feat(check/lsp): support "compilerOptions.rootDirs" (#27844) 2025-01-30 00:20:25 +00:00
snek
0098fddb10
feat(unstable): WebTransport (#27431)
Initial implementation of WebTransport client and server!

This is very unstable because the interface should eventually shift to
use hyper (h3 is on the [2025
roadmap](https://hyper.rs/contrib/roadmap/)) instead of manually messing
with the the protocol, which will enable integration with
Deno.serveHttp/etc and allow WebTransport over h2. This will also let us
expose multiplexing.

WebTransport stats will be a followup due to their complexity.

Fixes: https://github.com/denoland/deno/issues/9017
2025-01-29 14:39:12 +00:00
David Sherret
7528c7909c
fix(check): better handling of TypeScript in npm packages for type checking (#27853)
1. Allows resolving to `.ts` files for type checking.
2. Probes for `.ts` files to use for type checking.

To emphasize, this is only for type checking.
2025-01-28 20:32:37 +00:00
snek
02ed300525
feat(node:http): add http information support (#27381)
Implements some client and server events to improve compat.

Fixes: https://github.com/denoland/deno/issues/27239
2025-01-28 17:37:53 +00:00
David Sherret
4648fc4570
fix(check): compiler options from workspace members (#27785)
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2025-01-28 10:49:58 -05:00
David Sherret
9931fb5cad
chore: fix two locally failing on windows tests (#27845) 2025-01-28 10:46:43 -05:00
jia wei
c7cc6aeecd
fix(npmrc): merge .npmrc in user's homedir and project (#27119) 2025-01-28 15:25:50 +00:00
Divy Srivastava
5c64146bea
fix(ext/node): clear tz cache when setting process.env.TZ (#27826) 2025-01-28 18:13:41 +05:30
Yoshiya Hinosawa
0e47205ebe
fix(ext/node): do not apply socket-init-workaround to ipc socket (#27779)
This PR resolves 2 issues of Socket class of node compat (both are
related to playwright)

Currently `browser.launch()` of playwright is not working.
`browser.launch` opens PipeTransport (which is based on Pipe/IPC socket)
with the browser process. But that pipe doesn't start reading the data
because of the workaround #27662 (which pauses the socket at the
beginning if it's from playwright-core). This PR fixes this issue by
checking whether the given handle is `ipc` handle or not.

Another issue is that sock-init-workaround for TLS connection stopped
working at #27707 because of the changes of TLS socket initialization
steps. This change fixes the issue by correctly returning the function
in workaround path.

The added case `specs::npm::playwright_compat` checks both fixes with
actual playwright and playwright-core packages.

`browser.launch` issues
closes #16899
closes #27623 

`https.request` issue
closes #27658
2025-01-28 15:38:45 +09:00
David Sherret
92dce12af7
fix(install/global): warn about not including auto-discovered config file (#27745)
Closes #17855
2025-01-27 14:18:27 -05:00
Marvin Hagemeister
21e8260cc9
fix(lint): update jsx/react related rules and names (#27836)
This PR updates `deno_lint` which contains a couple of bug fixes for
JSX/React related rules. The react rules now have all a `react-*` prefix
in the name as well.
2025-01-27 16:54:35 +00:00
Yoshiya Hinosawa
2511458ac1
fix(ext/node): npm:mqtt compatibility (#27792) 2025-01-27 11:47:32 +09:00
David Sherret
769f748dd9
fix(node): align type stripping in node_modules error message with Node (#27809) 2025-01-24 13:05:04 -05:00
HasanAlrimawi
b70aba6bae
feat(compile): show remote modules and metadata size when compiling (#27415)
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-01-23 16:55:50 +00:00
snek
32eb991ef8
feat(unstable): support https otlp endpoints (#27743)
Support HTTPS protocol for otel exporting. Includes support for
`OTEL_EXPORTER_OTLP_CERTIFICATE`, `OTEL_EXPORTER_OTLP_CLIENT_KEY`, and
`OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE`

Fixes: https://github.com/denoland/deno/issues/27703
2025-01-22 13:07:04 +00:00
Yoshiya Hinosawa
773825aeb9
fix(ext/node): fix formatting of debug logs (#27772) 2025-01-22 20:13:13 +09:00
Ian Bull
c930e13ff1
chore: note in flags output that unstable is deprecated (#27334) 2025-01-21 19:25:46 -08:00
David Sherret
0d3d4f5466
fix(install/global): remove importMap field from specified config file (#27744)
Closes https://github.com/denoland/deno/issues/27734
2025-01-20 16:50:34 -05:00
Luca Casonato
5e9b3712de
feat(unstable): add basic support for otel trace links (#27727)
Currently only links with no attributes.
2025-01-20 15:39:59 +01:00
David Sherret
57dd66ec3d
refactor: move denort to separate crate (#27688)
This slightly degrades the performance of CJS export analysis on
subsequent runs because I changed it to no longer cache in the DENO_DIR
with this PR (denort now properly has no idea about the DENO_DIR). We'll
have to change it to embed this data in the binary and that will also
allow us to get rid of swc in denort (will do that in a follow-up PR).
2025-01-17 20:39:29 +00: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
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
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
David Sherret
1e95c20561
refactor: deno_config 0.45 (#27660) 2025-01-14 13:00:31 +01:00
David Sherret
2a2b39eb2e
fix(compile): store embedded fs case sensitivity (#27653) 2025-01-13 12:02:37 -05: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
David Sherret
f6dcc13537
fix(regression): show bare-node-builtin hint when using an import map (#27632) 2025-01-11 01:39:43 +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
Luca Casonato
f483996658
feat(unstable): no config npm:@opentelemetry/api integration (#27541)
After this PR, one does not need to import `jsr:@deno/otel` anymore.
2025-01-06 17:00:32 +01:00
Luca Casonato
4b35ba6b13
feat(unstable): replace SpanExporter with TracerProvider (#27473) 2025-01-06 14:28:29 +01:00
David Sherret
89c92b84fa
fix(check): move module not found errors to typescript diagnostics (#27533)
Instead of hard erroring, we now surface module not found errors as
TypeScript diagnostics (we have yet to show the source code of the
error, but something we can improve over time).
2025-01-03 21:49:56 +00:00
Nayeem Rahman
18b813b93f
fix(check): line-break between diagnostic message chain entries (#27543) 2025-01-03 18:30:41 +00:00
David Sherret
2092f0c697
fix(permissions): implicit --allow-import when using --cached-only (#27530)
`--cached-only` cannot communicate with a remote server

Closes https://github.com/denoland/deno/issues/27498
2025-01-02 16:55:03 -05:00
Kenta Moriuchi
8fb073d7b4
chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
Luca Casonato
f4e321342f
feat(unstable): add OTEL MeterProvider (#27240)
This commit replaces `Deno.telemetry.MetricsExporter` with
`Deno.telemetry.MeterProvider`.

Signed-off-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: snek <snek@deno.com>
2024-12-26 09:01:39 +01:00
David Sherret
e6869d7fa6
fix(node): handle cjs exports with escaped chars (#27438)
Closes https://github.com/denoland/deno/issues/27422
2024-12-21 10:00:18 -05:00
Marvin Hagemeister
351e79642a
fix(task): support tasks without commands (#27191)
Support running tasks that have no command and only dependencies. This
is useful for when you want to group tasks only.
2024-12-19 18:10:58 +00:00
David Sherret
074444ab6c
fix(compile): be more deterministic when compiling the same code in different directories (#27395)
Additionaly, this no longer unnecessarily stores the source twice for
file specifiers and fixes some sourcemap issues.

Closes https://github.com/denoland/deno/issues/27284
2024-12-19 12:53:52 -05:00
Yoshiya Hinosawa
350d9dce41
fix(ext/node): do not exit worker thread when there is pending async op (#27378)
This change fixes the premature exit of worker threads when there are still
remaining pending ops.

This change reuses the idea of #22647 (unref'ing `op_worker_recv_message` in
worker threads if closeOnIdle specified) and uses
`web_worker.has_message_event_listener` check in the opposite way as
#22944. (Now we continue the worker when `has_message_event_listener` is
true instead of stopping it when `has_message_event_listener` is false.

closes #23061
closes #26154
2024-12-19 17:39:20 +09:00
Bartek Iwańczuk
14e4064986
fix(task): properly handle task name wildcards with --recursive (#27396)
This commit fixes `deno task` by checking if the provided
task name actually has a wildcard char ("*").

Previously, if the "--recursive" flag was passed, the task name
was treated as a regex, which lead to a situation where exact task
name resulted in a regex that matched all tasks with the specific
prefix.

This commit fixes it, by checking if the provided task name, is an exact
name, or is it a wildcard match.

Closes https://github.com/denoland/deno/issues/27370
Closes https://github.com/denoland/deno/issues/27401
Closes https://github.com/denoland/deno/issues/27408
2024-12-18 03:32:37 +01:00
Nathan Whitaker
9d7174e434
fix(outdated): ensure "Latest" version is greater than "Update" version (#27390)
Fixes #27038.

Previously, for NPM packages the latest version was the version with the
"latest" tag. For JSR packages, the latest version was the greatest
version that matched a `*` version requirement. Unfortunately, that
doesn't work well with pre-release versions.

This PR changes it so that the latest version is always > the currently
requested version.
For NPM: if "latest" tag > current then "latest" tag; otherwise the
greatest version that is >= current
For JSR: greatest version >= current

This is the most reasonable behavior I could come up with. For example,

```
versions:
2.0.0-beta.2
2.0.0-beta.1
1.0.0 => "latest" tag

with a version req `^2.0.0-beta.1`

previously:
"Update" column => 2.0.0-beta.2
"Latest" column => 1.0.0

now:
"Update" column => 2.0.0-beta.2
"Latest" column => 2.0.0-beta.2
```
2024-12-17 23:56:03 +00:00
David Sherret
95928c46eb
refactor: extract out FileFetcher to deno_cache_dir (#27263) 2024-12-16 23:39:40 +00:00
David Sherret
75945cbb86
fix(compile): display embedded file sizes and total (#27360)
Merging as a fix so that LTS gets this as it's a useful diagnostic tool.

The 1MB unique is because we deduplicate files that we store (ex. some
packages have the same file multiple times so we store that once).
2024-12-16 09:37:39 -05:00
Nathan Whitaker
9d315f27ed
fix(outdated): support updating dependencies in external import maps (#27339)
Fixes #27331.

The support for it was already in `outdated`, but forgot to wire up the
updating part

Needs #27337
2024-12-13 12:25:05 -08:00
Nathan Whitaker
3946956b8c
fix(lockfile): include dependencies listed in external import map in lockfile (#27337) 2024-12-13 10:19:37 -08:00