summaryrefslogtreecommitdiff
path: root/cli
AgeCommit message (Collapse)Author
2024-10-03v2.0.0-rc.10 (#26002)Bartek Iwańczuk
2024-10-02fix(install): store tags associated with package in node_modules dir (#26000)Nathan Whitaker
Fixes #25998. Fixes https://github.com/denoland/deno/issues/25928. Originally I was just going to make this an error message instead of a panic, but once I got to a minimal repro I felt that this really should work. The panic occurs when you have `nodeModulesDir: manual` (or a package.json present), and you have an npm package with a tag in your deno.json (see the spec test that illustrates this). This code path only actually executes when trying to choose an appropriate package version from `node_modules/.deno`, so we should be able to fix it by storing some extra data at install time. The fix proposed here is to repurpose the `.initialized` file that we store in `node_modules` to store the tags associated with a package. Basically, if you have a version requirement with a tag (e.g. `npm:chalk@latest`), when we set up the node_modules folder for that package, we store the tag (`latest`) in `.initialized`. Then, when doing BYONM resolution, if we have a version requirement with a tag, we read that file and check if the tag is present. The downside is that we do more work when setting up `node_modules`. We _could_ do this only when BYONM is enabled, but that would have the downside of needing to re-run `deno install` when you switch from auto -> manual, though maybe that's not a big deal.
2024-10-02fix(install): compare versions directly to decide whether to create a child ↵Nathan Whitaker
node_modules dir for a workspace member (#26001) Fixes #25861. Previously we were attempting to match the version requirement against the version already present in `node_modules` root, and if they didn't match we would create a node_modules dir in the workspace member's directory with the dependency. Aside from the fact that this caused the panic, on second thought it just doesn't make sense in general. We shouldn't be semver matching, as resolution has already occurred and decided what package versions are required. Instead, we can just compare the versions directly.
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-02fix(node): implement libuv APIs needed to support `npm:sqlite3` (#25893)Nathan Whitaker
Fixes #24740. Implements the `uv_mutex_*` and `uv_async_*` APIs. The mutex API is implemented exactly as libuv, a thin wrapper over the OS's native mutex. The async API is implemented in terms of napi_async_work. As documented in the napi docs, you really shouldn't call `napi_queue_async_work` multiple times (it is documented as undefined behavior). However, our implementation doesn't have any issue with this, so I believe it suits our purpose here.
2024-10-02fix(workspace): handle when config has members when specified via --config ↵David Sherret
(#25988) Closes #25847
2024-10-02fix(no-slow-types): better `override` handling (#25989)David Sherret
* https://github.com/denoland/deno_graph/pull/534 Closes https://github.com/denoland/deno/issues/25322
2024-10-02chore: release deno_* crates (#25987)denobot
Testing once again if the crates are being properly released. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-02chore: release deno_* crates (#25976)denobot
Test run before Deno 2.0 release to make sure that the publishing process passes correctly. --------- Co-authored-by: bartlomieju <bartlomieju@users.noreply.github.com> Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2024-10-01feat(lsp): quick fix for @deno-types="npm:@types/*" (#25954)Nayeem Rahman
2024-10-01feat: Add suggestion for packages using Node-API addons (#25975)Bartek Iwańczuk
This commit adds a suggestion with information and hint how to resolve situation when user tries to run an npm package with Node-API addons using global cache (which is currently not supported). Closes https://github.com/denoland/deno/issues/25974
2024-10-01BREAKING: rename "deps" remote cache folder to "remote" (#25969)David Sherret
Closes https://github.com/denoland/deno/issues/25967 Closes #25968
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-10-01v2.0.0-rc.9 (#25957)Divy Srivastava
2024-10-01v2.0.0-rc.8 (#25950)Bartek Iwańczuk
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: move ByonmNpmResolver to deno_resolver (#25937)David Sherret
Some more slow progress on moving all the resolution code into deno_resolver.
2024-09-30refactor: bury descriptor parsing in PermissionsContainer (#25936)David Sherret
Closes https://github.com/denoland/deno/issues/25634
2024-09-30fix: update sui to 0.4 (#25942)Divy Srivastava
Properly apply offset fixup to `LC_DYLD_EXPORTS_TRIE` load commands. This should fix Node-API symbols not resolving in RC releases. Fixes https://github.com/denoland/deno/issues/25879 Fixes https://github.com/denoland/deno/issues/25940 Ref https://github.com/denoland/sui/commit/2b3a33bb6e1afbb04e2e1d345547e5686894e7f0
2024-09-29refactor: cleanup for creating worker structs (#25933)David Sherret
2024-09-28refactor: extract out sloppy imports resolution from CLI crate (#25920)David Sherret
This is slow progress towards creating a `deno_resolver` crate. Waiting on: * https://github.com/denoland/deno/pull/25918 * https://github.com/denoland/deno/pull/25916
2024-09-28refactor: move NpmCacheDir to deno_cache_dir (#25916)David Sherret
Part of the ongoing work to move more of Deno's resolution out of the CLI crate (for use in Wasm and other things) Includes: * https://github.com/denoland/deno_cache_dir/pull/60
2024-09-28refactor: use deno_path_util (#25918)David Sherret
2024-09-27v2.0.0-rc.7 (#25907)Bartek Iwańczuk
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-26refactor(fmt): rewrite HTML syntax error handling (#25892)Bartek Iwańczuk
2024-09-26feat: Don't warn about --allow-script when using esbuild (#25894)Bartek Iwańczuk
`esbuild` can work fine without needing to run post-install script, so to make it easier on users (especially people using Vite) we are not prompting to run with `--allow-scripts` again. We only do that for version >= 0.18.0 to be sure.
2024-09-26fix(info): move "version" field to top of json output (#25890)David Sherret
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-26fix(installl): make bin entries executable even if not put in ↵Nathan Whitaker
`node_modules/.bin` (#25873) Fixes https://github.com/denoland/deno/issues/25862. npm only makes bin entries executable if they get linked into `.bin`, as we did before this PR. So this PR actually deviates from npm, because it's the only reasonable way to fix this that I can think of. --- The reason this was broken in moment is the following: Moment has dependencies on two typescript versions: 1.8 and 3.1 If you have two packages with conflicting bin entries (i.e. two typescript versions which both have a bin entry `tsc`), in npm it is non-deterministic and undefined which one will end up in `.bin`. npm, due to implementation differences, chooses to put typescript 1.8 into the `.bin` directory, and so `node_modules/typescript/bin/tsc` ends up getting marked executable. We, however, choose typescript 3.2, and so we end up making `node_modules/typescript3/bin/tsc` executable. As part of its tests, moment executes `node_modules/typescript/bin/tsc`. Because we didn't make it executable, this fails. Since the conflict resolution is undefined in npm, instead of trying to match it, I think it makes more sense to just make bin entries executable even if they aren't chosen in the case of a conflict.
2024-09-26fix(doc): surface graph errors as warnings (#25888)David Sherret
2024-09-26refactor: use ModuleGraph::fill_from_lockfile (#25887)David Sherret
2024-09-26feat(tools/doc): display subitems in symbol overviews where applicable (#25885)Leo Kettmeir
For https://github.com/denoland/deno_doc/pull/635
2024-09-26v2.0.0-rc.6 (#25877)Bartek Iwańczuk
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-26fix(compile): support 'deno compile' in RC and LTS releases (#25875)Bartek Iwańczuk
This was missed previously. There's no problem support RC and LTS releases.
2024-09-25fix(check): properly surface dependency errors in types file of js file (#25860)David Sherret
We weren't surfacing dependency errors in types files of js files.
2024-09-25fix(add/install): default to "latest" tag for npm packages in `deno add ↵Nathan Whitaker
npm:pkg` (#25858) Fixes #25813. I initially tried doing this in `deno_semver`, where it's a cleaner change, but that caused breakage in deno in places where we don't expect a tag (see https://github.com/denoland/deno/issues/25857). This does not fix wildcard requirements failing to choose pre-release versions. That's a little more involved and I'll do a separate PR.
2024-09-25feat(fmt): better error on malfored HTML files (#25853)Bartek Iwańczuk
Improves syntax errors for HTML formatter. `broken.html` ```html <div class=container > content ``` ``` $ deno fmt broken.html Error formatting: /Users/ib/dev/deno/tests/specs/fmt/html/broken.html syntax error 'expect close tag' at line 3, column 0 Checked 1 file ``` ``` $ ./target/debug/deno fmt broken.html Error formatting: /Users/ib/dev/deno/tests/specs/fmt/html/broken.html Syntax error (expect close tag) at file:///Users/ib/dev/deno/tests/specs/fmt/html/broken.html:3:0 Checked 1 file ```
2024-09-24fix(check): ignore noImplicitOverrides in remote modules (#25854)David Sherret
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-24v2.0.0-rc.5 (#25838)Bartek Iwańczuk
2024-09-24fix: better error for Deno.UnsafeWindowSurface, correct HttpClient name, ↵Leo Kettmeir
cleanup unused code (#25833)
2024-09-24fix(fmt): --check was broken for CSS, YAML and HTML (#25848)Bartek Iwańczuk
`deno fmt --check` was broken for CSS, YAML and HTML files. Before this PR, formatting any of these file types would return a string, even though the contract in `cli/tools/fmt.rs` is to only return a string if the formatting changed. This causes wrong flagging of these files as being badly formatted even though diffs showed nothing (because they were in fact formatted properly). Closes https://github.com/denoland/deno/issues/25840
2024-09-24fix: Update deno_npm to fix `deno install` with crossws (#25837)Nathan Whitaker
Partially addresses https://github.com/denoland/deno/issues/25648. This allows packages that use `crossws` to be installed with `deno install`. `crossws` specifies an optional peer dependency on `uWebSockets`, but `uWebSockets` is not on npm (it is used with `git:` or `github:` specifiers). Previously we would error on this, now we don't error on non-existent optional peer dependencies.
2024-09-23fix: error out if a valid flag is passed before a subcommand (#25830)Leo Kettmeir
Closes #25808