codebakers 2.3.8 → 2.5.3

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,138 @@
1
+ # CodeBakers CLI Audit Report
2
+
3
+ ## Summary
4
+ - **Total TypeScript Errors**: 206 (mostly non-critical type issues)
5
+ - **Critical Runtime Bugs Found**: 3
6
+ - **Moderate Issues**: 12
7
+ - **Minor Issues**: Many (type annotations)
8
+
9
+ ---
10
+
11
+ ## 🔴 CRITICAL ISSUES (Will crash at runtime)
12
+
13
+ ### 1. ~~Missing `execa` import in prd-maker.ts~~ ✅ FIXED
14
+ **File**: `src/commands/prd-maker.ts`
15
+ **Issue**: `execa` was used but not imported
16
+ **Status**: Fixed
17
+
18
+ ### 2. ~~Duplicate function declarations in prd-maker.ts~~ ✅ FIXED
19
+ **File**: `src/commands/prd-maker.ts`
20
+ **Issue**: `getVoiceInput` and `checkVoiceAvailability` were both imported AND defined locally
21
+ **Status**: Fixed (removed imports, kept local implementations)
22
+
23
+ ### 3. ~~fs-extra import style causing writeJson to fail~~ ✅ FIXED (Previous session)
24
+ **Files**: All command files
25
+ **Issue**: `import * as fs from 'fs-extra'` doesn't work in ESM
26
+ **Status**: Fixed to `import fs from 'fs-extra'`
27
+
28
+ ---
29
+
30
+ ## 🟡 MODERATE ISSUES (May cause unexpected behavior)
31
+
32
+ ### 4. Missing try-catch around async operations
33
+ **Files affected**:
34
+ - `build.ts`: 15 async calls, only 5 try blocks
35
+ - `deploy.ts`: 10 async calls, only 8 try blocks
36
+ - `migrate.ts`: 17 async calls, only 7 try blocks
37
+ - `website.ts`: 8 async calls, only 4 try blocks
38
+
39
+ **Risk**: Unhandled promise rejections can crash the CLI
40
+ **Recommendation**: Add try-catch or handle with .catch()
41
+
42
+ ### 5. Silent failures with `reject: false`
43
+ **Files**: `build.ts`, `deploy.ts`, `integrate.ts`, `migrate.ts`
44
+ **Locations**:
45
+ ```
46
+ build.ts:541, 554, 578, 890, 904, 908
47
+ deploy.ts:320
48
+ integrate.ts:685
49
+ migrate.ts:105, 108
50
+ ```
51
+ **Risk**: Commands may appear to succeed when they actually failed
52
+ **Recommendation**: Log failures or show warnings to users
53
+
54
+ ### 6. Vercel deploy returns incomplete object
55
+ **File**: `src/commands/deploy.ts:233`
56
+ **Issue**: Accesses `deployment.dashboardUrl` but Vercel service only returns `{ url: string }`
57
+ **Fix needed**: Update VercelService to return dashboardUrl or remove that line
58
+
59
+ ### 7. Type issues with package.json generation in init.ts
60
+ **File**: `src/commands/init.ts:394-423`
61
+ **Issue**: Dynamic property assignment to typed objects
62
+ **Risk**: TypeScript errors, but works at runtime
63
+ **Recommendation**: Type the objects as `Record<string, string>`
64
+
65
+ ---
66
+
67
+ ## 🟢 MINOR ISSUES (Won't crash, but should fix)
68
+
69
+ ### 8. Anthropic response type checking
70
+ **Files**: Most AI command files
71
+ **Current code**:
72
+ ```typescript
73
+ const text = response.content[0].type === 'text' ? response.content[0].text : '';
74
+ ```
75
+ **Issue**: Accesses `[0]` without checking if array has elements
76
+ **Better**:
77
+ ```typescript
78
+ const firstContent = response.content?.[0];
79
+ const text = firstContent?.type === 'text' ? firstContent.text : '';
80
+ ```
81
+
82
+ ### 9. Potential null pointer on string operations
83
+ **Files**: Multiple
84
+ **Examples**:
85
+ - `advisors.ts:488`: `projectName.toUpperCase()` - projectName could be undefined
86
+ - `code.ts:135`: `input.trim()` - input could be undefined
87
+
88
+ ### 10. Symbol to string conversion
89
+ **File**: `code.ts:590`
90
+ **Issue**: Implicit symbol to string conversion will fail
91
+ **Recommendation**: Wrap in `String(...)`
92
+
93
+ ---
94
+
95
+ ## 📊 TypeScript Error Categories
96
+
97
+ | Error Code | Count | Description | Severity |
98
+ |------------|-------|-------------|----------|
99
+ | TS2532 | 72 | Object possibly undefined | Low |
100
+ | TS2339 | 22 | Property doesn't exist on type | Low |
101
+ | TS7053 | 15 | Dynamic index signature | Low |
102
+ | TS2345 | 11 | Type assignment mismatch | Low |
103
+ | TS2322 | 10 | Type mismatch | Low |
104
+ | TS18048 | 7 | Possibly undefined | Low |
105
+ | TS2440 | 2 | Duplicate declarations | Fixed |
106
+ | TS7006 | 1 | Implicit any | Low |
107
+ | TS2769 | 1 | No overload matches | Medium |
108
+ | TS2731 | 1 | Symbol conversion | Medium |
109
+
110
+ ---
111
+
112
+ ## ✅ Already Working Well
113
+
114
+ 1. **Config system** - Solid implementation with Zod validation
115
+ 2. **Service classes** - GitHub, Vercel, Supabase all properly structured
116
+ 3. **CLI structure** - Commander.js setup is correct
117
+ 4. **Error display utilities** - New display.ts is well-implemented
118
+ 5. **Voice input** - Has fallback to text input
119
+
120
+ ---
121
+
122
+ ## 🔧 Recommended Fixes Priority
123
+
124
+ 1. ✅ ~~Fix prd-maker.ts imports~~ DONE
125
+ 2. 🔴 Fix deploy.ts dashboardUrl issue
126
+ 3. 🔴 Add better error handling to build.ts and migrate.ts
127
+ 4. 🟡 Add null checks for Anthropic responses
128
+ 5. 🟡 Fix init.ts type issues
129
+ 6. 🟢 Add strict TypeScript checks gradually
130
+
131
+ ---
132
+
133
+ ## Next Steps
134
+
135
+ 1. Test all commands manually
136
+ 2. Add integration tests
137
+ 3. Gradually enable stricter TypeScript
138
+ 4. Add more comprehensive error handling
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  advisorsCommand
3
- } from "./chunk-YUSDTJD6.js";
3
+ } from "./chunk-D44U3IEA.js";
4
4
  import "./chunk-ASIJIQYC.js";
