Problem
The root app pubspec.yaml currently declares non-runtime tooling packages in dependencies, so they are treated as part of the app dependency surface. mockito is test-only, freezed is a code generator, and widgetbook / widgetbook_annotation are only used by the separate Widgetbook workspace.
Evidence
- Root
pubspec.yaml lists mockito under dependencies.
- Root
pubspec.yaml lists freezed under dependencies, while app source imports freezed_annotation, not freezed.
- Root
pubspec.yaml lists widgetbook and widgetbook_annotation under dependencies.
mockito imports are only under test/.
- Widgetbook imports are under
widgetbook/lib/, and widgetbook/pubspec.yaml already declares its own widgetbook, widgetbook_annotation, widgetbook_generator, and build_runner dependencies.
- Root code imports
freezed_annotation from lib/, so freezed_annotation should remain available to the app unless a separate migration proves otherwise.
Proposed direction
Move mockito and freezed from root dependencies to root dev_dependencies. Remove widgetbook and widgetbook_annotation from the root app pubspec.yaml unless a root app import is added later. Keep Widgetbook-specific packages in widgetbook/pubspec.yaml.
Acceptance criteria
- Root
pubspec.yaml no longer includes mockito, freezed, widgetbook, or widgetbook_annotation in dependencies.
- Root
pubspec.yaml keeps freezed_annotation available for app source imports.
- Root
dev_dependencies includes any root-level test/codegen packages still needed by flutter test or build_runner.
flutter pub get, dart run build_runner build --delete-conflicting-outputs, flutter analyze, and flutter test pass for the root app.
cd widgetbook && flutter pub get succeeds, and Widgetbook still owns its Widgetbook-specific dependencies.
Source: Codex codebase audit on 2026-06-28.
Problem
The root app
pubspec.yamlcurrently declares non-runtime tooling packages independencies, so they are treated as part of the app dependency surface.mockitois test-only,freezedis a code generator, andwidgetbook/widgetbook_annotationare only used by the separate Widgetbook workspace.Evidence
pubspec.yamllistsmockitounderdependencies.pubspec.yamllistsfreezedunderdependencies, while app source importsfreezed_annotation, notfreezed.pubspec.yamllistswidgetbookandwidgetbook_annotationunderdependencies.mockitoimports are only undertest/.widgetbook/lib/, andwidgetbook/pubspec.yamlalready declares its ownwidgetbook,widgetbook_annotation,widgetbook_generator, andbuild_runnerdependencies.freezed_annotationfromlib/, sofreezed_annotationshould remain available to the app unless a separate migration proves otherwise.Proposed direction
Move
mockitoandfreezedfrom rootdependenciesto rootdev_dependencies. Removewidgetbookandwidgetbook_annotationfrom the root apppubspec.yamlunless a root app import is added later. Keep Widgetbook-specific packages inwidgetbook/pubspec.yaml.Acceptance criteria
pubspec.yamlno longer includesmockito,freezed,widgetbook, orwidgetbook_annotationindependencies.pubspec.yamlkeepsfreezed_annotationavailable for app source imports.dev_dependenciesincludes any root-level test/codegen packages still needed byflutter testorbuild_runner.flutter pub get,dart run build_runner build --delete-conflicting-outputs,flutter analyze, andflutter testpass for the root app.cd widgetbook && flutter pub getsucceeds, and Widgetbook still owns its Widgetbook-specific dependencies.Source: Codex codebase audit on 2026-06-28.