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

5160 commits

Author SHA1 Message Date
Marvin Hagemeister
9d1385896f
fix: exclude internal JS files from coverage (#20448) 2023-09-11 13:53:42 +00:00
Nayeem Rahman
4460336fda
fix(lsp): always enable semantic tokens responses (#20440) 2023-09-10 20:09:45 +01:00
Marvin Hagemeister
0b3968c468
chore: speed up test name escapeing (#20439) 2023-09-10 14:07:00 +02:00
David Sherret
c228adc27d
feat: TypeScript 5.2 (#20425)
Without `using` declarations or decorator metadata (waiting for that in
v8).
2023-09-09 15:03:21 -04:00
Nayeem Rahman
f75a17521d
fix(lsp): respect configured exclusions for testing APIs (#20427)
LSP testing APIs now obey the various file inclusion settings:
- Modules shown in the text explorer now respect the `exclude`,
`test.exclude` and `test.include` fields in `deno.json`, as well as
`deno.enablePaths` in VSCode settings.
- Modules with testing code lens now respect the `"exclude"`,
`test.exclude` and `test.include` fields in `deno.json`. Code lens
already respects `deno.enablePaths`.
2023-09-09 19:37:01 +01:00
Matt Mastracci
947865c054
feat(cli): allow --log-level=trace for additional deep debugging (#20426)
This allows us to opt in to extremely detailed tracing from dependency
libraries, like so:

```
cargo run --features tracing/log,tracing/max_level_trace -- test --log-level=trace -A --unstable ./cli/tests/unit/serve_test.ts 
```

It will not impact normal operation as it requires the
`tracing/max_level_trace` and `tracing/log` to be active.

Note that tracing is already a dependency -- this just makes it a direct
dep of cli so we can access its features more easily.
2023-09-09 12:03:19 -06:00
Nayeem Rahman
29ff0bfa9f
Reland "refactor(lsp): clean up "enablePaths" handling (#20388)" (#20423) 2023-09-09 15:04:21 +01:00
David Sherret
c521c5fe77
feat: lockfile v3 (#20424)
Details: https://github.com/denoland/deno_lockfile/pull/8
2023-09-08 14:34:57 -04:00
David Sherret
9cac5601b8
fix(compile): support providing flags as args (#20422)
Closes #20413
2023-09-08 17:14:59 +00:00
David Sherret
1b7d5937d9
fix(fmt/markdown): improve ignore comment handling (#20421)
Two bug fixes:

* https://github.com/dprint/dprint-plugin-markdown/pull/85
* https://github.com/dprint/dprint-plugin-markdown/pull/84
2023-09-08 16:38:42 +00:00
Nayeem Rahman
f3d25af61c
Revert "refactor(lsp): clean up "enablePaths" handling (#20388)" (#20419)
This reverts commit 4a11603c76.
2023-09-08 15:48:26 +00:00
Nayeem Rahman
17276a1df9
fix: empty include in config file excludes all (#20404) 2023-09-08 15:04:45 +01:00
Nayeem Rahman
14522fc628
chore(lsp): remove TestingSettings::enable (#20407) 2023-09-08 12:47:57 +01:00
Curran McConnell
a9cc4631ca
fix(ext/node/ops/zlib/brotli): Allow decompressing more than 4096 bytes (#20301)
Fixes https://github.com/denoland/deno/issues/19816

In that issue, I suggest switching over the other brotli functionality
to the Rust API provided by the `brotli` crate. Here, I only do that
with the `brotli_decompress` function to fix the bug with buffers longer
than 4096 bytes.
2023-09-08 09:11:33 +05:30
Nayeem Rahman
4a11603c76
refactor(lsp): clean up "enablePaths" handling (#20388)
Previously we pre-computed enabled paths into `Config::enabled_paths`,
and had to keep updating it. Now we determine enabled paths directly
from `Config::settings` on demand as a single source of truth.

Removes `Config::root_uri`. If `InitializeParams::rootUri` is given, and
it doesn't correspond to a folder in
`InitializeParams::workspaceFolders`, prepend it to
`Config::workspace_folders` as a mocked folder.

Includes groundwork for
https://github.com/denoland/vscode_deno/issues/908. In a minor version
cycle or two we can fix that in vscode_deno, and it won't break for Deno
versions post this patch due to the corrected deserialization logic for
`enablePaths`.
2023-09-08 00:50:34 +01:00
David Sherret
3fc19dab47
feat: support import attributes (#20342) 2023-09-07 09:09:16 -04:00
Heyang Zhou
01a761f1d4
chore(ext/kv): limit total key size in an atomic op to 80 KiB (#20395)
Keys are expensive metadata. We track it for various purposes, e.g.
transaction conflict check, and key expiration.

This patch limits the total key size in an atomic operation to 80 KiB
(81920 bytes). This helps ensure efficiency in implementations.
2023-09-07 15:07:04 +08:00
Nayeem Rahman
2cbd1b40cb
fix(test): apply filter before checking for "only" (#20389) 2023-09-06 17:07:37 +01:00
Marvin Hagemeister
e0a269c23a
fix: don't show filtered test suites as running (#20385) 2023-09-06 14:54:21 +02:00
Bartek Iwańczuk
147c845c95
feat(test): Add Deno.test.ignore and Deno.test.only (#20365)
Closes https://github.com/denoland/deno/issues/17106
2023-09-06 14:17:33 +02:00
Divy Srivastava
9befa566ec
fix(ext/node): implement AES GCM cipher (#20368)
Adds support for AES-GCM 128/256 bit keys in `node:crypto` and
`setAAD()`, `setAuthTag()` and `getAuthTag()`

Uses https://github.com/littledivy/aead-gcm-stream

Fixes https://github.com/denoland/deno/issues/19836
https://github.com/denoland/deno/issues/20353
2023-09-06 11:01:50 +05:30
sigmaSd
be1fc754a1
feat(lsp): provide the deno.cache command server-side (#20111)
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-09-05 16:36:35 +01:00
zuisong
4a561f12db
fix(node/child_process): don't crash on undefined/null value of an env var (#20378)
Fixes #20373

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-09-05 12:42:35 +02:00
Bartek Iwańczuk
2a1ba2732e
chore: disable 'test-http-content-length.js` test (#20344) 2023-09-04 23:23:01 +02:00
Bartek Iwańczuk
9e243d22f4
Revert "refactor: rewrite ops that use 'deferred' to use 'op2(async(lazy))' (#20303) (#20370)
This reverts commit
83426be6ee.

Includes a regression test.
2023-09-04 17:05:06 -04:00
Nayeem Rahman
12f6ad32c2
fix(lsp): properly handle disabled configuration requests (#20358)
Fixes #19802.

Properly respect when clients do not have the `workspace/configuration`
capability, a.k.a. when an editor cannot provide scoped settings on
request from the LSP.

- Fix one spot where we weren't checking for the capability before
sending this request.
- For `enablePaths`, fall back to the settings passed in the
initialization options in more cases.
- Respect the `workspace/configuration` capability in the test harness
client.

See:
https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#workspace_configuration.
2023-09-02 16:36:04 +01:00
Nayeem Rahman
e1fb48524d
Reland "feat(lsp): enable via config file detection (#20334)" (#20349) 2023-09-01 21:13:13 +01:00
Bartek Iwańczuk
2b191c6e9d
chore: forward v1.36.4 to main (#20352)
Co-authored-by: denobot <33910674+denobot@users.noreply.github.com>
2023-09-01 18:08:58 +00:00
Bartek Iwańczuk
a74554987a
Revert "feat(lsp): enable via config file detection (#20334)" (#20347)
This reverts commit c0dcf6a357.

CC @nayeemrmn
2023-09-01 12:01:20 +00:00
Nayeem Rahman
c0dcf6a357
feat(lsp): enable via config file detection (#20334)
With https://github.com/denoland/vscode_deno/pull/902 for
https://github.com/denoland/vscode_deno/issues/880.

For multi-folder workspaces, note that this only scans the first one and
applies the result to all. That means users would have to still have to
specify `"deno.enable": true/false` for their secondary folders if the
preference is different for those.
2023-08-31 19:10:09 +01:00
Nayeem Rahman
1cce306022
fix(runtime/permissions): Resolve executable specifiers in allowlists and queries (#14130)
Closes #14122.

Adds two extensions to `--allow-run` behaviour:
- When `--allow-run=foo` is specified and `foo` is found in the `PATH`
at startup, `RunDescriptor::Path(which("foo"))` is added to the
allowlist alongside `RunDescriptor::Name("foo")`. Currently only the
latter is.
- When run permission for `foo` is queried and `foo` is found in the
`PATH` at runtime, either `RunDescriptor::Path(which("foo"))` or
`RunDescriptor::Name("foo")` would qualify in the allowlist. Currently
only the latter does.
2023-08-30 18:52:01 +01:00
Nayeem Rahman
d28384c3de
refactor(lsp): store test definitions in adjacency list (#20330)
Previously:
```rust
pub struct TestDefinition {
  pub id: String,
  pub name: String,
  pub range: SourceRange,
  pub steps: Vec<TestDefinition>,
}

pub struct TestDefinitions {
  pub discovered: Vec<TestDefinition>,
  pub injected: Vec<lsp_custom::TestData>,
  pub script_version: String,
}
```
Now:
```rust
pub struct TestDefinition {
  pub id: String,
  pub name: String,
  pub range: Option<Range>,
  pub is_dynamic: bool, // True for 'injected' module, not statically detected but added at runtime.
  pub parent_id: Option<String>,
  pub step_ids: HashSet<String>,
}

pub struct TestModule {
  pub specifier: ModuleSpecifier,
  pub script_version: String,
  pub defs: HashMap<String, TestDefinition>,
}
```

Storing the test tree as a literal tree diminishes the value of IDs,
even though vscode stores them that way. This makes all data easily
accessible from `TestModule`. It unifies the interface between
'discovered' and 'injected' tests. This unblocks some enhancements wrt
syncing tests between the LSP and extension, such as this TODO:
61f08d5a71/client/src/testing.ts (L251-L259)
and https://github.com/denoland/vscode_deno/issues/900. We should also
get more flexibility overall.

`TestCollector` is cleaned up, now stores a `&mut TestModule` directly
and registers tests as it comes across them with
`TestModule::register()`. This method ensures sanity in the redundant
data from having both of `TestDefinition::{parent_id,step_ids}`.

All of the messy conversions between `TestDescription`,
`LspTestDescription`, `TestDefinition`, `TestData` and `TestIdentifier`
are cleaned up. They shouldn't have been using `impl From` and now the
full list of tests is available to their implementations.
2023-08-30 16:31:31 +01:00
Divy Srivastava
329698cf73
fix(napi): ignore tsfn recv error (#20324)
Ref https://github.com/denoland/deno/issues/20072
2023-08-30 09:04:55 +05:30
Ryan Dahl
f76bfbbe33
refactor(init): simplify template (#20325)
- Don't include benchmark file - most people won't need this.
- Use deno.json instead of deno.jsonc, because it's a more common file
  format.
2023-08-29 19:58:56 +00:00
Matt Mastracci
64045ebc7a
chore(cli): use NPM_CONFIG_REGISTRY for all tests (#20320)
We never want tests to hit the real npm registry because this causes
test flakes. In addition, we set a sentinal "unset" value for
`NPM_CONFIG_REGISTRY` to ensure that all tests requiring npm go through
the test server.
2023-08-29 13:02:54 -06:00
Igor Zinkovsky
441b860978
fix(ext/kv): don't panic if listening on queues and KV is not closed (#20317)
fixes #20312
2023-08-29 11:24:44 -07:00
David Sherret
c4451d3076
feat(lockfile): add redirects to the lockfile (#20262) 2023-08-29 12:03:02 -05:00
David Sherret
bdc91211b0
fix(lsp): recreate npm search cache when cache path changes (#20327) 2023-08-29 16:24:19 +00:00
Nayeem Rahman
b5f032df73
feat(lsp): npm specifier completions (#20121) 2023-08-29 10:22:05 -05:00
Bartek Iwańczuk
2929313652
fix(node/http): don't leak resources on destroyed request (#20040)
Closes https://github.com/denoland/deno/issues/19828
2023-08-29 12:13:58 +00:00
Nayeem Rahman
c31c93ce70
fix(lsp): delete test modules with all tests deleted (#20321)
Fixes https://github.com/denoland/vscode_deno/issues/899.
2023-08-29 09:43:11 +01:00
Yoshiya Hinosawa
fb7092fb43
fix(ext/node): fix argv[1] in Worker (#20305) 2023-08-29 12:18:25 +09:00
Nayeem Rahman
bd034e360d
refactor(runtime): factor out code between build.rs and worker.rs (#20299)
Adds `runtime/shared.rs` which is imported by both `build.rs` and the
rest of the crate, containing utilities used by both.
Renames the `snapshot_from_snapshot` feature to
`exclude_runtime_main_js` since that's what it does and it's relevant
outside of snapshotting when `__runtime_js_sources` is specified.
2023-08-28 15:30:46 -06:00
Matt Mastracci
7adaf613bf
fix(ext/node): shared global buffer unlock correctness fix (#20314)
The fix for #20188 was not entirely correct -- we were unlocking the
global buffer incorrectly. This PR introduces a lock state that ensures
we only unlock a lock we have taken out.
2023-08-28 15:28:39 -06:00
Matt Mastracci
9198bbd454
fix(ext/http): don't panic on stream responses in cancelled requests (#20316)
When a TCP connection is force-closed (ie: browser refresh), the
underlying future we pass to Hyper is dropped which may cause us to try
to drop the body resource while the OpState lock is still held.

Preconditions for this bug to trigger:

 - The body resource must have been taken
- The response must return a resource (which requires us to take the
OpState lock)
 - The TCP connection must have been dropped before this

Fixes #20315 and #20298
2023-08-28 13:29:34 -06:00
Marvin Hagemeister
539e5032d3
fix: unexpected lsp function arg comma completion (#20311) 2023-08-28 17:07:22 +02:00
David Sherret
ebfead1021
fix(fmt/markdown): ignore trailing words in code block info string for language detection (#20310) 2023-08-28 12:28:06 +00:00
osddeitf
c2547ba039
fix(node/http): correctly send Content-length header instead of Transfer-Encoding: chunked (#20127)
Fix #20063.
2023-08-28 09:32:54 +02:00
Nayeem Rahman
f826574873
test(bench): mark explicit timer test as flaky (#20304)
https://github.com/denoland/deno/actions/runs/5990043261/job/16246927846?pr=18642

The test is just `b.start(); b.end()` where the time measured between
must be less 10 μs during warmup. Can't improve it.
Also fixes doc mistake.
2023-08-27 22:22:23 +02:00
sigmaSd
916ddcef6d
feat(lint): --rules print all rules (#20256)
The motivation is If I'm using deno lint --rules, I want to see all the
rules especially the one that have no tags, since the recommend ones are
already active

This change also prints the tags associated with the rule inline.
2023-08-27 11:17:41 +02:00