Skip to content

fix: calculate next version tag for display on home page#1898

Merged
danielroe merged 2 commits intomainfrom
fix/tags
Mar 3, 2026
Merged

fix: calculate next version tag for display on home page#1898
danielroe merged 2 commits intomainfrom
fix/tags

Conversation

@danielroe
Copy link
Member

@danielroe danielroe commented Mar 3, 2026

🔗 Linked issue

resolves #1899

🧭 Context

📚 Description

this extracts next-version calculation and also solves the issue where the last version tag was displayed

@danielroe danielroe requested a review from 43081j March 3, 2026 16:28
@vercel
Copy link

vercel bot commented Mar 3, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Mar 3, 2026 5:24pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Mar 3, 2026 5:24pm
npmx-lunaria Ignored Ignored Mar 3, 2026 5:24pm

Request Review

@codecov
Copy link

codecov bot commented Mar 3, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@danielroe danielroe mentioned this pull request Mar 3, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Version calculation was centralised into a new Node script scripts/next-version.ts that exports getNextVersion() returning { current, next, from }. GitHub Actions workflows .github/workflows/release-pr.yml and .github/workflows/release-tag.yml now set up Node and consume that script’s outputs instead of inline shell logic. config/env.ts delegates getVersion() to getNextVersion(). Unit tests were added/updated to assert semver-formatted outputs.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description references issue #1899 and explains the extraction of next-version calculation and fixing version tag display on the home page.
Linked Issues check ✅ Passed The pull request correctly addresses the linked issue #1899 by introducing a dedicated version calculation script and updating workflows to display the next version instead of the last tag.
Out of Scope Changes check ✅ Passed All changes are scoped to version calculation and display logic across workflows, configuration, and scripts, directly addressing the version display issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tags

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
test/unit/scripts/next-version.spec.ts (1)

20-30: Please add explicit bump-rule test cases.

These assertions are broad; they won’t catch regressions in conventional-commit handling (for example feat!: / fix!: behaviour in 0.x). Add deterministic cases by mocking Git output and asserting exact current/next/from results.

test/unit/config/env.spec.ts (1)

330-336: Consider restoring an explicit fallback-path test.

This now checks only format. Please add a case that forces getNextVersion() to throw and asserts getVersion() falls back to packageVersion, since that’s core runtime behaviour.


ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0020999 and 56207b1.

📒 Files selected for processing (6)
  • .github/workflows/release-pr.yml
  • .github/workflows/release-tag.yml
  • config/env.ts
  • scripts/next-version.ts
  • test/unit/config/env.spec.ts
  • test/unit/scripts/next-version.spec.ts

@danielroe danielroe merged commit 0d6e916 into main Mar 3, 2026
23 checks passed
@danielroe danielroe deleted the fix/tags branch March 3, 2026 17:27
@github-actions github-actions bot mentioned this pull request Mar 3, 2026
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.

Version 0.10.0

1 participant