xonecas.io
70160
Ce

cel-tui / commit fc17913

chore: add lefthook pre-commit hooks, fix typecheck

- lefthook runs format, check, typecheck, test on pre-commit
- Unified tsconfig.json with path aliases for workspace packages
- Added @types/bun for bun:test and process type definitions
- Removed per-package tsconfigs (single root config)
- All 4 checks passing: format, lint, typecheck, 170 tests

xonecas2026-04-03 fc17913ff0696a4e6006309603f5d77f6ee080b7 parent eea7005

7 files changed

bun.lock+32−0
@@ -6,7 +6,9 @@
66 "name": "cel-tui",
77 "devDependencies": {
88 "@biomejs/biome": "^2.4.10",
9+ "@types/bun": "^1.3.11",
910 "get-east-asian-width": "^1.5.0",
11+ "lefthook": "^2.1.4",
1012 "prettier": "^3.8.1",
1113 "typescript": "^6.0.2",
1214 },
@@ -56,10 +58,40 @@
5658
5759 "@cel-tui/types": ["@cel-tui/types@workspace:packages/types"],
5860
61+ "@types/bun": ["@types/bun@1.3.11", "", { "dependencies": { "bun-types": "1.3.11" } }, "sha512-5vPne5QvtpjGpsGYXiFyycfpDF2ECyPcTSsFBMa0fraoxiQyMJ3SmuQIGhzPg2WJuWxVBoxWJ2kClYTcw/4fAg=="],
62+
63+ "@types/node": ["@types/node@25.5.2", "", { "dependencies": { "undici-types": "~7.18.0" } }, "sha512-tO4ZIRKNC+MDWV4qKVZe3Ql/woTnmHDr5JD8UI5hn2pwBrHEwOEMZK7WlNb5RKB6EoJ02gwmQS9OrjuFnZYdpg=="],
64+
65+ "bun-types": ["bun-types@1.3.11", "", { "dependencies": { "@types/node": "*" } }, "sha512-1KGPpoxQWl9f6wcZh57LvrPIInQMn2TQ7jsgxqpRzg+l0QPOFvJVH7HmvHo/AiPgwXy+/Thf6Ov3EdVn1vOabg=="],
66+
5967 "get-east-asian-width": ["get-east-asian-width@1.5.0", "", {}, "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="],
6068
69+ "lefthook": ["lefthook@2.1.4", "", { "optionalDependencies": { "lefthook-darwin-arm64": "2.1.4", "lefthook-darwin-x64": "2.1.4", "lefthook-freebsd-arm64": "2.1.4", "lefthook-freebsd-x64": "2.1.4", "lefthook-linux-arm64": "2.1.4", "lefthook-linux-x64": "2.1.4", "lefthook-openbsd-arm64": "2.1.4", "lefthook-openbsd-x64": "2.1.4", "lefthook-windows-arm64": "2.1.4", "lefthook-windows-x64": "2.1.4" }, "bin": { "lefthook": "bin/index.js" } }, "sha512-JNfJ5gAn0KADvJ1I6/xMcx70+/6TL6U9gqGkKvPw5RNMfatC …
70+
71+ "lefthook-darwin-arm64": ["lefthook-darwin-arm64@2.1.4", "", { "os": "darwin", "cpu": "arm64" }, "sha512-BUAAE9+rUrjr39a+wH/1zHmGrDdwUQ2Yq/z6BQbM/yUb9qtXBRcQ5eOXxApqWW177VhGBpX31aqIlfAZ5Q7wzw=="],
72+
73+ "lefthook-darwin-x64": ["lefthook-darwin-x64@2.1.4", "", { "os": "darwin", "cpu": "x64" }, "sha512-K1ncIMEe84fe+ss1hQNO7rIvqiKy2TJvTFpkypvqFodT7mJXZn7GLKYTIXdIuyPAYthRa9DwFnx5uMoHwD2F1Q=="],
74+
75+ "lefthook-freebsd-arm64": ["lefthook-freebsd-arm64@2.1.4", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-PVUhjOhVN71YaYsVdQyNbFZ4a2jFB2Tg5hKrrn9kaWpx64aLz/XivLjwr8sEuTaP1GRlEWBpW6Bhrcsyo39qFw=="],
76+
77+ "lefthook-freebsd-x64": ["lefthook-freebsd-x64@2.1.4", "", { "os": "freebsd", "cpu": "x64" }, "sha512-ZWV9o/LeyWNEBoVO+BhLqxH3rGTba05nkm5NvMjEFSj7LbUNUDbQmupZwtHl1OMGJO66eZP0CalzRfUH6GhBxQ=="],
78+
79+ "lefthook-linux-arm64": ["lefthook-linux-arm64@2.1.4", "", { "os": "linux", "cpu": "arm64" }, "sha512-iWN0pGnTjrIvNIcSI1vQBJXUbybTqJ5CLMniPA0olabMXQfPDrdMKVQe+mgdwHK+E3/Y0H0ZNL3lnOj6Sk6szA=="],
80+
81+ "lefthook-linux-x64": ["lefthook-linux-x64@2.1.4", "", { "os": "linux", "cpu": "x64" }, "sha512-96bTBE/JdYgqWYAJDh+/e/0MaxJ25XTOAk7iy/fKoZ1ugf6S0W9bEFbnCFNooXOcxNVTan5xWKfcjJmPIKtsJA=="],
82+
83+ "lefthook-openbsd-arm64": ["lefthook-openbsd-arm64@2.1.4", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-oYUoK6AIJNEr9lUSpIMj6g7sWzotvtc3ryw7yoOyQM6uqmEduw73URV/qGoUcm4nqqmR93ZalZwR2r3Gd61zvw=="],
84+
85+ "lefthook-openbsd-x64": ["lefthook-openbsd-x64@2.1.4", "", { "os": "openbsd", "cpu": "x64" }, "sha512-i/Dv9Jcm68y9cggr1PhyUhOabBGP9+hzQPoiyOhKks7y9qrJl79A8XfG6LHekSuYc2VpiSu5wdnnrE1cj2nfTg=="],
86+
87+ "lefthook-windows-arm64": ["lefthook-windows-arm64@2.1.4", "", { "os": "win32", "cpu": "arm64" }, "sha512-hSww7z+QX4YMnw2lK7DMrs3+w7NtxksuMKOkCKGyxUAC/0m1LAICo0ZbtdDtZ7agxRQQQ/SEbzFRhU5ysNcbjA=="],
88+
89+ "lefthook-windows-x64": ["lefthook-windows-x64@2.1.4", "", { "os": "win32", "cpu": "x64" }, "sha512-eE68LwnogxwcPgGsbVGPGxmghyMGmU9SdGwcc+uhGnUxPz1jL89oECMWJNc36zjVK24umNeDAzB5KA3lw1MuWw=="],
90+
6191 "prettier": ["prettier@3.8.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="],
6292
6393 "typescript": ["typescript@6.0.2", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-bGdAIrZ0wiGDo5l8c++HWtbaNCWTS4UTv7RaTH/ThVIgjkveJt83m74bBHMJkuCbslY8ixgLBVZJIOiQlQTjfQ=="],
94+
95+ "undici-types": ["undici-types@7.18.2", "", {}, "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w=="],
6496 }
6597 }
lefthook.yml+11−0
@@ -0,0 +1,11 @@
1+pre-commit:
2+ parallel: false
3+ commands:
4+ format:
5+ run: bun run format
6+ check:
7+ run: bun run check
8+ typecheck:
9+ run: bun run typecheck
10+ test:
11+ run: bun test
package.json+2−0
@@ -13,7 +13,9 @@
1313 },
1414 "devDependencies": {
1515 "@biomejs/biome": "^2.4.10",
16+ "@types/bun": "^1.3.11",
1617 "get-east-asian-width": "^1.5.0",
18+ "lefthook": "^2.1.4",
1719 "prettier": "^3.8.1",
1820 "typescript": "^6.0.2"
1921 }
packages/components/tsconfig.json+0−13
@@ -1,13 +0,0 @@
1-{
2- "compilerOptions": {
3- "strict": true,
4- "target": "ESNext",
5- "module": "ESNext",
6- "moduleResolution": "bundler",
7- "declaration": true,
8- "outDir": "dist",
9- "rootDir": "src"
10- },
11- "include": ["src"],
12- "references": [{ "path": "../types" }, { "path": "../core" }]
13-}
packages/core/tsconfig.json+0−13
@@ -1,13 +0,0 @@
1-{
2- "compilerOptions": {
3- "strict": true,
4- "target": "ESNext",
5- "module": "ESNext",
6- "moduleResolution": "bundler",
7- "declaration": true,
8- "outDir": "dist",
9- "rootDir": "src"
10- },
11- "include": ["src"],
12- "references": [{ "path": "../types" }]
13-}
packages/types/tsconfig.json+0−12
@@ -1,12 +0,0 @@
1-{
2- "compilerOptions": {
3- "strict": true,
4- "target": "ESNext",
5- "module": "ESNext",
6- "moduleResolution": "bundler",
7- "declaration": true,
8- "outDir": "dist",
9- "rootDir": "src"
10- },
11- "include": ["src"]
12-}
tsconfig.json+9−6
@@ -3,11 +3,14 @@
33 "strict": true,
44 "target": "ESNext",
55 "module": "ESNext",
6- "moduleResolution": "bundler"
6+ "moduleResolution": "bundler",
7+ "noEmit": true,
8+ "skipLibCheck": true,
9+ "types": ["@types/bun"],
10+ "paths": {
11+ "@cel-tui/types": ["./packages/types/src/index.ts"],
12+ "@cel-tui/core": ["./packages/core/src/index.ts"]
13+ }
714 },
8- "references": [
9- { "path": "packages/types" },
10- { "path": "packages/core" },
11- { "path": "packages/components" }
12- ]
15+ "include": ["packages/*/src/**/*.ts"]
1316 }