Commit graph

3962 commits

Author SHA1 Message Date
Bartek Iwańczuk 5dea510b02
fix(lock): autodiscovery of lockfile (#16498)
This commit adds autodiscovery of lockfile. 

This only happens if Deno discovers the configuration file (either 
"deno.json" or "deno.jsonc"). In such case Deno tries to load
"deno.lock"
file that sits next to the configuration file, or creates one for user
if
the lockfile doesn't exist yet.

As a consequence, "--lock" and "--lock-write" flags had been updated.
"--lock" no longer requires a value, if one is not provided, it defaults
to "./deno.lock" resolved from the current working directory.
"--lock-write"
description was updated to say that it forces to overwrite a lockfile.

Autodiscovery is currently not handled by the LSP.
2022-11-02 16:32:30 +01:00
Bartek Iwańczuk 630abb58b0
refactor: Combine ImportMapResolver and JsxResolver (#16508)
These resolvers are used in `deno_graph` APIs. Combining them removes a
lot of code and
unblocks me on https://github.com/denoland/deno/pull/16157
2022-11-02 15:47:02 +01:00
David Sherret 5e4e324ceb
fix(lockfile): error if a referenced package id doesn't exist in list of packages (#16509)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-11-02 01:07:45 +00:00
Bartek Iwańczuk 89c5aa8598
fix(lock): Additive lock file (#16500)
This commit changes lockfile to be "additive" - ie. integrity check only fails if
file/package is already specified in the lockfile, but its integrity doesn't match.

If file/package is not present in the lockfile, it will be added to the lockfile and
the lockfile will be written to disk.
2022-11-01 00:07:36 +01:00
David Sherret cb08b4683f
feat(unstable/npm): deno info --json support for npm specifiers (#16472) 2022-10-31 10:25:46 -04:00
Bartek Iwańczuk c962cd4241
chore: remove stale comments (#16491)
Just a drive-by, noticed some stale comments that haven't been removed
earlier.
2022-10-31 14:14:35 +01:00
sigmaSd b07a753756
fix(tools): show correct upgrade command for upgrading canary (#16486) 2022-10-31 11:48:28 +01:00
Shogo Hida 80ed54a4b6
fix(test): add slice method to filename to make them portable (#16482)
In order for test cases to pass regardless of each individual's environment,
this commit adds calls to `slice` method when printing the filenames so
we can avoid getting `console.log` to truncate them.

Fixes #16305
2022-10-31 12:46:59 +09:00
Bartek Iwańczuk 05eb4d1084
chore: remove stable unstable APIs from cli/diagnostics.rs (#16492)
All these APIs are now stable
2022-10-30 23:07:41 +01:00
Geert-Jan Zwiers 94a5103b04
fix: update env to sys permission in jsdoc for Deno.osRelease (#16483)
This API needs `--allow-sys` permissions nowadays, but the docs still
mention `--allow-env` permissions.

```
deno run .\file.ts
⚠️  ┌ Deno requests sys access to "osRelease".
   ├ Requested by `Deno.osRelease()` API      
   ├ Run again with --allow-sys to bypass this prompt.
   └ Allow? [y/n] (y = yes, allow; n = no, deny) >
```
2022-10-30 21:50:34 +01:00
Bartek Iwańczuk 3922ceda03
test: disable run_watch_external_watch_files on macOS (#16477)
This test has hung a lot recently on macOS. I am not sure if this is
because of a bug in the test or because of the macOS runner that is extremely
slow and flaky in general.
2022-10-30 21:25:15 +01:00
Marcos Casagrande 207dd8d111
fix(napi): fix is_detached_arraybuffer (#16478) 2022-10-30 13:13:46 -04:00
Kenta Moriuchi 59ac110edd
fix(core): fix APIs not to be affected by Promise.prototype.then modification (#16326) 2022-10-29 18:25:23 +09:00
David Sherret edaceecec7
feat: support npm specifiers in deno info for display text output only (#16470) 2022-10-28 16:19:55 -04:00
Bartek Iwańczuk 2c674dcd20
refactor(npm): reorganize initialization of compat layer (#16471)
Ensures that "std/node" graph is analyzed only once.
2022-10-28 21:53:55 +02:00
David Sherret 7c80f15020
fix(lsp): correct parameterNames.suppressWhenArgumentMatchesName and variableTypes.suppressWhenTypeMatchesName (#16469)
Closes #16468
2022-10-28 14:48:14 -04:00
Bartek Iwańczuk d1d42e6ba7
fix(upgrade): don't prompt if latest version is older than current binary (#16464) 2022-10-28 18:43:49 +02:00
David Sherret 5cd82b84bb
chore: pin lsp types due to unstable "proposed" feature (#16467)
The "proposed" feature that we depend upon in tower-lsp, turns on the
"proposed" feature in lsp-types which has breaking changes in patch
releases because it's explicitly unstable. We need to pin it to prevent
it breaking cargo publish.
2022-10-28 11:38:56 -04:00
David Sherret 56d5cb21b0
refactor: move deno info functionality from deno_graph to CLI (#16434)
Closes #16423
2022-10-28 11:03:33 -04:00
Filip Skokan ec09134d8a
fix(ext/crypto): fix HMAC jwk import "use" check (#16465) 2022-10-28 19:50:38 +05:30
Divy Srivastava e18950284f
Reland "perf(core): generate inlined wrappers for async ops" (#16455)
Reland https://github.com/denoland/deno/pull/16428
2022-10-28 16:50:17 +05:30
David Sherret a4d4acd1af
chore(npm): add explicit tests for module.exports assignment with type checking (#16435) 2022-10-27 17:54:46 -04:00
Colin Ihrig 1376c6932f
fix: finish stabilizing Deno.osRelease() (#16447)
Fixes: https://github.com/denoland/deno/issues/16446
2022-10-27 16:56:06 -04:00
Bartek Iwańczuk c27942fee4
fix(lsp): add ServerCapabilities::encoding (#16444)
This caused v1.27.0 publishing to fail.
2022-10-27 19:34:44 +02:00
denobot b0fb8fa9dc
1.27.0 (#16442)
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-27 17:13:26 +02:00
Divy Srivastava 115cc1e6ae
Revert "perf(core): generate inlined wrappers for async ops (#16428)" (#16443) 2022-10-27 16:58:27 +02:00
Divy Srivastava 02187966c1
perf(core): generate inlined wrappers for async ops (#16428)
V8's JIT can do a better job knowing the argument count and also enable
fast call path (in future).

This also lets us call async ops without `opAsync`:

```js
const { ops } = Deno.core;
await ops.op_void_async();
```

this patch: 4405286 ops/sec
main: 3508771 ops/sec
2022-10-27 19:10:48 +05:30
David Sherret bfd9912e1f
fix(typescript): allow synthetic default imports when using ModuleKind.ESNext (#16438)
Closes #16437
2022-10-27 08:12:40 -04:00
David Sherret 65f12f571b
fix(cli): do not log update checker when log level is quiet (#16433)
Co-authored-by: lucacasonato <hello@lcas.dev>
2022-10-26 21:20:41 +00:00
Colin Ihrig 37340e2386
chore(unstable): rename Deno.getUid() and Deno.getGid() (#16432)
This commit renames `Deno.getUid()` to `Deno.uid()` and renames
`Deno.getGid()` to `Deno.gid()`.
2022-10-26 16:37:48 -04:00
Luca Casonato f4f1f4f0b6
feat(ext/net): reusePort for TCP on Linux (#16398) 2022-10-26 19:04:27 +00:00
Leo Kettmeir 6ac603ec88
feat(runtime): make kill signal optional (#16299)
This commit changes "Deno.kill()" method to have a default
value, that is "SIGTERM".
2022-10-26 19:53:16 +02:00
David Sherret 678ac5757b
fix(compile): show an error when using npm specifiers (#16430)
Closes #16427
2022-10-26 13:55:26 +00:00
Kitson Kelly a0d10efbb1
chore: improve built-in API documentation (#16158)
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Colin Ihrig <cjihrig@gmail.com>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-26 15:53:48 +02:00
doi yuki 5d45d2a7e0
fix(upgrade): Added error message when using canary option with M1 (#16382)
before
```
Looking up latest version
Found latest version 8c9e6c5565
Checking https://dl.deno.land/canary/8c9e6c5565c1c00437d083de76cdd944e44b1d99/deno-aarch64-apple-darwin.zip
Download could not be found, aborting
```

after
```
Looking up latest canary version
Found latest version 8c9e6c5565
error: Canary builds are not available for M1
```

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-10-26 15:51:22 +02:00
Cre3per 193b8828c5
feat(cli): show error cause recursion information (#16384) 2022-10-26 15:37:45 +02:00
Bartek Iwańczuk 046ab7dc8a
feat: Stabilize Deno.osRelease() API (#15973)
Closes https://github.com/denoland/deno/issues/15928
2022-10-26 14:18:58 +02:00
David Sherret 4d166e638f
feat(task): support sleep suffixes (#16425)
Co-authored-by: sigmaSd <sigmasd@users.noreply.github.com>
2022-10-25 21:14:08 -04:00
Bartek Iwańczuk ab0c33ebf8
feat: Stabilize Deno.consoleSize() API (#15933)
This commit stabilizes "Deno.consoleSize()" API. 

There is one change compared to previous unstable API,
in that the API doesn't accept any arguments. Console size
is established by querying syscalls for stdio streams at fd
0, 1 and 2.
2022-10-26 00:23:21 +02:00
Colin Ihrig 378e6a8c03
feat: stabilize Deno.utime() and Deno.utimeSync() (#16421) 2022-10-25 15:23:36 -04:00
Bartek Iwańczuk 1f6aeb430b
fix: listenTlsWithReuseAddr test (#16420) 2022-10-25 20:15:20 +02:00
Colin Ihrig ffff814540
feat: stabilize Deno.futime() and Deno.futimeSync() (#16415) 2022-10-25 14:03:05 -04:00
David Sherret 3f22f912ec
chore: fix flaky esm_module_deno_test test (#16419) 2022-10-25 13:18:54 -04:00
Bartek Iwańczuk 9835b095e5
fix(npm): add support for npm packages in lock files (#15938)
This commit adds support for npm packages in the lock file.
2022-10-25 18:20:07 +02:00
Ikko Ashimine 10c3c0ee57
chore(napi): fix typo in README.md (#16414)
Enviornment -> Environment
2022-10-25 12:18:02 -04:00
David Sherret e203bd9c5a
fix: upgrade swc_ecma_parser to 0.122.19 - deno_ast 0.20 (#16406) 2022-10-25 11:55:57 -04:00
Colin Ihrig 606db35ccb
feat: stabilize Deno.loadavg() (#16412) 2022-10-25 11:21:14 -04:00
Marcos Casagrande 34fb380ed3
feat(ext/web): use ArrayBuffer.was_detached() (#16307)
This PR adds a way to reliably check if an ArrayBuffer was detached
2022-10-25 14:22:37 +02:00
Brenley Dueck a189c5393e
feat(lint): add a report lint config setting (#16045)
Builds off this PR to add a "report" setting to deno.json which can be
"pretty", "compact", or "json".
2022-10-25 14:21:20 +02:00
Marcos Casagrande ac5fcf626a
perf(ext/web): add op_encode_binary_string (#16352)
Add a new op to use in `reader.readAsBinaryString(blob)`.

```
File API binary string: 400b    35.12 µs/iter    (21.93 µs … 3.27 ms)  31.87 µs 131.95 µs 217.63 µs
File API binary string: 4kb     46.49 µs/iter    (29.36 µs … 4.42 ms)   42.5 µs 122.48 µs  155.1 µs
File API binary string: 2.2mb    4.17 ms/iter     (1.75 ms … 8.54 ms)   5.48 ms   7.39 ms   8.54 ms
```

**main**

```
benchmark                          time (avg)             (min … max)       p75       p99      p995
--------------------------------------------------------------------- -----------------------------
File API binary string: 400b    56.17 µs/iter  (43.09 µs … 784.52 µs)   49.6 µs 177.18 µs 241.23 µs
File API binary string: 4kb     277.2 µs/iter   (240.29 µs … 1.84 ms) 269.87 µs 649.79 µs 774.46 µs
File API binary string: 2.2mb  180.03 ms/iter (173.32 ms … 194.35 ms) 182.54 ms 194.35 ms 194.35 ms
```

It can also handle bigger files, when encoding a 200mb file, main
crashes with OOM

```
<--- Last few GCs --->

[132677:0x560504676550]     5012 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms  (average mu = 0.824, current mu = 0.825) allocation failure; 
[132677:0x560504676550]     5038 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms  (average mu = 0.824, current mu = 0.825) allocation failure; 
[132677:0x560504676550]     5064 ms: Scavenge 417.3 (434.6) -> 401.8 (434.6) MB, 0.1 / 0.0 ms  (average mu = 0.824, current mu = 0.825) allocation failure;
```
2022-10-24 20:27:22 +02:00