Skip to content

Commit ca34f20

Browse files
authored
Merge branch 'main' into delete-mui
2 parents b547bb0 + 412b1ce commit ca34f20

File tree

14 files changed

+47
-44
lines changed

14 files changed

+47
-44
lines changed

.cspell.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"reqwest",
2020
"safify",
2121
"supabase",
22-
"swiper"
22+
"swiper",
23+
"lefthook"
2324
],
2425
"dictionaries": [
2526
"softwareTerms",

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
bun-version: latest
6868

6969
- run: make setup-ci
70-
- run: make spell-check
70+
- run: bunx cspell --quiet .
7171

7272
test:
7373
name: Bun Test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ dist-ssr
2525

2626
.env
2727
/.direnv
28+
.husky

.husky/pre-commit

Lines changed: 0 additions & 1 deletion
This file was deleted.

Makefile

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ LOCAL_DB := postgres://user:password@localhost:5432/database
55
setup:
66
if [ ! `command -v bun` ]; then echo 'ERR: Bun is required!'; exit 1; fi
77
make sync
8-
bunx husky
98
@echo "auto setup is done. now do:"
109
@echo "- edit server/.env.dev"
1110
@echo "- edit web/.env"
@@ -17,6 +16,7 @@ setup-ci:
1716
make generate-sql
1817

1918
sync: sync-server sync-web sync-root copy-common
19+
lefthook install || true
2020
@echo '----------------------------------------------------------------------------------------------------------'
2121
@echo '| Most work is done. now running prisma-generate-sql (which might fail if .env.dev is not set configured)|'
2222
@echo '----------------------------------------------------------------------------------------------------------'
@@ -80,16 +80,6 @@ dev-db:
8080
@make seed;
8181
@echo "Seeding completed."
8282

83-
84-
precommit: check-branch lint-staged spell-check
85-
86-
lint-staged:
87-
bunx lint-staged
88-
check-branch:
89-
@ if [ "$(git branch --show-current)" == "main" ]; then echo "Cannot make commit on main! aborting..."; exit 1; fi
90-
spell-check:
91-
bunx cspell --quiet .
92-
9383
# Sync (install/update packages, generate prisma, etc)
9484

9585
sync-web:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ GNU Make が導入されています。以下は、ユーザーが使うこと
1313
- make setup (セットアップします。)
1414
- make start (build -> serve します。)
1515
- make watch (ホットリロードします。)
16-
- make precommit (type-check, format-check, lint を実行します。husky で自動実行されます。)
1716

1817
### 環境構築
1918

@@ -27,6 +26,7 @@ GNU Make が導入されています。以下は、ユーザーが使うこと
2726
- Bun (js)
2827
- GNU Make
2928
- nvm (optional)
29+
- lefthook
3030

3131
- `make setup` を実行します。
3232

bun.lockb

-16.2 KB
Binary file not shown.

flake.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,13 @@
2727
biome
2828
pkg-config
2929
openssl
30+
lefthook
3031
] ++ [
3132
rust-pkgs
3233
];
3334
shellHook = ''
3435
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${pkgs.stdenv.cc.cc.lib}/lib
36+
lefthook install
3537
'' + prisma.shellHook;
3638
};
3739
});

lefthook.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Lefthook: Precommit Hook
2+
# docs: https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
3+
# 必須: Lefthook
4+
# 必須: `lefthook install`
5+
pre-commit:
6+
parallel: true
7+
commands:
8+
biome:
9+
glob: "*"
10+
run: biome check --write --no-errors-on-unmatched --files-ignore-unknown=true -- {staged_files}
11+
stage_fixed: true
12+
prevent-commit-on-main:
13+
run: if [ "$(git branch --show-current)" == "main" ]; then echo "Cannot make commit on main! aborting..."; exit 1; fi
14+
cspell:
15+
glob: "*"
16+
run: bunx cspell --quiet -- {staged_files}

package.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,19 @@
44
"description": "",
55
"main": "index.js",
66
"scripts": {
7-
"test": "echo \"Error: no test specified\" && exit 1",
8-
"prepare": "husky"
7+
"test": "echo \"Error: no test specified\" && exit 1"
98
},
109
"keywords": [],
1110
"author": "",
1211
"license": "ISC",
1312
"devDependencies": {
1413
"@biomejs/biome": "^1.9.1",
15-
"husky": "^9.1.4",
16-
"lint-staged": "^15.2.10",
1714
"typescript": "^5.6.2"
1815
},
1916
"dependencies": {
2017
"@types/bun": "^1.1.10",
2118
"cspell": "^8.14.4",
2219
"zod": "^3.23.8"
2320
},
24-
"lint-staged": {
25-
"*.{js,jsx,ts,tsx,json}": ["biome check --write"]
26-
},
2721
"trustedDependencies": ["@biomejs/biome"]
2822
}

0 commit comments

Comments
 (0)