feat(generate): target the shared {app}_ui package as canonical home for shared widgets#3
Open
lapc506 wants to merge 1 commit into
Open
feat(generate): target the shared {app}_ui package as canonical home for shared widgets#3lapc506 wants to merge 1 commit into
lapc506 wants to merge 1 commit into
Conversation
…ome for shared widgets
Architecture decision: in the apps/* + packages/* monorepo layout, shared
widgets (atoms/molecules/organisms) are generated into packages/{app}_ui
(or libs/{app}_ui), with the app and the apps/widgetbook catalog as
consumers via path dependencies. When no UI package exists, /generate
offers to scaffold one by default; the legacy in-app core/widgets/ layout
becomes the explicit fallback. Widgetbook entries go to the apps/widgetbook
catalog when present, aligning /generate with /widgetbook-setup, which
already mandates depending on the UI package, never the app.
Co-Authored-By: Claude (Fable) <noreply@anthropic.com>
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.
The repo owner has large uncommitted WIP on
commands/generate.mdin the local working tree (~186 insertions / 35 deletions) that restructures the command into stack-detection + a Flutter Path (Steps F4–F6) and a Vite Path (Steps V4–V7). This PR is a surgical change against committedmain, so reconciliation is required when that WIP lands:What
Codifies the user's architecture decision for the five Flutter monorepos (keiko, altrupets, vertivo, aduanext, habitanexus): the canonical approach is a shared
packages/{app}_uipackage (e.g.keiko_ui,altrupets_ui), with the app andapps/widgetbookas consumers via path dependencies.Semantics change in
/generatecore/widgets/{atoms|molecules|organisms}/(inside the app){app}_ui/lib/src/{atoms|molecules|organisms}/, re-exported from the package barrelpackages/*_ui/libs/*_ui; no package → offers to scaffold one by default; legacy in-app layout only as explicit fallback, flagged in the summary*.widgetbook.dartalongside the widgetapps/widgetbookcatalog present → use case generated atapps/widgetbook/lib/use_cases/{level}/importing from the UI package (aligns with/widgetbook-setup); colocated file only when no catalog existsFeature widgets (templates/pages) stay in the app — they bind state and routes.
New anti-pattern: Never generate a shared widget into the app when a shared UI package exists — the package is the canonical home; the app and the widgetbook are consumers.
Coherence
/widgetbook-setupandreferences/widgetbook-flutter-monorepo.md(merged in #2) already mandate "depend on the UI package, never the app" at catalog level — this PR makes/generateproduce that structure by default instead of merely auditing for it.Scope
commands/generate.md(+14/−3). No other WIP files touched (plugin.json,marketplace.json,README.md,audit.mduntouched; version bump left to the owner).🤖 Generated with Claude Code