1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00
Commit graph

12660 commits

Author SHA1 Message Date
Nathan Whitaker
6565f9f782
fix(install): handle invalid function error, and fallback to junctions regardless of the error (#26730)
Fixes #26116.

Handle the new error and treat is as lacking permission to make
symlinks, but also to make this more robust, just always fall back to
junctions no matter what the actual error is. Instead, warn if the error
isn't one we've handled, but go on to attempt creating the junction
2024-11-06 00:36:27 +01:00
Divy Srivastava
82ee63f78b
fix: op_run_microtasks crash (#26718)
Upgrade deno_core to 0.318.0

Fixes https://github.com/denoland/deno_core/issues/951
Fixes https://github.com/denoland/deno/issues/26468
2024-11-06 00:36:26 +01:00
Nathan Whitaker
09c9649bee
fix(add): better error message when adding package that only has pre-release versions (#26724)
Fixes https://github.com/denoland/deno/issues/26597

A small refactor as well to reduce some code duplication
2024-11-06 00:36:26 +01:00
Nathan Whitaker
062214abf5
chore: fix serve_watch_all test (#26725)
It's been failing a ton lately, it looks like the test is just
incorrectly using TS syntax in a JS file
https://github.com/denoland/deno/actions/runs/11672972415/job/32502710624?pr=26724#step:43:2791

I'm not really sure how this ever passes
2024-11-06 00:36:26 +01:00
Bartek Iwańczuk
0a2d60544b
ci: use self-hosted mac arm runner for building on tags (#26727) 2024-11-06 00:36:26 +01:00
Bartek Iwańczuk
69879d8767
fix(workspace): support wildcard packages (#26568)
This commit adds support for wildcard packages in `workspace`
configuration option in `deno.json`. This is now supported:
```
{
  "workspace": [
    "./packages/*"
  ]
}
```

Closes https://github.com/denoland/deno/issues/25783
2024-11-06 00:36:26 +01:00
Nathan Whitaker
331f101279
fix(ext/node): add findSourceMap to the default export of node:module (#26720)
Next.js 15.0.2 tries to use this and errors out
2024-11-06 00:36:25 +01:00
David Sherret
ee09d24ad2
fix(fmt): do not panic for jsx ignore container followed by jsx text (#26723) 2024-11-06 00:36:25 +01:00
Nayeem Rahman
7fc74b2b23
fix(lsp): scope attribution for lazily loaded assets (#26699) 2024-11-06 00:36:25 +01:00
Scott Twiname
f6a0ba7609
fix(types): missing import permission on PermissionOptionsObject (#26627) 2024-11-06 00:36:25 +01:00
Bartek Iwańczuk
a119ead8a0
fix(fmt): ignore file directive for YAML files (#26717)
Closes https://github.com/denoland/deno/issues/26712

Support `# deno-fmt-ignore-file` directive for YAML files.

Also added tests for single line ignores.
2024-11-06 00:36:25 +01:00
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