fix: reduce published package size of component-library and icon-kit - #1289
Draft
Arnold Stoba (arnoldstoba) wants to merge 5 commits into
Draft
fix: reduce published package size of component-library and icon-kit#1289Arnold Stoba (arnoldstoba) wants to merge 5 commits into
Arnold Stoba (arnoldstoba) wants to merge 5 commits into
Conversation
The maps were built with sourcemap: "hidden" since #1055, so no published file references them. They accounted for 23.6 MB (~55%) of the 43.4 MB unpacked package while being unreachable by any consumer tooling.
@t3-oss/env-core, dotenv, ora, winston and zod are only used by the icon sync script in src/, which is not part of the published package (files: ["icons"]). Consumers installed ~10 MB of unused tooling.
The Inter font files are copied into dist/assets/fonts/ at build time and served through the ./font.css export, so the published package is fully font-self-contained. Nothing in dist references the inter-ui package, yet every consumer installed its 15.6 MB. The lockfile update also covers the icon-kit devDependencies move from the previous commit.
src/ added 2.3 MB (including 141 spec and story files) to every install. The exports map only exposes dist, so src has been unreachable through package imports; shopware/shopware contains no references to it either.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
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.
What?
Removes dead weight from the published
@shopware-ag/meteor-component-libraryand@shopware-ag/meteor-icon-kitpackages. The component library shrinks from 43.4 MB unpacked (4,922 files) to 16.8 MB (2,500 files) — a 3.7 MB tarball — without changing a single byte of runtime code that consumers use.Why?
npm analytics flagged the component library at 43.4 MB unpacked (173 MB installed with dependencies) — far larger than comparable libraries. A byte-level analysis of the published tarball showed that most of it is never used by any consumer: unreachable source maps, unpublished-tooling dependencies, the raw
srctree, and a font package whose files are already copied intodist.Meteor is a public library — consumers are the
shopware/shopwareadministration and external extension developers building apps and plugins. Every change in this PR is therefore justified at the artifact level (properties of the published package itself, which hold for every consumer), not just by checking known consumers.How?
One commit per finding, each with a changeset (all
patch):fix(component-library): stop publishing source maps(23.6 MB, ~55% of the package)sourcemap: "hidden", which strips thesourceMappingURLcomments. We verified via grep over the published tarball that zero files reference the 2,130.mapfiles.sourcemap: falseadditionally removes the warning that fix: source map warning #1055 worked around.fix(icon-kit): move Figma sync tooling to devDependencies(~10 MB install weight:zod,winston,ora,dotenv,@t3-oss/env-core)src/, which is not part of the published package (files: ["icons"]).dependencies; such imports were never supported, pnpm/Yarn PnP already reject them, and the changeset documents it.fix(component-library): move inter-ui to devDependencies(15.6 MB install weight)inter-uiis build-time-only:emitInterFontAssetscopies the two woff2 files intodist/assets/fonts/and generatesdist/fonts.csswith relative URLs../font.cssexport is unchanged (verified in a fresh build) — self-contained for every consumer. The build helper throws if any~inter-uireference survives the URL rewrite, so a regression cannot build. Same phantom-dependency edge case as above, documented in the changeset.fix(component-library): stop publishing the src directory(2.3 MB, including 141.spec/.storiesfiles)srcwas published alongsidedistbut is not part of the public API.exportsmap has only ever exposeddistpaths, sosrcis unreachable through package imports in any modern resolver (Node ≥ 12.20, webpack 5, Vite, Rollup) — this holds for every consumer, not just known ones. Paths that bypass the package API (rawnode_modules/.../srcSCSS imports, webpack-4-era resolvers that ignoreexports) were never officially supported and are called out in the changeset; the shipped SCSS was not usable standalone anyway (it depends on build-time aliases and injected variables). As an additional check, the primary consumershopware/shopwarecontains zerosrcreferences (full-text search including SCSS and build configs) and our docs never instructed such imports.Testing?
vue-tsctype check clean.npm pack --dry-runconfirms identical publish contents..mapfiles, nosrc/, fonts present indist/assets/fonts/with correctly rewrittendist/fonts.css.shopware/shopwareadministration (Vite 6, including plugin builds) succeeds, plus a manual browser test against a yalc-linked build of this branch. External apps/plugins cannot be tested individually — they are covered by the artifact-level guarantees above (identical tarball, unreferenced files removed, unchangedexportssurface), with the known edge cases documented in the changesets.Anything Else?
.d.tsfiles).date-fnsunpinned to^4.1.0and a propervuepeerDependency declaration).