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.
Files changed (60) hide show
  1. package/README.md +54 -255
  2. package/dist/chunk-HOWR3YTF.js +146 -0
  3. package/dist/index.d.ts +0 -3
  4. package/dist/index.js +10505 -7997
  5. package/dist/terminal-6ZQVP6R7.js +10 -0
  6. package/package.json +26 -41
  7. package/AUDIT_REPORT.md +0 -138
  8. package/dist/advisors-RWRTSJRR.js +0 -7
  9. package/dist/chunk-ASIJIQYC.js +0 -320
  10. package/dist/chunk-D44U3IEA.js +0 -565
  11. package/dist/chunk-LANM5XQW.js +0 -326
  12. package/dist/prd-RYITSL6Q.js +0 -7
  13. package/install.bat +0 -9
  14. package/installers/CodeBakers-Install.bat +0 -207
  15. package/installers/CodeBakers-Install.command +0 -232
  16. package/installers/README.md +0 -157
  17. package/installers/mac/assets/README.txt +0 -31
  18. package/installers/mac/build-mac-installer.sh +0 -240
  19. package/installers/windows/CodeBakers.iss +0 -256
  20. package/installers/windows/assets/README.txt +0 -16
  21. package/installers/windows/scripts/post-install.bat +0 -15
  22. package/src/channels/discord.ts +0 -5
  23. package/src/channels/slack.ts +0 -5
  24. package/src/channels/sms.ts +0 -4
  25. package/src/channels/telegram.ts +0 -5
  26. package/src/channels/whatsapp.ts +0 -7
  27. package/src/commands/advisors.ts +0 -699
  28. package/src/commands/build.ts +0 -1025
  29. package/src/commands/check.ts +0 -365
  30. package/src/commands/code.ts +0 -806
  31. package/src/commands/connect.ts +0 -12
  32. package/src/commands/deploy.ts +0 -448
  33. package/src/commands/design.ts +0 -298
  34. package/src/commands/fix.ts +0 -20
  35. package/src/commands/gateway.ts +0 -604
  36. package/src/commands/generate.ts +0 -178
  37. package/src/commands/init.ts +0 -634
  38. package/src/commands/integrate.ts +0 -884
  39. package/src/commands/learn.ts +0 -36
  40. package/src/commands/migrate.ts +0 -419
  41. package/src/commands/prd-maker.ts +0 -588
  42. package/src/commands/prd.ts +0 -419
  43. package/src/commands/security.ts +0 -102
  44. package/src/commands/setup.ts +0 -600
  45. package/src/commands/status.ts +0 -56
  46. package/src/commands/website.ts +0 -741
  47. package/src/index.ts +0 -627
  48. package/src/patterns/loader.ts +0 -337
  49. package/src/services/github.ts +0 -61
  50. package/src/services/supabase.ts +0 -147
  51. package/src/services/vercel.ts +0 -61
  52. package/src/utils/claude-md.ts +0 -287
  53. package/src/utils/config.ts +0 -375
  54. package/src/utils/display.ts +0 -338
  55. package/src/utils/files.ts +0 -418
  56. package/src/utils/nlp.ts +0 -312
  57. package/src/utils/ui.ts +0 -441
  58. package/src/utils/updates.ts +0 -8
  59. package/src/utils/voice.ts +0 -323
  60. package/tsconfig.json +0 -26
