Skip to content

refactor(cli): read version with Effect#7

Merged
willmruzek merged 1 commit intomainfrom
refactor/read-version-w-effect
May 4, 2026
Merged

refactor(cli): read version with Effect#7
willmruzek merged 1 commit intomainfrom
refactor/read-version-w-effect

Conversation

@willmruzek
Copy link
Copy Markdown
Owner

@willmruzek willmruzek commented May 4, 2026

Summary by CodeRabbit

  • Chores
    • Updated project dependencies to support enhanced platform capabilities.
    • Refactored internal version loading mechanism for improved code maintainability.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7757fb38-6a0c-4e21-8b87-53315405f8f0

📥 Commits

Reviewing files that changed from the base of the PR and between fe5e901 and c5afd98.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • package.json
  • src/main.ts

📝 Walkthrough

Walkthrough

The PR migrates the CLI version-reading logic from Node.js fs/promises with zod validation to an Effect.js-based implementation, adding @effect/platform, @effect/platform-node, and package-directory as runtime dependencies.

Changes

Effect.js Migration for CLI Version Loading

Layer / File(s) Summary
Dependencies
package.json
Added @effect/platform, @effect/platform-node, and package-directory to support Effect.js-based file system operations and package root detection.
Core Implementation
src/main.ts
Replaced fs/promises + zod with Effect.js Schema and FileSystem service; readCliVersion() now locates package root via package-directory, reads package.json through the Effect FileSystem service, validates the JSON schema, and returns the version via Effect.runPromise with nodeFileSystemLayer injected.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A hop through Effect's sturdy gate,
Where schemas validate our fate,
The file system finds its way so true,
Through dependency injection—something new!
Version read with functional grace,

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: refactoring the CLI version reading logic to use the Effect library instead of direct fs/promises and zod.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/read-version-w-effect

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

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

@willmruzek willmruzek merged commit 7119e4f into main May 4, 2026
7 checks passed
@willmruzek willmruzek deleted the refactor/read-version-w-effect branch May 4, 2026 15:58
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