Repository navigation
ci: gate zero deps, tree-shaking, tsrs pins and lockfile sync - #105
Merged
Merged
Conversation
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.
Closes #101
Closes #102
Closes #103
Closes #104
What changed
Four CI-only gates. No library code under
packages/chart/srcchanges, so the publisheddist/is byte-identical tomain.Invariant: @bloxwap/chart has zero runtime dependencies (react only as optional peer, only in ./react) #101, zero runtime deps:
npm run check:dependenciesfails ifpackages/chart/package.jsongainsdependenciesoroptionalDependencies, or ifreactstops being the only optional peer. It also scans all 143dist/**/*.jsfiles for bareimport/export … from/import()specifiers. Onlyreactandreact/jsx-runtimeunderdist/react/are allowed.node:builtins and computed specifiers fail.Invariant: package.json sideEffects:false is accurate and entry points stay tree-shakable #102, tree-shaking:
npm run check:tree-shakingcheckssideEffects:false, then usesbun build --minifyto bundle fixtures from an installed copy of the package:parseColorsmaValues(/indicators)createChartInvariant: tsrs is pinned to the same exact version everywhere and the tsc fallback keeps passing #103, tsrs pins:
npm run check:tsrsrequires every workspace'stsrspin to be identical and exact, and requirestsrsand@tsrs/*to resolve to that version in both lockfiles. CI now also runsbun run typecheck:tscafter the coverage build.renovate.jsongroupstsrsand@tsrs/*so Renovate updates them together.Invariant: package-lock.json and bun.lock resolve the same dependency tree #104, lockfile sync:
npm run check:lockfilescompares package names and resolved versions inbun.lockandpackage-lock.json, excluding workspace links. Today: 391 names and 393 name/version pairs, 0 mismatches. The README line about "one root lockfile" now describes both lockfiles.npm run check:invariantsruns all four checks, then 19node:testregression tests. Those tests run each check against a temporary broken fixture (a runtime dependency, a required React peer, React leaking into core, a bare import or re-export, a dynamic builtin import, a kernel leak, a budget overrun,^and drifted tsrs pins, platform-binary drift in each lockfile, and an npm-only, bun-only or nested-version mismatch), and each one fails as expected. The gates are documented indocs/ci-runners.md.Proof
npm run check:invariants: all four checks pass, and 19/19 regression tests pass.npm run typecheck:tsc,npm run lintandnpm run build: all pass.srcortestfiles change. The CI coverage gate still enforces 100%.