summaryrefslogtreecommitdiff
path: root/cli/args/flags.rs
AgeCommit message (Collapse)Author
2024-09-04fix: lock down allow-run permissions more (#25370)David Sherret
`--allow-run` even with an allow list has essentially been `--allow-all`... this locks it down more. 1. Resolves allow list for `--allow-run=` on startup to an absolute path, then uses these paths when evaluating if a command can execute. Also, adds these paths to `--deny-write` 1. Resolves the environment (cwd and env vars) before evaluating permissions and before executing a command. Then uses this environment to evaluate the permissions and then evaluate the command.
2024-09-03fix(flags): require global flag for permission flags in install subcommand ↵Leo Kettmeir
(#25391) Also rewrites some of the subcommands help text Closes https://github.com/denoland/deno/issues/25362 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-03fix(install): recommend using `deno install -g` when using a single http url ↵Bartek Iwańczuk
(#25388) Closes https://github.com/denoland/deno/issues/25361
2024-09-03BREAKING(permissions): remove --allow-hrtime (#25367)Luca Casonato
Remove `--allow-hrtime` and `--deny-hrtime`. We are doing this because it is already possible to get access to high resolution timers through workers and SharedArrayBuffer. Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-03feat: hide several --unstable-* flags (#25378)Bartek Iwańczuk
This commit hides following unstable flags: - `--unstable-ffi` (the API is now stable) - `--unstable-webgpu` (this API is now stable) - `--unstable-fs` (no more unstable APIs) - `--unstable-byonm` (BYONM is on by default) The flags are still parseable, but they are not used. Concrete cleanup will be done in a follow up PR.
2024-09-03BREAKING: remove `deno vendor` (#25343)Asher Gomez
2024-09-02BREAKING: remove `--allow-none` flag (#25337)Asher Gomez
Towards #22079 Signed-off-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-09-02BREAKING: remove `--trace-ops` (#25344)Asher Gomez
Towards #22079
2024-09-02fix: remove entrypoint hack for Deno 2.0 (#25332)David Sherret
2024-09-02BREAKING: remove `deno bundle` (#25339)Asher Gomez
`deno bundle` now produces: ``` error: ⚠️ `deno bundle` was removed in Deno 2. See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations ``` `deno bundle --help` now produces: ``` ⚠️ `deno bundle` was removed in Deno 2. See the Deno 1.x to 2.x Migration Guide for migration instructions: https://docs.deno.com/runtime/manual/advanced/migrate_deprecations Usage: deno bundle [OPTIONS] Options: -q, --quiet Suppress diagnostic output --unstable Enable all unstable features and APIs. Instead of using this flag, consider enabling individual unstable features To view the list of individual unstable feature flags, run this command again with --help=unstable ```
2024-09-02BREAKING: remove `--ts` flag (#25338)Asher Gomez
2024-09-02BREAKING: remove `--jobs` flag (#25336)Asher Gomez
2024-08-31fix(upgrade): more informative information on invalid version (#25319)Bartek Iwańczuk
Before: ``` $ deno upgrade v1.xx error: Invalid version passed ``` After: ``` $ deno upgrade v1.xx error: Invalid version passed (v1.xx) Example usage: deno upgrade | deno upgrade 1.46 | deno upgrade canary ``` Also updates help text to use "shorthand version" without flags, but a positional arg.
2024-08-30refactor: remove DENO_FUTURE (#25314)David Sherret
2024-08-30BREAKING: `DENO_FUTURE=1` by default, or welcome to Deno 2.0 (#25213)Bartek Iwańczuk
This commit effectively turns Deno into Deno 2.0. This is done by forcing `DENO_FUTURE=1` env var, that was available in the past few months to try Deno 2 changes. This commit contains several breaking changes scheduled for Deno 2: - all deprecated JavaScript APIs are not available any more, mostly `Deno.*` APIs - `window` global is removed - FFI, WebGPU and FS APIs are now stable and don't require `--unstable-*` flags - import assertions are no longer supported - "bring your own node modules" is enabled by default This is the first commit in a series that are scheduled before the Deno 2 release. Follow up work is tracked in https://github.com/denoland/deno/issues/25241. --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Nayeem Rahman <nayeemrmn99@gmail.com> Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-08-29feat(config): Node modules option for 2.0 (#25299)Nathan Whitaker
2024-08-28feat: remove `--lock-write` flag (#25214)Bartek Iwańczuk
This commit remove `--lock-write` that was deprecated in v1.45 release. Closes https://github.com/denoland/deno/issues/24167. --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-27fix: removed unstable-htttp from deno help (#25216)HasanAlrimawi
Closes #25210 . Removed --unstable-http from being displayed on deno run --help=unstable --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-21feat(flags): improve help output and make `deno run` list tasks (#25108)Leo Kettmeir
- rewrite flag help - use gray for indentation - reorganize permission flags and split them up - make help subcommand act like help flag - `deno run` outputs list of tasks - Fixes #25120 error handling for `deno run` in case of no config file being found needs to be improved --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-20feat(config): Support frozen lockfile config option in deno.json (#25100)Nathan Whitaker
Closes #24544
2024-08-20feat(cli/tools): add a subcommand `--hide-stacktraces` for test (#24095)Hajime-san
2024-08-19fix(lint): support linting tsx/jsx from stdin (#24955)Yazan AbdAl-Rahman
Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-08-19feat(watch): add watch paths to test subcommand (#24771)Łukasz Czerniawski
2024-08-19feat(upgrade): support `deno upgrade 1.46.0` (#25096)Bartek Iwańczuk
This commit changes `deno upgrade` subcommand to accept a positional argument that can be either a version, release channel name or a git hash, making invocations of `deno upgrade` much more concise: ``` # before $ deno upgrade --version 1.46.0 # after $ deno upgrade 1.46.0 ``` ``` # before $ deno upgrade --canary # after $ deno upgrade canary ``` ``` # specific canary version before $ deno upgrade --canary --version f042c39180c1b345de8e7b5f0dfae5d0a49b161f # after $ deno upgrade f042c39180c1b345de8e7b5f0dfae5d0a49b161f ``` Old flags are still supported, but hidden from the help output.
2024-08-19feat: upgrade deno_core (#25042)snek
- Update ffi turbocall to use revised fast call api - Remove `v8_version` function calls - `*mut OwnedIsolate` is no longer stored in OpCtx gotham store
2024-08-18fix: clean up flag help output (#24686)Luca Casonato
Permission flags are unified in a clearer and concise output. Unstable flags are hidden by default with exception of the `unstable` flag itself. the remaining unstable flags can be seen with a `--help=unstable`. This also cleans up to show unstable flags only for subcommands that actually need them. Also sorts flags alphabetically, and gorups various flags together in a set of categories. --------- Co-authored-by: crowlkats <crowlkats@toaxl.com>
2024-08-16refactor: show release channel in `deno --version` (#25061)Bartek Iwańczuk
Also simplifies handling of various release channels in `deno upgrade` subcommand.
2024-08-15refactor: `version` module exports a single const struct (#25014)Bartek Iwańczuk
This commit rewrites the internal `version` module that exported various information about the current executable. Instead of exporting several consts, we are now exporting a single const structure that contains all the necessary information. This is the first step towards cleaning up how we use this information and should allow us to use SUI to be able to patch this information in already produced binary making it easier to cut new releases. --------- Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-08-15refactor: remove version::is_canary(), use ReleaseChannel instead (#25053)Bartek Iwańczuk
In preparation for https://github.com/denoland/deno/pull/25014, this commit removes public `is_canary()` method and instead uses an enum `ReleaseChannel` to be able to designate more "kinds" of builds.
2024-08-15feat: `deno compile --icon <ico>` (#25039)Divy Srivastava
Add `--icon` flag to set deno compile'd executable icon on Windows. ``` deno compile --icon icon.ico game.tsx ``` Depends on https://github.com/denoland/sui/pull/24 <img width="447" alt="image" src="https://github.com/user-attachments/assets/7f6f3aa0-6872-4975-ae9d-06701b7684b8"> Closes https://github.com/denoland/deno/issues/8912
2024-08-14feat(serve): Opt-in parallelism for `deno serve` (#24920)Nathan Whitaker
Adds a `parallel` flag to `deno serve`. When present, we spawn multiple workers to parallelize serving requests. ```bash deno serve --parallel main.ts ``` Currently on linux we use `SO_REUSEPORT` and rely on the fact that the kernel will distribute connections in a round-robin manner. On mac and windows, we sort of emulate this by cloning the underlying file descriptor and passing a handle to each worker. The connections will not be guaranteed to be fairly distributed (and in practice almost certainly won't be), but the distribution is still spread enough to provide a significant performance increase. --- (Run on an Macbook Pro with an M3 Max, serving `deno.com` baseline:: ``` ❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000 Running 30s test @ http://127.0.0.1:8000 2 threads and 125 connections Thread Stats Avg Stdev Max +/- Stdev Latency 239.78ms 13.56ms 330.54ms 79.12% Req/Sec 258.58 35.56 360.00 70.64% Latency Distribution 50% 236.72ms 75% 248.46ms 90% 256.84ms 99% 268.23ms 15458 requests in 30.02s, 2.47GB read Requests/sec: 514.89 Transfer/sec: 84.33MB ``` this PR (`with --parallel` flag) ``` ❯ wrk -d 30s -c 125 --latency http://127.0.0.1:8000 Running 30s test @ http://127.0.0.1:8000 2 threads and 125 connections Thread Stats Avg Stdev Max +/- Stdev Latency 117.40ms 142.84ms 590.45ms 79.07% Req/Sec 1.33k 175.19 1.77k 69.00% Latency Distribution 50% 22.34ms 75% 223.67ms 90% 357.32ms 99% 460.50ms 79636 requests in 30.07s, 12.74GB read Requests/sec: 2647.96 Transfer/sec: 433.71MB ```
2024-08-14feat(fmt): support HTML, Svelte, Vue, Astro and Angular (#25019)Pig Fang
This commit adds capability to format HTML, Svelte, Vue, Astro and Angular files. "--unstable-html" is required to format HTML files, and "--unstable-component" flag is needed to format other formats. These can also be specified in the config file. Close #25015
2024-08-12feat: deno remove (#24952)David Sherret
Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-08-12feat: `deno upgrade --rc` (#24905)Bartek Iwańczuk
This commit adds the "--rc" flag to "deno upgrade" subcommand. This flag allows to upgrade to the latest "release candidate" release. The update checker was also updated to take this into account.
2024-08-12feat: better help output (#24958)Leo Kettmeir
2024-08-12feat: Rename --unstable-hmr to --watch-hmr (#24975)Bartek Iwańczuk
This commit stabilizes HMR functionality and renames `--unstable-hmr` to `--watch-hmr`. The `--unstable-hmr` flag is still working, but hidden from the help output. It will be removed in Deno 2. Once https://github.com/denoland/deno/pull/24958 lands we should improve grouping of `--watch` and `--watch-hmr` flags.
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: `deno init --serve` (#24897)Bartek Iwańczuk
This commit adds "--serve" flag to "deno init" subcommand, that provides a template for quick starting a project using "deno serve". --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
2024-08-08feat: treat bare deno command with run arguments as deno run (#24887)Leo Kettmeir
removes the necessity for the `run` subcommand to run scripts fixes #24493
2024-08-08feat(cli): Add --env-file as alternative to --env (#24555)Birk Skyum
2024-08-08feat: support short flags for permissions (#24883)Ryan Dahl
This commit adds short CLI flags for following permission flags: - "-R" for "--allow-read" - "-W" for "--allow-write" - "-E" for "--allow-env" - "-N" for "--allow-net" - "-S" for "--allow-sys" --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-08-08feat: deno clean (#24950)David Sherret
Co-authored-by: Satya Rohith <me@satyarohith.com>
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-02fix(cli): shorten examples in help text (#24374)i-api
2024-08-02feat(test): rename --allow-none to --permit-no-files (#24809)Luca Casonato
2024-08-02feat(fmt): support YAML (#24717)Pig Fang
2024-08-02docs: fix typos (#24820)Andreas Deininger
This PR fixes various typos I spotted in the project.
2024-07-29fix(cli): Unhide publish subcommand help string (#24787)Ryan B.
Fixes #24753 The help text for `deno publish` was marked hidden while in preview. This is no longer a preview feature.
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-11chore: `@netlify/edge-bundler` workaround until Deno 2.0 (#24532)David Sherret
Hack for a few months until Deno 2.0. See code for details