summaryrefslogtreecommitdiff
path: root/cli/tools/registry/pm.rs
AgeCommit message (Collapse)Author
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-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-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-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-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-16fix(add): exact version should not have range `^` specifier (#26302)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26299
2024-10-16fix(cli): consolidate pkg parser for install & remove (#26298)Satya Rohith
Closes https://github.com/denoland/deno/issues/26283
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-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
2024-10-10fix(install): duplicate dependencies in `package.json` (#26128)Marvin Hagemeister
Fixes https://github.com/denoland/deno/issues/26120
2024-10-04fix(install): surface package.json dependency errors (#26023)David Sherret
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-18feat: require jsr prefix for `deno install` and `deno add` (#25698)Leo Kettmeir
2024-09-07feat(add/install): Flag to add dev dependency to package.json (#25495)Nathan Whitaker
``` deno install --dev npm:chalk ``` Adds to `devDependencies` if a `package.json` is present, otherwise it just adds to `imports` in `deno.json`
2024-09-06feat(add): Add npm packages to package.json if present (#25477)Nathan Whitaker
Closes https://github.com/denoland/deno/issues/25321 Ended up being a larger refactoring, since we're now juggling (potentially) two config files in the same `add`, instead of choosing one. I don't love the shape of the code, but I think it's good enough Some smaller side improvements: - `deno remove` supports `jsonc` - `deno install --dev` will be a really simple change - if `deno remove` removes the last import/dependency in the `imports`/`dependencies`/`devDependencies` field, it removes the field instead of leaving an empty object
2024-09-04feat(add): strip package subpath when adding a package (#25419)Bartek Iwańczuk
These now works: ``` $ deno add @std/dotenv/load $ deno add npm:preact/hooks ``` Previously we were erroring out, because this is a "package reference" including a subpath. Closes https://github.com/denoland/deno/issues/25385 --------- Signed-off-by: Bartek Iwańczuk <biwanczuk@gmail.com> Co-authored-by: David Sherret <dsherret@users.noreply.github.com>
2024-08-30refactor: remove DENO_FUTURE (#25314)David Sherret
2024-08-21fix(add): Handle packages without root exports (#25102)Nathan Whitaker
Fixes #24607. This PR makes the logic that caches top level dependencies (things present in import map) smarter, so we handle JSR dependencies without root exports.
2024-08-20fix(add): error when config file contains importMap field (#25115)David Sherret
The "imports" field has higher precedence than "importMap", so we should error when `deno add` goes to add an `"imports"` field. Closes https://github.com/denoland/deno/issues/24264 Closes https://github.com/denoland/deno/pull/24478
2024-08-18fix: make `deno add` output more deterministic (#25083)David Sherret
Will fix some flaky tests.
2024-08-12feat: deno remove (#24952)David Sherret
Co-authored-by: Satya Rohith <me@satyarohith.com>
2024-08-09fix(add): Better error message when missing npm specifier (#24970)Nathan Whitaker
Before: <img width="278" alt="Screenshot 2024-08-09 at 3 15 01 PM" src="https://github.com/user-attachments/assets/91b0ada6-93ee-4be6-a996-078aef98c2a9"> After: <img width="888" alt="Screenshot 2024-08-09 at 3 52 15 PM" src="https://github.com/user-attachments/assets/3c88a0e8-c761-4f70-88bf-109355ac12f0">
2024-08-08feat(install): change 'Add ...' message (#24949)Bartek Iwańczuk
Changes messages printed by `deno add` from `Add @oak/oak - jsr:@oak/oak^16.1.0` to `Add jsr:@oak/oak16.1.0`.
2024-08-02docs: fix typos (#24820)Andreas Deininger
This PR fixes various typos I spotted in the project.
2024-07-25refactor: decouple node resolution from deno_core (#24724)David Sherret
2024-07-23fix(upgrade): do not error if config in cwd invalid (#24689)David Sherret
``` > deno upgrade error: Unsupported lockfile version 'invalid'. Try upgrading Deno or recreating the lockfile. V:\scratch > V:\deno\target\debug\deno upgrade Looking up latest version Local deno version 1.45.3 is the most recent release ``` Closes #24517 Closes #20729
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-04feat: npm workspace and better Deno workspace support (#24334)David Sherret
Adds much better support for the unstable Deno workspaces as well as support for npm workspaces. npm workspaces is still lacking in that we only install packages into the root node_modules folder. We'll make it smarter over time in order for it to figure out when to add node_modules folders within packages. This includes a breaking change in config file resolution where we stop searching for config files on the first found package.json unless it's in a workspace. For the previous behaviour, the root deno.json needs to be updated to be a workspace by adding `"workspace": ["./path-to-pkg-json-folder-goes-here"]`. See details in https://github.com/denoland/deno_config/pull/66 Closes #24340 Closes #24159 Closes #24161 Closes #22020 Closes #18546 Closes #16106 Closes #24160
2024-06-26refactor: move PackageJson to deno_config (#24348)David Sherret
2024-06-10FUTURE: support `deno install <alias>@npm:<package>` (#24156)David Sherret
Closes #23144
2024-06-03refactor: don't share `reqwest::HttpClient` across tokio runtimes (#24092)David Sherret
This also fixes several issues where we weren't properly creating http clients with the user's settings.
2024-05-08FUTURE: `deno install` changes (#23498)Bartek Iwańczuk
This PR implements the changes we plan to make to `deno install` in deno 2.0. - `deno install` without arguments caches dependencies from `package.json` / `deno.json` and sets up the `node_modules` folder - `deno install <pkg>` adds the package to the config file (either `package.json` or `deno.json`), i.e. it aliases `deno add` - `deno add` can also add deps to `package.json` (this is gated behind `DENO_FUTURE` due to uncertainty around handling projects with both `deno.json` and `package.json`) - `deno install -g <bin>` installs a package as a globally available binary (the same as `deno install <bin>` in 1.0) --------- Co-authored-by: Nathan Whitaker <nathan@deno.com>
2024-04-18fix(cli): avoid `deno add` and `deno vendor` errors when deno.json is empty ↵nokazn
(#23439)
2024-03-26feat(add): always produce multiline config file (#23077)Bartek Iwańczuk
This commit changes `deno add` to always produce a multiline config file. In v1.41.3: ``` $ mkdir foo $ cd foo $ deno add @std/assert Created deno.json configuration file. Add @std/assert - jsr:@std/assert@^0.220.0 $ cat deno.json { "imports": { "@std/assert": "jsr:@std/assert@^0.220.0" } } ``` Now: ``` $ mkdir foo $ cd foo $ deno add @std/assert Created deno.json configuration file. Add @std/assert - jsr:@std/assert@^0.220.0 $ cat deno.json { "imports": { "@std/assert": "jsr:@std/assert@^0.220.0" } } ```
2024-03-11chore: enable clippy unused_async rule (#22834)David Sherret
2024-03-06feat(unstable/pm): support npm packages in 'deno add' (#22715)Nayeem Rahman
2024-03-01feat(unstable/pm): support version contraints in 'deno add' (#22646)Nayeem Rahman
2024-02-29feat(unstable): `deno add` subcommand (#22520)Bartek Iwańczuk
This commit adds "deno add" subcommand that has a basic support for adding "jsr:" packages to "deno.json" file. This currently doesn't support "npm:" specifiers and specifying version constraints.