Repository navigation
Add an emit option to generate only client or server RPC files - #5
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
emit: both | client | server, defaultboth, so existing configs keep today's output.clientwrites the data classes,SkirMethods.phpandSkirRpcClient.php.serverwrites everything exceptSkirRpcClient.php. The module method enum is server-only, because it implementsSkir\Server\Contracts\SkirMethodReference.@php-skir/generator-core0.4.0, which renders the selection (Add an emit option to render only client or server RPC files generator-core#3).skir.yml, so the client package gets its own Skir root with a symlinkedskir-src. The section shows that layout, the client package's owncomposer.json, and whyvalidationstays off client roots: generated clients validate responses while hydrating them.skir genon that two-root layout. It installs the client package withoutphp-skir/serverand makes a client call.Version is bumped to 0.5.0.
🤖 Generated with Claude Code