-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (44 loc) · 1.98 KB
/
Copy pathMakefile
File metadata and controls
64 lines (44 loc) · 1.98 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
# Makefile for the Particle Lab — thin wrappers around the npm scripts plus the
# composite gate targets from CLAUDE.md ("build, lint, test must pass before commit").
# Run `make` (or `make help`) to list targets.
NPM := npm
.DEFAULT_GOAL := help
.PHONY: help run install ci dev build preview typecheck lint lint-fix test test-watch coverage check verify clean clean-all
help: ## Show available targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-12s\033[0m %s\n", $$1, $$2}'
run: node_modules ## Zero-to-running: install deps if needed, then launch the app in the browser
$(NPM) run dev -- --open
# Install only when dependencies are missing or the manifests changed. Not .PHONY:
# the directory's existence/mtime gates whether `npm install` runs (so `run` is fast
# on a warm checkout and self-bootstrapping on a fresh clone). No `##` ⇒ hidden from help.
node_modules: package.json package-lock.json
$(NPM) install
@touch node_modules
install: ## Install dependencies (npm install)
$(NPM) install
ci: ## Clean, reproducible install from the lockfile (npm ci)
$(NPM) ci
dev: ## Start the Vite dev server
$(NPM) run dev
build: ## Type-check and build for production
$(NPM) run build
preview: build ## Build, then serve the production bundle locally
$(NPM) run preview
typecheck: ## Type-check all projects (tsc -b)
$(NPM) run typecheck
lint: ## Lint with ESLint
$(NPM) run lint
lint-fix: ## Lint and auto-fix
$(NPM) run lint -- --fix
test: ## Run the test suite once (Vitest)
$(NPM) test
test-watch: ## Run tests in watch mode
$(NPM) run test:watch
coverage: ## Run tests with coverage report
$(NPM) run test:coverage
check: typecheck lint test ## Fast pre-commit gate: typecheck + lint + test
verify: check build ## Full gate: typecheck + lint + test + production build
clean: ## Remove build output and caches
rm -rf dist coverage node_modules/.tmp
clean-all: clean ## Also remove installed dependencies
rm -rf node_modules