Skip to content

fix(version): Use versioned dev versions - #406

Open
dmoerner wants to merge 2 commits into
mainfrom
daniel/fix-versioned-dev-version
Open

fix(version): Use versioned dev versions#406
dmoerner wants to merge 2 commits into
mainfrom
daniel/fix-versioned-dev-version

Conversation

@dmoerner

@dmoerner dmoerner commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

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.

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.
@dmoerner
dmoerner requested a review from rafa-thayto August 4, 2026 21:00
@changeset-bot

changeset-bot Bot commented Aug 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6c95f22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When 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

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 59e9f460-0809-4d24-bf2e-805a963361a5

📥 Commits

Reviewing files that changed from the base of the PR and between 7af0a7f and 6c95f22.

📒 Files selected for processing (5)
  • packages/cli-core/src/commands/mcp/probe.ts
  • packages/cli-core/src/lib/update-check.ts
  • packages/cli-core/src/lib/user-agent.ts
  • packages/cli-core/src/lib/version.test.ts
  • packages/cli-core/src/lib/version.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)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/cli-core/src/lib/update-check.ts
  • packages/cli-core/src/lib/version.ts

📝 Walkthrough

Walkthrough

The CLI replaces the fixed 0.0.0-dev value with checkout-derived development versions. Versions can include the package version, date, short commit SHA, and .dirty suffix. Git failures use a dev fallback. Runtime consumers, update checks, local builds, tests, and versioning documentation now use the shared resolution APIs. Release builds continue to use explicit CLI_VERSION values.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: rafa-thayto

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing fixed development versions with versioned development versions.
Description check ✅ Passed The description directly explains the new checkout-derived development version format and its purpose for local CLI builds.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between f51f1e4 and 7af0a7f.

📒 Files selected for processing (12)
  • .changeset/silent-weeks-decide.md
  • CLAUDE.md
  • docs/releasing.md
  • packages/cli-core/src/commands/mcp/probe.ts
  • packages/cli-core/src/commands/update/index.ts
  • packages/cli-core/src/lib/credential-store.test.ts
  • packages/cli-core/src/lib/update-check.test.ts
  • packages/cli-core/src/lib/update-check.ts
  • packages/cli-core/src/lib/user-agent.ts
  • packages/cli-core/src/lib/version.test.ts
  • packages/cli-core/src/lib/version.ts
  • scripts/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)

Comment thread packages/cli-core/src/lib/version.ts Outdated
Comment thread packages/cli-core/src/lib/version.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant