summaryrefslogtreecommitdiff
path: root/cli/args/mod.rs
AgeCommit message (Collapse)Author
2024-08-14fix(cli): support --watch when running cjs npm packages (#25038)Luca Casonato
2024-08-13fix(tls): print a warning if a system certificate can't be loaded (#25023)Bartek Iwańczuk
This commit changes how system certificates are loaded on startup. Instead of hard erroring if a certificate can't be decoded, we are now printing a warning and bumping a hex representation of the certificate and continue execution. Ref https://github.com/denoland/deno/issues/24137
2024-08-09feat(fmt): support CSS, SCSS, Sass and Less (#24870)Pig Fang
This PR integrates [Malva](https://github.com/g-plane/malva) into `deno fmt`, which introduces the ability to format CSS, SCSS, Sass and Less files. On Linux x64 6.10, this PR increases about 800KiB: ``` ❯ wc -c target/release/deno 125168728 target/release/deno ❯ wc -c target/release/deno 124349456 target/release/deno ```
2024-08-08feat(cli): Add --env-file as alternative to --env (#24555)Birk Skyum
2024-08-07fix(compile): support workspace members importing other members (#24909)David Sherret
2024-08-02feat(unstable/fmt): move yaml formatting behind unstable flag (#24848)David Sherret
This moves YAML formatting behind an unstable flag for Deno 1.46. This will make it opt-in to start and then we can remove the flag to make it on by default in version of Deno after that. This can be specified by doing `deno fmt --unstable-yaml` or by specifying the following in a deno.json file: ```json { "unstable": ["fmt-yaml"] } ```
2024-08-01fix: Don't panic if failed to add system certificate (#24823)Bartek Iwańczuk
This commit fixes the panic from https://github.com/denoland/deno/issues/24137. I'm not sure if we want to hard error or maybe instead skip with a warning and continue execution.
2024-07-31perf: update deno_ast to 0.41 (#24819)David Sherret
Some perf gains in swc (I measured formatting and it was slightly faster). Includes: * https://github.com/denoland/deno_graph/pull/508 * https://github.com/denoland/eszip/pull/193
2024-07-30fix(node): Rework node:child_process IPC (#24763)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/24756. Fixes https://github.com/denoland/deno/issues/24796. This also gets vitest working when using [`--pool=forks`](https://vitest.dev/guide/improving-performance#pool) (which is the default as of vitest 2.0). Ref https://github.com/denoland/deno/issues/23882. --- This PR resolves a handful of issues with child_process IPC. In particular: - We didn't support sending typed array views over IPC - Opening an IPC channel resulted in the event loop never exiting - Sending a `null` over IPC would terminate the channel - There was some UB in the read implementation (transmuting an `&[u8]` to `&mut [u8]`) - The `send` method wasn't returning anything, so there was no way to signal backpressure (this also resulted in the benchmark `child_process_ipc.mjs` being misleading, as it tried to respect backpressure. That gave node much worse results at larger message sizes, and gave us much worse results at smaller message sizes). - We weren't setting up the `channel` property on the `process` global (or on the `ChildProcess` object), and also didn't have a way to ref/unref the channel - Calling `kill` multiple times (or disconnecting the channel, then calling kill) would throw an error - Node couldn't spawn a deno subprocess and communicate with it over IPC
2024-07-27fix(npmrc): skip loading .npmrc in home dir on permission error (#24758)David Sherret
2024-07-25refactor: decouple node resolution from deno_core (#24724)David Sherret
2024-07-23fix(upgrade): do not error if config in cwd invalid (#24689)David Sherret
``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729
2024-07-23refactor: update to use deno_package_json (#24688)David Sherret
This is in preparation for extracting out node resolution code from ext/node (which is something I'm going to do gradually over time). Uses https://github.com/denoland/deno_package_json
2024-07-19refactor: update to deno_config 0.25 (#24645)David Sherret
- Gets rid of WorkspaceMemberContext. It's now `Workspace` and `WorkspaceDirectory` - Uses the workspace cache in the lsp * https://github.com/denoland/deno_config/pull/95 * https://github.com/denoland/deno_config/pull/96
2024-07-18fix(lsp): support npm workspaces and fix some resolution issues (#24627)David Sherret
Makes the lsp use the same code as the rest of the cli.
2024-07-15fix(node): Fix `--allow-scripts` with no `deno.json` (#24533)Nathan Whitaker
We would resolve the wrong package.json, resulting in an inability to run CJS (or other node-mode) scripts
2024-07-12fix(config): regression - should not discover npm workspace for nested ↵David Sherret
deno.json not in workspace (#24559) Closes #24554
2024-07-12refactor: move importMap with imports/scopes diagnostic to deno_config (#24553)David Sherret
2024-07-10feat(jsr): support publishing jsr packages in npm workspaces (#24507)David Sherret
Supports publishing an npm workspace with a directory structure similar to the following: - workspace - package.json - package-a - package.json - jsr.json - package-b - package.json - jsr.json deno_config PR: https://github.com/denoland/deno_config/pull/77 Closes https://github.com/denoland/deno/issues/23638
2024-07-10fix: memory leak when transpiling (#24490)Bartek Iwańczuk
This commit fixes memory leak described in https://github.com/denoland/deno/issues/24380. This is done by upgrading following crates: - deno_ast - deno_graph - eszip - dprint-plugin-typescript - deno_lint - deno_doc - deno_emit
2024-07-10feat(node): Support executing npm package lifecycle scripts ↵Nathan Whitaker
(preinstall/install/postinstall) (#24487) Adds support for running npm package lifecycle scripts, opted into via a new `--allow-scripts` flag. With this PR, when running `deno cache` (or `DENO_FUTURE=1 deno install`) you can specify the `--allow-scripts=pkg1,pkg2` flag to run lifecycle scripts attached to the given packages. Note at the moment this only works when `nodeModulesDir` is true (using the local resolver). When a package with un-run lifecycle scripts is encountered, we emit a warning suggesting things may not work and to try running lifecycle scripts. Additionally, if a package script implicitly requires `node-gyp` and it's not found on the system, we emit a warning. Extra things in this PR: - Extracted out bits of `task.rs` into a separate module for reuse - Added a couple fields to `process.config` in order to support `node-gyp` (it relies on a few variables being there) - Drive by fix to downloading new npm packages to test registry --- TODO: - [x] validation for allow-scripts args (make sure it looks like an npm package) - [x] make allow-scripts matching smarter - [ ] figure out what issues this closes --- Review notes: - This adds a bunch of deps to our test registry due to using `node-gyp`, so it's pretty noisy
2024-07-09feat(compile): support --env (#24166)HasanAlrimawi
Supported the use of --env flag with the compile subcommand, so that the generated executable/binary file can access the passed env file.
2024-07-09fix: do not download compilerOptions -> types when not type checking (#24473)David Sherret
Closes https://github.com/denoland/deno/issues/22738
2024-07-09fix: add warning for invalid unstable feature use in deno.json/jsonc (#24120)HasanAlrimawi
2024-07-08fix(workspace): better cli file argument handling (#24447)David Sherret
Closes https://github.com/denoland/deno/issues/24422
2024-07-05refactor: move `FileCollector` to deno_config (#24433)David Sherret
2024-07-05fix(publish): unfurling should always be done with the package json (#24435)David Sherret
Closes https://github.com/denoland/deno/issues/24430
2024-07-04feat: npm workspace and better Deno workspace support (#24334)David Sherret
Adds much better support for the unstable Deno workspaces as well as support for npm workspaces. npm workspaces is still lacking in that we only install packages into the root node_modules folder. We'll make it smarter over time in order for it to figure out when to add node_modules folders within packages. This includes a breaking change in config file resolution where we stop searching for config files on the first found package.json unless it's in a workspace. For the previous behaviour, the root deno.json needs to be updated to be a workspace by adding `"workspace": ["./path-to-pkg-json-folder-goes-here"]`. See details in https://github.com/denoland/deno_config/pull/66 Closes #24340 Closes #24159 Closes #24161 Closes #22020 Closes #18546 Closes #16106 Closes #24160
2024-07-02fix(compile): prevent setting unstable feature twice (#24381)HasanAlrimawi
Prevent panic when enabling a feature that is already enabled by removing duplicate features. Closes #22015 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-07-02chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24388)Bartek Iwańczuk
Reland of https://github.com/denoland/deno/pull/24056 that doesn't suffer from the problem that was discovered in https://github.com/denoland/deno/pull/24261. It uses upgraded `hyper` and `hyper-util` that fixed the previous problem in https://github.com/hyperium/hyper/pull/3691.
2024-06-28refactor(cli): Create wrapper around `deno_lockfile::Lockfile` (#24366)Nathan Whitaker
As suggested in https://github.com/denoland/deno/pull/24355#discussion_r1657875422. I wasn't able to hide the mutex stuff as much as I'd like (ended up just adding an escape hatch `inner()` method that locks the inner mutex), because you can't return references to the inner fields through a mutex. This is mostly motivated by the frozen lockfile changes
2024-06-27fix(ext/node): discover .npmrc in user's homedir (#24021)Bartek Iwańczuk
This commit adds discovery of `.npmrc` files in user's homedir. This is not a perfect fix as it doesn't merge multiple `.npmrc` files together as per https://github.com/denoland/deno/issues/23954 but allows to fallback if no `.npmrc` file is discovered in the project root.
2024-06-26refactor: move PackageJson to deno_config (#24348)David Sherret
2024-06-19Revert "chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)" (#24262)Bartek Iwańczuk
This reverts commit fb31eaa9ca59f6daaee0210d5cd206185c7041b9. Reverting because users reported spurious errors when downloading dependencies - https://github.com/denoland/deno/issues/24260. Closes https://github.com/denoland/deno/issues/24260
2024-06-13chore: upgrade to reqwest 0.12.4 and rustls 0.22 (#24056)Bartek Iwańczuk
This commit updates Deno to use `reqwest` at 0.12.4 and `rustls` at 0.22. Other related crates were updated as well to match versions accepted by `reqwest` and `rustls`. Note: we are not using the latest available `rustls` yet, but this upgrade was non-trivial already, so a bump to 0.23 for `rustls` will be done in a separate commit. Closes #23370 --------- Signed-off-by: Ryan Dahl <ry@tinyclouds.org> Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Ryan Dahl <ry@tinyclouds.org> Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-06-06refactor: remove `PermissionsContainer` in deno_runtime (#24119)David Sherret
Also removes permissions being passed in for node resolution. It was completely useless because we only checked it for reading package.json files, but Deno reading package.json files for resolution is perfectly fine. My guess is this is also a perf improvement because Deno is doing less work.
2024-06-05fix(npm): use configured auth for tarball urls instead of scope auth (#24111)David Sherret
Deno was using the scope auth for the tarball urls, which is not always correct. We are going to do a release immediately for this issue.
2024-06-05fix: better handling of npm resolution occurring on workers (#24094)David Sherret
Closes https://github.com/denoland/deno/issues/24063
2024-05-30feat: do not require `DENO_FUTURE=1` for npmrc support (#24043)David Sherret
2024-05-30feat(lsp): support .npmrc (#24042)Nayeem Rahman
Closes #24040
2024-05-30feat(lint): add `no-boolean-literal-for-arguments` rule and enable ↵Luca Casonato
`no-unused-vars` for jsx files (#24034) * https://github.com/denoland/deno_lint/pull/1271 * https://github.com/denoland/deno_lint/pull/1277 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-28feat(vendor): support modifying remote files in vendor folder without ↵David Sherret
checksum errors (#23979) Includes: * https://github.com/denoland/deno_graph/pull/486 * https://github.com/denoland/deno_graph/pull/488 * https://github.com/denoland/deno_lockfile/pull/25 * https://github.com/denoland/deno_lockfile/pull/22 * https://github.com/denoland/deno_graph/pull/483 * https://github.com/denoland/deno_graph/pull/470
2024-05-28fix(deno_task): more descriptive error message (#24001)Mike Mulchrone
Signed-off-by: Mike Mulchrone <mikemulchrone987@gmail.com> Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-05-28FUTURE(ext/ffi,ext/webgpu): stabilize FFI and WebGPU APIs (#24011)Asher Gomez
Closes #23906
2024-05-27FUTURE(ext/fs): stabilize file system APIs (#23968)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/23906 --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-05-27fix: `--env` flag confusing message on syntax error (#23915)Hasan-Alrimawi
Enhanced warning message for --env flag with run and eval subcommands. The commit is specifically made to address issue #23674 by improving the warning messages that appear when using the --env flag with run or eval subcommands in the following scenarios: 1. Missing environment file. 2. Incorrect syntax in the environment file content. **Changes made** - Distinguishes between cases of missing environment file and wrong syntax in the environment file content. - Shows a concise warning message to convey the case/issue occurred. **Code changes & enhancements** - Implemented a match statement to handle different types of errors received while getting and parsing the file content to display a concise warning message, rather than simple error check and then displaying the same warning message for whatever the type of error is. - Updated the related existing tests to reflect the new warning messages. - Added two test cases to cover the wrong environment file content syntax with both run and eval subcommands. **Impact** The use of --env flag with both run/eval would be more user-friendly as it gives a precise description of what is not right when using incorrectly. If you could give it a look, @dsherret , I appreciate your feedback on these changes. --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-05-23FUTURE: initial support for .npmrc file (#23560)Bartek Iwańczuk
This commit adds initial support for ".npmrc" files. Currently we only discover ".npmrc" files next to "package.json" files and discovering these files in user home dir is left for a follow up. This pass supports "_authToken" and "_auth" configuration for providing authentication. LSP support has been left for a follow up PR. Towards https://github.com/denoland/deno/issues/16105
2024-05-23fix(cli): Support deno.lock with only package.json present + fix DENO_FUTURE ↵Nathan Whitaker
install interactions with lockfile (#23918) Fixes #23571. Previously, we required a `deno.json` to be present (or the `--lock` flag) in order for us to resolve a `deno.lock` file. This meant that if you were using deno in an npm-first project deno wouldn't use a lockfile. Additionally, while I was fixing that, I discovered there were a couple bugs keeping the future `install` command from using a lockfile. With this PR, `install` will actually resolve the lockfile (or create one if not present), and update it if it's not up-to-date. This also speeds up `deno install`, as we can use the lockfile to skip work during npm resolution.
2024-05-17feat(serve): support `--port 0` to use an open port (#23846)Satya Rohith
Closes https://github.com/denoland/deno/issues/23845
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>