Skip to content

feat: migrate CLI off magic_cli to fluttersdk_artisan#6

Merged
anilcancakir merged 4 commits into
masterfrom
feat/cli-migration-to-fluttersdk-artisan
Jun 24, 2026
Merged

feat: migrate CLI off magic_cli to fluttersdk_artisan#6
anilcancakir merged 4 commits into
masterfrom
feat/cli-migration-to-fluttersdk-artisan

Conversation

@anilcancakir

Copy link
Copy Markdown
Contributor

Syncs 0 local commit(s) to master.

Commits

…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.
Copilot AI review requested due to automatic review settings June 16, 2026 15:27

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.dart entrypoint; commands now surface via the host app’s artisan binary (notifications:*).
  • Introduce/rename the artisan provider to MagicNotificationsArtisanProvider and add MCP tool descriptors for notifications_doctor and notifications_channels.
  • Refactor InstallCommand to 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.

Comment thread lib/src/cli/commands/install_command.dart
Comment thread install.yaml Outdated
Comment thread CHANGELOG.md Outdated
Comment thread CLAUDE.md Outdated
Comment thread .claude/rules/cli.md Outdated
Comment thread test/cli/commands/uninstall_command_test.dart Outdated
- 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
@anilcancakir
anilcancakir merged commit 6ac53ea into master Jun 24, 2026
1 check passed
@anilcancakir
anilcancakir deleted the feat/cli-migration-to-fluttersdk-artisan branch June 24, 2026 17:05
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 56.81818% with 57 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
lib/src/cli/commands/install_command.dart 58.06% 52 Missing ⚠️
lib/src/cli/commands/doctor_command.dart 0.00% 3 Missing ⚠️
lib/src/cli/commands/configure_command.dart 0.00% 1 Missing ⚠️
lib/src/cli/commands/uninstall_command.dart 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants