Skip to content

chore: release v0.2.0#5

Merged
acossta merged 4 commits intomainfrom
release/v0.2.0
Aug 18, 2025
Merged

chore: release v0.2.0#5
acossta merged 4 commits intomainfrom
release/v0.2.0

Conversation

@acossta
Copy link
Owner

@acossta acossta commented Aug 18, 2025

Release v0.2.0

🎉 New Features

  • Comprehensive test coverage - 314 tests covering all critical paths
  • Coveralls integration - Automated coverage reporting with badges
  • Battle-tested cap table logic - UTC timezone consistency throughout
  • Property-based testing - Mathematical invariants with fast-check
  • Performance tests - Stress tested with 10,000+ transactions

📊 Test Coverage

  • Overall: 58.74% statements
  • Services: 96.37% (excellent coverage!)
  • Model: 90.93%
  • Store: 100%

🔧 Improvements

  • Enhanced SAFE conversion with iterative post-money calculations
  • Fixed vesting edge cases (leap years, month boundaries)
  • Improved date handling with UTC utilities
  • Added CI/CD workflows for Node 18 & 20

📦 Dependencies

  • Updated vitest to v3.2.4
  • Added @vitest/coverage-v8 for coverage generation
  • Added coveralls for coverage reporting
  • Added fast-check for property-based testing

This release significantly improves the reliability and maintainability of the codebase with comprehensive test coverage and continuous integration.

Summary by CodeRabbit

  • Chores
    • Bumped application version to 0.2.0.
    • Added preversion validation to run checks and tests before version bumps.
    • Consolidated pre-commit steps into a single validation run and clarified messages.
    • Added pre-push quality checks to validate, run all tests, and produce coverage before allowing pushes.
  • Documentation
    • Added coding standards guidance (CLAUDE.md) for TypeScript, Git, and testing practices.

@coderabbitai
Copy link

coderabbitai bot commented Aug 18, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Bumped package version and added a preversion script; consolidated pre-commit to run yarn validate and yarn test:all; added a new pre-push hook that runs validation, tests, and a coverage step before pushing. No public API changes.

Changes

Cohort / File(s) Summary
Version bump
package.json
Updated "version" from 0.1.0 to 0.2.0; added "preversion": "yarn validate && yarn test:all". No other fields changed.
Pre-commit hook update
.husky/pre-commit
Replaced yarn type-check with yarn validate (lint/format/type-check); renamed tests invocation to yarn test:all; updated comments/messages; lint-staged usage and exit behavior retained.
Pre-push hook added
.husky/pre-push
New shell hook that checks for release-tag adds, runs yarn validate (fail stops), runs yarn test:all (fail stops), runs yarn test:coverage:ci (warns on fail, continues), and prints a final success message on pass.
Docs / guidelines
CLAUDE.md
Added coding standards doc advising no any, avoiding --no-verify, and preferring Vitest for tests.

Sequence Diagram(s)

sequenceDiagram
  participant Dev as Developer (commit)
  participant HuskyPC as .husky/pre-commit
  participant Validate as yarn validate
  participant TestAll as yarn test:all
  participant LintStaged as lint-staged

  Dev->>HuskyPC: commit triggers pre-commit
  HuskyPC->>Validate: run yarn validate
  Validate-->>HuskyPC: success/fail
  HuskyPC->>TestAll: run yarn test:all
  TestAll-->>HuskyPC: success/fail
  HuskyPC->>LintStaged: run lint-staged
  LintStaged-->>HuskyPC: success/fail
  HuskyPC-->>Dev: allow or abort commit
Loading
sequenceDiagram
  participant Dev as Developer (push)
  participant HuskyPP as .husky/pre-push
  participant Git as git index
  participant Validate as yarn validate
  participant TestAll as yarn test:all
  participant Coverage as yarn test:coverage:ci

  Dev->>HuskyPP: push triggers pre-push
  HuskyPP->>Git: check staged files for ^v[0-9] (release-tag add)
  Git-->>HuskyPP: release-tag detected / not detected
  HuskyPP->>Validate: run yarn validate
  Validate-->>HuskyPP: success/fail (fail -> abort)
  HuskyPP->>TestAll: run yarn test:all
  TestAll-->>HuskyPP: success/fail (fail -> abort)
  HuskyPP->>Coverage: run yarn test:coverage:ci
  Coverage-->>HuskyPP: success/warn (warn -> continue)
  HuskyPP-->>Dev: allow or abort push
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

I hop, I patch, I tidy tracks,
A version bumped, no loose cracks.
I guard the push, I run the suite,
Tests and checks keep code neat.
🥕 — a rabbit on its feet.

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between f5efd84 and 21f383d.

