Conventions and Workflow
Code style
- TypeScript strict. Import via the
@/alias (@/lib/...,@/components/...). - Prettier: 100-character lines, double quotes, semicolons, trailing commas, Tailwind class sorting. Run
npm run format. - ESLint:
eslint-config-nextcore-web-vitals + TypeScript. Unused bindings prefixed with_are allowed. - Comments: explain why, especially around integrations and static-export constraints. Match the density of the surrounding file.
- Placeholders: mark content awaiting the client with
[PLACEHOLDER: …]so it can be found with grep.
Architecture rules
- Server components by default. Add
"use client"only for state, effects, or browser APIs. - Data in
src/lib, presentation insrc/components. Page-specific prose can live inpage.tsx. - Nothing that needs a server at runtime except in
functions/. No route handlers, server actions,headers()/cookies(), or ISR. They breakoutput: "export". - Never expose secrets through
NEXT_PUBLIC_*. Anything needing a secret goes in a Pages Function. - Keep third-party specifics isolated: FareHarbor in
content.tsandFareharborWidget; HighLevel in the Function,LeadForm,EmailSignup,DonateWidget, andsupport-content.ts. - Payments never touch the site. Link to provider-hosted checkouts.
- Validate at the edge of CMS data. Loaders should tolerate missing optional fields and bad URLs (see
getTourBooking). - Before using a Next.js API, check
node_modules/next/dist/docs/(perAGENTS.md). Next 16 has breaking changes.
Workflow
git pullfirst. Decap commits tomainfrequently.- Work on a branch for anything non-trivial. Pushing it gives you a Cloudflare preview URL to share for review.
npm run lint && npm run format:check && npm run buildbefore merging.- Merge to
main, then verify on production. - If a change affects editors or admins (a new CMS field, changed behaviour), update this book (see Maintaining This Book).
Commit messages in this repo are short imperative summaries, for example "Link donations to HighLevel hosted checkout" or "Add annual corporate sponsors directory".
No comments to display
No comments to display