Repository navigation
Fix two packaging bugs found while preparing for npm publish - #7
Merged
Merged
Conversation
Shimon asked to publish @matrix-ai/ui to npm. Checked readiness before attempting anything and found two genuine bugs: 1. react, react-dom, vite, @vitejs/plugin-react, and tailwindcss were listed under "dependencies". react/react-dom were also correctly declared as peerDependencies, so leaving them in dependencies too would have forced a second copy of React into every consumer's install (the classic "duplicate React instance" bug), plus Vite/Tailwind as unnecessary runtime installs for a package with zero actual runtime dependencies. Moved all five to devDependencies. 2. "files": ["dist"] included the entire build output directory, but pnpm build writes both the library (dist/lib/) and this repo's own demo app (dist/assets/*.js, dist/index.html) into the same dist/ folder. Verified with npm pack --dry-run: the tarball was 82.8 kB packed / 281.8 kB unpacked, including the full 216 kB demo bundle. Fixed: "files": ["dist/lib"]. Re-checked: 16.6 kB packed / 52.0 kB unpacked, 25 files, exactly dist/lib/** + README.md + package.json. Re-ran full validation after both fixes: typecheck, lint, test (15 files/70 tests, unchanged), build, test:consumer, test:react-consumer, test:nextjs-consumer, check:bundle-size all pass. Did NOT attempt the actual npm publish -- this machine has no npm auth configured (npm whoami -> ENEEDAUTH), and logging in on Shimon's behalf isn't something an agent should do regardless of explicit request. package.json still has "private": true, left as-is pending Shimon's decision on which npm scope/account to publish under -- confirmed via a read-only npm view that the exact package name is unclaimed, but scope ownership is a separate question this session can't resolve. See NEXT_TASK.md for the exact options and commands to run once both are decided.
Shimon's answer to the npm-scope question: rename to match this repo's GitHub org rather than try to claim the @matrix-ai npm org. Updated package.json, all consumer fixtures, docs, and evergreen sections of RESTART_PROMPT.md; left dated historical entries in CHANGELOG/ROADMAP/ STATE referencing the old name untouched. Full validation suite and npm pack --dry-run re-verified green under the new name. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
Checked publish-readiness before attempting anything and found two real bugs:
react/react-dom/vite/@vitejs/plugin-react/tailwindcsswere listed under"dependencies". Sincereact/react-domare also correctly declared aspeerDependencies, this would have forced a second copy of React into every consumer's install (the classic "duplicate React instance" bug), plus Vite/Tailwind as unnecessary runtime installs for a package with zero actual runtime dependencies. Moved all five todevDependencies."files": ["dist"]shipped the entire build output directory, butpnpm buildwrites both the library (dist/lib/) and this repo's own demo app into the samedist/folder. Verified vianpm pack --dry-run: 82.8 kB packed / 281.8 kB unpacked (including the full 216 kB demo bundle) → after narrowing to"files": ["dist/lib"]: 16.6 kB / 52.0 kB, exactlydist/lib/**+README.md+package.json.Not attempted: the actual
npm publishnpm whoami→ENEEDAUTH) — logging in requires Shimon's own credentials/OTP.package.jsonstill has"private": true, left as-is pending Shimon's decision on which npm scope/account to publish under (confirmed via a read-onlynpm viewthat the exact name@matrix-ai/uiis unclaimed, but scope ownership is a separate question).NEXT_TASK.mdfor the exact options and commands to run once both are resolved.Test plan
pnpm typecheck/pnpm lint/pnpm test(15 files/70 tests, unchanged) /pnpm build/pnpm test:consumer/pnpm test:react-consumer/pnpm test:nextjs-consumer/pnpm check:bundle-size— all passnpm pack --dry-runconfirmed before/after tarball contents🤖 Generated with Claude Code