|
1 | | -VENV = .venv/bin |
2 | | - |
3 | 1 | .PHONY: all |
4 | | -all: install-deps build fmt lint test |
| 2 | +all: build |
5 | 3 |
|
6 | | -.PHONY: install-deps |
7 | | -install-deps: |
8 | | - @echo "=== Running target: install-deps ===" |
9 | | - npm install --ignore-scripts |
10 | | - python3 -m venv .venv && \ |
11 | | - $(VENV)/pip install -r requirements.txt |
| 4 | +########################### |
| 5 | +# Composite targets |
| 6 | +# ########################### |
12 | 7 |
|
13 | 8 | .PHONY: build |
14 | | -build: |
15 | | - @echo "=== Running target: build ===" |
16 | | - npm run build # runs build through prepare-script |
| 9 | +build: install lint-fix fmt npm-build snapshots |
| 10 | + |
| 11 | +.PHONY: ci |
| 12 | +ci: install lint fmt-check npm-build test |
| 13 | + |
| 14 | +.PHONY: install |
| 15 | +install: py-install npm-install |
| 16 | + |
| 17 | +.PHONY: lint |
| 18 | +lint: py-lint-check npm-lint-check |
| 19 | + |
| 20 | +.PHONY: lint-fix |
| 21 | +lint-fix: py-lint-fix npm-lint-fix |
| 22 | + |
| 23 | +.PHONY: fmt |
| 24 | +fmt: py-fmt-fix npm-fmt-fix |
| 25 | + |
| 26 | +.PHONY: fmt-check |
| 27 | +fmt-check: py-fmt-check npm-fmt-check |
17 | 28 |
|
18 | 29 | .PHONY: test |
19 | | -test: npm-test py-test |
| 30 | +test: py-test npm-test |
| 31 | + |
| 32 | +.PHONY: snapshots |
| 33 | +snapshots: npm-test-update |
| 34 | + |
| 35 | +.PHONY: clean |
| 36 | +clean: npm-clean py-clean |
| 37 | + |
| 38 | +.PHONY: clean-all |
| 39 | +clean-all: npm-clean-all py-clean-all |
| 40 | + |
| 41 | + |
| 42 | +########################### |
| 43 | +# NPM targets |
| 44 | +########################### |
| 45 | +.PHONY: npm-install |
| 46 | +npm-install: |
| 47 | +ifeq ($(CI),true) |
| 48 | + npm ci |
| 49 | +else |
| 50 | + npm install --ignore-scripts |
| 51 | +endif |
| 52 | + |
| 53 | +.PHONY: npm-build |
| 54 | +npm-build: |
| 55 | + npm run build |
| 56 | + |
| 57 | +.PHONY: npm-fmt-fix |
| 58 | +npm-fmt-fix: |
| 59 | + npm run fmt |
| 60 | + |
| 61 | +.PHONY: npm-fmt-check |
| 62 | +npm-fmt-check: |
| 63 | + npm run fmt:check |
| 64 | + |
| 65 | +.PHONY: npm-upgrade-deps |
| 66 | +npm-upgrade-deps: |
| 67 | + npm run upgrade-dependencies |
20 | 68 |
|
| 69 | +.PHONY: npm-biome-migrate |
| 70 | +npm-biome-migrate: |
| 71 | + npm run biome-migrate |
| 72 | + |
| 73 | +.PHONY: npm-test |
21 | 74 | npm-test: |
22 | | - @echo "=== Running target: npm-test ===" |
23 | 75 | npm run test |
24 | 76 |
|
25 | | -py-test: |
26 | | - @echo "=== Running target: py-test ===" |
27 | | - TARGET_BUCKET_URL=s3://dummy/web \ |
28 | | - EXPIRE_SECONDS=86400 \ |
29 | | - DEPLOY_LOG_BUCKET_URL=s3://dummy/deployments.log \ |
30 | | - $(VENV)/python -m unittest discover webapp_deploy |
| 77 | +.PHONY: npm-test-update |
| 78 | +npm-test-update: |
| 79 | + npm run test:update |
31 | 80 |
|
32 | | -.PHONY: fmt |
33 | | -fmt: |
| 81 | +.PHONY: npm-lint-check |
| 82 | +npm-lint-check: |
| 83 | + npm run lint |
| 84 | + |
| 85 | +.PHONY: npm-lint-fix |
| 86 | +npm-lint-fix: |
34 | 87 | npm run lint:fix |
35 | | - $(VENV)/black webapp_deploy |
36 | 88 |
|
37 | | -.PHONY: npm-fmt |
38 | | -npm-fmt: |
39 | | - @echo "=== Running target: npm-fmt ===" |
40 | | - npm run format |
| 89 | +.PHONY: npm-clean |
| 90 | +npm-clean: |
| 91 | + rm -rf dist/ lib/ |
41 | 92 |
|
42 | | -.PHONY: py-fmt |
43 | | -py-fmt: |
44 | | - @echo "=== Running target: py-fmt ===" |
45 | | - $(VENV)/black webapp_deploy |
| 93 | +.PHONY: npm-clean-all |
| 94 | +npm-clean-all: npm-clean |
| 95 | + rm -rf node_modules/ |
46 | 96 |
|
47 | | -.PHONY: lint |
48 | | -lint: npm-lint py-lint |
49 | 97 |
|
50 | | -.PHONY: npm-lint |
51 | | -npm-lint: |
52 | | - @echo "=== Running target: npm-lint ===" |
53 | | - npm run lint |
| 98 | +########################### |
| 99 | +## Python targets |
| 100 | +########################### |
| 101 | +.PHONY: py-install |
| 102 | +py-install: |
| 103 | + uv sync |
54 | 104 |
|
55 | | -.PHONY: py-lint |
56 | | -py-lint: |
57 | | - @echo "=== Running target: py-lint ===" |
58 | | - $(VENV)/flake8 --exclude .venv webapp_deploy |
59 | | - $(VENV)/black --check webapp_deploy |
| 105 | +.PHONY: py-lint-check |
| 106 | +py-lint-check: |
| 107 | + uv run ruff check webapp_deploy |
60 | 108 |
|
61 | | -.PHONY: snapshots |
62 | | -snapshots: |
63 | | - @echo "=== Running target: snapshots ===" |
64 | | - npm test -- --updateSnapshot |
| 109 | +.PHONY: py-lint-fix |
| 110 | +py-lint-fix: |
| 111 | + uv run ruff check --fix webapp_deploy |
65 | 112 |
|
66 | | -.PHONY: clean |
67 | | -clean: |
68 | | - rm -rf dist/ lib/ |
| 113 | +.PHONY: py-fmt-fix |
| 114 | +py-fmt-fix: |
| 115 | + uv run ruff format webapp_deploy |
69 | 116 |
|
70 | | -.PHONY: upgrade-deps |
71 | | -upgrade-deps: |
72 | | - @echo "=== Running target: upgrade-deps ===" |
73 | | - npm run upgrade-dependencies |
| 117 | +.PHONY: py-fmt-check |
| 118 | +py-fmt-check: |
| 119 | + uv run ruff format --check webapp_deploy |
74 | 120 |
|
75 | | -.PHONY: biome-migrate |
76 | | -biome-migrate: |
77 | | - @echo "=== Running target: biome-migrate ===" |
78 | | - npm run biome-migrate |
| 121 | +.PHONY: py-test |
| 122 | +py-test: |
| 123 | + TARGET_BUCKET_URL=s3://dummy/web \ |
| 124 | + EXPIRE_SECONDS=86400 \ |
| 125 | + DEPLOY_LOG_BUCKET_URL=s3://dummy/deployments.log \ |
| 126 | + uv run python -m unittest discover webapp_deploy |
| 127 | + |
| 128 | +.PHONY: py-clean |
| 129 | +py-clean: |
| 130 | + uv run ruff clean |
| 131 | + uv clean |
| 132 | + |
| 133 | +.PHONY: py-clean-all |
| 134 | +py-clean-all: py-clean |
| 135 | + rm -rf venv |
0 commit comments