Skip to content

fix: ol --version shows the wrong version#60

Merged
scottlovegrove merged 2 commits into
mainfrom
copilot/fix-ol-versions-return
May 11, 2026
Merged

fix: ol --version shows the wrong version#60
scottlovegrove merged 2 commits into
mainfrom
copilot/fix-ol-versions-return

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 11, 2026

ol --version was reporting a stale hardcoded value from src/index.ts instead of the package’s actual release version. This caused version output drift whenever package.json was updated.

  • Version source correction

    • Updated CLI program metadata in src/index.ts to read version from package.json rather than a literal string.
    • Aligns runtime version output with published package metadata.
  • Impact

    • ol --version now reflects the current package version consistently across releases.
import packageJson from '../package.json' with { type: 'json' }

program
	.name('ol')
	.version(packageJson.version)

Copy link
Copy Markdown
Member

@doistbot doistbot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this update to dynamically pull the CLI version directly from package.json, which is a great maintainability improvement that ensures the runtime version always stays perfectly in sync with published releases. However, the current JSON import approach will cause a TypeScript build failure due to rootDir constraints, so the implementation will need to be adjusted to use a runtime file read instead.

Share FeedbackReview Logs

Comment thread src/index.ts Outdated
@AfzalivE AfzalivE changed the title Use package.json as the single source of truth for CLI version fix: Use package.json as the single source of truth for CLI version Apr 16, 2026
@AfzalivE AfzalivE changed the title fix: Use package.json as the single source of truth for CLI version fix: package.json as the single source of truth for CLI version Apr 16, 2026
@AfzalivE AfzalivE changed the title fix: package.json as the single source of truth for CLI version fix: ol --version shows the wrong version Apr 16, 2026
@AfzalivE AfzalivE changed the title fix: ol --version shows the wrong version fix: ol --version shows the wrong version Apr 16, 2026
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@scottlovegrove scottlovegrove merged commit 3ed8b10 into main May 11, 2026
4 checks passed
@scottlovegrove scottlovegrove deleted the copilot/fix-ol-versions-return branch May 11, 2026 15:24
doist-release-bot Bot added a commit that referenced this pull request May 11, 2026
## [1.5.3](v1.5.2...v1.5.3) (2026-05-11)

### Bug Fixes

* `ol --version` shows the wrong version ([#60](#60)) ([3ed8b10](3ed8b10))
@doist-release-bot
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.5.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants