@@ -24,27 +24,24 @@ points. There is no CLI, no component generator and no docs site, and that is de
2424
2525## The build
2626
27- ` bun run build ` is four steps and a gate , joined by ` && ` , in order:
27+ ` bun run build ` is three steps, joined by ` && ` , in order:
2828
2929| Step | Tool | Output |
3030| --- | --- | --- |
3131| ` generate ` | ` scripts/generate-exports.mjs ` | ` src/index.ts ` and the ` exports ` map in ` package.json ` |
32- | ` build:js ` | SWC | ` dist/**/*.js ` , one per source file |
33- | ` build:types ` | ` tsc -p tsconfig.build.json ` | ` dist/**/*.d.ts ` |
32+ | ` build:js ` | ` tsc -p tsconfig.build.json ` | ` dist/**/*.js ` and ` dist/**/*.d.ts ` , one per source file |
3433| ` build:css ` | Tailwind v4 CLI | ` dist/styles.css ` , plus ` dist/theme.css ` copied from source |
35- | ` contrast-test ` | ` scripts/contrast-test.mjs ` | the gate — reads ` dist/styles.css ` |
3634
37- SWC does the JavaScript because it is fast and per-file; ` tsc ` does the declarations
38- because SWC does not emit them. Nothing bundles, so nothing can merge two modules into
39- one chunk. ` prepack ` runs the whole thing, so a failing gate cannot be packed or
40- published.
35+ ` tsc ` emits the JavaScript and the declarations in one pass. Nothing bundles, so nothing
36+ can merge two modules into one chunk. ` prepack ` runs the build, so npm publishes a fresh
37+ ` dist/ ` . The gates (` contrast-test ` , ` dep-guard ` ) run in CI after the build.
4138
4239Source imports are relative and carry ` .js ` extensions. There is no path alias, so the
4340emitted files are valid ESM for Node as well as for every bundler.
4441
4542Every component module that calls a hook, creates a context, defines an inline event
4643handler, or imports an optional peer (Radix dialog, dropdown-menu or tooltip, or
47- ` sonner ` ) starts with ` "use client" ` , and SWC carries the directive into ` dist/ ` . A React Server Components consumer renders any
44+ ` sonner ` ) starts with ` "use client" ` , and ` tsc ` carries the directive into ` dist/ ` . A React Server Components consumer renders any
4845component directly; stateless components stay server-renderable. Plain-React bundlers
4946ignore the directive. ` dep-guard ` enforces the rule, and checks ` dist/ ` after a build.
5047
@@ -118,7 +115,7 @@ provider; every other component does not.
118115
119116### Contrast is gated
120117
121- ` contrast-test ` is the last step of the build. It parses the ** built** ` dist/styles.css `
118+ ` contrast-test ` runs in CI after the build. It parses the ** built** ` dist/styles.css `
122119for the ` :root ` and ` .dark ` custom properties and derives its pairs from token * names* ,
123120never from listed hexes, so a new ` --warning ` / ` --warning-foreground ` is covered on the
124121next run with no edit. Six rules:
0 commit comments