diff --git a/scripts/check-branding-drift.ts b/scripts/check-branding-drift.ts index a11bf6d152..4e49e1015c 100644 --- a/scripts/check-branding-drift.ts +++ b/scripts/check-branding-drift.ts @@ -34,6 +34,7 @@ export const BRANDING_DRIFT_PATHSPECS = [ "packages/*/lib/**/*.js", "packages/*/lib/**/*.ts", "packages/*/src/**/*.ts", + "packages/*/src/**/*.tsx", "packages/*/scripts/**/*.mjs", "apps/*/src/**/*.ts", "apps/*/src/**/*.tsx", diff --git a/test/unit/check-branding-drift-script.test.ts b/test/unit/check-branding-drift-script.test.ts index db556a7d06..3e22de5fd9 100644 --- a/test/unit/check-branding-drift-script.test.ts +++ b/test/unit/check-branding-drift-script.test.ts @@ -50,6 +50,24 @@ describe("scanBrandingHits", () => { expect(capturedArgs).toContain("apps/*/scripts/**/*.mjs"); }); + it("scans packages/*/src/**/*.tsx, so ui-kit design-system components are covered like apps/* .tsx are", () => { + let capturedArgs: string[] = []; + const exec = (_root: string, args: string[]) => { + capturedArgs = args; + return ""; + }; + scanBrandingHits({ root: "/fake", exec }); + + expect(capturedArgs).toContain("packages/*/src/**/*.tsx"); + }); + + it("includes a packages/*/src/*.tsx hit in the scanned set (a ui-kit component now in scope)", () => { + const exec = () => "packages/loopover-ui-kit/src/card.tsx:1\n"; + const result = scanBrandingHits({ root: "/fake", exec }); + + expect(result).toEqual({ "packages/loopover-ui-kit/src/card.tsx": 1 }); + }); + // Real regression guard, mirroring check-manifest-drift-script.test.ts's own real-repo-state test: proves // the actual defaultExec (real `git grep` subprocess, real exit-1-means-empty handling) works against this // repo's real tracked files, not just the injected fake above.