1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-18 13:22:55 -05:00
Commit graph

1388 commits

Author SHA1 Message Date
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
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
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
ingalless
fe1be715d8
chore(tests): Deprecate remaining usages of itest in check tests (#26962)
This PR progresses #22907 by deprecating the usage of `itest` in
`tests/integration/check_tests.rs`
2024-12-10 23:41:24 +01:00
Bartek Iwańczuk
7bab83d6c0
fix(outdated): respect --quiet flag for hints (#27317) 2024-12-10 18:22:42 +00:00
Mohammad Sulaiman
59dd5d21d4
fix: replace the @deno-types with @ts-types (#27310) 2024-12-10 09:52:13 -05:00
Bartek Iwańczuk
c3af09821a
fix(outdated): show a suggestion for updating (#27304)
Show command to update dependencies based on the output
of "deno outdated" command.

Closes https://github.com/denoland/deno/issues/27256
2024-12-10 14:41:16 +01:00
David Sherret
da3a676d1c
fix: do not error when subpath has an @ symbol (#27290)
Closes https://github.com/denoland/deno/issues/27243
2024-12-09 13:19:08 -08:00
Yoshiya Hinosawa
796749c807
test(ext/node): remove flaky node:dgram compat test case (#27249) 2024-12-07 00:30:04 +09:00
Yoshiya Hinosawa
07737b03bc
fix(ext/node): accept file descriptor in fs.readFile(Sync) (#27252)
closes #27123
2024-12-06 20:18:08 +09:00
Yoshiya Hinosawa
1ee13a3544
chore: add script to check remaining node compat cases (#27122) 2024-12-06 15:22:33 +09:00
Nathan Whitaker
ffac282805
fix(install): use locked version of jsr package when fetching exports (#27237)
Fixes #27193.
2024-12-05 18:55:35 +00:00
Marvin Hagemeister
f098dd02f7
fix(task): --recursive option not working (#27183)
We didn't handle the `--recursive` option properly in `deno task`. This
PR addresses that.

Fixes https://github.com/denoland/deno/issues/27174
2024-12-05 19:00:35 +01:00
Yoshiya Hinosawa
3bae68eda6
test(ext/node): fix flaky node/http2.createServer() test (#27208) 2024-12-06 00:25:16 +09:00
Luca Casonato
ae5c743f33
chore: update hickory dns crates (#27137) 2024-12-05 14:11:35 +00:00
ud2
25aed5071f
fix(unstable/temporal): respect locale in Duration.prototype.toLocaleString (#27000)
Adds a temporary polyfill for `Duration.prototype.toLocaleString()`
that will be removed once native support in V8 lands.
2024-12-05 13:55:50 +00:00
Marvin Hagemeister
e8d731c05f
fix(node/worker_threads): data url not encoded properly with eval (#27184)
When using the `eval` option on Node's `worker_threads` the code is
passed as a `data:` URL. But we didn't encode the actual code for that,
which lead to syntax errors when including characters not allowed in an
URL.

Fixes a part of https://github.com/denoland/deno/issues/27167
2024-12-05 14:30:43 +01:00
David Sherret
f0586238fc
fix(task): kill descendants when killing task process on Windows (#27163) 2024-12-04 12:19:06 -05:00
David Sherret
f863a623c9
fix: improve auto-imports for npm packages (#27224)
Improves auto-imports when using `"nodeModulesDir": "auto"`
2024-12-04 12:05:34 -05:00
snek
5c17bb4287
fix(unstable): otel context with multiple keys (#27230)
`SafeMap` treats its argument as an object with a "length" and index
properties, rather than a generic iterator, so every time we cloned it,
it was dropping all the data.
2024-12-04 13:14:37 +00:00
Marvin Hagemeister
120b3811eb
fix(task): don't panic with filter on missing task argument (#27180)
We were panicing when running `deno task --filter foo` without a task
argument.

Fixes https://github.com/denoland/deno/issues/27177
2024-12-04 13:06:09 +01:00
Yoshiya Hinosawa
fb24fd37c9
test: add node compat test cases (#27134)
This PR enables node compat test cases found passing by using the tool
added in #27122

The percentage of passing test case increases from 16.16% to 30.43% by
this change.
2024-12-04 11:37:20 +09:00
Yoshiya Hinosawa
32b4c37c05
test(ext/node): reduce race condition in test case (#27207) 2024-12-04 11:29:31 +09:00
David Sherret
8cd257de3d
refactor: remove CliNpmRegistryApi (#27222)
Extracts more code out of the CLI.
2024-12-03 19:44:56 -05:00
Marvin Hagemeister
d5b63bb642
fix(task): only pass args to root task (#27213)
When we run `deno task` with args like `deno task foo arg` the argument
should only be passed to the root task, not to its dependencies.

Fixes https://github.com/denoland/deno/issues/27206
2024-12-03 16:35:46 +01:00
Marvin Hagemeister
2fbc5fea83
fix(node/fs): support recursive option in readdir (#27179)
We didn't support the `recursive` option of
`fs.readdir()/fs.readdirSync()`.

Fixes https://github.com/denoland/deno/issues/27175
2024-12-03 10:28:20 +01:00
Ian Bull
b78c851a94
refactor(ext/web): align error messages (#25871)
Aligns the error messages in the ext/web folder to be in-line with the
Deno style guide.
2024-12-03 03:30:39 +00:00
David Sherret
70d69a8828
chore: fix cjs_with_deps test to use a temp dir (#27199)
It was creating a node_modules directory.
2024-12-03 02:37:40 +01:00
Bartek Iwańczuk
53936eda11
fix(fmt): stable formatting of HTML files with JS (#27164)
Closes https://github.com/denoland/deno/issues/26407
Closes https://github.com/denoland/deno/issues/26763
Closes https://github.com/denoland/deno/issues/26560
Closes https://github.com/denoland/deno/issues/26744
Closes https://github.com/denoland/deno/issues/27030
2024-12-03 02:04:55 +01:00
snek
7c036772df
feat(unstable): add metrics to otel (#27143)
Refs: https://github.com/denoland/deno/issues/26852

Initial support for exporting metrics.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-12-02 20:45:41 +01:00
Mathias Lykkegaard Lorenzen
f9a6cc3f03
chore: export variables from node compat tools script (#27189) 2024-12-03 00:05:59 +09:00
Bartek Iwańczuk
1d49b3cb0f
fix: support workspace:^ and workspace:~ version constraints (#27096)
This commit adds support for understanding "workpace:^"
and "workspace:~" version constraints in npm/pnpm workspaces.

This is done by upgrading various crates to their latest versions.

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

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-30 00:54:26 +01:00
David Sherret
f6248601f4
fix(task): forward signals to spawned sub-processes on unix (#27141)
Closes https://github.com/denoland/deno/issues/18445
2024-11-29 17:36:43 -05:00
Ian Bull
8626ec7c25
refactor(ext/fs): align error messages (#25414)
Aligns the error messages in the ext/fs folder to be in-line with the
Deno style guide.
2024-11-28 18:47:07 +00:00
Marvin Hagemeister
3553aa9132
fix(publish): error on missing name field (#27131)
This PR improves the error output on publish when the `name` filed is
missing:

```json
{
  "exports": "./mod.ts",
  "version": "0.0.1"
}
```

Before:

```sh
deno publish --dry-run
error: You did not specify an entrypoint in file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json. Add `exports` mapping in the configuration file, eg:
{
  "name": "@scope/name",
  "version": "0.0.0",
  "exports": "<path_to_entrypoint>"
}
```

After:

```sh
deno publish --dry-run
error: Missing 'name' field in 'file:///Users/marvinh/dev/test/deno-pkg-timers/deno.json'.
```

Fixes https://github.com/denoland/deno/issues/27116
2024-11-28 18:11:36 +01:00
Marvin Hagemeister
39722f190a
fix(node/timers): error when passing id to clearTimeout/clearInterval (#27130)
As pointed out in https://github.com/denoland/deno/issues/27126 we used
a variable which could potentially be of type `number` instead of the
`Timeout` class instance. Ensure that we're always setting `_destroyed`
on the class instead instead.

Fixes https://github.com/denoland/deno/issues/27126
2024-11-28 15:11:51 +01:00
Luca Casonato
32e260d55a
fix: support bun specifiers in JSR publish (#24588)
Fixes https://github.com/denoland/deno/issues/26989

---------

Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-11-28 14:51:24 +01:00
Divy Srivastava
1af2d2474e
fix(ext/node): tls.connect socket upgrades (#27125)
Fixes https://github.com/denoland/deno/issues/27087
Fixes https://github.com/denoland/deno/issues/26685
Fixes https://github.com/denoland/deno/issues/26660
2024-11-28 17:59:20 +05:30
Nathan Whitaker
76daa03aa9
fix(info): resolve bare specifier pointing to workspace member (#27020)
Fixes https://github.com/denoland/deno/issues/26721

Previously, we were applying only the import map, which would result in
`@scope/foo` expanding to (e.g.) `jsr:@scope/foo@1.0.0`. Since that
didn't exist it would error and fail to resolve.
2024-11-27 13:54:26 -08:00
David Sherret
6fb0e10252
chore: fix lint step due to node compat test changes (#27111)
Seems due to merging this:
https://github.com/denoland/deno/actions/runs/12052779514/job/33606893423
2024-11-27 17:20:20 +00:00
Marvin Hagemeister
9bc36aa79b
fix(node/http): casing ignored in ServerResponse.hasHeader() (#27105)
We didn't respect casing when checking if a HTTP header is present in
Node's `ServerResponse.hasHeader()`. This lead to us returning incorrect
results when the header was present. Koa assumed that the `Content-Type`
header wasn't present when it actually was and defaulted to a different
`Content-Type` value.

Fixes https://github.com/denoland/deno/issues/27101
2024-11-27 17:56:13 +01:00
Bartek Iwańczuk
93adf37bdf
fix(task): strip ansi codes and control chars when printing tasks (#27100) 2024-11-27 15:54:15 +00:00
Yoshiya Hinosawa
e943c6a25d
test(ext/node): enable parallel/test-fs-promises-file-handle-stat.js (#27074) 2024-11-27 23:51:23 +09:00
David Sherret
2bbfef137c
feat(unstable): repurpose --unstable-detect-cjs to attempt loading more modules as cjs (#27094)
This resurrects the `--unstable-detect-cjs` flag (which became stable),
and repurposes it to attempt loading .js/.jsx/.ts/.tsx files as CJS in
the following additional scenarios:

1. There is no package.json
1. There is a package.json without a "type" field

Also cleans up the implementation of this in the LSP a lot by hanging
`resolution_mode()` off `Document` (didn't think about doing that until
now).
2024-11-27 09:50:38 -05:00
Divy Srivastava
1e51b650be
perf(ext/webstorage): use object wrap for Storage (#26931)
![image](https://github.com/user-attachments/assets/3f86e2fd-9026-4965-8f3b-512423362f1e)


Depends on:
- https://github.com/denoland/deno_core/pull/970
- https://github.com/denoland/deno_core/pull/976
- https://github.com/denoland/deno_core/pull/980
- https://github.com/denoland/deno_core/pull/981

---------

Signed-off-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-27 16:11:57 +05:30
Leo Kettmeir
7400181ecb
fix(tools/doc): HTML resolve main entrypoint from config file (#27103)
Fixes #26901
2024-11-27 02:15:15 -08:00
Marvin Hagemeister
927352bd4e
fix(node/fs): add missing stat path argument validation (#27086)
We didn't validate the `path` argument that's passed to `fs.stat()` and
`fs.statSync()` which lead to wrong errors being thrown. The
`@rollup/plugin-node-resolve` code calls it with `undefined` quite a lot
which lead to `nitro` and `nuxt` failing.

Fixes https://github.com/denoland/deno/issues/26700

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-11-27 08:35:39 +01:00
Leo Kettmeir
42b71d82db
chore(lint): add .out file reference checker (#27078)
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-26 20:53:20 -08:00