feat: add Dart and Flutter support - #47
Merged
Merged
Conversation
Locks in the approach for initium dart/initium flutter commands, mirroring the existing per-language generator pattern.
Add Dart and Flutter project type detection by checking for pubspec.yaml with Flutter SDK dependencies or top-level flutter section. Includes placeholder generator modules for Dart and Flutter to be implemented in follow-up tasks. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… shim) - Run cargo fmt to fix rustfmt violations in mod.rs and (formerly) flutter.rs from the original commit. - Revert src/generators/dart.rs and flutter.rs to the brief's exact Step 6 placeholder (empty impl block, no methods) instead of the working stub methods added in 688e395, which belong to Tasks 2-7. Added #[allow(unused_imports)] to each since the bare InitiumError import otherwise fails the clippy -D warnings CI gate. - Replace the ~40-line Dart/Flutter match arms in handle_auto_generate (src/commands.rs) with a minimal compiling placeholder, since the exhaustive ProjectType match requires an arm for the two new variants. Full UX wiring is Task 10's scope.
…try point Adds get_dart_justfile_content (default/cli/package templates) and wires generate_dart/generate_dart_with_template as the Dart generator entry point, matching the Go generator's private-helper pattern. generate_dart_pubspec, generate_dart_analysis_options, and generate_dart_gitignore are made private (no longer needed pub since Task 3's direct-call test is superseded by integration coverage through generate_dart_with_template); the two analysis_options.yaml content assertions from that test were preserved by folding them into test_generate_dart_config.
…ate entry point Mirrors Task 4's Dart wiring: adds get_flutter_justfile_content (default/ package/plugin templates) and generate_flutter_with_template, which chains the basic config generator with the Flutter pubspec/analysis_options/ gitignore/justfile generators. Privatizes generate_flutter_pubspec/generate_flutter_analysis_options/ generate_flutter_gitignore (previously pub only so Task 6's integration test could call them directly), matching the Dart/Go precedent of pub entry point + private per-file helpers. Task 6's test_generate_flutter_analysis_options_and_gitignore is removed since it can no longer compile; its two content assertions (flutter_lints include, *.freezed.dart exclude) are folded into the new test_generate_flutter_config.
Add Commands::Dart/Flutter variants and dispatch in main.rs, plus handle_dart/handle_flutter in CommandHandler. Extend handle_auto_generate with ProjectType::Dart/Flutter arms (removing the Task 1 placeholder shim that would otherwise become an unreachable_patterns clippy error) and extend handle_list with Dart/Flutter file, template, and command entries.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
docs: add design spec for Dart and Flutter support
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
initium dart(templates:default,cli,package) andinitium flutter(templates:default,package,plugin) commands, mirroring the existing Ruby/Python/Node/Go/Rust/Bash generator patternpubspec.yaml,analysis_options.yaml,.gitignore, andjustfilefor each, plus the shared basic config filesProjectType::Dart/ProjectType::Flutterauto-detection via plain-textpubspec.yamlsniffing (no new YAML dependency)--hooks) for both languages, following the existing per-language hooks patternTest plan
just ci-local(rustfmt, clippy-D warnings, full suite) passescargo test— 148 passed, 9 suites, 0 failuresinitium dart --template packageandinitium flutter --template plugingenerate all expected files with correct contentsrc/generators/dart.rs95.8%,src/generators/flutter.rs97.5% (target 80%+)Spec:
docs/superpowers/specs/2026-07-12-dart-flutter-support-design.mdPlan:
docs/superpowers/plans/2026-07-12-dart-flutter-support.md