-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJustfile
More file actions
181 lines (136 loc) · 4.62 KB
/
Justfile
File metadata and controls
181 lines (136 loc) · 4.62 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
# transscendsurvival.org — SvelteKit blog task runner
# Prerequisites: just (brew install just), Node.js >= 22, npm
# Quick Start: just setup && just dev
set dotenv-load := true
set shell := ["bash", "-euo", "pipefail", "-c"]
root := justfile_directory()
# List available commands
default:
@just --list --unsorted
# =============================================================================
# Development
# =============================================================================
# First-time setup
setup:
npm install
@echo "Setup complete. Run 'just dev' to start."
# Start dev server
dev:
npm run dev
# Start dev server and open browser
dev-open:
npm run dev -- --open
# =============================================================================
# Building
# =============================================================================
# Production build (redirects + pagefind)
build:
npm run build
# Clean then build
rebuild: clean build
# Preview production build
preview: build
npm run preview
# Preview without rebuilding
preview-only:
npm run preview
# =============================================================================
# Validation
# =============================================================================
# Validate post frontmatter
validate-frontmatter:
npx tsx scripts/validate-frontmatter.mts
# Materialize reviewed Tinyland post projections into src/posts/*.md
ingest-tinyland-posts:
npm run ingest:tinyland-posts
# Type check with svelte-check
check:
npm run check
# Validate redirects after build
test-redirects:
npm run test:redirects
# Run Vitest unit tests
test-unit:
npx vitest run
# Run Playwright E2E tests (builds + serves automatically)
test-e2e:
npx playwright test
# Run a specific E2E test file
test-e2e-file file:
npx playwright test {{file}}
# Run E2E tests with visible browser
test-e2e-headed:
npx playwright test --headed
# Run all tests (unit + redirects + E2E)
test: test-unit test-redirects test-e2e
# Run full CI pipeline locally
ci: check test-unit build test-redirects validate-frontmatter test-e2e
# =============================================================================
# Changelog
# =============================================================================
# Generate changelog
changelog:
git-cliff --output CHANGELOG.md
# Preview changelog without writing
changelog-preview:
git-cliff --unreleased
# =============================================================================
# Cleanup
# =============================================================================
# Remove build artifacts
clean:
rm -rf build .svelte-kit
# Deep clean including node_modules
clean-all: clean
rm -rf node_modules
# =============================================================================
# Utilities
# =============================================================================
# Sync SvelteKit types
sync:
npx svelte-kit sync
# Build with bundle analysis
analyze:
BUILD_ANALYZE=true npm run build && open build/stats.html || open .svelte-kit/output/client/stats.html
# =============================================================================
# Media Recovery (Wayback Machine)
# =============================================================================
# Audit posts for missing/external media
audit-media:
npx tsx scripts/audit-media.mts
# Audit media and output JSON report
audit-media-json:
npx tsx scripts/audit-media.mts --json
# Query Wayback CDX API (dry run)
wayback-query-dry:
npx tsx scripts/wayback-cdx-query.mts --dry-run
# Query Wayback CDX API and save results
wayback-query:
npx tsx scripts/wayback-cdx-query.mts --output wayback-cdx-results.json
# Download archived media (dry run)
wayback-download-dry:
npx tsx scripts/wayback-download.mts wayback-cdx-results.json --dry-run
# Download archived media
wayback-download:
npx tsx scripts/wayback-download.mts wayback-cdx-results.json
# Preview post image URL updates (dry run)
wayback-update-dry:
npx tsx scripts/update-post-images.mts
# Apply post image URL updates
wayback-update:
npx tsx scripts/update-post-images.mts --apply
# Full recovery pipeline (dry run)
wayback-recover-dry:
npx tsx scripts/wayback-recover.mts --dry-run
# Full recovery pipeline
wayback-recover:
npx tsx scripts/wayback-recover.mts
# Install git hooks (frontmatter validation on commit)
install-hooks:
ln -sf ../../scripts/hooks/pre-commit .git/hooks/pre-commit
@echo "Git hooks installed."
# Show environment info
info:
@echo "Node: $$(node --version)"
@echo "npm: $$(npm --version)"
@echo "Root: {{root}}"