Reduce published package install size - #84
Open
JonathonRP wants to merge 1 commit into
Open
Conversation
Exclude generated test fixtures and disable unusable declaration maps while retaining runtime source-map settings and public dependencies. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
🦋 Changeset detectedLatest commit: 54cd42e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
📝 WalkthroughWalkthroughThe package now excludes compiled test directories and disables declaration map generation. A Changeset records the patch release and the package size cleanup. ChangesPublished package size cleanup
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
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
dist/**/__tests__/**fixtures while retaining the existing named test/spec exclusionssourceMapsettingmotion-startcsstypeas a runtime dependency so public declaration imports continue to resolveDirect package measurements
Measured against published
motion-start@0.2.0-next.6and an actual tarball built from this branch:Tarball inspection confirms 0
__tests__paths and 0.d.ts.mapfiles.Installed dependency closure
npmx calculates install size as the sum of registry
dist.unpackedSizefor the root and recursively resolved runtime dependencies (excluding peer dependencies). Its published-version comparison is:0.1.210.2.0-next.6This PR reduces the published next.6 total closure by 343,190 bytes (11.12%). Compared with v0.1.21, the candidate root package is 589,572 bytes (35.90%) smaller, but its total closure remains 636,280 bytes (30.21%) larger because dependencies are unchanged.
The exact 979,470-byte (46.50%) next.6 regression shown by npmx is:
csstype@3.2.3addedruned@0.37.1addedlz-string@1.5.0addeddequal@2.0.3addedesm-env@1.2.2addedmotion-startroot changedpopmotion@11.0.5removedstyle-value-types@5.1.2removedtslib@2.4.0removedframesync@6.1.2removedhey-listen@1.0.8removedA clean npm install using
--legacy-peer-depsto match npmx's runtime-only closure measured:node_modulesnode_modulesThe small difference from npmx totals is npm-generated
.package-lock.json/.bincontent.Why
csstyperemainsSvelte 5.56.8's stable public
svelte/elementssurface does not exportCSSPropertiesorStyleProperties; HTML and SVGstyleattributes are typed only asstring | null | undefined. DOM'sCSSStyleDeclarationsimilarly uses broad string values and cannot preserveMotionStyle's property-specific unions, numeric lengths, MotionValue support, or generated public declaration behavior. Replacingcsstypewith either would weaken consumer types. Moving it to dev, optional, or peer dependencies would not safely solve declaration resolution or npm's default install closure, so this focused packaging PR intentionally retains it.Validation
bun run package(includessvelte-packageandpublint --strict)bun run test:run: 143 passed, 1 skipped test file; 642 passed, 1 skipped testbun run test:types: 21 files and 21 tests passed; no type errorsbun run check:package: 0 errors and 0 warningsmotion-startandmotion-start/domdist/index.jsanddist/dom.jsunder the Svelte condition__tests__paths, 0.d.ts.mapfilesNo release version files or
bun.lockchanges are included.Summary by CodeRabbit