Skip to content

feat: upgrade to Effect v4 beta and modernize CLI implementation#19

Open
adelrodriguez wants to merge 1 commit intomainfrom
03-20-feat_upgrade_to_effect_v4_beta_and_modernize_cli_implementation
Open

feat: upgrade to Effect v4 beta and modernize CLI implementation#19
adelrodriguez wants to merge 1 commit intomainfrom
03-20-feat_upgrade_to_effect_v4_beta_and_modernize_cli_implementation

Conversation

@adelrodriguez
Copy link
Copy Markdown
Owner

This pull request upgrades the Effect ecosystem dependencies from version 3.x to 4.0.0-beta.33, which includes significant API changes and modernizations.

Key Changes:

  • Effect Core: Upgraded from effect@3.19.14 to effect@4.0.0-beta.33
  • Platform Dependencies: Consolidated from separate @effect/cli, @effect/platform, and @effect/platform-node packages to just @effect/platform-node@4.0.0-beta.33

API Migrations:

  • CLI Framework: Migrated from @effect/cli to the new built-in effect/unstable/cli module

    • ArgsArgument
    • OptionsFlag
    • Command.run() now requires only version parameter instead of name and version
  • Platform Services:

    • @effect/platform/FileSystemeffect/FileSystem
    • @effect/platform/Patheffect/Path
    • NodeContext.layerNodeServices.layer
  • Process Management: Replaced @effect/platform/Command with effect/unstable/process/ChildProcess for better process control and type safety

  • Schema Updates: Schema.decodeUnknown()Schema.decodeUnknownEffect() and updated JSON parsing patterns

  • Error Handling: Enhanced error handling with improved CLI error detection and more detailed error messages

Dependency Updates:

  • Added ioredis support with related Redis dependencies
  • Updated various utility packages (mime, undici, uuid, etc.) to newer versions
  • Removed several intermediate Effect packages that are now consolidated

The changes maintain backward compatibility in functionality while adopting the new Effect v4 patterns and improved type safety.

Copy link
Copy Markdown
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@adelrodriguez adelrodriguez marked this pull request as ready for review March 20, 2026 15:52
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 626ed09c15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +20 to +24
Effect.catch((error: unknown) => {
if (CliError.isCliError(error)) {
return Console.error(error.message)
}
return Console.error(messageFromUnknown(error) ?? String(error))
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve non-zero exit codes for CLI parse failures

This top-level Effect.catch converts every CliError into Console.error(...), which makes argument/usage failures succeed from the shell’s perspective. In practice, commands like sakuga render with no input or sakuga git --commits 0 README.md will print an error but exit with status 0, which breaks CI and scripts that rely on the process status. The previous entry point only swallowed a few specific parser errors; this now catches the entire CLI failure channel.

Useful? React with 👍 / 👎.

Comment on lines +39 to +44
const handle = yield* ChildProcess.make(GIT_BINARY, args, {
cwd,
stderr: "pipe",
stdin: "ignore",
stdout: "pipe",
})
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Wrap ChildProcess.make failures in GitCommandFailed

runGitString() no longer maps failures from ChildProcess.make(...) itself, only the later stream/exit-code reads. If git is missing from PATH, the working directory has disappeared, or process spawn is otherwise denied, the failure escapes as a raw platform error. resolveGitRepoRoot() only recovers GitCommandFailed, and src/commands/git.ts only formats tagged git errors, so these cases bypass the intended user-facing diagnostics entirely.

Useful? React with 👍 / 👎.

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