create-projx 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,286 +0,0 @@
1
- .PHONY: setup install format lint fix check typecheck test test-coverage test-e2e \
2
- migrate migrate-down seed run run-dev stop logs clean
3
-
4
- # ─── Setup ───────────────────────────────────────────────────────────
5
-
6
- setup:
7
- git config core.hooksPath .githooks
8
- @echo "Git hooks configured."
9
- $(MAKE) install
10
-
11
- install:
12
- <% if (components.includes('fastapi')) { %>
13
- cd fastapi && uv sync --all-extras
14
- <% } %>
15
- <% if (components.includes('fastify')) { %>
16
- cd fastify && pnpm install --frozen-lockfile
17
- <% } %>
18
- <% if (components.includes('frontend')) { %>
19
- cd frontend && npm ci
20
- <% } %>
21
- <% if (components.includes('e2e')) { %>
22
- cd e2e && npm ci
23
- <% } %>
24
- <% if (components.includes('mobile')) { %>
25
- cd mobile && flutter pub get 2>/dev/null || echo "Flutter SDK not installed — skipping mobile"
26
- <% } %>
27
- @echo "All dependencies installed."
28
-
29
- # ─── Format ──────────────────────────────────────────────────────────
30
-
31
- format:
32
- <% if (components.includes('fastapi')) { %>
33
- cd fastapi && uv run ruff format src tests
34
- <% } %>
35
- <% if (components.includes('fastify')) { %>
36
- cd fastify && npx prettier --write --ignore-unknown .
37
- <% } %>
38
- <% if (components.includes('frontend')) { %>
39
- cd frontend && npx prettier --write --ignore-unknown .
40
- <% } %>
41
- <% if (components.includes('e2e')) { %>
42
- cd e2e && npx prettier --write --ignore-unknown .
43
- <% } %>
44
- <% if (components.includes('mobile')) { %>
45
- cd mobile && dart format . 2>/dev/null || true
46
- <% } %>
47
- <% if (components.includes('infra')) { %>
48
- cd infra/stack && terraform fmt -recursive 2>/dev/null || true
49
- <% } %>
50
-
51
- # ─── Lint ────────────────────────────────────────────────────────────
52
-
53
- lint:
54
- <% if (components.includes('fastapi')) { %>
55
- cd fastapi && uv run ruff check src tests
56
- <% } %>
57
- <% if (components.includes('fastify')) { %>
58
- cd fastify && npx eslint 'src/**/*.ts' 'tests/**/*.ts'
59
- <% } %>
60
- <% if (components.includes('frontend')) { %>
61
- cd frontend && npx eslint 'src/**/*.{ts,tsx}'
62
- <% } %>
63
- <% if (components.includes('e2e')) { %>
64
- cd e2e && npx eslint '**/*.ts'
65
- <% } %>
66
- <% if (components.includes('mobile')) { %>
67
- cd mobile && dart analyze --fatal-infos 2>/dev/null || true
68
- <% } %>
69
- <% if (components.includes('infra')) { %>
70
- cd infra/stack && terraform validate 2>/dev/null || true
71
- <% } %>
72
-
73
- # ─── Fix (format + lint with auto-fix) ──────────────────────────────
74
-
75
- fix:
76
- <% if (components.includes('fastapi')) { %>
77
- cd fastapi && uv run ruff format src tests && uv run ruff check --fix src tests
78
- <% } %>
79
- <% if (components.includes('fastify')) { %>
80
- cd fastify && npx prettier --write --ignore-unknown . && npx eslint --fix 'src/**/*.ts' 'tests/**/*.ts'
81
- <% } %>
82
- <% if (components.includes('frontend')) { %>
83
- cd frontend && npx prettier --write --ignore-unknown . && npx eslint --fix 'src/**/*.{ts,tsx}'
84
- <% } %>
85
- <% if (components.includes('e2e')) { %>
86
- cd e2e && npx prettier --write --ignore-unknown . && npx eslint --fix '**/*.ts'
87
- <% } %>
88
- <% if (components.includes('mobile')) { %>
89
- cd mobile && dart format . 2>/dev/null && dart analyze --fatal-infos 2>/dev/null || true
90
- <% } %>
91
- <% if (components.includes('infra')) { %>
92
- cd infra/stack && terraform fmt -recursive 2>/dev/null || true
93
- <% } %>
94
-
95
- # ─── Type Check ──────────────────────────────────────────────────────
96
-
97
- typecheck:
98
- <% if (components.includes('fastify')) { %>
99
- cd fastify && npx tsc --noEmit
100
- <% } %>
101
- <% if (components.includes('frontend')) { %>
102
- cd frontend && npx tsc --noEmit
103
- <% } %>
104
- <% if (components.includes('e2e')) { %>
105
- cd e2e && npx tsc --noEmit
106
- <% } %>
107
-
108
- # ─── Check (CI-equivalent) ──────────────────────────────────────────
109
-
110
- check:
111
- <% if (components.includes('fastapi')) { %>
112
- cd fastapi && uv run ruff format --check src tests && uv run ruff check src tests
113
- <% } %>
114
- <% if (components.includes('fastify')) { %>
115
- cd fastify && npx prettier --check . && npx eslint . && npx tsc --noEmit
116
- <% } %>
117
- <% if (components.includes('frontend')) { %>
118
- cd frontend && npx prettier --check . && npx eslint 'src/**/*.{ts,tsx}' && npx tsc --noEmit
119
- <% } %>
120
- <% if (components.includes('e2e')) { %>
121
- cd e2e && npx prettier --check . && npx eslint '**/*.ts' && npx tsc --noEmit
122
- <% } %>
123
- <% if (components.includes('mobile')) { %>
124
- cd mobile && dart format --set-exit-if-changed . 2>/dev/null && dart analyze --fatal-infos 2>/dev/null || true
125
- <% } %>
126
- <% if (components.includes('infra')) { %>
127
- cd infra/stack && terraform fmt -check -recursive 2>/dev/null && terraform validate 2>/dev/null || true
128
- <% } %>
129
-
130
- # ─── Test ────────────────────────────────────────────────────────────
131
-
132
- test:
133
- <% if (components.includes('fastapi')) { %>
134
- cd fastapi && uv run pytest --tb=short -q
135
- <% } %>
136
- <% if (components.includes('fastify')) { %>
137
- cd fastify && pnpm test
138
- <% } %>
139
- <% if (components.includes('frontend')) { %>
140
- cd frontend && npx vitest run
141
- <% } %>
142
- <% if (components.includes('mobile')) { %>
143
- cd mobile && flutter test 2>/dev/null || true
144
- <% } %>
145
-
146
- test-coverage:
147
- <% if (components.includes('fastapi')) { %>
148
- cd fastapi && uv run pytest --cov=src --cov-report=term-missing --cov-fail-under=80
149
- <% } %>
150
- <% if (components.includes('fastify')) { %>
151
- cd fastify && pnpm test -- --coverage
152
- <% } %>
153
- <% if (components.includes('frontend')) { %>
154
- cd frontend && npx vitest run --coverage
155
- <% } %>
156
- <% if (components.includes('mobile')) { %>
157
- cd mobile && flutter test --coverage 2>/dev/null || true
158
- <% } %>
159
- <% if (components.includes('e2e')) { %>
160
-
161
- test-e2e:
162
- cd e2e && npx playwright test
163
- <% } %>
164
- <% if (components.includes('mobile')) { %>
165
-
166
- test-e2e-mobile:
167
- cd mobile && flutter test integration_test/
168
-
169
- mobile-build-apk:
170
- cd mobile && flutter build apk --release
171
-
172
- mobile-build-ios:
173
- cd mobile && flutter build ios --release --no-codesign
174
-
175
- mobile-codegen:
176
- cd mobile && dart run build_runner build --delete-conflicting-outputs
177
- <% } %>
178
- <% if (components.includes('fastapi')) { %>
179
-
180
- # ─── Database ────────────────────────────────────────────────────────
181
-
182
- migrate:
183
- cd fastapi && uv run migrate.py
184
- <% if (components.includes('fastify')) { %>
185
- cd fastify && pnpm prisma:migrate:dev
186
- <% } %>
187
-
188
- migrate-deploy:
189
- cd fastapi && uv run migrate.py
190
- <% if (components.includes('fastify')) { %>
191
- cd fastify && pnpm prisma:migrate:deploy
192
- <% } %>
193
-
194
- migrate-down:
195
- cd fastapi && uv run migrate.py --downgrade -1
196
-
197
- seed:
198
- cd fastapi && uv run seed.py
199
- <% } %>
200
- <% if (components.includes('fastify') && !components.includes('fastapi')) { %>
201
-
202
- migrate:
203
- cd fastify && pnpm prisma:migrate:dev
204
-
205
- migrate-deploy:
206
- cd fastify && pnpm prisma:migrate:deploy
207
- <% } %>
208
-
209
- # ─── Run (local) ─────────────────────────────────────────────────────
210
-
211
- run-local:
212
- <% if (components.includes('fastapi')) { %>
213
- cd fastapi && uv run main.py &
214
- <% } %>
215
- <% if (components.includes('fastify')) { %>
216
- cd fastify && pnpm dev &
217
- <% } %>
218
- <% if (components.includes('frontend')) { %>
219
- cd frontend && npm run dev &
220
- <% } %>
221
- @echo "All services starting. Run 'make stop-local' to stop."
222
- @wait
223
-
224
- stop-local:
225
- @kill $$(lsof -ti:7860,3000,5173 2>/dev/null) 2>/dev/null || true
226
- @echo "All local services stopped."
227
- <% if (components.includes('fastapi')) { %>
228
-
229
- run-fastapi:
230
- cd fastapi && uv run main.py
231
- <% } %>
232
- <% if (components.includes('fastify')) { %>
233
-
234
- run-fastify:
235
- cd fastify && pnpm dev
236
- <% } %>
237
- <% if (components.includes('frontend')) { %>
238
-
239
- run-frontend:
240
- cd frontend && npm run dev
241
- <% } %>
242
- <% if (components.includes('mobile')) { %>
243
-
244
- run-mobile:
245
- cd mobile && flutter run
246
- <% } %>
247
-
248
- # ─── Run (Docker Compose) ───────────────────────────────────────────
249
-
250
- run:
251
- docker compose up -d --build
252
-
253
- run-dev:
254
- docker compose -f docker-compose.dev.yml up -d --build
255
-
256
- stop:
257
- docker compose down
258
- docker compose -f docker-compose.dev.yml down 2>/dev/null || true
259
-
260
- logs:
261
- docker compose logs -f
262
- <% if (components.includes('fastapi')) { %>
263
-
264
- entity:
265
- @test -n "$(name)" || (echo "Usage: make entity name=my_entity" && exit 1)
266
- cd fastapi && uv run scaffold.py $(name)
267
-
268
- entity-custom:
269
- @test -n "$(name)" || (echo "Usage: make entity-custom name=my_entity" && exit 1)
270
- cd fastapi && uv run scaffold.py $(name) --controller
271
- <% } %>
272
-
273
- # ─── Clean ───────────────────────────────────────────────────────────
274
-
275
- clean:
276
- docker compose down -v
277
- docker compose -f docker-compose.dev.yml down -v 2>/dev/null || true
278
- <% if (components.includes('fastapi')) { %>
279
- cd fastapi && rm -rf .pytest_cache __pycache__ .coverage htmlcov
280
- <% } %>
281
- <% if (components.includes('fastify')) { %>
282
- cd fastify && rm -rf dist coverage node_modules/.cache
283
- <% } %>
284
- <% if (components.includes('frontend')) { %>
285
- cd frontend && rm -rf dist coverage node_modules/.cache playwright-report test-results
286
- <% } %>