Skip to content

Commit 7447dd8

Browse files
committed
scripts: migrate to bun script
1 parent 7ac8a9c commit 7447dd8

File tree

4 files changed

+18
-74
lines changed

4 files changed

+18
-74
lines changed

README.md

+10-13
Original file line numberDiff line numberDiff line change
@@ -20,25 +20,22 @@ b. Nix を使えない場合
2020
- bun (>= v1.2)
2121
- biome (for linting only)
2222
- deno (for formatting)
23-
- lefthook
2423
- gitleaks
2524
- just
2625

27-
### Just スクリプト
26+
### スクリプト
2827

29-
just が導入されています。 以下は、just で実行可能なスクリプトの例です。 `just` または `just --list`
30-
でスクリプトの一覧が見れます。
28+
just と Bun Script で管理されています。以下は、just や bun で実行可能なスクリプトの例です。
29+
それぞれ `just --list``bun run --list` でスクリプトの一覧が見れます。
3130

3231
```sh
33-
just install # alias: `just i` - installs all package dependencies
34-
just build # alias: `just b` - builds all package
35-
36-
just check # checks:
37-
# formatting
38-
# linting
39-
# sveltekit static analysis
40-
# typescript types
41-
just fix # fix format and lint
32+
# Just: 未導入
33+
34+
bun dev # 開発用サーバーを立てます
35+
bun check # 型チェックを行います
36+
bun style # コードスタイル (フォーマットなど) を整えます
37+
bun style:check # コードスタイルが即しているかどうか確認します (書き込みはしません)。
38+
bun local-db # ローカルのデータベースをスキーマに同期します
4239
```
4340

4441
## 技術スタック

justfile

-56
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,2 @@
11
default:
22
just --list
3-
4-
i: install
5-
6-
install:
7-
just pre-install
8-
just install-bun
9-
just post-install
10-
11-
install-bun:
12-
cd web; bun install --frozen-lockfile
13-
cd service; bun install --frozen-lockfile
14-
15-
pre-install:
16-
lefthook install
17-
18-
post-install: local-db
19-
20-
local-db:
21-
cd service; DATABASE_URL=file:./local.db bunx drizzle-kit push
22-
23-
b: build
24-
25-
build: build-svelte build-service
26-
27-
build-svelte:
28-
cd web; bun run build
29-
30-
build-service:
31-
cd service; bunx tsc
32-
33-
dev:
34-
(trap 'kill 0' EXIT; just dev-service & just dev-web & wait)
35-
36-
dev-service:
37-
cd service; DB_KIND=${DB_KIND:-local} bun dev
38-
39-
dev-web:
40-
cd web; bun dev
41-
42-
format:
43-
deno fmt --check .
44-
45-
format-fix:
46-
deno fmt .
47-
48-
lint:
49-
biome lint .
50-
51-
lint-fix:
52-
biome lint --fix .
53-
54-
check: format lint
55-
cd web; bun check
56-
cd service; bun check
57-
58-
fix: format-fix lint-fix

package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@
66
"web"
77
],
88
"scripts": {
9-
"prepare": "trap 'kill 0' SIGINT; (cd service; bun run prepare) & (cd web; bun run prepare) & (lefthook install) & wait",
9+
"prepare": "trap 'kill 0' SIGINT; (cd service; bun run prepare) & (cd web; bun run prepare) & bun run prepare:self & wait",
10+
"prepare:self": "lefthook install",
1011
"dev": "trap 'kill 0' EXIT; (cd service; bun run dev) & (cd web; bun run dev) & wait",
1112
"check": "(cd web && bun check) && (cd service && bun check)",
12-
"db": "cd service; bun db"
13+
"local-db": "cd service; DATABASE_URL=file:./local.db bun db push",
14+
"style": "deno fmt . && biome lint --fix .",
15+
"style:check": "deno fmt --check . && biome lint ."
1316
},
1417
"devDependencies": {
1518
"@types/bun": "latest",

service/package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"scripts": {
66
"prepare": "bun run cf-typegen",
77
"deploy": "wrangler deploy",
8-
"cf-typegen": "wrangler types",
8+
"cf-typegen": "wrangler types && deno fmt ./worker-configuration.d.ts",
9+
"db": "drizzle-kit",
910
"dev": "bun run --watch ./cmd/dev.ts",
1011
"dev:local": "DB_KIND=local bun run --watch ./cmd/dev.ts",
1112
"dev:tmp": "DB_KIND=memory bun run --watch ./cmd/dev.ts",
1213
"dev:remote": "DB_KIND=turso bun run --watch ./cmd/dev.ts",
13-
"check": "bunx tsc",
14-
"db": "drizzle-kit"
14+
"check": "bun run tsc"
1515
},
1616
"devDependencies": {
1717
"@cloudflare/workers-types": "^4.20250204.0",

0 commit comments

Comments
 (0)