bonzai-burn 1.0.8 → 1.0.9

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.8",
3
+ "version": "1.0.9",
4
4
  "description": "Git branch-based cleanup tool with btrim and brevert commands",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -20,6 +20,6 @@
20
20
  },
21
21
  "files": [
22
22
  "src",
23
- "bonzai"
23
+ "payload-bonzai"
24
24
  ]
25
25
  }
package/src/btrim.js CHANGED
@@ -12,8 +12,8 @@ const BONZAI_DIR = 'bonzai';
12
12
  const SPECS_FILE = 'specs.md';
13
13
  const CONFIG_FILE = 'config.json';
14
14
 
15
- // Template folder in the package
16
- const TEMPLATE_DIR = join(__dirname, '..', 'bonzai');
15
+ // Template folder in the package (ships as payload-bonzai, copied as bonzai)
16
+ const TEMPLATE_DIR = join(__dirname, '..', 'payload-bonzai');
17
17
 
18
18
  function initializeBonzai() {
19
19
  const bonzaiPath = join(process.cwd(), BONZAI_DIR);
package/src/index.js CHANGED
@@ -1,24 +1,17 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, mkdirSync, writeFileSync } from 'fs';
3
- import { join } from 'path';
2
+ import { existsSync, mkdirSync, copyFileSync } from 'fs';
3
+ import { join, dirname } from 'path';
4
+ import { fileURLToPath } from 'url';
4
5
 
5
- const BONZAI_DIR = 'bonzai';
6
- const SPECS_FILE = 'specs.md';
7
-
8
- const DEFAULT_SPECS = `# Bonzai Specs
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = dirname(__filename);
9
8
 
10
- Define your cleanup requirements below. btrim will follow these instructions.
11
-
12
- ## Example:
13
- - Remove unused imports
14
- - Delete files matching pattern "*.tmp"
15
- - Clean up console.log statements
16
- `;
9
+ const BONZAI_DIR = 'bonzai';
10
+ const TEMPLATE_DIR = join(__dirname, '..', 'payload-bonzai');
17
11
 
18
12
  function init() {
19
13
  const currentDir = process.cwd();
20
14
  const bonzaiPath = join(currentDir, BONZAI_DIR);
21
- const specsPath = join(bonzaiPath, SPECS_FILE);
22
15
 
23
16
  if (existsSync(bonzaiPath)) {
24
17
  console.log(`📁 ${BONZAI_DIR}/ already exists`);
@@ -26,8 +19,9 @@ function init() {
26
19
  }
27
20
 
28
21
  mkdirSync(bonzaiPath, { recursive: true });
29
- writeFileSync(specsPath, DEFAULT_SPECS);
30
- console.log(`📁 Created ${BONZAI_DIR}/ folder with specs.md`);
22
+ copyFileSync(join(TEMPLATE_DIR, 'specs.md'), join(bonzaiPath, 'specs.md'));
23
+ copyFileSync(join(TEMPLATE_DIR, 'config.json'), join(bonzaiPath, 'config.json'));
24
+ console.log(`📁 Created ${BONZAI_DIR}/ folder with specs.md and config.json`);
31
25
  console.log(`📝 Edit ${BONZAI_DIR}/specs.md to define your cleanup rules`);
32
26
  console.log(`🔥 Run 'btrim' to start a cleanup session`);
33
27
  }
File without changes
File without changes