-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
183 lines (150 loc) · 4.43 KB
/
justfile
File metadata and controls
183 lines (150 loc) · 4.43 KB
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
# semantic-docs - justfile
# Run `just` or `just help` to see available commands
# Default recipe: show help
default:
@just --list --unsorted
# Install dependencies
install:
pnpm install
# Install dependencies (frozen lockfile, for CI)
install-frozen:
pnpm install --frozen-lockfile
# Start dev server
dev:
pnpm dev
# Build for production
build:
pnpm build
# Preview production build
preview:
pnpm preview
# Run tests
test *ARGS:
pnpm test {{ ARGS }}
# Run tests in CI mode (no watch)
test-run:
pnpm test --run
# Run tests with coverage
test-coverage:
pnpm test:coverage
# Check coverage for low-coverage files
uncov:
pnpm uncov
# Run linter (Biome)
lint:
pnpm lint
# Fix lint issues and format code
lint-fix:
pnpm lint:fix
# Format code (alias for lint-fix, Biome handles both)
format: lint-fix
# Type check
typecheck:
pnpm exec tsc --noEmit
# Initialize Turso database schema (uses .env)
db-init:
pnpm db:init
# Initialize local database (no .env required)
db-init-local:
pnpm db:init:local
# Index content to Turso (uses .env)
index:
pnpm index
# Index content to local database
index-local:
pnpm index:local
# Run all checks (lint + typecheck + test)
check: lint typecheck test-run
# Full CI workflow locally
ci: install-frozen test-run db-init-local index-local build typecheck lint
# Clean build artifacts
clean:
rm -rf dist coverage logs local.db .astro
# Clean everything including dependencies
clean-all: clean
rm -rf node_modules
# Generate full changelog
changelog:
git cliff -o CHANGELOG.md
# Preview unreleased changes
changelog-preview:
git cliff --unreleased
# ============================================================================
# Version Management
# ============================================================================
# CI-friendly version setter (Linux sed compatible)
set-version version:
jq --arg v "{{version}}" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json
@echo "Set version to {{version}}"
# Show current version
version:
@echo "Current version: $(jq -r '.version' package.json)"
# Bump patch version (0.1.2 → 0.1.3)
bump-patch:
#!/bin/sh
set -e
CURRENT=$(jq -r '.version' package.json)
echo "Current version: $CURRENT"
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
MINOR=$(echo "$CURRENT" | cut -d. -f2)
PATCH=$(echo "$CURRENT" | cut -d. -f3)
NEW="$MAJOR.$MINOR.$((PATCH + 1))"
echo "New version: $NEW"
jq --tab --arg v "$NEW" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json
pnpm lint:fix >/dev/null
git add package.json
git commit -m "chore(release): bump version to $NEW"
git tag "v$NEW"
echo ""
echo "Created tag v$NEW"
echo ""
echo "Push with:"
echo " git push origin main --tags"
# Bump minor version (0.1.2 → 0.2.0)
bump-minor:
#!/bin/sh
set -e
CURRENT=$(jq -r '.version' package.json)
echo "Current version: $CURRENT"
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
MINOR=$(echo "$CURRENT" | cut -d. -f2)
NEW="$MAJOR.$((MINOR + 1)).0"
echo "New version: $NEW"
jq --tab --arg v "$NEW" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json
pnpm lint:fix >/dev/null
git add package.json
git commit -m "chore(release): bump version to $NEW"
git tag "v$NEW"
echo ""
echo "Created tag v$NEW"
echo ""
echo "Push with:"
echo " git push origin main --tags"
# Bump major version (0.1.2 → 1.0.0)
bump-major:
#!/bin/sh
set -e
CURRENT=$(jq -r '.version' package.json)
echo "Current version: $CURRENT"
MAJOR=$(echo "$CURRENT" | cut -d. -f1)
NEW="$((MAJOR + 1)).0.0"
echo "New version: $NEW"
jq --tab --arg v "$NEW" '.version = $v' package.json > package.json.tmp && mv package.json.tmp package.json
pnpm lint:fix >/dev/null
git add package.json
git commit -m "chore(release): bump version to $NEW"
git tag "v$NEW"
echo ""
echo "Created tag v$NEW"
echo ""
echo "Push with:"
echo " git push origin main --tags"
# Release: bump patch, push, and trigger release workflow
release-patch: bump-patch
git push origin main --tags
# Release: bump minor, push, and trigger release workflow
release-minor: bump-minor
git push origin main --tags
# Release: bump major, push, and trigger release workflow
release-major: bump-major
git push origin main --tags