1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-08 23:28:18 -05:00
Commit graph

7029 commits

Author SHA1 Message Date
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
Kitson Kelly
7cabd02c59
fix(kv): improve backoff error message and inline documentation (#27537)
Ref: #27536
2025-01-04 00:04:14 +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
David Sherret
225c3dea87
refactor: update some fs_util functions to use sys_traits (#27515)
This is in preparation for extracting out these functions from the CLI
crate.

A side benefit is these functions will now work in Wasm.
2025-01-02 10:06:12 -05:00
David Sherret
9215aa60a6
refactor(node/npm): separate out permission check from npm resolvers (#27511)
Decouples permissions from the npm resolvers (towards moving the
resolvers out of the cli crate)
2025-01-02 10:05:52 -05:00
Nayeem Rahman
79c0b2ce73
fix(lsp): css preprocessor formatting (#27526) 2025-01-02 13:31:47 +00:00
David Sherret
8e618e1b2a
fix(npm): deterministically output tags to initialized file (#27514)
The tags were being sorted in a random order due to the package_reqs
hashmap
2024-12-31 20:36:57 +00:00
Kenta Moriuchi
8fb073d7b4
chore: Happy New Year 2025 (#27509) 2024-12-31 19:12:39 +00:00
David Sherret
ac7b33a340
chore: cargo fmt - turn on group_imports=StdExternalCrate (#26646) 2024-12-31 12:13:39 -05:00
David Sherret
4638caa740
refactor: do not use deno_fs::FileSystem everywhere (#27508)
This changes the cli to mostly use `std::fs` via `sys_traits` instead of
the implemention of `deno_fs::FileSystem`.
2024-12-31 11:29:07 -05:00
Je Xia
7b491a28df
fix(node): Add missing inspector/promises (#27491)
Add missing `inspector/promises` in node builtin module list, that
causes types checking error.
2024-12-31 11:06:21 +01:00
Marvin Hagemeister
a844d96ee9
chore(lint): remove manual AST field counter (#27449)
Addresses the review feedback in
https://github.com/denoland/deno/pull/27416 .

- Hoist the buffer max size variable to make it less confusing
- Remove manual AST field counter in favour of an explicit "commit
schema" step which writes the actual field count.
2024-12-31 08:59:41 +01:00
David Sherret
c391ad315e
refactor: use sys_traits (#27480) 2024-12-30 12:38:20 -05:00
Marvin Hagemeister
fdd0edf23c
fix(unstable): don't error on non-existing attrs or type attr (#27456)
When running selectors for JS linting plugins we would error when
encountering an unknown attribute name:

```js
// selector
Foo[non-existant]

// error
Error: Missing string id: <number>
```

This was caused by using `0` as the invalid marker, but also overloading
`0` with an actual node type. So the fix is to reserve `0` as the
invalid marker and move the property type to the next index.
2024-12-27 22:46:29 +01: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
Marvin Hagemeister
1a809b8115
feat(unstable): support selectors in JS lint plugins (#27452)
This PR adds support for using selectors in the JS linting plugin API.
Supported at the moment are:

- `Foo Bar` (descendant)
- `Foo > Bar` (child combinator)
- `Foo + Foo` (next sibling)
- `Foo ~ Foo` (subsequent sibling)
- `[attr]`, `[attr=value]` (attribute selectors, supported operators:
`=`, `!=`, `<`, `>`, `<=`, `>=`)
- `:first-child`
- `:last-child`
- `:nth-child(2)`, `:nth-child(2n + 1)`
2024-12-23 08:45:47 +01:00
Marvin Hagemeister
26425a137b
feat(unstable): add JS linting plugin infrastructure (#27416)
This PR extracts the core part of
https://github.com/denoland/deno/pull/27203 to make it easier to review
and land in parts.

It contains:
-  The JS plugin code the deserializes and walks the buffer
- The Rust portion to serialize SWC to the buffer format (a bunch of
nodes are still todos, but imo these can land anytime later)
- Basic lint plugin types, without the AST node types to make this PR
easier to review
- Added more code comments to explain the format etc.


More fixes and changes will be done in follow-up PRs.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-12-21 00:58:03 +01:00
David Sherret
ece718eb3e
perf: upgrade to deno_semver 0.7 (#27426) 2024-12-20 21:14:37 +00:00
Bartek Iwańczuk
c30f3450c6
perf: don't store duplicate info for ops in the snapshot (#27430)
Mostly for changes from https://github.com/denoland/deno_core/pull/1010

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2024-12-20 17:43:03 +00:00
snek
65b647909d
feat(unstable): Implement QUIC (#21942)
Implements a QUIC interface, loosely based on the WebTransport API (a
future change could add the WebTransport API, built on top of this one).

[quinn](https://docs.rs/quinn/latest/quinn/) is used for the underlying
QUIC implementation, for a few reasons:
- A cloneable "handle" api which fits quite nicely into deno resources.
- Good collaboration with the rust ecosystem, especially rustls.
- I like it.

<!--
Before submitting a PR, please read https://deno.com/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
7. Open as a draft PR if your work is still in progress. The CI won't
run
   all steps, but you can add '[ci]' to a commit message to force it to.
8. If you would like to run the benchmarks on the CI, add the 'ci-bench'
label.
-->
2024-12-20 13:48:48 +01:00
Nayeem Rahman
feb94d09e7
fix(lsp): rewrite imports for 'Move to a new file' action (#27427) 2024-12-20 02:33:35 +00:00
David Sherret
3c147d6be1
fix(publish): infer literal types in const contexts (#27425)
* https://github.com/denoland/deno_graph/pull/555
2024-12-19 18:53:33 +00: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
Sean McArthur
b1c685f4b7
fix(ext/fetch): retry some http/2 errors (#27417)
This brings some of the HTTP/2 retry behavior from reqwest to
`ext/fetch`. It will retry very specific HTTP/2 errors once, if the body
is able to be used again.

Closes #27332
2024-12-18 23:04:29 +01: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
Nayeem Rahman
2820ba1e22
fix(lsp): include "node:" prefix for node builtin auto-imports (#27404) 2024-12-17 18:55:17 +00:00
Bartek Iwańczuk
f9add94e17
refactor(lint): renames and code flattening (#27386)
Working on loading plugin configuration for
https://github.com/denoland/deno/pull/27203
I encountered a lot of complexity, so did some drive-by cleanups to make
it easier to grok the code and have fewer duplicate names.
2024-12-17 01:35:26 +00:00
David Sherret
59f263409e
refactor: use capacity_builder for writing deno compile data section (#27393) 2024-12-16 19:20:53 -05:00
David Sherret
95928c46eb
refactor: extract out FileFetcher to deno_cache_dir (#27263) 2024-12-16 23:39:40 +00:00
Nayeem Rahman
358bf566c2
fix(lsp): respect "typescript.suggestionActions.enabled" setting (#27373) 2024-12-16 17:25:49 +00:00
Divy Srivastava
f9f5a12a16
fix: upgrade deno_doc to 0.161.3 (#27377)
upgrades itoa requirement to `1.0.14`. needed for #27308
2024-12-16 10:12:07 -05: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
Divy Srivastava
50871b2aa3
fix: FastString v8_string() should error when cannot allocated (#27375)
Upgrades deno_core to 0.326.0
2024-12-16 13:51:49 +00:00
Bartek Iwańczuk
7949f53cab
refactor: add 'sync' feature to deno_resolver crate (#27357) 2024-12-15 09:18:04 +01: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
Nayeem Rahman
32b57f7b82
fix(lsp): sql and component file formatting (#27350) 2024-12-13 14:14:55 +00:00
David Sherret
4cfa34052d
fix(compile): analyze modules in directory specified in --include (#27296)
I ended up changing the file system implementation to determine
its root directory as the last step of building it instead of being the
first step which makes it much more reliable.
2024-12-12 18:07:35 +00:00
snek
5f8be055db
refactor(unstable): otel configuration (#27333)
split up otel config into user configurable and runtime configurable
parts. user configurable part is now set via env vars parsed according
to the otel spec. otel is now enabled via `OTEL_DENO=true`, and
`--unstable-otel` only acts as a guard.

Fixes: https://github.com/denoland/deno/issues/27273
2024-12-12 09:17:26 +01:00
David Sherret
c6fa62896d
fix(compile): output contents of embedded file system (#27302) 2024-12-11 09:40:50 -05:00
denobot
9df6be8916
chore: forward v2.1.4 release commit to main (#27329)
This is the release commit being forwarded back to main for 2.1.4

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-12-11 12:47:31 +00:00
Nathan Whitaker
6f506208f6
feat(unstable): support caching npm dependencies only as they're needed (#27300)
Currently deno eagerly caches all npm packages in the workspace's npm
resolution. So, for instance, running a file `foo.ts` that imports
`npm:chalk` will also install all dependencies listed in `package.json`
and all `npm` dependencies listed in the lockfile.

This PR refactors things to give more control over when and what npm
packages are automatically cached while building the module graph.

After this PR, by default the current behavior is unchanged _except_ for
`deno install --entrypoint`, which will only cache npm packages used by
the given entrypoint. For the other subcommands, this behavior can be
enabled with `--unstable-npm-lazy-caching`


Fixes #25782.

---------

Signed-off-by: Nathan Whitaker <17734409+nathanwhit@users.noreply.github.com>
Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-12-10 18:24:23 -08:00
Bartek Iwańczuk
dd42a64c43
refactor(lint): manage schema files for linter in Deno repo (#27324)
This commit provides schema files for lint rules and lint tags
in this repo instead of pulling them from `deno_lint` repository.

A unit test was added to ensure all available rules are listed
in the schema file. A unit test for tags can be done once 
https://github.com/denoland/deno/pull/27162 lands.
2024-12-11 02:06:04 +01:00
Bartek Iwańczuk
7c8b55b584
fix(outdated): error when there are no config files (#27306)
This commit changes "deno outdated" subcommand to
error out if run in a directory that has no config file 
(including parent directories). This matches
"pnpm" behavior.

Also added tests for filtering that yields no results,
to ensure that it exists cleanly, that also matches "pnpm"
behavior.

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

---------

Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-12-10 23:25:29 +00:00