5
5
  export {
6
6
  advisorsCommand
@@ -5,7 +5,7 @@ import {
5
5
  // src/commands/advisors.ts
6
6
  import * as p from "@clack/prompts";
7
7
  import chalk from "chalk";
8
- import * as fs from "fs-extra";
8
+ import fs from "fs-extra";
9
9
  import * as path from "path";
10
10
  import Anthropic from "@anthropic-ai/sdk";
11
11
  var DREAM_TEAM = [
@@ -219,7 +219,7 @@ async function conductInterview() {
219
219
  }
220
220
  async function getAdvisorFeedback(anthropic, advisor, brief) {
221
221
  const response = await anthropic.messages.create({
222
- model: "claude-sonnet-4-20250514",
222
+ model: "claude-sonnet-4-5-20250929",
223
223
  max_tokens: 2048,
224
224
  messages: [{
225
225
  role: "user",
@@ -278,7 +278,7 @@ Score 1-10 based on your area of expertise. Be honest but constructive.`
278
278
  async function generateReport(anthropic, brief, advisorFeedback) {
279
279
  const avgScore = advisorFeedback.reduce((sum, f) => sum + f.score, 0) / advisorFeedback.length;
280
280
  const response = await anthropic.messages.create({
281
- model: "claude-sonnet-4-20250514",
281
+ model: "claude-sonnet-4-5-20250929",
282
282
  max_tokens: 8192,
283
283
  messages: [{
284
284
  role: "user",
@@ -5,7 +5,7 @@ import {
5
5
  // src/commands/prd.ts
6
6
  import * as p from "@clack/prompts";
7
7
  import chalk from "chalk";
8
- import * as fs from "fs-extra";
8
+ import fs from "fs-extra";
9
9
  import * as path from "path";
10
10
  import Anthropic from "@anthropic-ai/sdk";
11
11
  async function prdCommand(filePath) {
@@ -100,7 +100,7 @@ async function prdCommand(filePath) {
100
100
  }
101
101
  async function parsePRD(anthropic, content) {
102
102
  const response = await anthropic.messages.create({
103
- model: "claude-sonnet-4-20250514",
103
+ model: "claude-sonnet-4-5-20250929",
104
104
  max_tokens: 4096,
105
105
  messages: [{
106
106
  role: "user",
@@ -225,7 +225,7 @@ ${chalk.bold("Continue building:")}
225
225
  }
226
226
  async function generateBuildPlan(anthropic, prd, designProfile) {
227
227
  const response = await anthropic.messages.create({
228
- model: "claude-sonnet-4-20250514",
228
+ model: "claude-sonnet-4-5-20250929",
229
229
  max_tokens: 4096,
230
230
  messages: [{
231
231
  role: "user",
@@ -270,7 +270,7 @@ Keep tasks specific and actionable.`
270
270
  }
271
271
  async function executeTask(anthropic, projectPath, task, prd, designProfile) {
272
272
  const response = await anthropic.messages.create({
273
- model: "claude-sonnet-4-20250514",
273
+ model: "claude-sonnet-4-5-20250929",
274
274
  max_tokens: 8192,
275
275
  messages: [{
276
276
  role: "user",