docs: recommend install-strategy=linked to catch phantom dependencies#9678
Open
manzoorwanijk wants to merge 1 commit into
Open
docs: recommend install-strategy=linked to catch phantom dependencies#9678manzoorwanijk wants to merge 1 commit into
manzoorwanijk wants to merge 1 commit into
Conversation
… before publishing
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.
Encourages package authors to develop under
install-strategy=linkedto surface undeclared ("phantom") dependencies before publishing.Under the default hoisted
node_modules, a package canimporta dependency it never declared and still resolve it: a transitive dependency hoisted alongside it (or a workspace root'snode_modules) happens to satisfy the import. That undeclared dependency passes the author's own build silently, then fails for a consumer who installs the package on its own. The linked (isolated) layout exposes only a package's declared dependencies, so such an import can fail at the author's build instead of shipping broken.The change documents this in two places:
install-strategyentry in the config reference now recommends that authors use--install-strategy=linkedduring development, cross-linked to the developers guide.devDependencyor a workspace root'snode_modulescan still resolve locally — alongside auditing the dependencies the published package actually uses.This is documentation-only; the config reference text is generated from the
install-strategydefinition description.References
Closes #9675