Skip to content

Commit b448dcf

Browse files
committed
fixes for knip
1 parent ed11230 commit b448dcf

File tree

6 files changed

+132
-960
lines changed

6 files changed

+132
-960
lines changed

.husky/_/pre-commit

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/sh
2+
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
5+
fi
6+
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
9+
fi
10+
11+
call_lefthook()
12+
{
13+
if test -n "$LEFTHOOK_BIN"
14+
then
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook.exe -h >/dev/null 2>&1
17+
then
18+
lefthook.exe "$@"
19+
elif lefthook.bat -h >/dev/null 2>&1
20+
then
21+
lefthook.bat "$@"
22+
else
23+
dir="$(git rev-parse --show-toplevel)"
24+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
25+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
26+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe"
27+
then
28+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@"
32+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe"
33+
then
34+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@"
35+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
36+
then
37+
"$dir/node_modules/lefthook/bin/index.js" "$@"
38+
39+
elif bundle exec lefthook -h >/dev/null 2>&1
40+
then
41+
bundle exec lefthook "$@"
42+
elif yarn lefthook -h >/dev/null 2>&1
43+
then
44+
yarn lefthook "$@"
45+
elif pnpm lefthook -h >/dev/null 2>&1
46+
then
47+
pnpm lefthook "$@"
48+
elif swift package plugin lefthook >/dev/null 2>&1
49+
then
50+
swift package --disable-sandbox plugin lefthook "$@"
51+
elif command -v mint >/dev/null 2>&1
52+
then
53+
mint run csjones/lefthook-plugin "$@"
54+
else
55+
echo "Can't find lefthook in PATH"
56+
fi
57+
fi
58+
}
59+
60+
call_lefthook run "pre-commit" "$@"

.husky/_/prepare-commit-msg

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
#!/bin/sh
2+
3+
if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
4+
set -x
5+
fi
6+
7+
if [ "$LEFTHOOK" = "0" ]; then
8+
exit 0
9+
fi
10+
11+
call_lefthook()
12+
{
13+
if test -n "$LEFTHOOK_BIN"
14+
then
15+
"$LEFTHOOK_BIN" "$@"
16+
elif lefthook.exe -h >/dev/null 2>&1
17+
then
18+
lefthook.exe "$@"
19+
elif lefthook.bat -h >/dev/null 2>&1
20+
then
21+
lefthook.bat "$@"
22+
else
23+
dir="$(git rev-parse --show-toplevel)"
24+
osArch=$(uname | tr '[:upper:]' '[:lower:]')
25+
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
26+
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe"
27+
then
28+
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook.exe" "$@"
29+
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe"
30+
then
31+
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook.exe" "$@"
32+
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe"
33+
then
34+
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook.exe" "$@"
35+
elif test -f "$dir/node_modules/lefthook/bin/index.js"
36+
then
37+
"$dir/node_modules/lefthook/bin/index.js" "$@"
38+
39+
elif bundle exec lefthook -h >/dev/null 2>&1
40+
then
41+
bundle exec lefthook "$@"
42+
elif yarn lefthook -h >/dev/null 2>&1
43+
then
44+
yarn lefthook "$@"
45+
elif pnpm lefthook -h >/dev/null 2>&1
46+
then
47+
pnpm lefthook "$@"
48+
elif swift package plugin lefthook >/dev/null 2>&1
49+
then
50+
swift package --disable-sandbox plugin lefthook "$@"
51+
elif command -v mint >/dev/null 2>&1
52+
then
53+
mint run csjones/lefthook-plugin "$@"
54+
else
55+
echo "Can't find lefthook in PATH"
56+
fi
57+
fi
58+
}
59+
60+
call_lefthook run "prepare-commit-msg" "$@"

knip.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"$schema": "https://unpkg.com/knip@5/schema.json",
3-
"entry": ["scripts/*.{ts,js}", "app/routes.ts", "vite.config.ts", "app/server/*.ts"],
3+
"entry": [
4+
"scripts/*.{ts,js}",
5+
"app/routes.ts",
6+
"vite.config.ts",
7+
"vitest.workspace.ts",
8+
"vitest.config.ts",
9+
"app/server/*.ts"
10+
],
411
"remix": true,
512
"lefthook": true,
6-
"project": ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}", "vite.config.ts"],
7-
"ignore": ["app/library/icon/icons/types.ts"]
13+
"project": ["**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}", "vite.config.ts", "vitest.workspace.ts", "vitest.config.ts"],
14+
"ignore": ["app/library/icon/icons/types.ts", "**/*.server.test.{ts,tsx}", "**/*.browser.test.{ts,tsx}"]
815
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"happy-dom": "15.11.6",
6565
"knip": "5.37.2",
6666
"lefthook": "1.8.4",
67-
"npm-run-all": "4.1.5",
6867
"playwright": "1.49.0",
6968
"postcss": "8.4.49",
7069
"prompt": "1.3.0",

0 commit comments

Comments
 (0)