Commit Graph

11754 Commits

Author SHA1 Message Date
Luca Casonato
080869a9b9
wip 2024-07-15 16:38:11 +02:00
Luca Casonato
aad8ae3710
feat: support bun specifiers in JSR publish 2024-07-15 15:08:09 +02:00
Rano | Ranadeep
702f7ee89c
fix(std/http2): release window capacity back to remote stream (#24576)
This PR adds logic to release window capacity after reading the chunks
from the stream. Without it, large response (more than `u16::MAX`) may
fill up the capacity and the whole response can't be read.

Closes https://github.com/denoland/deno/issues/24552
Closes https://github.com/denoland/deno/issues/24305
2024-07-15 17:10:59 +05:30
Igor Borisoglebski
9128cc9850
fix(docs): fix some deno.land/manual broken urls (#24557)
Fixing some broken urls found after the docs migration
2024-07-15 11:08:45 +00:00
David Sherret
8754a01d43
fix(init): use bare specifier for jsr:@std/assert (#24581)
Closes #24580
2024-07-14 13:22:43 -04:00
Ryan Dahl
e0cfc9da39
Revert "refactor(fetch): reimplement fetch with hyper instead of reqwest (#24237)" (#24574)
This reverts commit f6fd6619e7.

I'm seeing a difference between canary and 1.45.2. In
`deno-docs/reference_gen` I can't download dax when running `deno task
types`

```
~/src/deno-docs/reference_gen# deno upgrade --canary
Looking up latest canary version
Found latest version f6fd6619e7
Downloading https://dl.deno.land/canary/f6fd6619e708a515831f707438368d81b0c9aa56/deno-aarch64-apple-darwin.zip
Deno is upgrading to version f6fd6619e7
Archive:  /var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/.tmpb5lDnq/deno.zip
  inflating: deno
Upgraded successfully

~/src/deno-docs/reference_gen# deno -v
deno 1.45.2+f6fd661

~/src/deno-docs/reference_gen# rm -rf /Users/ry/Library/Caches/deno

~/src/deno-docs/reference_gen# deno task types
Task types deno task types:deno && deno task types:node
Task types:deno deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts
error: JSR package manifest for '@david/dax' failed to load. expected value at line 1 column 1
    at file:///Users/ry/src/deno-docs/reference_gen/deno-docs.ts:2:15

~/src/deno-docs/reference_gen# deno upgrade --version 1.45.2
Downloading https://github.com/denoland/deno/releases/download/v1.45.2/deno-aarch64-apple-darwin.zip
Deno is upgrading to version 1.45.2
Archive:  /var/folders/9v/kys6gqns6kl8nksyn4l1f9v40000gn/T/.tmp3R7uhF/deno.zip
  inflating: deno
Upgraded successfully

~/src/deno-docs/reference_gen# rm -rf /Users/ry/Library/Caches/deno

~/src/deno-docs/reference_gen# deno task types
Task types deno task types:deno && deno task types:node
Task types:deno deno run --allow-read --allow-write --allow-run --allow-env --allow-sys deno-docs.ts
Task types:node deno run --allow-read --allow-write=. --allow-env --allow-sys node-docs.ts
```
2024-07-13 21:08:23 +00:00
Sean McArthur
f6fd6619e7
refactor(fetch): reimplement fetch with hyper instead of reqwest (#24237)
This commit re-implements `ext/fetch` and all dependent crates
using `hyper` and `hyper-util`, instead of `reqwest`.

The reasoning is that we want to have greater control and access
to low level `hyper` APIs when implementing `fetch` API as well
as `node:http` module.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-13 00:51:37 +02:00
David Sherret
2fca4f11fe
chore: include current versions more in release checklist (#24562) 2024-07-12 18:44:55 -04:00
denobot
3a48bc695f
chore: forward v1.45.2 release commit to main (#24564)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2024-07-12 18:05:45 -04:00
David Sherret
8243c85a47
fix(publish): show dirty files on dirty check failure (#24541) 2024-07-12 15:35:57 -04:00
David Sherret
9510a8b7d1
fix(config): regression - should not discover npm workspace for nested deno.json not in workspace (#24559)
Closes #24554
2024-07-12 15:33:30 -04:00
vwh
1711158984
fix(cli/init): broken link in deno init sample template (#24545)
This commit fixes the broken link in the sample template provided by the
deno init command.
2024-07-12 15:04:27 -04:00
David Sherret
1c41db76ac
fix: include already seen deps in lockfile dep tracking (#24556)
Tests in https://github.com/denoland/deno_graph/pull/504

Closes #24536
2024-07-12 14:48:03 -04:00
David Sherret
8ee14bd56a
refactor: move importMap with imports/scopes diagnostic to deno_config (#24553) 2024-07-12 12:48:53 -04:00
Satya Rohith
8cbf81cf08
fix(ext/node): handle prefix mapping for IPv4-mapped IPv6 addresses (#24546)
Ensure that the prefix is properly adjusted when dealing with IPv4
addresses mapped to IPv6. This fixes inconsistencies in network
range calculations for mapped addresses.

Closes https://github.com/denoland/deno/issues/24525
2024-07-12 14:25:17 +05:30
Satya Rohith
fee4d3a762
perf(ext/crypto): make randomUUID() 5x faster (#24510) 2024-07-12 10:50:32 +05:30
chirsz
01c074d195
fix(ext/webgpu): GPUDevice.createRenderPipelineAsync should return a Promise (#24349)
Fixes #24317
2024-07-12 09:53:52 +05:30
snek
7ab25dd89e
fix: unblock fsevents native module (#24542)
node-api is fully supported now.

Signed-off-by: snek <snek@deno.com>
2024-07-11 19:15:05 -07:00
denobot
0be4c8947d
chore: forward v1.45.1 release commit to main (#24540)
This is the release commit being forwarded back to main for 1.45.1

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-07-12 01:14:14 +02:00
David Sherret
77f771b69c
fix(npm): use start directory deno.json as "root deno.json config" in npm workspace (#24538) 2024-07-11 21:07:31 +00:00
David Sherret
1200f69082
fix(node): revert invalid package target change (#24539)
Reason is that `e` may contain an invalid package target nested deeply
in the returned errors. We should probably add a `.code()` to all errors
to make matching easier or make the errors flatter.
2024-07-11 16:32:52 -04:00
Nathan Whitaker
3d0e1b65b1
fix(node): Ignore broken default install scripts (#24534)
NPM inserts a default install script when a package has a `binding.gyp`
file.

It's possible, however, for the package to exclude the `binding.gyp`
file when they publish, and in this case the install script will never
succeed for a user of the package.

This happens with `fsevents`, for instance. They don't include the
`binding.gyp` file in their published tarball, but the default install
script appears in the manifest served by `npm`.

This causes us to warn that `fsevents` has an install script, but when
you try to run it it fails due to `binding.gyp` not existing.
2024-07-11 18:39:45 +00:00
David Sherret
ba63740e7f
chore: @netlify/edge-bundler workaround until Deno 2.0 (#24532)
Hack for a few months until Deno 2.0. See code for details
2024-07-11 17:43:46 +00:00
Bartek Iwańczuk
4f15aada02
fix(workspace): allow using --import-map flag with workspace (#24527)
This is a temporary fix, which is not perfect - specifying
`--import-map`
will break resolution of packages defined in `workspace` setting, but
erroring on `--import-map` currently causes regression in code that
worked fine in v1.44.x.
2024-07-11 16:43:28 +00:00
David Sherret
f950f59983
fix(npm): only warn about lifecycle scripts not being run when setting up directory (#24530)
Closes #24518
2024-07-11 16:41:42 +00:00
Marvin Hagemeister
de30f7c188
chore: add std import mapping for tests (#24521)
This makes the LSP understand `@std/` imports in our tests.
2024-07-11 10:03:29 +02:00
David Sherret
a5f8bfdbfb
chore: format yaml internally (#24520)
Uses https://github.com/g-plane/pretty_yaml
2024-07-10 23:59:57 -04:00
Bartek Iwańczuk
e8057bc102
build: update wgpu-core to unblock release (#24515)
`wgpu-core` version 0.20 was yanked and it caused failure to
publish `deno_webgpu`. I bumped and published locally to
unblock the release.
2024-07-11 02:03:08 +02:00
denobot
04ff5c731d
1.45.0 (#24512)
Bumped versions for 1.45.0

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-11 00:08:02 +02:00
Leo Kettmeir
28f9485c25
chore: update deno_doc (#24509) 2024-07-10 22:46:46 +02:00
David Sherret
ad8d265e29
chore: fix flaky publish::npm_workspace test (#24511) 2024-07-10 20:44:37 +00:00
David Sherret
a49d0bd10b
fix(check): CJS types importing dual ESM/CJS package should prefer CJS types (#24492)
Closes #16370
2024-07-10 14:46:25 -04:00
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
Nathan Whitaker
69afa8718f
chore: tweak warning message for un-run install scripts (#24508)
Previously when we printed out the packages that skipped install
scripts, we didn't prefix them with `npm:`. When you pass
`--allow-scripts` though, we require `npm:`, which means you can't just
copy paste the package name from the warning message.
2024-07-10 18:03:41 +00:00
Marvin Hagemeister
26288cf2a9
fix(node/perf_hooks): stub eventLoopUtilization (#24501)
This PR stubs `perf_hooks.eventLoopUtilization` to make the tests of
[hapi](https://github.com/hapijs/hapi) start. Previously, they'd all
error because of this function throwing a not implemented error. This
brings down the test failures in their suite from 982 to 68 failures.
2024-07-10 19:47:45 +02:00
Marvin Hagemeister
60668c1e93
fix(node/v8): stub serializer methods (#24502)
Stubbing a few of Node's `v8` serializer methods makes the `tap` test
runner at least start. Previously, it would fail to boot up as some
instances of `DefaultSerializer` are constructed eagerly 🎉

Before:
<img width="1041" alt="Screenshot 2024-07-10 at 16 41 30"
src="https://github.com/denoland/deno/assets/1062408/58f1157f-cef8-4176-9239-9d724ca0a677">


After:

<img width="830" alt="Screenshot 2024-07-10 at 16 39 35"
src="https://github.com/denoland/deno/assets/1062408/710ef673-8120-405a-b9d3-a5ca826b4829">


Fixes https://github.com/denoland/deno/issues/24409
2024-07-10 19:46:40 +02: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
Adam Gregory
82f9216610
fix: Add sys permission kinds for node compat (#24242)
Fixes #24241

* Support "statfs", "username", "getPriority" and "setPriority" kinds
for `--allow-sys`.
* Check individual permissions in `node:os.userInfo()` instead of a
single "userInfo" permission.
* Check for "uid" permission in `node:process.geteuid()` instead of
"geteuid".
* Add missing "homedir" to `SysPermissionDescriptor.kind` union

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-10 15:15:43 +02:00
Marvin Hagemeister
9a0d59d95d
fix(node/http): don't send destroyed requests (#24498)
Make sure that already destroyed requests are not actually sent.

This error was discovered in jsdom's test suite.
2024-07-10 12:01:08 +02:00
Marvin Hagemeister
2a86edf0af
fix(node/http): don't error if request destroyed before send (#24497)
A request can be destroyed before it was even made in the Node http API.
We errored on that.

This issue was discovered in the JSDOM test suite.
2024-07-10 10:05:41 +02:00
Victor Turansky
92d567d356
fix(ext/webgpu): fix GPUUncapturedErrorEvent parent type (#24369)
https://developer.mozilla.org/en-US/docs/Web/API/GPUUncapturedErrorEvent

Signed-off-by: Victor Turansky <victor.turansky@gmail.com>
2024-07-10 12:39:15 +05:30
Andrew Johnston
26bf4480ff
fix(net): set correct max size for Datagram (#21611) 2024-07-10 03:30:22 +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
Asher Gomez
eb46296e97
feat: deprecate deno vendor (#22183)
This commit deprecates `deno vendor` subcommand in favor
of using `--vendor` flag or `"vendor": true` setting in the config file.

The subcommand is still available (until Deno 2) but is hidden from
the help output.

Closes #20584

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-10 03:18:10 +02:00
muddlebee
ff5163af05
feat(cli): deno init --lib (#22499)
Closes #22287

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-07-09 21:13:34 -04:00
muddlebee
9776a13e33
fix: panic when piping "deno help" or "deno --version" (#22917)
Fixes #22863

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-09 22:57:00 +00:00
HasanAlrimawi
fb6348500f
feat(compile): support --env (#24166)
Supported the use of --env flag with the compile subcommand, so that the
generated executable/binary file can access the passed env file.
2024-07-09 21:33:41 +00:00
Leo Kettmeir
52946878b2
ci: update release steps related to dotcom (#24467) 2024-07-09 17:10:04 -04:00
David Sherret
43d10a558b
fix: do not download compilerOptions -> types when not type checking (#24473)
Closes https://github.com/denoland/deno/issues/22738
2024-07-09 17:07:16 -04: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