2026-03-13 16:26:07 -07:00
|
|
|
import path from "node:path";
|
|
|
|
|
import { fileURLToPath } from "node:url";
|
2026-06-03 16:40:33 -07:00
|
|
|
import { runFileSizeCheck } from "../../scripts/check-file-sizes-core.mjs";
|
2026-03-13 16:26:07 -07:00
|
|
|
|
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
|
|
const projectRoot = path.resolve(__dirname, "..");
|
|
|
|
|
|
2026-06-03 16:40:33 -07:00
|
|
|
const MAX_LINES = 1000;
|
|
|
|
|
|
2026-03-13 16:26:07 -07:00
|
|
|
const rules = [
|
2026-06-03 16:40:33 -07:00
|
|
|
{ root: "src-tauri/src", extensions: new Set([".rs"]), maxLines: MAX_LINES },
|
2026-08-03 21:51:17 -04:00
|
|
|
// Workspace member crates. Without this the ratchet's only Rust root is
|
|
|
|
|
// `src-tauri/src`, and a crate under `src-tauri/crates/` is born outside the
|
|
|
|
|
// repo's one size discipline -- silently, since the check still exits 0.
|
|
|
|
|
{
|
|
|
|
|
root: "src-tauri/crates",
|
|
|
|
|
extensions: new Set([".rs"]),
|
|
|
|
|
maxLines: MAX_LINES,
|
|
|
|
|
},
|
2026-03-13 16:26:07 -07:00
|
|
|
{
|
|
|
|
|
root: "src/app",
|
|
|
|
|
extensions: new Set([".ts", ".tsx"]),
|
2026-06-03 16:40:33 -07:00
|
|
|
maxLines: MAX_LINES,
|
2026-03-13 16:26:07 -07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
root: "src/features",
|
|
|
|
|
extensions: new Set([".ts", ".tsx"]),
|
2026-06-03 16:40:33 -07:00
|
|
|
maxLines: MAX_LINES,
|
2026-03-13 16:26:07 -07:00
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
root: "src/shared/api",
|
|
|
|
|
extensions: new Set([".ts", ".tsx"]),
|
2026-06-03 16:40:33 -07:00
|
|
|
maxLines: MAX_LINES,
|
2026-03-13 16:26:07 -07:00
|
|
|
},
|
2026-06-29 13:49:36 -06:00
|
|
|
{
|
|
|
|
|
root: "src/shared/context",
|
|
|
|
|
extensions: new Set([".ts", ".tsx"]),
|
|
|
|
|
maxLines: MAX_LINES,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
root: "src/shared/lib",
|
|
|
|
|
extensions: new Set([".ts", ".tsx"]),
|
|
|
|
|
maxLines: MAX_LINES,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
root: "src/shared/ui",
|
|
|
|
|
extensions: new Set([".ts", ".tsx"]),
|
|
|
|
|
maxLines: MAX_LINES,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
root: "src/shared/styles",
|
|
|
|
|
extensions: new Set([".css"]),
|
|
|
|
|
maxLines: MAX_LINES,
|
|
|
|
|
},
|
2026-03-13 16:26:07 -07:00
|
|
|
];
|
|
|
|
|
|
2026-06-03 16:40:33 -07:00
|
|
|
await runFileSizeCheck({
|
|
|
|
|
projectRoot,
|
|
|
|
|
rules,
|
|
|
|
|
label: "Desktop",
|
|
|
|
|
});
|