codebakers 2.1.2 → 2.2.1

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.
@@ -0,0 +1,7 @@
1
+ import {
2
+ prdCommand
3
+ } from "./chunk-ND6T4UDY.js";
4
+ import "./chunk-ASIJIQYC.js";
5
+ export {
6
+ prdCommand
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebakers",
3
- "version": "2.1.2",
3
+ "version": "2.2.1",
4
4
  "description": "AI dev team that follows the rules. Build apps from anywhere with pattern enforcement.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -70,19 +70,38 @@ export async function buildCommand(prdPath?: string, options: { sequential?: boo
70
70
  const config = new Config();
71
71
 
72
72
  if (!config.isConfigured()) {
73
- p.log.error('Please run `codebakers setup` first.');
73
+ console.log(chalk.yellow(`
74
+ ⚠️ CodeBakers isn't set up yet.
75
+
76
+ Run this first:
77
+ ${chalk.cyan('codebakers setup')}
78
+ `));
74
79
  return;
75
80
  }
76
81
 
77
82
  const anthropicCreds = config.getCredentials('anthropic');
78
83
  if (!anthropicCreds?.apiKey) {
79
- p.log.error('Anthropic API key not configured.');
84
+ console.log(chalk.yellow(`
85
+ ⚠️ Anthropic API key not configured.
86
+
87
+ The parallel build needs Claude AI to work.
88
+
89
+ Run this to add your API key:
90
+ ${chalk.cyan('codebakers setup')}
91
+ `));
80
92
  return;
81
93
  }
82
94
 
83
95
  // Get PRD file
84
96
  let prdFile = prdPath;
85
97
  if (!prdFile) {
98
+ console.log(chalk.dim(`
99
+ A PRD (Product Requirements Document) describes what you want to build.
100
+
101
+ Don't have one? Create one with:
102
+ ${chalk.cyan('codebakers prd-maker')}
103
+ `));
104
+
86
105
  const file = await p.text({
87
106
  message: 'Path to PRD file:',
88
107
  placeholder: './my-app-prd.md',
@@ -94,7 +113,12 @@ export async function buildCommand(prdPath?: string, options: { sequential?: boo
94
113
 
95
114
  // Read PRD
96
115
  if (!await fs.pathExists(prdFile)) {
97
- p.log.error(`PRD file not found: ${prdFile}`);
116
+ console.log(chalk.red(`
117
+ ❌ PRD file not found: ${prdFile}
118
+
119
+ Make sure the file exists, or create one:
120
+ ${chalk.cyan('codebakers prd-maker')}
121
+ `));
98
122
  return;
99
123
  }
100
124
 
@@ -103,6 +127,13 @@ export async function buildCommand(prdPath?: string, options: { sequential?: boo
103
127
  console.log(chalk.cyan(`
104
128
  ╔═══════════════════════════════════════════════════════════════╗
105
129
  ║ 🚀 CODEBAKERS PARALLEL BUILD ║
130
+ ║ ║
131
+ ║ This will: ║
132
+ ║ 1. Analyze your PRD ║
133
+ ║ 2. Break it into features ║
134
+ ║ 3. Run up to 3 AI agents in parallel ║
135
+ ║ 4. Auto-fix any errors ║
136
+ ║ 5. Merge everything together ║
106
137
  ╚═══════════════════════════════════════════════════════════════╝
107
138
  `));
108
139
 
@@ -33,20 +33,45 @@ export async function codeCommand(prompt?: string, options: CodeOptions = {}): P
33
33
 
34
34
  // Check if configured
35
35
  if (!config.isConfigured()) {
36
- p.log.error('Please run `codebakers setup` first.');
36
+ console.log(chalk.yellow(`
37
+ ⚠️ CodeBakers isn't set up yet.
38
+
39
+ Run this first:
40
+ ${chalk.cyan('codebakers setup')}
41
+
42
+ This connects your API keys (Anthropic, GitHub, etc.)
43
+ so CodeBakers can generate code and deploy for you.
44
+ `));
37
45
  return;
38
46
  }
39
47
 
40
48
  // Check if in project
41
49
  if (!config.isInProject()) {
42
- p.log.error('Not in a CodeBakers project. Run `codebakers init` first.');
50
+ console.log(chalk.yellow(`
51
+ ⚠️ You're not in a CodeBakers project.
52
+
53
+ Options:
54
+ ${chalk.cyan('codebakers init')} Create a new project here
55
+ ${chalk.cyan('codebakers website')} Build a website by describing it
56
+ ${chalk.cyan('cd my-project')} Navigate to an existing project
57
+ `));
43
58
  return;
44
59
  }
45
60
 
46
61
  // Get API key
47
62
  const anthropicCreds = config.getCredentials('anthropic');
48
63
  if (!anthropicCreds?.apiKey) {
49
- p.log.error('Anthropic API key not configured. Run `codebakers setup`.');
64
+ console.log(chalk.yellow(`
65
+ ⚠️ Anthropic API key not configured.
66
+
67
+ The AI coding agent needs Claude to work.
68
+
69
+ Run this to add your API key:
70
+ ${chalk.cyan('codebakers setup')}
71
+
72
+ Get an API key at:
73
+ ${chalk.dim('https://console.anthropic.com/settings/keys')}
74
+ `));
50
75
  return;
51
76
  }
52
77
 
@@ -17,7 +17,32 @@ export async function deployCommand(options: DeployOptions = {}): Promise<void>
17
17
  const config = new Config();
18
18
 
19
19
  if (!config.isInProject()) {
20
- p.log.error('Not in a CodeBakers project.');
20
+ console.log(chalk.yellow(`
21
+ ⚠️ You're not in a CodeBakers project.
22
+
23
+ Navigate to your project first:
24
+ ${chalk.cyan('cd my-project')}
25
+
26
+ Or create a new one:
27
+ ${chalk.cyan('codebakers init')}
28
+ `));
29
+ return;
30
+ }
31
+
32
+ // Check for Vercel credentials
33
+ const vercelCreds = config.getCredentials('vercel');
34
+ if (!vercelCreds?.token) {
35
+ console.log(chalk.yellow(`
36
+ ⚠️ Vercel isn't connected.
37
+
38
+ CodeBakers deploys to Vercel by default.
39
+
40
+ Run this to connect:
41
+ ${chalk.cyan('codebakers setup')}
42
+
43
+ Or deploy manually:
44
+ ${chalk.cyan('npx vercel')}
45
+ `));
21
46
  return;
22
47
  }
23
48
 
@@ -107,7 +132,16 @@ export async function deployCommand(options: DeployOptions = {}): Promise<void>
107
132
  // Step 3: Run build
108
133
  spinner.start('Building project...');
109
134
  try {
110
- await execa('pnpm', ['build'], { cwd: process.cwd() });
135
+ // Try npm first, fall back to pnpm or yarn
136
+ try {
137
+ await execa('npm', ['run', 'build'], { cwd: process.cwd() });
138
+ } catch {
139
+ try {
140
+ await execa('pnpm', ['build'], { cwd: process.cwd() });
141
+ } catch {
142
+ await execa('yarn', ['build'], { cwd: process.cwd() });
143
+ }
144
+ }
111
145
  spinner.stop('Build successful');
112
146
  } catch (error) {
113
147
  spinner.stop('');
@@ -188,7 +188,17 @@ Domain: ${domain || 'Vercel default'}`,
188
188
 
189
189
  // Step 2: Install dependencies
190
190
  spinner.start('Installing dependencies...');
191
- await execa('pnpm', ['install'], { cwd: projectPath });
191
+
192
+ // Try npm first (most common), fall back to pnpm or yarn
193
+ try {
194
+ await execa('npm', ['install'], { cwd: projectPath });
195
+ } catch {
196
+ try {
197
+ await execa('pnpm', ['install'], { cwd: projectPath });
198
+ } catch {
199
+ await execa('yarn', ['install'], { cwd: projectPath });
200
+ }
201
+ }
192
202
  spinner.stop('Dependencies installed');
193
203
 
194
204
  // Step 3: GitHub