1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-01 16:51:13 -05:00
Commit graph

12649 commits

Author SHA1 Message Date
Leo Kettmeir
1bdecc8c73
refactor(runtime/permissions): use concrete error types (#26464) 2024-11-06 00:36:25 +01:00
Kenta Moriuchi
3bded14144
chore: update dlint to v0.68.0 for internal (#26711) 2024-11-06 00:36:24 +01:00
Nayeem Rahman
2be26f8ee3
perf(lsp): don't walk coverage directory (#26715) 2024-11-06 00:36:24 +01:00
Nathan Whitaker
01c4a2e989
fix(add): only add npm deps to package.json if it's at least as close as deno.json (#26683)
Fixes https://github.com/denoland/deno/issues/26653
2024-11-06 00:36:24 +01:00
David Sherret
c5887708a9
fix: improved support for cjs and cts modules (#26558)
* cts support
* better cjs/cts type checking
* deno compile cjs/cts support
* More efficient detect cjs (going towards stabilization)
* Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only
done after loading
* Support `import x = require(...);`

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-06 00:36:24 +01:00
Divy Srivastava
2e70376451
chore: upgrade to rust 1.82 and LLVM 19 (#26615)
Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because
`requestAdapter` not working on new ubuntu 24 runners
2024-11-06 00:36:24 +01:00
Nathan Whitaker
124b28ab63
fix(cli): set npm_config_user_agent when running npm packages or tasks (#26639)
Fixes #25342.

Still not sure on the exact user agent to set (should it include
`node`?).

After this PR, here's the state of running some `create-*` packages
(just ones I could think of off the top of my head):

| package                  | prints/runs/suggests deno install | notes |
| ---------------- | ------------- | ------ |
| `create-next-app` |  | falls back to npm, needs a PR
([code](c32e280209/packages/create-next-app/helpers/get-pkg-manager.ts (L3)))
| `sv create` |  | uses `package-manager-detector`, needs a PR
([code](https://github.com/antfu-collective/package-manager-detector/tree/main))
| `create-qwik` |  | runs `deno install` but suggests `deno start`
which doesn't work (should be `deno task start` or `deno run start`)
| `create-astro` |  | runs `deno install` but suggests `npm run dev`
later in output, probably needs a PR
| `nuxi init` |  | deno not an option in dialog, needs a PR
([code](f04e2e8944/src/commands/init.ts (L96-L102)))
| `create-react-app` |  | uses npm
| `ng new` (`@angular/cli`) |  | uses npm
| `create-vite` |  | suggests working deno commands 🎉 
| `create-solid` |   | suggests npm commands, needs PR

It's possible that fixing `package-manager-detector` or other packages
might make some of these just work, but haven't looked too carefully at
each
2024-11-06 00:36:24 +01:00
Nathan Whitaker
8c70b6151a
fix(node): Implement os.userInfo properly, add missing toPrimitive (#24702)
Fixes the implementation of `os.userInfo`, and adds a missing
`toPrimitive` for `tmpdir`. This allows us to enable the corresponding
node_compat test.
2024-11-06 00:36:23 +01:00
Nathan Whitaker
68cee70838
fix(ext/node): resolve exports even if parent module filename isn't present (#26553)
Fixes https://github.com/denoland/deno/issues/26505

I'm not exactly sure how this case comes about (I tried to write tests
for it but couldn't manage to reproduce it), but what happens is the
parent filename ends up null, and we bail out of resolving the specifier
in package exports.

I've checked, and in node the parent filename is also null (so that's
not a bug on our part), but node continues to resolve even in that case.
So this PR should match node's behavior more closely than we currently
do.
2024-11-06 00:36:23 +01:00
Nathan Whitaker
d284d1c6a8
fix(ext/node): convert errors from fs.readFile/fs.readFileSync to node format (#26632)
Fixes the original issue reported in #26404. storybook runs into other
errors after this PR (the new errors will be fixed in other PRs).

Some code used by a dependency of storybook does a [string comparison on
the error
message](ce30b2be34/node-src/lib/getConfiguration.ts (L88-L92))
thrown here to check for a file not found error.
2024-11-06 00:36:23 +01:00
David Sherret
919a96dc37
fix: surface package.json location on dep parse failure (#26665)
Related: https://github.com/denoland/deno/issues/26653
2024-11-06 00:36:23 +01:00
Taku Amano
12c8b80010
fix(coverage): exclude comment lines from coverage reports (#25939) 2024-11-06 00:36:23 +01:00
Pig Fang
8d2012ab95
fix(fmt): fix several HTML and components issues (#26654)
Fix #26245 
Close #26324 
Fix #26508 
Fix #26540 
Fix #26562

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-06 00:36:23 +01:00
Nayeem Rahman
e1ddb7a473
fix(lsp): include unstable features from editor settings (#26655) 2024-11-06 00:36:22 +01:00
Divy Srivastava
13612e7112
fix: clamp smi in fast calls by default (#26506)
Fixes https://github.com/denoland/deno/issues/26480

Ref
d2945fb65b
2024-11-06 00:36:22 +01:00
David Sherret
b9cec00c47
fix: remove permission check in op_require_node_module_paths (#26645) 2024-11-06 00:36:22 +01:00
Nathan Whitaker
0e2a7315b7
fix(ext/node): return this from http.Server.ref/unref() (#26647)
Fixes https://github.com/denoland/deno/issues/26642
2024-11-06 00:36:22 +01:00
HasanAlrimawi
2acbe13668
fix(serve): support serve hmr (#26078)
This PR addresses issue #25600 

Changes:
Updated `fn has_hmr` to check `serve` subcommand and return its hmr
value if found, in order to run the worker in serve mode with
hmr_runner. Thus the hmr event can be dispatched upon changes on the
file served.
2024-11-06 00:36:22 +01:00
McSneaky
f51f192345
docs(console): Update docstrings for install and uninstall (#26623)
When running `deno -h` then `install` and `uninstall` scripts had
description since deno 1 times :)
2024-11-06 00:36:21 +01:00
denobot
b7c282d2f8
2.0.4 (#26630)
Bumped versions for 2.0.4

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-10-30 01:15:35 +01:00
HasanAlrimawi
1019184a18
fix: support watch flag to enable watching other files than the main module on serve subcommand (#26622)
Closes #26618
2024-10-30 00:16:13 +01:00
Yoshiya Hinosawa
36b7f9d9ed
Revert "fix(ext/node): fix dns.lookup result ordering (#26264)" (#26621)
This reverts commit d59599fc18.

Closes #26588
2024-10-30 00:16:13 +01:00
Volker Schlecht
6f6879327c
fix(ext/napi): export dynamic symbols list for {Free,Open}BSD (#26605)
The two BSD ports are reusing the Linux code here.
2024-10-30 00:16:13 +01:00
Volker Schlecht
99febad5e2
fix(ext/node): compatibility with {Free,Open}BSD (#26604)
Ports for both BSDs contain patches to the same effect.
See
https://github.com/freebsd/freebsd-ports/blob/main/www/deno/files/patch-ext_node_ops_fs.rs
and
8644910cae/lang/deno/patches/patch-ext_node_ops_fs_rs
2024-10-30 00:16:12 +01:00
Yoshiya Hinosawa
01085e6c2f
refactor(init): inline routing in deno init --serve template (#26595) 2024-10-30 00:16:12 +01:00
Bartek Iwańczuk
a2dacc7686
Revert "fix(ext/node): use primordials in ext/node/polyfills/https.ts (#26323)" (#26613)
…s` (#26323)"

This reverts commit afb33b3c25.

Reverting because it caused a regression -
https://github.com/denoland/deno/issues/26612.

Closes https://github.com/denoland/deno/issues/26612.
2024-10-30 00:16:12 +01:00
Bartek Iwańczuk
9f9eec1250
fix: provide hints in terminal errors for Node.js globals (#26610)
Add info/hint for terminal errors related to Node.js globals:
- __filename
- __dirname
- Buffer
- global
- setImmediate
- clearImmediate

Closes https://github.com/denoland/deno/issues/17494
2024-10-30 00:16:12 +01:00
David Sherret
4823849520
fix(check): expose more globals from @types/node (#26603)
Extracted out of https://github.com/denoland/deno/pull/26558

Closes https://github.com/denoland/deno/issues/26578
2024-10-30 00:16:12 +01:00
snek
96e931a721
fix: report exceptions from nextTick (#26579)
Fixes: https://github.com/denoland/deno/issues/24713
Fixes: https://github.com/denoland/deno/issues/25855
2024-10-30 00:16:12 +01:00
David Sherret
de610f6201
fix(compile): regression handling redirects (#26586)
Closes https://github.com/denoland/deno/issues/26583
2024-10-30 00:16:12 +01:00
Marvin Hagemeister
6ef2875395
fix(npm): match npm bearer token generation (#26544)
Spend some time stepping through the npm client code and noticed that
the bearer token was different from ours. They do some double encoding
and @dsherret helped me in matching the encoding behavior.

Fixes https://github.com/denoland/deno/issues/26033
2024-10-30 00:16:11 +01:00
David Sherret
61598884c1
fix: do not panic when failing to write to http cache (#26591)
Closes https://github.com/denoland/deno/issues/26189
Closes https://github.com/denoland/deno/issues/26575
2024-10-30 00:16:11 +01:00
familyboat
56ecc26b71
fix(ext/node): add path to fs.stat and fs.statSync error (#26037) 2024-10-30 00:16:11 +01:00
Bartek Iwańczuk
2d2928c4b7
fix(watch): don't panic on invalid file specifiers (#26577)
Removes an unwrap that falsely assumed the specifier is a valid
file path.

Fixes https://github.com/denoland/deno/issues/26209
2024-10-30 00:16:11 +01:00
Meir Blachman
ec0e7dde90
docs(readme): Add winget instructions (#25136)
Signed-off-by: Meir Blachman <meirblachman@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-30 00:15:38 +01:00
Chris Veness
7a7232c47c
fix(cli): Make --watcher CLEAR_SCREEN clear scrollback buffer as well as visible screen (#25997)
The --watch option should clear the screen scrollback buffer as well as
the screen itself.

On Ubuntu (22.04 Jammy) the 'clear' command generates
"\x1B[H\x1B[2J\x1B[3J"; that is:
- \E[H  - cursor home
- \E[2J - clear entire screen
- \E[3J - clear entire screen & scrollback buffer.

By contrast, Deno defined CLEAR_SCREEN as "\x1B[2J\x1B[1;1H", which
fails to clear the scrollback buffer.

The "\E[H\E[2J\E[3J" sequence works on MacOS (Sonoma) (using printf);
I'm not able to test on Windows.

Closes https://github.com/denoland/deno/issues/26514
2024-10-30 00:15:38 +01:00
Mayank Kumar
16f3c31c97
fix(ext/node): use primordials in ext\node\polyfills\internal\crypto\_randomInt.ts (#26534)
Towards #24236
2024-10-30 00:15:38 +01:00
David Sherret
b54a46b5de
perf: pass transpiled module to deno_core as known string (#26555) 2024-10-30 00:15:38 +01:00
Nayeem Rahman
ac384f71a0
fix(lsp): make missing import action fix infallible (#26539) 2024-10-30 00:15:37 +01:00
Nathan Whitaker
f9e70c093c
fix(install): cache json exports of JSR packages (#26552)
Fixes https://github.com/denoland/deno/issues/26509.

Ended up being a `deno_graph` bug causing the error to surface. This PR
updates `deno_graph` to pick up the fix and reverts the temporary
workaround that skipped JSON exports.
2024-10-30 00:15:37 +01:00
David Sherret
1dff19aeb1
fix(upgrade): stop running deno lsp processes on windows before attempting to replace executable (#26542) 2024-10-30 00:15:37 +01:00
David Sherret
494bcfab20
fix(check): ignore resolving jsxImportSource when jsx is not used in graph (#26548) 2024-10-30 00:15:37 +01:00
David Sherret
8eb3a5f8e2
fix(install): regression - do not panic when config file contains \r\n newlines (#26547)
This is specifically for `deno install`/`deno add` commands.

* https://github.com/dprint/jsonc-parser/pull/49

Closes https://github.com/denoland/deno/issues/26543
2024-10-30 00:15:37 +01:00
Nayeem Rahman
f44bec4ed0
feat(lsp): "typescript.preferences.preferTypeOnlyAutoImports" setting (#26546) 2024-10-30 00:15:37 +01:00
Bartek Iwańczuk
571751b00d
build: use 'fs' feature of 'nix' crate in ext/fs (#26533)
Hot-fix to unblock `v2.0.3` release
2024-10-25 12:53:54 +02:00
denobot
997bd47fc2
2.0.3 (#26532)
Bumped versions for 2.0.3

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-25 02:57:52 +02:00
Nathan Whitaker
eba48ace97
fix(install): don't cache json exports of JSR packages (for now) (#26530)
Temporary fix for #26509, so people don't get errors.
2024-10-25 02:09:40 +02:00
David Sherret
f84c007392
chore: remove print debugging from test server (#26529)
Accidentally added in https://github.com/denoland/deno/pull/26473/files
2024-10-25 02:09:39 +02:00
Nicola Bovolato
6c415bf819
fix(ext/node): refactor http.ServerResponse into function class (#26210)
While testing, I found out that light-my-request relies on
`ServerResponse.connection`, which is deprecated, so I added that and
`socket`, the non deprecated property.

It also relies on an undocumented `_header` property, apparently for
[raw header
processing](https://github.com/fastify/light-my-request/blob/v6.1.0/lib/response.js#L180-L186).
I added it as an empty string, feel free to provide other approaches.

Fixes #19901

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-25 02:09:39 +02:00
Bartek Iwańczuk
6f44eb6833
bench: remove http benchmarks (#26484)
These benchmarks run on GitHub Actions and are extremely noisy, thus
not providing much value.
2024-10-25 02:09:39 +02:00