feat: migrate CLI off magic_cli to fluttersdk_artisan#6
Merged
Conversation
…rtisan Pin fluttersdk_artisan ^0.0.7 and drop the committed dependency_overrides. Rewrite install onto ArtisanInstallCommand + install.yaml + transactional PluginInstaller (hybrid: UUID fail-fast, web prompts code-gated, OneSignalSDKWorker.js write, idempotent head-script via HtmlEditor.hasContent; transactional writes staged before helper injects). Drop bin/ entrypoint, expose read-only mcpTools (notifications_doctor, notifications_channels), purge magic_cli/Kernel from tests, update docs/rules/CHANGELOG. BREAKING CHANGE: bin/magic_notifications.dart removed. Use dart run <app>:artisan notifications:<cmd> via the host app's artisan provider registration.
Add a Flutter-free top-level lib/cli.dart barrel and rename the provider to Magic<Pkg>ArtisanProvider so fluttersdk_artisan's plugin discovery (package:<pkg>/cli.dart + <PascalCase(pkg)>ArtisanProvider) generates a compilable _plugins.g.dart in the consumer app. Without this, plugin:install emitted an import of a non-existent barrel/class and the host app failed to compile.
There was a problem hiding this comment.
Pull request overview
Migrates the Magic Notifications CLI from the legacy magic_cli/Kernel model to the host-app fluttersdk_artisan model, exposing commands via an ArtisanServiceProvider and adding a read-only MCP tool surface for diagnostics.
Changes:
- Remove the standalone
bin/magic_notifications.dartentrypoint; commands now surface via the host app’s artisan binary (notifications:*). - Introduce/rename the artisan provider to
MagicNotificationsArtisanProviderand add MCP tool descriptors fornotifications_doctorandnotifications_channels. - Refactor
InstallCommandto a hybrid manifest + fluent override model and update tests/docs accordingly.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| test/cli/readme_test.dart | Updates README expectation to artisan invocation format. |
| test/cli/publish_command_test.dart | Switches tests from Kernel-based dispatch to direct ArtisanContext handling. |
| test/cli/notifications_artisan_provider_test.dart | Adds provider MCP tool surface tests (2 read-only tools). |
| test/cli/install_command_test.dart | Reworks install tests for ArtisanInstallCommand + manifest/override behavior and adds idempotency/dry-run coverage. |
| test/cli/e2e_test.dart | Replaces process-based CLI e2e with provider-surface assertions. |
| test/cli/commands/uninstall_command_test.dart | Migrates uninstall tests to artisan context execution. |
| test/cli/commands/doctor_command_test.dart | Updates doctor tests to artisan context and validates verbose output behavior. |
| README.md | Updates CLI invocation/documentation and notes MCP tool availability. |
| pubspec.yaml | Pins fluttersdk_artisan to a released version and removes local override. |
| lib/src/cli/notifications_artisan_provider.dart | Renames provider, sets providerName, registers commands, and defines MCP tool descriptors. |
| lib/src/cli/commands/install_command.dart | Major refactor: manifest parsing + transactional installer + fluent overrides + plan resolution. |
| lib/src/cli/commands/doctor_command.dart | Switches to using src/cli/cli.dart barrel import (avoids redundant artisan import). |
| lib/src/cli/cli.dart | Defines CLI barrel exports and hides artisan’s built-in DoctorCommand. |
| lib/cli.dart | Adds public CLI-only barrel export for consumers. |
| install.yaml | Updates manifest narrative and post-install messaging for hybrid install. |
| CLAUDE.md | Updates project guidance to artisan-based CLI architecture. |
| CHANGELOG.md | Documents breaking changes and CLI migration. |
| bin/magic_notifications.dart | Removes standalone CLI entrypoint. |
| .claude/rules/cli.md | Updates internal CLI domain rules to artisan model and narrows path scope. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Add explicit CommandBoot.none override to InstallCommand (consistency with sibling commands) - Align docs/CHANGELOG/rules to MagicNotificationsArtisanProvider; correct the install.yaml ordering comment (transactional writes first, helper-backed provider injection after) and the config-publish wording - Make uninstall confirmation injectable (confirmRemoval) so tests no longer depend on real stdin - Use host-dispatched invocation (dart run <app>:artisan ...) across all command docstrings and messages
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
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.
Syncs 0 local commit(s) to
master.Commits