summaryrefslogtreecommitdiff
path: root/cli/tools
AgeCommit message (Collapse)Author
2024-11-20reviewHEADmainBartek Iwańczuk
2024-11-20Merge branch 'main' into haturatu/mainBartek Iwańczuk
2024-11-20dedup, rename, fix testsBartek Iwańczuk
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-19refactor: update deno_doc, use prismjs, remove internal reference html ↵Leo Kettmeir
generation logic (#26885)
2024-11-20Merge branch 'denoland:main' into mainhaturau
2024-11-19feat(task): dependencies (#26467)David Sherret
This commit adds support for "dependencies" in `deno task` subcommand: ```jsonc { "tasks": { "build": "deno run -RW build.ts", "generate": "deno run -RW generate.ts", "serve": { "command": "deno run -RN server.ts", "dependencies": ["build", "generate"] } } } ``` Executing `deno task serve` will first execute `build` and `generate` tasks (in parallel) and once both complete the `serve` task will be executed. Number of tasks run in parallel is equal to the no of cores on the machine, and respects `DENO_JOBS` env var if one is specified. Part of https://github.com/denoland/deno/issues/26462 --------- Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-11-18feat: fmt and lint respect .gitignore file (#26897)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/26573
2024-11-16feat(watch): log which file changed on HMR or watch change (#25801)HasanAlrimawi
Closes #25504
2024-11-16fix(cli): show prefix hint when installing a package globally (#26629)Miguel Rodrigues
Closes #26545 Shows a hint when a package is installed globally, otherwise fallbacks to the existing implementation.
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-13fix(fmt): error instead of panic on unstable format (#26859)David Sherret
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-10Revert "perf(upgrade): cache downloaded binaries in DENO_DIR" (#26799)Divy Srivastava
Reverts denoland/deno#26108 Tests are flaky on main https://github.com/denoland/deno/commit/01de3317424cc870913dbe85ff3b80eadaf8cc87
2024-11-09perf(upgrade): cache downloaded binaries in DENO_DIR (#26108)Bartek Iwańczuk
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
2024-11-08fix(install): cache jsr deps from all workspace config files (#26779)Nathan Whitaker
Fixes #26772. I wasn't aware that the `imports()` method only returned the workspace root imports
2024-11-06fix(fmt): don't use self-closing tags in HTML (#26754)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/26748
2024-11-05fix(add): better error message when adding package that only has pre-release ↵Nathan Whitaker
versions (#26724) Fixes https://github.com/denoland/deno/issues/26597 A small refactor as well to reduce some code duplication
2024-11-04fix(fmt): ignore file directive for YAML files (#26717)Bartek Iwańczuk
Closes https://github.com/denoland/deno/issues/26712 Support `# deno-fmt-ignore-file` directive for YAML files. Also added tests for single line ignores.
2024-11-04refactor(runtime/permissions): use concrete error types (#26464)Leo Kettmeir
2024-11-01fix(add): only add npm deps to package.json if it's at least as close as ↵Nathan Whitaker
deno.json (#26683) Fixes https://github.com/denoland/deno/issues/26653
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-11-01chore: upgrade to rust 1.82 and LLVM 19 (#26615)Divy Srivastava
Upgrade to rust 1.82 and LLVM 19 . Removes one webusb test because `requestAdapter` not working on new ubuntu 24 runners
2024-10-31fix(cli): set `npm_config_user_agent` when running npm packages or tasks ↵Nathan Whitaker
(#26639) Fixes #25342. Still not sure on the exact user agent to set (should it include `node`?). After this PR, here's the state of running some `create-*` packages (just ones I could think of off the top of my head): | package | prints/runs/suggests deno install | notes | | ---------------- | ------------- | ------ | | `create-next-app` | ❌ | falls back to npm, needs a PR ([code](https://github.com/vercel/next.js/blob/c32e2802097c03fd9f95b1dae228d6e0257569c0/packages/create-next-app/helpers/get-pkg-manager.ts#L3)) | `sv create` | ❌ | uses `package-manager-detector`, needs a PR ([code](https://github.com/antfu-collective/package-manager-detector/tree/main)) | `create-qwik` | ✅ | runs `deno install` but suggests `deno start` which doesn't work (should be `deno task start` or `deno run start`) | `create-astro` | ✅ | runs `deno install` but suggests `npm run dev` later in output, probably needs a PR | `nuxi init` | ❌ | deno not an option in dialog, needs a PR ([code](https://github.com/nuxt/cli/blob/f04e2e894446f597da9d971b7eb03191d5a0da7e/src/commands/init.ts#L96-L102)) | `create-react-app` | ❌ | uses npm | `ng new` (`@angular/cli`) | ❌ | uses npm | `create-vite` | ✅ | suggests working deno commands 🎉 | `create-solid` | ❌ | suggests npm commands, needs PR It's possible that fixing `package-manager-detector` or other packages might make some of these just work, but haven't looked too carefully at each
2024-10-31fix(coverage): exclude comment lines from coverage reports (#25939)Taku Amano
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-29refactor(init): inline routing in deno init --serve template (#26595)Yoshiya Hinosawa
2024-10-26perf: pass transpiled module to deno_core as known string (#26555)David Sherret
2024-10-25fix(install): cache json exports of JSR packages (#26552)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26509. Ended up being a `deno_graph` bug causing the error to surface. This PR updates `deno_graph` to pick up the fix and reverts the temporary workaround that skipped JSON exports.
2024-10-25fix(upgrade): stop running `deno lsp` processes on windows before attempting ↵David Sherret
to replace executable (#26542)
2024-10-24fix(install): don't cache json exports of JSR packages (for now) (#26530)Nathan Whitaker
Temporary fix for #26509, so people don't get errors.
2024-10-24perf(compile): pass module source data from binary directly to v8 (#26494)David Sherret
This changes denort to pass a static reference of the moude source bytes found in the binary to v8 instead of copying it.
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 all exports of JSR packages listed in `deno.json` (#26501)Nathan Whitaker
Fixes #26498. This was a sort of intentional decision originally, as I wanted to avoid caching extra files that may not be needed. It seems like that behavior is unintuitive, so I propose we cache all of the exports of listed jsr packages when you run a bare `deno install`.
2024-10-22fix(fmt): upgrade formatters (#26469)Pig Fang
Fixes #25926 Fixes #26004
2024-10-22fix(install): update lockfile when using package.json (#26458)Bartek Iwańczuk
This commit makes sure that `deno add`, `deno install` and `deno remove` update the lockfile if only `package.json` file is present. Fixes https://github.com/denoland/deno/issues/26270
2024-10-21fix(install): better json editing (#26450)David Sherret
1. Respects the formatting of the file (ex. keeps four space indents or tabs). 2. Handles editing of comments. 3. Handles trailing commas. 4. Code is easier to maintain.
2024-10-18fix(info): resolve workspace member mappings (#26350)Marvin Hagemeister
This PR fixes the issue where mapped specifiers in a workspace member would never be found. Only mapped paths from the workspace root would resolve. This was caused by always passing the workspace root url to the import map resolver instead of the workspace member one. Fixes https://github.com/denoland/deno/issues/26138 Fixes https://github.com/denoland/fresh/issues/2615 --------- Signed-off-by: Marvin Hagemeister <marvinhagemeister50@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-10-18fix(jupyter): fix panics for overslow subtraction (#26371)Bartek Iwańczuk
I don't have a reliable reproduction for it, but it makes it painful to use the Jupyter kernel with semi-frequent random panics. The completions don't always work correctly anyway, so I think it's better to just not panic here for the time being. Fixes https://github.com/denoland/deno/issues/26340
2024-10-17fix(install): don't attempt to cache specifiers that point to directories ↵Nathan Whitaker
(#26369) Fixes https://github.com/denoland/deno/issues/26162
2024-10-17fix(jupyter): update to the new logo (#26353)Jeremy Tuloup
Follow-up to #26084 Update to the new logo found here: https://github.com/denoland/docs/blob/main/static/img/logo.svg
2024-10-16fix(add): exact version should not have range `^` specifier (#26302)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26299
2024-10-16fix(jupyter): copy kernels icons to the kernel directory (#26084)Jeremy Tuloup
2024-10-16fix(cli): consolidate pkg parser for install & remove (#26298)Satya Rohith
Closes https://github.com/denoland/deno/issues/26283
2024-10-15fix(install): retry downloads of registry info / tarballs (#26278)Nathan Whitaker
Fixes #26085. Adds a basic retry utility with some defaults, starts off with a 100ms wait, then 250ms, then 500ms I've applied the retry in the http client, reusing an existing function, so this also applies to retrying downloads of deno binaries in `upgrade` and `compile`. I can make a separate function that doesn't retry so this doesn't affect `upgrade` and `compile`, but it seemed desirable to have retries there too, so I left it in.
2024-10-15fix(add): create deno.json when running `deno add jsr:<pkg>` (#26275)Nathan Whitaker
Fixes https://github.com/denoland/deno/issues/26119. Originally I wanted to put them in package.json if there's no deno.json, but on second thought it makes more sense to just create a deno.json
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-14fix(install): support installing npm package with alias (#26246)David Sherret
Just tried this out today and it wasn't properly implemented in https://github.com/denoland/deno/pull/24156