docs: clarify that catalogs are npm-only#3369
Merged
Merged
Conversation
The `catalog`/`catalogs` workspace feature only manages npm dependencies: a catalog entry is a bare name mapped to a version requirement, and a `catalog:` reference always resolves to an `npm:` specifier. There is no way to put a `jsr:` package in a catalog, and `deno update`/`deno outdated` resolve catalog entries against the npm registry. This was implied but never stated, and users hit confusing "npm registry not found" warnings after putting `jsr:` packages in a catalog. Also note that a `catalog:` reference can now appear in a member's `deno.json` `imports`, not just `package.json` dependencies (added in Deno 2.9).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
catalog/catalogsworkspace feature only manages npm dependencies, butthe docs never said so explicitly. A catalog entry is a bare package name mapped
to a version requirement, and a
catalog:reference always resolves to annpm:specifier, so there is no way to point a catalog entry at ajsr:package. Because catalog entries are treated as npm packages,
deno updateanddeno outdatedresolve them against the npm registry.This came up in denoland/deno#35075, where a user put
jsr:packages in a rootcatalogand then saw confusing "npm registry, not found" warnings fromdeno update. The behavior is working as intended (catalog has been npm-onlysince it landed in Deno 2.8); it just was not documented.
Changes:
and that
jsr:dependencies should be managed throughimportsinstead.catalog:reference can now also appear in a member'sdeno.jsonimports, not justpackage.jsondependencies (added in Deno 2.9), which theprevious wording ("only read from package.json files") no longer reflected.