-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjustfile
89 lines (66 loc) · 1.58 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
set dotenv-load := true
source := "./src"
devDirectory := "./dev"
watch := "false"
ci := "false"
git_commit_cmd := "git rev-parse HEAD"
git_branch_cmd := "git rev-parse --abbrev-ref HEAD"
default:
@just --choose
# === Setup ===
install:
npm install
audit:
npm audit
clean:
rm -rf ./node_modules/
rm -rf ./package-lock.json
rm -rf ./yarn.lock
rm -rf ./pnpm-lock.yaml
rm -rf ./yarn-error.log
rm -rf ./*.tsbuildinfo
rm -rf ./dist
rm -rf ./coverage
build *args:
npx tsup {{ args }}
# === Ops ===
docker-build *args:
GIT_COMMIT=$(git rev-parse HEAD) \
GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) \
docker buildx bake -f docker-bake.hcl {{ args }}
update-deps-commit: update-deps
git add .
git commit -m 'deps: update deps'
update-branch branch:
git switch {{ branch }}
git town sync
git switch main
# === Maintenance ===
# full-check: test format-check typecheck
full-check: format-check typecheck
test *args: build
# npx uvu dist/ '(.+)\.test\.js$' {{ args }}
npm test
typecheck:
npx tsc
format-check:
npx prettier --check .
format:
npx prettier --write .
format-all: format format-justfile format-utils
format-justfile:
just --unstable --fmt
format-utils: format-justfile
check-deps-versions:
@ if [ {{ ci }} = "true" ]; then \
npx ncu --errorLevel=2; \
else \
npx ncu; \
fi
update-deps:
npx ncu
# === Dev ===
node-watch filename:
node --enable-source-maps --watch {{ filename }}
tsx-watch filename:
npx tsx --enable-source-maps --watch {{ filename }}