Docker / build (push) Failing after 1m43s
Import this repo's components into a Claude Design project so the design
agent builds with the real Cloudrite library instead of generic components.
The repo is a Next.js app, not a component library: no dist/, no exports
map, no .d.ts tree, and Tailwind exists only as build directives. So
.design-sync/ carries a small build that manufactures a consumable package
from source (staged to the gitignored .ds-pkg/):
- tsconfig.dts.json declaration emit, for real <Name>Props contracts
- build-css.mjs Tailwind v4 -> a static stylesheet via @tailwindcss/postcss
- make-pkg.mjs stages the package; index.js exports all 292 symbols
while index.d.ts exports only the 61 roots, so shadcn's
flat compound parts don't each become a preview card.
Also generates the per-root parts tables in docs/
- shims/next-link router-free anchor; the real next/link needs
AppRouterContext and drags in the App Router runtime
- fonts/ Space Grotesk + Inter woff2 (SIL OFL). next/font supplies
these at runtime in the app, so the bundle has none
previews/ holds 40 authored preview stories, conventions.md is prepended to
the generated README as the design agent's usage guide, and NOTES.md records
the gotchas a future sync would otherwise rediscover.
Co-Authored-By: Claude Opus 5 <[email protected]>
28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
#!/usr/bin/env node
|
|
// Compile .design-sync/tailwind-entry.css → .design-sync/compiled.css.
|
|
//
|
|
// The repo only depends on @tailwindcss/postcss (Next drives it through
|
|
// postcss.config.mjs), not @tailwindcss/cli — so this runs the same plugin
|
|
// directly rather than adding a devDependency just for the sync.
|
|
//
|
|
// Re-run before every package-build.mjs: Tailwind generates utilities by
|
|
// scanning sources, and newly authored .design-sync/previews/*.tsx introduce
|
|
// classes that aren't in the previous compile.
|
|
//
|
|
// node .design-sync/build-css.mjs
|
|
|
|
import { readFileSync, writeFileSync } from 'node:fs';
|
|
import { dirname, resolve } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import postcss from 'postcss';
|
|
import tailwind from '@tailwindcss/postcss';
|
|
|
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
const from = resolve(HERE, 'tailwind-entry.css');
|
|
const to = resolve(HERE, 'compiled.css');
|
|
|
|
const result = await postcss([tailwind()]).process(readFileSync(from, 'utf8'), { from, to });
|
|
for (const w of result.warnings()) console.error(`! ${w.toString()}`);
|
|
writeFileSync(to, result.css);
|
|
console.error(`css: ${(result.css.length / 1024).toFixed(0)} KB → ${to}`);
|