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

750 commits

Author SHA1 Message Date
Nayeem Rahman
ac464ead49
feat(jupyter): support Deno.test() (#20778) 2023-10-05 21:45:11 +01:00
Nayeem Rahman
64f9155126
fix(lsp): show diagnostics for type imports from untyped deps (#20780) 2023-10-05 01:38:11 +01:00
David Sherret
54fcf539c8
fix(npm): upgrade to deno_npm 0.15.2 (#20772)
* fix: handle optional deps not found in dependencies map
(https://github.com/denoland/deno_npm/pull/38)
* fix: resolve a version requirement to the latest dist tag if it
matches (https://github.com/denoland/deno_npm/pull/37)

Closes #20771
2023-10-03 17:35:47 +00:00
Luca Casonato
d5b6c636b0
fix(ext/node): don't call undefined nextTick fn (#20724)
The `process` global is not defined in this file.

Fixes #20441

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-10-02 14:13:57 +02:00
Nayeem Rahman
2d1af0cf51
feat(lsp): jupyter notebook analysis (#20719) 2023-09-29 20:44:59 +01:00
Nayeem Rahman
b433133a1f
fix(lsp): allow query strings for "deno:/status.md" (#20697) 2023-09-27 01:48:34 +01:00
Bartek Iwańczuk
46a4bd5178
feat(unstable): add Deno.jupyter.broadcast API (#20656)
Closes https://github.com/denoland/deno/issues/20591

---------

Co-authored-by: Kyle Kelley <rgbkrk@gmail.com>
2023-09-27 02:21:06 +02:00
Nayeem Rahman
cb154d6afa
chore(lsp): bump tower-lsp to 0.20.0 (#20693) 2023-09-26 21:57:14 +01:00
Nayeem Rahman
bb4b00df92
feat(lsp): cache all dependencies quick fix (#20665) 2023-09-24 23:33:52 +01:00
Nayeem Rahman
98ef7bd818
fix(lsp): resolve remote import maps (#20651) 2023-09-24 18:00:15 +01:00
Nayeem Rahman
33f84321b2
refactor(lsp): implement "deno.cacheOnSave" server-side (#20632) 2023-09-24 17:59:42 +01:00
Nayeem Rahman
d955d66a3f
fix(lsp): show related information for tsc diagnostics (#20654) 2023-09-24 08:18:51 +01:00
Nayeem Rahman
a4ac6a3f5f
refactor(lsp): store language sections in WorkspaceSettings (#20593)
When sending configuration requests to the client, reads `javascript`
and `typescript` sections in addition to `deno`.

The LSP's initialization options now accepts `javascript` and
`typescript` namespaces.
2023-09-21 06:46:39 +01:00
Nayeem Rahman
40122d7f2a
fix(lsp): force correct media type detection from tsc (#20562) 2023-09-19 16:37:27 +01:00
await-ovo
dc1da30927
fix(cli): for main-module that exists in package.json, use the version defined in package.json directly (#20328) 2023-09-18 20:02:58 +00:00
Nayeem Rahman
86c04f43e0
fix(lsp): pass quote preference to tsc (#20547) 2023-09-18 20:48:32 +01:00
Nayeem Rahman
f7ba701304
fix(lsp): prefer local auto-import specifiers (#20539)
Give auto-import completion entries a sort-text suffix depending on if
the specifier parses as a URL. This will favour relative and bare
(likely import-mapped) specifiers.
2023-09-18 19:55:24 +01:00
Nayeem Rahman
87ddd1f04d
fix(lsp): restore tsc's quick fix ordering (#20545) 2023-09-18 17:39:28 +01:00
David Sherret
0709c051f8
feat(unstable): package manager (#20517)
Adds an experimental unstable built-in package manager to Deno, but it is
currently not usable because the registry infrastructure hasn't been
setup and it points to a non-existent url by default. The default
registry url can be configured via the `DENO_REGISTRY_URL` environment
variable.
2023-09-18 10:46:44 -04:00
Bartek Iwańczuk
4fcd9a0de8
fix(lsp): sort quickfix actions (#17221)
This commit changes ordering of quickfix actions, by sorting them in
following order:

- TSC fixes
- Deno fixes
- deno_lint fixes

Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-09-17 19:05:19 +01:00
Nayeem Rahman
d13e6e6db8
feat(lsp): include source in auto import completion label (#20523) 2023-09-16 15:51:35 +01:00
Nayeem Rahman
11f0ccf805
fix(test): share fail fast tracker between threads (#20515) 2023-09-15 15:46:48 +00:00
David Sherret
6dc8682b9a
feat: explicit resource management in TypeScript (#20506)
This adds support for `using` and `await using` declarations in
TypeScript only. We need to wait for v8 to support it for this to work
in JS.
2023-09-14 18:08:59 +00:00
David Sherret
e66d3c2c2e
refactor: remove DENO_UNSTABLE_NPM_SYNC_DOWNLOAD and custom sync functionality (#20504)
https://github.com/denoland/deno/pull/20488 enables us to remove this
functionality. This is better because our test suite is now not testing
a separate code path.
2023-09-14 17:51:28 +00:00
David Sherret
54890ee98b
chore(tests): ability to pattern match unordered lines (#20488)
This adds the ability to pattern match unordered lines. For example, the
downloading messages may appear in any order

```
[UNORDERED_START]
Download https://localhost:4546/a.ts
Download https://localhost:4546/b.ts
[UNORDERED_END]
Hello!
```

Additionally, I've made the pattern matching slightly more strict and the output better.
2023-09-14 16:21:57 +00:00
Luca Casonato
851f795001
fix: output traces for op sanitizer in more cases (#20494)
This adds traces for the "started outside test, closed inside test"
case.
2023-09-14 16:38:15 +02:00
Nayeem Rahman
022664aab4
feat(lsp): WorkspaceSettings::disablePaths (#20475) 2023-09-13 17:30:27 +01:00
Leigh McCulloch
4a8b873111
fix(init): skip existing files instead of erroring (#20434)
### What
Skip writing files from the template if the files already exist in the
project directory.

### Why
When I run deno init in a directory that already has a main.ts, or one
of the other template files, I usually want to initialize a workspace
around a file I've started working in. A hard error in this case seems
counter productive. An informational message about what's being skipped
seems sufficient.

Close #20433
2023-09-12 12:55:26 +02:00
Bartek Iwańczuk
f32acb945e
refactor: rewrite ext/io, ext/webstorage ops to op2 (#20461) 2023-09-12 12:42:05 +02:00
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
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
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
3fc19dab47
feat: support import attributes (#20342) 2023-09-07 09:09:16 -04: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
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
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
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
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
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
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
林炳权
2080669943
chore: update to Rust 1.72 (#20258)
<!--
Before submitting a PR, please read https://deno.com/manual/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.
-->

As the title.

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-26 22:04:12 -06:00
Nayeem Rahman
5dbf5c8293
fix(bench): explicit timers don't force high precision measurements (#20272)
Disables `BenchContext::start()` and `BenchContext::end()` for low
precision benchmarks (less than 0.01s per iteration). Prints a warning
when they are used in such benchmarks, suggesting to remove them.

```ts
Deno.bench("noop", { group: "noops" }, () => {});

Deno.bench("noop with start/end", { group: "noops" }, (b) => {
  b.start();
  b.end();
});
```

Before:
```
cpu: 12th Gen Intel(R) Core(TM) i9-12900K
runtime: deno 1.36.2 (x86_64-unknown-linux-gnu)

file:///home/nayeem/projects/deno/temp3.ts
benchmark                    time (avg)        iter/s             (min … max)       p75       p99      p995
----------------------------------------------------------------------------- -----------------------------


noop                          2.63 ns/iter 380,674,131.4    (2.45 ns … 27.78 ns)   2.55 ns   4.03 ns   5.33 ns
noop with start and end     302.47 ns/iter   3,306,146.0     (200 ns … 151.2 µs)    300 ns    400 ns    400 ns

summary
  noop
   115.14x faster than noop with start and end
```

After:
```
cpu: 12th Gen Intel(R) Core(TM) i9-12900K
runtime: deno 1.36.1 (x86_64-unknown-linux-gnu)

file:///home/nayeem/projects/deno/temp3.ts
benchmark                    time (avg)        iter/s             (min … max)       p75       p99      p995
----------------------------------------------------------------------------- -----------------------------


noop                          3.01 ns/iter 332,565,561.7    (2.73 ns … 29.54 ns)   2.93 ns   5.29 ns   7.45 ns
noop with start and end       7.73 ns/iter 129,291,091.5    (6.61 ns … 46.76 ns)   7.87 ns  13.12 ns  15.32 ns
Warning start() and end() calls in "noop with start and end" are ignored because it averages less than 0.01s per iteration. Remove them for better results.

summary
  noop
   2.57x faster than noop with start and end
```
2023-08-26 11:29:45 +02:00
Nayeem Rahman
37292e74e1
fix(lsp): implement deno.suggest.completeFunctionCalls (#20214)
Fixes https://github.com/denoland/vscode_deno/issues/743.
```ts
const items: string[] = ['foo', 'bar', 'baz'];

items.map
// ->
items.map(callbackfn) // auto-completes with argument placeholders.
```

---

We have our own setting for `suggest.completeFunctionCalls`, which must
be enabled:
```js
{
    "deno.suggest.completeFunctionCalls": true,
    // Re-implementation of:
    // "javascript.suggest.completeFunctionCalls": true,
    // "typescript.suggest.completeFunctionCalls": true,
}
```
But before this commit the actual implementation had been left as a TODO.
2023-08-26 02:53:44 +02:00
Valentin Anger
a526cff0a9
feat(cli/tools): add TAP test reporter (#14390) (#20073)
This PR adds a test reporter for the [Test Anything
Protocol](https://testanything.org).

It makes the following implementation decisions:
- No TODO pragma, as there is no such marker in `Deno.test`
- SKIP pragma for `ignore`d tests
- Test steps are treated as TAP14 subtests
  - Support for this in consumers seems spotty
- Some consumers will incorrectly interpret these markers, resulting in
unexpected output
- Considering the lack of support, and to avoid implementation
complexity,
subtests are at most one level deep (all test steps are in the same
subtest)
- To accommodate consumers that use comments to indicate test-suites
(unspecced)
  - The test module path is output as a comment
  - This is disabled for `--parallel` testing
- Failure diagnostics are output as JSON, which is also valid YAML
- The structure is not specified, so the format roughly follows the spec
example:
  ```
  ---
  message: "Failed with error 'hostname peebles.example.com not found'"
  severity: fail
  found:
    hostname: 'peebles.example.com'
    address: ~
  wanted:
    hostname: 'peebles.example.com'
    address: '85.193.201.85'
  at:
    file: test/dns-resolve.c
    line: 142
  ...
  ```
2023-08-26 01:19:23 +02:00