From 927515c0895f94ce6fb0adf7cabe2f978c1ee108 Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Sun, 15 Jun 2025 14:13:09 -0500 Subject: [PATCH] fix: update glob usage to modern async API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- tools/upgraders/v3-to-v4-upgrader.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/upgraders/v3-to-v4-upgrader.js b/tools/upgraders/v3-to-v4-upgrader.js index 496fd364..6aa8cb4f 100644 --- a/tools/upgraders/v3-to-v4-upgrader.js +++ b/tools/upgraders/v3-to-v4-upgrader.js @@ -1,8 +1,6 @@ const fs = require("fs").promises; const path = require("path"); -const glob = require("glob"); -const { promisify } = require("util"); -const globAsync = promisify(glob); +const { glob } = require("glob"); // Dynamic imports for ES modules let chalk, ora, inquirer; @@ -242,17 +240,17 @@ class V3ToV4Upgrader { } // Find epic files - const epicFiles = await globAsync("epic*.md", { cwd: docsPath }); + const epicFiles = await glob("epic*.md", { cwd: docsPath }); // Find story files const storiesPath = path.join(docsPath, "stories"); let storyFiles = []; if (await this.pathExists(storiesPath)) { - storyFiles = await globAsync("*.md", { cwd: storiesPath }); + storyFiles = await glob("*.md", { cwd: storiesPath }); } // Count custom files in bmad-agent - const bmadAgentFiles = await globAsync("**/*.md", { + const bmadAgentFiles = await glob("**/*.md", { cwd: bmadAgentPath, ignore: ["node_modules/**"], }); @@ -747,13 +745,11 @@ class V3ToV4Upgrader { async createInstallManifest(projectPath) { const fileManager = require("../installer/lib/file-manager"); - const glob = require("glob"); - const { promisify } = require("util"); - const globAsync = promisify(glob); + const { glob } = require("glob"); // Get all files in .bmad-core for the manifest const bmadCorePath = path.join(projectPath, ".bmad-core"); - const files = await globAsync("**/*", { + const files = await glob("**/*", { cwd: bmadCorePath, nodir: true, ignore: ["**/.git/**", "**/node_modules/**"],