0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-07 23:06:50 -05:00
Commit graph

1903 commits

Author SHA1 Message Date
Nayeem Rahman
bc8554878e
fix(check): support sloppy imports with "compilerOptions.rootDirs" (#27973) 2025-02-05 23:08:10 +00:00
David Sherret
408d581fc1
chore: fix lockfile on main (#27978)
Every time I run `cargo test` or whatever the lockfile changes to this.
2025-02-05 19:03:45 +00:00
Bartek Iwańczuk
f08ca6414b
feat(lint): add JavaScript plugin support (#27203)
This commit adds an unstable lint plugin API.

Plugins are specified in the `deno.json` file under
`lint.plugins` option like so:

```
{
  "lint": {
    "plugins": [
      "./plugins/my-plugin.ts",
      "jsr:@deno/lint-plugin1",
      "npm:@deno/lint-plugin2"
    ]
  }
}
```

The API is considered unstable and might be subject
to changes in the future.

Plugin API was modelled after ESLint API for the 
most part, but there are no guarantees for compatibility.
The AST format exposed to plugins is closely modelled
after the AST that `typescript-eslint` uses.

Lint plugins use the visitor pattern and can add
diagnostics like so:

```
export default {
  name: "lint-plugin",
  rules: {
    "plugin-rule": {
      create(context) {
        return {
          Identifier(node) {
            if (node.name === "a") {
              context.report({
                node,
                message: "should be b",
                fix(fixer) {
                  return fixer.replaceText(node, "_b");
                },
              });
            }
          },
        };
      },
    },
  },
} satisfies Deno.lint.Plugin;
```

Besides reporting errors (diagnostics) plugins can provide
automatic fixes that use text replacement to apply changes.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
Co-authored-by: David Sherret <dsherret@gmail.com>
2025-02-05 16:59:24 +01:00
Hajime-san
1eb4142143
feat(ext/canvas): enhance createImageBitmap specification compliance (#25517) 2025-02-05 04:10:11 -08:00
Nathan Whitaker
b440d2d4f7
feat(outdated): interactive update (#27812)
interactively select which packages to upgrade. a future improvement
could be to add a way to select the version as well, though not sure how
valuable that would be.
2025-02-04 15:41:56 -08:00
Divy Srivastava
28834a89bb
fix(ext/node): implement SQLite Session API (#27909)
https://nodejs.org/api/sqlite.html#class-session

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-02-04 21:59:13 +05:30
David Sherret
8971064546
feat: TypeScript 5.7 (#27857)
Co-authored-by: Kenta Moriuchi <moriken@kimamass.com>
2025-01-31 16:07:42 -05:00
denobot
d9db0b35e0
chore: forward v2.1.9 release commit to main (#27888)
This is the release commit being forwarded back to main for 2.1.9

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-31 03:02:00 +01:00
denobot
1b7719c5d6
chore: forward v2.1.8 release commit to main (#27882)
This is the release commit being forwarded back to main for 2.1.8

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-30 21:09:06 +01:00
Divy Srivastava
5c2fc88ba6
fix(core): Fix create_stack_trace from empty trace (#27873)
Fixes https://github.com/denoland/deno/issues/27849
2025-01-30 18:12:44 +05:30
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
Bartek Iwańczuk
a5a1cce50d
feat(ext/cache): support lscache (#27628)
This commit adds support for lscache backend for
the Web cache API.

The cache cab be configured using `DENO_CACHE_LSC_ENDPOINT`
env var.
2025-01-28 18:51:06 +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
Divy Srivastava
aeac5a6338
feat(ext/node): implement node:sqlite (#27308)
Depends on:
- https://github.com/denoland/deno_core/pull/994
- https://github.com/denoland/deno_core/pull/993
- https://github.com/denoland/deno_core/issues/999
- https://github.com/denoland/deno_core/pull/1000
- https://github.com/denoland/deno_core/pull/1001

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


![image](https://github.com/user-attachments/assets/396fc8b7-30cb-411c-82bc-2e9e3e6bbb18)

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2025-01-28 19:30:03 +05:30
Nathan Whitaker
094e268002
fix(ext/node): implement aes-128-ctr, aes-192-ctr, and aes-256-ctr (#27630)
Fixes https://github.com/denoland/deno/issues/24864

Need to add some tests, also unsure about the right counter size (went
with 128 bit to be safe)

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2025-01-27 23:35:51 -08:00
David Sherret
679902a108
perf(node_resolver): reduce url to/from path conversions (#27839)
Extracted out of https://github.com/denoland/deno/pull/27838/files

Reduces some allocations by accepting either a pathbuf or url for the
referrer for resolution and returning either a pathbuf or url at the
end, which the caller can then convert into to their preferred state.

This is about 4% faster when still converting the final result to a url
and 6% faster when keeping the result as a path in a benchmark I ran.
2025-01-27 15:23:20 -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
David Sherret
48e86c7025
chore: fix deno_resolver non-sync build (#27824) 2025-01-27 15:28:33 +00:00
Divy Srivastava
8ccc05e503
fix(core): handle dyn imports exceeding call stack size (#27825)
Fixes https://github.com/denoland/deno/issues/27736
2025-01-27 09:10:12 +05:30
Cre3per
be080784dd
fix(ext/fetch): update h2 to fix sending a PROTOCOL_ERROR instead of REFUSED_STREAM when receiving oversized headers (#27531)
Fixes #26490

Related PR in h2 https://github.com/hyperium/h2/pull/792  
Related release of h2 https://github.com/hyperium/h2/releases/tag/v0.4.6
2025-01-26 23:04:53 +00:00
David Sherret
e475749935
refactor: make PackageJsonCache injectable (#27800)
This used to be complicated to do, but is now trivial.
2025-01-24 09:50:25 -05:00
Yoshiya Hinosawa
3d8834f957
chore: update ensure_registry_files_local to handle scoped packages (#27801) 2025-01-24 21:47:15 +09:00
Bartek Iwańczuk
0697578d3e
feat(lint): add rules for react/preact (#27162)
This commit updated to deno_lint 0.69.0, which adds a bunch
or new lint rules dedicated for react/preact users.
2025-01-24 13:08:36 +01:00
David Sherret
273ec9fbf2
refactor: add WorkspaceFactory and ResolverFactory (#27766)
Allows easily constructing a `DenoResolver` using the exact same logic
that we use in the CLI (useful for dnt and for external bundlers). This
code is then used in the CLI to ensure the logic is always up-to-date.

```rs
use std::rc::Rc;

use deno_resolver:🏭:ResolverFactory;
use deno_resolver:🏭:WorkspaceFactory;
use sys_traits::impls::RealSys;

let sys = RealSys;
let cwd = sys.env_current_dir()?;
let workspace_factory = Rc::new(WorkspaceFactory::new(sys, cwd, Default::default()));
let resolver_factory = ResolverFactory::new(workspace_factory.clone(), Default::default());
let deno_resolver = resolver_factory.deno_resolver().await?;
```
2025-01-23 18:52:55 -05:00
David Sherret
563a7c284e
refactor: use DataUrl from deno_media_type (#27783)
This was moved from deno_graph to deno_media_type.
2025-01-22 20:35:16 +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
denobot
3ba212649f
chore: forward v2.1.7 release commit to main (#27767)
This is the release commit being forwarded back to main for 2.1.7

Please ensure:
- [x] Everything looks ok in the PR
- [x] The release has been published

To make edits to this PR:
```shell
git fetch upstream forward_v2.1.7 && git checkout -b forward_v2.1.7 upstream/forward_v2.1.7
```

Don't need this PR? Close it.

cc @crowlKats

---------

Co-authored-by: crowlKats <crowlKats@users.noreply.github.com>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
2025-01-21 19:25:12 -08:00
Dimitris Apostolou
6ba99be819
fix(deps): update yanked crates (#27512)
Update yanked crates `bytemuck`, `futures-util`, `pest`, `pest_derive`
and `url`.
2025-01-20 21:47:14 -08:00
David Sherret
9aa02769c8
perf(compile): remove swc from denort (#27721)
This is achieved by storing CJS export analysis ahead of time in the
executable, which should also improve the performance of `denort` by
this never being done anymore (I'm too lazy atm to bench this, but it
will be significant for some programs).
2025-01-19 14:23:07 -05: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
Leo Kettmeir
054075730c
refactor: update deno_core and use more concrete errors (#27620)
waiting for https://github.com/denoland/deno_core/pull/1043

Fixes #27672
2025-01-17 09:41:52 -08:00
Bartek Iwańczuk
0050857f51
refactor: add 'deno_process' crate (#27680)
Untangled the whole `runtime/ops/process.rs` from `ext/node/` and moved
to a separate `ext/process` crate.
2025-01-17 13:30:14 +01:00
denobot
94dc5b16f5
chore: forward v2.1.6 release commit to main (#27705)
This is the release commit being forwarded back to main for 2.1.6

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2025-01-17 02:09:13 +01:00
David Sherret
05dc69932d
refactor: create deno_lib crate (#27673)
Shifts just some code down for now. I'll do the rest of the refactor in
the next pr, but didn't want to drop a huge refactor.
2025-01-15 09:35:46 -05:00
Bartek Iwańczuk
974e2f44b2
refactor: add 'deno_os' crate (#27655)
This commit creates "deno_os" extension crate and moves
numerous ops from "runtime/" crate to the new crate.
2025-01-14 17:29:36 +01:00
David Sherret
0b033140c0
refactor: move CliNpmResolver to deno_resolver::npm::NpmResolver (#27659)
As title. After this PR all npm resolution will be out of the CLI crate.
2025-01-14 10:01:05 -05:00
David Sherret
1e95c20561
refactor: deno_config 0.45 (#27660) 2025-01-14 13:00:31 +01:00
David Sherret
9dbb99a83c
refactor: create NpmInstaller (#27626)
This separates npm resolution code from npm installation (more work
towards moving resolution code out of the CLI and cleaning up this
code).
2025-01-13 17:35:18 -05:00
David Sherret
c27248a8f3
refactor: remove CliNpmReqResolver trait in deno_resolver (#27616) 2025-01-10 14:48:43 -05:00
David Sherret
475793f94d
refactor: implement NpmPackageFolderResolver in deno_resolver (#27614) 2025-01-10 00:01:47 +00:00
denobot
8bafb182ef
chore: forward v2.1.5 release commit to main (#27613)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2025-01-09 17:38:18 -05:00
David Sherret
093f3ba565
refactor(npm): extract out some npm fs resolution code from the cli (#27607)
Moves the npm fs resolvers into the deno_resolution crate.

This does not entirely move things out, but is a step in that direction.
2025-01-09 12:10:07 -05: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
Tatsuya Kawano
814da49dff
fix(ext/net): update moka cache to avoid potential panic in Deno.resolveDns on some laptops with Ryzen CPU (#27572) 2025-01-08 16:48:23 -05:00
David Sherret
fc2788bfd7
fix(jsr): Wasm imports fail to load (#27594)
* https://github.com/denoland/deno_graph/pull/562

Closes https://github.com/denoland/deno/issues/27593
2025-01-08 19:46:15 +00:00
David Sherret
3f5cad38aa
fix(no-slow-types): handle rest param with internal assignments (#27581)
Closes #27575
2025-01-07 12:34:34 -08: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