Skip to content

Add an emit option to generate only client or server RPC files - #5

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

One schema can now be generated into a server and, separately, into a Composer package that only acts as a client and does not depend on php-skir/server.

What changes

  • New config option emit: both | client | server, default both, so existing configs keep today's output.
  • client writes the data classes, SkirMethods.php and SkirRpcClient.php. server writes everything except SkirRpcClient.php. The module method enum is server-only, because it implements Skir\Server\Contracts\SkirMethodReference.
  • Requires @php-skir/generator-core 0.4.0, which renders the selection (Add an emit option to render only client or server RPC files generator-core#3).
  • README: new "Client-only and server-only output" section. Skir allows only one entry per generator in a skir.yml, so the client package gets its own Skir root with a symlinked skir-src. The section shows that layout, the client package's own composer.json, and why validation stays off client roots: generated clients validate responses while hydrating them.
  • A new integration test runs real skir gen on that two-root layout. It installs the client package without php-skir/server and makes a client call.

Version is bumped to 0.5.0.

🤖 Generated with Claude Code

happyDemon and others added 2 commits November 11, 2026 15:30
emit: both | client | server selects which RPC files the generator writes.
client output needs no php-skir/server, so a separate Composer package can
receive the client side of the same schema from its own Skir root. both
(the default) keeps today's output.

Requires @php-skir/generator-core 0.4.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@happyDemon
happyDemon merged commit 44723f9 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