Skip to content

ci: add production build check and lighten pre-commit hooks#988

Merged
Yeom-JinHo merged 1 commit into
magicuidesign:mainfrom
Yeom-JinHo:ci/build-check-and-lighter-hooks
Jul 19, 2026
Merged

ci: add production build check and lighten pre-commit hooks#988
Yeom-JinHo merged 1 commit into
magicuidesign:mainfrom
Yeom-JinHo:ci/build-check-and-lighter-hooks

Conversation

@Yeom-JinHo

Copy link
Copy Markdown
Member

Summary

  • CI: Add a build job to code-check.yml — PRs that break the Next.js production build now fail CI. No secrets needed (all env reads in the build path are defensive), so fork PRs build identically. Caches apps/www/.next/cache, uses setup-node@v4 + node-version-file: .nvmrc. A workflow-level concurrency group cancels superseded runs on rapid pushes.
  • Hooks: Rework lefthook.yml around fast, staged-only pre-commit (~30–120s → ~2–10s per commit):
    • lint/format run directly on staged files instead of the whole project
    • registry build uses the www-scoped script (the root script also ran a hidden full-project lint+format) and stages generated artifacts by explicit path instead of git add --all
    • full typecheck moves from pre-commit to pre-push
  • Guard: Generated registry JSON added to .prettierignore so the format hook can never reformat build:registry output away from its JSON.stringify form (which would trip the registry-drift CI check).

Why the build job matters

While validating this change on a fork that predated #979, the new job immediately caught the tweet-card prerender regression (TypeError: c is not iterable) that used to slip through CI — exactly the class of failure this check gates. Verified green against current main (full 381-page prerender, ~5 min cold / ~2–4 min with warm cache).

Contributor-facing changes

  • Type errors no longer block git commit — they block git push and CI.
  • Everything removed locally remains covered by CI (lint / format / tsc / registry-drift jobs).

🤖 Generated with Claude Code

https://claude.ai/code/session_01QEkEs1cWYWSvshxhxJZ6od

Add a build job to code-check.yml so PRs that break the Next.js
production build fail CI. The job needs no secrets (all env reads are
defensive), caches apps/www/.next/cache, and uses setup-node@v4 with
node-version-file so the Node version follows .nvmrc. A workflow-level
concurrency group cancels superseded runs on rapid PR pushes.

Rework lefthook.yml around fast, staged-only pre-commit:
- lint/format run directly on staged files instead of the whole project
- registry build uses the www-scoped script (the root script also ran a
  full-project lint:fix + format:fix) and stages generated artifacts by
  explicit path instead of `git add --all`
- full typecheck moves from pre-commit to pre-push; CI remains the
  backstop for everything removed locally

Ignore generated registry JSON in prettier so the format hook can never
reformat build:registry output away from its JSON.stringify form, which
would trip CI's registry-drift check.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEkEs1cWYWSvshxhxJZ6od
@vercel

vercel Bot commented Jul 19, 2026

Copy link
Copy Markdown

@Yeom-JinHo is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo
Yeom-JinHo merged commit 76d280a into magicuidesign:main Jul 19, 2026
6 of 7 checks passed
@Yeom-JinHo
Yeom-JinHo deleted the ci/build-check-and-lighter-hooks branch July 19, 2026 11:51
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.

1 participant