summaryrefslogtreecommitdiff
path: root/cli/tools
AgeCommit message (Collapse)Author
2024-05-16fix(node): seperate worker module cache (#23634)Divy Srivastava
Construct a new module graph container for workers instead of sharing it with the main worker. Fixes #17248 Fixes #23461 --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-05-14fix(publish): always include config file when publishing (#23797)David Sherret
Closes https://github.com/denoland/deno/issues/23796
2024-05-14fix(publish): error for missing version constraints on dry-publish instead ↵David Sherret
of just publish (#23798) Closes https://github.com/denoland/deno/issues/22835
2024-05-13chore(task): various small refactorings (#23793)David Sherret
2024-05-13fix(cli): panic with `deno coverage` (#23353)Evan
This PR directly addresses the issue raised in #23282 where Deno panics if `deno coverage` is called with `--include` regex that returns no matches. I've opted not to change the return value of `collect_summary` for simplicity and return an empty `HashMap` instead
2024-05-13refactor(lsp): reuse CliGraphResolverOptions::sloppy_imports_resolver (#23764)Nayeem Rahman
2024-05-09fix(task): regression where `npx <command>` sometimes couldn't find command ↵David Sherret
(#23730) Closes https://github.com/denoland/deno/issues/23724
2024-05-08chore: enable clippy::print_stdout and clippy::print_stderr (#23732)David Sherret
1. Generally we should prefer to use the `log` crate. 2. I very often accidentally commit `eprintln`s. When we should use `println` or `eprintln`, it's not too bad to be a bit more verbose and ignore the lint rule.
2024-05-08FUTURE: `deno install` changes (#23498)Bartek Iwańczuk
This PR implements the changes we plan to make to `deno install` in deno 2.0. - `deno install` without arguments caches dependencies from `package.json` / `deno.json` and sets up the `node_modules` folder - `deno install <pkg>` adds the package to the config file (either `package.json` or `deno.json`), i.e. it aliases `deno add` - `deno add` can also add deps to `package.json` (this is gated behind `DENO_FUTURE` due to uncertainty around handling projects with both `deno.json` and `package.json`) - `deno install -g <bin>` installs a package as a globally available binary (the same as `deno install <bin>` in 1.0) --------- Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-05-06fix(compile): relative permissions should be retained as relative (#23719)David Sherret
Closes #23715
2024-05-02fix(test): proper type checking for files with doc tests (#23654)Leo Kettmeir
Closes https://github.com/denoland/deno/issues/23430 --------- Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2024-05-01refactor(jupyter): move communication methods out of data structs (#23622)David Sherret
Moves the communication methods out of the data structs and onto the `Connection` struct.
2024-05-01chore: update deno_doc (#23621)Leo Kettmeir
2024-04-30feat(cli): add support for jsxImportSourceTypes (#23419)Luca Casonato
Co-authored-by: David Sherret <dsherret@gmail.com>
2024-04-29refactor: remove conditional color code in bench reporter (#23593)David Sherret
There is no need for this conditional code because it's handled by the `colors` module.
2024-04-24chore: update deno_doc (#23544)Leo Kettmeir
2024-04-24feat: Add `deno serve` subcommand (#23511)Matt Mastracci
By default, `deno serve` will assign port 8000 (like `Deno.serve`). Users may choose a different port using `--port`. `deno serve /tmp/file.ts` `server.ts`: ```ts export default { fetch(req) { return new Response("hello world!\n"); }, }; ```
2024-04-24fix(publish): --dry-publish should error for gitignored excluded files (#23540)David Sherret
Files that were gitignored only were not included in the diagnostic.
2024-04-23fix(cli): Don't panic on invalid emit options (#23463)Nathan Whitaker
Fixes #23456.
2024-04-20feat(task): support running npm binary commands in deno.json (#23478)David Sherret
npm binary commands like `vite` from a `node_modules/.bin` folder will now execute when defined in a deno.json Closes https://github.com/denoland/deno/issues/23477
2024-04-19refactor: move redirect handling into deno_graph (#23444)David Sherret
2024-04-19perf(lsp): cleanup document dependencies (#23426)Nayeem Rahman
2024-04-18fix(cli): avoid `deno add` and `deno vendor` errors when deno.json is empty ↵nokazn
(#23439)
2024-04-17fix(publish): support import equals (#23421)Luca Casonato
2024-04-17perf: v8 code cache (#23081)Igor Zinkovsky
This PR enables V8 code cache for ES modules and for `require` scripts through `op_eval_context`. Code cache artifacts are transparently stored and fetched using sqlite db and are passed to V8. `--no-code-cache` can be used to disable. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-04-16fix(cli): Identify and fix a test deadlock (#23411)Matt Mastracci
If a worker tried to flush large amounts of data right as the test was ending, it could cause the flush sync marker to get lost.
2024-04-16fix(cli): TestEventSender should be !Clone (#23405)Matt Mastracci
`TestEventSender` should not be Clone so we don't end up with multiple copies of the same writer FD. This is probably not the cause of the test channel lockups, but it's a lot easier to reason about.
2024-04-16fix(ext/node): dispatch beforeExit/exit events irrespective of listeners ↵Satya Rohith
(#23382) Closes https://github.com/denoland/deno/issues/23342 Closes https://github.com/denoland/deno/issues/21757
2024-04-15fix(ext/io): Fix NUL termination error in windows named pipes (#23379)Matt Mastracci
Due to a terminating NUL that was placed in a `r#` string, we were not actually NUL-terminating pipe names on Windows. While this has no security implications due to the random nature of the prefix, it would occasionally cause random failures when the trailing garbage would make the pipe name invalid.
2024-04-15refactor: move lifecycle events dispatch to Rust (#23358)Bartek Iwańczuk
This commit moves logic of dispatching lifecycle events ( "load", "beforeunload", "unload") to be triggered from Rust. Before that we were executing scripts from Rust, but now we are storing references to functions from "99_main.js" and calling them directly. Prerequisite for https://github.com/denoland/deno/issues/23342
2024-04-11fix(publish): do not warn about excluded external modules in node_modules ↵David Sherret
directory (#23173)
2024-04-11fix: upgrade deno_ast related crates (#23187)David Sherret
Had to revert back swc due to https://github.com/swc-project/swc/issues/8840 Fixes: - https://github.com/denoland/deno_lint/pull/1262 - https://github.com/denoland/deno_doc/pull/538 - https://github.com/denoland/deno_doc/pull/537 - https://github.com/denoland/deno_graph/pull/430 - https://github.com/denoland/deno_graph/pull/425 - https://github.com/denoland/deno_graph/pull/432
2024-04-10chore: update to Rust 1.77.2 (#23262)林炳权
update to Rust 1.77.2 --------- Co-authored-by: Matt Mastracci <matthew@mastracci.com>
2024-04-10fix(ext/fs): account for all ops in leak checks (#23300)Asher Gomez
This is PR a smaller retry of #23066 that simply ensures all async `ext/fs` ops are accounted for if left hanging in tests. This also sorts the `OP_DETAILS` in alphabetical order for easy future reading. When reviewing, it might be best to look at the commits in order for better understanding.
2024-04-05FUTURE: override byonm with nodeModulesDir setting (#23222)David Sherret
Makes the `"nodeModulesDir"` setting take precedence over byonm when using `DENO_FUTURE`.
2024-04-04fix(cli): fix deadlock in test writer when test pipe is full (#23210)Matt Mastracci
The tests would deadlock if we tried to write the sync marker into a pipe that was full because one test streamed just enough data to fill the pipe, so when we went to actually write the sync marker we blocked when nobody was reading. We use a two-phase lock for sync markers now: one to indicate "ready to sync" and the second to indicate that the sync bytes have been received.
2024-04-04refactor(flags): prepare for deno install changes (#23217)Bartek Iwańczuk
This commit adds enum to "InstallFlags" and "UninstallFlags" that will allow to support both local and global (un)installation. Currently the local variant is not used. Towards https://github.com/denoland/deno/issues/23062
2024-03-31fix(check): ignore certain diagnostics in remote modules and when publishing ↵David Sherret
(#23119) Unused locals and parameters don't make sense to surface in remote modules. Additionally, fast check can cause these kind of diagnostics when publishing, so they should be ignored. Closes #22959
2024-03-28chore: update deno_doc to 0.119.0 (#23103)Leo Kettmeir
2024-03-27feat(install): require -g / --global flag (#23060)Bartek Iwańczuk
In preparation for upcoming changes to `deno install` in Deno 2. If `-g` or `--global` flag is not provided a warning will be emitted: ``` ⚠️ `deno install` behavior will change in Deno 2. To preserve the current behavior use `-g` or `--global` flag. ``` The same will happen for `deno uninstall` - unless `-g`/`--global` flag is provided a warning will be emitted. Towards https://github.com/denoland/deno/issues/23062 --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-03-27feat(task): Task description in the form of comments (#23101)Nathan Whitaker
Closes #22786. TLDR; ```jsonc { "tasks": { // Some comment // // describing what the task does "dev": "deno run -A --watch main.ts" } } ``` ```bash deno task ``` ![Screenshot 2024-03-27 at 1 43 49 PM](https://github.com/denoland/deno/assets/17734409/7a14da8c-8e63-45ba-9bfb-590d250b56a9)
2024-03-27fix: less aggressive vendor folder ignoring (#23100)David Sherret
This is slightly breaking as some users want the `vendor` folder excluded and may not have that specified in their deno.json. Closes #22833
2024-03-27feat(init): use jsr specifier for @std/assert (#23073)Bartek Iwańczuk
This commit changes "deno init" subcommand to use "jsr:" specifier for standard library "assert" module. It is unversioned, but we will change it to `@^1` once `@std/assert` release version 1.0. This allows us to start decoupling `deno` and `deno_std` release. The release scripts have been updated to take that into account.
2024-03-27feat(task): cross-platform shebang support (#23091)David Sherret
Adds cross-platform shebang support (supports using shebangs in `deno task` on Windows) https://github.com/denoland/deno_task_shell/pull/113
2024-03-26feat(add): always produce multiline config file (#23077)Bartek Iwańczuk
This commit changes `deno add` to always produce a multiline config file. In v1.41.3: ``` $ mkdir foo $ cd foo $ deno add @std/assert Created deno.json configuration file. Add @std/assert - jsr:@std/assert@^0.220.0 $ cat deno.json { "imports": { "@std/assert": "jsr:@std/assert@^0.220.0" } } ``` Now: ``` $ mkdir foo $ cd foo $ deno add @std/assert Created deno.json configuration file. Add @std/assert - jsr:@std/assert@^0.220.0 $ cat deno.json { "imports": { "@std/assert": "jsr:@std/assert@^0.220.0" } } ```
2024-03-26fix(kernel): Do not increase counter if store_history=false (#20848)Don Jayamanne
Fixes https://github.com/denoland/deno/issues/20847 Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-03-26fix(bench): Fix group header printing logic + don't filter out the warmup ↵Nathan Whitaker
benchmark (#23083) Fixes #23053. Two small bugs here: - the existing condition for printing out the group header was broken. it worked in the reproducer (in the issue above) without filtering only by accident, due to setting `self.has_ungrouped = true` once we see the warmup bench. Knowing that we sort benchmarks to put ungrouped benches first, there are only two cases: 1) we are starting the first group 2) we are ending the previous group and starting a new group - when you passed `--filter` we were applying that filter to the warmup bench (which is not visible to users), so we suffered from jit bias if you were filtering (unless your filter was `<warmup>`) TLDR; Running ```bash deno bench main.js --filter="G" ``` ```js // main.js Deno.bench({ group: "G1", name: "G1-A", fn() {}, }); Deno.bench({ group: "G1", name: "G1-B", fn() {}, }); ``` Before this PR: ``` benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- G1-A 303.52 ps/iter3,294,726,102.1 (254.2 ps … 7.8 ns) 287.5 ps 391.7 ps 437.5 ps G1-B 3.8 ns/iter 263,360,635.9 (2.24 ns … 8.36 ns) 3.84 ns 4.73 ns 4.94 ns summary G1-A 12.51x faster than G1-B ``` After this PR: ``` benchmark time (avg) iter/s (min … max) p75 p99 p995 --------------------------------------------------------------- ----------------------------- group G1 G1-A 3.85 ns/iter 259,822,096.0 (2.42 ns … 9.03 ns) 3.83 ns 4.62 ns 4.83 ns G1-B 3.84 ns/iter 260,458,274.5 (3.55 ns … 7.05 ns) 3.83 ns 4.45 ns 4.7 ns summary G1-B 1x faster than G1-A ```
2024-03-26refactor(lsp): unify config file data into ConfigTree (#23032)Nayeem Rahman
2024-03-25chore(tests): Introduce integration tests for `jupyter` subcommand (#23074)Nathan Whitaker
Before this PR, we didn't have any integration tests set up for the `jupyter` subcommand. This PR adds a basic jupyter client and helpers for writing integration tests for the jupyter kernel. A lot of the code here is boilerplate, mainly around the message format for jupyter. This also adds a few basic integration tests, most notably for requesting execution of a snippet of code and getting the correct results.
2024-03-25feat(lint): automatically opt-in packages to `jsr` lint tag (#23072)David Sherret
This automatically opts packages (deno.json's with a name, version, and exports field) into the "jsr" lint tag.