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

2166 commits

Author SHA1 Message Date
David Sherret
e0429e2ad6
fix(repl): improve package.json support (#18497)
1. Fixes a cosmetic issue in the repl where it would display lsp warning
messages.
2. Lazily loads dependencies from the package.json on use.
3. Supports using bare specifiers from package.json in the REPL.

Closes #17929
Closes #18494
2023-03-30 10:43:16 -04:00
Yoshiya Hinosawa
3deade4b14
chore(ext/node): run node compat parallel tests in core number concurrency (#18505)
We currently run the all test cases in `parallel` category at the same
time, which invokes hundreds process at the same time, and that seems
causing some flakiness in CI. (maybe related to #18487)

This PR limits the concurrency to the number of cpu cores. This is more
aligned to how Node.js run their `parallel` test in their repository.
42c4a35952/Makefile (L356)
2023-03-30 16:35:45 +02:00
Bartek Iwańczuk
d418f792a9
test: fix test_check_origin_not_supported (#18504)
Merge of dotland and dotcom caused this test to fail.
2023-03-30 19:17:39 +05:30
Andrew Nester
bacbf94925
test(ext/node): add timers_tests.ts from std/node (#18472) 2023-03-29 18:34:37 +09:00
Andrew Nester
04399d138e
test(ext/node): add string_decoder_test.ts from std/node (#18473) 2023-03-29 18:32:29 +09:00
David Sherret
b5d3eb5c23
chore: fix flaky pty_internal_repl (#18486) 2023-03-29 00:25:28 +00:00
Bartek Iwańczuk
ceab7a8d23
test(lsp): make lsp_completions_auto_import more robust (#18482)
A completely unrelated change in
https://github.com/denoland/deno/pull/18286 threw of this test.

These changes make it more robust and easier to update in such cases.
2023-03-28 23:58:12 +02:00
David Sherret
6fb6b0c1f3
chore: restore pty tests and make them run on the Linux CI (#18424)
1. Rewrites the tests to be more back and forth rather than getting the
output all at once (which I believe was causing the hangs on linux and
maybe mac)
2. Runs the pty tests on the linux ci.
3. Fixes a bunch of tests that were just wrong.
4. Adds timeouts on the pty tests.
2023-03-28 21:49:00 +00:00
Ryan Dahl
35fd8583ef
refactor: move shared library tests to their own file (#18479) 2023-03-28 13:40:43 -04:00
Kamal Singh
e789f813f9
test(node/fs): add fs.Dir tests (#18463)
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2023-03-28 23:58:40 +09:00
Yoshiya Hinosawa
4358ab2d84
fix(ext/node): implement crypto.Sign (RSA/PEM/SHA{224,256,384,512}) (#18471) 2023-03-28 21:46:48 +09:00
Divy Srivastava
10012c2fe3
feat(ext/node): add crypto.checkPrime API (#18465)
Towards #18455 

This commit implements `checkPrimeSync` and `checkPrime` in node:crypto
using the Miller-Rabin primality test (fun fact: it actually is a test
for composite numbers)

It first compares the candidate against many known small primes and if
not, proceeds to run the Miller-Rabin primality test.
http://nickle.org/examples/miller-rabin.5c used as reference
implementation.
2023-03-28 10:56:38 +00:00
Divy Srivastava
67e21e71ce
chore(ext/node): port pbkdf2 to Rust (#18470)
Towards #18455
2023-03-28 09:40:56 +00:00
Andrew Nester
d0a0ff680e
chore: add test for Linux shared libraries (#18461)
Closes #18266
2023-03-28 09:00:19 +00:00
Matt Mastracci
86c3c4f343
feat(core): initialize SQLite off-main-thread (#18401)
This gets SQLite off the flamegraph and reduces initialization time by
somewhere between 0.2ms and 0.5ms. In addition, I took the opportunity
to move all the cache management code to a single place and reduce
duplication. While the PR has a net gain of lines, much of that is just
being a bit more deliberate with how we're recovering from errors.

The existing caches had various policies for dealing with cache
corruption, so I've unified them and tried to isolate the decisions we
make for recovery in a single place (see `open_connection` in
`CacheDB`). The policy I chose was:

 1. Retry twice to open on-disk caches
 2. If that fails, try to delete the file and recreate it on-disk
3. If we fail to delete the file or re-create a new cache, use a
fallback strategy that can be chosen per-cache: InMemory (temporary
cache for the process run), BlackHole (ignore writes, return empty
reads), or Error (fail on every operation).

The caches all use the same general code now, and share the cache
failure recovery policy.

In addition, it cleans up a TODO in the `NodeAnalysisCache`.
2023-03-27 22:01:52 +00:00
Marvin Hagemeister
8c051dbd1a
fix(ext/node): add missing _preloadModules hook (#18447)
This internal node hook is used by libraries such as `ts-node` when used
as a require hook `node -r ts-node/register`. That combination is often
used with test frameworks like `mocha` or `jasmine`.

We had a reference to `Module._preloadModules` in our code, but the
implementation was missing. While fixing this I also noticed that the
`fakeParent` module that we create internally always threw because of
the `pathDirname` check on the module id in the constructor of `Mdoule`.
So this code path was probably broken for a while.

```txt
✖ ERROR: Error: Empty filepath.
    at pathDirname (ext:deno_node/01_require.js:245:11)
    at new Module (ext:deno_node/01_require.js:446:15)
    at Function.Module._resolveFilename (ext:deno_node/01_require.js:754:28)
    at Function.resolve (ext:deno_node/01_require.js:1015:19)
```
2023-03-27 21:54:22 +02:00
Geert-Jan Zwiers
a29d88b43b
feat(bench): add --no-run flag (#18433) 2023-03-26 14:55:58 +00:00
Max Dahlgren
701099b2a9
test(ext/node): Port crypto tests from std/node (#18382) 2023-03-26 10:03:10 +00:00
Nayeem Rahman
b4c61c146a
fix(cli): don't store blob and data urls in the module cache (#18261) 2023-03-26 12:24:10 +03:00
Nayeem Rahman
8a4865c379
feat(test): print pending tests on sigint (#18246) 2023-03-25 21:32:11 +02:00
Geert-Jan Zwiers
e4c60bc1c6
chore(tests): enable single_compile_with_reload again (#18196) 2023-03-25 09:59:39 +00:00
Heyang Zhou
27834dfc10
chore(ext/kv): add limits (#18415) 2023-03-25 15:29:36 +08:00
Yoshiya Hinosawa
70e2e8f2dd
fix(ext/node): add aes-128-ecb algorithm support (#18412) 2023-03-25 15:42:07 +09:00
Divy Srivastava
d740a9e43d
feat(ext/node): implement crypto.createSecretKey (#18413)
This commit adds the `crypto.createSecretKey` API.

Key management: This follows the same approach as our WebCrypto
CryptoKey impl where we use WeakMap for storing key material and a
handle is passed around, such that (only internal) JS can access the key
material and we don't have to explicitly close a Rust resource.

As a result, `createHmac` now accepts a secret KeyObject.

Closes https://github.com/denoland/deno/issues/17844
2023-03-24 14:13:26 +00:00
Yoshiya Hinosawa
3d75fb2be7
fix(ext/node): make cipher/decipher transform stream (#18408) 2023-03-24 22:29:14 +09:00
Heyang Zhou
94ef428b56
fix(ext/kv): add missing getMany method (#18410)
The `getMany` method was missing from the implementation of the
`Deno.Kv` class. This patch fixes it.
2023-03-24 20:06:27 +08:00
Cre3per
eb25e50edb
fix(cli): restore deno run - to handle stdin as typescript (#18391)
Bug reported here shortly after merging `--ext` changes
https://github.com/denoland/deno/pull/17172#issuecomment-1480898098

Also found a missing `--check` in integration tests for `--ext` that
would have missed a bug if there was one.

Fixes #18392
2023-03-23 12:45:43 -04:00
David Sherret
81c5ddf9f2
fix(inspect): ensure non-compact output when object literal has newline in entry text (#18366)
Fixes `Deno.inspect` to make an object literal non-compact when an entry
has multiple lines in it.
2023-03-23 10:58:53 -04:00
Ryan Dahl
a3529d0232
refactor(ext/node): Use Deno.inspect (#17960)
No need for two almost identical implementations of the same thing

---------

Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-03-23 10:01:07 -04:00
David Sherret
64f491422b
fix(lsp): ensure enablePaths works when clients do not provide a trailing slash for workspace dir (#18373)
Closes https://github.com/denoland/vscode_deno/issues/827
2023-03-23 01:58:38 +00:00
Heyang Zhou
533e33131f
fix(ext/kv): reverse mapping between AnyValue::Bool and KeyPart::Bool (#18365)
Previously the mapping between `AnyValue::Bool` and `KeyPart::Bool` was
inverted.

This patch also allows using the empty key `[]` as range start/end to
`snapshot_read`.
2023-03-22 21:53:16 +01:00
Heyang Zhou
a117d3d91e
chore(ext/kv): disable ci tests on darwin (#18364)
https://github.com/denoland/deno/issues/18363
2023-03-22 20:46:26 +01:00
Ryan Dahl
f9c8d98b77
Revert "refactor: rename Deno.openKv() to Deno.kv() (#18349)" (#18362)
This reverts commit 50b793c9ed.
2023-03-22 20:23:36 +01:00
Bartek Iwańczuk
df614ff6e5
test: ignore flaky node:child_process tests (#18360) 2023-03-22 18:39:13 +00:00
Matt Mastracci
03e236b614
chore(cli): measure performance against wall-clock (#18357)
Fixes test flake by requiring perf to be <150% of wall-clock time rather
than <500ms.
2023-03-22 18:06:29 +00:00
Matt Mastracci
79fb3b1f35
chore(cli): ensure no signal on test exit (#18354)
If deno crashes on exit, we get a failure on the exit code (None instead
of Some(0) but we never see the signal.
2023-03-22 18:00:07 +00:00
Matt Mastracci
42d13c4e6a
chore(cli): disable flash_test as it is causing SIGSEGV (#18358) 2023-03-22 13:42:50 -04:00
Bartek Iwańczuk
2ac2906b2b
test: ignore fetchWithInvalidContentLength and fetchConnectionError on Windows (#18351)
https://github.com/denoland/deno/issues/18350
2023-03-22 10:19:11 -04:00
Cre3per
fd0658fb42
feat(cli): --ext parameter for run, compile, and bundle (#17172)
Adds `--ext` to `deno run`, closes #5088

Additionally

- Adds `--ext` to `deno compile` and `deno bundle`
2023-03-22 10:15:53 -04:00
Ryan Dahl
50b793c9ed
refactor: rename Deno.openKv() to Deno.kv() (#18349) 2023-03-22 10:02:40 -04:00
Bartek Iwańczuk
e73e8410f6
chore: upgrade rusty_v8 to 0.66.0 (#18339) 2023-03-22 13:38:56 +01:00
Bartek Iwańczuk
aa7f02946d
test: mark two unit tests as flaky (#18344)
Temporarily marking two "fetch" tests as flaky, since
they've been failing on CI for the past 24h.
2023-03-22 13:30:54 +01:00
Nayeem Rahman
5804d7434e
fix(ext/kv): don't request permissions for ":memory:" (#18346)
Currently `Deno.openKv(":memory:")` requests read+write permissions for
`./:memory:` even though no file is read or written. Also added some
guards for special sqlite paths that were unintentionally opted into.
2023-03-22 06:49:29 -04:00
Heyang Zhou
92ebf4afe5
feat(ext/kv): key-value store (#18232)
This commit adds unstable "Deno.openKv()" API that allows to open
a key-value database at a specified path.

---------

Co-authored-by: Luca Casonato <hello@lcas.dev>
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-03-22 12:13:24 +08:00
Bartek Iwańczuk
8bcffff9dc
test: disable macos_shared_libraries test (#18342)
This test is flaky: https://github.com/denoland/deno/issues/18341
2023-03-21 18:23:35 -06:00
David Sherret
2fcf1f14cf
feat: TypeScript 5.0.2 (except decorators) (#18294)
This upgrades TypeScript to 5.0.2, but does not have ES decorator
support because swc does not support that yet.
2023-03-21 15:46:40 +00:00
Yoshiya Hinosawa
aa729a42b4
chore(tools): restore node compat test setup script (#18290) 2023-03-21 22:38:07 +09:00
Yoshiya Hinosawa
896d7f02cb
chore(ext/console): inspect anonymous function as [Function (anonymous)] (#18283)
This PR changes the inspect result of anonymous functions from
`[Function]` to `[Function (anonymous)]`. This behavior is aligned
to `util.inspect` of Node.js.
2023-03-21 13:12:13 +09:00
Sam Gwilym
4c34a2f2df
feat(ext/net): Add multicasting APIs to DatagramConn (#10706) (#17811) 2023-03-20 22:27:00 +01:00
Bartek Iwańczuk
cd53ab5427
refactor(ext/node): untangle dependencies between js files (#18284)
Moving some code around in `ext/node` is it's a bit better well defined
and makes it possible for others to embed it.

I expect to see no difference in startup perf with this change.
2023-03-20 14:05:13 -04:00