codebakers 2.5.4 → 3.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 +54 -255
- package/dist/chunk-HOWR3YTF.js +146 -0
- package/dist/index.d.ts +0 -3
- package/dist/index.js +10505 -7997
- package/dist/terminal-6ZQVP6R7.js +10 -0
- package/package.json +26 -41
- package/AUDIT_REPORT.md +0 -138
- package/dist/advisors-RWRTSJRR.js +0 -7
- package/dist/chunk-ASIJIQYC.js +0 -320
- package/dist/chunk-D44U3IEA.js +0 -565
- package/dist/chunk-LANM5XQW.js +0 -326
- package/dist/prd-RYITSL6Q.js +0 -7
- package/install.bat +0 -9
- package/installers/CodeBakers-Install.bat +0 -207
- package/installers/CodeBakers-Install.command +0 -232
- package/installers/README.md +0 -157
- package/installers/mac/assets/README.txt +0 -31
- package/installers/mac/build-mac-installer.sh +0 -240
- package/installers/windows/CodeBakers.iss +0 -256
- package/installers/windows/assets/README.txt +0 -16
- package/installers/windows/scripts/post-install.bat +0 -15
- package/src/channels/discord.ts +0 -5
- package/src/channels/slack.ts +0 -5
- package/src/channels/sms.ts +0 -4
- package/src/channels/telegram.ts +0 -5
- package/src/channels/whatsapp.ts +0 -7
- package/src/commands/advisors.ts +0 -699
- package/src/commands/build.ts +0 -1025
- package/src/commands/check.ts +0 -365
- package/src/commands/code.ts +0 -806
- package/src/commands/connect.ts +0 -12
- package/src/commands/deploy.ts +0 -448
- package/src/commands/design.ts +0 -298
- package/src/commands/fix.ts +0 -20
- package/src/commands/gateway.ts +0 -604
- package/src/commands/generate.ts +0 -178
- package/src/commands/init.ts +0 -634
- package/src/commands/integrate.ts +0 -884
- package/src/commands/learn.ts +0 -36
- package/src/commands/migrate.ts +0 -419
- package/src/commands/prd-maker.ts +0 -588
- package/src/commands/prd.ts +0 -419
- package/src/commands/security.ts +0 -102
- package/src/commands/setup.ts +0 -600
- package/src/commands/status.ts +0 -56
- package/src/commands/website.ts +0 -741
- package/src/index.ts +0 -627
- package/src/patterns/loader.ts +0 -337
- package/src/services/github.ts +0 -61
- package/src/services/supabase.ts +0 -147
- package/src/services/vercel.ts +0 -61
- package/src/utils/claude-md.ts +0 -287
- package/src/utils/config.ts +0 -375
- package/src/utils/display.ts +0 -338
- package/src/utils/files.ts +0 -418
- package/src/utils/nlp.ts +0 -312
- package/src/utils/ui.ts +0 -441
- package/src/utils/updates.ts +0 -8
- package/src/utils/voice.ts +0 -323
- package/tsconfig.json +0 -26
package/src/commands/design.ts
DELETED
|
@@ -1,298 +0,0 @@
|
|
|
1
|
-
import * as p from '@clack/prompts';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import { Config } from '../utils/config.js';
|
|
6
|
-
|
|
7
|
-
const DESIGN_PROFILES = {
|
|
8
|
-
minimal: {
|
|
9
|
-
name: 'Minimal',
|
|
10
|
-
inspiration: 'Linear, Notion, Vercel',
|
|
11
|
-
fonts: { heading: 'Inter', body: 'Inter' },
|
|
12
|
-
corners: 'rounded-md',
|
|
13
|
-
shadows: 'none',
|
|
14
|
-
spacing: 'generous',
|
|
15
|
-
},
|
|
16
|
-
bold: {
|
|
17
|
-
name: 'Bold',
|
|
18
|
-
inspiration: 'Stripe, Ramp, Mercury',
|
|
19
|
-
fonts: { heading: 'Plus Jakarta Sans', body: 'Inter' },
|
|
20
|
-
corners: 'rounded-2xl',
|
|
21
|
-
shadows: 'elevated',
|
|
22
|
-
spacing: 'generous',
|
|
23
|
-
},
|
|
24
|
-
editorial: {
|
|
25
|
-
name: 'Editorial',
|
|
26
|
-
inspiration: 'Medium, Substack, NY Times',
|
|
27
|
-
fonts: { heading: 'Playfair Display', body: 'Source Serif Pro' },
|
|
28
|
-
corners: 'rounded-none',
|
|
29
|
-
shadows: 'none',
|
|
30
|
-
spacing: 'reading',
|
|
31
|
-
},
|
|
32
|
-
playful: {
|
|
33
|
-
name: 'Playful',
|
|
34
|
-
inspiration: 'Figma, Slack, Notion',
|
|
35
|
-
fonts: { heading: 'Nunito', body: 'Nunito' },
|
|
36
|
-
corners: 'rounded-full',
|
|
37
|
-
shadows: 'soft',
|
|
38
|
-
spacing: 'comfortable',
|
|
39
|
-
},
|
|
40
|
-
premium: {
|
|
41
|
-
name: 'Premium',
|
|
42
|
-
inspiration: 'Apple, Porsche, Amex',
|
|
43
|
-
fonts: { heading: 'Cormorant Garamond', body: 'Lato' },
|
|
44
|
-
corners: 'rounded-lg',
|
|
45
|
-
shadows: 'subtle',
|
|
46
|
-
spacing: 'luxurious',
|
|
47
|
-
},
|
|
48
|
-
dashboard: {
|
|
49
|
-
name: 'Dashboard',
|
|
50
|
-
inspiration: 'Datadog, Grafana, Linear',
|
|
51
|
-
fonts: { heading: 'Inter', body: 'Inter' },
|
|
52
|
-
corners: 'rounded-md',
|
|
53
|
-
shadows: 'card',
|
|
54
|
-
spacing: 'compact',
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export async function designCommand(subcommand?: string): Promise<void> {
|
|
59
|
-
const config = new Config();
|
|
60
|
-
|
|
61
|
-
if (!config.isInProject()) {
|
|
62
|
-
p.log.error('Not in a CodeBakers project. Run `codebakers init` first.');
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
p.intro(chalk.bgCyan.black(' Design System '));
|
|
67
|
-
|
|
68
|
-
const action = subcommand || await p.select({
|
|
69
|
-
message: 'What do you want to do?',
|
|
70
|
-
options: [
|
|
71
|
-
{ value: 'profile', label: '🎨 Set design profile' },
|
|
72
|
-
{ value: 'palette', label: '🌈 Generate color palette' },
|
|
73
|
-
{ value: 'check', label: '✅ Check design quality' },
|
|
74
|
-
{ value: 'view', label: '👀 View current settings' },
|
|
75
|
-
],
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
if (p.isCancel(action)) return;
|
|
79
|
-
|
|
80
|
-
switch (action) {
|
|
81
|
-
case 'profile':
|
|
82
|
-
await setProfile();
|
|
83
|
-
break;
|
|
84
|
-
case 'palette':
|
|
85
|
-
await generatePalette();
|
|
86
|
-
break;
|
|
87
|
-
case 'check':
|
|
88
|
-
await checkDesign();
|
|
89
|
-
break;
|
|
90
|
-
case 'view':
|
|
91
|
-
await viewSettings();
|
|
92
|
-
break;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async function setProfile(): Promise<void> {
|
|
97
|
-
const profile = await p.select({
|
|
98
|
-
message: 'Choose your design profile:',
|
|
99
|
-
options: Object.entries(DESIGN_PROFILES).map(([key, value]) => ({
|
|
100
|
-
value: key,
|
|
101
|
-
label: `${value.name}`,
|
|
102
|
-
hint: value.inspiration,
|
|
103
|
-
})),
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
if (p.isCancel(profile)) return;
|
|
107
|
-
|
|
108
|
-
const selected = DESIGN_PROFILES[profile as keyof typeof DESIGN_PROFILES];
|
|
109
|
-
|
|
110
|
-
// Save to project config
|
|
111
|
-
const configPath = path.join(process.cwd(), '.codebakers', 'design.json');
|
|
112
|
-
await fs.ensureDir(path.dirname(configPath));
|
|
113
|
-
await fs.writeJson(configPath, {
|
|
114
|
-
profile,
|
|
115
|
-
...selected,
|
|
116
|
-
updatedAt: new Date().toISOString(),
|
|
117
|
-
}, { spaces: 2 });
|
|
118
|
-
|
|
119
|
-
p.log.success(`Design profile set to ${selected.name}`);
|
|
120
|
-
|
|
121
|
-
console.log(chalk.dim(`
|
|
122
|
-
Fonts: ${selected.fonts.heading} / ${selected.fonts.body}
|
|
123
|
-
Corners: ${selected.corners}
|
|
124
|
-
Shadows: ${selected.shadows}
|
|
125
|
-
Spacing: ${selected.spacing}
|
|
126
|
-
`));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
async function generatePalette(): Promise<void> {
|
|
130
|
-
const brandColor = await p.text({
|
|
131
|
-
message: 'Enter your brand color (hex):',
|
|
132
|
-
placeholder: '#6366F1',
|
|
133
|
-
validate: (v) => {
|
|
134
|
-
if (!v.match(/^#[0-9A-Fa-f]{6}$/)) return 'Enter a valid hex color (#RRGGBB)';
|
|
135
|
-
return undefined;
|
|
136
|
-
},
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
if (p.isCancel(brandColor)) return;
|
|
140
|
-
|
|
141
|
-
const palette = generateColorPalette(brandColor as string);
|
|
142
|
-
|
|
143
|
-
// Save to project
|
|
144
|
-
const configPath = path.join(process.cwd(), '.codebakers', 'design.json');
|
|
145
|
-
let config = {};
|
|
146
|
-
if (await fs.pathExists(configPath)) {
|
|
147
|
-
config = await fs.readJson(configPath);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
await fs.writeJson(configPath, {
|
|
151
|
-
...config,
|
|
152
|
-
colors: palette,
|
|
153
|
-
updatedAt: new Date().toISOString(),
|
|
154
|
-
}, { spaces: 2 });
|
|
155
|
-
|
|
156
|
-
p.log.success('Color palette generated!');
|
|
157
|
-
|
|
158
|
-
console.log(`
|
|
159
|
-
${chalk.bgHex(palette.brand[500]).black(' Brand ')} ${palette.brand[500]}
|
|
160
|
-
${chalk.bgHex(palette.brand[100]).black(' Light ')} ${palette.brand[100]}
|
|
161
|
-
${chalk.bgHex(palette.brand[900]).white(' Dark ')} ${palette.brand[900]}
|
|
162
|
-
${chalk.bgHex(palette.accent).black(' Accent ')} ${palette.accent}
|
|
163
|
-
`);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function generateColorPalette(hex: string): Record<string, any> {
|
|
167
|
-
// Convert hex to HSL
|
|
168
|
-
const r = parseInt(hex.slice(1, 3), 16) / 255;
|
|
169
|
-
const g = parseInt(hex.slice(3, 5), 16) / 255;
|
|
170
|
-
const b = parseInt(hex.slice(5, 7), 16) / 255;
|
|
171
|
-
|
|
172
|
-
const max = Math.max(r, g, b);
|
|
173
|
-
const min = Math.min(r, g, b);
|
|
174
|
-
let h = 0, s = 0, l = (max + min) / 2;
|
|
175
|
-
|
|
176
|
-
if (max !== min) {
|
|
177
|
-
const d = max - min;
|
|
178
|
-
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
|
|
179
|
-
switch (max) {
|
|
180
|
-
case r: h = ((g - b) / d + (g < b ? 6 : 0)) / 6; break;
|
|
181
|
-
case g: h = ((b - r) / d + 2) / 6; break;
|
|
182
|
-
case b: h = ((r - g) / d + 4) / 6; break;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
h = Math.round(h * 360);
|
|
187
|
-
s = Math.round(s * 100);
|
|
188
|
-
l = Math.round(l * 100);
|
|
189
|
-
|
|
190
|
-
// Generate scale
|
|
191
|
-
const hslToHex = (h: number, s: number, l: number): string => {
|
|
192
|
-
l /= 100;
|
|
193
|
-
const a = s * Math.min(l, 1 - l) / 100;
|
|
194
|
-
const f = (n: number) => {
|
|
195
|
-
const k = (n + h / 30) % 12;
|
|
196
|
-
const color = l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
|
|
197
|
-
return Math.round(255 * color).toString(16).padStart(2, '0');
|
|
198
|
-
};
|
|
199
|
-
return `#${f(0)}${f(8)}${f(4)}`;
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
return {
|
|
203
|
-
brand: {
|
|
204
|
-
50: hslToHex(h, s * 0.3, 97),
|
|
205
|
-
100: hslToHex(h, s * 0.4, 94),
|
|
206
|
-
200: hslToHex(h, s * 0.5, 86),
|
|
207
|
-
300: hslToHex(h, s * 0.6, 74),
|
|
208
|
-
400: hslToHex(h, s * 0.8, 62),
|
|
209
|
-
500: hex, // Original
|
|
210
|
-
600: hslToHex(h, s, l * 0.85),
|
|
211
|
-
700: hslToHex(h, s, l * 0.7),
|
|
212
|
-
800: hslToHex(h, s, l * 0.55),
|
|
213
|
-
900: hslToHex(h, s, l * 0.4),
|
|
214
|
-
},
|
|
215
|
-
accent: hslToHex((h + 180) % 360, s, l), // Complementary
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
async function checkDesign(): Promise<void> {
|
|
220
|
-
const spinner = p.spinner();
|
|
221
|
-
spinner.start('Checking design quality...');
|
|
222
|
-
|
|
223
|
-
const cwd = process.cwd();
|
|
224
|
-
const issues: string[] = [];
|
|
225
|
-
|
|
226
|
-
// Check for anti-patterns in code
|
|
227
|
-
const glob = (await import('fast-glob')).default;
|
|
228
|
-
const files = await glob(['src/**/*.{tsx,jsx}'], { cwd });
|
|
229
|
-
|
|
230
|
-
for (const file of files) {
|
|
231
|
-
const content = await fs.readFile(path.join(cwd, file), 'utf-8');
|
|
232
|
-
|
|
233
|
-
// Check for generic gradient hero
|
|
234
|
-
if (content.includes('bg-gradient-to-r from-blue-500') ||
|
|
235
|
-
content.includes('bg-gradient-to-r from-purple-500')) {
|
|
236
|
-
issues.push(`${file}: Generic gradient hero detected`);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
// Check for icon spam
|
|
240
|
-
const iconMatches = content.match(/<(Rocket|Shield|Zap|Star|Check|Lightning)/g);
|
|
241
|
-
if (iconMatches && iconMatches.length > 3) {
|
|
242
|
-
issues.push(`${file}: Too many generic icons (${iconMatches.length})`);
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
// Check for generic CTAs
|
|
246
|
-
if (content.includes('>Get Started<') || content.includes('>Learn More<')) {
|
|
247
|
-
issues.push(`${file}: Generic CTA text - be more specific`);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
// Check for lazy empty states
|
|
251
|
-
if (content.includes('No data') || content.includes('Nothing here')) {
|
|
252
|
-
issues.push(`${file}: Lazy empty state - add helpful message`);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
// Check for small section padding
|
|
256
|
-
if (content.includes('py-4') || content.includes('py-6') || content.includes('py-8')) {
|
|
257
|
-
if (content.includes('<section')) {
|
|
258
|
-
issues.push(`${file}: Section padding too small - use py-16 or larger`);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
spinner.stop('Check complete');
|
|
264
|
-
|
|
265
|
-
if (issues.length === 0) {
|
|
266
|
-
console.log(chalk.green('\n✓ No design issues found!\n'));
|
|
267
|
-
} else {
|
|
268
|
-
console.log(chalk.yellow(`\n⚠️ ${issues.length} design issues found:\n`));
|
|
269
|
-
for (const issue of issues) {
|
|
270
|
-
console.log(chalk.dim(` • ${issue}`));
|
|
271
|
-
}
|
|
272
|
-
console.log('');
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
async function viewSettings(): Promise<void> {
|
|
277
|
-
const configPath = path.join(process.cwd(), '.codebakers', 'design.json');
|
|
278
|
-
|
|
279
|
-
if (!await fs.pathExists(configPath)) {
|
|
280
|
-
p.log.info('No design settings configured. Run `codebakers design profile` to set up.');
|
|
281
|
-
return;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const config = await fs.readJson(configPath);
|
|
285
|
-
|
|
286
|
-
console.log(chalk.bold('\nCurrent Design Settings:\n'));
|
|
287
|
-
console.log(` Profile: ${config.name || config.profile}`);
|
|
288
|
-
console.log(` Fonts: ${config.fonts?.heading} / ${config.fonts?.body}`);
|
|
289
|
-
console.log(` Corners: ${config.corners}`);
|
|
290
|
-
console.log(` Shadows: ${config.shadows}`);
|
|
291
|
-
console.log(` Spacing: ${config.spacing}`);
|
|
292
|
-
|
|
293
|
-
if (config.colors) {
|
|
294
|
-
console.log(` Brand: ${config.colors.brand?.[500]}`);
|
|
295
|
-
console.log(` Accent: ${config.colors.accent}`);
|
|
296
|
-
}
|
|
297
|
-
console.log('');
|
|
298
|
-
}
|
package/src/commands/fix.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import * as p from '@clack/prompts';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { runPatternCheck } from './check.js';
|
|
4
|
-
|
|
5
|
-
export async function fixCommand(): Promise<void> {
|
|
6
|
-
p.intro(chalk.bgCyan.black(' Auto-Fix '));
|
|
7
|
-
|
|
8
|
-
const spinner = p.spinner();
|
|
9
|
-
spinner.start('Analyzing code...');
|
|
10
|
-
|
|
11
|
-
const result = await runPatternCheck(true);
|
|
12
|
-
|
|
13
|
-
if (result.passed) {
|
|
14
|
-
spinner.stop('No issues found!');
|
|
15
|
-
} else {
|
|
16
|
-
spinner.stop(`Fixed ${result.violations.length} issues`);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
p.outro(chalk.green('Done!'));
|
|
20
|
-
}
|