-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
89 lines (68 loc) · 2 KB
/
Makefile
File metadata and controls
89 lines (68 loc) · 2 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
.DEFAULT_GOAL := help
SHELL := /bin/bash
## General
.PHONY: help
help: ## Show this help message
@echo ""
@echo "Usage:"
@echo " make <target>"
@echo ""
@awk 'BEGIN {FS = ":.*?## "; section=""} \
/^## / { section=substr($$0, 4); next } \
/^[a-zA-Z_-]+:.*?## / { \
if (section != prev) { printf "\n\033[1m%s\033[0m\n", section; prev=section } \
printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 \
}' $(MAKEFILE_LIST)
@echo ""
.PHONY: install
install: ## Install dependencies and git hooks
bun install
prek install
## Development
.PHONY: dev
dev: ## Start development server
bun run dev
.PHONY: preview
preview: ## Build and preview production locally
bun run preview
## Build
.PHONY: build
build: ## Build production bundle
bun run build
.PHONY: clean
clean: ## Clean build artifacts and caches
rm -rf dist .astro node_modules/.astro
## Quality
.PHONY: lint
lint: ## Run oxlint on source files
bunx oxlint src/
.PHONY: typecheck
typecheck: ## Run TypeScript type checking
bunx astro check
.PHONY: check
check: lint typecheck ## Run all checks (typecheck + lint)
.PHONY: spellcheck
spellcheck: ## Run spell checker on all files
prek run typos --all-files
.PHONY: pre-commit
pre-commit: ## Run all pre-commit hooks
prek run --all-files
## Content
.PHONY: migrate
migrate: ## Migrate Blogger posts
bun run scripts/migrate-blogger.ts
.PHONY: content-new-author
content-new-author: ## Create a new author (ID=author-id NAME="Author Name")
@if [ -z "$(ID)" ] || [ -z "$(NAME)" ]; then \
echo "Usage: make content-new-author ID=author-id NAME=\"Author Name\""; exit 1; fi
@echo '{"name":"$(NAME)","bio":"","github":"","avatar":"","twitter":"","bluesky":"","mastodon":"","website":"","featured":false}' \
| python3 -m json.tool > content/authors/$(ID).json
@echo "Created content/authors/$(ID).json"
## Maintenance
.PHONY: fresh
fresh: clean ## Clean install (remove node_modules and reinstall)
rm -rf node_modules bun.lock
bun install
.PHONY: update
update: ## Update all dependencies
bun update