📒 Files selected for processing (1)
  • CLAUDE.md (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch release/v0.2.0

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

- Run yarn validate for complete code quality checks
- Ensure all 314 tests pass before allowing commits
- Provides better code quality assurance
- Add pre-push hook to run validation and tests before pushing
- Add preversion script to ensure quality before version bumps
- Generates coverage report on push for Coveralls
- Ensures all 314 tests pass before releases
- Prevents broken code from being pushed or released
Copy link

@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: 0

🧹 Nitpick comments (2)
.husky/pre-commit (2)

19-25: Running all tests on every commit can slow down dev flow; gate by changed files or move to pre-push/CI.

For large suites (314 tests), running on every commit is heavy. Consider:

  • Run all tests in pre-push/CI.
  • In pre-commit, run tests only if relevant files changed.

Example change to gate the test step by staged changes:

-# Run all tests
-echo "🧪 Running all tests..."
-yarn test:all
-if [ $? -ne 0 ]; then
-  echo "❌ Tests failed. Please fix failing tests."
-  exit 1
-fi
+# Run tests only if relevant files changed (skip on docs/chore-only commits)
+CHANGED_FILES="$(git diff --name-only --cached)"
+if echo "$CHANGED_FILES" | grep -Eq '\.(ts|tsx|js|jsx|mjs|cjs|json)$|^(src|test|tests|__tests__|packages)/|(^package\.json$|^yarn\.lock$)'; then
+  echo "🧪 Running all tests..."
+  yarn test:all
+  if [ $? -ne 0 ]; then
+    echo "❌ Tests failed. Please fix failing tests."
+    exit 1
+  fi
+else
+  echo "🧪 Skipping tests (no code/test changes detected)."
+fi

Happy to tailor the match patterns to your repo layout (monorepo packages, specific src dirs, etc.) or to wire this into a pre-push hook instead.


11-16: Prevent file mutations in pre-commit hook

Current yarn validate runs mutating commands (eslint --fix via lint:fix and prettier --write via format), which will modify unstaged files and slow down commits. To keep pre-commits fast and read-only, either:

  • Run a check-only variant of validate
  • Or scope the hook to type-checking only

Affected locations:

  • .husky/pre-commit (lines 11–16)
  • package.json → scripts.validate (around line 21)

Example refactor for read-only pre-commit:

# .husky/pre-commit
- echo "🔧 Running full validation..."
- yarn validate
+ echo "🔧 Running pre-commit validation (read-only)…"
+ yarn validate:check
# package.json
 "scripts": {
-  "validate": "yarn lint:fix && yarn format && yarn type-check",
+  "validate": "yarn lint:fix && yarn format && yarn type-check",
+  "lint:check": "eslint 'src/**/*.{ts,tsx}'",
+  "format:check": "prettier --check 'src/**/*.{ts,tsx}'",
+  "validate:check": "yarn lint:check && yarn format:check && yarn type-check",
 }

Or, to only type-check in pre-commit and defer full validation to CI/pre-push:

# .husky/pre-commit
- echo "🔧 Running full validation..."
- yarn validate
+ echo "🔧 Running type-check only…"
+ yarn type-check
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 9859854 and 186c2a4.

📒 Files selected for processing (1)
  • .husky/pre-commit (1 hunks)

- TypeScript: Never use 'any' type, always use specific types
- Git: Never use --no-verify flag when committing
- Testing: Use vitest for all tests

These guidelines ensure code quality and maintain consistency across the project.
Copy link

@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: 0

🧹 Nitpick comments (5)
.husky/pre-push (5)

6-9: Tag detection is incorrect for pre-push; parse refs from STDIN instead of git diff.

git diff --cached looks at the index and won’t tell you what refs are being pushed; tags aren’t files. Pre-push receives refs on STDIN (refs/heads/, refs/tags/). Parse those to detect tag pushes.

Apply this diff to replace the current detection:

-# Check if we're pushing a tag (release)
-if git diff --cached --name-only --diff-filter=A | grep -q "^v[0-9]"; then
-  echo "📦 Detected release tag. Running full validation and tests..."
-fi
+# Detect if any pushed ref is a tag
+is_tag_push=false
+while read -r local_ref local_sha remote_ref remote_sha; do
+  case "$local_ref" in
+    refs/tags/*) is_tag_push=true ;;
+  esac
+done
+if [ "$is_tag_push" = "true" ]; then
+  echo "📦 Detected tag push. Running full validation and tests..."
+fi

11-17: Simplify exit checks; avoid manual $? handling.

Use negation to make intent clear and avoid subtle $? misuse if lines are reordered.

 echo "🔧 Running validation (lint, format, type-check)..."
-yarn validate
-if [ $? -ne 0 ]; then
-  echo "❌ Validation failed. Please fix errors before pushing."
-  exit 1
-fi
+if ! yarn validate; then
+  echo "❌ Validation failed. Please fix errors before pushing."
+  exit 1
+fi
@@
 echo "🧪 Running all tests (314 tests)..."
-yarn test:all
-if [ $? -ne 0 ]; then
-  echo "❌ Tests failed. Please fix failing tests before pushing."
-  exit 1
-fi
+if ! yarn test:all; then
+  echo "❌ Tests failed. Please fix failing tests before pushing."
+  exit 1
+fi

Also applies to: 19-25


20-20: Avoid hard-coding the test count in logs.

The “(314 tests)” annotation will drift and confuse contributors.

-echo "🧪 Running all tests (314 tests)..."
+echo "🧪 Running all tests..."

27-34: Make success messaging accurate when coverage generation fails.

Currently, you still print “All pre-push checks passed” even if coverage generation fails. Either gate on coverage or adjust the message.

-# Run coverage to ensure it's generated
-echo "📊 Generating coverage report..."
-yarn test:coverage:ci
-if [ $? -ne 0 ]; then
-  echo "⚠️  Coverage generation failed, but continuing..."
-fi
-
-echo "✅ All pre-push checks passed! Ready to push."
+# Run coverage to ensure it's generated
+echo "📊 Generating coverage report..."
+if yarn test:coverage:ci; then
+  echo "✅ All pre-push checks passed! Ready to push."
+else
+  echo "⚠️  Coverage generation failed (non-blocking)."
+  echo "✅ Validation and tests passed. Ready to push."
+fi

1-1: Optional: use a more portable shebang.

Using env helps on systems where sh isn’t at /bin/sh (rare, but occasionally relevant).

-#!/bin/sh
+#!/usr/bin/env sh
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 186c2a4 and f5efd84.

📒 Files selected for processing (2)
  • .husky/pre-push (1 hunks)
  • package.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

@acossta acossta merged commit 21f383d into main Aug 18, 2025
1 check was pending
@acossta acossta deleted the release/v0.2.0 branch August 18, 2025 18:04
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