Skip to content

[codex] trim package to openapi-effect#22

Merged
skulidropek merged 3 commits into
ProverCoderAI:mainfrom
skulidropek:codex/effect-client-infer-output
Jun 18, 2026
Merged

[codex] trim package to openapi-effect#22
skulidropek merged 3 commits into
ProverCoderAI:mainfrom
skulidropek:codex/effect-client-infer-output

Conversation

@skulidropek

Copy link
Copy Markdown
Member

Summary

  • Trim the package down to the openapi-effect client surface.
  • Keep createClientEffect<Paths>(options?) as the public API with openapi-fetch-compatible inputs and Effect output channels.
  • Remove template CLI/greeting code, playground artifacts, generated dispatcher/strict-client surface, Promise createClient public API, and unused dependencies.

Scenario Verified

The strict example compiles through tsc --noEmit and covers:

  • createClientEffect<Paths>(clientOptions) without per-call output schema.
  • apiClient.GET("/pets", { params: { query: { limit: 10 } } }) input compatibility.
  • Exhaustive success handling for status 200.
  • Effect.catchTags handling for HttpError, TransportError, UnexpectedStatus, UnexpectedContentType, ParseError, and DecodeError.
  • Export type Effect.Effect<void> after all errors are handled.

Validation

  • corepack pnpm --filter @prover-coder-ai/openapi-effect run typecheck
  • corepack pnpm --filter @prover-coder-ai/openapi-effect test — 88 tests passed
  • corepack pnpm --filter @prover-coder-ai/openapi-effect run build
  • corepack pnpm --filter @prover-coder-ai/openapi-effect run lint
  • corepack pnpm --filter @prover-coder-ai/openapi-effect run lint:effect
  • corepack pnpm --filter @prover-coder-ai/openapi-effect run lint:types
  • corepack pnpm --filter @prover-coder-ai/openapi-effect pack --dry-run

Notes

The root-level untracked scripts symlink was left untouched and is not part of this PR.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e93e4a9c-c9be-403f-baac-d8fe8f74317e

📥 Commits

Reviewing files that changed from the base of the PR and between c2e1985 and 891db34.

