Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (37 loc) · 1.78 KB
/
Copy pathMakefile
File metadata and controls
50 lines (37 loc) · 1.78 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
.PHONY: install dev test lint typecheck build dist-check hygiene binary ci hooks clean help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies (reproducible, from package-lock.json)
npm ci
dev: ## Install all dependencies, including dev tooling
npm install
test: ## Run unit tests
npm test
lint: ## Run ESLint
npm run lint
typecheck: ## Run the TypeScript type checker
npm run typecheck
build: ## Compile TypeScript to dist/
npm run build
dist-check: ## Verify the npm package contents (CI equivalent)
npm pack --dry-run --json | node -e "const f=JSON.parse(require('fs').readFileSync(0,'utf8'))[0].files.map(x=>x.path); if(!f.includes('dist/bin/abx.js')){console.error('dist/bin/abx.js NOT found in package');process.exit(1)} console.log('dist/bin/abx.js found in package: OK')"
binary: ## Build standalone binary for current platform (esbuild + Node SEA)
npm ci
node scripts/build_binary.mjs
hygiene: ## Fail on committed local paths / credential-like strings (CI equivalent)
npm run check:hygiene
ci: ## Run local CI equivalent (single Node version; NOT a full substitute for the Node 20/22 matrix in GitHub Actions)
$(MAKE) hygiene
npm run typecheck
npm run lint
rm -rf dist/
npm run build
npm test
npm run parity:coverage
$(MAKE) dist-check
@echo "Note: this runs on a single Node.js version; the Node 20/22 matrix can only be fully covered by GitHub Actions CI."
hooks: ## Install pre-commit (called automatically via .githooks/pre-commit)
pip install pre-commit
@echo "pre-commit installed. It will be called automatically via .githooks/pre-commit."
clean: ## Clean build artifacts
rm -rf build/ dist/ coverage/ *.tgz