feat(console): render Cycle schema to PHP file (+roles filter, overwrite)#101
Merged
roxblnfk merged 4 commits intospiral:2.xfrom Oct 22, 2025
Merged
Conversation
roxblnfk
reviewed
Oct 9, 2025
…e filtering - New console command to export Cycle ORM schema into a PHP file - Filter by roles to limit the exported subset - Overwrite flag to safely replace existing file
828eaf1 to
85a4498
Compare
roxblnfk
reviewed
Oct 9, 2025
Member
|
And eah, please don't overwrite reviewed commits via |
Contributor
Author
Understood, sorry for rewriting them earlier and thanks for the advice :) |
- Make roles an optional argument (comma-separated). If omitted export full schema. - Add --format=php|mermaid|color|plain; default is color for ANSI-capable terminals, otherwise plain. - Allow --output for all formats; automatically overwrite existing files. - Update command description/help with usage examples.
simplify and apply code style
56483d3 to
43ab4fb
Compare
roxblnfk
approved these changes
Oct 22, 2025
Member
|
Good feature, thanks |
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.
cycle:renderWhat was changed
cycle:renderconsole command:-o, --output=/path/to/schema.php— writes rendered schema to a file (supported only forformat=php).--overwrite— allows replacing an existing output file.-r, --role=<role> [--role=<role> ...]— filters the rendered schema by roles; accepts multiple flags and comma-separated values (e.g.--role=auth,rbac --role=default).--outputis not provided, output goes to STDOUT as before.phpformats with--output, the command fails with an explicit error.Examples
Edge cases & messages
--output→ prints “Nothing to write.” and exits successfully;--output→ prints an empty line to STDOUT.--overwrite, the command fails with an explicit message.Why?
--outputenables file-based workflows.Checklist
Documentation
New options:
-o, --output=PATH— write rendered schema to a PHP file (supported only whenformat=php).--overwrite— allow replacing an existing output file.-r, --role=ROLE— filter exported schema by roles (for any format).Accepts multiple flags and comma-separated values inside a flag (e.g.
--role=auth,rbac --role=default).Role matching is case-insensitive; unknown roles are ignored with a warning.
Behavior & edge cases:
--outputthe command writes to STDOUT (unchanged behavior).--outputis used with a non-phpformat → the command fails with an explicit error.--output→ prints “Nothing to write.” and exits successfully;--output→ prints an empty line to STDOUT.Examples