Skip to content

Simplify docs and add CI workflow for build validation - #3

Merged
DropSnorz merged 8 commits into
mainfrom
claude/command-palette-test-modules-5vytdt
Sep 12, 2026
Merged

DropSnorz merged 8 commits into
mainfrom
claude/command-palette-test-modules-5vytdt

Conversation

@DropSnorz

Copy link
Copy Markdown
Member

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

  • Documentation: Condensed README.md to focus on essential information, removing detailed setup instructions and token management details that are better suited for maintainer docs
  • CI Workflow: Added .github/workflows/ci.yml to validate builds on every push to any branch, catching broken builds before they reach main
  • DevDependencies: Added vitest, Testing Library packages (@testing-library/jest-dom, @testing-library/react, @testing-library/user-event), and @types/spark-md5 to package.json
    • These are required because @astrelitehq/localgrid's build process type-checks its entire source tree (including tests) via tsc -b, but the published package doesn't include devDependencies
    • Listing them here allows npm's hoisted node_modules to satisfy that type-check
  • Node Version: Updated pages.yml to use Node 24 (matching @types/node's ^24.x range) and simplified workflow comments
  • Agent Instructions: Added AGENTS.md with style guidelines and command reference for AI assistants

Implementation Details

  • The new CI workflow uses GITHUB_TOKEN (which has implicit packages: read permission) instead of requiring a separate PACKAGES_READ_TOKEN secret
  • DevDependency versions should be kept in sync with localgrid.dev's own package.json
  • Documentation now emphasizes that the lockfile generation and CI/CD setup are separate concerns from the core functionality

https://claude.ai/code/session_01VRLpTV8ikW4M8i9LvhUGQD

@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.
@DropSnorz
DropSnorz merged commit dd69154 into main Sep 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants