diff --git a/CHANGELOG.md b/CHANGELOG.md index 68deb09..4197189 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,16 @@ This project follows [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0. ## [Unreleased] +### Changed + +- **`telescope:install` now injects `import 'package:magic_devtools/telescope.dart';` and gates the Magic-stack wiring on the `magic_devtools` dependency** instead of the removed `package:magic/telescope_integration.dart`. Coordinated with the `magic_devtools` extraction that moved `MagicTelescopeIntegration` out of the magic core package. The injected `MagicTelescopeIntegration.install()` call and all other wiring are unchanged. + +## [0.0.4] - 2026-06-17 + +### Changed + +- **`fluttersdk_artisan` constraint bumped `^0.0.6` -> `^0.0.8`.** Required for co-installability with `fluttersdk_dusk` 0.0.7, which declares `fluttersdk_artisan: ^0.0.8`. Without this bump, a downstream package listing both `fluttersdk_dusk: ^0.0.7` and `fluttersdk_telescope` would fail pub dependency resolution. No public API change; constraint only. + ## [0.0.3] - 2026-05-28 ### Added diff --git a/example/pubspec.lock b/example/pubspec.lock index e0ebde5..f2f2a09 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -119,17 +119,17 @@ packages: dependency: transitive description: name: fluttersdk_artisan - sha256: "196e6fbd513036de002e70ac005d596f0837b91a70f09f64010fbad0b4b73122" + sha256: "008a29e38629ee1295a601fc9146d976ecf642b93e6dbe6750a9336ed4cac05c" url: "https://pub.dev" source: hosted - version: "0.0.6" + version: "0.0.8" fluttersdk_telescope: dependency: "direct main" description: path: ".." relative: true source: path - version: "0.0.3" + version: "0.0.4" http_parser: dependency: transitive description: diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 9e67d14..f6513a2 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: cupertino_icons: ^1.0.8 fluttersdk_telescope: path: ../ - version: 0.0.3 + version: 0.0.4 dio: ^5.7.0 logging: ^1.2.0 diff --git a/lib/src/commands/telescope_install_command.dart b/lib/src/commands/telescope_install_command.dart index f7c569c..41264e7 100644 --- a/lib/src/commands/telescope_install_command.dart +++ b/lib/src/commands/telescope_install_command.dart @@ -21,7 +21,7 @@ import 'package:fluttersdk_artisan/artisan.dart'; /// 3. Inject the runtime wiring into `lib/main.dart` via /// [MainDartEditor]: imports plus the `kDebugMode`-gated /// [TelescopePlugin.install] + [ExceptionWatcher] + [DumpWatcher] -/// block before `runApp(`. When the consumer's pubspec lists `magic` +/// block before `runApp(`. When the consumer's pubspec lists `magic_devtools` /// as a dependency AND `lib/main.dart` contains an `await Magic.init(` /// call, also injects `MagicTelescopeIntegration.install()` after it. /// All steps idempotent; re-runs are no-ops. @@ -133,7 +133,7 @@ class TelescopeInstallCommand extends ArtisanCommand { /// the canonical install anchor: `await Magic.init(` on Magic-stack /// apps (so ExceptionWatcher captures Magic boot errors), otherwise /// `runApp(` for vanilla Flutter apps. - /// 3c. When pubspec has `magic:` AND main.dart has `await Magic.init(`, + /// 3c. When pubspec has `magic_devtools:` AND main.dart has `await Magic.init(`, /// inject `MagicTelescopeIntegration.install()` after that call. static void _injectRuntimeWiring(ArtisanContext ctx, String mainDartPath) { ctx.output.info('Wiring TelescopePlugin into $mainDartPath...'); @@ -187,13 +187,13 @@ class TelescopeInstallCommand extends ArtisanCommand { FileHelper.writeFile(mainDartPath, source); } - // 3c. Magic-side coordinated wiring when the consumer pulls in magic. - // Detect via pubspec.yaml; skip silently when magic is not a dep or + // 3c. Magic-side coordinated wiring when the consumer pulls in magic_devtools. + // Detect via pubspec.yaml; skip silently when magic_devtools is not a dep or // when main.dart has no Magic.init() anchor (vanilla Flutter app). - if (_hasMagicDep()) { + if (_hasMagicDevtoolsDep()) { MainDartEditor.addImport( mainDartPath, - "import 'package:magic/telescope_integration.dart';", + "import 'package:magic_devtools/telescope.dart';", ); try { MainDartEditor.injectAfterMagicInit( @@ -209,11 +209,12 @@ class TelescopeInstallCommand extends ArtisanCommand { } } - /// Returns true when the consumer's pubspec.yaml lists `magic:` as a - /// top-level dependency (2-space indent under `dependencies:`). - static bool _hasMagicDep() { + /// Returns true when the consumer's pubspec.yaml lists `magic_devtools:` + /// (the package that ships MagicTelescopeIntegration) as a dependency or + /// dev_dependency (2-space indent). + static bool _hasMagicDevtoolsDep() { final pubspec = File('pubspec.yaml'); if (!pubspec.existsSync()) return false; - return RegExp(r'\n magic:').hasMatch(pubspec.readAsStringSync()); + return RegExp(r'\n magic_devtools:').hasMatch(pubspec.readAsStringSync()); } } diff --git a/pubspec.yaml b/pubspec.yaml index 53ee6a6..e8e2b79 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: fluttersdk_telescope description: "Passive runtime inspector for Flutter. Captures HTTP, logs, exceptions, DB queries, and Magic events via VM Service extensions. CLI tail and MCP tools for Claude Code." -version: 0.0.3 +version: 0.0.4 homepage: https://fluttersdk.com/telescope repository: https://github.com/fluttersdk/telescope issue_tracker: https://github.com/fluttersdk/telescope/issues @@ -25,7 +25,7 @@ environment: dependencies: flutter: sdk: flutter - fluttersdk_artisan: ^0.0.6 + fluttersdk_artisan: ^0.0.8 logging: ^1.2.0 meta: ^1.16.0 diff --git a/test/src/commands/telescope_install_command_test.dart b/test/src/commands/telescope_install_command_test.dart index eac3abd..b9399c9 100644 --- a/test/src/commands/telescope_install_command_test.dart +++ b/test/src/commands/telescope_install_command_test.dart @@ -191,15 +191,15 @@ void main() { }); // ------------------------------------------------------------------------- - // Magic-stack branch: pubspec lists `magic:` + main.dart has - // `await Magic.init(` ; injected magic import must reference the new - // opt-in sub-barrel (`package:magic/telescope_integration.dart`), NOT the - // legacy main barrel (`package:magic/magic.dart`). + // Magic-stack branch: pubspec lists `magic_devtools:` + main.dart has + // `await Magic.init(` ; injected magic import must reference the + // magic_devtools telescope barrel (`package:magic_devtools/telescope.dart`), + // NOT the removed package:magic sub-barrel. // ------------------------------------------------------------------------- test( - 'magic-stack app: injects import for the telescope_integration sub-barrel ' - '(not the legacy magic.dart main barrel) plus the integration install ' + 'magic-stack app: injects import for the magic_devtools telescope barrel ' + '(not the removed package:magic sub-barrel) plus the integration install ' 'call after Magic.init', () async { final tempDir = @@ -208,7 +208,7 @@ void main() { final mainDartPath = _seedProject( tempDir, - pubspecDeps: const {'magic': 'any'}, + pubspecDeps: const {'magic': 'any', 'magic_devtools': 'any'}, mainDartContents: ''' import 'package:flutter/material.dart'; import 'package:magic/magic.dart'; @@ -242,14 +242,15 @@ Future main() async { final result = File(mainDartPath).readAsStringSync(); - // The magic-detect branch (L187 ; _hasMagicDep + Magic.init anchor) - // must inject the opt-in sub-barrel; never the legacy main barrel. + // The magic-detect branch (_hasMagicDevtoolsDep + Magic.init anchor) + // must inject the magic_devtools telescope barrel; never the removed + // package:magic sub-barrel. expect( - result.contains("import 'package:magic/telescope_integration.dart';"), + result.contains("import 'package:magic_devtools/telescope.dart';"), isTrue, reason: - 'magic-stack inject must reference the new telescope_integration ' - 'sub-barrel, not the legacy magic.dart main barrel', + 'magic-stack inject must reference the magic_devtools telescope ' + 'barrel, not the removed package:magic sub-barrel', ); // Parity check: the integration install call still lands after