summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
2023-05-27fix(compile): inline symlinks as files outside node_modules dir and warn for ↵David Sherret
directories (#19285) If a symlink within the `node_modules` directory lies outside that directory, it will now warn and inline the file. For directories, it will just warn for now. Probably fixes #19251 (I'm still unable to reproduce).
2023-05-27refactor(node/http): don't use readablestream for writing to request (#19282)Leo Kettmeir
Refactors the internal usage of a readablestream to write to the resource directly --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-26fix(compile): implicit read permission to npm vfs (#19281)David Sherret
Closes #19280
2023-05-26chore: upgrade rusty_v8 to 0.73.0 (#19278)Bartek Iwańczuk
2023-05-26fix(node): make 'v8.setFlagsFromString' a noop (#19271)Bartek Iwańczuk
Towards https://github.com/denoland/deno/issues/16460
2023-05-26chore: remove useless benchmark (#19272)Bartek Iwańczuk
This benchmark is useless and only gives several hundred thousand messages of failure. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2023-05-26chore(lsp/tests): diagnostic synchronization (reland) (#19270)David Sherret
Merge on approval as it fixes the flaky test.
2023-05-26fix(napi): properly handle arguments in napi_get_cb_info (#19269)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/17213
2023-05-26fix(napi): clear currently registering module slot (#19249)Bartek Iwańczuk
This commit fixes problem with loading N-API modules that use the "old" way of registration (using "napi_module_register" API). The slot was not cleared after loading modules, causing subsequent calls that use the new way of registration (using "napi_register_module_v1" API) to try and load the previous module. Ref https://github.com/denoland/deno/issues/16460 --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2023-05-26Revert "chore(lsp/tests): diagnostic synchronization (#19264)" (#19268)Bartek Iwańczuk
This reverts commit 89026abe395c22eb2ace4ea5f948189daa1dadf1. This change caused LSP benchmarks to fail on `main`.
2023-05-26chore(lsp/tests): diagnostic synchronization (#19264)David Sherret
Fixes the flaky lsp test by having better synchronization of diagnostics between the client and server for testing purposes.
2023-05-25fix(compile): improve panic message when stripping root path fails (#19258)David Sherret
I'm not sure what's going on here, so this will help us debug. For #19251
2023-05-25fix(compile): handle when DENO_DIR is readonly (#19257)David Sherret
Closes #19253
2023-05-25fix: don't print release notes on version check prompt (#19252)Luca Casonato
2023-05-241.34.0 (#19246)denobot
Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-24refactor: upgrade to deno_npm 0.6 (#19244)David Sherret
2023-05-24feat(ext/fs): add isBlockDevice, isCharDevice, isFifo, isSocket to FileInfo ↵Hirotaka Tagawa / wafuwafu13
(#19008) `isFile`, `isDirectory`, `isSymlink` are defined in `Deno.FileInfo`, but `isBlockDevice`, `isCharacterDevice`, `isFIFO`, `isSocket` are not defined. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-24fix(npm): create `node_modules/.deno/node_modules` folder (#19242)David Sherret
This is what pnpm does and we were missing it. It makes modules work which have a dependency on something, but don't say they have that dependency, but that dep is still in the tree somewhere.
2023-05-24chore(core): Ensure that net test ports aren't used elsewhere (#19243)Matt Mastracci
Fixes occasional test flake due to overlapping ports
2023-05-24feat(ext/http): Brotli Compression (#19216)Levente Kurusa
Add Brotli streaming compression to HTTP
2023-05-24fix(napi): add napi_async_init and napi_async_destroy (#19234)Bartek Iwańczuk
We don't have support for "AsyncContext" in "node:async_hooks" module, so these two APIs are just noops. Towards https://github.com/denoland/deno/issues/18610.
2023-05-24fix(node): fire 'unhandledrejection' event when using node: or npm: imports ↵Bartek Iwańczuk
(#19235) This commit fixes emitting "unhandledrejection" event when there are "node:" or "npm:" imports. Before this commit the Node "unhandledRejection" event was emitted using a regular listener for Web "unhandledrejection" event. This listener was installed before any user listener had a chance to be installed which effectively prevent emitting "unhandledrejection" events to user code. Closes https://github.com/denoland/deno/issues/16928
2023-05-23feat: top level package.json install when node_modules dir is explicitly ↵David Sherret
opted into (#19233) When someone explicitly opts into using the node_modules dir via `--node-modules-dir` or setting `"nodeModulesDir": true` in the deno.json file, we should eagerly ensure a top level package.json install is done on startup. This was initially always done when we added package.json support and a package.json was auto-discovered, but scaled it back to be lazily done when a bare specifier matched an entry in the package.json because of how disruptive it was for people using Deno scripts in Node projects. That said, it does not make sense for someone to opt-into having deno control and use their node_modules directory and not want a package.json install to occur. If such a rare scenario exists, the `DENO_NO_PACKAGE_JSON=1` environment variable can be set. Ideally, we would only ever use a node_modules directory with this explicit opt-in so everything is very clear, but we still have this automatic scenario when there's a package.json in order to make more node projects work out of the box.
2023-05-24chore: upgrade rusty_v8 to 0.72.0 (#19228)Bartek Iwańczuk
This commit updates rusty_v8 to 0.72.0 and by extension V8 to version 11.5.150.1.
2023-05-23fix(ext/node): add basic node:worker_threads support (#19192)Yoshiya Hinosawa
This PR restores `node:worker_threads` implementation and test cases from [`std@0.175.0/node`](https://github.com/denoland/deno_std/blob/0.175.0/node/worker_threads.ts). --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-23fix: better error message for malformed glob (#19225)Bartek Iwańczuk
Before: ``` $ cargo run -- test "foo/*******/bar.ts" error: Pattern syntax error near position 6: wildcards are either regular `*` or recursive `**` ``` After: ``` $ cargo run -- test "foo/*******/bar.ts" error: Failed to expand glob: "foo/*******/bar.ts" Caused by: Pattern syntax error near position 6: wildcards are either regular `*` or recursive `**` ``` --------- Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2023-05-23fix(node): duplicate node_module suffixes (#19222)Marvin Hagemeister
Noticed that we're checking more module paths than necessary. In particular the module path array contains a couple of entries with a duplicated `node_modules/node_modules` suffix. ```js [ // ... more entries before here, where some also contain duplicate suffixes "/Users/marvinhagemeister/dev/preact-render-to-string/node_modules/.deno/node_modules", "/Users/marvinhagemeister/dev/preact-render-to-string/node_modules/node_modules", // <-- duplicate suffix "/Users/marvinhagemeister/dev/preact-render-to-string/node_modules", "/Users/marvinhagemeister/dev/node_modules", "/Users/marvinhagemeister/node_modules", "/Users/node_modules", "/node_modules", "/node_modules" // <-- duplicate entry ] ``` This was caused by a misunderstanding in how Rust's [`Path::ends_with()`](https://doc.rust-lang.org/std/path/struct.Path.html#method.ends_with) works. It's designed to match on whole path segments and the suffix `/node_modules` is not that, except for the root entry. This meant that our check for if the path already ended with `node_module` always returned `false`. Removing the leading slash fixes that. While we're at it, we can remove the last condition where we explicitly added the root `/node_modules` entry since the while loop prior to that takes care of it already.
2023-05-23feat: add support for globs in the config file and CLI arguments for files ↵Bartek Iwańczuk
(#19102) Follow up to https://github.com/denoland/deno/pull/19084. This commit adds support for globs in the configuration file as well as CLI arguments for files. With this change users can now use glob syntax for "include" and "exclude" fields, like so: ```json { "lint": { "include": [ "directory/test*.ts", "other_dir/" ], "exclude": [ "other_dir/foo*.ts", "nested/nested2/*" ] }, "test": { "include": [ "data/test*.ts", "nested/", "tests/test[1-9].ts" ], "exclude": [ "nested/foo?.ts", "nested/nested2/*" ] } } ``` Or in CLI args like so: ``` // notice quotes here; these values will be passed to Deno verbatim // and deno will perform glob expansion $ deno fmt --ignore="data/*.ts" $ deno lint "data/**/*.ts" ``` Closes https://github.com/denoland/deno/issues/17971 Closes https://github.com/denoland/deno/issues/6365
2023-05-22feat(lsp): support lockfile and node_modules directory (#19203)David Sherret
This adds support for the lockfile and node_modules directory to the lsp. In the case of the node_modules directory, it is only enabled when explicitly opted into via `"nodeModulesDir": true` in the configuration file. This is to reduce the language server automatically modifying the node_modules directory when the user doesn't want it to. Closes #16510 Closes #16373
2023-05-23refactor: further work on node http client (#19211)Leo Kettmeir
2023-05-22fix(npm): store npm binary command resolution in lockfile (#19219)David Sherret
Part of #19038 Closes #19034 (eliminates the time spent re-resolving)
2023-05-22chore(cli): One Rust test per JS and Node unit test file (#19199)Matt Mastracci
This runs our `js_unit_tests` and `node_unit_tests` in parallel, one rust test per JS unit test file. Some of our JS tests don't like running in parallel due to port requirements, so this also makes those use a specific port-per-file. This does not attempt to make the node-compat tests work.
2023-05-22chore(cli): Don't assume deno is in path for spawn_kill_permissions (#19198)Matt Mastracci
We don't need to use the `deno` command here to test kill permissions and it's awkward to get right without passing `-A`. `cat` works, but for platforms other than windows. This test should have plenty of coverage on other platforms.
2023-05-22docs: be explicit in the unit of time of delay in setTimeout (#19207)Connor Burton
2023-05-22fix(ext/web): improve timers resolution for 0ms timeouts (#19212)Bartek Iwańczuk
This commit changes the implementation of `ext/web` timers, by using "op_void_async_deferred" for timeouts of 0ms. 0ms timeout is meant to be run at the end of the event loop tick and currently Tokio timers that we use to back timeouts have at least 1ms resolution. That means that 0ms timeout actually take >1ms. This commit changes that and runs 0ms timeout at the end of the event loop tick. One consequence is that "unrefing" a 0ms timer will actually keep the event loop alive (which I believe actually makes sense, the test we had only worked because the timeout took more than 1ms). Ref https://github.com/denoland/deno/issues/19034
2023-05-22fix(node): add http.Server.unref() (#19201)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/19113
2023-05-21fix(ci): simplify test assertion for http version enforcing with ↵Leo Kettmeir
Deno.createHttpClient (#19210)
2023-05-21feat(unstable): add more options to Deno.createHttpClient (#17385)Leo Kettmeir
2023-05-19chore: add Deno version information to new 1.34 deno.json properties (#19202)David Sherret
These already come up in the auto-complete, so let's let users know what versions these are available in.
2023-05-19feat(vendor): support for npm specifiers (#19186)David Sherret
We never properly added support for this. This fixes vendoring when it has npm or node specifiers. Vendoring occurs by adding a `"nodeModulesDir": true` property to deno.json then it uses a local node_modules directory. This can be opted out by setting `"nodeModulesDir": false` or running with `--node-modules-dir=false`. Closes #18090 Closes #17210 Closes #17619 Closes #16778
2023-05-19feat(ext/http): ref/unref for server (#19197)Matt Mastracci
Add `ref` and `unref` to return value from `Deno.serve`. Unblocks #3326.
2023-05-19Revert "perf: use jemalloc as global allocator (#18957)" (#19187)Bartek Iwańczuk
This reverts commit 798c1ad0f1de80ff0e7196b6140a3f74e31fe111. Reverting because this change caused a spike in memory usage, but we can't fully realise gains from lower GC pressure from more optimal malloc/ free provided by "jemalloc". We might revisit the topic in future.
2023-05-18feat(ext/http): Add support for trailers w/internal API (HTTP/2 only) (#19182)Matt Mastracci
Necessary for #3326. Requested in #10214 as well.
2023-05-19BREAKING(unstable): change return type of Deno.serve() API (#19189)Bartek Iwańczuk
This commit changes the return type of an unstable `Deno.serve()` API to instead return a `Deno.Server` object that has a `finished` field. This change is done in preparation to be able to ref/unref the HTTP server.
2023-05-19feat(compile): remove need for `--unstable` with npm specifiers (#19185)David Sherret
2023-05-18feat(cli): add `nodeModulesDir` option to config file (#19095)David Sherret
This adds an option to disable or enable using a local `node_modules` directory as a project wide setting. https://github.com/denoland/manual/pull/659 Closes #17930
2023-05-18feat(cli): top-level `exclude` field in `deno.json` (#17778)scarf
2023-05-18feat(task): glob expansion (#19084)David Sherret
This adds cross-platform glob expansion to deno task.
2023-05-18fix(npm): run pre and post tasks if present (#19178)Marvin Hagemeister
This PR optionally runs pre and posts tasks from `package.json` if available. Fixes #19157
2023-05-18fix(npm): `process` not defined in readline (#19184)Marvin Hagemeister
Issue was that we create node globals much later, so pulling `process` via a module import is the way to go. Fixes #19183