@skyf0xx/hedgehog-core-full-stack-app 1.0.13 → 1.0.14
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyf0xx/hedgehog-core-full-stack-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"description": "Hedgehog's full-stack-app core: an Nx/pnpm/NestJS/Next.js workspace, backend-first domain module build discipline, and the agents and skills that drive it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -163,9 +163,14 @@ write — same treatment as an out-of-scope `apps/mobile`.
|
|
|
163
163
|
|
|
164
164
|
```bash
|
|
165
165
|
npx nx g @nx/js:lib packages/auth --bundler=none --unitTestRunner=vitest
|
|
166
|
-
pnpm add better-auth @thallesp/nestjs-better-auth
|
|
167
166
|
```
|
|
168
167
|
|
|
168
|
+
`better-auth` and `@thallesp/nestjs-better-auth` are already declared in
|
|
169
|
+
root `package.json` and resolved by `pnpm-lock.yaml` — the core ships
|
|
170
|
+
them, so there is nothing to install here. Don't run `pnpm add` for
|
|
171
|
+
either: an add resolves against npm at whatever is latest today, which
|
|
172
|
+
is the drift this core pins them to avoid.
|
|
173
|
+
|
|
169
174
|
Configure the Drizzle adapter against `packages/db`. Add
|
|
170
175
|
`BETTER_AUTH_SECRET: z.string().min(32)` to `packages/config/env.schema.ts`
|
|
171
176
|
now (it doesn't exist in the core schema `hedgehog-bootstrap-full-stack-app-core`
|
|
@@ -175,9 +180,10 @@ line reproduces the exact `loadEnv()` crash-on-boot that
|
|
|
175
180
|
`hedgehog-bootstrap-full-stack-app-core`'s `DATABASE_URL` entry exists to prevent, just
|
|
176
181
|
for this var instead. Tag: `scope:auth`, `type:adapter`.
|
|
177
182
|
|
|
178
|
-
Also wire the global auth guard on `apps/api`:
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
Also wire the global auth guard on `apps/api`: register the guard
|
|
184
|
+
(secure-by-default) against `packages/auth` — the root declaration
|
|
185
|
+
already resolves `@thallesp/nestjs-better-auth` for every project in the
|
|
186
|
+
workspace, so `apps/api` needs no add of its own. `apps/api`'s
|
|
181
187
|
`depConstraints` entry needs `scope:auth` added to its allowed
|
|
182
188
|
dependencies now — the one deliberate exception to "api reaches things
|
|
183
189
|
only through ports," since auth is cross-cutting infra, not a domain
|
|
@@ -195,9 +201,12 @@ skipped, say so plainly and move on — same treatment as an out-of-scope
|
|
|
195
201
|
|
|
196
202
|
```bash
|
|
197
203
|
npx nx g @nx/node:app apps/worker
|
|
198
|
-
pnpm add bullmq ioredis
|
|
199
204
|
```
|
|
200
205
|
|
|
206
|
+
`bullmq` and `ioredis` are already declared in root `package.json` and
|
|
207
|
+
resolved by `pnpm-lock.yaml` — same as Auth's packages above. Nothing to
|
|
208
|
+
install here; don't run `pnpm add` for either.
|
|
209
|
+
|
|
201
210
|
Add a `redis` service to the root `docker-compose.yml` that
|
|
202
211
|
`hedgehog-bootstrap-full-stack-app-core` landed (Postgres-only) and
|
|
203
212
|
`REDIS_URL: z.string().url()` to `packages/config/env.schema.ts` (it
|
|
@@ -235,12 +244,49 @@ Skip this step entirely if Mobile isn't on for this project (check
|
|
|
235
244
|
say so plainly and move on — same pattern as Auth (step 1) and Queue
|
|
236
245
|
(step 2) when their add-on is off.
|
|
237
246
|
|
|
247
|
+
Mobile's packages are pinned in `addon-versions.json` at the workspace
|
|
248
|
+
root, not named inline here and not declared in root `package.json` —
|
|
249
|
+
Expo pulls a native build matrix that has no business in a project that
|
|
250
|
+
never scaffolds `apps/mobile`. Read every version from that file rather
|
|
251
|
+
than typing one, so this step installs what the core was last gated
|
|
252
|
+
against:
|
|
253
|
+
|
|
238
254
|
```bash
|
|
255
|
+
NX_EXPO=$(node -p "require('./addon-versions.json').mobile['@nx/expo']")
|
|
256
|
+
NATIVEWIND=$(node -p "require('./addon-versions.json').mobile.nativewind")
|
|
257
|
+
RNR=$(node -p "require('./addon-versions.json').mobile['@react-native-reusables/cli']")
|
|
258
|
+
|
|
259
|
+
pnpm add -w -D "@nx/expo@$NX_EXPO"
|
|
260
|
+
pnpm add -w "nativewind@$NATIVEWIND"
|
|
261
|
+
|
|
239
262
|
npx nx g @nx/expo:app apps/mobile --unitTestRunner=jest
|
|
240
|
-
|
|
241
|
-
npx @react-native-reusables/cli
|
|
263
|
+
|
|
264
|
+
npx "@react-native-reusables/cli@$RNR" init
|
|
265
|
+
npx "@react-native-reusables/cli@$RNR" add button text
|
|
242
266
|
```
|
|
243
267
|
|
|
268
|
+
`-w` is required: this is a pnpm workspace, and an add without it fails
|
|
269
|
+
with `ERR_PNPM_ADDING_TO_ROOT` rather than installing.
|
|
270
|
+
|
|
271
|
+
`@nx/expo:app` generates `apps/mobile/src/test-setup.ts` with an untyped
|
|
272
|
+
`defineGlobal` helper, which is a `TS7006` error under the core's
|
|
273
|
+
`strict: true` base tsconfig — `mobile:typecheck` fails on a fresh
|
|
274
|
+
scaffold until it is annotated:
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
const defineGlobal = (name: string, value: unknown) => {
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
Make that edit before the step's commit. `nx-migrate.yml`'s add-on gate
|
|
281
|
+
applies the same annotation, so the day `@nx/expo` ships the types both
|
|
282
|
+
stop being needed together.
|
|
283
|
+
|
|
284
|
+
`@nx/expo`'s pin is byte-identical to every other `@nx/*` entry in root
|
|
285
|
+
`package.json` — Nx requires its plugin matrix to be version-identical,
|
|
286
|
+
and a mismatch fails at generator time with a resolution error rather
|
|
287
|
+
than at install. If the pin and the `@nx/*` entries have drifted apart,
|
|
288
|
+
stop and fix `addon-versions.json` rather than installing anyway.
|
|
289
|
+
|
|
244
290
|
`@nx/expo:app`'s own default for `--unitTestRunner` is `none` — pass it
|
|
245
291
|
explicitly, or `apps/mobile` has no `test` target at all and the `screen`
|
|
246
292
|
layer's verify command below fails on a missing target rather than a
|
|
@@ -253,7 +299,7 @@ NativeWind and the `@/*` path alias into `apps/mobile/tsconfig.json`
|
|
|
253
299
|
named components' source into `apps/mobile/src/components/ui/`. `button`
|
|
254
300
|
and `text` are the two the `screen` generator's mobile output imports —
|
|
255
301
|
add any further components `front-end-eng` needs the same way, per
|
|
256
|
-
module, as it builds.
|
|
302
|
+
module, as it builds, at the same pinned CLI version.
|
|
257
303
|
|
|
258
304
|
Edit `init`'s generated theme (`tailwind.config.js` colors, light/dark)
|
|
259
305
|
to match `apps/web`'s base theme (landed by
|
|
@@ -355,6 +401,19 @@ time via `hedgehog next`/`hedgehog verify`, each its own commit.
|
|
|
355
401
|
(written by `planner` at planning intake) turns that add-on on — say so
|
|
356
402
|
plainly and skip otherwise, don't leave it ambiguous whether the step
|
|
357
403
|
was considered.
|
|
404
|
+
- A skipped Auth or Queue step leaves that add-on's packages declared but
|
|
405
|
+
unused, since the core ships them in root `package.json`. Delete the
|
|
406
|
+
skipped add-on's entries (`better-auth` and
|
|
407
|
+
`@thallesp/nestjs-better-auth` for Auth; `bullmq` and `ioredis` for
|
|
408
|
+
Queue) and re-run `pnpm install` so the lockfile drops them. Do this in
|
|
409
|
+
the same commit that records the skip. Mobile needs nothing — its
|
|
410
|
+
packages were never in the install to begin with.
|
|
411
|
+
- Never write a version number into a command in this file. Auth and
|
|
412
|
+
Queue versions come from root `package.json`; Mobile's come from
|
|
413
|
+
`addon-versions.json`. A version typed into a step is invisible to
|
|
414
|
+
`nx migrate`, to `pnpm outdated`, and to CI's add-on gate, so it drifts
|
|
415
|
+
silently in whichever direction the day's npm resolution happens to
|
|
416
|
+
take it.
|
|
358
417
|
- Don't add domain schema, contracts, or any `libs/<module>/*` content —
|
|
359
418
|
that's Phase A, started after Bootstrap, one module at a time.
|
|
360
419
|
- Don't deviate from the package/library choices above, for whichever
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": [
|
|
3
|
+
"Pinned versions for the Mobile add-on's packages, which are NOT declared in",
|
|
4
|
+
"workspace/package.json. Expo pulls a native build matrix (Metro, the",
|
|
5
|
+
"React Native toolchain, the @react-native-reusables CLI's own tree) that",
|
|
6
|
+
"every consuming project would otherwise install whether or not it ever",
|
|
7
|
+
"scaffolds apps/mobile. Declaring them here keeps the version a tracked,",
|
|
8
|
+
"tool-visible fact — nx-migrate.yml's add-on gate scaffolds against these",
|
|
9
|
+
"pins every Monday, and a bump is a reviewable diff — without putting the",
|
|
10
|
+
"matrix in the default install.",
|
|
11
|
+
"",
|
|
12
|
+
"Auth and Queue packages are NOT here: they are plain Node dependencies with",
|
|
13
|
+
"no native matrix, so they are declared in workspace/package.json and",
|
|
14
|
+
"resolved by pnpm-lock.yaml like every other core dependency.",
|
|
15
|
+
"",
|
|
16
|
+
"@nx/expo must stay byte-identical to every other @nx/* entry in",
|
|
17
|
+
"workspace/package.json — Nx requires its plugin matrix to be version-",
|
|
18
|
+
"identical, and a mismatch fails at generator time, not install time.",
|
|
19
|
+
"nx-migrate.yml's add-on gate asserts that equality before it scaffolds.",
|
|
20
|
+
"",
|
|
21
|
+
"nativewind stays on 4.x: 5.x, the line that targets Tailwind v4, is still",
|
|
22
|
+
"a preview release. 4.x declares a `tailwindcss@~3` peer (through",
|
|
23
|
+
"react-native-css-interop) against the v4 that apps/web pins, which the",
|
|
24
|
+
"`react-native-css-interop>tailwindcss` peerDependencyRules entry in",
|
|
25
|
+
"package.json accepts — apps/mobile carries its own NativeWind-side Tailwind",
|
|
26
|
+
"config, written by the @react-native-reusables CLI's init, so the two",
|
|
27
|
+
"never share a config. Revisit both when nativewind 5 goes stable.",
|
|
28
|
+
"",
|
|
29
|
+
"@react-native-reusables/cli is a scaffolder, not a runtime dependency — it",
|
|
30
|
+
"copies component source into apps/mobile and is never installed. Pinning it",
|
|
31
|
+
"is what stops `npx @react-native-reusables/cli@latest` from resolving to a",
|
|
32
|
+
"different generator on every Bootstrap run."
|
|
33
|
+
],
|
|
34
|
+
"mobile": {
|
|
35
|
+
"@nx/expo": "23.1.2",
|
|
36
|
+
"nativewind": "4.2.6",
|
|
37
|
+
"@react-native-reusables/cli": "0.7.1"
|
|
38
|
+
}
|
|
39
|
+
}
|
package/workspace/package.json
CHANGED
|
@@ -67,8 +67,12 @@
|
|
|
67
67
|
"@nestjs/common": "^11.0.0",
|
|
68
68
|
"@nestjs/core": "^11.0.0",
|
|
69
69
|
"@nestjs/platform-express": "^11.0.0",
|
|
70
|
+
"@thallesp/nestjs-better-auth": "^2.7.0",
|
|
70
71
|
"axios": "^1.18.0",
|
|
72
|
+
"better-auth": "^1.7.2",
|
|
73
|
+
"bullmq": "^6.3.4",
|
|
71
74
|
"drizzle-orm": "^0.45.2",
|
|
75
|
+
"ioredis": "^6.0.0",
|
|
72
76
|
"nestjs-pino": "^4.6.1",
|
|
73
77
|
"next": "~16.3.0",
|
|
74
78
|
"pg": "^8.22.0",
|
|
@@ -88,7 +92,8 @@
|
|
|
88
92
|
"eslint-plugin-import>eslint": "10",
|
|
89
93
|
"eslint-plugin-jsx-a11y>eslint": "10",
|
|
90
94
|
"eslint-plugin-react>eslint": "10",
|
|
91
|
-
"@exodus/bytes>@noble/hashes": "1"
|
|
95
|
+
"@exodus/bytes>@noble/hashes": "1",
|
|
96
|
+
"react-native-css-interop>tailwindcss": "4"
|
|
92
97
|
}
|
|
93
98
|
},
|
|
94
99
|
"overrides": {
|