1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-22 15:06:54 -05:00
Commit graph

6395 commits

Author SHA1 Message Date
Asher Gomez
d49a151abf chore: fix bench task (#24718)
<!--
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.
-->
2024-07-26 12:04:10 -04:00
David Sherret
80b479d63e refactor: decouple node resolution from deno_core (#24724) 2024-07-26 12:04:10 -04:00
David Sherret
2a026bee33 fix(unstable): move sloppy-import warnings to lint rule (#24710)
Adds a new `no-sloppy-imports` lint rule and cleans up the lint code.

Closes #22844
Closes https://github.com/denoland/deno_lint/issues/1293
2024-07-26 12:04:10 -04:00
David Sherret
a818db4699 fix(workspaces/publish): include the license file from the workspace root if not in pkg (#24714) 2024-07-26 12:04:09 -04:00
Nathan Whitaker
4edb86496c fix(future): Emit deno install warning less often, suggest deno install in error message (#24706)
Two small changes:

- In our BYONM errors, suggest running `deno install` instead of `npm
install` if `DENO_FUTURE` is set
- Only emit warning about `deno install` changes if you do `deno install
<foo>` with deno_future unset
2024-07-26 12:04:09 -04:00
Leo Kettmeir
f7749a95b4 perf: update deno_doc (#24700)
Ref https://github.com/denoland/deno_doc/pull/616
2024-07-26 12:04:08 -04:00
HasanAlrimawi
8924b02fb6 fix: update lsp error message of 'relative import path' to 'use deno add' for npm/jsr packages (#24524) 2024-07-26 12:04:08 -04:00
David Sherret
815354adee fix(node): better detection for when to surface node resolution errors (#24653) 2024-07-26 12:04:08 -04:00
Bartek Iwańczuk
57e0f40812 Reland "fix: CFunctionInfo and CTypeInfo leaks (#24634)" (#24692)
Reverted in
95847f4e94.
2024-07-26 12:04:08 -04:00
David Sherret
99d8193ed2 fix(upgrade): do not error if config in cwd invalid (#24689)
```
> deno upgrade
error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile.
V:\scratch
> V:\deno\target\debug\deno upgrade
Looking up latest version
Local deno version 1.45.3 is the most recent release
```

Closes #24517
Closes #20729
2024-07-26 12:04:07 -04:00
David Sherret
b8c16eda9b refactor: update to use deno_package_json (#24688)
This is in preparation for extracting out node resolution code from
ext/node (which is something I'm going to do gradually over time).

Uses https://github.com/denoland/deno_package_json
2024-07-26 12:04:07 -04:00
HasanAlrimawi
e76330c49d fix: enable the reporting of parsing related problems when running deno lint (#24332) 2024-07-26 12:04:07 -04:00
Nayeem Rahman
142b9f29ae fix(lsp): rewrite import for 'infer return type' action (#24685) 2024-07-26 12:04:07 -04:00
Bartek Iwańczuk
fec792ee9c
Revert "fix(cli): add NAPI support in standalone mode (#24642)"
This reverts commit 4e8f5875bc.
2024-07-23 00:54:29 +02:00
Bartek Iwańczuk
b812e7cb60
Revert "chore: move all node-api impl to ext (#24662)"
This reverts commit d00fbd7025.
2024-07-23 00:34:29 +02:00
denobot
87ce64e574
1.45.3 (#24679)
Bumped versions for 1.45.3

---------

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-22 23:34:15 +02:00
Kenta Moriuchi
a115a10100
fix(types): Conform lib.deno_web.d.ts to lib.dom.d.ts and lib.webworker.d.ts (#24599)
Fix #24578
Fix #21981
2024-07-22 22:48:40 +02:00
David Sherret
2680b09b0d
fix(publish): warn about missing license file (#24677)
Part of https://github.com/denoland/deno/issues/24676 , but just a
warning for now.
2024-07-22 22:48:40 +02:00
snek
d00fbd7025
chore: move all node-api impl to ext (#24662)
these symbols are re-exported from runtime/cli using `build.rs`, so we
don't need them in the same crate.
2024-07-22 22:48:40 +02:00
David Sherret
b9ddec0137
fix(npm): handle packages with only pre-released 0.0.0 versions (#24563)
* https://github.com/denoland/deno_semver/pull/26

Closes https://github.com/denoland/deno/issues/24550
2024-07-22 22:48:40 +02:00
Nayeem Rahman
181d415ac7
fix(lsp): scope attribution for asset documents (#24663) 2024-07-22 22:48:40 +02:00
Bartek Iwańczuk
b5e5e1de4e
Revert "fix: CFunctionInfo and CTypeInfo leaks (#24634)" (#24665)
This reverts commit 6c5905dbc3.

Reverting because of errors like this in CI:
```
#
# Fatal error in , line 0
# Check failed: FastApiCallNode::ArityForArgc(c_arg_count, slow_arg_count) == value_input_count.
#
#
#
#FailureMessage Object: 0x7fd5b3ffd9d0
==== C stack trace ===============================

    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1111883) [0x55b8d2107883]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1110b6b) [0x55b8d2106b6b]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x110c6f9) [0x55b8d21026f9]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x20413cd) [0x55b8d30373cd]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x2034222) [0x55b8d302a222]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x202ff44) [0x55b8d3025f44]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1e0b253) [0x55b8d2e01253]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1dfcd96) [0x55b8d2df2d96]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1df92aa) [0x55b8d2def2aa]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1df8b71) [0x55b8d2deeb71]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x11ce49b) [0x55b8d21c449b]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x121fb23) [0x55b8d2215b23]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1221359) [0x55b8d2217359]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x1112f3b) [0x55b8d2108f3b]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x111792b) [0x55b8d210d92b]
    /home/runner/work/deno/deno/target/release/deps/url_ops-e4068c650cedb9fa(+0x110df0f) [0x55b8d2103f0f]
    /lib/x86_64-linux-gnu/libc.so.6(+0x94ac3) [0x7fd5cb294ac3]
    /lib/x86_64-linux-gnu/libc.so.6(+0x126850) [0x7fd5cb326850]
```
2024-07-22 22:48:39 +02:00
Ivancing
3c40457820
fix(cli): add NAPI support in standalone mode (#24642)
Currently, importing Node-Addons modules in a standalone binary results
in a `missing symbol called` error
(https://github.com/denoland/deno/issues/24614). Because the NAPI
symbols are not exported in this mode. This PR should fix the issue.
2024-07-22 22:48:39 +02:00
Divy Srivastava
e10e9812d8
fix: CFunctionInfo and CTypeInfo leaks (#24634)
Trying out the deno_core patch

Ref https://github.com/denoland/deno_core/pull/832

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

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-22 22:48:39 +02:00
David Sherret
5fbf8a5871
fix(lsp): hang when caching failed (#24651)
Closes #24600
2024-07-22 22:48:39 +02:00
David Sherret
3fe388ff5f
refactor: update to deno_config 0.25 (#24645)
- Gets rid of WorkspaceMemberContext. It's now `Workspace` and
`WorkspaceDirectory`
- Uses the workspace cache in the lsp

* https://github.com/denoland/deno_config/pull/95
* https://github.com/denoland/deno_config/pull/96
2024-07-22 22:47:59 +02:00
Nathan Whitaker
9b6959129a
fix(cli): Respect implied BYONM from DENO_FUTURE in deno task (#24652)
Regression from
04f9db5b22

Originally I thought to fix the issue in the PR we needed to explicitly
pass through the `node-modules-dir` flag, but after applying the correct
fix that david pointed out (setting `NPM_PROCESS_STATE`) that wasn't
necessary (or correct).

We had a test for deno task with BYONM, but it only tested with
`"unstable": ["byonm"]` in deno.json, so it didn't catch this.
2024-07-22 22:47:58 +02:00
David Sherret
b443244bda
fix(fmt): was sometimes putting comments in front of commas in parameter lists (#24650)
* https://github.com/dprint/dprint-plugin-typescript/pull/651
2024-07-22 22:47:58 +02:00
Marvin Hagemeister
a2ca399227
fix(node): support tty.hasColors() and tty.getColorDepth() (#24619)
This PR adds support for
[`tty.WriteStream.prototype.hasColors()`](https://nodejs.org/api/tty.html#writestreamhascolorscount-env)
and
[`tty.WriteStream.prototype.getColorDepth()`](https://nodejs.org/api/tty.html#writestreamgetcolordepthenv).

I couldn't find any usage on GitHub which passes parameters to it.
Therefore I've skipped adding support for the `env` parameter to keep
our snapshot size small.

Based on https://github.com/denoland/deno_terminal/pull/3

Fixes https://github.com/denoland/deno/issues/24616
2024-07-22 22:47:58 +02:00
David Sherret
1469d61055
fix(lsp): support npm workspaces and fix some resolution issues (#24627)
Makes the lsp use the same code as the rest of the cli.
2024-07-22 22:47:58 +02:00
David Sherret
4945714b71
fix(publish): surface syntax errors when using --no-check (#24620) 2024-07-22 22:47:57 +02:00
Bartek Iwańczuk
b2bacd969c
Reland "refactor(fetch): reimplement fetch with hyper instead of reqwest" (#24593)
Originally landed in
f6fd6619e7.
Reverted in https://github.com/denoland/deno/pull/24574.

This reland contains a fix that sends "Accept: */*" header for calls made
from "FileFetcher". Absence of this header made downloading source code
from JSR broken. This is tested by ensuring this header is present in the
test server that servers JSR packages.

---------

Co-authored-by: Sean McArthur <sean@seanmonstar.com>
2024-07-22 22:47:57 +02:00
David Sherret
a84ca673da
fix(workspace): support resolving bare specifiers to npm pkgs within a workspace (#24611)
This makes bare specifiers for npm packages work when inside a
workspace, which emulates the same behaviour as when there's a
node_modules directory. The bare specifier can be overwritten by
specifying an import map entry or package.json dependency entry.

* https://github.com/denoland/deno_config/pull/88

Closes #24605
2024-07-22 22:47:09 +02:00
David Sherret
35cbe2937d
refactor(node): internally add .code() to node resolution errors (#24610)
This makes it easier to tell what kind of error something is (even for
deeply nested errors) and will help in the future once we add error
codes to the JS errors this returns.
2024-07-22 22:47:08 +02:00
Nathan Whitaker
6e6c5ab51a
fix(cli): Create child node_modules for conflicting dependency versions, respect aliases in package.json (#24609)
Fixes #24419.
2024-07-22 22:47:08 +02:00
Nathan Whitaker
9a859318d6
fix(node): Fix --allow-scripts with no deno.json (#24533)
We would resolve the wrong package.json, resulting in an inability to
run CJS (or other node-mode) scripts
2024-07-22 22:47:08 +02:00
David Sherret
ce638654f0
fix(workspace): do not resolve to self for npm pkg depending on matching req (#24591)
Closes #24584
2024-07-22 22:47:08 +02:00
Igor Borisoglebski
9c2adb0b4f
fix(docs): fix some deno.land/manual broken urls (#24557)
Fixing some broken urls found after the docs migration
2024-07-22 22:46:39 +02:00
David Sherret
7caefa963e
fix(init): use bare specifier for jsr:@std/assert (#24581)
Closes #24580
2024-07-22 22:46:39 +02:00
Ryan Dahl
dd83e3fb71
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-22 22:46:39 +02:00
Sean McArthur
aa7e1fc362
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-22 22:46:39 +02:00
denobot
85de4280a1
1.45.2 (#24561)
Co-authored-by: dsherret <dsherret@users.noreply.github.com>
2024-07-12 16:04:46 -04:00
David Sherret
7ef58ae2ba fix(publish): show dirty files on dirty check failure (#24541) 2024-07-12 15:38:48 -04:00
David Sherret
2627f6b5f0 fix(config): regression - should not discover npm workspace for nested deno.json not in workspace (#24559)
Closes #24554
2024-07-12 15:38:48 -04:00
vwh
8e75b63793 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:38:48 -04:00
David Sherret
1bce3ba81e 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 15:38:47 -04:00
David Sherret
79cccc4cca refactor: move importMap with imports/scopes diagnostic to deno_config (#24553) 2024-07-12 15:38:47 -04:00
denobot
c841d163e3
1.45.1 (#24535)
Bumped versions for 1.45.1

Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
2024-07-11 20:46:42 +02: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