feat(core-ui): scaffold @repo/core-ui via generator

Runs pnpm turbo gen core-package ui to produce the package shell:
atomic-design components (Button, Input, Label, FormField), vitest
config excluding story files from coverage, and transpilePackages
wiring in web-next. Adds @vitest/coverage-v8 devDep and
label.stories.tsx to satisfy lint/coverage gates.

Also fixes scripts/library-decisions/check.mjs to fall back to
committed approved traces when no staged trace exists — preventing
spurious failures when existing workspace libraries (react, clsx,
tailwind-merge) are adopted by a new package.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 20:59:48 +00:00
parent 81898d9902
commit bce9ded915
38 changed files with 998 additions and 3 deletions

View File

@@ -174,6 +174,36 @@ describe("checkLibraryDecisions", () => {
assert.deepEqual(checkLibraryDecisions(dir), []);
});
test("new feature-tier dep with already-committed approved trace → exit 0", () => {
const { dir, g } = makeRepo();
// Commit trace first (simulates an existing workspace-approved library)
stageTrace(dir, g, "existing-lib", "approved");
g("git commit -m add-trace");
// Now add a new package that depends on the same library
commitPkg(dir, g, "packages/feat-a", { dependencies: {} });
stagePkg(dir, g, "packages/feat-a", {
dependencies: { "existing-lib": "^1.0.0" },
});
// No staged trace needed — the committed trace is the fallback
assert.deepEqual(checkLibraryDecisions(dir), []);
});
test("new feature-tier dep with already-committed rejected trace → exit 1", () => {
const { dir, g } = makeRepo();
stageTrace(dir, g, "bad-lib", "rejected");
g("git commit -m add-trace");
commitPkg(dir, g, "packages/feat-a", { dependencies: {} });
stagePkg(dir, g, "packages/feat-a", {
dependencies: { "bad-lib": "^1.0.0" },
});
const errs = checkLibraryDecisions(dir);
assert.equal(errs.length, 1);
assert.equal(errs[0].dep, "bad-lib");
assert.equal(errs[0].reason, "not-approved");
});
test("--staged-against mode: new feature-tier dep without trace → exit 1", () => {
const { dir, g } = makeRepo();
// Baseline commit: feature package with no deps