mirror of
https://github.com/hanzoai/billing.git
synced 2026-10-30 18:46:54 +00:00
Converges the no-Tailwind work from make/canonical-verbs onto main's
@hanzo/design token direction. Both sides were right about different things and
neither built on the other, so this takes main as the base and mines the branch.
The dependency set is now @hanzo/ui ^8.0.47 + @hanzo/gui ^8.0.2 + @hanzo/design
^0.4.6 + @hanzogui/shell ^8.0.6. Tailwind is gone from the tree, not just from
the source: @radix-ui 425 lockfile lines -> 0, tailwindcss 66 -> 0,
tailwind-merge 4 -> 0, @tailwindcss/postcss 3 -> 0. postcss.config.mjs and
lib/cn.ts are deleted; nothing imported cn any more. TypeScript stays at 5.9.3
and Next at 16.2.1 — the branch had moved both, and TS 7 takes the build down.
Three things the branch got wrong, fixed here rather than carried:
* `@hanzo/ui/styles.css` inlines @hanzo/design's ladder and then, ~160KB
later, the @hanzogui theme runtime emits a BARE `:root` re-declaring
--background as var(--t189) = hsla(0,0%,97%). Same specificity, so it wins,
and dark mode renders a #f7f7f7 ground under #fafafa ink. White on white,
with a green build, a green type-check and gui-css-check at 100% — none of
them resolve a custom property. app/global.css re-imports design's
colors.css LAST to put the ladder back on top.
* The brand triple aliased design's --brand family, which does not restate
under `.light`. A primary button was therefore light grey on a white page
with a hover one shade off itself. It aliases --primary now, which is the
ink of the current theme, so it inverts with everything else.
* next/font/google mints a scoped family name (`__Geist_Mono_abc123`) and
binds it to --font-mono. @hanzo/ui's `.mono` asks for the literal family
'Geist Mono', so it never matched and every money figure fell back to
ui-monospace — still monospace, still tabular, wrong face, invisible in a
screenshot. @hanzo/design self-hosts both faces and 8.0.47 deliberately
dropped its duplicate @font-face, so design's fonts.css is the one owner
and layout.tsx no longer loads fonts at all.
Money is tabular where money is shown: the local `.font-mono` (which spelled
ui-monospace and set no numeric variant) and `.tabular-nums` are deleted in
favour of ui's `mono` and `tnum`, and 25 numeric cells carry `mono`.
BillingSection loses cost/members/business/tax. Those four panels render INSIDE
usage, team and settings — they are not destinations, and naming them made
SECTION_TITLES incomplete. The branch's fix was to invent four titles, which
taught getInitialSection that `#cost` is a valid hash: it passes the
`hash in SECTION_TITLES` test, sets a section no case matches, and the content
area renders nothing. A section is a place you can navigate to.
Preserved from main: the PCI work — scripts/pci-scope.mjs stays the `lint`
script and hosted fields stay the only card entry path. One mined hunk was
dropped for that reason: 7dd9b0f touched the raw-PAN CardForm that main had
already deleted, and taking it would have resurrected a cc-number input.
Verified on real 8.0.47 from npm, no shim:
build Turbopack, compiled successfully, 12 static pages
lint 55 source files + 482 bundle chunks clean, SAQ-A intact
typecheck tsc --noEmit, exit 0
css-check 40 rendered pages (390 + 1280, both themes, all ten sections,
commerce mocked so the tables populate) — 218/218 classes, zero
misses. Wired as `postbuild`.
browser 44 money cells, 0 wrong: every one "Geist Mono" + tabular-nums,
with document.fonts.check() true for both faces and both woff2
emitted to /_next/static/media/. Theme inverts: dark ground
rgb(10,10,10) / ink rgb(250,250,250); light ground
rgb(255,255,255) / ink rgb(10,10,10). No horizontal overflow at
390, nothing clipped.
Co-authored-by: Hanzo Dev <[email protected]>
49 lines
2.3 KiB
Makefile
49 lines
2.3 KiB
Makefile
# @hanzo/billing — the billing surface (Next.js). package.json pins
|
|
# `packageManager: [email protected]` and the committed pnpm-lock.yaml agrees, so pnpm
|
|
# is the one package manager here. Targets call billing's own scripts wherever
|
|
# those scripts actually run.
|
|
|
|
PNPM ?= pnpm
|
|
|
|
.PHONY: help build test lint typecheck dev clean
|
|
|
|
help: ## Show this help.
|
|
@awk 'BEGIN{FS=":.*##";printf "\nUsage: make <target>\n\nTargets:\n"} /^[a-zA-Z_-]+:.*##/{printf " \033[36m%-16s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
|
|
|
build: node_modules ## Build the Next.js app (next build).
|
|
$(PNPM) build
|
|
|
|
# billing ships NO tests — no `test` script, no spec files, no runner. The
|
|
# target exists because the fleet vocabulary promises it, and it exits 0 because
|
|
# nothing failed: a red exit would claim a suite ran and broke, which is the
|
|
# opposite lie. It says so on every run, so a green line here is never read as
|
|
# coverage. Delete this recipe the day the repo grows a real suite.
|
|
test: ## No test suite in this repo — says so, exits 0.
|
|
@echo ">> billing has NO tests (no test script, no spec files). Green here is not coverage."
|
|
|
|
# Two real static checks, both required. `pnpm lint` is scripts/pci-scope.mjs —
|
|
# the SAQ-A boundary, scanned against the source AND the built bundle, so it
|
|
# needs `build` to have run or it refuses to pass on an empty scan. typecheck is
|
|
# tsc --noEmit. Neither subsumes the other: one asks whether a raw PAN can reach
|
|
# first-party JS, the other whether the types hold.
|
|
lint: typecheck ## Static checks — tsc --noEmit, then the PCI scope scan.
|
|
$(PNPM) lint
|
|
|
|
typecheck: node_modules ## tsc --noEmit.
|
|
$(PNPM) typecheck
|
|
|
|
dev: node_modules ## Dev server on :3005.
|
|
$(PNPM) dev
|
|
|
|
node_modules: ## Install deps (pnpm install --frozen-lockfile).
|
|
$(PNPM) install --frozen-lockfile
|
|
|
|
# Deliberately NOT `$(PNPM) clean`. That script is `rimraf .next out`, but rimraf
|
|
# is not a declared dependency and is not installed, so it dies with "rimraf: not
|
|
# found" — it has never run from a clean install. Same two paths, spelled a way
|
|
# that works. next-env.d.ts is excluded on purpose: it is TRACKED in this repo
|
|
# and tsconfig `include`s it, so deleting it would both dirty the tree and break
|
|
# typecheck. node_modules is never touched — dropping it is a reinstall.
|
|
clean: ## Remove build output (.next, out, *.tsbuildinfo).
|
|
rm -rf .next out *.tsbuildinfo
|