@bison-lab/create-theme 3.3.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +61 -130
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,8 @@ import pc from "picocolors";
|
|
|
4
4
|
import { execSync } from "child_process";
|
|
5
5
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
6
6
|
import { dirname, join, relative, resolve } from "path";
|
|
7
|
-
import { buildThemeCss, isThemeHex } from "@bison-lab/tokens";
|
|
7
|
+
import { buildThemeCss, isThemeHex, presetHints } from "@bison-lab/tokens";
|
|
8
|
+
import { catalog, findFontByFamily, isFontId } from "@bison-lab/fonts";
|
|
8
9
|
//#region src/preview.ts
|
|
9
10
|
function hexToRgb(hex) {
|
|
10
11
|
hex = hex.replace("#", "");
|
|
@@ -22,6 +23,23 @@ function previewHexColor(hex) {
|
|
|
22
23
|
//#region src/prompts.ts
|
|
23
24
|
/** The same rule `buildThemeCss` enforces, so the CLI never writes a config the derivation refuses. */
|
|
24
25
|
const isValidHex = isThemeHex;
|
|
26
|
+
function hintOptions(hints) {
|
|
27
|
+
return Object.entries(hints).map(([value, { label, hint }]) => ({
|
|
28
|
+
value,
|
|
29
|
+
label,
|
|
30
|
+
hint
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The catalogue id to preselect for a stored value: the id itself, the id
|
|
35
|
+
* of a legacy family name (a config written before the catalogue), else
|
|
36
|
+
* the fallback.
|
|
37
|
+
*/
|
|
38
|
+
function catalogueId(stored, fallback) {
|
|
39
|
+
if (!stored) return fallback;
|
|
40
|
+
if (isFontId(stored)) return stored;
|
|
41
|
+
return findFontByFamily(stored)?.id ?? fallback;
|
|
42
|
+
}
|
|
25
43
|
async function runPrompts(existing) {
|
|
26
44
|
p.log.info(pc.bold("Brand Colors"));
|
|
27
45
|
if (existing) p.log.message(`Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)} Highlight ${previewHexColor(existing.brandHighlight)} Success ${previewHexColor(existing.brandSuccess)}`);
|
|
@@ -69,33 +87,7 @@ async function runPrompts(existing) {
|
|
|
69
87
|
const greyScale = await p.select({
|
|
70
88
|
message: "Grey palette for borders, text, backgrounds",
|
|
71
89
|
initialValue: existing?.greyScale ?? "slate",
|
|
72
|
-
options:
|
|
73
|
-
{
|
|
74
|
-
value: "slate",
|
|
75
|
-
label: "Slate",
|
|
76
|
-
hint: "Cool blue-grey — modern, tech-forward"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
value: "gray",
|
|
80
|
-
label: "Gray",
|
|
81
|
-
hint: "Balanced blue-grey — neutral default"
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
value: "zinc",
|
|
85
|
-
label: "Zinc",
|
|
86
|
-
hint: "Cool desaturated — minimal, sharp"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
value: "neutral",
|
|
90
|
-
label: "Neutral",
|
|
91
|
-
hint: "Pure grey — zero hue bias"
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
value: "stone",
|
|
95
|
-
label: "Stone",
|
|
96
|
-
hint: "Warm earthy grey — organic, approachable"
|
|
97
|
-
}
|
|
98
|
-
]
|
|
90
|
+
options: hintOptions(presetHints.greyScale)
|
|
99
91
|
});
|
|
100
92
|
if (p.isCancel(greyScale)) return null;
|
|
101
93
|
const darkSelector = await p.select({
|
|
@@ -123,123 +115,43 @@ async function runPrompts(existing) {
|
|
|
123
115
|
const defaultTheme = await p.select({
|
|
124
116
|
message: "Default theme mode",
|
|
125
117
|
initialValue: existing?.defaultTheme ?? "system",
|
|
126
|
-
options:
|
|
127
|
-
{
|
|
128
|
-
value: "system",
|
|
129
|
-
label: "System",
|
|
130
|
-
hint: "Follow OS preference (recommended)"
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
value: "light",
|
|
134
|
-
label: "Light",
|
|
135
|
-
hint: "Always start in light mode"
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
value: "dark",
|
|
139
|
-
label: "Dark",
|
|
140
|
-
hint: "Always start in dark mode"
|
|
141
|
-
}
|
|
142
|
-
]
|
|
118
|
+
options: hintOptions(presetHints.defaultTheme)
|
|
143
119
|
});
|
|
144
120
|
if (p.isCancel(defaultTheme)) return null;
|
|
145
121
|
const radius = await p.select({
|
|
146
122
|
message: "Border radius preset",
|
|
147
123
|
initialValue: existing?.radius ?? "rounded",
|
|
148
|
-
options:
|
|
149
|
-
{
|
|
150
|
-
value: "sharp",
|
|
151
|
-
label: "Sharp",
|
|
152
|
-
hint: "0px — square corners"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
value: "subtle",
|
|
156
|
-
label: "Subtle",
|
|
157
|
-
hint: "6px — barely rounded"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
value: "rounded",
|
|
161
|
-
label: "Rounded",
|
|
162
|
-
hint: "8px — balanced (default)"
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
value: "pill",
|
|
166
|
-
label: "Pill",
|
|
167
|
-
hint: "12px — soft, bubbly"
|
|
168
|
-
}
|
|
169
|
-
]
|
|
124
|
+
options: hintOptions(presetHints.radius)
|
|
170
125
|
});
|
|
171
126
|
if (p.isCancel(radius)) return null;
|
|
172
127
|
const shadow = await p.select({
|
|
173
128
|
message: "Shadow preset",
|
|
174
129
|
initialValue: existing?.shadow ?? "subtle",
|
|
175
|
-
options:
|
|
176
|
-
{
|
|
177
|
-
value: "flat",
|
|
178
|
-
label: "Flat",
|
|
179
|
-
hint: "No shadows — clean, modern"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
value: "subtle",
|
|
183
|
-
label: "Subtle",
|
|
184
|
-
hint: "Soft low-opacity shadows (default)"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
value: "elevated",
|
|
188
|
-
label: "Elevated",
|
|
189
|
-
hint: "Prominent layered shadows"
|
|
190
|
-
}
|
|
191
|
-
]
|
|
130
|
+
options: hintOptions(presetHints.shadow)
|
|
192
131
|
});
|
|
193
132
|
if (p.isCancel(shadow)) return null;
|
|
194
133
|
const motion = await p.select({
|
|
195
134
|
message: "Motion preset",
|
|
196
135
|
initialValue: existing?.motion ?? "smooth",
|
|
197
|
-
options:
|
|
198
|
-
{
|
|
199
|
-
value: "snappy",
|
|
200
|
-
label: "Snappy",
|
|
201
|
-
hint: "Fast, spring-like (150ms)"
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
value: "smooth",
|
|
205
|
-
label: "Smooth",
|
|
206
|
-
hint: "Balanced ease-out (200ms, default)"
|
|
207
|
-
},
|
|
208
|
-
{
|
|
209
|
-
value: "minimal",
|
|
210
|
-
label: "Minimal",
|
|
211
|
-
hint: "Barely-there, linear (100ms)"
|
|
212
|
-
}
|
|
213
|
-
]
|
|
136
|
+
options: hintOptions(presetHints.motion)
|
|
214
137
|
});
|
|
215
138
|
if (p.isCancel(motion)) return null;
|
|
216
139
|
const density = await p.select({
|
|
217
140
|
message: "Component density",
|
|
218
141
|
initialValue: existing?.density ?? "default",
|
|
219
|
-
options:
|
|
220
|
-
{
|
|
221
|
-
value: "compact",
|
|
222
|
-
label: "Compact",
|
|
223
|
-
hint: "Tight padding, smaller components"
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
value: "default",
|
|
227
|
-
label: "Default",
|
|
228
|
-
hint: "Balanced spacing"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
value: "spacious",
|
|
232
|
-
label: "Spacious",
|
|
233
|
-
hint: "Generous padding, larger components"
|
|
234
|
-
}
|
|
235
|
-
]
|
|
142
|
+
options: hintOptions(presetHints.density)
|
|
236
143
|
});
|
|
237
144
|
if (p.isCancel(density)) return null;
|
|
238
145
|
p.log.info(pc.bold("Typography"));
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
146
|
+
const fontOptions = catalog.map((font) => ({
|
|
147
|
+
value: font.id,
|
|
148
|
+
label: font.family,
|
|
149
|
+
hint: font.hint
|
|
150
|
+
}));
|
|
151
|
+
const fontBody = await p.select({
|
|
152
|
+
message: "Body font",
|
|
153
|
+
initialValue: catalogueId(existing?.fontBody, "inter"),
|
|
154
|
+
options: fontOptions
|
|
243
155
|
});
|
|
244
156
|
if (p.isCancel(fontBody)) return null;
|
|
245
157
|
const wantsHeading = await p.confirm({
|
|
@@ -249,10 +161,10 @@ async function runPrompts(existing) {
|
|
|
249
161
|
if (p.isCancel(wantsHeading)) return null;
|
|
250
162
|
let fontHeading = null;
|
|
251
163
|
if (wantsHeading) {
|
|
252
|
-
const heading = await p.
|
|
253
|
-
message: "Heading font
|
|
254
|
-
|
|
255
|
-
|
|
164
|
+
const heading = await p.select({
|
|
165
|
+
message: "Heading font",
|
|
166
|
+
initialValue: catalogueId(existing?.fontHeading, "playfair-display"),
|
|
167
|
+
options: fontOptions
|
|
256
168
|
});
|
|
257
169
|
if (p.isCancel(heading)) return null;
|
|
258
170
|
fontHeading = heading;
|
|
@@ -325,8 +237,8 @@ async function runPrompts(existing) {
|
|
|
325
237
|
* (`buildThemeCss`) so this file, `BisonProvider` and a CMS theme rendered at
|
|
326
238
|
* request time all agree; the CLI only writes the result to disk.
|
|
327
239
|
*/
|
|
328
|
-
function generateThemeCSS(config) {
|
|
329
|
-
return buildThemeCss(config);
|
|
240
|
+
function generateThemeCSS(config, options) {
|
|
241
|
+
return buildThemeCss(config, options);
|
|
330
242
|
}
|
|
331
243
|
function generateTailwindConfig() {
|
|
332
244
|
return [
|
|
@@ -349,8 +261,23 @@ function generateImports(themeImportPath) {
|
|
|
349
261
|
const BISON_PACKAGES = [
|
|
350
262
|
"@bison-lab/tokens",
|
|
351
263
|
"@bison-lab/ui",
|
|
352
|
-
"@bison-lab/tailwind-preset"
|
|
264
|
+
"@bison-lab/tailwind-preset",
|
|
265
|
+
"@bison-lab/fonts"
|
|
353
266
|
];
|
|
267
|
+
/**
|
|
268
|
+
* The theme CSS carries the `@font-face` rules for the chosen families under
|
|
269
|
+
* `/fonts`; this is the route that answers them, and the config line that
|
|
270
|
+
* keeps the package's font files reachable from the route.
|
|
271
|
+
*/
|
|
272
|
+
const FONT_ROUTE_SNIPPET = [
|
|
273
|
+
`// app/fonts/[...path]/route.ts`,
|
|
274
|
+
`import { serveFont } from "@bison-lab/fonts/server";`,
|
|
275
|
+
`export const GET = serveFont;`,
|
|
276
|
+
`export const HEAD = serveFont;`,
|
|
277
|
+
``,
|
|
278
|
+
`// next.config.ts`,
|
|
279
|
+
`// serverExternalPackages: ["@bison-lab/fonts"],`
|
|
280
|
+
].join("\n");
|
|
354
281
|
function copyToClipboard(text) {
|
|
355
282
|
try {
|
|
356
283
|
const platform = process.platform;
|
|
@@ -489,7 +416,7 @@ async function main() {
|
|
|
489
416
|
} else p.log.success("Bison Lab packages already installed.");
|
|
490
417
|
const s = p.spinner();
|
|
491
418
|
s.start("Generating theme files...");
|
|
492
|
-
const themeCSS = generateThemeCSS(config);
|
|
419
|
+
const themeCSS = generateThemeCSS(config, { fontsBaseUrl: "/fonts" });
|
|
493
420
|
const themePath = resolve(outDir, THEME_FILE);
|
|
494
421
|
writeFileSync(themePath, themeCSS, "utf-8");
|
|
495
422
|
writeFileSync(configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
@@ -542,6 +469,10 @@ async function main() {
|
|
|
542
469
|
if (!p.isCancel(action) && action === "copy") if (copyToClipboard(importsSnippet)) p.log.success("Copied CSS imports to clipboard!");
|
|
543
470
|
else p.log.warning("Could not access clipboard — copy manually from above.");
|
|
544
471
|
}
|
|
472
|
+
const routePath = resolve(outDir, "app/fonts/[...path]/route.ts");
|
|
473
|
+
const srcRoutePath = resolve(outDir, "src/app/fonts/[...path]/route.ts");
|
|
474
|
+
if (existsSync(routePath) || existsSync(srcRoutePath)) p.log.success("Font route already exists.");
|
|
475
|
+
else p.note(FONT_ROUTE_SNIPPET, "Serve the fonts: add this route");
|
|
545
476
|
p.outro(pc.green("Done! Your Bison Lab theme is ready."));
|
|
546
477
|
}
|
|
547
478
|
main().catch(console.error);
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/preview.ts","../src/prompts.ts","../src/generate.ts","../src/index.ts"],"sourcesContent":["import pc from \"picocolors\";\n\nexport function hexToRgb(hex: string): [number, number, number] {\n hex = hex.replace(\"#\", \"\");\n return [\n parseInt(hex.substring(0, 2), 16),\n parseInt(hex.substring(2, 4), 16),\n parseInt(hex.substring(4, 6), 16),\n ];\n}\n\nexport function previewHexColor(hex: string): string {\n const [r, g, b] = hexToRgb(hex);\n // Use ANSI 24-bit color for background\n return `\\x1b[48;2;${r};${g};${b}m \\x1b[0m ${pc.dim(hex)}`;\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { isThemeHex, type GreyScale, type ThemeConfig } from \"@bison-lab/tokens\";\nimport { previewHexColor } from \"./preview\";\n\n/** The `bison.config.json` shape. Lives in `@bison-lab/tokens` so the derivation and the CLI share it. */\nexport type { ThemeConfig, GreyScale };\n\n/** The same rule `buildThemeCss` enforces, so the CLI never writes a config the derivation refuses. */\nconst isValidHex = isThemeHex;\n\nexport async function runPrompts(existing?: ThemeConfig): Promise<ThemeConfig | null> {\n // Brand colors\n p.log.info(pc.bold(\"Brand Colors\"));\n\n if (existing) {\n p.log.message(\n `Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)} Highlight ${previewHexColor(existing.brandHighlight)} Success ${previewHexColor(existing.brandSuccess)}`\n );\n }\n\n const brandPrimary = await p.text({\n message: \"Primary brand color (hex)\",\n placeholder: \"#1e3a5f\",\n ...(existing?.brandPrimary && { defaultValue: existing.brandPrimary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #1e3a5f)\" : undefined),\n });\n if (p.isCancel(brandPrimary)) return null;\n\n p.log.message(` ${previewHexColor(brandPrimary as string)} Primary`);\n\n const brandSecondary = await p.text({\n message: \"Secondary brand color (hex)\",\n placeholder: \"#2d9d6e\",\n ...(existing?.brandSecondary && { defaultValue: existing.brandSecondary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #2d9d6e)\" : undefined),\n });\n if (p.isCancel(brandSecondary)) return null;\n\n p.log.message(` ${previewHexColor(brandSecondary as string)} Secondary`);\n\n const brandAccent = await p.text({\n message: \"Accent color (hex)\",\n placeholder: \"#e89b20\",\n ...(existing?.brandAccent && { defaultValue: existing.brandAccent }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #e89b20)\" : undefined),\n });\n if (p.isCancel(brandAccent)) return null;\n\n p.log.message(` ${previewHexColor(brandAccent as string)} Accent`);\n\n const brandHighlight = await p.text({\n message: \"Highlight color (hex)\",\n placeholder: \"#7c3aed\",\n ...(existing?.brandHighlight && { defaultValue: existing.brandHighlight }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #7c3aed)\" : undefined),\n });\n if (p.isCancel(brandHighlight)) return null;\n\n p.log.message(` ${previewHexColor(brandHighlight as string)} Highlight`);\n\n const brandSuccess = await p.text({\n message: \"Success color (hex)\",\n placeholder: \"#22c55e\",\n ...(existing?.brandSuccess && { defaultValue: existing.brandSuccess }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #22c55e)\" : undefined),\n });\n if (p.isCancel(brandSuccess)) return null;\n\n p.log.message(` ${previewHexColor(brandSuccess as string)} Success`);\n\n // Grey scale\n p.log.info(pc.bold(\"Grey Scale\"));\n\n const greyScale = await p.select({\n message: \"Grey palette for borders, text, backgrounds\",\n initialValue: existing?.greyScale ?? \"slate\",\n options: [\n { value: \"slate\" as const, label: \"Slate\", hint: \"Cool blue-grey — modern, tech-forward\" },\n { value: \"gray\" as const, label: \"Gray\", hint: \"Balanced blue-grey — neutral default\" },\n { value: \"zinc\" as const, label: \"Zinc\", hint: \"Cool desaturated — minimal, sharp\" },\n { value: \"neutral\" as const, label: \"Neutral\", hint: \"Pure grey — zero hue bias\" },\n { value: \"stone\" as const, label: \"Stone\", hint: \"Warm earthy grey — organic, approachable\" },\n ],\n });\n if (p.isCancel(greyScale)) return null;\n\n // Dark mode selector\n const darkSelector = await p.select({\n message: \"Dark mode CSS selector\",\n initialValue: existing?.darkSelector ?? '[data-theme=\"dark\"]',\n options: [\n { value: '[data-theme=\"dark\"]' as const, label: '[data-theme=\"dark\"]', hint: \"Attribute selector — works with class & attribute strategies (recommended)\" },\n { value: \".dark\" as const, label: \".dark\", hint: \"Class selector — Tailwind default\" },\n { value: \"@media\" as const, label: \"@media (prefers-color-scheme: dark)\", hint: \"System preference — no JS needed\" },\n ],\n });\n if (p.isCancel(darkSelector)) return null;\n\n // Default theme\n const defaultTheme = await p.select({\n message: \"Default theme mode\",\n initialValue: existing?.defaultTheme ?? \"system\",\n options: [\n { value: \"system\" as const, label: \"System\", hint: \"Follow OS preference (recommended)\" },\n { value: \"light\" as const, label: \"Light\", hint: \"Always start in light mode\" },\n { value: \"dark\" as const, label: \"Dark\", hint: \"Always start in dark mode\" },\n ],\n });\n if (p.isCancel(defaultTheme)) return null;\n\n // Radius\n const radius = await p.select({\n message: \"Border radius preset\",\n initialValue: existing?.radius ?? \"rounded\",\n options: [\n { value: \"sharp\" as const, label: \"Sharp\", hint: \"0px — square corners\" },\n { value: \"subtle\" as const, label: \"Subtle\", hint: \"6px — barely rounded\" },\n { value: \"rounded\" as const, label: \"Rounded\", hint: \"8px — balanced (default)\" },\n { value: \"pill\" as const, label: \"Pill\", hint: \"12px — soft, bubbly\" },\n ],\n });\n if (p.isCancel(radius)) return null;\n\n // Shadow\n const shadow = await p.select({\n message: \"Shadow preset\",\n initialValue: existing?.shadow ?? \"subtle\",\n options: [\n { value: \"flat\" as const, label: \"Flat\", hint: \"No shadows — clean, modern\" },\n { value: \"subtle\" as const, label: \"Subtle\", hint: \"Soft low-opacity shadows (default)\" },\n { value: \"elevated\" as const, label: \"Elevated\", hint: \"Prominent layered shadows\" },\n ],\n });\n if (p.isCancel(shadow)) return null;\n\n // Motion\n const motion = await p.select({\n message: \"Motion preset\",\n initialValue: existing?.motion ?? \"smooth\",\n options: [\n { value: \"snappy\" as const, label: \"Snappy\", hint: \"Fast, spring-like (150ms)\" },\n { value: \"smooth\" as const, label: \"Smooth\", hint: \"Balanced ease-out (200ms, default)\" },\n { value: \"minimal\" as const, label: \"Minimal\", hint: \"Barely-there, linear (100ms)\" },\n ],\n });\n if (p.isCancel(motion)) return null;\n\n // Density\n const density = await p.select({\n message: \"Component density\",\n initialValue: existing?.density ?? \"default\",\n options: [\n { value: \"compact\" as const, label: \"Compact\", hint: \"Tight padding, smaller components\" },\n { value: \"default\" as const, label: \"Default\", hint: \"Balanced spacing\" },\n { value: \"spacious\" as const, label: \"Spacious\", hint: \"Generous padding, larger components\" },\n ],\n });\n if (p.isCancel(density)) return null;\n\n // Font\n p.log.info(pc.bold(\"Typography\"));\n\n const fontBody = await p.text({\n message: \"Body font family\",\n placeholder: \"Inter\",\n defaultValue: existing?.fontBody ?? \"Inter\",\n });\n if (p.isCancel(fontBody)) return null;\n\n const wantsHeading = await p.confirm({\n message: \"Use a separate display/heading font?\",\n initialValue: existing?.fontHeading != null,\n });\n if (p.isCancel(wantsHeading)) return null;\n\n let fontHeading: string | null = null;\n if (wantsHeading) {\n const heading = await p.text({\n message: \"Heading font family\",\n placeholder: \"Playfair Display\",\n ...(existing?.fontHeading && { defaultValue: existing.fontHeading }),\n });\n if (p.isCancel(heading)) return null;\n fontHeading = heading as string;\n }\n\n // Font weights\n const customizeWeights = await p.confirm({\n message: \"Customize font weights? (default: 400/500/600/700)\",\n initialValue: false,\n });\n if (p.isCancel(customizeWeights)) return null;\n\n let fontWeights = existing?.fontWeights ?? { normal: 400, medium: 500, semibold: 600, bold: 700 };\n\n if (customizeWeights) {\n const normal = await p.text({\n message: \"Normal weight\",\n defaultValue: String(fontWeights.normal),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(normal)) return null;\n\n const medium = await p.text({\n message: \"Medium weight\",\n defaultValue: String(fontWeights.medium),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(medium)) return null;\n\n const semibold = await p.text({\n message: \"Semibold weight\",\n defaultValue: String(fontWeights.semibold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(semibold)) return null;\n\n const bold = await p.text({\n message: \"Bold weight\",\n defaultValue: String(fontWeights.bold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(bold)) return null;\n\n fontWeights = {\n normal: Number(normal),\n medium: Number(medium),\n semibold: Number(semibold),\n bold: Number(bold),\n };\n }\n\n return {\n brandPrimary: brandPrimary as string,\n brandSecondary: brandSecondary as string,\n brandAccent: brandAccent as string,\n brandHighlight: brandHighlight as string,\n brandSuccess: brandSuccess as string,\n greyScale: greyScale as GreyScale,\n darkSelector: darkSelector as string,\n defaultTheme: defaultTheme as ThemeConfig[\"defaultTheme\"],\n radius: radius as ThemeConfig[\"radius\"],\n shadow: shadow as ThemeConfig[\"shadow\"],\n motion: motion as ThemeConfig[\"motion\"],\n density: density as ThemeConfig[\"density\"],\n fontBody: fontBody as string,\n fontHeading,\n fontWeights,\n };\n}\n","import { buildThemeCss, type ThemeConfig } from \"@bison-lab/tokens\";\n\n/**\n * `bison-theme.css` for a config. The derivation lives in `@bison-lab/tokens`\n * (`buildThemeCss`) so this file, `BisonProvider` and a CMS theme rendered at\n * request time all agree; the CLI only writes the result to disk.\n */\nexport function generateThemeCSS(config: ThemeConfig): string {\n return buildThemeCss(config);\n}\n\nexport function generateTailwindConfig(): string {\n return [\n `/* Add to your main CSS file (e.g. globals.css): */`,\n `/* @import \"tailwindcss\"; */`,\n `/* @import \"@bison-lab/tailwind-preset/css\"; */`,\n `/* @import \"./bison-theme.css\"; */`,\n ].join(\"\\n\");\n}\n\n/**\n * The layout imports. The theme CSS carries the radius, shadow, motion and\n * density variables itself, so the four preset files are no longer imported;\n * they stay published for consumers composing a theme by hand.\n */\nexport function generateImports(themeImportPath: string): string {\n return [\n `import '@bison-lab/tokens/css/base.css';`,\n `import '${themeImportPath}';`,\n ].join(\"\\n\");\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { execSync } from \"child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { resolve, join, relative, dirname } from \"path\";\nimport { runPrompts, type ThemeConfig } from \"./prompts\";\nimport { generateThemeCSS, generateTailwindConfig, generateImports } from \"./generate\";\n\nconst BISON_PACKAGES = [\n \"@bison-lab/tokens\",\n \"@bison-lab/ui\",\n \"@bison-lab/tailwind-preset\",\n];\n\nfunction copyToClipboard(text: string): boolean {\n try {\n const platform = process.platform;\n if (platform === \"darwin\") {\n execSync(\"pbcopy\", { input: text });\n } else if (platform === \"linux\") {\n execSync(\"xclip -selection clipboard\", { input: text });\n } else if (platform === \"win32\") {\n execSync(\"clip\", { input: text });\n } else {\n return false;\n }\n return true;\n } catch {\n return false;\n }\n}\n\nfunction detectPackageManager(): \"pnpm\" | \"npm\" | \"yarn\" | \"bun\" {\n const cwd = process.cwd();\n if (existsSync(join(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (existsSync(join(cwd, \"bun.lockb\")) || existsSync(join(cwd, \"bun.lock\"))) return \"bun\";\n if (existsSync(join(cwd, \"yarn.lock\"))) return \"yarn\";\n return \"npm\";\n}\n\nfunction installCommand(pm: \"pnpm\" | \"npm\" | \"yarn\" | \"bun\"): string {\n const pkgs = BISON_PACKAGES.join(\" \");\n switch (pm) {\n case \"pnpm\": return `pnpm add ${pkgs}`;\n case \"yarn\": return `yarn add ${pkgs}`;\n case \"bun\": return `bun add ${pkgs}`;\n default: return `npm install ${pkgs}`;\n }\n}\n\nfunction areBisonPackagesInstalled(): boolean {\n return BISON_PACKAGES.every((pkg) => {\n try {\n const pkgJsonPath = join(process.cwd(), \"node_modules\", pkg, \"package.json\");\n return existsSync(pkgJsonPath);\n } catch {\n return false;\n }\n });\n}\n\nfunction findLayoutFile(baseDir: string): string | null {\n const candidates = [\n \"app/layout.tsx\",\n \"app/layout.jsx\",\n \"src/app/layout.tsx\",\n \"src/app/layout.jsx\",\n ];\n for (const candidate of candidates) {\n const full = resolve(baseDir, candidate);\n if (existsSync(full)) return full;\n }\n return null;\n}\n\nfunction injectImportsIntoLayout(layoutPath: string, imports: string): boolean {\n const content = readFileSync(layoutPath, \"utf-8\");\n\n // Check if already injected\n if (content.includes(\"@bison-lab/tokens/css/base.css\") || content.includes(\"@bison-lab/tokens/css/globals.css\")) {\n return false;\n }\n\n // Match all import statements including multiline ones (e.g. import { \\n Foo,\\n } from \"bar\";)\n const importRegex = /^import\\s[\\s\\S]*?from\\s+['\"][^'\"]+['\"];?\\s*$/gm;\n let lastMatchEnd = -1;\n let match: RegExpExecArray | null;\n\n while ((match = importRegex.exec(content)) !== null) {\n lastMatchEnd = match.index + match[0].length;\n }\n\n if (lastMatchEnd === -1) {\n // No imports found, prepend to file\n writeFileSync(layoutPath, imports + \"\\n\\n\" + content, \"utf-8\");\n } else {\n // Insert after the last import statement\n const before = content.slice(0, lastMatchEnd);\n const after = content.slice(lastMatchEnd);\n writeFileSync(layoutPath, before + \"\\n\\n\" + imports + after, \"utf-8\");\n }\n\n return true;\n}\n\nconst CONFIG_FILE = \"bison.config.json\";\nconst THEME_FILE = \"bison-theme.css\";\n\nasync function main() {\n p.intro(pc.bgCyan(pc.black(\" Bison Lab Theme Generator \")));\n\n // --- Output directory ---\n const outputDir = await p.text({\n message: \"Output directory for generated files\",\n placeholder: \".\",\n defaultValue: \".\",\n validate: (v) => {\n if (!v) return undefined;\n const resolved = resolve(process.cwd(), v);\n if (!existsSync(resolved)) return `Directory does not exist: ${v}`;\n return undefined;\n },\n });\n\n if (p.isCancel(outputDir)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n const outDir = resolve(process.cwd(), outputDir as string);\n\n if (outDir !== process.cwd()) {\n p.log.info(`Output directory: ${pc.cyan(relative(process.cwd(), outDir) || \".\")}`);\n }\n\n const configPath = resolve(outDir, CONFIG_FILE);\n let existingConfig: ThemeConfig | undefined;\n\n if (existsSync(configPath)) {\n const raw = JSON.parse(readFileSync(configPath, \"utf-8\")) as ThemeConfig;\n existingConfig = raw;\n\n const mode = await p.select({\n message: \"An existing theme was found. What would you like to do?\",\n options: [\n { value: \"update\", label: \"Update existing theme\", hint: \"Modify individual properties\" },\n { value: \"fresh\", label: \"Start fresh\", hint: \"Overwrite everything\" },\n ],\n });\n\n if (p.isCancel(mode)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (mode === \"fresh\") {\n existingConfig = undefined;\n }\n }\n\n const config = await runPrompts(existingConfig);\n\n if (!config) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n // --- Install dependencies ---\n if (!areBisonPackagesInstalled()) {\n const pm = detectPackageManager();\n const cmd = installCommand(pm);\n\n const shouldInstall = await p.confirm({\n message: `Install Bison Lab packages? (${pc.dim(cmd)})`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldInstall)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (shouldInstall) {\n const s = p.spinner();\n s.start(`Installing packages with ${pm}...`);\n try {\n execSync(cmd, { cwd: process.cwd(), stdio: \"pipe\" });\n s.stop(\"Packages installed!\");\n } catch (err) {\n s.stop(\"Package installation failed.\");\n p.log.warning(`Run manually: ${pc.cyan(cmd)}`);\n }\n } else {\n p.log.warning(`Skipped. Run manually: ${pc.cyan(installCommand(pm))}`);\n }\n } else {\n p.log.success(\"Bison Lab packages already installed.\");\n }\n\n // --- Generate theme files ---\n const s = p.spinner();\n s.start(\"Generating theme files...\");\n\n const themeCSS = generateThemeCSS(config);\n const themePath = resolve(outDir, THEME_FILE);\n writeFileSync(themePath, themeCSS, \"utf-8\");\n writeFileSync(configPath, JSON.stringify(config, null, 2), \"utf-8\");\n\n s.stop(\"Theme files generated!\");\n\n const outPrefix = outDir === process.cwd() ? \"\" : relative(process.cwd(), outDir) + \"/\";\n p.log.success(`${pc.green(\"Created:\")} ${outPrefix}${THEME_FILE}`);\n p.log.success(`${pc.green(\"Created:\")} ${outPrefix}${CONFIG_FILE}`);\n\n // --- Tailwind config guidance ---\n const tailwindPath = resolve(outDir, \"tailwind.config.ts\");\n const presetSnippet = `import bisonPreset from '@bison-lab/tailwind-preset';\\n\\n// Add to your Tailwind config:\\n// presets: [bisonPreset],\\n// content: [..., './node_modules/@bison-lab/ui/dist/**/*.js'],`;\n\n if (existsSync(tailwindPath)) {\n const existing = readFileSync(tailwindPath, \"utf-8\");\n if (existing.includes(\"@bison-lab/tailwind-preset\")) {\n p.log.success(\"tailwind.config.ts already includes Bison Lab preset.\");\n } else {\n p.note(presetSnippet, \"Add to your tailwind.config.ts\");\n\n const action = await p.select({\n message: \"Add the Bison Lab preset to your existing tailwind.config.ts manually:\",\n options: [\n { value: \"copy\", label: \"Copy snippet to clipboard\" },\n { value: \"skip\", label: \"Skip\", hint: \"I'll handle it\" },\n ],\n });\n\n if (!p.isCancel(action) && action === \"copy\") {\n if (copyToClipboard(presetSnippet)) {\n p.log.success(\"Copied Tailwind preset snippet to clipboard!\");\n } else {\n p.log.warning(\"Could not access clipboard — copy manually from above.\");\n }\n }\n }\n } else {\n // No config exists — safe to create one\n const tailwindConfig = generateTailwindConfig();\n writeFileSync(tailwindPath, tailwindConfig, \"utf-8\");\n p.log.success(`${pc.green(\"Created:\")} ${outPrefix}tailwind.config.ts`);\n }\n\n // --- Layout imports ---\n const layoutPath = findLayoutFile(outDir);\n\n // Compute relative path from layout directory to the theme file\n const themeImportPath = layoutPath\n ? relative(dirname(layoutPath), themePath).replace(/\\\\/g, \"/\")\n : `./${THEME_FILE}`;\n const importsSnippet = generateImports(themeImportPath.startsWith(\".\") ? themeImportPath : `./${themeImportPath}`);\n\n if (layoutPath) {\n const injected = injectImportsIntoLayout(layoutPath, importsSnippet);\n if (injected) {\n const rel = relative(process.cwd(), layoutPath);\n p.log.success(`${pc.green(\"Updated:\")} ${rel} with Bison Lab imports.`);\n } else {\n p.log.success(\"Layout file already includes Bison Lab imports.\");\n }\n } else {\n p.note(importsSnippet, \"app/layout.tsx imports\");\n\n const action = await p.select({\n message: \"No layout file found. Copy imports to clipboard?\",\n options: [\n { value: \"copy\", label: \"Copy to clipboard\" },\n { value: \"skip\", label: \"Skip\" },\n ],\n });\n\n if (!p.isCancel(action) && action === \"copy\") {\n if (copyToClipboard(importsSnippet)) {\n p.log.success(\"Copied CSS imports to clipboard!\");\n } else {\n p.log.warning(\"Could not access clipboard — copy manually from above.\");\n }\n }\n }\n\n p.outro(pc.green(\"Done! Your Bison Lab theme is ready.\"));\n}\n\nmain().catch(console.error);\n"],"mappings":";;;;;;;;AAEA,SAAgB,SAAS,KAAuC;AAC9D,OAAM,IAAI,QAAQ,KAAK,GAAG;AAC1B,QAAO;EACL,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EAClC;;AAGH,SAAgB,gBAAgB,KAAqB;CACnD,MAAM,CAAC,GAAG,GAAG,KAAK,SAAS,IAAI;AAE/B,QAAO,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,IAAI;;;;;ACL1D,MAAM,aAAa;AAEnB,eAAsB,WAAW,UAAqD;AAEpF,GAAE,IAAI,KAAK,GAAG,KAAK,eAAe,CAAC;AAEnC,KAAI,SACF,GAAE,IAAI,QACJ,oBAAoB,gBAAgB,SAAS,aAAa,CA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,gBAAgB,eAAe,CACjC,GAAE,IAAI,QAAQ,mCAAmC;MAEjD,GAAE,IAAI,QAAQ,yDAAyD;;AAK7E,GAAE,MAAM,GAAG,MAAM,uCAAuC,CAAC;;AAG3D,MAAM,CAAC,MAAM,QAAQ,MAAM"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/preview.ts","../src/prompts.ts","../src/generate.ts","../src/index.ts"],"sourcesContent":["import pc from \"picocolors\";\n\nexport function hexToRgb(hex: string): [number, number, number] {\n hex = hex.replace(\"#\", \"\");\n return [\n parseInt(hex.substring(0, 2), 16),\n parseInt(hex.substring(2, 4), 16),\n parseInt(hex.substring(4, 6), 16),\n ];\n}\n\nexport function previewHexColor(hex: string): string {\n const [r, g, b] = hexToRgb(hex);\n // Use ANSI 24-bit color for background\n return `\\x1b[48;2;${r};${g};${b}m \\x1b[0m ${pc.dim(hex)}`;\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { isThemeHex, presetHints, type GreyScale, type ThemeConfig } from \"@bison-lab/tokens\";\nimport { catalog, findFontByFamily, isFontId, type FontId } from \"@bison-lab/fonts\";\nimport { previewHexColor } from \"./preview\";\n\n/** The `bison.config.json` shape. Lives in `@bison-lab/tokens` so the derivation and the CLI share it. */\nexport type { ThemeConfig, GreyScale };\n\n/** The same rule `buildThemeCss` enforces, so the CLI never writes a config the derivation refuses. */\nconst isValidHex = isThemeHex;\n\nfunction hintOptions<K extends string>(hints: Record<K, { label: string; hint: string }>) {\n return (Object.entries(hints) as [K, { label: string; hint: string }][]).map(([value, { label, hint }]) => ({\n value,\n label,\n hint,\n }));\n}\n\n/**\n * The catalogue id to preselect for a stored value: the id itself, the id\n * of a legacy family name (a config written before the catalogue), else\n * the fallback.\n */\nfunction catalogueId(stored: string | null | undefined, fallback: FontId): FontId {\n if (!stored) return fallback;\n if (isFontId(stored)) return stored;\n return findFontByFamily(stored)?.id ?? fallback;\n}\n\nexport async function runPrompts(existing?: ThemeConfig): Promise<ThemeConfig | null> {\n // Brand colors\n p.log.info(pc.bold(\"Brand Colors\"));\n\n if (existing) {\n p.log.message(\n `Current: Primary ${previewHexColor(existing.brandPrimary)} Secondary ${previewHexColor(existing.brandSecondary)} Accent ${previewHexColor(existing.brandAccent)} Highlight ${previewHexColor(existing.brandHighlight)} Success ${previewHexColor(existing.brandSuccess)}`\n );\n }\n\n const brandPrimary = await p.text({\n message: \"Primary brand color (hex)\",\n placeholder: \"#1e3a5f\",\n ...(existing?.brandPrimary && { defaultValue: existing.brandPrimary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #1e3a5f)\" : undefined),\n });\n if (p.isCancel(brandPrimary)) return null;\n\n p.log.message(` ${previewHexColor(brandPrimary as string)} Primary`);\n\n const brandSecondary = await p.text({\n message: \"Secondary brand color (hex)\",\n placeholder: \"#2d9d6e\",\n ...(existing?.brandSecondary && { defaultValue: existing.brandSecondary }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #2d9d6e)\" : undefined),\n });\n if (p.isCancel(brandSecondary)) return null;\n\n p.log.message(` ${previewHexColor(brandSecondary as string)} Secondary`);\n\n const brandAccent = await p.text({\n message: \"Accent color (hex)\",\n placeholder: \"#e89b20\",\n ...(existing?.brandAccent && { defaultValue: existing.brandAccent }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #e89b20)\" : undefined),\n });\n if (p.isCancel(brandAccent)) return null;\n\n p.log.message(` ${previewHexColor(brandAccent as string)} Accent`);\n\n const brandHighlight = await p.text({\n message: \"Highlight color (hex)\",\n placeholder: \"#7c3aed\",\n ...(existing?.brandHighlight && { defaultValue: existing.brandHighlight }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #7c3aed)\" : undefined),\n });\n if (p.isCancel(brandHighlight)) return null;\n\n p.log.message(` ${previewHexColor(brandHighlight as string)} Highlight`);\n\n const brandSuccess = await p.text({\n message: \"Success color (hex)\",\n placeholder: \"#22c55e\",\n ...(existing?.brandSuccess && { defaultValue: existing.brandSuccess }),\n validate: (v) => (!isValidHex(v) ? \"Enter a valid hex color (e.g. #22c55e)\" : undefined),\n });\n if (p.isCancel(brandSuccess)) return null;\n\n p.log.message(` ${previewHexColor(brandSuccess as string)} Success`);\n\n // Grey scale\n p.log.info(pc.bold(\"Grey Scale\"));\n\n const greyScale = await p.select({\n message: \"Grey palette for borders, text, backgrounds\",\n initialValue: existing?.greyScale ?? \"slate\",\n options: hintOptions(presetHints.greyScale),\n });\n if (p.isCancel(greyScale)) return null;\n\n // Dark mode selector\n const darkSelector = await p.select({\n message: \"Dark mode CSS selector\",\n initialValue: existing?.darkSelector ?? '[data-theme=\"dark\"]',\n options: [\n { value: '[data-theme=\"dark\"]' as const, label: '[data-theme=\"dark\"]', hint: \"Attribute selector — works with class & attribute strategies (recommended)\" },\n { value: \".dark\" as const, label: \".dark\", hint: \"Class selector — Tailwind default\" },\n { value: \"@media\" as const, label: \"@media (prefers-color-scheme: dark)\", hint: \"System preference — no JS needed\" },\n ],\n });\n if (p.isCancel(darkSelector)) return null;\n\n // Default theme\n const defaultTheme = await p.select({\n message: \"Default theme mode\",\n initialValue: existing?.defaultTheme ?? \"system\",\n options: hintOptions(presetHints.defaultTheme),\n });\n if (p.isCancel(defaultTheme)) return null;\n\n // Radius\n const radius = await p.select({\n message: \"Border radius preset\",\n initialValue: existing?.radius ?? \"rounded\",\n options: hintOptions(presetHints.radius),\n });\n if (p.isCancel(radius)) return null;\n\n // Shadow\n const shadow = await p.select({\n message: \"Shadow preset\",\n initialValue: existing?.shadow ?? \"subtle\",\n options: hintOptions(presetHints.shadow),\n });\n if (p.isCancel(shadow)) return null;\n\n // Motion\n const motion = await p.select({\n message: \"Motion preset\",\n initialValue: existing?.motion ?? \"smooth\",\n options: hintOptions(presetHints.motion),\n });\n if (p.isCancel(motion)) return null;\n\n // Density\n const density = await p.select({\n message: \"Component density\",\n initialValue: existing?.density ?? \"default\",\n options: hintOptions(presetHints.density),\n });\n if (p.isCancel(density)) return null;\n\n // Font\n p.log.info(pc.bold(\"Typography\"));\n\n const fontOptions = catalog.map((font) => ({ value: font.id, label: font.family, hint: font.hint }));\n const fontBody = await p.select({\n message: \"Body font\",\n initialValue: catalogueId(existing?.fontBody, \"inter\"),\n options: fontOptions,\n });\n if (p.isCancel(fontBody)) return null;\n\n const wantsHeading = await p.confirm({\n message: \"Use a separate display/heading font?\",\n initialValue: existing?.fontHeading != null,\n });\n if (p.isCancel(wantsHeading)) return null;\n\n let fontHeading: FontId | null = null;\n if (wantsHeading) {\n const heading = await p.select({\n message: \"Heading font\",\n initialValue: catalogueId(existing?.fontHeading, \"playfair-display\"),\n options: fontOptions,\n });\n if (p.isCancel(heading)) return null;\n fontHeading = heading as FontId;\n }\n\n // Font weights\n const customizeWeights = await p.confirm({\n message: \"Customize font weights? (default: 400/500/600/700)\",\n initialValue: false,\n });\n if (p.isCancel(customizeWeights)) return null;\n\n let fontWeights = existing?.fontWeights ?? { normal: 400, medium: 500, semibold: 600, bold: 700 };\n\n if (customizeWeights) {\n const normal = await p.text({\n message: \"Normal weight\",\n defaultValue: String(fontWeights.normal),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(normal)) return null;\n\n const medium = await p.text({\n message: \"Medium weight\",\n defaultValue: String(fontWeights.medium),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(medium)) return null;\n\n const semibold = await p.text({\n message: \"Semibold weight\",\n defaultValue: String(fontWeights.semibold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(semibold)) return null;\n\n const bold = await p.text({\n message: \"Bold weight\",\n defaultValue: String(fontWeights.bold),\n validate: (v) => (isNaN(Number(v)) ? \"Must be a number\" : undefined),\n });\n if (p.isCancel(bold)) return null;\n\n fontWeights = {\n normal: Number(normal),\n medium: Number(medium),\n semibold: Number(semibold),\n bold: Number(bold),\n };\n }\n\n return {\n brandPrimary: brandPrimary as string,\n brandSecondary: brandSecondary as string,\n brandAccent: brandAccent as string,\n brandHighlight: brandHighlight as string,\n brandSuccess: brandSuccess as string,\n greyScale: greyScale as GreyScale,\n darkSelector: darkSelector as string,\n defaultTheme: defaultTheme as ThemeConfig[\"defaultTheme\"],\n radius: radius as ThemeConfig[\"radius\"],\n shadow: shadow as ThemeConfig[\"shadow\"],\n motion: motion as ThemeConfig[\"motion\"],\n density: density as ThemeConfig[\"density\"],\n fontBody: fontBody as FontId,\n fontHeading,\n fontWeights,\n };\n}\n","import { buildThemeCss, type BuildThemeCssOptions, type ThemeConfig } from \"@bison-lab/tokens\";\n\n/**\n * `bison-theme.css` for a config. The derivation lives in `@bison-lab/tokens`\n * (`buildThemeCss`) so this file, `BisonProvider` and a CMS theme rendered at\n * request time all agree; the CLI only writes the result to disk.\n */\nexport function generateThemeCSS(config: ThemeConfig, options?: BuildThemeCssOptions): string {\n return buildThemeCss(config, options);\n}\n\nexport function generateTailwindConfig(): string {\n return [\n `/* Add to your main CSS file (e.g. globals.css): */`,\n `/* @import \"tailwindcss\"; */`,\n `/* @import \"@bison-lab/tailwind-preset/css\"; */`,\n `/* @import \"./bison-theme.css\"; */`,\n ].join(\"\\n\");\n}\n\n/**\n * The layout imports. The theme CSS carries the radius, shadow, motion and\n * density variables itself, so the four preset files are no longer imported;\n * they stay published for consumers composing a theme by hand.\n */\nexport function generateImports(themeImportPath: string): string {\n return [\n `import '@bison-lab/tokens/css/base.css';`,\n `import '${themeImportPath}';`,\n ].join(\"\\n\");\n}\n","import * as p from \"@clack/prompts\";\nimport pc from \"picocolors\";\nimport { execSync } from \"child_process\";\nimport { existsSync, readFileSync, writeFileSync } from \"fs\";\nimport { resolve, join, relative, dirname } from \"path\";\nimport { runPrompts, type ThemeConfig } from \"./prompts\";\nimport { generateThemeCSS, generateTailwindConfig, generateImports } from \"./generate\";\n\nconst BISON_PACKAGES = [\n \"@bison-lab/tokens\",\n \"@bison-lab/ui\",\n \"@bison-lab/tailwind-preset\",\n \"@bison-lab/fonts\",\n];\n\n/**\n * The theme CSS carries the `@font-face` rules for the chosen families under\n * `/fonts`; this is the route that answers them, and the config line that\n * keeps the package's font files reachable from the route.\n */\nconst FONT_ROUTE_SNIPPET = [\n `// app/fonts/[...path]/route.ts`,\n `import { serveFont } from \"@bison-lab/fonts/server\";`,\n `export const GET = serveFont;`,\n `export const HEAD = serveFont;`,\n ``,\n `// next.config.ts`,\n `// serverExternalPackages: [\"@bison-lab/fonts\"],`,\n].join(\"\\n\");\n\nfunction copyToClipboard(text: string): boolean {\n try {\n const platform = process.platform;\n if (platform === \"darwin\") {\n execSync(\"pbcopy\", { input: text });\n } else if (platform === \"linux\") {\n execSync(\"xclip -selection clipboard\", { input: text });\n } else if (platform === \"win32\") {\n execSync(\"clip\", { input: text });\n } else {\n return false;\n }\n return true;\n } catch {\n return false;\n }\n}\n\nfunction detectPackageManager(): \"pnpm\" | \"npm\" | \"yarn\" | \"bun\" {\n const cwd = process.cwd();\n if (existsSync(join(cwd, \"pnpm-lock.yaml\"))) return \"pnpm\";\n if (existsSync(join(cwd, \"bun.lockb\")) || existsSync(join(cwd, \"bun.lock\"))) return \"bun\";\n if (existsSync(join(cwd, \"yarn.lock\"))) return \"yarn\";\n return \"npm\";\n}\n\nfunction installCommand(pm: \"pnpm\" | \"npm\" | \"yarn\" | \"bun\"): string {\n const pkgs = BISON_PACKAGES.join(\" \");\n switch (pm) {\n case \"pnpm\": return `pnpm add ${pkgs}`;\n case \"yarn\": return `yarn add ${pkgs}`;\n case \"bun\": return `bun add ${pkgs}`;\n default: return `npm install ${pkgs}`;\n }\n}\n\nfunction areBisonPackagesInstalled(): boolean {\n return BISON_PACKAGES.every((pkg) => {\n try {\n const pkgJsonPath = join(process.cwd(), \"node_modules\", pkg, \"package.json\");\n return existsSync(pkgJsonPath);\n } catch {\n return false;\n }\n });\n}\n\nfunction findLayoutFile(baseDir: string): string | null {\n const candidates = [\n \"app/layout.tsx\",\n \"app/layout.jsx\",\n \"src/app/layout.tsx\",\n \"src/app/layout.jsx\",\n ];\n for (const candidate of candidates) {\n const full = resolve(baseDir, candidate);\n if (existsSync(full)) return full;\n }\n return null;\n}\n\nfunction injectImportsIntoLayout(layoutPath: string, imports: string): boolean {\n const content = readFileSync(layoutPath, \"utf-8\");\n\n // Check if already injected\n if (content.includes(\"@bison-lab/tokens/css/base.css\") || content.includes(\"@bison-lab/tokens/css/globals.css\")) {\n return false;\n }\n\n // Match all import statements including multiline ones (e.g. import { \\n Foo,\\n } from \"bar\";)\n const importRegex = /^import\\s[\\s\\S]*?from\\s+['\"][^'\"]+['\"];?\\s*$/gm;\n let lastMatchEnd = -1;\n let match: RegExpExecArray | null;\n\n while ((match = importRegex.exec(content)) !== null) {\n lastMatchEnd = match.index + match[0].length;\n }\n\n if (lastMatchEnd === -1) {\n // No imports found, prepend to file\n writeFileSync(layoutPath, imports + \"\\n\\n\" + content, \"utf-8\");\n } else {\n // Insert after the last import statement\n const before = content.slice(0, lastMatchEnd);\n const after = content.slice(lastMatchEnd);\n writeFileSync(layoutPath, before + \"\\n\\n\" + imports + after, \"utf-8\");\n }\n\n return true;\n}\n\nconst CONFIG_FILE = \"bison.config.json\";\nconst THEME_FILE = \"bison-theme.css\";\n\nasync function main() {\n p.intro(pc.bgCyan(pc.black(\" Bison Lab Theme Generator \")));\n\n // --- Output directory ---\n const outputDir = await p.text({\n message: \"Output directory for generated files\",\n placeholder: \".\",\n defaultValue: \".\",\n validate: (v) => {\n if (!v) return undefined;\n const resolved = resolve(process.cwd(), v);\n if (!existsSync(resolved)) return `Directory does not exist: ${v}`;\n return undefined;\n },\n });\n\n if (p.isCancel(outputDir)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n const outDir = resolve(process.cwd(), outputDir as string);\n\n if (outDir !== process.cwd()) {\n p.log.info(`Output directory: ${pc.cyan(relative(process.cwd(), outDir) || \".\")}`);\n }\n\n const configPath = resolve(outDir, CONFIG_FILE);\n let existingConfig: ThemeConfig | undefined;\n\n if (existsSync(configPath)) {\n const raw = JSON.parse(readFileSync(configPath, \"utf-8\")) as ThemeConfig;\n existingConfig = raw;\n\n const mode = await p.select({\n message: \"An existing theme was found. What would you like to do?\",\n options: [\n { value: \"update\", label: \"Update existing theme\", hint: \"Modify individual properties\" },\n { value: \"fresh\", label: \"Start fresh\", hint: \"Overwrite everything\" },\n ],\n });\n\n if (p.isCancel(mode)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (mode === \"fresh\") {\n existingConfig = undefined;\n }\n }\n\n const config = await runPrompts(existingConfig);\n\n if (!config) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n // --- Install dependencies ---\n if (!areBisonPackagesInstalled()) {\n const pm = detectPackageManager();\n const cmd = installCommand(pm);\n\n const shouldInstall = await p.confirm({\n message: `Install Bison Lab packages? (${pc.dim(cmd)})`,\n initialValue: true,\n });\n\n if (p.isCancel(shouldInstall)) {\n p.cancel(\"Cancelled.\");\n process.exit(0);\n }\n\n if (shouldInstall) {\n const s = p.spinner();\n s.start(`Installing packages with ${pm}...`);\n try {\n execSync(cmd, { cwd: process.cwd(), stdio: \"pipe\" });\n s.stop(\"Packages installed!\");\n } catch (err) {\n s.stop(\"Package installation failed.\");\n p.log.warning(`Run manually: ${pc.cyan(cmd)}`);\n }\n } else {\n p.log.warning(`Skipped. Run manually: ${pc.cyan(installCommand(pm))}`);\n }\n } else {\n p.log.success(\"Bison Lab packages already installed.\");\n }\n\n // --- Generate theme files ---\n const s = p.spinner();\n s.start(\"Generating theme files...\");\n\n const themeCSS = generateThemeCSS(config, { fontsBaseUrl: \"/fonts\" });\n const themePath = resolve(outDir, THEME_FILE);\n writeFileSync(themePath, themeCSS, \"utf-8\");\n writeFileSync(configPath, JSON.stringify(config, null, 2), \"utf-8\");\n\n s.stop(\"Theme files generated!\");\n\n const outPrefix = outDir === process.cwd() ? \"\" : relative(process.cwd(), outDir) + \"/\";\n p.log.success(`${pc.green(\"Created:\")} ${outPrefix}${THEME_FILE}`);\n p.log.success(`${pc.green(\"Created:\")} ${outPrefix}${CONFIG_FILE}`);\n\n // --- Tailwind config guidance ---\n const tailwindPath = resolve(outDir, \"tailwind.config.ts\");\n const presetSnippet = `import bisonPreset from '@bison-lab/tailwind-preset';\\n\\n// Add to your Tailwind config:\\n// presets: [bisonPreset],\\n// content: [..., './node_modules/@bison-lab/ui/dist/**/*.js'],`;\n\n if (existsSync(tailwindPath)) {\n const existing = readFileSync(tailwindPath, \"utf-8\");\n if (existing.includes(\"@bison-lab/tailwind-preset\")) {\n p.log.success(\"tailwind.config.ts already includes Bison Lab preset.\");\n } else {\n p.note(presetSnippet, \"Add to your tailwind.config.ts\");\n\n const action = await p.select({\n message: \"Add the Bison Lab preset to your existing tailwind.config.ts manually:\",\n options: [\n { value: \"copy\", label: \"Copy snippet to clipboard\" },\n { value: \"skip\", label: \"Skip\", hint: \"I'll handle it\" },\n ],\n });\n\n if (!p.isCancel(action) && action === \"copy\") {\n if (copyToClipboard(presetSnippet)) {\n p.log.success(\"Copied Tailwind preset snippet to clipboard!\");\n } else {\n p.log.warning(\"Could not access clipboard — copy manually from above.\");\n }\n }\n }\n } else {\n // No config exists — safe to create one\n const tailwindConfig = generateTailwindConfig();\n writeFileSync(tailwindPath, tailwindConfig, \"utf-8\");\n p.log.success(`${pc.green(\"Created:\")} ${outPrefix}tailwind.config.ts`);\n }\n\n // --- Layout imports ---\n const layoutPath = findLayoutFile(outDir);\n\n // Compute relative path from layout directory to the theme file\n const themeImportPath = layoutPath\n ? relative(dirname(layoutPath), themePath).replace(/\\\\/g, \"/\")\n : `./${THEME_FILE}`;\n const importsSnippet = generateImports(themeImportPath.startsWith(\".\") ? themeImportPath : `./${themeImportPath}`);\n\n if (layoutPath) {\n const injected = injectImportsIntoLayout(layoutPath, importsSnippet);\n if (injected) {\n const rel = relative(process.cwd(), layoutPath);\n p.log.success(`${pc.green(\"Updated:\")} ${rel} with Bison Lab imports.`);\n } else {\n p.log.success(\"Layout file already includes Bison Lab imports.\");\n }\n } else {\n p.note(importsSnippet, \"app/layout.tsx imports\");\n\n const action = await p.select({\n message: \"No layout file found. Copy imports to clipboard?\",\n options: [\n { value: \"copy\", label: \"Copy to clipboard\" },\n { value: \"skip\", label: \"Skip\" },\n ],\n });\n\n if (!p.isCancel(action) && action === \"copy\") {\n if (copyToClipboard(importsSnippet)) {\n p.log.success(\"Copied CSS imports to clipboard!\");\n } else {\n p.log.warning(\"Could not access clipboard — copy manually from above.\");\n }\n }\n }\n\n // --- Font route ---\n const routePath = resolve(outDir, \"app/fonts/[...path]/route.ts\");\n const srcRoutePath = resolve(outDir, \"src/app/fonts/[...path]/route.ts\");\n if (existsSync(routePath) || existsSync(srcRoutePath)) {\n p.log.success(\"Font route already exists.\");\n } else {\n p.note(FONT_ROUTE_SNIPPET, \"Serve the fonts: add this route\");\n }\n\n p.outro(pc.green(\"Done! Your Bison Lab theme is ready.\"));\n}\n\nmain().catch(console.error);\n"],"mappings":";;;;;;;;;AAEA,SAAgB,SAAS,KAAuC;AAC9D,OAAM,IAAI,QAAQ,KAAK,GAAG;AAC1B,QAAO;EACL,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EACjC,SAAS,IAAI,UAAU,GAAG,EAAE,EAAE,GAAG;EAClC;;AAGH,SAAgB,gBAAgB,KAAqB;CACnD,MAAM,CAAC,GAAG,GAAG,KAAK,SAAS,IAAI;AAE/B,QAAO,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,aAAa,GAAG,IAAI,IAAI;;;;;ACJ1D,MAAM,aAAa;AAEnB,SAAS,YAA8B,OAAmD;AACxF,QAAQ,OAAO,QAAQ,MAAM,CAA4C,KAAK,CAAC,OAAO,EAAE,OAAO,aAAa;EAC1G;EACA;EACA;EACD,EAAE;;;;;;;AAQL,SAAS,YAAY,QAAmC,UAA0B;AAChF,KA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",
|
|
4
4
|
"description": "Interactive CLI for generating and updating Bison Lab theme files",
|
|
5
5
|
"homepage": "https://components.bisonlab.ai",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@clack/prompts": "^1.1.0",
|
|
23
23
|
"picocolors": "^1.1.1",
|
|
24
|
-
"@bison-lab/
|
|
24
|
+
"@bison-lab/fonts": "3.6.0",
|
|
25
|
+
"@bison-lab/tokens": "3.7.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
28
|
"@types/node": "^25.5.0",
|