WEBDEV-8970: Drop the package-root import from elements - #81
Open
jbuckner wants to merge 1 commit into
Open
Conversation
The root import never worked: exports pointed . at ./dist/src/index.js and the build never emitted it. Rather than add the missing entry point, remove the root import so consumers pull in only the elements they use. Adds a package-check script (publint plus a subpath resolution check) to CI and the publish workflow so a broken element entry point can't ship again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CUM1e29MLyK3kBDiZYgERx
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #81 +/- ##
==========================================
- Coverage 81.12% 79.39% -1.73%
==========================================
Files 27 27
Lines 927 927
Branches 227 227
==========================================
- Hits 752 736 -16
- Misses 113 129 +16
Partials 62 62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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 root import
@internetarchive/elementshas never worked (exports pointed.at a file the build doesn't emit). Rather than add the missing entry point, we're dropping the root import: it's a big package and people should only pull in the elements they use, which is what the README example already shows.So this removes
.from the exports map, removes the top-leveltypesthat pointed at the same phantom entry, and deletes thesrc/elements/index.tsbarrel. The root import now fails withERR_PACKAGE_PATH_NOT_EXPORTEDinstead of a confusing module-not-found.Heads up for review: the barrel was also reachable as
@internetarchive/elements/indexvia the./*pattern, so that undocumented path goes away too. I grepped offshoot, iaux, petabox and bookreader, and nothing imports either the root or/index, everything already uses subpaths.To keep this from happening again, CI and the publish workflow now run
pnpm run package-check: publint plus a small script that resolves every element's real subpath and checks the built files exist. publint alone doesn't cover it, it (and attw) treat./*as an opaque wildcard, so a broken subpath target passes silently.Worth a
0.3.0on the next release rather than a patch, since it removes an exports entry.https://webarchive.jira.com/browse/WEBDEV-8970
🤖 Generated with Claude Code
https://claude.ai/code/session_01CUM1e29MLyK3kBDiZYgERx