Skip to content

Add an emit option to render only client or server RPC files - #3

Merged
happyDemon merged 2 commits into
mainfrom
emit-option
Nov 11, 2026
Merged

happyDemon merged 2 commits into
mainfrom
emit-option

Conversation

@happyDemon

Copy link
Copy Markdown
Member

Why

A generator can now produce the RPC files for one side only. The use case is one schema that a server generates into its own code and a separate Composer package receives as a client, without depending on php-skir/server.

What changes

  • generatePhp() and generateNormalizedPhp() accept emit: "both" | "client" | "server". The Emit Zod schema (default "both") is exported so that generators can reuse it in their config.
  • client renders SkirMethods and SkirRpcClient. It leaves out the module method enum, SkirProcedures, AbstractSkirProcedures, SkirProcedureProvider and skir-server-manifest.json; all of them need php-skir/server (the method enum implements SkirMethodReference).
  • server renders everything except SkirRpcClient, which needs php-skir/client.
  • Records are rendered for every value. both keeps today's output byte for byte.

Version is bumped to 0.4.0.

🤖 Generated with Claude Code

happyDemon and others added 2 commits November 11, 2026 15:26
generatePhp() and generateNormalizedPhp() accept emit: both | client | server.
client leaves out the method enum, the procedure contracts and the server
manifest, which need php-skir/server. server leaves out SkirRpcClient, which
needs php-skir/client. Records and SkirMethods are always rendered, and both
(the default) keeps today's output byte for byte.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@happyDemon
happyDemon merged commit 04396e0 into main Nov 11, 2026
4 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