feat(matches): add the candidate match screen with expandable explanations

This commit is contained in:
shira committed 2026-10-09 13:55:00 +03:00
1 parent 0b11021b16
commit 28337d84cb
50 files changed
+4834 -37

No files matched your search

+37 -1
View File
@@ -34,6 +34,19 @@ const peerSlicePolicies = sliceLayers.flatMap((layer) => [
},
},
]);
// Test files may also import the test-only entry (`testing.ts`) of a lower
// slice. Production files are held to `index.ts` alone, so nothing that ships
// can reach the fixtures behind it.
const testingEntryPolicies = layerNames.flatMap((sourceLayer, sourceIndex) =>
sliceLayers
.filter((targetLayer) => layerNames.indexOf(targetLayer) > sourceIndex)
.map((targetLayer) => ({
from: { element: { type: sourceLayer } },
allow: {
to: { element: { type: targetLayer, fileInternalPath: "testing.ts" } },
},
})),
);
const publicEntryPolicies = layerNames.flatMap((sourceLayer, sourceIndex) =>
sliceLayers
.filter((targetLayer) => layerNames.indexOf(targetLayer) > sourceIndex)
@@ -84,7 +97,12 @@ export default tseslint.config(
partialMatch: false,
capture: ["slice"],
},
{ type: "entities", pattern: "src/entities/*", partialMatch: false, capture: ["slice"] },
{
type: "entities",
pattern: ["src/entities/*", "scripts/fixtures/src/entities/*"],
partialMatch: false,
capture: ["slice"],
},
{ type: "shared", pattern: "src/shared", partialMatch: false },
],
},
@@ -107,4 +125,22 @@ export default tseslint.config(
plugins: { boundaries },
rules: { "boundaries/no-unknown-files": "error" },
},
{
files: ["src/**/*.test.{ts,tsx}"],
plugins: { boundaries },
rules: {
"boundaries/dependencies": [
"error",
{
default: "allow",
policies: [
...upwardPolicies,
...peerSlicePolicies,
...publicEntryPolicies,
...testingEntryPolicies,
],
},
],
},
},
);