From 3367fa18f711aef93da4196967e5b18ca8dd3faa Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Sat, 19 Jul 2025 00:04:16 -0500 Subject: [PATCH] version alignment --- bmad-core/core-config.yaml | 1 - .../bmad-2d-phaser-game-dev/config.yaml | 2 +- .../bmad-2d-unity-game-dev/config.yaml | 8 +-- .../bmad-infrastructure-devops/config.yaml | 2 +- package.json | 6 +- tools/bump-all-versions.js | 17 +++--- tools/bump-core-version.js | 56 ------------------- tools/installer/bin/bmad.js | 4 +- tools/installer/lib/file-manager.js | 11 ++-- tools/installer/lib/installer.js | 12 ++-- 10 files changed, 26 insertions(+), 93 deletions(-) delete mode 100644 tools/bump-core-version.js diff --git a/bmad-core/core-config.yaml b/bmad-core/core-config.yaml index 64312864..9f5276c1 100644 --- a/bmad-core/core-config.yaml +++ b/bmad-core/core-config.yaml @@ -1,4 +1,3 @@ -version: 4.29.0 markdownExploder: true prd: prdFile: docs/prd.md diff --git a/expansion-packs/bmad-2d-phaser-game-dev/config.yaml b/expansion-packs/bmad-2d-phaser-game-dev/config.yaml index da266b39..d37bbd72 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/config.yaml @@ -1,5 +1,5 @@ name: bmad-2d-phaser-game-dev -version: 1.10.0 +version: 1.11.0 short-title: Phaser 3 2D Game Dev Pack description: >- 2D Game Development expansion pack for BMad Method - Phaser 3 & TypeScript diff --git a/expansion-packs/bmad-2d-unity-game-dev/config.yaml b/expansion-packs/bmad-2d-unity-game-dev/config.yaml index 688ac159..560ac1fc 100644 --- a/expansion-packs/bmad-2d-unity-game-dev/config.yaml +++ b/expansion-packs/bmad-2d-unity-game-dev/config.yaml @@ -1,8 +1,6 @@ name: bmad-2d-unity-game-dev -version: 1.1.1 +version: 1.2.0 short-title: Unity C# 2D Game Dev Pack -description: >- - 2D Game Development expansion pack for BMad Method - Unity & C# - focused +description: 2D Game Development expansion pack for BMad Method - Unity & C# focused author: pbean (PinkyD) -slashPrefix: bmad2du \ No newline at end of file +slashPrefix: bmad2du diff --git a/expansion-packs/bmad-infrastructure-devops/config.yaml b/expansion-packs/bmad-infrastructure-devops/config.yaml index 3597ccc8..9961b22b 100644 --- a/expansion-packs/bmad-infrastructure-devops/config.yaml +++ b/expansion-packs/bmad-infrastructure-devops/config.yaml @@ -1,5 +1,5 @@ name: bmad-infrastructure-devops -version: 1.9.0 +version: 1.10.0 short-title: Infrastructure DevOps Pack description: >- This expansion pack extends BMad Method with comprehensive infrastructure and diff --git a/package.json b/package.json index ff29cf59..c64a8fd7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bmad-method", - "version": "4.30.2", + "version": "4.31.0", "description": "Breakthrough Method of Agile AI-driven Development", "main": "tools/cli.js", "bin": { @@ -18,10 +18,6 @@ "version:patch": "node tools/version-bump.js patch", "version:minor": "node tools/version-bump.js minor", "version:major": "node tools/version-bump.js major", - "version:core": "node tools/bump-core-version.js", - "version:core:major": "node tools/bump-core-version.js major", - "version:core:minor": "node tools/bump-core-version.js minor", - "version:core:patch": "node tools/bump-core-version.js patch", "version:expansion": "node tools/bump-expansion-version.js", "version:expansion:set": "node tools/update-expansion-version.js", "version:all": "node tools/bump-all-versions.js", diff --git a/tools/bump-all-versions.js b/tools/bump-all-versions.js index 7ee7261c..ef7fd60a 100755 --- a/tools/bump-all-versions.js +++ b/tools/bump-all-versions.js @@ -31,21 +31,20 @@ function bumpVersion(currentVersion, type) { async function bumpAllVersions() { const updatedItems = []; - // First, bump the core version - const coreConfigPath = path.join(__dirname, '..', 'bmad-core', 'core-config.yaml'); + // First, bump the core version (package.json) + const packagePath = path.join(__dirname, '..', 'package.json'); try { - const coreConfigContent = fs.readFileSync(coreConfigPath, 'utf8'); - const coreConfig = yaml.load(coreConfigContent); - const oldCoreVersion = coreConfig.version || '1.0.0'; + const packageContent = fs.readFileSync(packagePath, 'utf8'); + const packageJson = JSON.parse(packageContent); + const oldCoreVersion = packageJson.version || '1.0.0'; const newCoreVersion = bumpVersion(oldCoreVersion, bumpType); - coreConfig.version = newCoreVersion; + packageJson.version = newCoreVersion; - const updatedCoreYaml = yaml.dump(coreConfig, { indent: 2 }); - fs.writeFileSync(coreConfigPath, updatedCoreYaml); + fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2) + '\n'); updatedItems.push({ type: 'core', name: 'BMad Core', oldVersion: oldCoreVersion, newVersion: newCoreVersion }); - console.log(`✓ BMad Core: ${oldCoreVersion} → ${newCoreVersion}`); + console.log(`✓ BMad Core (package.json): ${oldCoreVersion} → ${newCoreVersion}`); } catch (error) { console.error(`✗ Failed to update BMad Core: ${error.message}`); } diff --git a/tools/bump-core-version.js b/tools/bump-core-version.js deleted file mode 100644 index b6e5e144..00000000 --- a/tools/bump-core-version.js +++ /dev/null @@ -1,56 +0,0 @@ -#!/usr/bin/env node - -const fs = require('fs'); -const path = require('path'); -const yaml = require('js-yaml'); - -// --- Argument parsing --- -const args = process.argv.slice(2); -const bumpType = args[0] || 'minor'; - -if (!['major', 'minor', 'patch'].includes(bumpType)) { - console.log('Usage: node bump-core-version.js [major|minor|patch]'); - console.log('Default: minor'); - process.exit(1); -} - -// --- Function to bump semantic version --- -function bumpVersion(version, type) { - const [major, minor, patch] = version.split('.').map(Number); - - return { - major: `${major + 1}.0.0`, - minor: `${major}.${minor + 1}.0`, - patch: `${major}.${minor}.${patch + 1}`, - }[type] || version; -} - -// --- Main function --- -function bumpCoreVersion() { - const configPath = path.join(__dirname, '..', 'bmad-core', 'core-config.yaml'); - - try { - const content = fs.readFileSync(configPath, 'utf8'); - const config = yaml.load(content); - - const oldVersion = config.version || '1.0.0'; - const newVersion = bumpVersion(oldVersion, bumpType); - - config.version = newVersion; - const updatedYaml = yaml.dump(config, { indent: 2 }); - - fs.writeFileSync(configPath, updatedYaml); - - console.log(`✓ BMad Core version bumped: ${oldVersion} → ${newVersion}\n`); - console.log('Next steps:'); - console.log(`1. Test your changes`); - console.log(`2. Commit:\n git add -A && git commit -m "chore: bump core version (${bumpType})"`); - - } catch (err) { - console.error(`✗ Failed to bump version: ${err.message}`); - process.exit(1); - } -} - -// --- Run --- -bumpCoreVersion(); diff --git a/tools/installer/bin/bmad.js b/tools/installer/bin/bmad.js index a8771c7a..c14833ec 100755 --- a/tools/installer/bin/bmad.js +++ b/tools/installer/bin/bmad.js @@ -165,13 +165,13 @@ async function promptInstallation() { let bmadOptionText; if (state.type === 'v4_existing') { const currentVersion = state.manifest?.version || 'unknown'; - const newVersion = coreConfig.version || 'unknown'; // Use version from core-config.yaml + const newVersion = version; // Always use package.json version const versionInfo = currentVersion === newVersion ? `(v${currentVersion} - reinstall)` : `(v${currentVersion} → v${newVersion})`; bmadOptionText = `Update ${coreShortTitle} ${versionInfo} .bmad-core`; } else { - bmadOptionText = `${coreShortTitle} (v${coreConfig.version || version}) .bmad-core`; + bmadOptionText = `${coreShortTitle} (v${version}) .bmad-core`; } choices.push({ diff --git a/tools/installer/lib/file-manager.js b/tools/installer/lib/file-manager.js index 08dd2e1c..d173f32d 100644 --- a/tools/installer/lib/file-manager.js +++ b/tools/installer/lib/file-manager.js @@ -116,15 +116,14 @@ class FileManager { this.manifestFile ); - // Read version from core-config.yaml - const coreConfigPath = path.join(resourceLocator.getBmadCorePath(), "core-config.yaml"); + // Read version from package.json let coreVersion = "unknown"; try { - const coreConfigContent = await fs.readFile(coreConfigPath, "utf8"); - const coreConfig = yaml.load(coreConfigContent); - coreVersion = coreConfig.version || "unknown"; + const packagePath = path.join(__dirname, '..', '..', '..', 'package.json'); + const packageJson = require(packagePath); + coreVersion = packageJson.version; } catch (error) { - console.warn("Could not read version from core-config.yaml, using 'unknown'"); + console.warn("Could not read version from package.json, using 'unknown'"); } const manifest = { diff --git a/tools/installer/lib/installer.js b/tools/installer/lib/installer.js index 250729fe..765e76fe 100644 --- a/tools/installer/lib/installer.js +++ b/tools/installer/lib/installer.js @@ -11,15 +11,13 @@ const resourceLocator = require("./resource-locator"); class Installer { async getCoreVersion() { - const yaml = require("js-yaml"); - const fs = require("fs-extra"); - const coreConfigPath = path.join(resourceLocator.getBmadCorePath(), "core-config.yaml"); try { - const coreConfigContent = await fs.readFile(coreConfigPath, "utf8"); - const coreConfig = yaml.load(coreConfigContent); - return coreConfig.version || "unknown"; + // Always use package.json version + const packagePath = path.join(__dirname, '..', '..', '..', 'package.json'); + const packageJson = require(packagePath); + return packageJson.version; } catch (error) { - console.warn("Could not read version from core-config.yaml, using 'unknown'"); + console.warn("Could not read version from package.json, using 'unknown'"); return "unknown"; } }