bmad-method 6.3.1-next.6 → 6.3.1-next.8

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,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "bmad-method",
4
- "version": "6.3.1-next.6",
4
+ "version": "6.3.1-next.8",
5
5
  "description": "Breakthrough Method of Agile AI-driven Development",
6
6
  "keywords": [
7
7
  "agile",
@@ -70,7 +70,6 @@
70
70
  "chalk": "^4.1.2",
71
71
  "commander": "^14.0.0",
72
72
  "csv-parse": "^6.1.0",
73
- "fs-extra": "^11.3.0",
74
73
  "glob": "^11.0.3",
75
74
  "ignore": "^7.0.5",
76
75
  "js-yaml": "^4.1.0",
@@ -19,7 +19,7 @@ module.exports = {
19
19
  const { bmadDir } = await installer.findBmadDir(projectDir);
20
20
 
21
21
  // Check if bmad directory exists
22
- const fs = require('fs-extra');
22
+ const fs = require('../fs-native');
23
23
  if (!(await fs.pathExists(bmadDir))) {
24
24
  await prompts.log.warn('No BMAD installation found in the current directory.');
25
25
  await prompts.log.message(`Expected location: ${bmadDir}`);
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const prompts = require('../prompts');
4
4
  const { Installer } = require('../core/installer');
5
5
 
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const yaml = require('yaml');
4
4
  const { Manifest } = require('./manifest');
5
5
 
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const { getProjectRoot } = require('../project-root');
4
4
  const { BMAD_FOLDER_NAME } = require('../ide/shared/path-utils');
5
5
 
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const { Manifest } = require('./manifest');
4
4
  const { OfficialModules } = require('../modules/official-modules');
5
5
  const { IdeManager } = require('../ide/manager');
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const yaml = require('yaml');
4
4
  const crypto = require('node:crypto');
5
5
  const csv = require('csv-parse/sync');
@@ -193,11 +193,13 @@ class ManifestGenerator {
193
193
  }
194
194
  }
195
195
 
196
- // Recurse into subdirectories
197
- for (const entry of entries) {
198
- if (!entry.isDirectory()) continue;
199
- if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue;
200
- await walk(path.join(dir, entry.name));
196
+ // Recurse into subdirectories — but not inside a discovered skill
197
+ if (!skillMeta) {
198
+ for (const entry of entries) {
199
+ if (!entry.isDirectory()) continue;
200
+ if (entry.name.startsWith('.') || entry.name.startsWith('_')) continue;
201
+ await walk(path.join(dir, entry.name));
202
+ }
201
203
  }
202
204
  };
203
205
 
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const crypto = require('node:crypto');
4
4
  const { getProjectRoot } = require('../project-root');
5
5
  const prompts = require('../prompts');
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('./fs-native');
2
2
  const path = require('node:path');
3
3
  const crypto = require('node:crypto');
4
4
 
@@ -0,0 +1,111 @@
1
+ // Drop-in replacement for fs-extra using native node:fs APIs.
2
+ // Eliminates graceful-fs monkey-patching that causes non-deterministic
3
+ // file loss during multi-module installs on macOS (issue #1779).
4
+ const fsp = require('node:fs/promises');
5
+ const fs = require('node:fs');
6
+ const path = require('node:path');
7
+
8
+ async function pathExists(p) {
9
+ try {
10
+ await fsp.access(p);
11
+ return true;
12
+ } catch {
13
+ return false;
14
+ }
15
+ }
16
+
17
+ async function ensureDir(dir) {
18
+ await fsp.mkdir(dir, { recursive: true });
19
+ }
20
+
21
+ async function remove(p) {
22
+ await fsp.rm(p, { recursive: true, force: true });
23
+ }
24
+
25
+ async function copy(src, dest, options = {}) {
26
+ const filterFn = options.filter;
27
+ const overwrite = options.overwrite !== false;
28
+ const srcStat = await fsp.stat(src);
29
+
30
+ if (srcStat.isFile()) {
31
+ if (filterFn && !(await filterFn(src, dest))) return;
32
+ await fsp.mkdir(path.dirname(dest), { recursive: true });
33
+ if (!overwrite) {
34
+ try {
35
+ await fsp.access(dest);
36
+ if (options.errorOnExist) throw new Error(`${dest} already exists`);
37
+ return;
38
+ } catch (error) {
39
+ if (error.message.includes('already exists')) throw error;
40
+ }
41
+ }
42
+ await fsp.copyFile(src, dest);
43
+ return;
44
+ }
45
+
46
+ if (srcStat.isDirectory()) {
47
+ if (filterFn && !(await filterFn(src, dest))) return;
48
+ await fsp.mkdir(dest, { recursive: true });
49
+ const entries = await fsp.readdir(src, { withFileTypes: true });
50
+ for (const entry of entries) {
51
+ await copy(path.join(src, entry.name), path.join(dest, entry.name), options);
52
+ }
53
+ }
54
+ }
55
+
56
+ async function move(src, dest) {
57
+ try {
58
+ await fsp.rename(src, dest);
59
+ } catch (error) {
60
+ if (error.code === 'EXDEV') {
61
+ await copy(src, dest);
62
+ await fsp.rm(src, { recursive: true, force: true });
63
+ } else {
64
+ throw error;
65
+ }
66
+ }
67
+ }
68
+
69
+ function readJsonSync(p) {
70
+ return JSON.parse(fs.readFileSync(p, 'utf8'));
71
+ }
72
+
73
+ async function writeJson(p, data, options = {}) {
74
+ const spaces = options.spaces ?? 2;
75
+ await fsp.writeFile(p, JSON.stringify(data, null, spaces) + '\n', 'utf8');
76
+ }
77
+
78
+ module.exports = {
79
+ // Native async (node:fs/promises)
80
+ readFile: fsp.readFile,
81
+ writeFile: fsp.writeFile,
82
+ stat: fsp.stat,
83
+ readdir: fsp.readdir,
84
+ access: fsp.access,
85
+ rename: fsp.rename,
86
+ unlink: fsp.unlink,
87
+ chmod: fsp.chmod,
88
+ mkdir: fsp.mkdir,
89
+ mkdtemp: fsp.mkdtemp,
90
+ copyFile: fsp.copyFile,
91
+ rm: fsp.rm,
92
+
93
+ // fs-extra compatible helpers (native implementations)
94
+ pathExists,
95
+ ensureDir,
96
+ remove,
97
+ copy,
98
+ move,
99
+ readJsonSync,
100
+ writeJson,
101
+
102
+ // Sync methods from core node:fs
103
+ existsSync: fs.existsSync.bind(fs),
104
+ readFileSync: fs.readFileSync.bind(fs),
105
+ writeFileSync: fs.writeFileSync.bind(fs),
106
+ createReadStream: fs.createReadStream.bind(fs),
107
+ pathExistsSync: fs.existsSync.bind(fs),
108
+
109
+ // Constants
110
+ constants: fs.constants,
111
+ };
@@ -1,6 +1,6 @@
1
1
  const os = require('node:os');
2
2
  const path = require('node:path');
3
- const fs = require('fs-extra');
3
+ const fs = require('../fs-native');
4
4
  const yaml = require('yaml');
5
5
  const prompts = require('../prompts');
6
6
  const csv = require('csv-parse/sync');
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('../fs-native');
2
2
  const path = require('node:path');
3
3
  const yaml = require('yaml');
4
4
 
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../../fs-native');
3
3
  const yaml = require('yaml');
4
4
 
5
5
  /**
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('./fs-native');
2
2
  const path = require('node:path');
3
3
  const yaml = require('yaml');
4
4
  const prompts = require('./prompts');
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('../fs-native');
2
2
  const os = require('node:os');
3
3
  const path = require('node:path');
4
4
  const { execSync } = require('node:child_process');
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('../fs-native');
2
2
  const os = require('node:os');
3
3
  const path = require('node:path');
4
4
  const { execSync } = require('node:child_process');
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('../fs-native');
2
2
  const os = require('node:os');
3
3
  const path = require('node:path');
4
4
  const { execSync } = require('node:child_process');
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('../fs-native');
3
3
  const yaml = require('yaml');
4
4
  const prompts = require('../prompts');
5
5
  const { getProjectRoot, getSourcePath, getModulePath } = require('../project-root');
@@ -1,4 +1,4 @@
1
- const fs = require('fs-extra');
1
+ const fs = require('../fs-native');
2
2
  const path = require('node:path');
3
3
  const yaml = require('yaml');
4
4
 
@@ -1,5 +1,5 @@
1
1
  const path = require('node:path');
2
- const fs = require('fs-extra');
2
+ const fs = require('./fs-native');
3
3
 
4
4
  /**
5
5
  * Find the BMAD project root directory by looking for package.json
@@ -1,6 +1,6 @@
1
1
  const path = require('node:path');
2
2
  const os = require('node:os');
3
- const fs = require('fs-extra');
3
+ const fs = require('./fs-native');
4
4
  const { CLIUtils } = require('./cli-utils');
5
5
  const { ExternalModuleManager } = require('./modules/external-manager');
6
6
  const { getProjectRoot } = require('./project-root');
@@ -3,7 +3,7 @@
3
3
  * This should be run once to update existing installations
4
4
  */
5
5
 
6
- const fs = require('fs-extra');
6
+ const fs = require('./installer/fs-native');
7
7
  const path = require('node:path');
8
8
  const yaml = require('yaml');
9
9
  const chalk = require('chalk');