Marcos Casagrande
e2990be264
fix(ext/cache): close resource on error ( #16129 )
2022-10-03 09:48:59 +05:30
李瑞丰
b3444e0d3b
fix(ext/crypto): fix importKey error when leading zeroes ( #16009 )
...
Co-authored-by: Jason <m.jason.liu@outlook.com>
2022-10-03 09:37:25 +05:30
Marcos Casagrande
a55b194638
fix(ext/cache): acquire reader lock before async op ( #16126 )
2022-10-02 01:21:48 +02:00
Bartek Iwańczuk
048c06f84f
fix(npm): handle json files in require ( #16125 )
2022-10-01 22:21:19 +02:00
sigmaSd
a6618dc01c
lsp: use deno:/asset instead of deno:asset ( #16023 )
...
Make offering "virtual documents" via the lsp easier to parse. `deno:`
can be ambiguous to parse by editors (can conflict with linux paths)
Neovim recently landed a PR https://github.com/neovim/neovim/pull/19797
that allows it to parse `scheme:/` this PR should make deno lsp work
correctly in neovim
2022-10-01 20:02:25 +02:00
Marcos Casagrande
927f4e2e83
fix(ext/fetch): Body#bodyUsed
for static body ( #16080 )
...
This fixes a bug where `Body#bodyUsed` incorrectly returns `false`
for a body that has actually already been consumed, after `Body#body`
is called.
2022-09-29 17:38:04 +02:00
ayame113
691e36ac50
chore(ext/flash): Enabling disabled windows tests ( #16081 )
2022-09-29 10:34:26 +05:30
Kitson Kelly
cfbcb3b613
chore: improve JSDoc for built-in APIs ( #16048 )
...
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-28 22:21:08 +02:00
Divy Srivastava
e2828ad762
fix(ext/flash): reregister socket on partial read on Windows ( #16076 )
2022-09-28 20:52:24 +02:00
David Sherret
fcb20ab952
chore: fix flaky integration::lint::compact ( #16075 )
2022-09-28 13:52:10 -04:00
David Sherret
d677ba67f5
feat(npm): functionality to support child_process.fork ( #15891 )
2022-09-28 13:04:16 -04:00
Brenley Dueck
23125b275f
feat(lint): add --compact flag for terse output ( #15926 )
2022-09-28 18:47:48 +02:00
Guilherme Bernal
6c55772f0d
feat(core): add Deno.core.setPromiseHooks ( #15475 )
2022-09-28 16:09:33 +02:00
Luca Casonato
70bc0eb72b
feat(unstable): Deno.setRaw -> Deno.stdin.setRaw ( #15797 )
...
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-09-28 15:03:56 +02:00
Yoshiya Hinosawa
fa9e7aab6d
feat: add --allow-sys permission flag ( #16028 )
2022-09-28 21:46:50 +09:00
Satya Rohith
b312279e58
feat: implement Web Cache API ( #15829 )
2022-09-28 17:41:12 +05:30
Satya Rohith
7a47321b09
fix(ext/fetch): blob url ( #16057 )
...
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-09-27 22:07:46 +05:30
Marcos Casagrande
c7dd842f84
perf(ext/fetch): use content-length in InnerBody.consume ( #15925 )
...
This fast path prevents repeated allocations when receiving a fetch body with a known size.
Co-authored-by: Luca Casonato <hello@lcas.dev>
2022-09-26 20:27:50 +02:00
李瑞丰
a2262c11d7
fix(ext/console): fix error when logging a proxied Date ( #16018 )
2022-09-26 23:55:58 +09:00
Marcos Casagrande
b73cb7bf9c
perf(ext/console): break on iterableLimit & better sparse array handling ( #15935 )
2022-09-26 15:55:22 +09:00
David Sherret
f6a9b49dfb
perf: don't re-download package tarball to global cache if local node_modules folder exists for package ( #16005 )
2022-09-23 17:35:48 -04:00
Marcos Casagrande
12306022da
test(ext/fetch): enable null body status test on windows ( #15995 )
2022-09-23 08:34:04 -04:00
David Sherret
9bf4ec2eac
chore: temporarily ignore websocketstream test ( #15997 )
2022-09-22 12:41:42 -04:00
David Sherret
716005a0d4
feat(npm): add flag for creating and resolving npm packages to a local node_modules folder ( #15971 )
2022-09-22 11:17:02 -04:00
Bartek Iwańczuk
9a216806d5
feat(npm): add support for --reload=npm: and --reload=npm:<package> ( #15972 )
2022-09-22 10:39:58 -04:00
Kayla Washburn
1ef96343a1
feat: allow exiting on two consecutive ctrl+c presses ( #15981 )
2022-09-22 04:42:09 -04:00
Yoshiya Hinosawa
cc32a297da
fix(runtime): better error message with Deno.env.get/set ( #15966 )
2022-09-21 15:18:58 +09:00
Bartek Iwańczuk
35fe9ee530
fix(flash): panic if response if undefined ( #15964 )
...
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2022-09-20 22:08:15 +02:00
Kitson Kelly
73e89844ba
feat(cli): update to TypeScript 4.8 ( #15064 )
2022-09-20 07:00:01 +10:00
David Sherret
1464b756a4
refactor: move out test files from root testdata directory into sub directories ( #15949 )
2022-09-19 10:32:21 -04:00
David Sherret
a4a894fa1e
fix(doc): deno doc should parse modules if they haven't been parsed before ( #15941 )
2022-09-18 13:59:33 -04:00
Yoshiya Hinosawa
d7b27ed63b
fix(ext/node): fix builtin module module ( #15904 )
2022-09-17 20:35:32 +09:00
Divy Srivastava
6154188786
perf(ext/console): avoid wrapConsole
when not inspecting ( #15931 )
2022-09-17 15:34:43 +05:30
Nayeem Rahman
38280990da
fix(runtime): fix permission status cache keys ( #15899 )
2022-09-16 20:46:38 +09:00
Divy Srivastava
1de17fad7f
chore(ext/flash): disable flaky flash test ( #15908 )
2022-09-15 09:52:31 +05:30
Colin Ihrig
19deec4494
fix(ops): add node.js env variable allowlist ( #15893 )
...
This commit allows the Node compatibility layer to skip
environment variable permission checks when --unstable
is passed and the variable name is one that Node uses.
Fixes: https://github.com/denoland/deno/issues/15890
2022-09-14 11:59:20 -04:00
Bartek Iwańczuk
7b98282993
fix(npm): binary entrypoint for .js or no extension ( #15900 )
2022-09-14 10:41:47 -04:00
Bartek Iwańczuk
233d5422fd
fix(npm): use shim from deno_node crate for 'module' built-in module ( #15881 )
2022-09-12 18:11:32 -04:00
David Sherret
98454c1eb8
fix(npm): support cjs resolution of package subpath with package.json ( #15855 )
2022-09-12 15:47:54 -04:00
David Sherret
a3a4760831
fix(npm): align Deno importing Node cjs with Node esm importing cjs ( #15879 )
2022-09-12 14:28:51 -04:00
David Sherret
dee9f0acaf
fix(npm): align Node esm code importing cjs with Node ( #15838 )
2022-09-10 15:00:45 -04:00
David Sherret
3b0de03b59
fix(npm): remove export binding to match node ( #15837 )
2022-09-10 11:38:11 -04:00
Bartek Iwańczuk
6c179daff0
fix(npm): recursive translation of reexports, remove window global in node code ( #15806 )
...
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-09-08 22:01:48 +02:00
David Sherret
9e6917426a
fix: upgrade deno_ast to 0.19 ( #15808 )
2022-09-07 15:06:18 -04:00
Bartek Iwańczuk
4a250b2f25
feat: add --no-npm flag to disable npm: imports ( #15673 )
...
This commit adds "--no-npm" flag, it's similar to "--no-remote"
flag. This flag makes Deno error out if "npm:" specifier is encountered.
2022-09-07 15:33:51 +02:00
Colin Ihrig
3b1204eb2d
fix(core): make errors more resistant to tampering ( #15789 )
...
This commit makes error objects more resistant to
prototype tampering.
This bug was found when updating the deno_std Node compatibility
layer to Node 18. The Node test 'parallel/test-assert-fail.js'
was breaking std's assertion library.
Refs: https://github.com/denoland/deno_std/pull/2585
2022-09-07 09:11:16 -04:00
Divy Srivastava
d57f9d560d
fix(ext/flash): use utf8 length as Content-Length ( #15793 )
2022-09-07 16:21:30 +05:30
Divy Srivastava
7f4b043f32
fix(test): unflake wasm_unreachable test ( #15794 )
2022-09-07 16:21:18 +05:30
Nayeem Rahman
5819fef2d5
test: fix bad resource fixture ( #15792 )
2022-09-07 09:49:34 +05:30
Divy Srivastava
d2a408f452
perf(runtime): short-circuit queue_async_op
for Poll::Ready ( #15773 )
2022-09-06 23:08:37 +05:30
Nayeem Rahman
118dd47ad0
fix(watch): ignore unload errors on drop ( #15782 )
2022-09-06 13:18:23 +02:00
David Sherret
08a6af398f
fix(cli): allow using file resource synchronously while being used async ( #15747 )
2022-09-04 22:33:06 -04:00
Bartek Iwańczuk
e324151520
BREAKING(unstable): remove --compat mode ( #15678 )
...
This commit removes "compat" mode. We shipped support for "npm:" specifier
support in v1.25 and that is preferred way to interact with Node code that we
will iterate and improve upon.
2022-09-03 18:19:30 +02:00
Bartek Iwańczuk
fc4025c878
fix(npm): add more context to errors when file doesn't exist ( #15749 )
2022-09-03 15:43:35 +02:00
Bartek Iwańczuk
223403e899
feat(info): add information about npm modules cache ( #15750 )
2022-09-03 15:31:01 +02:00
Nayeem Rahman
4f8dea100e
refactor(test): grab runTests() and runBenchmarks() from __bootstrap ( #15420 )
2022-09-02 19:44:45 +02:00
Geert-Jan Zwiers
7d622a6643
fix(init): suppress info logs when using quiet mode ( #15741 )
2022-09-02 17:59:36 +02:00
Garcia
4ec213b0aa
fix(ext/timers): create primordial eval
( #15110 )
2022-09-02 17:55:44 +02:00
David Sherret
03e6727a04
fix(npm): correct exact matching of pre-release versions ( #15745 )
2022-09-02 11:21:40 -04:00
Jason
8178665bd1
fix(cli/repl): await Promise.any([])... ( #15623 )
2022-09-02 13:38:06 +02:00
Nayeem Rahman
a74b2ecf37
fix(repl): don't terminate on unhandled error events ( #15548 )
2022-09-02 12:43:39 +02:00
Geert-Jan Zwiers
58e76098e6
fix(serde_v8): no panic on reading large text file ( #15494 )
...
Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com>
2022-09-01 22:20:11 +02:00
David Sherret
e1d7d7b0e3
fix(npm): better node version and version requirement compatibility ( #15714 )
2022-09-01 11:50:12 -04:00
Divy Srivastava
20c835407c
fix(ext/flash): retry write failures ( #15591 )
2022-09-01 18:58:34 +05:30
Bartek Iwańczuk
adec4f575e
fix(npm): translate CJS to ESM with name clashes for files and dirs ( #15697 )
2022-08-31 00:31:59 +02:00
David Sherret
5f251b283b
fix(npm): prefer importing esm from esm ( #15676 )
2022-08-30 14:09:22 -04:00
Bartek Iwańczuk
54be07d05e
fix(npm): skip extracting pax_global_header from tarballs ( #15677 )
2022-08-30 17:15:41 +02:00
Danny Povolotski
5e0fa5dd88
fix(ext/websocket): fix closing of WebSocketStream with unread messages ( #15632 )
2022-08-30 03:43:17 +02:00
David Sherret
c3e48cba18
fix(compile): panic when running with a populated dep analysis cache ( #15672 )
...
Closes #15612
2022-08-29 14:24:10 -04:00
Bartek Iwańczuk
2851a98072
fix(npm): conditional exports with wildcards ( #15652 )
2022-08-29 19:15:20 +02:00
Bartek Iwańczuk
ad98c9fdd1
chore: update test_util/std/ submodule ( #15657 )
2022-08-29 11:35:27 +02:00
David Sherret
ec98d86d21
fix(npm): handle cjs re-exports with the same name as an export ( #15626 )
2022-08-26 14:34:35 -04:00
Yoshiya Hinosawa
9b324b1cf4
fix(ext/node): fix global in node env ( #15622 )
2022-08-26 23:39:05 +09:00
David Sherret
f583a7ebf4
chore(npm): add test for esm npm binary package ( #15609 )
2022-08-26 09:17:48 -04:00
Bartek Iwańczuk
da10c9c8d1
fix(ext/flash): panic on AddrInUse ( #15607 )
2022-08-26 08:42:11 +05:30
David Sherret
376665d115
fix: avoid global declaration collisions in cjs ( #15608 )
...
* Use a default stack size * 2 in debug for Windows because swc using so much stack size. We should look into this more later though.
2022-08-25 20:24:18 -04:00
Bartek Iwańczuk
fb1c7b7dea
fix(unstable): finish HTTP response for 205 and 304 responses ( #15584 )
...
This commit fixes "Deno.serve()" API by making sure that
205 and 304 responses end with "\r\n\r\n".
2022-08-24 21:26:57 +02:00
David Sherret
348291f5ec
fix(npm): always require --unstable flag even for esm ( #15583 )
2022-08-24 13:44:38 -04:00
Luca Casonato
33c4d45328
fix: resolve jsxImportSource
relative to module ( #15561 )
...
Previously `jsxImportSource` was resolved relative to the config file
during graph building, and relative to the emitted module during
runtime.
This is now fixed so that the JSX import source is resolved relative to
the module both during graph building and at runtime.
2022-08-24 19:36:05 +02:00
David Sherret
684aabbc25
feat: support subpaths in npm package references ( #15578 )
2022-08-24 11:25:32 -04:00
Bartek Iwańczuk
a4cc09447e
fix(unstable): Deno.serve() can parse hostnames ( #15579 )
2022-08-24 16:38:51 +02:00
Bartek Iwańczuk
5268fa0e0f
fix(unstable): various resolution bugs for npm: specifiers ( #15546 )
...
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-24 14:54:20 +02:00
Luca Casonato
f3bde1d53b
feat(ext/flash): split upgradeHttp into two APIs ( #15557 )
...
This commit splits `Deno.upgradeHttp` into two different APIs, because
the same API is currently overloaded with two different functions. Flash
requests upgrade immediately, with no need to return a `Response`
object. Instead you have to manually write the response to the socket.
Hyper requests only upgrade once a `Response` object has been sent.
These two behaviours are now split into `Deno.upgradeHttp` and
`Deno.upgradeHttpRaw`. The latter is flash only. The former only
supports hyper requests at the moment, but can be updated to support
flash in the future.
Additionally this removes `void | Promise<void>` as valid return types
for the handler function. If one wants to use `Deno.upgradeHttpRaw`,
they will have to type cast the handler signature - the signature is
meant for the 99.99%, and should not be complicated for the 0.01% that
use `Deno.upgradeHttpRaw()`.
2022-08-24 17:40:57 +05:30
David Sherret
452df99222
feat(npm): support packages with multiple command names ( #15565 )
2022-08-23 22:01:21 -04:00
Luca Casonato
4ef08a58df
feat: update Deno.serve
function signature ( #15563 )
...
This commit changes the `Deno.serve` function signature to be more
versatile and easier to use. It is now a drop in replacement for
std/http's `serve`.
The input validation has also been reworked.
2022-08-24 00:08:56 +02:00
David Sherret
e7367044d9
feat: binary npm commands ( #15542 )
2022-08-23 10:39:19 -04:00
David Sherret
362af63c6f
fix(cache): do not attempt to emit non-emitable files ( #15562 )
2022-08-23 10:30:14 -04:00
Luca Casonato
24f7f3fda9
fix(ext/fetch): ignore user content-length header ( #15555 )
...
Previously if a user specified a content-length header for an POST
request without a body, the request would contain two `content-length`
headers. One added by us, and one added by the user.
This commit ignores all content-length headers coming from the user,
because we need to have the sole authority on the content-length because
we transmit the body.
2022-08-23 12:43:04 +02:00
Bartek Iwańczuk
c66386dbd2
feat(unstable): Respect --cached-only flags for npm: specifiers ( #15512 )
...
This commit changes "npm:" specifier handling to respect "--cached-only" flags and adds "Download" messages for npm registry api calls.
Co-authored-by: David Sherret <dsherret@gmail.com>
2022-08-22 17:35:04 +02:00
Yoshiya Hinosawa
57d48134d1
fix(ext/flash): fix default onListen callback ( #15533 )
2022-08-22 17:01:43 +09:00
Bartek Iwańczuk
301f6c46ba
fix(unstable): better error for invalid hostname in Deno.serve() ( #15529 )
2022-08-21 21:15:52 +02:00
Nayeem Rahman
97954003cc
feat: queueMicrotask()
error handling ( #15522 )
...
Adds error event dispatching for queueMicrotask(). Consequently unhandled errors are now reported with Deno.core.terminate(), which is immune to the existing quirk with plainly thrown errors (#14158 ).
2022-08-21 20:16:42 +02:00
Yoshiya Hinosawa
fb2aeb79a1
fix(ext/flash): fix listening port ( #15519 )
2022-08-21 21:27:14 +09:00
Nayeem Rahman
e39d4e3e7f
fix(core/runtime): always cancel termination in exception handling ( #15514 )
2022-08-21 13:57:10 +02:00
David Sherret
87f80ff6be
feat(unstable): initial support for npm specifiers ( #15484 )
...
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-20 11:31:33 -04:00
Leo Kettmeir
1ffbd56164
feat: add "deno init" subcommand ( #15469 )
...
This adds an init subcommand to that creates a project starter similar to cargo init.
```
$ deno init my_project
Project initialized
Run these commands to get started:
cd my_project
deno run main.ts
deno run main_test.ts
$ deno run main.ts
Add 2 + 3 5
$ cat main.ts
export function add(a: number, b: number): number {
return a + b;
}
if (import.meta.main) {
console.log("Add 2 + 3", add(2, 3));
}
$ cat main_test.ts
import { assertEquals } from "https://deno.land/std@0.151.0/testing/asserts.ts ";
import { add } from "./main.ts";
Deno.test(function addTest() {
assertEquals(add(2, 3), 5);
});
```
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2022-08-20 01:37:05 +02:00
Bartek Iwańczuk
5beec3f106
feat(unstable): change Deno.serve() API ( #15498 )
...
- Merge "Deno.serve()" and "Deno.serveTls()" API
- Remove first argument and use "fetch" field options instead
- Update type declarations
- Add more documentation
2022-08-19 14:36:01 +02:00
Divy Srivastava
8bdcec1c84
fix(ext/flash): concurrent response streams ( #15493 )
2022-08-19 10:14:56 +05:30
Divy Srivastava
cd21cff299
feat(ext/flash): An optimized http/1.1 server ( #15405 )
...
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
Co-authored-by: Ben Noordhuis <info@bnoordhuis.nl>
Co-authored-by: crowlkats <crowlkats@toaxl.com>
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
2022-08-18 17:35:02 +05:30
Kitson Kelly
a2ab5eee01
docs: add category tag for built-in APIs ( #15480 )
2022-08-17 13:12:24 +10:00