magic_devtools 0.0.3
magic_devtools: ^0.0.3 copied to clipboard
Magic adapters for the fluttersdk dev-tooling ecosystem: wires MagicDuskIntegration and MagicTelescopeIntegration into dusk and telescope.
Changelog #
All notable changes to this package are documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased] #
0.0.3 - 2026-08-05 #
Documentation only; no runtime change. The package code is identical to 0.0.2.
Changed #
- The README install snippet pins the versions actually shipped rather than a looser range, so a copy-paste resolves to the combination this package is tested against.
.github/workflows/publish.ymlnames the pub.dev prerequisite it cannot check for itself. Automated publishing has to be enabled per package on pub.dev, and without it a tag gets all the way through validate, a clean--dry-runand the upload before pub.dev refuses; that is what left 0.0.2 unpublished for a week while consumers requiring^0.0.2could not resolve at all. That setting is still off, so this release was published by hand as well.
0.0.2 - 2026-07-29 #
Added #
MagicDevtoolsumbrella wiring: a newpackage:magic_devtools/magic_devtools.dartbarrel exposingMagicDevtools.installPre()/MagicDevtools.installPost().installPreboots both tool plugins and registers telescope's opt-inExceptionWatcher+DumpWatcher(call beforeMagic.init());installPostwiresMagicTelescopeIntegration+MagicDuskIntegration(call afterMagic.init()). Collapses the previous fourkDebugModeblocks in a host'slib/main.dartinto two, while preserving the load-bearing pre/post ordering and the call-sitekDebugModeguard (moving the guard inside would defeat the release tree-shake).MagicPreviewframework: a dev-only component preview catalog hosted via two plain pages (/previewand/preview/:component). Newpackage:magic_devtools/preview.dartbarrel exports thePreviewEntrycontract (label,slug,builder), theMagicPreviewCatalogwidget (a scrollable sidebar next to a SINGLE active preview pane — tapping a sidebar item, or deep-linking/preview/<slug>, swaps the pane to that entry; only the selected preview is mounted, so a large screen-heavy catalog stays responsive — plus a global light/dark toggle bound to wind'sWindTheme.of(context).toggleTheme()), and theMagicPreviewregistration entrypoint (registerplusregisterRoutes). The route, catalog, and every registeredPreviewEntryare reachable only throughMagicPreview.registerRoutes, which is guarded bykReleaseModeplusconst bool.fromEnvironment('PREVIEW_ENABLED', defaultValue: kDebugMode), so the whole surface const-folds dead and tree-shakes out of release builds. Entries are held in a function-scoped list (never a top-level const, the dart-lang/sdk#33920 foot-gun). The generated_previews.g.dart(Step 18) feeds aList<PreviewEntry>intoMagicPreview.register. Consumers must callMagicPreview.registerRoutes()from a providerboot()BEFORE the router locks on firstrouterConfigaccess, else/previewsilently never registers.fluttersdk_windis now a direct dependency (the catalog renders onWDiv/WText/WAnchorand binds the theme toggle toWindThemeController).MagicDuskIntegration.install()now registers a navigate adapter viaDuskPlugin.registerNavigateAdaptersoext.dusk.navigate --route <path>drives GoRouter throughMagicRouter.instance.to(path)instead of falling back to theSystemNavigatorplatform broadcast. Returnstrueon success andfalsewhen the router is not yet initialised (catchesStateError).resetForTesting()clears the adapter withDuskPlugin.registerNavigateAdapter(null).
Fixed #
/preview/<slug>deep links now select the right entry: the catalog moved off a persistent ShellRoute (which did not rebuild when only the child route swapped, leaving every deep link stuck on the first entry) to two plain pages; the/preview/:componentbuilder receives the slug and rebuilds on navigation. Known dev-only limitation: feature-SCREEN previews (full controller-backedMagicStatefulViews) emit a couple of non-fatalsetState() during buildwarnings because the catalog mounts the same screen in both the light and dark panes sharing a singleton controller; the screens render correctly and the real app routes are clean (the catalog is stripped from release)./previewroute no longer crashes the app: the catalog group's index child path was/which composed to/preview/, tripping go_router'sroute path may not end with '/'assertion and blanking the entire app on every route. Changed the index child path to''so the composed path is exactly/preview.- Catalog previews now inherit the host theme: each light/dark pane copied a bare
WindThemeDatathat carried no aliases, so component semantic tokens (text-fg,bg-surface, ...) resolved to no-ops and every preview rendered Flutter's red unstyled-text fallback. Panes nowcopyWith(brightness:)the ambient app theme, preserving aliases and brand colors. - Catalog overflow: the preview surface now scrolls vertically and each pane scrolls horizontally, so wide variant matrices no longer trigger RenderFlex overflows in the side-by-side light/dark layout.
0.0.1 - 2026-06-17 #
Added #
- Initial release, extracted from the
magicpackage.MagicDuskIntegration(14 enrichers forfluttersdk_dusksnapshots) andMagicTelescopeIntegration(5 watchers plusMagicHttpFacadeAdapterforfluttersdk_telescope) now live here as a dedicated, debug-only dev-tooling adapter rather than as sub-barrels ofmagic. - Two import barrels:
package:magic_devtools/dusk.dartandpackage:magic_devtools/telescope.dart. - The relocated enricher and watcher test suites moved over unchanged.
Note #
- Local development resolves the
magic,fluttersdk_dusk, andfluttersdk_telescopesiblings throughdependency_overridespath entries. Those overrides are dev-only; version pins replace them at publish (the publish-time pubspec is user-owned).