-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (48 loc) · 1.66 KB
/
Makefile
File metadata and controls
56 lines (48 loc) · 1.66 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
.PHONY: clean
clean:
rm -rf dist
rm -rf coverage
rm -rf examples/*.js
find . -name "*.tsbuildinfo" -delete
.PHONY: deps
deps:
npm install
.PHONY: build
build: clean deps
npm run build
.PHONY: test
test: build
npm run test
.PHONY: prettier
prettier: deps
npm run prettier
.PHONY: prettier-check
prettier-check: deps
npx prettier --config .prettierrc 'src/**/*.ts' --check
.PHONY: ci-check
ci-check: deps build prettier
@echo "Checking for uncommitted changes..."
@if ! git diff --quiet --exit-code; then \
echo "❌ Error: Files were modified by 'npm install', build, or prettier"; \
echo "Modified files:"; \
git diff --name-only; \
echo ""; \
if git diff --quiet package-lock.json 2>/dev/null; then \
echo "Please run 'make build' and 'make prettier' locally and commit the changes."; \
else \
echo "package-lock.json was modified. Checking if it's just peer metadata differences..."; \
git diff package-lock.json > /tmp/package-lock.diff; \
if grep -q '^[+-].*"peer":' /tmp/package-lock.diff && ! grep -qvE '^[+-].*"peer":|^[+-]---|^[+]\+\+\+|^@@' /tmp/package-lock.diff; then \
echo "⚠️ Only peer metadata differences detected. These are harmless but should be normalized."; \
echo " Run 'npm install --package-lock-only' locally and commit the updated package-lock.json"; \
else \
echo "package-lock.json has significant differences (not just peer metadata)"; \
echo "Please run 'npm install' locally and commit the updated package-lock.json"; \
fi; \
echo ""; \
echo "Differences in package-lock.json:"; \
git diff package-lock.json | head -100; \
fi; \
exit 1; \
fi
@echo "✅ No uncommitted changes detected"