fix(pkg): give passwordRules a deep import path - #291
Closed
pathscale wants to merge 1 commit into
Closed
Conversation
`evaluatePasswordRules` and friends are re-exported from the package root but `dist/passwordRules.js` had no entry in the `exports` map, so `@pathscale/ui/passwordRules` did not resolve at all. Consumers that forbid barrel imports could not reach this module by any path: the deep import failed to resolve and the root import failed their lint. Every other module the root re-exports from (components, primitives, hooks, motion, styles) already has a mapping. This was the only gap.
Owner
Author
|
Rolled into #289 so the four fixes ship as one release. The commit is unchanged. |
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 package root re-exports
evaluatePasswordRules,matchPasswordConfirmationand the password rule types from./passwordRules, butdist/passwordRules.jshas no entry in theexportsmap. With anexportsmap present, an unlisted subpath is blocked, so@pathscale/ui/passwordRulesdoes not resolve.That leaves consumers which forbid barrel imports with no way to use it at all:
import { evaluatePasswordRules } from "@pathscale/ui/passwordRules"fails to resolve.import { evaluatePasswordRules } from "@pathscale/ui"fails their lint.nofilter.io hit exactly this while removing its 69 barrel imports. It was the only symbol of the 69 with no deep path.
Every other module the root re-exports from already has a mapping:
components/*,primitives/*,hooks/*,motion,styles/*.passwordRuleswas the single gap; I checked the full set of subpathsdist/index.d.tsre-exports from.No source change, and
dist/passwordRules.jsand.d.tsare already emitted and published, so this only makes a shipped file addressable.