Keeping nself.org in sync with SPORT
Keeping nself.org in sync with SPORT
Section titled “Keeping nself.org in sync with SPORT”All version strings, prices, and plugin counts on nself.org are generated at build time from authoritative SPORT source files. Hand-editing these values in the website source will cause your changes to be overwritten on the next build.
What is SPORT?
Section titled “What is SPORT?”SPORT (Single Point of Reference Truth) is a set of 15 Markdown files at
.claude/docs/sport/F01-F15.md inside the nself monorepo root. These files are
code-verified and read-only. They are the canonical source for:
- Plugin counts (F03, F04)
- Bundle membership (F06)
- Pricing tiers (F07)
- Version strings (F01 / MASTER-VERSIONS.md)
How the build pipeline works
Section titled “How the build pipeline works”SPORT source files → build scripts → generated files → Next.js pagesThree scripts run before every pnpm dev and pnpm build in web/org:
| Script | Input | Output |
|---|---|---|
scripts/sync-sport.mjs | SPORT + MASTER-VERSIONS | src/generated/sport.json |
scripts/gen-pricing.mjs | F06, F07, sport.json | src/data/generated-pricing.ts |
scripts/validate-sport-json.mjs | sport.json | CI gate (exits non-zero on errors) |
The pages that consume generated data:
/pricing: importsGENERATED_TIERSandGENERATED_BUNDLES/plugins: importsGENERATED_PLUGIN_COUNTSfor header stats
Updating prices or bundle membership
Section titled “Updating prices or bundle membership”-
Edit the authoritative SPORT file:
- Pricing changes →
.claude/docs/sport/F07-PRICING-TIERS.md - Bundle membership changes →
.claude/docs/sport/F06-BUNDLE-INVENTORY.md
- Pricing changes →
-
Regenerate the TypeScript data module:
Terminal window cd web/orgnode scripts/gen-pricing.mjs -
Verify the output in
src/data/generated-pricing.tsmatches your intent. -
Run tests to confirm no canonical values regressed:
Terminal window pnpm vitest run
Updating version strings
Section titled “Updating version strings”-
Edit
MASTER-VERSIONS.mdat the nself monorepo root (.claude/docs/MASTER-VERSIONS.md). -
Regenerate sport.json:
Terminal window cd web/orgnode scripts/sync-sport.mjs -
The
/pricingand/pluginspages pick up the new counts automatically via sport.json.
Updating plugin counts
Section titled “Updating plugin counts”Plugin counts come from sport.json, which reads F03 (free plugins) and F04 (paid plugins)
via sync-sport.mjs. To update:
- Add or remove plugins in
plugins/orplugins-pro/. - Run
node scripts/sync-sport.mjsto update sport.json. - Run
node scripts/gen-pricing.mjsto propagate counts togenerated-pricing.ts.
The plugins page header will now show the correct counts.
CI validation
Section titled “CI validation”validate-sport-json.mjs runs as part of predev and prebuild. It fails if:
- sport.json is missing required keys
- CLI version is not in
vX.Y.Zformat - Any superseded tier name (Basic, Pro, Elite, Business) appears in
pricingTiers - Free plugin count drops below 25
- Paid plugin count drops below 62
Fix validation failures by regenerating sport.json, not by patching validate-sport-json.mjs.
Never hand-edit these files
Section titled “Never hand-edit these files”| File | Why |
|---|---|
web/org/src/generated/sport.json | Overwritten on every build |
web/org/src/data/generated-pricing.ts | Overwritten by gen-pricing.mjs |
Changes to these files will be silently discarded.