Skip to content

test(guards): lib/shared must not import shadcn_flutter (ratchet allow-list) - #1409

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1365-shared-shadcn-guard
Oct 11, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
issue/1365-shared-shadcn-guard

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Part of #1365 (does not close it)

What

test/guards/shared_does_not_import_shadcn_test.dart, in the style of the other guards, written as a ratchet:

  • lib/shared/ is scanned; a file that imports package:shadcn_flutter/ and is not in the allow-list fails the test.
  • An allow-list entry whose file no longer imports shadcn (or is gone) also fails, so the list can only shrink, and has to in the same change that removes the import.
  • The allow-list is today's 16 files (15 in lib/shared/widgets/ including the widgets.dart barrel that re-exports shadcn, plus services/data_export_service.dart).

docs/ui-kit.md's guard table lists it.

Why now

Epic #1331 / #1365 migrate away from shadcn in many PRs. Without a ratchet the count can grow in between; with it, every migration PR only has to delete lines from one list.

Not in this PR

No source changes: the imports themselves go in the component migrations (QueryaButton is #1408, the controls follow).

Not run locally; CI is the check.

Fix the current set of files that import it in an allow-list: nothing new may
start to, and an entry must be removed in the change that removes its import.
Part of #1365.
@github-actions github-actions Bot added epic Epic / umbrella issue frontend Theme parser epic label: frontend ui User interface components and widgets ux User experience, keyboard shortcuts and interactions labels Oct 10, 2026
It only mentions the package in a comment; it does not import it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

epic Epic / umbrella issue frontend Theme parser epic label: frontend ui User interface components and widgets ux User experience, keyboard shortcuts and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant