codebakers 2.2.0 → 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
+ advisorsCommand
3
+ } from "./chunk-YUSDTJD6.js";
4
+ import "./chunk-ASIJIQYC.js";
5
+ export {
6
+ advisorsCommand
7
+ };
@@ -1,6 +1,7 @@
1
1
  // src/utils/config.ts
2
2
  import Conf from "conf";
3
- import * as fs from "fs-extra";
3
+ import fsExtra from "fs-extra";
4
+ import { existsSync, readFileSync, appendFileSync } from "fs";
4
5
  import * as path from "path";
5
6
  import os from "os";
6
7
  import { z } from "zod";
@@ -99,10 +100,10 @@ var Config = class {
99
100
  configDir;
100
101
  constructor() {
101
102
  this.configDir = path.join(os.homedir(), ".codebakers");
102
- fs.ensureDirSync(this.configDir);
103
- fs.ensureDirSync(path.join(this.configDir, "patterns"));
104
- fs.ensureDirSync(path.join(this.configDir, "templates"));
105
- fs.ensureDirSync(path.join(this.configDir, "learning"));
103
+ fsExtra.ensureDirSync(this.configDir);
104
+ fsExtra.ensureDirSync(path.join(this.configDir, "patterns"));
105
+ fsExtra.ensureDirSync(path.join(this.configDir, "templates"));
106
+ fsExtra.ensureDirSync(path.join(this.configDir, "learning"));
106
107
  this.conf = new Conf({
107
108
  projectName: "codebakers",
108
109
  cwd: this.configDir,
@@ -126,7 +127,7 @@ var Config = class {
126
127
  const cwd = process.cwd();
127
128
  const codebakersDir = path.join(cwd, ".codebakers");
128
129
  const claudeFile = path.join(cwd, "CLAUDE.md");
129
- if (fs.existsSync(codebakersDir) || fs.existsSync(claudeFile)) {
130
+ if (existsSync(codebakersDir) || existsSync(claudeFile)) {
130
131
  return true;
131
132
  }
132
133
  const projectIndicators = [
@@ -140,7 +141,7 @@ var Config = class {
140
141
  "astro.config.mjs"
141
142
  ];
142
143
  const hasProjectFile = projectIndicators.some(
143
- (file) => fs.existsSync(path.join(cwd, file))
144
+ (file) => existsSync(path.join(cwd, file))
144
145
  );
145
146
  if (hasProjectFile) {
146
147
  this.autoInitExisting(cwd);
@@ -153,18 +154,18 @@ var Config = class {
153
154
  try {
154
155
  let framework = "unknown";
155
156
  let ui = "unknown";
156
- if (fs.existsSync(path.join(cwd, "next.config.js")) || fs.existsSync(path.join(cwd, "next.config.mjs")) || fs.existsSync(path.join(cwd, "next.config.ts"))) {
157
+ if (existsSync(path.join(cwd, "next.config.js")) || existsSync(path.join(cwd, "next.config.mjs")) || existsSync(path.join(cwd, "next.config.ts"))) {
157
158
  framework = "nextjs";
158
- } else if (fs.existsSync(path.join(cwd, "vite.config.ts")) || fs.existsSync(path.join(cwd, "vite.config.js"))) {
159
+ } else if (existsSync(path.join(cwd, "vite.config.ts")) || existsSync(path.join(cwd, "vite.config.js"))) {
159
160
  framework = "vite";
160
- } else if (fs.existsSync(path.join(cwd, "remix.config.js"))) {
161
+ } else if (existsSync(path.join(cwd, "remix.config.js"))) {
161
162
  framework = "remix";
162
- } else if (fs.existsSync(path.join(cwd, "astro.config.mjs"))) {
163
+ } else if (existsSync(path.join(cwd, "astro.config.mjs"))) {
163
164
  framework = "astro";
164
165
  }
165
166
  const pkgPath = path.join(cwd, "package.json");
166
- if (fs.existsSync(pkgPath)) {
167
- const pkg = fs.readJsonSync(pkgPath);
167
+ if (existsSync(pkgPath)) {
168
+ const pkg = fsExtra.readJsonSync(pkgPath);
168
169
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
169
170
  if (deps["@shadcn/ui"] || deps["class-variance-authority"]) {
170
171
  ui = "shadcn";
@@ -177,7 +178,7 @@ var Config = class {
177
178
  }
178
179
  }
179
180
  const configDir = path.join(cwd, ".codebakers");
180
- fs.ensureDirSync(configDir);
181
+ fsExtra.ensureDirSync(configDir);
181
182
  const config = {
182
183
  name: path.basename(cwd),
183
184
  framework,
@@ -185,12 +186,12 @@ var Config = class {
185
186
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
186
187
  autoDetected: true
187
188
  };
188
- fs.writeJsonSync(path.join(configDir, "config.json"), config, { spaces: 2 });
189
+ fsExtra.writeJsonSync(path.join(configDir, "config.json"), config, { spaces: 2 });
189
190
  const gitignorePath = path.join(cwd, ".gitignore");
190
- if (fs.existsSync(gitignorePath)) {
191
- const gitignore = fs.readFileSync(gitignorePath, "utf-8");
191
+ if (existsSync(gitignorePath)) {
192
+ const gitignore = readFileSync(gitignorePath, "utf-8");
192
193
  if (!gitignore.includes(".codebakers")) {
193
- fs.appendFileSync(gitignorePath, "\n# CodeBakers\n.codebakers/\n");
194
+ appendFileSync(gitignorePath, "\n# CodeBakers\n.codebakers/\n");
194
195
  }
195
196
  }
196
197
  } catch {
@@ -200,8 +201,8 @@ var Config = class {
200
201
  getProjectConfig() {
201
202
  const cwd = process.cwd();
202
203
  const configPath = path.join(cwd, ".codebakers", "config.json");
203
- if (fs.existsSync(configPath)) {
204
- return fs.readJsonSync(configPath);
204
+ if (existsSync(configPath)) {
205
+ return fsExtra.readJsonSync(configPath);
205
206
  }
206
207
  return null;
207
208
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Config
3
- } from "./chunk-RCC7FYEU.js";
3
+ } from "./chunk-ASIJIQYC.js";
4
4
 
5
5
  // src/commands/prd.ts
6
6
  import * as p from "@clack/prompts";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Config
3
- } from "./chunk-RCC7FYEU.js";
3
+ } from "./chunk-ASIJIQYC.js";
4
4
 
5
5
  // src/commands/advisors.ts
6
6
  import * as p from "@clack/prompts";
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  prdCommand
4
- } from "./chunk-YGVDLNXY.js";
4
+ } from "./chunk-ND6T4UDY.js";
5
5
  import {
6
6
  advisorsCommand
7
- } from "./chunk-FWQNLNTI.js";
7
+ } from "./chunk-YUSDTJD6.js";
8
8
  import {
9
9
  Config
10
- } from "./chunk-RCC7FYEU.js";
10
+ } from "./chunk-ASIJIQYC.js";
11
11
 
12
12
  // src/index.ts
13
13
  import { Command } from "commander";
@@ -4967,10 +4967,10 @@ async function prdMakerCommand() {
4967
4967
  return;
4968
4968
  }
4969
4969
  if (nextStep === "build") {
4970
- const { prdCommand: prdCommand2 } = await import("./prd-HBUCYLVG.js");
4970
+ const { prdCommand: prdCommand2 } = await import("./prd-AIEY63YY.js");
4971
4971
  await prdCommand2(filepath);
4972
4972
  } else if (nextStep === "advisors") {
4973
- const { advisorsCommand: advisorsCommand2 } = await import("./advisors-J3S64IZK.js");
4973
+ const { advisorsCommand: advisorsCommand2 } = await import("./advisors-GGUCFS4E.js");
4974
4974
  await advisorsCommand2();
4975
4975
  }
4976
4976
  }
@@ -7604,7 +7604,7 @@ async function clarifyDeployTarget() {
7604
7604
  }
7605
7605
 
7606
7606
  // src/index.ts
7607
- var VERSION2 = "2.2.0";
7607
+ var VERSION2 = "2.2.1";
7608
7608
  var logo = `
7609
7609
  \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557
7610
7610
  \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2554\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D
@@ -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.2.0",
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",
package/src/index.ts CHANGED
@@ -29,7 +29,7 @@ import { integrateCommand, INTEGRATIONS } from './commands/integrate.js';
29
29
  import { websiteCommand } from './commands/website.js';
30
30
  import { parseNaturalLanguage, clarifyCommand, clarifyDeployTarget } from './utils/nlp.js';
31
31
 
32
- const VERSION = '2.2.0';
32
+ const VERSION = '2.2.1';
33
33
 
34
34
  // ASCII art logo
35
35
  const logo = `
@@ -1,5 +1,6 @@
1
1
  import Conf from 'conf';
2
- import * as fs from 'fs-extra';
2
+ import fsExtra from 'fs-extra';
3
+ import { existsSync, readFileSync, appendFileSync } from 'fs';
3
4
  import * as path from 'path';
4
5
  import os from 'os';
5
6
  import { z } from 'zod';
@@ -106,10 +107,10 @@ export class Config {
106
107
  this.configDir = path.join(os.homedir(), '.codebakers');
107
108
 
108
109
  // Ensure config directory exists
109
- fs.ensureDirSync(this.configDir);
110
- fs.ensureDirSync(path.join(this.configDir, 'patterns'));
111
- fs.ensureDirSync(path.join(this.configDir, 'templates'));
112
- fs.ensureDirSync(path.join(this.configDir, 'learning'));
110
+ fsExtra.ensureDirSync(this.configDir);
111
+ fsExtra.ensureDirSync(path.join(this.configDir, 'patterns'));
112
+ fsExtra.ensureDirSync(path.join(this.configDir, 'templates'));
113
+ fsExtra.ensureDirSync(path.join(this.configDir, 'learning'));
113
114
 
114
115
  this.conf = new Conf<ConfigType>({
115
116
  projectName: 'codebakers',
@@ -143,7 +144,7 @@ export class Config {
143
144
  const claudeFile = path.join(cwd, 'CLAUDE.md');
144
145
 
145
146
  // Already a CodeBakers project
146
- if (fs.existsSync(codebakersDir) || fs.existsSync(claudeFile)) {
147
+ if (existsSync(codebakersDir) || existsSync(claudeFile)) {
147
148
  return true;
148
149
  }
149
150
 
@@ -160,7 +161,7 @@ export class Config {
160
161
  ];
161
162
 
162
163
  const hasProjectFile = projectIndicators.some(file =>
163
- fs.existsSync(path.join(cwd, file))
164
+ existsSync(path.join(cwd, file))
164
165
  );
165
166
 
166
167
  // If it's a project but no .codebakers, auto-initialize
@@ -179,23 +180,23 @@ export class Config {
179
180
  let framework = 'unknown';
180
181
  let ui = 'unknown';
181
182
 
182
- if (fs.existsSync(path.join(cwd, 'next.config.js')) ||
183
- fs.existsSync(path.join(cwd, 'next.config.mjs')) ||
184
- fs.existsSync(path.join(cwd, 'next.config.ts'))) {
183
+ if (existsSync(path.join(cwd, 'next.config.js')) ||
184
+ existsSync(path.join(cwd, 'next.config.mjs')) ||
185
+ existsSync(path.join(cwd, 'next.config.ts'))) {
185
186
  framework = 'nextjs';
186
- } else if (fs.existsSync(path.join(cwd, 'vite.config.ts')) ||
187
- fs.existsSync(path.join(cwd, 'vite.config.js'))) {
187
+ } else if (existsSync(path.join(cwd, 'vite.config.ts')) ||
188
+ existsSync(path.join(cwd, 'vite.config.js'))) {
188
189
  framework = 'vite';
189
- } else if (fs.existsSync(path.join(cwd, 'remix.config.js'))) {
190
+ } else if (existsSync(path.join(cwd, 'remix.config.js'))) {
190
191
  framework = 'remix';
191
- } else if (fs.existsSync(path.join(cwd, 'astro.config.mjs'))) {
192
+ } else if (existsSync(path.join(cwd, 'astro.config.mjs'))) {
192
193
  framework = 'astro';
193
194
  }
194
195
 
195
196
  // Check for UI libraries in package.json
196
197
  const pkgPath = path.join(cwd, 'package.json');
197
- if (fs.existsSync(pkgPath)) {
198
- const pkg = fs.readJsonSync(pkgPath);
198
+ if (existsSync(pkgPath)) {
199
+ const pkg = fsExtra.readJsonSync(pkgPath);
199
200
  const deps = { ...pkg.dependencies, ...pkg.devDependencies };
200
201
 
201
202
  if (deps['@shadcn/ui'] || deps['class-variance-authority']) {
@@ -211,7 +212,7 @@ export class Config {
211
212
 
212
213
  // Create .codebakers config
213
214
  const configDir = path.join(cwd, '.codebakers');
214
- fs.ensureDirSync(configDir);
215
+ fsExtra.ensureDirSync(configDir);
215
216
 
216
217
  const config = {
217
218
  name: path.basename(cwd),
@@ -221,14 +222,14 @@ export class Config {
221
222
  autoDetected: true,
222
223
  };
223
224
 
224
- fs.writeJsonSync(path.join(configDir, 'config.json'), config, { spaces: 2 });
225
+ fsExtra.writeJsonSync(path.join(configDir, 'config.json'), config, { spaces: 2 });
225
226
 
226
227
  // Add to .gitignore if exists
227
228
  const gitignorePath = path.join(cwd, '.gitignore');
228
- if (fs.existsSync(gitignorePath)) {
229
- const gitignore = fs.readFileSync(gitignorePath, 'utf-8');
229
+ if (existsSync(gitignorePath)) {
230
+ const gitignore = readFileSync(gitignorePath, 'utf-8');
230
231
  if (!gitignore.includes('.codebakers')) {
231
- fs.appendFileSync(gitignorePath, '\n# CodeBakers\n.codebakers/\n');
232
+ appendFileSync(gitignorePath, '\n# CodeBakers\n.codebakers/\n');
232
233
  }
233
234
  }
234
235
  } catch {
@@ -240,8 +241,8 @@ export class Config {
240
241
  getProjectConfig(): Record<string, unknown> | null {
241
242
  const cwd = process.cwd();
242
243
  const configPath = path.join(cwd, '.codebakers', 'config.json');
243
- if (fs.existsSync(configPath)) {
244
- return fs.readJsonSync(configPath);
244
+ if (existsSync(configPath)) {
245
+ return fsExtra.readJsonSync(configPath);
245
246
  }
246
247
  return null;
247
248
  }
@@ -1,7 +0,0 @@
1
- import {
2
- advisorsCommand
3
- } from "./chunk-FWQNLNTI.js";
4
- import "./chunk-RCC7FYEU.js";
5
- export {
6
- advisorsCommand
7
- };
@@ -1,7 +0,0 @@
1
- import {
2
- prdCommand
3
- } from "./chunk-YGVDLNXY.js";
4
- import "./chunk-RCC7FYEU.js";
5
- export {
6
- prdCommand
7
- };