fix(version): Use versioned dev versions - #406
Conversation
While developing Claude skills that use the Clerk CLI, it's convenient to gate the skill on a minimum CLI version. However, when using a local dev version of the Clerk CLI, all versions would have the same version string `0.0.0-dev`. Instead, version dev versions based on the underlying version. Assuming the last release in `packages/cli/package.json` was 3.0.0: ``` 3.0.0-dev.20260803.f51f1e4 clean tree at commit f51f1e4 3.0.0-dev.20260803.f51f1e4.dirty ...with uncommitted changes 3.0.0-dev git unavailable, or not run from a checkout ``` I thought it was cleanest to include both the date and the commit, since the date provides human-readable information on how old your working tree is. But we can switch to just the commit, which would match our canary tags.
🦋 Changeset detectedLatest commit: 6c95f22 The changes in this PR will be included in the next version bump. This PR includes changesets to release 0 packagesWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe CLI replaces the fixed Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/cli-core/src/lib/version.ts`:
- Around line 80-81: Update the dirty-state detection in the version logic
around git() so untracked files are marked dirty as well as tracked
modifications. Use git status --porcelain --untracked-files=normal, or otherwise
query untracked paths separately, and preserve the existing ".dirty" suffix
behavior when any changes are present.
- Around line 93-96: Update resolveDevVersion and resolveCliVersion so an
injected CLI_VERSION containing -dev... is preserved as the complete runtime
version, including date and commit suffix. Prefer the injected development
version before describeCheckout or compiled-binary fallback, while retaining the
existing generated <base>-dev behavior when no injected version is available.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fbf94fcc-686d-4fcb-86ba-9912084a0534
📒 Files selected for processing (12)
.changeset/silent-weeks-decide.mdCLAUDE.mddocs/releasing.mdpackages/cli-core/src/commands/mcp/probe.tspackages/cli-core/src/commands/update/index.tspackages/cli-core/src/lib/credential-store.test.tspackages/cli-core/src/lib/update-check.test.tspackages/cli-core/src/lib/update-check.tspackages/cli-core/src/lib/user-agent.tspackages/cli-core/src/lib/version.test.tspackages/cli-core/src/lib/version.tsscripts/build.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
clerk/clerk_go(manual)clerk/dashboard(manual)clerk/accounts(manual)clerk/backoffice(manual)clerk/clerk(manual)clerk/clerk-docs(manual)clerk/cloudflare-workers(manual)
While developing Claude skills that use the Clerk CLI, it's convenient to gate the skill on a minimum CLI version. However, when using a local dev version of the Clerk CLI, all versions would have the same version string
0.0.0-dev.Instead, version dev versions based on the underlying version.
Assuming the last release in
packages/cli/package.jsonwas 3.0.0:I thought it was cleanest to include both the date and the commit, since the date provides human-readable information on how old your working tree is. But we can switch to just the commit, which would match our canary tags.