@@ -1,178 +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
-
6
- export async function generateCommand(type?: string): Promise<void> {
7
- p.intro(chalk.bgCyan.black(' Generate '));
8
-
9
- const generateType = type || await p.select({
10
- message: 'What do you want to generate?',
11
- options: [
12
- { value: 'component', label: '🧩 Component' },
13
- { value: 'page', label: '📄 Page' },
14
- { value: 'api', label: '🔌 API Route' },
15
- { value: 'hook', label: '🪝 Custom Hook' },
16
- { value: 'store', label: '📦 Zustand Store' },
17
- { value: 'form', label: '📝 Form Component' },
18
- ],
19
- });
20
-
21
- if (p.isCancel(generateType)) return;
22
-
23
- const name = await p.text({
24
- message: 'Name:',
25
- placeholder: generateType === 'page' ? 'dashboard' : 'MyComponent',
26
- validate: (v) => !v ? 'Name is required' : undefined,
27
- });
28
-
29
- if (p.isCancel(name)) return;
30
-
31
- const spinner = p.spinner();
32
- spinner.start('Generating...');
33
-
34
- await generateFile(generateType as string, name as string);
35
-
36
- spinner.stop(`Generated ${name}`);
37
- p.outro('');
38
- }
39
-
40
- async function generateFile(type: string, name: string): Promise<void> {
41
- const cwd = process.cwd();
42
-
43
- const templates: Record<string, { path: string; content: string }> = {
44
- component: {
45
- path: `src/components/${name}.tsx`,
46
- content: `'use client';
47
-
48
- interface ${name}Props {
49
- // props
50
- }
51
-
52
- export function ${name}({}: ${name}Props) {
53
- return (
54
- <div>
55
- <h2>${name}</h2>
56
- </div>
57
- );
58
- }
59
- `,
60
- },
61
- page: {
62
- path: `src/app/${name}/page.tsx`,
63
- content: `export default function ${name.charAt(0).toUpperCase() + name.slice(1)}Page() {
64
- return (
65
- <div className="container mx-auto py-8">
66
- <h1 className="text-2xl font-bold">${name}</h1>
67
- </div>
68
- );
69
- }
70
- `,
71
- },
72
- api: {
73
- path: `src/app/api/${name}/route.ts`,
74
- content: `import { NextRequest, NextResponse } from 'next/server';
75
-
76
- export async function GET(request: NextRequest) {
77
- try {
78
- return NextResponse.json({ data: [] });
79
- } catch (error) {
80
- return NextResponse.json({ error: 'Internal error' }, { status: 500 });
81
- }
82
- }
83
-
84
- export async function POST(request: NextRequest) {
85
- try {
86
- const body = await request.json();
87
- return NextResponse.json({ success: true }, { status: 201 });
88
- } catch (error) {
89
- return NextResponse.json({ error: 'Internal error' }, { status: 500 });
90
- }
91
- }
92
- `,
93
- },
94
- hook: {
95
- path: `src/hooks/use-${name.toLowerCase()}.ts`,
96
- content: `import { useState, useEffect } from 'react';
97
-
98
- export function use${name}() {
99
- const [data, setData] = useState(null);
100
- const [isLoading, setIsLoading] = useState(false);
101
- const [error, setError] = useState<Error | null>(null);
102
-
103
- return { data, isLoading, error };
104
- }
105
- `,
106
- },
107
- store: {
108
- path: `src/stores/${name.toLowerCase()}-store.ts`,
109
- content: `import { create } from 'zustand';
110
-
111
- interface ${name}State {
112
- items: unknown[];
113
- isLoading: boolean;
114
- setItems: (items: unknown[]) => void;
115
- reset: () => void;
116
- }
117
-
118
- export const use${name}Store = create<${name}State>((set) => ({
119
- items: [],
120
- isLoading: false,
121
- setItems: (items) => set({ items }),
122
- reset: () => set({ items: [], isLoading: false }),
123
- }));
124
- `,
125
- },
126
- form: {
127
- path: `src/components/forms/${name}-form.tsx`,
128
- content: `'use client';
129
-
130
- import { useState } from 'react';
131
- import { useForm } from 'react-hook-form';
132
- import { zodResolver } from '@hookform/resolvers/zod';
133
- import { z } from 'zod';
134
- import { toast } from 'sonner';
135
-
136
- const schema = z.object({
137
- name: z.string().min(1, 'Required'),
138
- });
139
-
140
- type FormData = z.infer<typeof schema>;
141
-
142
- export function ${name}Form({ onSuccess }: { onSuccess?: () => void }) {
143
- const [isSubmitting, setIsSubmitting] = useState(false);
144
- const form = useForm<FormData>({ resolver: zodResolver(schema) });
145
-
146
- const onSubmit = async (data: FormData) => {
147
- setIsSubmitting(true);
148
- try {
149
- // Submit
150
- toast.success('Success!');
151
- onSuccess?.();
152
- } catch (error) {
153
- toast.error('Failed');
154
- } finally {
155
- setIsSubmitting(false);
156
- }
157
- };
158
-
159
- return (
160
- <form onSubmit={form.handleSubmit(onSubmit)}>
161
- {/* Form fields */}
162
- <button type="submit" disabled={isSubmitting}>
163
- {isSubmitting ? 'Submitting...' : 'Submit'}
164
- </button>
165
- </form>
166
- );
167
- }
168
- `,
169
- },
170
- };
171
-
172
- const template = templates[type];
173
- if (!template) throw new Error(`Unknown type: ${type}`);
174
-
175
- const filePath = path.join(cwd, template.path);
176
- await fs.ensureDir(path.dirname(filePath));
177
- await fs.writeFile(filePath, template.content);
178
- }