fix: update glob usage to modern async API

- Remove promisify wrapper for glob since modern glob package is already async
- Fix ERR_INVALID_ARG_TYPE error in v3-to-v4-upgrader.js
- This resolves GitHub Actions validation failures

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Brian Madison
2025-06-15 14:13:09 -05:00
parent ebdafa41b6
commit 927515c089

View File

@@ -1,8 +1,6 @@
const fs = require("fs").promises; const fs = require("fs").promises;
const path = require("path"); const path = require("path");
const glob = require("glob"); const { glob } = require("glob");
const { promisify } = require("util");
const globAsync = promisify(glob);
// Dynamic imports for ES modules // Dynamic imports for ES modules
let chalk, ora, inquirer; let chalk, ora, inquirer;
@@ -242,17 +240,17 @@ class V3ToV4Upgrader {
} }
// Find epic files // Find epic files
const epicFiles = await globAsync("epic*.md", { cwd: docsPath }); const epicFiles = await glob("epic*.md", { cwd: docsPath });
// Find story files // Find story files
const storiesPath = path.join(docsPath, "stories"); const storiesPath = path.join(docsPath, "stories");
let storyFiles = []; let storyFiles = [];
if (await this.pathExists(storiesPath)) { if (await this.pathExists(storiesPath)) {
storyFiles = await globAsync("*.md", { cwd: storiesPath }); storyFiles = await glob("*.md", { cwd: storiesPath });
} }
// Count custom files in bmad-agent // Count custom files in bmad-agent
const bmadAgentFiles = await globAsync("**/*.md", { const bmadAgentFiles = await glob("**/*.md", {
cwd: bmadAgentPath, cwd: bmadAgentPath,
ignore: ["node_modules/**"], ignore: ["node_modules/**"],
}); });
@@ -747,13 +745,11 @@ class V3ToV4Upgrader {
async createInstallManifest(projectPath) { async createInstallManifest(projectPath) {
const fileManager = require("../installer/lib/file-manager"); const fileManager = require("../installer/lib/file-manager");
const glob = require("glob"); const { glob } = require("glob");
const { promisify } = require("util");
const globAsync = promisify(glob);
// Get all files in .bmad-core for the manifest // Get all files in .bmad-core for the manifest
const bmadCorePath = path.join(projectPath, ".bmad-core"); const bmadCorePath = path.join(projectPath, ".bmad-core");
const files = await globAsync("**/*", { const files = await glob("**/*", {
cwd: bmadCorePath, cwd: bmadCorePath,
nodir: true, nodir: true,
ignore: ["**/.git/**", "**/node_modules/**"], ignore: ["**/.git/**", "**/node_modules/**"],