Files
daffy0208__ai-dev-standards/scripts/bump-version.cjs
T
daffy0208 ec35acd490 chore: Release v2.0.0 - Phase 3 Complete + Infrastructure Improvements
Version 2.0.0 - Major Release
=============================

Phase 3 Design System Complete (75 Resources)
- 48 MCPs (exceeded 30 MCP goal)
- 216 total resources
- 92% skill-to-MCP coverage
- Complete aesthetic design system

Infrastructure Improvements
===========================

1. Version Management System
   - Added VERSION-POLICY.md with comprehensive versioning policy
   - Created scripts/bump-version.cjs for automated version bumping
   - Added npm scripts: version:major, version:minor, version:patch, release
   - Single source of truth: package.json

2. Validation System Fixes
   - Fixed scripts/validate-all.cjs (removed archived BUILD_FOCUS.md)
   - All validation checks now passing (45 skills, 48 MCPs)
   - 100% registry consistency

3. Documentation Enhancements
   - Added DOCS/CLAUDE-CODE-AGENTS.md
     * Documents Claude Code's Task tool (native subagents)
     * Explains relationship to custom agents (COMPONENTS/agents)
     * Clarifies parallel execution patterns
   - Fixed codex-review-workflow SKILL.md (added YAML frontmatter)

4. Registry Updates
   - skill-registry.json: 45 skills (added codex-review-workflow)
   - registry.json: 48 MCPs, 45 skills (synced)
   - All relationship mappings complete

5. Documentation Consistency
   - Updated all files to reflect v2.0.0 and correct counts
   - README.md, CHANGELOG.md, INSTALL.md, .cursorrules
   - DOCS/INDEX.md, DOCS/MCP-DEVELOPMENT-ROADMAP.md
   - .claude/claude.md (auto-synced)

Files Changed: 16
New Files: 3 (CLAUDE-CODE-AGENTS.md, VERSION-POLICY.md, bump-version.cjs)

Validation Status
=================
✅ All 22 validation checks passing
✅ 100% registry consistency
✅ 100% documentation consistency
✅ 0 critical errors

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-27 23:13:44 +00:00

135 lines
4.0 KiB
JavaScript

#!/usr/bin/env node
/**
* Unified Version Management Script
*
* Updates version consistently across:
* - package.json
* - README.md (header and Versioning section)
* - CHANGELOG.md (creates new section)
*
* Usage:
* npm run version:patch # 1.0.0 -> 1.0.1
* npm run version:minor # 1.0.0 -> 1.1.0
* npm run version:major # 1.0.0 -> 2.0.0
*/
const fs = require('fs');
const path = require('path');
const { execSync } = require('child_process');
const ROOT = path.join(__dirname, '..');
// Parse arguments
const bumpType = process.argv[2]; // 'major', 'minor', or 'patch'
const changeDescription = process.argv[3]; // Optional description
if (!['major', 'minor', 'patch'].includes(bumpType)) {
console.error('❌ Usage: node bump-version.cjs <major|minor|patch> [description]');
console.error(' npm run version:major "Phase 3 Complete - Design System"');
process.exit(1);
}
console.log(`🔄 Bumping ${bumpType} version...\n`);
// 1. Read current version from package.json (source of truth)
const packagePath = path.join(ROOT, 'package.json');
const packageJson = JSON.parse(fs.readFileSync(packagePath, 'utf-8'));
const currentVersion = packageJson.version;
// 2. Calculate new version
const [major, minor, patch] = currentVersion.split('.').map(Number);
let newVersion;
switch (bumpType) {
case 'major':
newVersion = `${major + 1}.0.0`;
break;
case 'minor':
newVersion = `${major}.${minor + 1}.0`;
break;
case 'patch':
newVersion = `${major}.${minor}.${patch + 1}`;
break;
}
console.log(`📦 Version: ${currentVersion} → ${newVersion}\n`);
// 3. Get current date
const date = new Date().toISOString().split('T')[0];
// 4. Update package.json
packageJson.version = newVersion;
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2) + '\n');
console.log('✅ Updated package.json');
// 5. Update README.md (header)
const readmePath = path.join(ROOT, 'README.md');
let readme = fs.readFileSync(readmePath, 'utf-8');
// Update header version
readme = readme.replace(
/\*\*Version \d+\.\d+\.\d+\*\*/,
`**Version ${newVersion}**`
);
// Update "Current Version" in Versioning section
readme = readme.replace(
/\*\*Current Version:\*\* \d+\.\d+\.\d+/,
`**Current Version:** ${newVersion}`
);
// Update version history section (add new entry at top)
const versionHistoryMarker = '**Version History:**';
const historyIndex = readme.indexOf(versionHistoryMarker);
if (historyIndex !== -1) {
const insertPoint = readme.indexOf('\n', historyIndex) + 1;
const newEntry = `- **${newVersion}** (${date}): ${changeDescription || 'Version bump'}\n`;
readme = readme.slice(0, insertPoint) + newEntry + readme.slice(insertPoint);
}
fs.writeFileSync(readmePath, readme);
console.log('✅ Updated README.md (header + versioning section)');
// 6. Update CHANGELOG.md
const changelogPath = path.join(ROOT, 'CHANGELOG.md');
let changelog = fs.readFileSync(changelogPath, 'utf-8');
// Find the insertion point (after the header, before first version)
const headerEnd = changelog.indexOf('---\n\n## ');
if (headerEnd !== -1) {
const insertPoint = headerEnd + 6; // After "---\n\n"
const newSection = `## [${newVersion}] - ${date}
### ${changeDescription || 'Changes'}
- Version bump to ${newVersion}
- ${changeDescription || 'See git log for details'}
---
`;
changelog = changelog.slice(0, insertPoint) + newSection + changelog.slice(insertPoint);
fs.writeFileSync(changelogPath, changelog);
console.log('✅ Updated CHANGELOG.md');
} else {
console.warn('⚠️ Could not find insertion point in CHANGELOG.md');
}
// 7. Git operations
console.log('\n📝 Git status:');
try {
const status = execSync('git status --short', { encoding: 'utf-8' });
console.log(status);
console.log('\n✨ Version bump complete!');
console.log(`\nNext steps:`);
console.log(` git add package.json README.md CHANGELOG.md`);
console.log(` git commit -m "chore: Bump version to ${newVersion}"`);
console.log(` git tag v${newVersion}`);
console.log(` git push origin main --tags`);
} catch (error) {
console.log('Run git commands manually');
}