Skip to content

Confine @ui-sdk imports to UI primitives - #83

Merged
mapringg merged 1 commit into
developfrom
mapring/confine-ui-sdk-imports
Nov 22, 2026
Merged

mapringg merged 1 commit into
developfrom
mapring/confine-ui-sdk-imports

Conversation

@mapringg

Copy link
Copy Markdown
Owner

Summary

@ui-sdk/ joins the UI primitive packages that only src/components/ui/** may import in UI apps (web, liff, mobile, marketing).

 {
-  ban: { module: /^(?:@base-ui-components|@base-ui|@rn-primitives)\// },
+  ban: { module: /^(?:@base-ui-components|@base-ui|@rn-primitives|@ui-sdk)\// },
   kinds: UI,
   owner: ["src/components/ui/**"],
   use: "Use the primitives from #/components/ui.",
 },

The patch version goes to 1.3.1, the same as earlier rule changes.

Evidence

This is a lint rule change with nothing to see in a UI, so no screenshot. New test: owners confines UI primitive packages to components/ui in UI apps. It protects the rule that UI primitive packages are imported only inside components/ui in UI apps. The bug it catches: a primitive package missing from the regex or the owner glob, which would let feature code skip the wrappers. No test covered this ban before.

  • Before (new test run against the old regex):
    ✖ owners confines UI primitive packages to components/ui in UI apps
    -   'apps/web/src/features/task/task-button.tsx',
    
    After:
    ✔ owners confines UI primitive packages to components/ui in UI apps
    ℹ tests 92  ℹ pass 92  ℹ fail 0
    
  • The test also checks that @ui-sdk/ in components/ui, @ui-sdk/ in an API app and a bare ui-sdk package are not flagged. It covers the existing @base-ui-components and @rn-primitives patterns too.
  • pnpm lint, pnpm format:check, pnpm knip and pnpm test all pass.

Merge Danger

Door: two-way

Blast Radius: consumers

A consumer is flagged only if it imports @ui-sdk/... outside src/components/ui/** in a UI app. Consumers that don't use @ui-sdk are not affected.

@mapringg
mapringg merged commit 6272054 into develop Nov 22, 2026
1 check passed
@mapringg
mapringg deleted the mapring/confine-ui-sdk-imports branch November 22, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant