bdsg-cli 0.1.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/README.md +277 -0
- package/dist/commands/generate.d.ts +3 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +176 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +125 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/validate.d.ts +3 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +63 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/files.d.ts +12 -0
- package/dist/utils/files.d.ts.map +1 -0
- package/dist/utils/files.js +190 -0
- package/dist/utils/files.js.map +1 -0
- package/package.json +25 -0
- package/src/commands/generate.ts +236 -0
- package/src/commands/init.ts +132 -0
- package/src/commands/validate.ts +89 -0
- package/src/index.ts +18 -0
- package/src/utils/files.ts +249 -0
- package/tsconfig.json +12 -0
package/README.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# bdsg-cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/bdsg-cli)
|
|
4
|
+
[](https://github.com/CarlosEduJs/bdsg/actions/workflows/ci.yml)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
Interactive CLI for design system generation. Generate design tokens with WCAG accessibility compliance without leaving your terminal.
|
|
8
|
+
|
|
9
|
+
## Table of Contents
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Quick Start](#quick-start)
|
|
13
|
+
- [Commands](#commands)
|
|
14
|
+
- [init](#init)
|
|
15
|
+
- [generate](#generate)
|
|
16
|
+
- [validate](#validate)
|
|
17
|
+
- [Output Formats](#output-formats)
|
|
18
|
+
- [License](#license)
|
|
19
|
+
|
|
20
|
+
## Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install -g bdsg-cli
|
|
24
|
+
# or
|
|
25
|
+
bun add -g bdsg-cli
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Interactive setup
|
|
32
|
+
bdsg init
|
|
33
|
+
|
|
34
|
+
# Generate specific tokens
|
|
35
|
+
bdsg generate palette "#3B82F6" -n primary
|
|
36
|
+
bdsg generate typography -r golden-ratio
|
|
37
|
+
bdsg generate spacing -m fibonacci
|
|
38
|
+
bdsg generate shadows -s material
|
|
39
|
+
|
|
40
|
+
# Validate WCAG contrast
|
|
41
|
+
bdsg validate "#3B82F6" "#FFFFFF"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Commands
|
|
45
|
+
|
|
46
|
+
### init
|
|
47
|
+
|
|
48
|
+
Interactive setup to generate a complete design system.
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
bdsg init [options]
|
|
52
|
+
|
|
53
|
+
Options:
|
|
54
|
+
-o, --output <dir> Output directory (default: "./tokens")
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
**Prompts:**
|
|
58
|
+
|
|
59
|
+
- Project name
|
|
60
|
+
- Primary color (hex)
|
|
61
|
+
- Typography scale ratio
|
|
62
|
+
- Spacing method
|
|
63
|
+
- Shadow style
|
|
64
|
+
- Output format
|
|
65
|
+
|
|
66
|
+
**Example:**
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
$ bdsg init
|
|
70
|
+
|
|
71
|
+
BDSG - Design System Generator
|
|
72
|
+
|
|
73
|
+
? Project name: my-design-system
|
|
74
|
+
? Primary color (hex): #3B82F6
|
|
75
|
+
? Typography scale ratio: Perfect Fourth (1.333)
|
|
76
|
+
? Spacing method: Fibonacci (natural progression)
|
|
77
|
+
? Shadow style: Material Design
|
|
78
|
+
? Output format: Shadcn/ui (with dark mode)
|
|
79
|
+
|
|
80
|
+
✔ Design tokens generated!
|
|
81
|
+
|
|
82
|
+
Files created:
|
|
83
|
+
./tokens/globals.css
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### generate
|
|
87
|
+
|
|
88
|
+
Generate specific design tokens individually.
|
|
89
|
+
|
|
90
|
+
#### generate palette
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
bdsg generate palette <color> [options]
|
|
94
|
+
|
|
95
|
+
Arguments:
|
|
96
|
+
color Base color in hex format (e.g., #3B82F6)
|
|
97
|
+
|
|
98
|
+
Options:
|
|
99
|
+
-n, --name <name> Palette name (default: "primary")
|
|
100
|
+
-o, --output <dir> Output directory (default: "./tokens")
|
|
101
|
+
-f, --format <fmt> Output format: css, json (default: "css")
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
**Example:**
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
$ bdsg generate palette "#10B981" -n success
|
|
108
|
+
|
|
109
|
+
✔ Palette generated!
|
|
110
|
+
|
|
111
|
+
File: ./tokens/success.css
|
|
112
|
+
|
|
113
|
+
Color shades:
|
|
114
|
+
50: #f5f9f8
|
|
115
|
+
100: #e9f2ef
|
|
116
|
+
200: #c5ecdf
|
|
117
|
+
...
|
|
118
|
+
900: #15513d
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### generate typography
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
bdsg generate typography [options]
|
|
125
|
+
|
|
126
|
+
Options:
|
|
127
|
+
-r, --ratio <ratio> Scale ratio (default: "perfect-fourth")
|
|
128
|
+
-b, --base <size> Base font size in px (default: "16")
|
|
129
|
+
-o, --output <dir> Output directory (default: "./tokens")
|
|
130
|
+
-f, --format <fmt> Output format: css, json (default: "css")
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Available ratios: `minor-second`, `major-second`, `minor-third`, `major-third`, `perfect-fourth`, `perfect-fifth`, `golden-ratio`
|
|
134
|
+
|
|
135
|
+
#### generate spacing
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
bdsg generate spacing [options]
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
-m, --method <method> Spacing method (default: "fibonacci")
|
|
142
|
+
-b, --base <size> Base spacing in px (default: "8")
|
|
143
|
+
-o, --output <dir> Output directory (default: "./tokens")
|
|
144
|
+
-f, --format <fmt> Output format: css, json (default: "css")
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Available methods: `fibonacci`, `linear`, `t-shirt`
|
|
148
|
+
|
|
149
|
+
#### generate shadows
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
bdsg generate shadows [options]
|
|
153
|
+
|
|
154
|
+
Options:
|
|
155
|
+
-s, --style <style> Shadow style (default: "material")
|
|
156
|
+
-o, --output <dir> Output directory (default: "./tokens")
|
|
157
|
+
-f, --format <fmt> Output format: css, json (default: "css")
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Available styles: `material`, `soft`, `hard`
|
|
161
|
+
|
|
162
|
+
### validate
|
|
163
|
+
|
|
164
|
+
Validate WCAG contrast between two colors with suggestions for accessibility compliance.
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
bdsg validate <foreground> <background> [options]
|
|
168
|
+
|
|
169
|
+
Arguments:
|
|
170
|
+
foreground Foreground color in hex format
|
|
171
|
+
background Background color in hex format
|
|
172
|
+
|
|
173
|
+
Options:
|
|
174
|
+
-l, --level <level> Target WCAG level: AA, AAA (default: "AA")
|
|
175
|
+
-s, --size <size> Text size: normal, large (default: "normal")
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**Example:**
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
$ bdsg validate "#3B82F6" "#FFFFFF"
|
|
182
|
+
|
|
183
|
+
Contrast Analysis
|
|
184
|
+
|
|
185
|
+
Colors
|
|
186
|
+
──────────────────
|
|
187
|
+
Foreground: #3B82F6
|
|
188
|
+
Background: ████ #FFFFFF
|
|
189
|
+
Ratio: 3.68:1
|
|
190
|
+
|
|
191
|
+
WCAG Results
|
|
192
|
+
──────────────────
|
|
193
|
+
AA Normal Text: ✗ Fail (needs 4.5:1)
|
|
194
|
+
AA Large Text: ✓ Pass (needs 3.0:1)
|
|
195
|
+
AAA Normal Text: ✗ Fail (needs 7.0:1)
|
|
196
|
+
AAA Large Text: ✗ Fail (needs 4.5:1)
|
|
197
|
+
|
|
198
|
+
Suggestion
|
|
199
|
+
──────────────────
|
|
200
|
+
For AA normal text compliance:
|
|
201
|
+
Try: #2563EB (ratio: 4.52:1)
|
|
202
|
+
Strategy: lightness
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
## Output Formats
|
|
206
|
+
|
|
207
|
+
### CSS Variables
|
|
208
|
+
|
|
209
|
+
```css
|
|
210
|
+
:root {
|
|
211
|
+
--color-primary-50: #eff6ff;
|
|
212
|
+
--color-primary-500: #3b82f6;
|
|
213
|
+
--font-size-base: 1rem;
|
|
214
|
+
--spacing-4: 1rem;
|
|
215
|
+
}
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### JSON Tokens
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"colors": {
|
|
223
|
+
"primary-50": "#eff6ff",
|
|
224
|
+
"primary-500": "#3b82f6"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Tailwind v4
|
|
230
|
+
|
|
231
|
+
```css
|
|
232
|
+
@import "tailwindcss";
|
|
233
|
+
|
|
234
|
+
@theme {
|
|
235
|
+
--color-primary-50: #eff6ff;
|
|
236
|
+
--color-primary-500: #3b82f6;
|
|
237
|
+
--font-size-base: 1rem;
|
|
238
|
+
--spacing-4: 1rem;
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Shadcn/ui
|
|
243
|
+
|
|
244
|
+
Generates a complete `globals.css` compatible with shadcn/ui:
|
|
245
|
+
|
|
246
|
+
- Semantic tokens (`--primary`, `--secondary`, `--accent`, etc.)
|
|
247
|
+
- Dark mode with `.dark` class
|
|
248
|
+
- `@theme inline` block for Tailwind v4
|
|
249
|
+
- `@layer base` styles
|
|
250
|
+
|
|
251
|
+
```css
|
|
252
|
+
@import "tailwindcss";
|
|
253
|
+
|
|
254
|
+
@custom-variant dark (&:is(.dark *));
|
|
255
|
+
|
|
256
|
+
@theme inline {
|
|
257
|
+
--color-primary: var(--primary);
|
|
258
|
+
--color-secondary: var(--secondary);
|
|
259
|
+
/* ... */
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
:root {
|
|
263
|
+
--primary: #3B82F6;
|
|
264
|
+
--primary-foreground: #FFFFFF;
|
|
265
|
+
/* ... */
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.dark {
|
|
269
|
+
--primary: #60A5FA;
|
|
270
|
+
--primary-foreground: #1E3A5F;
|
|
271
|
+
/* ... */
|
|
272
|
+
}
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## License
|
|
276
|
+
|
|
277
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,eAAO,MAAM,eAAe,SA+N1B,CAAC"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { generatePalette, generateShadows, generateSpacingScale, generateTypographyScale, } from "bdsg";
|
|
4
|
+
import chalk from "chalk";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import ora from "ora";
|
|
7
|
+
export const generateCommand = new Command("generate")
|
|
8
|
+
.description("Generate specific design tokens")
|
|
9
|
+
.addCommand(new Command("palette")
|
|
10
|
+
.description("Generate a color palette from a base color")
|
|
11
|
+
.argument("<color>", "Base color in hex format (e.g., #3B82F6)")
|
|
12
|
+
.option("-n, --name <name>", "Palette name", "primary")
|
|
13
|
+
.option("-o, --output <dir>", "Output directory", "./tokens")
|
|
14
|
+
.option("-f, --format <format>", "Output format (css, json)", "css")
|
|
15
|
+
.action(async (color, options) => {
|
|
16
|
+
const spinner = ora("Generating palette...").start();
|
|
17
|
+
try {
|
|
18
|
+
const palette = generatePalette(color, options.name);
|
|
19
|
+
await mkdir(options.output, { recursive: true });
|
|
20
|
+
if (options.format === "json") {
|
|
21
|
+
const colors = {};
|
|
22
|
+
for (const [shade, data] of Object.entries(palette.shades)) {
|
|
23
|
+
colors[`${options.name}-${shade}`] = data.value;
|
|
24
|
+
}
|
|
25
|
+
await writeFile(join(options.output, `${options.name}.json`), JSON.stringify({ colors }, null, 2));
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
let css = ":root {\n";
|
|
29
|
+
for (const [shade, data] of Object.entries(palette.shades)) {
|
|
30
|
+
css += ` --color-${options.name}-${shade}: ${data.value};\n`;
|
|
31
|
+
}
|
|
32
|
+
css += "}\n";
|
|
33
|
+
await writeFile(join(options.output, `${options.name}.css`), css);
|
|
34
|
+
}
|
|
35
|
+
spinner.succeed(chalk.green("Palette generated!"));
|
|
36
|
+
console.log(chalk.dim(`\nFile: ${options.output}/${options.name}.${options.format}`));
|
|
37
|
+
console.log();
|
|
38
|
+
// Show preview
|
|
39
|
+
console.log(chalk.bold("Color shades:"));
|
|
40
|
+
for (const [shade, data] of Object.entries(palette.shades)) {
|
|
41
|
+
console.log(` ${shade}: ${data.value}`);
|
|
42
|
+
}
|
|
43
|
+
console.log();
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
spinner.fail(chalk.red("Failed to generate palette"));
|
|
47
|
+
console.error(error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
50
|
+
}))
|
|
51
|
+
.addCommand(new Command("typography")
|
|
52
|
+
.description("Generate a typography scale")
|
|
53
|
+
.option("-r, --ratio <ratio>", "Scale ratio", "perfect-fourth")
|
|
54
|
+
.option("-b, --base <size>", "Base font size in px", "16")
|
|
55
|
+
.option("-o, --output <dir>", "Output directory", "./tokens")
|
|
56
|
+
.option("-f, --format <format>", "Output format (css, json)", "css")
|
|
57
|
+
.action(async (options) => {
|
|
58
|
+
const spinner = ora("Generating typography scale...").start();
|
|
59
|
+
try {
|
|
60
|
+
const typography = generateTypographyScale({
|
|
61
|
+
ratio: options.ratio,
|
|
62
|
+
base: Number.parseInt(options.base, 10),
|
|
63
|
+
});
|
|
64
|
+
await mkdir(options.output, { recursive: true });
|
|
65
|
+
if (options.format === "json") {
|
|
66
|
+
const tokens = {};
|
|
67
|
+
for (const token of typography.tokens) {
|
|
68
|
+
tokens[token.name] = {
|
|
69
|
+
fontSize: token.fontSize,
|
|
70
|
+
lineHeight: token.lineHeight,
|
|
71
|
+
letterSpacing: token.letterSpacing,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
await writeFile(join(options.output, "typography.json"), JSON.stringify({ typography: tokens }, null, 2));
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
await writeFile(join(options.output, "typography.css"), typography.cssVariables);
|
|
78
|
+
}
|
|
79
|
+
spinner.succeed(chalk.green("Typography scale generated!"));
|
|
80
|
+
console.log(chalk.dim(`\nFile: ${options.output}/typography.${options.format}`));
|
|
81
|
+
console.log();
|
|
82
|
+
// Show preview
|
|
83
|
+
console.log(chalk.bold("Font sizes:"));
|
|
84
|
+
for (const token of typography.tokens) {
|
|
85
|
+
console.log(` ${token.name}: ${token.fontSize}px`);
|
|
86
|
+
}
|
|
87
|
+
console.log();
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
spinner.fail(chalk.red("Failed to generate typography"));
|
|
91
|
+
console.error(error);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
}))
|
|
95
|
+
.addCommand(new Command("spacing")
|
|
96
|
+
.description("Generate a spacing scale")
|
|
97
|
+
.option("-m, --method <method>", "Spacing method (fibonacci, linear, t-shirt)", "fibonacci")
|
|
98
|
+
.option("-b, --base <size>", "Base spacing in px", "8")
|
|
99
|
+
.option("-o, --output <dir>", "Output directory", "./tokens")
|
|
100
|
+
.option("-f, --format <format>", "Output format (css, json)", "css")
|
|
101
|
+
.action(async (options) => {
|
|
102
|
+
const spinner = ora("Generating spacing scale...").start();
|
|
103
|
+
try {
|
|
104
|
+
const spacing = generateSpacingScale({
|
|
105
|
+
method: options.method,
|
|
106
|
+
base: Number.parseInt(options.base, 10),
|
|
107
|
+
});
|
|
108
|
+
await mkdir(options.output, { recursive: true });
|
|
109
|
+
if (options.format === "json") {
|
|
110
|
+
const tokens = {};
|
|
111
|
+
for (const token of spacing.tokens) {
|
|
112
|
+
tokens[token.name] = {
|
|
113
|
+
value: token.formatted,
|
|
114
|
+
px: token.value,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
await writeFile(join(options.output, "spacing.json"), JSON.stringify({ spacing: tokens }, null, 2));
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
await writeFile(join(options.output, "spacing.css"), spacing.cssVariables);
|
|
121
|
+
}
|
|
122
|
+
spinner.succeed(chalk.green("Spacing scale generated!"));
|
|
123
|
+
console.log(chalk.dim(`\nFile: ${options.output}/spacing.${options.format}`));
|
|
124
|
+
console.log();
|
|
125
|
+
// Show preview
|
|
126
|
+
console.log(chalk.bold("Spacing values:"));
|
|
127
|
+
for (const token of spacing.tokens) {
|
|
128
|
+
console.log(` ${token.name}: ${token.formatted}`);
|
|
129
|
+
}
|
|
130
|
+
console.log();
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
spinner.fail(chalk.red("Failed to generate spacing"));
|
|
134
|
+
console.error(error);
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
}))
|
|
138
|
+
.addCommand(new Command("shadows")
|
|
139
|
+
.description("Generate shadow tokens")
|
|
140
|
+
.option("-s, --style <style>", "Shadow style (material, soft, hard)", "material")
|
|
141
|
+
.option("-o, --output <dir>", "Output directory", "./tokens")
|
|
142
|
+
.option("-f, --format <format>", "Output format (css, json)", "css")
|
|
143
|
+
.action(async (options) => {
|
|
144
|
+
const spinner = ora("Generating shadows...").start();
|
|
145
|
+
try {
|
|
146
|
+
const shadows = generateShadows({
|
|
147
|
+
style: options.style,
|
|
148
|
+
});
|
|
149
|
+
await mkdir(options.output, { recursive: true });
|
|
150
|
+
if (options.format === "json") {
|
|
151
|
+
const tokens = {};
|
|
152
|
+
for (const token of shadows.tokens) {
|
|
153
|
+
tokens[token.name] = token.value;
|
|
154
|
+
}
|
|
155
|
+
await writeFile(join(options.output, "shadows.json"), JSON.stringify({ shadows: tokens }, null, 2));
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
await writeFile(join(options.output, "shadows.css"), shadows.cssVariables);
|
|
159
|
+
}
|
|
160
|
+
spinner.succeed(chalk.green("Shadows generated!"));
|
|
161
|
+
console.log(chalk.dim(`\nFile: ${options.output}/shadows.${options.format}`));
|
|
162
|
+
console.log();
|
|
163
|
+
// Show preview
|
|
164
|
+
console.log(chalk.bold("Shadow levels:"));
|
|
165
|
+
for (const token of shadows.tokens) {
|
|
166
|
+
console.log(` ${token.name}: elevation ${token.elevation}`);
|
|
167
|
+
}
|
|
168
|
+
console.log();
|
|
169
|
+
}
|
|
170
|
+
catch (error) {
|
|
171
|
+
spinner.fail(chalk.red("Failed to generate shadows"));
|
|
172
|
+
console.error(error);
|
|
173
|
+
process.exit(1);
|
|
174
|
+
}
|
|
175
|
+
}));
|
|
176
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../src/commands/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB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AK,CAAC,IAAI,eAAe,KAAK,CAAC,SAAS,EAAE,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjB,CAAC;AACF,CAAC,CAAC,CACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,eAAO,MAAM,WAAW,SAuHrB,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { generatePalette, generateShadows, generateSpacingScale, generateTypographyScale, } from "bdsg";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import inquirer from "inquirer";
|
|
5
|
+
import ora from "ora";
|
|
6
|
+
import { writeTokensToFile } from "../utils/files.js";
|
|
7
|
+
export const initCommand = new Command("init")
|
|
8
|
+
.description("Initialize a new design system")
|
|
9
|
+
.option("-o, --output <dir>", "Output directory", "./tokens")
|
|
10
|
+
.action(async (options) => {
|
|
11
|
+
console.log(chalk.bold("\n BDSG - Design System Generator\n"));
|
|
12
|
+
const answers = await inquirer.prompt([
|
|
13
|
+
{
|
|
14
|
+
type: "input",
|
|
15
|
+
name: "projectName",
|
|
16
|
+
message: "Project name:",
|
|
17
|
+
default: "my-design-system",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: "input",
|
|
21
|
+
name: "primaryColor",
|
|
22
|
+
message: "Primary color (hex):",
|
|
23
|
+
default: "#3B82F6",
|
|
24
|
+
validate: (input) => {
|
|
25
|
+
if (/^#[0-9A-Fa-f]{6}$/.test(input))
|
|
26
|
+
return true;
|
|
27
|
+
return "Please enter a valid hex color (e.g., #3B82F6)";
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: "list",
|
|
32
|
+
name: "typographyRatio",
|
|
33
|
+
message: "Typography scale ratio:",
|
|
34
|
+
choices: [
|
|
35
|
+
{ name: "Minor Second (1.067)", value: "minor-second" },
|
|
36
|
+
{ name: "Major Second (1.125)", value: "major-second" },
|
|
37
|
+
{ name: "Minor Third (1.2)", value: "minor-third" },
|
|
38
|
+
{ name: "Major Third (1.25)", value: "major-third" },
|
|
39
|
+
{ name: "Perfect Fourth (1.333)", value: "perfect-fourth" },
|
|
40
|
+
{ name: "Perfect Fifth (1.5)", value: "perfect-fifth" },
|
|
41
|
+
{ name: "Golden Ratio (1.618)", value: "golden-ratio" },
|
|
42
|
+
],
|
|
43
|
+
default: "perfect-fourth",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "list",
|
|
47
|
+
name: "spacingMethod",
|
|
48
|
+
message: "Spacing method:",
|
|
49
|
+
choices: [
|
|
50
|
+
{ name: "Fibonacci (natural progression)", value: "fibonacci" },
|
|
51
|
+
{ name: "Linear (consistent increments)", value: "linear" },
|
|
52
|
+
{ name: "T-shirt sizes (semantic)", value: "t-shirt" },
|
|
53
|
+
],
|
|
54
|
+
default: "fibonacci",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "list",
|
|
58
|
+
name: "shadowStyle",
|
|
59
|
+
message: "Shadow style:",
|
|
60
|
+
choices: [
|
|
61
|
+
{ name: "Material Design", value: "material" },
|
|
62
|
+
{ name: "Soft", value: "soft" },
|
|
63
|
+
{ name: "Hard", value: "hard" },
|
|
64
|
+
],
|
|
65
|
+
default: "material",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "list",
|
|
69
|
+
name: "outputFormat",
|
|
70
|
+
message: "Output format:",
|
|
71
|
+
choices: [
|
|
72
|
+
{ name: "CSS Variables", value: "css" },
|
|
73
|
+
{ name: "JSON Tokens", value: "json" },
|
|
74
|
+
{ name: "Tailwind v4 (@theme)", value: "tailwind-v4" },
|
|
75
|
+
{ name: "Shadcn/ui (with dark mode)", value: "shadcn" },
|
|
76
|
+
],
|
|
77
|
+
default: "css",
|
|
78
|
+
},
|
|
79
|
+
]);
|
|
80
|
+
const spinner = ora("Generating design tokens...").start();
|
|
81
|
+
try {
|
|
82
|
+
// Generate tokens using bdsg
|
|
83
|
+
const palette = generatePalette(answers.primaryColor, "primary");
|
|
84
|
+
const typography = generateTypographyScale({
|
|
85
|
+
ratio: answers.typographyRatio,
|
|
86
|
+
});
|
|
87
|
+
const spacing = generateSpacingScale({
|
|
88
|
+
method: answers.spacingMethod,
|
|
89
|
+
});
|
|
90
|
+
const shadows = generateShadows({
|
|
91
|
+
style: answers.shadowStyle,
|
|
92
|
+
});
|
|
93
|
+
// Write to files
|
|
94
|
+
await writeTokensToFile({
|
|
95
|
+
palette,
|
|
96
|
+
typography,
|
|
97
|
+
spacing,
|
|
98
|
+
shadows,
|
|
99
|
+
format: answers.outputFormat,
|
|
100
|
+
outputDir: options.output,
|
|
101
|
+
});
|
|
102
|
+
spinner.succeed(chalk.green("Design tokens generated!"));
|
|
103
|
+
console.log(chalk.dim("\nFiles created:"));
|
|
104
|
+
if (answers.outputFormat === "shadcn") {
|
|
105
|
+
console.log(chalk.dim(` ${options.output}/globals.css`));
|
|
106
|
+
}
|
|
107
|
+
else if (answers.outputFormat === "tailwind-v4") {
|
|
108
|
+
console.log(chalk.dim(` ${options.output}/theme.css`));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
const ext = answers.outputFormat === "json" ? "json" : "css";
|
|
112
|
+
console.log(chalk.dim(` ${options.output}/colors.${ext}`));
|
|
113
|
+
console.log(chalk.dim(` ${options.output}/typography.${ext}`));
|
|
114
|
+
console.log(chalk.dim(` ${options.output}/spacing.${ext}`));
|
|
115
|
+
console.log(chalk.dim(` ${options.output}/shadows.${ext}`));
|
|
116
|
+
}
|
|
117
|
+
console.log();
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
spinner.fail(chalk.red("Failed to generate tokens"));
|
|
121
|
+
console.error(error);
|
|
122
|
+
process.exit(1);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,uBAAuB,GACvB,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,OAAO,CAAC,MAAM,CAAC;KAC5C,WAAW,CAAC,gCAAgC,CAAC;KAC7C,MAAM,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,UAAU,CAAC;KAC5D,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;IACzB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,qCAAqC,CAAC,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACrC;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,aAAa;YACnB,OAAO,EAAE,eAAe;YACxB,OAAO,EAAE,kBAAkB;SAC3B;QACD;YACC,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,cAAc;YACpB,OAAO,EAAE,sBAAsB;YAC/B,OAAO,EAAE,SAAS;YAClB,QA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