Commit graph

1558 commits

Author SHA1 Message Date
David Sherret 4d2d764816
feat(jsr): support publishing jsr packages in npm workspaces (#24507)
Supports publishing an npm workspace with a directory structure similar
to the following:

- workspace
  - package.json
  - package-a
    - package.json
    - jsr.json
  - package-b
    - package.json
    - jsr.json

deno_config PR: https://github.com/denoland/deno_config/pull/77

Closes https://github.com/denoland/deno/issues/23638
2024-07-10 14:46:09 -04:00
Bartek Iwańczuk 8b34c4d75b
fix: memory leak when transpiling (#24490)
This commit fixes memory leak described in
https://github.com/denoland/deno/issues/24380.

This is done by upgrading following crates:
- deno_ast
- deno_graph
- eszip
- dprint-plugin-typescript
- deno_lint
- deno_doc
- deno_emit
2024-07-10 13:51:55 +00:00
Nathan Whitaker ce7dc2be92
feat(node): Support executing npm package lifecycle scripts (preinstall/install/postinstall) (#24487)
Adds support for running npm package lifecycle scripts, opted into via a
new `--allow-scripts` flag.

With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno
install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run
lifecycle scripts attached to the given packages.

Note at the moment this only works when `nodeModulesDir` is true (using
the local resolver).

When a package with un-run lifecycle scripts is encountered, we emit a
warning suggesting things may not work and to try running lifecycle
scripts. Additionally, if a package script implicitly requires
`node-gyp` and it's not found on the system, we emit a warning.

Extra things in this PR:
- Extracted out bits of `task.rs` into a separate module for reuse
- Added a couple fields to `process.config` in order to support
`node-gyp` (it relies on a few variables being there)
- Drive by fix to downloading new npm packages to test registry

---

TODO:
- [x] validation for allow-scripts args (make sure it looks like an npm
package)
- [x] make allow-scripts matching smarter
- [ ] figure out what issues this closes

---
Review notes:
- This adds a bunch of deps to our test registry due to using
`node-gyp`, so it's pretty noisy
2024-07-10 03:06:08 +00:00
David Sherret e5c3c21e95
feat(workspace): support object config (#24483)
This adds object config for the workspace config:

```json
{
  "workspace": {
    "members": ["./member-1", "./member-2"]
  }
}
```

This is a more verbose version of `"workspace": ["./member-1",
"./member-2"]`. Although we don't need it at the moment, it makes the
naming of `"workspace"` more clear and leaves the object open for more
config in the future.

Closes https://github.com/denoland/deno/issues/24456
2024-07-09 17:06:50 -04:00
David Sherret 839caf6faf
refactor: use concrete error types for node resolution (#24470)
This will help clean up some of the code in the CLI because we'll be
able to tell how the resolution failed (not part of this PR).
2024-07-09 12:15:03 -04:00
Bartek Iwańczuk 0425dabb84
feat: upgrade deno_core to 0.293.0 (#24482)
Upgrades to V8 12.7.224.12
2024-07-09 15:50:38 +02:00
David Sherret e30ad77ffa
feat: support wildcards in npm workspaces (#24471)
Implemented in https://github.com/denoland/deno_config/pull/74

Closes https://github.com/denoland/deno/issues/24420
2024-07-09 00:23:45 +00:00
David Sherret 86010bec09
fix(workspace): better cli file argument handling (#24447)
Closes https://github.com/denoland/deno/issues/24422
2024-07-08 14:12:10 +00:00
David Sherret 80df9aec1d
refactor: move FileCollector to deno_config (#24433) 2024-07-05 17:53:09 -04:00
David Sherret f396b3d1c8
fix(publish): unfurling should always be done with the package json (#24435)
Closes https://github.com/denoland/deno/issues/24430
2024-07-05 00:41:01 +00:00
David Sherret 147411e64b
feat: npm workspace and better Deno workspace support (#24334)
Adds much better support for the unstable Deno workspaces as well as
support for npm workspaces. npm workspaces is still lacking in that we
only install packages into the root node_modules folder. We'll make it
smarter over time in order for it to figure out when to add node_modules
folders within packages.

This includes a breaking change in config file resolution where we stop
searching for config files on the first found package.json unless it's
in a workspace. For the previous behaviour, the root deno.json needs to
be updated to be a workspace by adding `"workspace":
["./path-to-pkg-json-folder-goes-here"]`. See details in
https://github.com/denoland/deno_config/pull/66

Closes #24340
Closes #24159
Closes #24161
Closes #22020
Closes #18546
Closes #16106
Closes #24160
2024-07-04 00:54:33 +00:00
Bartek Iwańczuk 8db420d552
chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24388)
Reland of https://github.com/denoland/deno/pull/24056 that doesn't
suffer from the problem that was discovered in
https://github.com/denoland/deno/pull/24261.

It uses upgraded `hyper` and `hyper-util` that fixed the previous
problem in https://github.com/hyperium/hyper/pull/3691.
2024-07-02 02:09:47 +02:00
snek a555cb4d1d
feat: upgrade deno_core (#24364)
- Symbol.asyncDispose no longer needs to be polyfilled
- assorted updates for cppgc api changes
2024-07-01 15:48:52 -07:00
Leo Kettmeir ec9963570b
chore: update deno_doc (#24308) 2024-06-28 05:03:51 -07:00
David Sherret 0da01c0ca6
refactor: move PackageJson to deno_config (#24348) 2024-06-26 21:24:10 +00:00
David Sherret eb283c43f5
refactor: bump deno_graph to 0.79 (#24337)
No fixes in this to my knowledge. Just an upgrade. The functionality
here will be used in a different PR.
2024-06-26 01:42:18 +00:00
Luca Casonato 1e8a6b94b1
fix(ext/node): rewrite crypto.Hash (#24302)
Changes in this PR:

- Added new fixed size hash algorithms (blake2b512, blake2s256,
sha512-224, sha512-256, sha3-224, sha3-256, sha3-384, sha3-512, sm3)
- Added variable size hash algorithms (the concept), with the algorithms
shake128 and shake256
- Use cppgc instead of resources for the hasher
- Enable Node's crypto.Hash tests and fix found bugs
2024-06-24 11:47:12 +02:00
Luca Casonato 973d186e8f
chore: use sha1 crate, not sha-1 (#24306) 2024-06-23 16:39:14 +02:00
Divy Srivastava b4939f3379
fix: upgrade deno_core to 0.291.0 (#24297) 2024-06-21 10:49:39 +05:30
ud2 88e3f465d3
refactor(ext): remove use of brotli::ffi (#24214) 2024-06-20 20:44:24 +05:30
David Sherret b62534dbf1
fix(task): do not propagate env changes outside subshells (#24279)
* https://github.com/denoland/deno_task_shell/pull/120
2024-06-20 00:57:53 +00:00
denobot 6c6ee02dfd
chore: forward v1.44.4 release commit to main (#24271)
This is the release commit being forwarded back to main for 1.44.4

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-06-19 20:29:53 +02:00
Bartek Iwańczuk b94707af7d
Revert "chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)" (#24262)
This reverts commit fb31eaa9ca.

Reverting because users reported spurious errors when downloading
dependencies - https://github.com/denoland/deno/issues/24260.

Closes https://github.com/denoland/deno/issues/24260
2024-06-19 16:09:17 +02:00
denobot 1d6b775f81
chore: forward v1.44.3 release commit to main (#24256)
This is the release commit being forwarded back to main for 1.44.3

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-19 03:17:32 +02:00
dependabot[bot] cfaffe9e5b
build(deps): bump curve25519-dalek from 4.1.2 to 4.1.3 (#24251)
Bumps
[curve25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek)
from 4.1.2 to 4.1.3.

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-18 23:31:02 +00:00
Bartek Iwańczuk 5407510791
chore: remove deno_core patch (#24252)
A PR was landed by mistake that used `[patch.crates-io]` instead
of released `deno_core` version:
https://github.com/denoland/deno/pull/23842#discussion_r1645170369
2024-06-18 23:00:13 +00:00
Tom Alcorn 5289c69271
fix(ext/web): fix AbortSignal.timeout() leak (#23842)
<!--
Before submitting a PR, please read
https://docs.deno.com/runtime/manual/references/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.
-->

Fixes #20663.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-19 07:47:05 +10:00
Satya Rohith 8c4b33db0d
feat(ext/node): add BlockList & SocketAddress classes (#24229)
Closes https://github.com/denoland/deno/issues/24059
2024-06-18 10:46:13 +00:00
Bartek Iwańczuk 184a85eaec
fix(inspector): crash on "Debugger.setBlackboxPatterns" (#24204)
Closes https://github.com/denoland/deno/issues/24196

---------

Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-14 23:52:21 +02:00
David Sherret 9092a23619
fix(no-slow-types): handle named type in mapped type (#24205)
Fixed via the swc upgrade.

Tests here: https://github.com/denoland/deno_graph/pull/499

Closes #23284
2024-06-14 17:24:33 +03:00
David Sherret 4ec9250c40
fix(npm): use more relaxed package.json version constraint parsing (#24202) 2024-06-13 18:29:27 -04:00
Bartek Iwańczuk fb31eaa9ca
chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)
This commit updates Deno to use `reqwest` at 0.12.4
and `rustls` at 0.22. Other related crates were updated
as well to match versions accepted by `reqwest` and `rustls`.

Note: we are not using the latest available `rustls` yet,
but this upgrade was non-trivial already, so a bump to
0.23 for `rustls` will be done in a separate commit.

Closes #23370

---------

Signed-off-by: Ryan Dahl <ry@tinyclouds.org>
Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-13 22:41:26 +02:00
denobot efb2085b61
chore: forward v1.44.2 release commit to main (#24194)
Co-authored-by: nathanwhit <nathanwhit@users.noreply.github.com>
2024-06-13 01:57:22 +00:00
Divy Srivastava 17e1219250
chore: upgrade deno_core (#24146)
With changes for https://github.com/denoland/deno_core/pull/778
2024-06-11 15:12:38 +02:00
David Sherret 4bc96c5d2a
fix(npm): resolve dynamic npm imports individually (#24170)
* https://github.com/denoland/deno_npm/pull/57
* https://github.com/denoland/deno_graph/pull/498

Closes https://github.com/denoland/deno/issues/17802
2024-06-11 08:55:12 -04:00
Bartek Iwańczuk 22d34f7012
chore: upgrade deno_core to 0.287.0 (#24145)
Includes:
- [fix: lossily UTF8 decode module source
text](ec38e428c6)
- [fix: `ModuleMap` was not dropped if it had pending
futures](5d12f510a1)
2024-06-08 07:49:23 +05:30
Bartek Iwańczuk 9dc0e33e67
fix: upgrade deno_core (#24128)
Includes https://github.com/denoland/deno_core/pull/770 necessary
for https://github.com/denoland/deno/pull/24101.

Also includes https://github.com/denoland/deno_core/pull/769 that
fixes https://github.com/denoland/deno/issues/24098 and
https://github.com/denoland/deno/issues/24069 and
https://github.com/denoland/deno/issues/24089.
2024-06-07 17:47:15 +00:00
David Sherret 78774dd664
fix: do not panic linting files with UTF-8 BOM (#24136)
Closes #24122
2024-06-07 17:02:47 +00:00
David Sherret 386d5c8310
refactor: remove PermissionsContainer in deno_runtime (#24119)
Also removes permissions being passed in for node resolution. It was
completely useless because we only checked it for reading package.json
files, but Deno reading package.json files for resolution is perfectly
fine.

My guess is this is also a perf improvement because Deno is doing less
work.
2024-06-06 23:37:53 -04:00
David Sherret 7a17eba5a7
refactor: NpmRegistryApi - #[async_trait(?Send)] (#24126) 2024-06-06 22:37:41 +00:00
denobot 4d531bf229
chore: forward v1.44.1 release commit to main (#24115)
This is the release commit being forwarded back to main for 1.44.1

Co-authored-by: devsnek <devsnek@users.noreply.github.com>
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-06 03:23:10 +00:00
Ryan Dahl c7894447eb
chore: upgrade trust-dns-resolver and friends (#24108)
To avoid duplicate winreg crate in #24056

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-05 23:39:39 +02:00
David Sherret 566adb7c0a
fix(npm): use configured auth for tarball urls instead of scope auth (#24111)
Deno was using the scope auth for the tarball urls, which is not always
correct. We are going to do a release immediately for this issue.
2024-06-05 21:24:52 +00:00
Bartek Iwańczuk 0db73f6333
fix: update deno_npm (#24065) 2024-06-05 19:22:40 +00:00
David Sherret 7ed90a20d0
fix: better handling of npm resolution occurring on workers (#24094)
Closes https://github.com/denoland/deno/issues/24063
2024-06-05 17:04:16 +02:00
ud2 29a075de2b
chore(ext/web): use Error.captureStackTrace in DOMException constructor (#23986)
This makes `DOMException`'s `stack` property behave the same as native
errors' – `stack` is now an own accessor property on every instance, and
the getter calls `Error.prepareStackTrace`.

Upgrades `deno_core` to 0.284.0.
---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-06-05 01:09:13 +02:00
denobot 9e2971d40f
1.44.0 (#24045)
Bumped versions for 1.44.0

Co-authored-by: littledivy <littledivy@users.noreply.github.com>
2024-05-30 04:49:23 +00:00
Luca Casonato e084fe10a9
feat(lint): add no-boolean-literal-for-arguments rule and enable no-unused-vars for jsx files (#24034)
* https://github.com/denoland/deno_lint/pull/1271
* https://github.com/denoland/deno_lint/pull/1277

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-30 00:09:16 +00:00
Kyle Kelley cf611fbf54
chore: upgrade jupyter runtimelib to 0.11.0 (#24036)
Brings in:

* More fully typed structures (for when we get to implementing more)
* `with_metadata`, `with_buffers`, etc. from
https://github.com/runtimed/runtimed/pull/99

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-29 22:46:47 +00:00
David Sherret 94f040ac28
fix: bump cache sqlite dbs to v2 for WAL journal mode change (#24030)
In https://github.com/denoland/deno/pull/23955 we changed the sqlite db
journal mode to WAL. This causes issues when someone is running an old
version of Deno using TRUNCATE and a new version because the two fight
against each other.
2024-05-29 18:38:18 +00:00