Add three-layer preset system with config overlays#3
Merged
Conversation
e6729e3 to
66b5be1
Compare
Add comprehensive preset support allowing users to define custom configuration overlays for different Rails app types (API-only, minimal, etc.). Key Features: - Three-layer config merging: builtin → user → preset - CLI flags: --preset NAME and --default - Preset resolution: user presets override built-in gem presets - Config-overlay schema (questions/post_actions merged by id) - Both interactive and non-interactive modes with presets Architecture: - Config.load now accepts preset_path parameter - CLI preset resolution checks ~/.config/railstart/presets/ first, then falls back to gem's config/presets/ - Generator modes respect preset overlays for both use_defaults and interactive flows - Proper error handling: explicit --preset raises on missing file, --default silently falls back to builtin config Shipped Presets: - config/presets/default.yaml (PostgreSQL + Tailwind + Importmap) - config/presets/api-only.yaml (PostgreSQL + API mode + skip features) Tests: - test_preset_overlay_merges_on_top_of_user_config validates merge precedence - test_preset_changes_generator_default_behavior validates end-to-end behavior - All tests pass (30 runs, 80 assertions, 0 failures) Fixes: - CLI: Changed UndefinedCommandError → Thor::UndefinedCommandError - Generator: Always confirms before generation (even in --default mode) - Config: Proper deep merging with id-based array merging Documentation: - Updated README with preset examples and architecture - Added preset usage modes and configuration guide - Documented three-layer config system Version: 0.1.0 → 0.2.0
66b5be1 to
50e41b6
Compare
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.
Summary
--preset NAMEand--defaultfor preset selection and non-interactive defaultsKey Features
Architecture Changes
Changes
Test plan