Add repo hygiene gates: knip, publint, yarn constraints

knip (workspace-aware config) fails on unused files, exports, and
dependencies in our code — vendor/ excluded, duplicate default+named
exports allowed (intentional API shape). publint checks every
packages/* package.json for publishing correctness (scripts/
publint-all.ts). Yarn constraints (yarn.config.cjs) mechanize the
AGENTS.md package rules: everything private, dsh-* packages declare
cordis as matching peer+dev dependency, uniform 0.0.1 version, ESM.

yarn hygiene runs all three.
This commit is contained in:
Tianyi Cui
2026-06-11 15:04:50 +08:00
parent bfb034830f
commit 6796a3922d
5 changed files with 680 additions and 2 deletions

15
knip.json Normal file
View File

@@ -0,0 +1,15 @@
{
"$schema": "https://unpkg.com/knip@5/schema.json",
"exclude": ["duplicates"],
"ignoreWorkspaces": ["vendor/*"],
"workspaces": {
".": {
"entry": ["examples/echo-agent/src/*.ts"],
"project": ["scripts/**/*.ts", "examples/**/*.ts"]
},
"packages/*": {
"entry": ["tests/**/*.spec.ts"],
"project": ["src/**/*.ts", "tests/**/*.ts"]
}
}
}