⛔ Files ignored due to path filters (5)
  • packages/app/src/generated/decoders.ts is excluded by !**/generated/**
  • packages/app/src/generated/dispatch.ts is excluded by !**/generated/**
  • packages/app/src/generated/dispatchers-by-path.ts is excluded by !**/generated/**
  • packages/app/src/generated/index.ts is excluded by !**/generated/**
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (27)
  • packages/app/eslint.config.mts
  • packages/app/examples/strict-error-handling.ts
  • packages/app/examples/test-create-client.ts
  • packages/app/package.json
  • packages/app/scripts/gen-strict-api.ts
  • packages/app/scripts/lint-types.sh
  • packages/app/src/app/main.ts
  • packages/app/src/app/program.ts
  • packages/app/src/core/axioms.ts
  • packages/app/src/core/greeting.ts
  • packages/app/src/index.ts
  • packages/app/src/shell/api-client/create-client-response.ts
  • packages/app/src/shell/api-client/create-client-runtime-types.ts
  • packages/app/src/shell/api-client/create-client-runtime.ts
  • packages/app/src/shell/api-client/create-client-types.ts
  • packages/app/src/shell/api-client/create-client.ts
  • packages/app/src/shell/api-client/index.ts
  • packages/app/src/shell/api-client/strict-client.ts
  • packages/app/src/shell/cli.ts
  • packages/app/tests/api-client/boundary-errors.test.ts
  • packages/app/tests/api-client/create-client-dispatchers.test.ts
  • packages/app/tests/api-client/generated-dispatchers.get-delete.test.ts
  • packages/app/tests/api-client/generated-dispatchers.test.ts
  • packages/app/tests/app/main.test.ts
  • packages/app/tests/core/greeting.test.ts
  • packages/app/tsconfig.json
  • packages/app/vite.config.ts

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced error handling with typed failure categories (HttpError, TransportError, UnexpectedStatus, UnexpectedContentType, ParseError, DecodeError).
  • Refactor

    • Streamlined API surface to focus on Effect-based OpenAPI client creation.
    • Simplified dependencies and removed template/demo code.
    • Updated build configuration to library-only output.
  • Removed

    • Removed CLI and greeting demo features.
    • Removed legacy client creation APIs and path-based client wrappers.

Walkthrough

The PR refactors packages/app from a broad CLI+dispatcher-based openapi client into a strict Effect-only API library. The non-strict response envelope is replaced by createStrictResponseEffect with typed failures. All legacy CLI, greeting, dispatcher, strict-client, and path-based client code is deleted. The public exports are narrowed to createClientEffect and serialization helpers. Build tooling, package metadata, lint scripts, and an example are updated accordingly.

Changes

Strict Effect API Refactor

Layer / File(s) Summary
Strict response Effect pipeline: types, response builder, runtime factory
packages/app/src/shell/api-client/create-client-runtime-types.ts, packages/app/src/shell/api-client/create-client-response.ts, packages/app/src/shell/api-client/create-client-runtime.ts
RuntimeFetchResponse and RuntimeClient are removed. createResponseEnvelope is replaced by createStrictResponseEffect returning RuntimeApiSuccess or typed RuntimeEffectFailure. createRuntimeClient/createCoreFetch are replaced by createRuntimeEffectClient/createCoreEffectFetch wiring the new strict response path.
Public API surface narrowing: axioms, types, create-client, index
packages/app/src/core/axioms.ts, packages/app/src/shell/api-client/create-client-types.ts, packages/app/src/shell/api-client/create-client.ts, packages/app/src/shell/api-client/index.ts, packages/app/src/index.ts
axioms.ts is trimmed to Json/asJson/asStrictApiClient/asMiddlewareResult. create-client-types.ts removes all dispatcher, path-based, and strict-client types. create-client.ts retains only createClientEffect. Shell and package index re-exports are narrowed to Effect-oriented types and serialization helpers.
Remove legacy CLI, greeting, app entrypoint, and related tests
packages/app/src/app/main.ts, packages/app/src/app/program.ts, packages/app/src/core/greeting.ts, packages/app/src/shell/cli.ts, packages/app/tests/app/main.test.ts, packages/app/tests/core/greeting.test.ts, packages/app/tests/api-client/*, packages/app/eslint.config.mts
Node runtime bootstrap, CLI argument parsing, GreetingVariant/formatGreeting, and the composed program effect are deleted. All dispatcher-based API client tests (boundary-errors, create-client-dispatchers, generated-dispatchers variants) and greeting tests are removed. ESLint suggest-members plugin is dropped.
Build config, package metadata, lint script, tsconfig, and updated example
packages/app/vite.config.ts, packages/app/package.json, packages/app/tsconfig.json, packages/app/scripts/lint-types.sh, packages/app/examples/strict-error-handling.ts
Vite config removes the CLI Rollup entry. package.json updates description, scripts, repository, keywords, and dependencies to effect/openapi-typescript-helpers. tsconfig.json adds the example to include. lint-types.sh splits ANY_PATTERN/UNKNOWN_PATTERN and expands the UNKNOWN_ALLOWED_FILES allowlist. The strict-error-handling example is rewritten to use createClientEffect with Effect.catchTags.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

🐰 Hop, hop, away with the old!
The dispatcher code? Sold, sold, sold.
createClientEffect now leads the way,
Strict typed errors here to stay.
No more CLI greetings to run—
Just openapi-effect, purely done! ✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@skulidropek

skulidropek commented Jun 18, 2026

Copy link
Copy Markdown
Member Author

AI Session Backup

Commit: 891db34
Status: success
Files: 7 (5.84 MB)
Links: README | Manifest

git status

On branch codex/effect-client-infer-output
Your branch is up to date with 'origin/codex/effect-client-infer-output'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	scripts

nothing added to commit but untracked files present (use "git add" to track)

@skulidropek skulidropek marked this pull request as ready for review June 18, 2026 12:39
@skulidropek skulidropek merged commit 7121329 into ProverCoderAI:main Jun 18, 2026
8 of 9 checks passed
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