bonzai-burn 1.0.10 → 1.0.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bonzai-burn",
3
- "version": "1.0.10",
3
+ "version": "1.0.11",
4
4
  "description": "Git branch-based cleanup tool with bburn, baccept, and brevert commands",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -1,4 +1,14 @@
1
1
  {
2
2
  "headlessClaude": true,
3
- "autoBurn": false
3
+ "autoBurn": false,
4
+ "lineLimit": {
5
+ "enabled": true,
6
+ "limit": 70,
7
+ "prompt": "Split any file with over {{ linelimit }} lines into smaller files."
8
+ },
9
+ "folderLimit": {
10
+ "enabled": true,
11
+ "limit": 10,
12
+ "prompt": "Split any folder with over {{ folderlimit }} items into smaller, compartmentalized folders."
13
+ }
4
14
  }
@@ -2,8 +2,8 @@
2
2
 
3
3
  Define your cleanup requirements below. bburn will follow these instructions.
4
4
 
5
- ## Requirements:
5
+ ## Custom Requirements:
6
6
  - Remove unused imports and variables
7
- - Split any folder with over 10 items into smaller, compartmentalized folders.
8
7
  - Remove all console log statements
9
- - Split any folder with over 100 lines into smaller files
8
+ - Split any file with over {{ linelimit }} lines into smaller files
9
+ - Split any folder with over {{ folderlimit }} items into smaller, compartmentalized folders
package/src/baccept.js CHANGED
File without changes
package/src/bburn.js CHANGED
@@ -73,8 +73,29 @@ function loadConfig(configPath) {
73
73
  }
74
74
  }
75
75
 
76
- function loadSpecs(specsPath) {
77
- const content = fs.readFileSync(specsPath, 'utf-8');
76
+ function loadSpecs(specsPath, config) {
77
+ let content = fs.readFileSync(specsPath, 'utf-8');
78
+
79
+ // Process lineLimit if enabled
80
+ if (config.lineLimit?.enabled) {
81
+ content = content.replace(/\{\{\s*linelimit\s*\}\}/gi, config.lineLimit.limit);
82
+ } else {
83
+ // Remove lines containing {{ linelimit }} if disabled
84
+ content = content.split('\n')
85
+ .filter(line => !/\{\{\s*linelimit\s*\}\}/i.test(line))
86
+ .join('\n');
87
+ }
88
+
89
+ // Process folderLimit if enabled
90
+ if (config.folderLimit?.enabled) {
91
+ content = content.replace(/\{\{\s*folderlimit\s*\}\}/gi, config.folderLimit.limit);
92
+ } else {
93
+ // Remove lines containing {{ folderlimit }} if disabled
94
+ content = content.split('\n')
95
+ .filter(line => !/\{\{\s*folderlimit\s*\}\}/i.test(line))
96
+ .join('\n');
97
+ }
98
+
78
99
  return `You are a code cleanup assistant. Follow these specifications:\n\n${content}`;
79
100
  }
80
101
 
@@ -236,8 +257,8 @@ async function burn() {
236
257
 
237
258
  // Ensure bonzai directory and specs file exist
238
259
  const { specsPath, configPath } = ensureBonzaiDir();
239
- const specs = loadSpecs(specsPath);
240
260
  const config = loadConfig(configPath);
261
+ const specs = loadSpecs(specsPath, config);
241
262
 
242
263
  // Check if Claude CLI exists and execute
243
264
  console.log('🔍 Checking for Claude Code CLI...');