summaryrefslogtreecommitdiff
path: root/cli/args/mod.rs
AgeCommit message (Collapse)Author
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-17fix(npm): improved optional dependency support (#19135)David Sherret
Note: If the package information has already been cached, then this requires running with `--reload` or for the registry information to be fetched some other way (ex. the cache busting). Closes #15544 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-05-10feat(compile): unstable npm and node specifier support (#19005)David Sherret
This is the initial support for npm and node specifiers in `deno compile`. The npm packages are included in the binary and read from it via a virtual file system. This also supports the `--node-modules-dir` flag, dependencies specified in a package.json, and npm binary commands (ex. `deno compile --unstable npm:cowsay`) Closes #16632
2023-05-01perf: lazily create RootCertStore (#18938)David Sherret
2023-05-01refactor(cli): remove ProcState - add CliFactory (#18900)David Sherret
This removes `ProcState` and replaces it with a new `CliFactory` which initializes our "service structs" on demand. This isn't a performance improvement at the moment for `deno run`, but might unlock performance improvements in the future.
2023-05-01refactor(cli): use CliMainWorker in standalone (#18880)David Sherret
Uses `CliMainWorker` in all the cli code.
2023-04-27refactor(cli): extract out ProcState from CliMainWorker (#18867)David Sherret
2023-04-13refactor: upgrade to deno_npm 0.3.0 (#18671)David Sherret
This allows us to specify the `@types/node` version constraint in the CLI instead of in deno_npm.
2023-04-12fix(npm): cache bust npm specifiers more aggressively (#18636)David Sherret
Part 1: #18622 Part 2: This PR Closes #16901 --------- Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-04-06refactor(npm): use deno_npm and deno_semver (#18602)David Sherret
2023-03-26feat(bench): add `--no-run` flag (#18433)Geert-Jan Zwiers
2023-03-23fix(cli): restore `deno run -` to handle stdin as typescript (#18391)Cre3per
Bug reported here shortly after merging `--ext` changes https://github.com/denoland/deno/pull/17172#issuecomment-1480898098 Also found a missing `--check` in integration tests for `--ext` that would have missed a bug if there was one. Fixes #18392
2023-03-22feat(cli): --ext parameter for run, compile, and bundle (#17172)Cre3per
Adds `--ext` to `deno run`, closes #5088 Additionally - Adds `--ext` to `deno compile` and `deno bundle`
2023-03-21chore(cli) Use with_context(|| format!(...)) rather than ↵Matt Mastracci
context(format!(...)) to avoid allocations in non-error path (#18332)
2023-03-14test: fix flaky resolve_import_map_flags_take_precedence test (#18182)Bartek Iwańczuk
Trying to fix https://github.com/denoland/deno/issues/18180
2023-03-14refactor(core): resolve_url_or_path and resolve_url_or_path_deprecated (#18170)Bartek Iwańczuk
This commit changes current "deno_core::resolve_url_or_path" API to "resolve_url_or_path_deprecated" and adds new "resolve_url_or_path" API that requires to explicitly pass the directory from which paths should be resolved to. Some of the call sites were updated to use the new API, the reminder of them will be updated in a follow up PR. Towards landing https://github.com/denoland/deno/pull/15454
2023-03-12refactor(npm): push npm struct creation to a higher level (#18139)David Sherret
This has been bothering me for a while and it became more painful while working on #18136 because injecting the shared progress bar became very verbose. Basically we should move the creation of all these npm structs up to a higher level. This is a stepping stone for a future refactor where we can improve how we create all our structs.
2023-03-09chore: update Rust to 1.68.0 (#18102)Bartek Iwańczuk
2023-03-03fix: lazily surface errors in package.json deps parsing (#17974)David Sherret
Closes #17941
2023-02-24feat: add `DENO_NO_PACKAGE_JSON` env var (#17926)David Sherret
Depends on #17924 Part of #17916
2023-02-24fix(npm): package.json auto-discovery should respect `--no-config` and ↵David Sherret
`--no-npm` (#17924) Part of #17916
2023-02-23fix(npm): support bare specifiers in package.json having a path (#17903)David Sherret
For example `import * as test from "package/path.js"`
2023-02-23feat(npm): support bare specifiers from package.json in more subcommands and ↵David Sherret
language server (#17891)
2023-02-22feat(task): support scripts in package.json (#17887)David Sherret
This is a super basic initial implementation. We don't create a `node_modules/.bin` folder at the moment and add it to the PATH like we should which is necessary to make command name resolution in the subprocess work properly (ex. you run a script that launches another script that then tries to launch an "npx command"... this won't work atm). Closes #17492
2023-02-22fix(npm): resolve node_modules dir relative to package.json instead of cwd ↵David Sherret
(#17885)
2023-02-20feat: auto-discover package.json for npm dependencies (#17272)Bartek Iwańczuk
This commits adds auto-discovery of "package.json" file when running "deno run" and "deno task" subcommands. In case of "deno run" the "package.json" is being looked up starting from the directory of the script that is being run, stopping early if "deno.json(c)" file is found (ie. FS tree won't be traversed "up" from "deno.json"). When "package.json" is discovered the "--node-modules-dir" flag is implied, leading to creation of local "node_modules/" directory - we did that, because most tools relying on "package.json" will expect "node_modules/" directory to be present (eg. Vite). Additionally "dependencies" and "devDependencies" specified in the "package.json" are downloaded on startup. This is a stepping stone to supporting bare specifier imports, but the actual integration will be done in a follow up commit. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2023-02-12feat(bench): Add JSON reporter for "deno bench" subcommand (#17595)Serhiy Barhamon
2023-02-09refactor: deno_graph 0.43 upgrade (#17692)David Sherret
2023-01-27chore: upgrade to Rust 1.67 (#17548)David Sherret
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2023-01-25fix: support import map specified as data uri (#17531)David Sherret
2023-01-25feat: embed import map in the config file (#17478)Bartek Iwańczuk
This commit changes handling of config file to enable specifying "imports" and "scopes" objects effectively making the configuration file an import map. "imports" and "scopes" take precedence over "importMap" configuration, but have lower priority than "--importmap" CLI flag. Co-authored-by: David Sherret <dsherret@users.noreply.github.com> Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-25feat(fmt): make semi-colon option a boolean (#17527)David Sherret
2023-01-24feat(fmt): add ability to configure semicolons (#17292)Bartek Iwańczuk
Allows to change behavior of `deno fmt` to use "ASI" setting for semicolons instead of always prefering them, this is done by "--options-semi=asi" flag or `"semi": "asi"` setting in the config file.
2023-01-23refactor: Move lockfile to a separate crate (#17503)Bartek Iwańczuk
Moves the lockfile implementation to a separate crate so other projects like Deploy can use it as well.
2023-01-18refactor(cli): Integrate standalone mode cert handling into `Flags` (#17419)Andreu Botella
The way the standalone mode handles the `--cert` flag is different to all other modes. This is because `--cert` takes a path to the certificate file, which is directly added to the root cert store; except for compile mode, where its byte contents are stored in the standalone metadata, and they are added to the root cert store after the `ProcState` is created. This change instead changes `Flags::ca_file` (an `Option<String>`) into `Flags::ca_data`, which can represent a `String` file path or a `Vec<u8>` with the certificate contents. That way, standalone mode can create a `ProcState` whose root cert store alreay contains the certificate. This change also adds a tests for certificates in standalone mode, since there weren't any before. This refactor will help with implementing web workers in standalone mode in the future.
2023-01-07refactor(cli/tools): move flag and config logic to CliOptions (#17008)Geert-Jan Zwiers
Co-authored-by: David Sherret <dsherret@gmail.com>
2023-01-05refactor(cli,core,ext,rt): remove some unnecessary `clone` or `malloc` (#17274)Yiyu Lin
2023-01-02chore: update copyright year to 2023 (#17247)David Sherret
Yearly tradition of creating extra noise in git.
2022-12-17chore: update to Rust 1.66.0 (#17078)linbingquan
2022-12-16fix(npm): fix require resolution if using --node-modules-dir (#17087)Bartek Iwańczuk
In our `require()` implementation we use a special logic to resolve "base path" when looking for matching packages, however this logic is in contradiction to what needs to happen if there's a local "node_modules" directory used. This commit changes require implementation to be aware if we're running off of global node modules cache or a local one.
2022-12-12feat: add `--inspect-wait` flag (#17001)Bartek Iwańczuk
This commit adds new "--inspect-wait" flag which works similarly to "--inspect-brk" in that it waits for inspector session to be established before running code. However it doesn't break on the first statement of user code, but instead runs it as soon as a session is established.
2022-12-10feat(cli): support deno bench in the config file (#16608)Geert-Jan Zwiers
This PR adds the ability to set `include/exclude` fields for `deno bench` in the configuration file.
2022-12-08fix(compile): ensure import map is used when specified in deno config file ↵David Sherret
(#16990) Closes #14246
2022-11-30fix(repl): respect --quiet flag (#16875)Bartek Iwańczuk
This commit changes REPL behavior to respect --quiet flag. Once this flag is present REPL will not print a banner at the start.
2022-11-28refactor: create util folder, move nap_sym to napi/sym, move http_cache to ↵David Sherret
cache folder (#16857)
2022-11-26refactor: `DenoDir` - move to cache folder and make `root_dir` private (#16823)David Sherret
2022-11-25refactor: move dts files, diagnostics.rs, and tsc.rs to tsc folder (#16820)David Sherret
2022-11-25refactor: move lockfile.rs to args module (#16818)David Sherret
This should be in the `args` folder as it's similar to `config_file`.
2022-11-02fix(lock): autodiscovery of lockfile (#16498)Bartek Iwańczuk
This commit adds autodiscovery of lockfile. This only happens if Deno discovers the configuration file (either "deno.json" or "deno.jsonc"). In such case Deno tries to load "deno.lock" file that sits next to the configuration file, or creates one for user if the lockfile doesn't exist yet. As a consequence, "--lock" and "--lock-write" flags had been updated. "--lock" no longer requires a value, if one is not provided, it defaults to "./deno.lock" resolved from the current working directory. "--lock-write" description was updated to say that it forces to overwrite a lockfile. Autodiscovery is currently not handled by the LSP.
2022-10-13fix(cli): allow importMap to be an absolute URL within the deno config file ↵Mark Gibson
(#16234)