Skip to content

WEBDEV-8970: Drop the package-root import from elements - #81

Open
jbuckner wants to merge 1 commit into
mainfrom
WEBDEV-8970-package-root-entry
Open

WEBDEV-8970: Drop the package-root import from elements#81
jbuckner wants to merge 1 commit into
mainfrom
WEBDEV-8970-package-root-entry

Conversation

@jbuckner

Copy link
Copy Markdown
Collaborator

The root import @internetarchive/elements has 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-level types that pointed at the same phantom entry, and deletes the src/elements/index.ts barrel. The root import now fails with ERR_PACKAGE_PATH_NOT_EXPORTED instead of a confusing module-not-found.

Heads up for review: the barrel was also reachable as @internetarchive/elements/index via 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.0 on 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

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
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

🚀 View preview at
https://internetarchive.github.io/elements/pr/pr-81/

Built to branch ghpages at 2026-08-27 00:08 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.39%. Comparing base (8c054a6) to head (75ecd6b).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants