Main flow
Your manual steps are green; everything after the merge runs on its own.
One detail chart shows at a time, below. Each has a link back here. Tables and exact messages: Reference.
On a narrow screen, scroll each chart sideways.
Pre-commit
.husky/pre-commit runs npm run type-check then npm run check; .husky/commit-msg runs commitlint. Team convention: feat: or fix: only.
details: gate matrix · skip a step · manifest controls
Changeset summary
scripts/changeset-summary.mjs calls writeSummaries in scripts/check-changeset.mjs. Commit first: it reads origin/main...HEAD. Never npx changeset.
details: summary gate messages · summary file template
- Signals: calculation (
src/utils/orcalculat*), timing (debounce,throttle,setTimeout,setInterval,*_MS), bff/network (src/client.ts,/shared/api/), tracking (track*), props (exported*Props). - Fingerprint:
<!-- summary-fingerprint: @bankrate/<dir>@<sha256> -->over the source files the branch changes in the package and its workspace deps, so mergingmainkeeps it fresh; checked on pre-push and in CI. - A
calculator-internalchange needs a summary for every dependent publishable calculator.
Pre-push gates
.husky/pre-push, in order. The five changeset gates (code order) print every failure at once, then the hook stops. --no-verify skips the hook; CI runs the same gates and tests.
details: gate matrix · skip a step (exact messages)
Exact gate titles
✗ A changeset names both an ignored and a released package.
✗ A major changeset must retire the current major for the QA version switcher.
✗ A contracts changeset must keep the superseded version under the BFF compat check.
✗ A changeset summary is incomplete or stale.
✗ This PR changes package source but adds no changeset.
✓ Changeset present for <N> changed package file(s).Breaking change (major)
N is the major in the package's current package.json. Alias and frozen manifest: major-retirement gate; Host import: qa-manifest.test.ts. Both run on pre-push and in CI.
details: major-retirement row · protections
BFF compatibility
src/lib/__tests__/bff-compat.test.ts checks every @bankrate-qa/calculator-contracts-* alias (1.0.0 to 7.0.0) against today's BFF, request and response. Entries live in bffCompatAllowlist (scripts/boundaries/allowlists.ts).
details: acknowledged breaks · protections
Failure messages
<route> (contracts <x.y.z>, <direction>): `<field>` <detail>; if intended, add '<field>: <detail>' to the breaks of a bffCompatAllowlist entry in scripts/boundaries/allowlists.ts
<route> (contracts <entry>, <direction>): '<field>: <detail>': acknowledged break no longer exists; remove it from the entry
<route>: add it to routes, or to notApplicable with a reason
QA info alert: known BFF incompatibility (contracts <entry>, <direction>): `<fields>` — <reason>PR checks + Wiz
.github/workflows/pr-checks.yml. Wiz scans the PR image when image paths change.
details: gate matrix · skip a step
Release and deploy
release.yml → publish-packages.yml (on Semantic Release success) and build-and-push.yml (on release: published), which calls deploy.yml and smoke.yml. No "Version Packages" PR; prod needs no approval.
details: release facts · commands
QA page
localhost:3000 locally, calculators.qa.bankrate.com after deploy. Banners: src/app/_calculator-qa-host/playground/CalculatorPlayground.tsx.
details: QA page messages · QA page data · manifest controls
Annotated screenshots
- 1Search title or description:
?q= - 2Categories: one
&category=each - 3Workspace
package.jsonversion, not latest published
Catalog /. No match: "No calculators match these filters."
- 1Package, version, Changelog (anchored to the release)
- 2Version select:
vN — x.y.z (workspace source)first - 3Changes: releases of the selected major
- 4One control per boolean / preset, JSDoc text; 7 host props hidden
- 5State is in the URL: only non-defaults, one history entry per change
/mortgage at 1440px. Panel docks at 86rem (97rem for the wide rebrand page); narrower windows get a floating Props button and a left sheet.
- 1Pending major changeset: shown as v4, "unreleased major"
- 2Old URL param flagged: "removed in 4.0.0"
- 3
docsprop: read-only - 4
packageParams:name = valueor(unset)
/mortgage-refinance?showRateOffers=false
All warning texts: QA page messages.
- 1Frozen major
vN — x.y.z (date): sets?version=N, renders@bankrate-qa/<dir>-vN - 2Old major vs today's BFF:
BFF compatibility failure (vN): … - 3Changes offers Upgrade to current
/home-affordability?version=2: the published 2.0.3 crashes against the current BFF. An acknowledged break now also adds an info alert, known BFF incompatibility (contracts …) (BFF compatibility); not in this screenshot.
Reference
Tables behind the charts. Exact messages are in each row's message.
Gate matrix: which check runs where
| Check | pre-commit | pre-push | PR CI | release |
|---|---|---|---|---|
| Commit message (commitlint) | ||||
| Type-check: manifests, preset unions | ||||
| Biome | ||||
| ESLint | ||||
| Changeset present / mixed / major retirement | ||||
| Contracts version alias | ||||
| Summary complete + fingerprint | ||||
| qa-manifest (exists, Host imports frozen) | ||||
| FE/BFF boundaries | ||||
| Shadow boundary | ||||
| Boolean defaults | ||||
| Ledger usage | ||||
| Contract compat (request fixtures) | ||||
| BFF compatibility | ||||
| All other unit tests + coverage | ||||
| App build | ||||
| E2E | ||||
| No prerelease artifacts | ||||
| Package artifacts + clean-room | ||||
| Docker build + Wiz scan | ||||
| Terraform plan (speculative) | ||||
| QA smoke before prod | ||||
| Prod smoke |
runs and blocks · partial or conditional: pre-push runs @smoke only, CI the affected shards; package and Docker jobs are scoped / path-filtered (Docker: same-repo PRs only); prod smoke reports only. Pre-commit includes commit-msg.
What happens if you skip a step
A failing hook step stops the commit or push; all changeset failures print at once. --no-verify skips the hook; CI runs the same gates and guard tests. Pass: ✓ Changeset present for <N> changed package file(s).
| Gate | Runs | Result | Fix |
|---|---|---|---|
| Commit message | commit-msg, CI | blocks commit | Conventional type; team uses feat: / fix: onlymessage |
| Manifest drift | pre-commit, CI | blocks commit | Add / remove the prop's control in qa-manifest.tsmessage |
| Preset missing a union member | pre-commit, CI | blocks commit | Add an option for every member (a plain string prop accepts any keys)message |
| Format / lint | Biome: pre-commit, CI; ESLint: CI | blocks | npm run lint:fix |
| Mixed ignored changeset | pre-push, CI | blocks push | Drop calculator-internal from it, or split it outmessage |
| Major without retirement | pre-push, CI | blocks push | Add the vN alias + frozen manifest (chart)message |
| Missing contracts alias | pre-push, CI | blocks push | Add the printed alias (current contracts version) to root devDependenciesmessage |
| Summary incomplete / stale | pre-push, CI | blocks push | Re-run npm run changeset:summary, finish the text, commitmessage |
| Missing changeset | pre-push, CI | blocks push | npm run changeset:summary, set the bump, commitmessage |
Missing qa-manifest.ts | pre-push, CI | blocks push | Create the route's manifestmessage |
| Host skips a frozen manifest | pre-push, CI | blocks push | Import ./manifests/vN in <Name>Host.tsx and add it to versionsmessage |
| FE/BFF boundaries | pre-push, CI | blocks push | Shared shapes go to calculator-contracts; exceptions only in scripts/boundaries/allowlists.tsmessage |
| Shadow boundary | pre-push, CI | blocks push | Render <Component>Inner inside CalculatorShadowBoundarymessage |
| Boolean defaults | pre-push, CI | blocks push | Default false, rename, or fix the allowlist / manifestmessage |
| Ledger usage | pre-push, CI | blocks push | Use the Ledger component; classes at the call sitemessage |
| Contract compatibility | pre-push, CI | blocks push | Keep BFF request schemas accepting old majors' recorded requestsmessage |
| BFF compatibility | pre-push, CI | blocks push | Fix the BFF, or acknowledge in bffCompatAllowlist (entries)message |
| Other unit tests | CI | blocks merge | npm test (CI runs it with coverage) |
| App build | CI | blocks merge | npm run build |
| E2E | pre-push (@smoke), CI | blocks | npm run test:e2e |
| Prerelease artifacts | CI | blocks merge | Follow the printed discard stepsmessage |
| Package artifacts | CI (affected packages) | blocks merge | npm run verify:pkg / npm run test:clean-room |
| Docker build + Wiz | CI (image paths) | blocks merge | Fix the Dockerfile or the flagged dependency |
| QA smoke | release | stops prod | Fix forward with a new PR |
Backward-compatibility protections
Consumers stay on old majors, and old majors keep calling today's BFF.
| Protection | Catches | Misses |
|---|---|---|
| Manifest type-check | every prop and preset union member has a QA control | behavior changes |
| Frozen manifests (39) | every retired major renders in the switcher; Host must import each one | a missing versions entry (only an unused-import lint) |
| Version switcher | old major rendered live against today's BFF, with a banner on failure | manual: someone has to open it |
| Contract fixtures | old majors' recorded requests vs today's zod schemas | recorded by hand (record-contract-fixtures.mjs) |
| Change summaries | gated sections + signals; rolled up in the upgrade view | only as accurate as written |
| BFF compatibility | contracts 1.0.0–7.0.0 types vs today's BFF, request and response; acknowledged breaks visible in the PR diff and a QA alert | types only, not live upstream data |
Acknowledged BFF breaks (6)
bffCompatAllowlist in scripts/boundaries/allowlists.ts; each entry lists its exact breaks (<field>: <detail>), so a different break on the same field fails again, and a reason, shown in the QA info alert. Failure text: BFF compatibility row.
| Route | Contracts | Direction | Fields | QA alert on |
|---|---|---|---|---|
/cd/api | <7.0.0 | response | nationalRate, chartData | v2, v3 |
/home-affordability/api | <6.0.0 | response | recommendedPaymentBreakdown, maxPaymentBreakdown | v2 |
/mortgage-refinance/api | <2.1.0 | request | closingCosts, propertyValue, remainingBalance | none |
/mortgage-refinance/api | <2.1.0 | response | currentLoanTermLabel, currentRate, newLoanAmount, newRate, paymentDelta | none |
/mortgage-refinance/api | 2.1.0 | response | loanToValue, newLoanAmount | none |
/savings/api | <3.0.0 | response | yearlyData | none |
Manifest controls: one per prop
qa-manifest.ts lists every prop, checked by satisfies QaManifest<Props>; a broken dependsOn rule shows as a warning with its reason. Best Rate Guarantee: open is host-owned React state in the Host.
| Kind | Panel | Rule |
|---|---|---|
boolean | Switch | defaultValue, else false |
preset | Select | named options; the first key is the default; type-check requires every union member |
host | hidden | wiring the host owns: bffBaseUrl, client, onError… |
docs | read-only, "docs only" badge | not toggleable, e.g. CTA URLs |
- Booleans default to
falseand are namedshow*/enable*/allow*;hide*/disable*are banned. booleanTrueDefaultAllowlist(manifest must saydefaultValue: true): mortgage-calculatorshowRateOffers,enableScenarioTools; mortgage-refinance-calculatorshowIntentQuestion,showConversionCard; mortgage-calculator-rebrandshowIntentQuestion,showConversionCard,showLenderMatchCta,enableScenarioTools.
QA page messages
| When | Shown as | Text |
|---|---|---|
| Unknown URL param | warning | <param> was removed in <N>.0.0 · <param> was added in <N>.0.0 · <param> is not a prop of this version |
Unknown value (or ?version=) | warning | <value> is not a value of <prop> here; using the default |
Broken dependsOn rule | warning | prop name as title, the rule's reason as text |
| Old major with an acknowledged break | info | known BFF incompatibility (contracts <entry>, <direction>): `<fields>` — <reason> |
| Old major errors or crashes | host banner | BFF compatibility failure (v<N>): <message> |
| Current version errors | package | the package shows its own errors; best-rate-guarantee sets hostErrorBanner (host banner, raw message) |
| Pending major changeset | label + notice | select: vN — x.y.z (workspace source, unreleased major); Changes: Unreleased: a pending major changeset will publish <N>.0.0. |
| Catalog: no match | text | No calculators match these filters. |
- Upgrade view (
?upgradeFrom=): props diff, every non-noneconsumer action, then the remaining release notes, newest first; empty?upgradeFrom=uses the selected release.
Where the QA page gets its data
scripts/gen-prop-docs.mjs, on predev, prebuild and prepare; output under src/app/_calculator-qa-host/.
| Source | Generated file | Used for |
|---|---|---|
packages/<dir>/src *Props JSDoc | playground/prop-docs.generated.json | panel control text |
packages/<dir>/package.json version | package-versions.generated.json | catalog tiles, version label |
.changeset/*.md pending majors | pending-majors.generated.json | "unreleased major", Changes notice |
packages/<dir>/CHANGELOG.md | changelogs/<dir>.generated.json | Changes list, upgrade view |
bffCompatAllowlist + each alias's contracts dependency | bff-compat.generated.json | known BFF incompatibility alert |
Release facts
- Publish waits for Semantic Release: semantic-release exits 0 without releasing when its branch is behind the remote, so a version commit landing first would silently skip the tag, image and deploy.
- Publish runs only when Semantic Release concluded
success(or on a manual dispatch frommain); every step is idempotent and re-runnable. - ECR gets
vX.Y.Z, pluslatestunless prerelease.deploy-prodrequiresprerelease == falseand no-in the tag. - Rollback: Actions → Deploy to ECS → Run workflow (
deploy.ymlfrommain) with an earlierimage_tag.
Generated .changeset/<dir>-summary.md
---
'@bankrate/mortgage-calculator': patch ← patch | minor | major
---
## what changed
TODO(changeset-summary): replace with the what changed.
## behavior impact
signals: props, timing ← written by the command
TODO(changeset-summary): replace with the behavior impact.
## consumer action needed
TODO(changeset-summary): replace with the consumer action needed.
<!-- summary-fingerprint: @bankrate/mortgage-calculator@<sha256> -->Commands
| Command | What it does |
|---|---|
npm install | prepare: gen:css, gen:prop-docs, husky (outside CI) |
npm run dev | QA pages + BFF on localhost:3000 |
npm run changeset:summary | Create / update summaries; optional -- <baseRef> (default origin/main) |
npm run changeset:check | The five changeset gates, as on pre-push |
npm run type-check | tsc --noEmit, includes manifests |
npm run check / npm run lint | Biome / Biome + ESLint (lint:fix writes fixes) |
npm test / npm run test:coverage | Vitest / with coverage (CI) |
npm test -- src/lib/__tests__/boundary-rules.test.ts | Boundary rules only |
npm test -- packages/__tests__/ledger-usage.test.ts | Ledger rules only |
npm test -- src/lib/__tests__/bff-compat.test.ts | BFF compatibility only |
npm run test:e2e / npm run test:e2e:smoke | Playwright, full / @smoke |
npm run gen:prop-docs | Prop docs, versions, pending majors, changelogs, BFF compat JSON (also on predev / prebuild) |
npm run build / npm run build:pkg | Next app / all packages |
npm run verify:pkg, npm run test:clean-room | Package artifact + clean-install checks |
node scripts/check-no-prerelease.mjs | Prerelease gate |
npx next build && npx next start -p 3900, then node scripts/record-contract-fixtures.mjs | Record request fixtures (port defaults to 3900) |
Where things live
| Path | What |
|---|---|
packages/<dir>/src | package source |
src/app/<route>/page.tsx, <Name>Host.tsx | server entry (BFF URL, geo); CalculatorPlayground + versions |
src/app/<route>/qa-manifest.ts, manifests/vN.ts | current and frozen manifests |
src/app/<route>/api, _server, _server/__fixtures__ | BFF; contract fixtures |
src/app/_calculator-qa-host/ | catalog, shell, playground, generated JSON |
.changeset/, scripts/check-changeset.mjs, scripts/changeset-summary.mjs | changesets (config.json ignores calculator-internal) and their gates |
scripts/boundaries/allowlists.ts | bffCompatAllowlist, booleanTrueDefaultAllowlist, other exceptions |
src/lib/__tests__/, packages/__tests__/ | the 7 pre-push guard tests (and the rest) |
.husky/ | commit-msg, pre-commit, pre-push |
.github/workflows/ | pr-checks, release, publish-packages, build-and-push, deploy, smoke, coverage |
docs/RELEASING.md, docs/releasing/change-summaries.md | policy and summary format |