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

2487 commits

Author SHA1 Message Date
Evan
ece2a3de5b
fix(ext/net): implement a graceful error on an invalid SSL certificate (#20157)
The goal of this PR is to address issue #19520 where Deno panics when
encountering an invalid SSL certificate.

This PR achieves that goal by removing an `.expect()` statement and
implementing a match statement on `tsl_config` (found in
[/ext/net/ops_tsl.rs](e071382768/ext/net/ops_tls.rs (L1058)))
to check whether the desired configuration is valid

---------

Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2023-08-15 00:11:12 +00:00
Matt Mastracci
babfba14ef
chore: deno_core -> 0.201.0 (#20135) 2023-08-12 19:04:45 +00:00
Divy Srivastava
33dc5d2622
fix(node): implement TLSSocket._start (#20120)
Closes https://github.com/denoland/deno/issues/19983
Closes https://github.com/denoland/deno/issues/18303
Closes https://github.com/denoland/deno/issues/16681
Closes https://github.com/denoland/deno/issues/19978
2023-08-11 11:57:41 +00:00
Divy Srivastava
2f00b0add4
fix(ext/node): support dictionary option in zlib init (#20035)
Fixes https://github.com/denoland/deno/issues/19540
2023-08-11 11:42:35 +00:00
Divy Srivastava
65db8814c3
fix(node): object keys in publicEncrypt (#20128)
Fixes https://github.com/denoland/deno/issues/19935
2023-08-11 07:34:23 +00:00
Divy Srivastava
91dc6fa5f1
chore: upgrade fastwebsockets to 0.4.4 (#19089)
Fixes https://github.com/denoland/deno/issues/19041
2023-08-10 09:59:06 +05:30
Bartek Iwańczuk
8f854782b1
fix(ext/timers): some timers are not resolved (#20055)
Fixes https://github.com/denoland/deno/issues/19866
2023-08-10 04:01:35 +00:00
Bartek Iwańczuk
04a259e2c8
fix(test): handle ASCII escape chars in test name (#20081)
Handles ASCCI espace chars in test and bench name making
test and bench reporting more reliable. This one is also tested
in the fixture of "node:test" module.
2023-08-10 01:40:34 +02:00
Yusuke Tanaka
f2e30a6f79
refactor(cli): move snapshot_from_lockfile function to deno_npm (#20024)
This commit moves `snapshot_from_lockfile` function to [deno_npm
crate](https://github.com/denoland/deno_npm). This allows this function
to be called outside Deno CLI (in particular, Deno Deploy).
2023-08-08 10:07:29 -07:00
David Sherret
b9b0386948
feat(unstable): rename deno_modules to vendor (#20065)
Renames the unstable `deno_modules` directory and corresponding settings
to `vendor` after feedback. Also causes the vendoring of the
`node_modules` directory which can be disabled via
`--node-modules-dir=false` or `"nodeModulesDir": false`.
2023-08-06 21:56:56 -04:00
David Sherret
7b5bc87f29
fix(unstable): vendor cache should support adding files to hashed directories (#20070)
This changes the design of the manifest.json file to have a separate
"folders" map for mapping hashed directories. This allows, for example,
to add files in a folder like `http_localhost_8000/#testing_5de71/` and
have them be resolved automatically as long as their remaining
components are identity-mappable to the file system (not hashed). It
also saves space in the manifest.json file by only including the hashed
directory instead of each descendant file.

```
// manifest.json
{
  "folders": {
    "https://localhost/NOT_MAPPABLE/": "localhost/#not_mappable_5cefgh"
  },
  "modules": {
    "https://localhost/folder/file": {
      "headers": {
        "content-type": "application/javascript"
      }
    },
  }
}

// folder structure
localhost
  - folder
    - #file_2defn (note: I've made up the hashes in these examples)
  - #not_mappable_5cefgh
    - mod.ts
    - etc.ts
    - more_files.ts
```
2023-08-06 12:25:48 -04:00
Matt Mastracci
85a2b281f5
chore: use zlib-ng for flate2 (#20059)
Extracted from PR #16011
2023-08-05 15:43:16 -06:00
Yoshiya Hinosawa
8a175a780a
fix(test): make test runner work when global setTimeout is replaced (#20052) 2023-08-04 22:29:04 +09:00
Bartek Iwańczuk
6405b5f454
fix(node): polyfill process.title (#20044)
Closes https://github.com/denoland/deno/issues/19777
2023-08-04 14:31:13 +02:00
Bartek Iwańczuk
8d8a89ceea
fix(node): repl._builtinLibs (#20046)
Ref https://github.com/denoland/deno/issues/19733
2023-08-04 14:30:48 +02:00
Asher Gomez
6fb7e8d93b
feat(permissions): add "--deny-*" flags (#19070)
This commit adds new "--deny-*" permission flags. These are complimentary to
"--allow-*" flags.

These flags can be used to restrict access to certain resources, even if they
were granted using "--allow-*" flags or the "--allow-all" ("-A") flag.

Eg. specifying "--allow-read --deny-read" will result in a permission error,
while "--allow-read --deny-read=/etc" will allow read access to all FS but the
"/etc" directory.

Runtime permissions APIs ("Deno.permissions") were adjusted as well, mainly
by adding, a new "PermissionStatus.partial" field. This field denotes that
while permission might be granted to requested resource, it's only partial (ie.
a "--deny-*" flag was specified that excludes some of the requested resources).
Eg. specifying "--allow-read=foo/ --deny-read=foo/bar" and then querying for
permissions like "Deno.permissions.query({ name: "read", path: "foo/" })"
will return "PermissionStatus { state: "granted", onchange: null, partial: true }",
denoting that some of the subpaths don't have read access.

Closes #18804.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2023-08-03 13:19:19 +02:00
Bartek Iwańczuk
db287e216d
refactor: use '--reporter' and '--junit-path' flags for 'deno test' (#20031)
This commit adds "--reporter" and "--junit-path" flags to "deno test"
subcommand instead of using "--dot" and "--junit" flags.
2023-08-02 22:05:34 -04:00
David Sherret
480894e5c8
feat(unstable/lsp): support navigating to deno_modules folder (#20030)
Closes #20015
Closes https://github.com/denoland/vscode_deno/issues/850 (only for
deno_modules, but I don't think this will be possible for the global
cache)
2023-08-02 16:57:25 -04:00
Bartek Iwańczuk
029bdf0cd5
feat(cli): Add dot test reporter (#19804)
This commit adds a "dot" reporter to "deno test" subcommand,
that can be activated using "--dot" flag.

It provides a concise output using:
- "." for passing test
- "," for ignored test
- "!" for failing test

User output is silenced and not printed to the console.

In non-TTY environments each result is printed on a separate line.
2023-08-02 18:38:10 +02:00
Bartek Iwańczuk
d9c85e016f
fix(node): node:test reports correct location (#20025)
Also removed some noisy output that caused test flakiness.
2023-08-02 17:11:04 +02:00
Bartek Iwańczuk
9d1c32945c
fix: regression in workers using dynamic imports (#20006)
Closes https://github.com/denoland/deno/issues/19903
2023-08-02 01:19:44 +00:00
David Sherret
1cefa831fd
feat(unstable): optional deno_modules directory (#19977)
Closes #15633
2023-08-02 00:49:09 +00:00
Bartek Iwańczuk
36ae37604a
feat(bench): print iter/s in the report (#19994)
This commit adds "iter/s" column to the console report
generated by "deno bench" subcommand.
2023-08-01 23:55:23 +00:00
await-ovo
fec34d8069
fix(ext/node): fix import json using npm specifier (#19723) 2023-08-01 23:20:08 +00:00
Bartek Iwańczuk
21f1b2f62b
feat(node): add polyfill for node:test module (#20002)
This commit provides basic polyfill for "node:test" module. Currently
only top-level "test" function is polyfilled, all remaining functions from
that module throw not implemented errors.
2023-08-02 01:17:38 +02:00
David Sherret
00b5fe8ba3
feat(npm): support running non-bin scripts in npm pkgs via deno run (#19975)
Closes https://github.com/denoland/deno/issues/19967
2023-08-01 18:47:57 -04:00
Felipe Baltor
ab2627a014
fix(test): request cloning should throw if body stream is locked (#19990)
Follow-up from #19869.
2023-08-01 18:24:42 +00:00
David Sherret
b563746885
fix: deno diagnostic - clarify where to put triple-slash directive (#20009)
Some people might not know what "entrypoint" means or where to put the
triple-slash directive.
2023-08-01 15:27:25 +00:00
Bartek Iwańczuk
5df2b0b4dc
fix: retry module download once if server errored (#17252)
Closes https://github.com/denoland/deno/issues/17251
Closes #19970

This commits adds logic to retry failed module downloads once.
Both request and server errors are handled and the retry is done after
50 ms wait time.
2023-08-01 10:52:28 +02:00
Bartek Iwańczuk
a05e890d56
chore: make LSP test less prone to changes (#20003)
This test was getting changed often, I modified it a bit
so it's less sensitive to changes in declaration files.
2023-07-31 21:31:30 -04:00
Leo Kettmeir
aa8078b688
feat(node/os): implement getPriority, setPriority & userInfo (#19370)
Takes #4202 over
Closes #17850 

---------

Co-authored-by: ecyrbe <ecyrbe@gmail.com>
2023-07-31 22:29:09 +02:00
Luca Casonato
78ceeec6be
perf: faster node globals access in cjs (#19997)
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-07-31 19:45:32 +00:00
Matt Mastracci
43877f1209
chore(cli): Reduce port conflict in tests (#19988)
Ports are still occasionally causing CI flake -- allocate and separate
ports further for fetch/http tests.
2023-07-31 07:29:17 -06:00
Matt Mastracci
2fd87471e8
chore(cli): Fix test that locks up on some M2 macs (#19989)
I'm not sure why, but sending SIGABRT to Deno on my machine as part of
this test causes it to lock up very badly, leaving it in an unkillable
`UE+` state.

This showed up after #19333, but was not caused by it.
2023-07-31 07:29:00 -06:00
Nayeem Rahman
02865cb5a2
feat(bench): add BenchContext::start() and BenchContext::end() (#18734)
Closes #17589.
```ts
Deno.bench("foo", async (t) => {
  const resource = setup(); // not included in measurement
  t.start();
  measuredOperation(resource);
  t.end();
  resource.close(); // not included in measurement
});
```
2023-07-31 12:02:59 +02:00
Felipe Baltor
3cb260ed15
fix(Deno.serve): accessing .url on cloned request throws (#19869)
This PR fixes #19818. The problem was that the new InnerRequest class does not initialize the fields urlList and urlListProcessed that are used during a request clone. The solution aims to be straightforward by simply initializing the missing properties during the clone process. I also implemented a "cache" to the url getter of the new InnerRequest, avoiding the cost of calling op_http_get_request_method_and_url.
2023-07-30 09:13:28 -04:00
David Sherret
279030f2b8
fix(npm): improve declaration resolution for filename with different extensions (#19966)
postcss was importing `./index.js` from `./index.d.mts` where there also
existed a `./index.d.ts`.

Closes #19575
2023-07-28 11:24:22 -04:00
Leo Kettmeir
5cb1d18439
feat: Deno.createHttpClient allowHost (#19689)
This adds an option to allow using the host header in a fetch call.
Closes https://github.com/denoland/deno/issues/16840
Ref https://github.com/denoland/deno/issues/11017
2023-07-28 09:01:06 +02:00
David Sherret
fa52b5e733
fix: do not include jsx without @ts-check in tsc roots (#19964)
Closes #19928
2023-07-27 14:09:02 -04:00
David Sherret
56e3daa19b
fix(lsp): handle import mapped node: specifier (#19956)
Closes https://github.com/denoland/vscode_deno/issues/805
2023-07-26 22:52:31 +00:00
David Sherret
cf16df00d9
fix(check): should bust check cache when json module or npm resolution changes (#19941)
A small part of #19928.
2023-07-26 17:23:07 -04:00
Bartek Iwańczuk
06209f824c
perf: cache node resolution when accesing a global (#19930)
Reclaims some of the performance hit introduced by
https://github.com/denoland/deno/pull/19307.
2023-07-25 23:43:00 +02:00
Vedant Pandey
4a5aaceb26
fix: deno info should respect import map (#19781)
Closes #19742
2023-07-25 18:23:43 +02:00
Bartek Iwańczuk
bd79baea5e
fix(node): add writable and readable fields to FakeSocket (#19931)
Closes https://github.com/denoland/deno/issues/19927
2023-07-25 07:17:53 +00:00
Yoshiya Hinosawa
3d35900639
fix(ext/net): fix string port number handling in listen (#19921)
While string `port` is not allowed in typing, it seems we used to
support that and now it's broken. ref:
https://github.com/denoland/deno/issues/10064#issuecomment-1637427260

This PR restores the support of string port number in `listen` and
`listenTls`
2023-07-25 06:26:18 +00:00
David Sherret
d6e086d681
fix(lsp): handle watched files events from symlinked config files (#19898)
Related to https://github.com/denoland/vscode_deno/issues/784
2023-07-21 09:12:26 -04:00
Leo Kettmeir
da709729e3
fix(node/http): add encrypted field to FakeSocket (#19886)
Fixes #19557
2023-07-21 02:18:07 +02:00
David Sherret
235fdc243f
fix(lsp): auto-discover deno.json in more cases (#19894)
We weren't auto-discovering the deno.json in two cases:

1. A project that didn't have a deno.json and just added one.
2. After a syntax error in the deno.json.

This now rediscovers it in both these cases.

Closes https://github.com/denoland/vscode_deno/issues/867
2023-07-20 14:05:52 -04:00
Luca Casonato
e511022c74
feat(ext/node): properly segregate node globals (#19307)
Code run within Deno-mode and Node-mode should have access to a
slightly different set of globals. Previously this was done through a
compile time code-transform for Node-mode, but this is not ideal and has
many edge cases, for example Node's globalThis having a different
identity than Deno's globalThis.

This commit makes the `globalThis` of the entire runtime a semi-proxy.
This proxy returns a different set of globals depending on the caller's
mode. This is not a full proxy, because it is shadowed by "real"
properties on globalThis. This is done to avoid the overhead of a full
proxy for all globalThis operations.

The globals between Deno-mode and Node-mode are now properly segregated.
This means that code running in Deno-mode will not have access to Node's
globals, and vice versa. Deleting a managed global in Deno-mode will
NOT delete the corresponding global in Node-mode, and vice versa.

---------

Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Aapo Alasuutari <aapo.alasuutari@gmail.com>
2023-07-19 10:30:04 +02:00
Leo Kettmeir
bf4e99cbd7
fix(node/http): call callback after request is sent (#19871)
Fixes #19762
2023-07-19 01:30:19 +02:00