Skip to content

fix --version outputting v0.0.0 and centralize VERSION as single source of truth#593

Merged
JeremyDev87 merged 2 commits intomasterfrom
fix/issue-592-version-single-source-of-truth
Feb 20, 2026
Merged

fix --version outputting v0.0.0 and centralize VERSION as single source of truth#593
JeremyDev87 merged 2 commits intomasterfrom
fix/issue-592-version-single-source-of-truth

Conversation

@JeremyDev87
Copy link
Owner

Summary

Fixes #592

npx codingbuddy --version was outputting v0.0.0 because version.utils.ts attempted to resolve package.json via readFileSync(join(__dirname, '..', '..', 'package.json')), which resolves to dist/src/package.json at runtime — a path that does not exist. The catch block silently returned '0.0.0'.

Root Cause

join(__dirname, '..', '..', 'package.json')
  → dist/src/package.json  ← does not exist
  → catch → return '0.0.0'

Changes

Core Fix (fix(version))

  • Add apps/mcp-server/src/shared/version.ts — single source of truth; exports VERSION = '4.3.0'
  • Refactor version.utils.ts — replace readFileSync path resolution with import { VERSION } from version.ts
  • Simplify version.utils.spec.ts — remove fs mock entirely; validate semver format and VERSION constant equality instead

Scripts (feat(scripts))

  • Add scripts/bump-version.sh — atomically updates version.ts and all package.json files in one command
    • Node.js-based file modification (cross-platform, no sed -i dependency)
    • Validates semver format (^[0-9]+\.[0-9]+\.[0-9]+$) before applying
    • Validates CWD is project root before running
  • Update scripts/verify-release-versions.sh — include version.ts VERSION constant in release verification checks

Verification

# Build and verify
yarn workspace codingbuddy build
node apps/mcp-server/dist/src/cli/cli.js --version
# → codingbuddy v4.3.0 ✅

# Tests
yarn workspace codingbuddy test --testPathPattern=version
# → 4 tests passed ✅

# Version bump script
./scripts/bump-version.sh 4.4.0
# → Updates version.ts + 3 package.json files atomically ✅

# Release verification
./scripts/verify-release-versions.sh
# → All 4 files match v4.3.0 ✅

Test Plan

  • version.utils.spec.ts — 4 tests pass (semver format, VERSION equality, fallback export)
  • E2E: npx codingbuddy --version outputs codingbuddy v4.3.0
  • bump-version.sh — semver validation, CWD check, atomic update of 5 files
  • verify-release-versions.sh — validates version.ts alongside package.json files

…sion outputting v0.0.0

- Add version.ts as single source of truth with VERSION constant
- Refactor version.utils.ts to import VERSION instead of readFileSync
- Simplify version.utils.spec.ts: remove fs mock, add semver format validation

Closes #592
….sh for version.ts

- Add bump-version.sh: atomically updates VERSION in version.ts and all package.json files
  - Cross-platform (Node.js-based, no sed -i dependency)
  - Validates semver format before applying changes
  - Validates CWD is project root before running
- Update verify-release-versions.sh: include version.ts VERSION constant in release verification
@JeremyDev87 JeremyDev87 added fix mcp-server apps/mcp-server priority:must Must Have - 반드시 필요, 없으면 릴리즈 불가 labels Feb 20, 2026
@vercel
Copy link

vercel bot commented Feb 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Feb 20, 2026 0:39am

@JeremyDev87 JeremyDev87 changed the title fix(version): fix --version outputting v0.0.0 and centralize VERSION as single source of truth fix --version outputting v0.0.0 and centralize VERSION as single source of truth Feb 20, 2026
@JeremyDev87 JeremyDev87 self-assigned this Feb 20, 2026
@JeremyDev87 JeremyDev87 merged commit b1be537 into master Feb 20, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the fix/issue-592-version-single-source-of-truth branch February 20, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix mcp-server apps/mcp-server priority:must Must Have - 반드시 필요, 없으면 릴리즈 불가

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: --version outputs v0.0.0 and centralize version as single source of truth

1 participant