summaryrefslogtreecommitdiff
path: root/cli/args
AgeCommit message (Collapse)Author
2024-11-19feat(compile): ability to embed directory in executable (#26939)David Sherret
2024-11-19feat(compile): ability to embed local data files (#26934)David Sherret
``` > deno compile --allow-read=. --include data-file.txt main.js ``` This only applies to files on the filesystem. For remote modules, that's going to have to wait for `import ... from "./data.txt" with { "type": "bytes" }` or whatever it will be.
2024-11-19feat(fmt): support SQL (#26750)João Baptista
This commit adds support for .sql files in "deno fmt" subcommand. Closes: https://github.com/denoland/deno/issues/25024 --------- Signed-off-by: m4rc3l05 <15786310+M4RC3L05@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-18perf(compile): code cache (#26528)David Sherret
Adds a lazily created code cache to `deno compile` by default. The code cache is created on first run to a single file in the temp directory and is only written once. After it's been written, the code cache becomes read only on subsequent runs. Only the modules loaded during startup are cached (dynamic imports are not code cached). The code cache can be disabled by compiling with `--no-code-cache`.
2024-11-17feat(cli): support multiple env file argument (#26527)Bhuwan Pandit
Closes #26425 ## Overview This PR adds support for specifying multiple environment files as arguments when using the Deno CLI. Subsequent files override pre-existing variables defined in previous files. If the same variable is defined in the environment and in the file, the value from the environment takes precedence. ## Example Usage ```bash deno run --allow-env --env-file --env-file=".env.one" --env-file=".env.two" script.ts ``` --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-11-16feat(task): support object notation, remove support for JSDocs (#26886)Bartek Iwańczuk
This commit changes three aspects of `deno task`: 1. Tasks can now be written using object notation like so: ```jsonc { "tasks": { "foo": "deno run foo.js", "bar": { "command": "deno run bar.js" } } ``` 2. Support for comments for tasks is now removed. Comments above tasks will no longer be printed when running `deno task`. 3. Tasks written using object notation can have "description" field that replaces support for comments above tasks: ```jsonc { "tasks": { "bar": { "description": "This is a bar task" "command": "deno run bar.js" } } ``` ``` $ deno task Available tasks: - bar // This is a bar task deno run bar.js ``` Pulled most of the changes from https://github.com/denoland/deno/pull/26467 to support "dependencies" in tasks. Additionally some cleanup was performed to make code easier to read. --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-11-14fix: otel resiliency (#26857)snek
Improving the breadth of collected data, and ensuring that the collected data is more likely to be successfully reported. - Use `log` crate in more places - Hook up `log` crate to otel - Switch to process-wide otel processors - Handle places that use `process::exit` Also adds a more robust testing framework, with a deterministic tracing setting. Refs: https://github.com/denoland/deno/issues/26852
2024-11-13feat(node): stabilize detecting if CJS via `"type": "commonjs"` in a ↵David Sherret
package.json (#26439) This will respect `"type": "commonjs"` in a package.json to determine if `.js`/`.jsx`/`.ts`/.tsx` files are CJS or ESM. If the file is found to be ESM it will be loaded as ESM though.
2024-11-13feat: OpenTelemetry Tracing API and Exporting (#26710)snek
Initial import of OTEL code supporting tracing. Metrics soon to come. Implements APIs for https://jsr.io/@deno/otel so that code using OpenTelemetry.js just works tm. There is still a lot of work to do with configuration and adding built-in tracing to core APIs, which will come in followup PRs. --------- Co-authored-by: Luca Casonato <hello@lcas.dev>
2024-11-04refactor(runtime/permissions): use concrete error types (#26464)Leo Kettmeir
2024-11-01fix: improved support for cjs and cts modules (#26558)David Sherret
* cts support * better cjs/cts type checking * deno compile cjs/cts support * More efficient detect cjs (going towards stabilization) * Determination of whether .js, .ts, .jsx, or .tsx is cjs or esm is only done after loading * Support `import x = require(...);` Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-31fix: surface package.json location on dep parse failure (#26665)David Sherret
Related: https://github.com/denoland/deno/issues/26653
2024-10-30fix(serve): support serve hmr (#26078)HasanAlrimawi
This PR addresses issue #25600 Changes: Updated `fn has_hmr` to check `serve` subcommand and return its hmr value if found, in order to run the worker in serve mode with hmr_runner. Thus the hmr event can be dispatched upon changes on the file served.
2024-10-30docs(console): Update docstrings for install and uninstall (#26623)McSneaky
When running `deno -h` then `install` and `uninstall` scripts had description since deno 1 times :)
2024-10-29fix: support watch flag to enable watching other files than the main module ↵HasanAlrimawi
on serve subcommand (#26622) Closes #26618
2024-10-24fix(fmt): --ext flag requires to pass files (#26525)Bartek Iwańczuk
To avoid situations like described in https://github.com/denoland/deno/issues/26402 using `deno fmt` with `--ext` flag now requires to explicitly specify list of files (or globs) to format. Closes https://github.com/denoland/deno/issues/26402
2024-10-24fix: `.npmrc` settings not being passed to install/add command (#26473)Marvin Hagemeister
We weren't passing the resolved npmrc settings to the install commands. This lead us to always fall back to the default registry url instead of using the one from npmrc. Fixes https://github.com/denoland/deno/issues/26139 Fixes https://github.com/denoland/deno/issues/26033 Fixes https://github.com/denoland/deno/issues/25924 Fixes https://github.com/denoland/deno/issues/25822 Fixes https://github.com/denoland/deno/issues/26152 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-23fix(install): cache type only module deps in `deno install` (#26497)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26180.
2024-10-22fix(check): support `--frozen` on deno check (#26479)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26391
2024-10-18fix(help): missing package specifier (#26380)Marvin Hagemeister
Was notified of one more occurance where we were missing an explicit specifier for a `deno add` call. See https://github.com/denoland/deno/issues/26295#issuecomment-2421637401
2024-10-16fix(cli): add prefix to install commands in help (#26318)Marvin Hagemeister
Some `deno add` and `deno install` example usage commands didn't have the `jsr:` or `npm:` prefixes. --------- Signed-off-by: Marvin Hagemeister <marvinhagemeister50@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-15fix(repl): remove check flags (#26140)Yoshiya Hinosawa
This change removes the handling of `--check` and `--no-check` flags from `deno repl` subcommand. Currently these flags don't have effects, and the help output for these options are incorrect and confusing. closes #26042
2024-10-14feat(unstable): `--unstable-detect-cjs` for respecting explicit `"type": ↵David Sherret
"commonjs"` (#26149) When using the `--unstable-detect-cjs` flag or adding `"unstable": ["detect-cjs"]` to a deno.json, it will make a JS file CJS if the closest package.json contains `"type": "commonjs"` and the file is not an ESM module (no TLA, no `import.meta`, no `import`/`export`).
2024-10-12feat(npm): support `--allow-scripts` on `deno run` (and `deno add`, `deno ↵Nathan Whitaker
test`, etc) (#26075) Fixes https://github.com/denoland/deno/issues/25533. Fixes https://github.com/denoland/deno/issues/25396. Previously we only supported it on `deno install` and `deno cache`, which is annoying if you're using `nodeModulesDir: auto`. Also changes from printing output of lifecycle scripts directly to capturing the output and only printing it on error.
2024-10-04fix(install): surface package.json dependency errors (#26023)David Sherret
2024-10-04Revert "feat: warn when using --allow-run with no allow list" (#26021)David Sherret
Although using `--allow-run` without an allow list gives basically no security, I think we should remove this warning because it gets in the way and the only way to disable it is via --quiet.
2024-10-03feat(permissions): allow importing from cdn.jsdelivr.net by default (#26013)David Sherret
The exploit `--allow-import` is preventing against requires a compromised host. To make things easier and given its popularity, we're going to have the default `--allow-import` value include `cdn.jsdelivr.net:443`, but this can be overridden by replacing the `--allow-import` value with something else.
2024-10-02feat(byonm): support `deno run npm:<package>` when package is not in ↵David Sherret
package.json (#25981) Closes https://github.com/denoland/deno/issues/25905
2024-10-01fix: remove the typo in the help message (#25962)MujahedSafaa
This PR fixes: https://github.com/denoland/deno/issues/25274 Remove the extra shorthand -S that attached to the --deny-sys.
2024-10-01fix: Hide 'deno cache' from help output (#25960)Bartek Iwańczuk
`deno cache` was soft-deprecated in favor of `deno install`. It should not show up in the help output.
2024-09-30fix(flags): move some content from docs.deno.com into help output (#25951)Leo Kettmeir
2024-09-30fix(info): error instead of panic for npm specifiers when using byonm (#25947)David Sherret
2024-09-30refactor: bury descriptor parsing in PermissionsContainer (#25936)David Sherret
Closes https://github.com/denoland/deno/issues/25634
2024-09-28refactor: use deno_path_util (#25918)David Sherret
2024-09-27fix(node): Pass NPM_PROCESS_STATE to subprocesses via temp file instead of ↵Nathan Whitaker
env var (#25896) Fixes https://github.com/denoland/deno/issues/25401. Fixes https://github.com/denoland/deno/issues/25841. Fixes https://github.com/denoland/deno/issues/25891.
2024-09-27fix(flags): --allow-all should conflict with lower permissions (#25909)David Sherret
Using `--allow-all` with other `--allow-x` permission flags should cause an error since `--allow-all` is a superset of `--allow-x`. Closes #25901
2024-09-27fix(lint): correctly handle old jsx in linter (#25902)Luca Casonato
Previously the CLI was incorrectly reporting `React` as unused in a JSX file that uses the "old" transform. The LSP was already handling this correctly.
2024-09-26feat(install): warn repeatedly about not-run lifecycle scripts on explicit ↵Nathan Whitaker
installs (#25878) Currently we only warn once. With this PR, we continue to warn about not-run scripts on explicit `deno install` (or cache). For `run` (or other subcommands) we only warn the once, as we do currently.
2024-09-26feat: add `--allow-import` flag (#25469)Bartek Iwańczuk
This replaces `--allow-net` for import permissions and makes the security sandbox stricter by also checking permissions for statically analyzable imports. By default, this has a value of `--allow-import=deno.land:443,jsr.io:443,esm.sh:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443`, but that can be overridden by providing a different set of hosts. Additionally, when no value is provided, import permissions are inferred from the CLI arguments so the following works because `fresh.deno.dev:443` will be added to the list of allowed imports: ```ts deno run -A -r https://fresh.deno.dev ``` --------- Co-authored-by: David Sherret <dsherret@gmail.com>
2024-09-24fix(cli): Warn on not-run lifecycle scripts with global cache (#25786)Nathan Whitaker
Refactors the lifecycle scripts code to extract out the common functionality and then uses that to provide a warning in the global resolver. While ideally we would still support them with the global cache, for now a warning is at least better than the status quo (where people are unaware why their packages aren't working).
2024-09-23fix: error out if a valid flag is passed before a subcommand (#25830)Leo Kettmeir
Closes #25808
2024-09-23BREAKING: remove support for remote import maps in deno.json (#25836)David Sherret
This is for security reasons for the time being for Deno 2. Details to follow post Deno 2.0 release. Remote import maps seem incredibly rare (only 2 usages on GitHub from what I can tell), so we'll add this back with more permissions if there's enough demand for it: https://github.com/search?type=code&q=%2F%22importMap%22%3A+%22http%2F In the meantime, use the `--import-map` flag and `"deno.importMap"` config in the LSP for remote import maps.
2024-09-23feat(fmt): stabilize CSS, HTML and YAML formatters (#25753)Bartek Iwańczuk
This commits stabilizes CSS, HTML and YAML formatters in `deno fmt`. It is no longer required to use either of these flags: - `--unstable-css` - `--unstable-html` - `--unstable-yaml` Or these `unstable` options in the config file: - `fmt-css` - `fmt-html` - `html-yaml`
2024-09-20fix(cli): Default to auto with --node-modules-dir flag (#25772)Nathan Whitaker
Fixes a regression where we were ignoring `--node-modules-dir` if there was no value passed with it. We should instead default to "auto", to maintain compat with deno 1
2024-09-20fix(flags): properly error out for urls (#25770)Leo Kettmeir
Closes https://github.com/denoland/deno/issues/25760
2024-09-19fix(cli): Only set allow net flag for deno serve if not already allowed all ↵Nathan Whitaker
(#25743) Fixes #25740
2024-09-18feat: suggest `deno install --entrypoint` instead of `deno cache` (#25228)Asher Gomez
Hides `deno cache` from `--help` output. --------- Signed-off-by: Asher Gomez <ashersaupingomez@gmail.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-09-18feat: default to TS for file extension and support ext flag in more ↵Leo Kettmeir
scenarios (#25472) Closes #11220 Currently does lint, fmt, and repl
2024-09-18fix(flags): don't treat empty run command as task subcommand (#25708)Leo Kettmeir
2024-09-18fix: remove --allow-run warning when using deno without args or subcommand ↵HasanAlrimawi
(#25684) Closes #25676 --------- Co-authored-by: David Sherret <dsherret@gmail.com>