Simplify docs and add CI workflow for build validation - #3
Merged
Merged
Conversation
@astrelitehq/localgrid's build script (tsc -b && vite build) type-checks its whole src tree, test files included, but the published npm package only ships its runtime dependencies, not the devDependencies (vitest, Testing Library, @types/spark-md5) those files need. Installing the same packages here, where npm's flat node_modules layout lets tsc resolve them from node_modules/@astrelitehq/localgrid, fixes the build without touching localgrid.dev. --legacy-peer-deps works around an unrelated npm arborist crash hit while resolving vitest's optional peer dependencies; that flag also disables npm's automatic peer-dependency install, so @testing-library/dom (a peer of @testing-library/react and user-event) is listed explicitly too. See the new README section for the full explanation and the real (upstream) fix this works around.
--legacy-peer-deps disables peer-dependency conflict checking for the entire install, not just the one package that needed a workaround. The actual problem is an npm arborist bug (npm < 12) that crashes resolving vitest's optional peer dependency graph; npm 12 resolves it correctly with default (non-legacy) peer resolution. Upgrading npm before `npm install` in CI fixes the crash without giving up peer-dependency checking, and lets npm auto-install @testing-library/dom (a real peer of @testing-library/react and user-event) instead of listing it explicitly. Also reframes the README section: this accommodation is meant to stay local to this repo rather than be treated as a stopgap for an upstream fix.
Matches @types/node's ^24.13.3 range, which was already declared here but untested against — CI ran Node 20 while types targeted Node 24 APIs. Also drops the "Upgrade npm" step: Node 24 bundles npm 11.19.0, which (like npm 12) doesn't hit the arborist crash resolving vitest's optional peer dependencies that Node 20/22's bundled npm 10.9.7 does. One less manual pin to maintain.
Shorten pages.yml comments to one-liners and cut the README down to what's load-bearing, dropping restated rationale and narrative explanation.
Carries over the applicable clauses from localgrid.dev's AGENTS.md (style rules, commit/PR policy); skips the ones specific to its widget-app source structure, which this repo doesn't have.
New ci.yml runs `npm run build` (no deploy) on push to any branch, so a broken build shows up before merging to main rather than at the next pages.yml deploy.
PACKAGES_READ_TOKEN isn't used; pages.yml and ci.yml both authenticate with the default GITHUB_TOKEN, granted access via the package's own Actions access settings.
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
This PR streamlines the README documentation, adds a dedicated CI workflow for build validation on all branches, and includes devDependencies needed for type-checking the installed package.
Key Changes
.github/workflows/ci.ymlto validate builds on every push to any branch, catching broken builds before they reachmainvitest, Testing Library packages (@testing-library/jest-dom,@testing-library/react,@testing-library/user-event), and@types/spark-md5topackage.json@astrelitehq/localgrid's build process type-checks its entire source tree (including tests) viatsc -b, but the published package doesn't include devDependenciesnode_modulesto satisfy that type-checkpages.ymlto use Node 24 (matching@types/node's^24.xrange) and simplified workflow commentsAGENTS.mdwith style guidelines and command reference for AI assistantsImplementation Details
GITHUB_TOKEN(which has implicitpackages: readpermission) instead of requiring a separatePACKAGES_READ_TOKENsecretpackage.jsonhttps://claude.ai/code/session_01VRLpTV8ikW4M8i9LvhUGQD