anhedral 0.1.10 → 0.4.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.
Files changed (87) hide show
  1. package/CHANGELOG.md +119 -0
  2. package/CONTRIBUTING.md +73 -0
  3. package/LICENSE +196 -17
  4. package/README.md +202 -145
  5. package/SECURITY.md +37 -0
  6. package/SKILL.md +244 -0
  7. package/bin/anhedral.js +1 -1
  8. package/dist/architecture/contributions.d.ts +28 -0
  9. package/dist/architecture/contributions.js +125 -0
  10. package/dist/architecture/index.d.ts +12 -0
  11. package/dist/architecture/index.js +6 -0
  12. package/dist/architecture/manifest.d.ts +53 -0
  13. package/dist/architecture/manifest.js +283 -0
  14. package/dist/architecture/modules.d.ts +37 -0
  15. package/dist/architecture/modules.js +184 -0
  16. package/dist/architecture/plan.d.ts +58 -0
  17. package/dist/architecture/plan.js +145 -0
  18. package/dist/architecture/templates.d.ts +10 -0
  19. package/dist/architecture/templates.js +23 -0
  20. package/dist/bin.d.ts +2 -0
  21. package/dist/bin.js +179 -0
  22. package/dist/cli.d.ts +24 -2
  23. package/dist/cli.js +189 -21
  24. package/dist/composers/root.d.ts +6 -0
  25. package/dist/composers/root.js +35 -0
  26. package/dist/dependencies.d.ts +31 -9
  27. package/dist/dependencies.js +227 -60
  28. package/dist/index.d.ts +8 -2
  29. package/dist/index.js +5 -31
  30. package/dist/print.js +15 -0
  31. package/dist/prompts.d.ts +5 -0
  32. package/dist/prompts.js +19 -0
  33. package/dist/render.d.ts +11 -0
  34. package/dist/render.js +74 -0
  35. package/dist/scaffold.d.ts +64 -12
  36. package/dist/scaffold.js +1726 -1150
  37. package/dist/template-source.d.ts +20 -0
  38. package/dist/template-source.js +180 -0
  39. package/dist/templates/api.d.ts +2 -0
  40. package/dist/templates/api.js +3122 -0
  41. package/dist/templates/assets-private-proxy.d.ts +3 -0
  42. package/dist/templates/assets-private-proxy.js +277 -0
  43. package/dist/templates/desktop.d.ts +2 -0
  44. package/dist/templates/desktop.js +639 -0
  45. package/dist/templates/electron-updater.d.ts +3 -0
  46. package/dist/templates/electron-updater.js +358 -0
  47. package/dist/templates/extension.d.ts +1 -1
  48. package/dist/templates/extension.js +322 -248
  49. package/dist/templates/mobile.d.ts +2 -0
  50. package/dist/templates/mobile.js +720 -0
  51. package/dist/templates/shared.d.ts +2 -0
  52. package/dist/templates/shared.js +520 -0
  53. package/dist/templates/web.d.ts +2 -0
  54. package/dist/templates/web.js +412 -0
  55. package/dist/toolchain.d.ts +0 -8
  56. package/dist/toolchain.js +0 -21
  57. package/dist/transaction.d.ts +22 -0
  58. package/dist/transaction.js +822 -0
  59. package/dist/ui.d.ts +33 -0
  60. package/dist/ui.js +199 -0
  61. package/dist/util.d.ts +1 -5
  62. package/dist/util.js +70 -159
  63. package/dist/version.d.ts +2 -0
  64. package/dist/version.js +2 -0
  65. package/dist/workspace-config.d.ts +11 -0
  66. package/dist/workspace-config.js +372 -0
  67. package/docs/conventions.md +92 -0
  68. package/docs/master-stack-map.md +192 -0
  69. package/docs/output-tree-contract.md +482 -0
  70. package/docs/references/manual-scaffolding.md +403 -0
  71. package/docs/references/provisioning.md +220 -0
  72. package/package.json +57 -13
  73. package/templates/api-fastify/apps/api/tsconfig.json +20 -0
  74. package/templates/catalog.json +23 -0
  75. package/templates/db-drizzle/packages/db/tsconfig.json +14 -0
  76. package/templates/desktop-electron/apps/desktop/tsconfig.json +37 -0
  77. package/templates/extension-wxt/apps/extension/tsconfig.json +41 -0
  78. package/templates/mobile-expo/apps/mobile/expo-env.d.ts +1 -0
  79. package/templates/web-next/apps/web/next-env.d.ts +6 -0
  80. package/dist/branding.d.ts +0 -5
  81. package/dist/branding.js +0 -17
  82. package/dist/commands.d.ts +0 -7
  83. package/dist/commands.js +0 -24
  84. package/dist/templates/backend.d.ts +0 -2
  85. package/dist/templates/backend.js +0 -2115
  86. package/dist/templates/frontend.d.ts +0 -2
  87. package/dist/templates/frontend.js +0 -1268
@@ -0,0 +1,482 @@
1
+ # Generated Output-Tree Contract
2
+
3
+ <!-- Generated by tests/update-output-tree-contracts.js. Do not edit by hand. -->
4
+
5
+ These source-only trees are generated with the stable toolchain and `--skip-install`.
6
+ Each contract records every file or symlink path, Unix mode, byte length, and SHA-256 digest.
7
+ Installed dependencies, compiler output, and framework caches are forbidden.
8
+ Deterministic provider-placeholder `.env.example` files are hashed by the contract; generated real `.env` files are forbidden.
9
+
10
+ Runtime E2E builds use disposable operating-system temp directories and are not part of these golden trees.
11
+ A generated project may contain only the root `pnpm-workspace.yaml` and root `pnpm-lock.yaml`; nested pnpm workspace islands are rejected.
12
+
13
+ Regenerate after an intentional scaffold change:
14
+
15
+ ```sh
16
+ pnpm build
17
+ node tests/update-output-tree-contracts.js
18
+ ```
19
+
20
+ ## Scenario summary
21
+
22
+ | Scenario | Apps | Features | Contract | Entries | Tree SHA-256 |
23
+ | --- | --- | --- | --- | ---: | --- |
24
+ | `expo-extension` | web, mobile, api, desktop, extension | database, auth, billing, storage, nativeSubscriptions, electronUpdater | deterministic golden | 145 | `ffe0feed203c4cdfaeeadba03dd2acc93855296699570d81f856b989f45cde23` |
25
+ | `web-api-minimal` | web, api | database, auth | deterministic golden | 65 | `25303118c1ee766afbfd9a707b5b16c25ad587021a62a68238696dda7cbc4385` |
26
+ | `api-only` | api | | deterministic golden | 32 | `a405e93cea274273bf46605e934e4a9be21018513b04c47c83ed1b1b8c9f187e` |
27
+ | `add-desktop-flow` | api, desktop | database, auth | deterministic golden | 67 | `d6804478404c2bb62945f6a7dbb9d1184ebe75d3594b83347cab76e785b21051` |
28
+
29
+ ## expo-extension
30
+
31
+ All app surfaces and feature modules
32
+
33
+ ```text
34
+ expo-extension-sample/
35
+ ├── .env.example
36
+ ├── .github/
37
+ │ └── workflows/
38
+ │ └── anhedral-ci.yml
39
+ ├── .gitignore
40
+ ├── .vercelignore
41
+ ├── ANHEDRAL.md
42
+ ├── PRODUCTION.md
43
+ ├── README.md
44
+ ├── SKILL.md
45
+ ├── anhedral.json
46
+ ├── apps/
47
+ │ ├── api/
48
+ │ │ ├── .env.example
49
+ │ │ ├── .gitignore
50
+ │ │ ├── package.json
51
+ │ │ ├── src/
52
+ │ │ │ ├── application.ts
53
+ │ │ │ ├── auth.ts
54
+ │ │ │ ├── billing.ts
55
+ │ │ │ ├── env.ts
56
+ │ │ │ ├── index.ts
57
+ │ │ │ ├── realtime.ts
58
+ │ │ │ ├── routes/
59
+ │ │ │ │ └── app.ts
60
+ │ │ │ ├── routes.ts
61
+ │ │ │ └── storage.ts
62
+ │ │ ├── tests/
63
+ │ │ │ ├── env.test.ts
64
+ │ │ │ ├── health.test.ts
65
+ │ │ │ ├── revenuecat-webhook.test.ts
66
+ │ │ │ └── storage.test.ts
67
+ │ │ ├── tsconfig.json
68
+ │ │ └── vitest.config.ts
69
+ │ ├── assets-private-proxy/
70
+ │ │ ├── package.json
71
+ │ │ ├── src/
72
+ │ │ │ └── index.js
73
+ │ │ └── wrangler.jsonc
74
+ │ ├── desktop/
75
+ │ │ ├── .env.example
76
+ │ │ ├── components.json
77
+ │ │ ├── electron-builder.env.example
78
+ │ │ ├── index.html
79
+ │ │ ├── package.json
80
+ │ │ ├── postcss.config.mjs
81
+ │ │ ├── scripts/
82
+ │ │ │ ├── dev.mjs
83
+ │ │ │ └── publish-updates.mjs
84
+ │ │ ├── src/
85
+ │ │ │ ├── main/
86
+ │ │ │ │ ├── app-window.ts
87
+ │ │ │ │ ├── main.ts
88
+ │ │ │ │ └── preload.cts
89
+ │ │ │ └── renderer/
90
+ │ │ │ ├── components/
91
+ │ │ │ │ └── ui/
92
+ │ │ │ │ └── button.tsx
93
+ │ │ │ ├── hooks/
94
+ │ │ │ │ └── use-entitlement.ts
95
+ │ │ │ ├── lib/
96
+ │ │ │ │ ├── api.ts
97
+ │ │ │ │ ├── auth.ts
98
+ │ │ │ │ └── utils.ts
99
+ │ │ │ ├── main.tsx
100
+ │ │ │ └── styles.css
101
+ │ │ ├── tsconfig.json
102
+ │ │ ├── tsconfig.main.json
103
+ │ │ └── vite.config.ts
104
+ │ ├── desktop-updater-worker/
105
+ │ │ ├── package.json
106
+ │ │ ├── src/
107
+ │ │ │ └── index.js
108
+ │ │ ├── tests/
109
+ │ │ │ └── worker.test.js
110
+ │ │ └── wrangler.jsonc
111
+ │ ├── extension/
112
+ │ │ ├── .env.example
113
+ │ │ ├── README.md
114
+ │ │ ├── components.json
115
+ │ │ ├── package.json
116
+ │ │ ├── postcss.config.cjs
117
+ │ │ ├── src/
118
+ │ │ │ ├── components/
119
+ │ │ │ │ └── ui/
120
+ │ │ │ │ └── button.tsx
121
+ │ │ │ ├── contexts/
122
+ │ │ │ │ └── auth-context.tsx
123
+ │ │ │ ├── entrypoints/
124
+ │ │ │ │ ├── background.ts
125
+ │ │ │ │ └── sidepanel/
126
+ │ │ │ │ ├── app.tsx
127
+ │ │ │ │ ├── index.html
128
+ │ │ │ │ └── main.tsx
129
+ │ │ │ ├── hooks/
130
+ │ │ │ │ └── use-entitlement.ts
131
+ │ │ │ ├── lib/
132
+ │ │ │ │ ├── api.ts
133
+ │ │ │ │ └── utils.ts
134
+ │ │ │ └── styles/
135
+ │ │ │ └── main.css
136
+ │ │ ├── tailwind.config.cjs
137
+ │ │ ├── tsconfig.json
138
+ │ │ └── wxt.config.ts
139
+ │ ├── mobile/
140
+ │ │ ├── .env.example
141
+ │ │ ├── .gitignore
142
+ │ │ ├── app/
143
+ │ │ │ ├── _layout.tsx
144
+ │ │ │ └── index.tsx
145
+ │ │ ├── app.json
146
+ │ │ ├── babel.config.js
147
+ │ │ ├── components/
148
+ │ │ │ └── account-controls.tsx
149
+ │ │ ├── components.json
150
+ │ │ ├── eas.json
151
+ │ │ ├── expo-env.d.ts
152
+ │ │ ├── global.css
153
+ │ │ ├── hooks/
154
+ │ │ │ ├── use-api-client.ts
155
+ │ │ │ └── use-entitlement.ts
156
+ │ │ ├── lib/
157
+ │ │ │ ├── api.ts
158
+ │ │ │ ├── subscriptions.ts
159
+ │ │ │ └── utils.ts
160
+ │ │ ├── metro.config.js
161
+ │ │ ├── nativewind-env.d.ts
162
+ │ │ ├── package.json
163
+ │ │ ├── tailwind.config.js
164
+ │ │ └── tsconfig.json
165
+ │ └── web/
166
+ │ ├── .env.example
167
+ │ ├── app/
168
+ │ │ ├── globals.css
169
+ │ │ ├── layout.tsx
170
+ │ │ └── page.tsx
171
+ │ ├── components/
172
+ │ │ ├── account-actions.tsx
173
+ │ │ ├── subscription-status.tsx
174
+ │ │ └── ui/
175
+ │ │ ├── button.tsx
176
+ │ │ └── card.tsx
177
+ │ ├── components.json
178
+ │ ├── hooks/
179
+ │ │ ├── use-api-client.ts
180
+ │ │ └── use-entitlement.ts
181
+ │ ├── lib/
182
+ │ │ ├── api.ts
183
+ │ │ └── utils.ts
184
+ │ ├── next-env.d.ts
185
+ │ ├── next.config.ts
186
+ │ ├── package.json
187
+ │ ├── postcss.config.mjs
188
+ │ └── tsconfig.json
189
+ ├── cloudflare/
190
+ │ ├── README.md
191
+ │ ├── desktop-updates.md
192
+ │ └── r2-cors.template.json
193
+ ├── docs/
194
+ │ ├── DEVELOPMENT.md
195
+ │ └── STACK.md
196
+ ├── package.json
197
+ ├── packages/
198
+ │ ├── api-client/
199
+ │ │ ├── package.json
200
+ │ │ ├── src/
201
+ │ │ │ ├── app.ts
202
+ │ │ │ ├── generated.ts
203
+ │ │ │ └── index.ts
204
+ │ │ └── tsconfig.json
205
+ │ ├── contracts/
206
+ │ │ ├── package.json
207
+ │ │ ├── src/
208
+ │ │ │ ├── app.ts
209
+ │ │ │ ├── generated.ts
210
+ │ │ │ └── index.ts
211
+ │ │ └── tsconfig.json
212
+ │ ├── db/
213
+ │ │ ├── .env.example
214
+ │ │ ├── drizzle.config.ts
215
+ │ │ ├── migrations/
216
+ │ │ │ └── .gitkeep
217
+ │ │ ├── package.json
218
+ │ │ ├── src/
219
+ │ │ │ ├── app-schema.ts
220
+ │ │ │ ├── generated-schema.ts
221
+ │ │ │ ├── index.ts
222
+ │ │ │ ├── migrate.ts
223
+ │ │ │ └── schema.ts
224
+ │ │ └── tsconfig.json
225
+ │ └── realtime/
226
+ │ ├── package.json
227
+ │ ├── src/
228
+ │ │ └── index.ts
229
+ │ └── tsconfig.json
230
+ ├── pnpm-workspace.yaml
231
+ ├── scripts/
232
+ │ └── verify-db-migrations.mjs
233
+ ├── turbo.json
234
+ └── vercel.json
235
+ ```
236
+
237
+ ## web-api-minimal
238
+
239
+ Next.js, Fastify, database, and auth
240
+
241
+ ```text
242
+ web-api-minimal/
243
+ ├── .env.example
244
+ ├── .github/
245
+ │ └── workflows/
246
+ │ └── anhedral-ci.yml
247
+ ├── .gitignore
248
+ ├── .vercelignore
249
+ ├── ANHEDRAL.md
250
+ ├── PRODUCTION.md
251
+ ├── README.md
252
+ ├── SKILL.md
253
+ ├── anhedral.json
254
+ ├── apps/
255
+ │ ├── api/
256
+ │ │ ├── .env.example
257
+ │ │ ├── .gitignore
258
+ │ │ ├── package.json
259
+ │ │ ├── src/
260
+ │ │ │ ├── application.ts
261
+ │ │ │ ├── auth.ts
262
+ │ │ │ ├── env.ts
263
+ │ │ │ ├── index.ts
264
+ │ │ │ ├── routes/
265
+ │ │ │ │ └── app.ts
266
+ │ │ │ └── routes.ts
267
+ │ │ ├── tests/
268
+ │ │ │ ├── env.test.ts
269
+ │ │ │ └── health.test.ts
270
+ │ │ ├── tsconfig.json
271
+ │ │ └── vitest.config.ts
272
+ │ └── web/
273
+ │ ├── .env.example
274
+ │ ├── app/
275
+ │ │ ├── globals.css
276
+ │ │ ├── layout.tsx
277
+ │ │ └── page.tsx
278
+ │ ├── components/
279
+ │ │ ├── account-actions.tsx
280
+ │ │ └── ui/
281
+ │ │ ├── button.tsx
282
+ │ │ └── card.tsx
283
+ │ ├── components.json
284
+ │ ├── hooks/
285
+ │ │ └── use-api-client.ts
286
+ │ ├── lib/
287
+ │ │ ├── api.ts
288
+ │ │ └── utils.ts
289
+ │ ├── next-env.d.ts
290
+ │ ├── next.config.ts
291
+ │ ├── package.json
292
+ │ ├── postcss.config.mjs
293
+ │ └── tsconfig.json
294
+ ├── docs/
295
+ │ ├── DEVELOPMENT.md
296
+ │ └── STACK.md
297
+ ├── package.json
298
+ ├── packages/
299
+ │ ├── api-client/
300
+ │ │ ├── package.json
301
+ │ │ ├── src/
302
+ │ │ │ ├── app.ts
303
+ │ │ │ ├── generated.ts
304
+ │ │ │ └── index.ts
305
+ │ │ └── tsconfig.json
306
+ │ ├── contracts/
307
+ │ │ ├── package.json
308
+ │ │ ├── src/
309
+ │ │ │ ├── app.ts
310
+ │ │ │ ├── generated.ts
311
+ │ │ │ └── index.ts
312
+ │ │ └── tsconfig.json
313
+ │ └── db/
314
+ │ ├── .env.example
315
+ │ ├── drizzle.config.ts
316
+ │ ├── migrations/
317
+ │ │ └── .gitkeep
318
+ │ ├── package.json
319
+ │ ├── src/
320
+ │ │ ├── app-schema.ts
321
+ │ │ ├── generated-schema.ts
322
+ │ │ ├── index.ts
323
+ │ │ ├── migrate.ts
324
+ │ │ └── schema.ts
325
+ │ └── tsconfig.json
326
+ ├── pnpm-workspace.yaml
327
+ ├── scripts/
328
+ │ └── verify-db-migrations.mjs
329
+ ├── turbo.json
330
+ └── vercel.json
331
+ ```
332
+
333
+ ## api-only
334
+
335
+ Minimal Fastify API without database or auth
336
+
337
+ ```text
338
+ api-only/
339
+ ├── .env.example
340
+ ├── .github/
341
+ │ └── workflows/
342
+ │ └── anhedral-ci.yml
343
+ ├── .gitignore
344
+ ├── .vercelignore
345
+ ├── ANHEDRAL.md
346
+ ├── PRODUCTION.md
347
+ ├── README.md
348
+ ├── SKILL.md
349
+ ├── anhedral.json
350
+ ├── apps/
351
+ │ └── api/
352
+ │ ├── .env.example
353
+ │ ├── .gitignore
354
+ │ ├── package.json
355
+ │ ├── src/
356
+ │ │ ├── application.ts
357
+ │ │ ├── env.ts
358
+ │ │ ├── index.ts
359
+ │ │ ├── routes/
360
+ │ │ │ └── app.ts
361
+ │ │ └── routes.ts
362
+ │ ├── tests/
363
+ │ │ ├── env.test.ts
364
+ │ │ └── health.test.ts
365
+ │ ├── tsconfig.json
366
+ │ └── vitest.config.ts
367
+ ├── docs/
368
+ │ ├── DEVELOPMENT.md
369
+ │ └── STACK.md
370
+ ├── package.json
371
+ ├── packages/
372
+ │ └── contracts/
373
+ │ ├── package.json
374
+ │ ├── src/
375
+ │ │ ├── app.ts
376
+ │ │ ├── generated.ts
377
+ │ │ └── index.ts
378
+ │ └── tsconfig.json
379
+ ├── pnpm-workspace.yaml
380
+ ├── turbo.json
381
+ └── vercel.json
382
+ ```
383
+
384
+ ## add-desktop-flow
385
+
386
+ API-first project with desktop added afterward
387
+
388
+ ```text
389
+ add-desktop-flow/
390
+ ├── .env.example
391
+ ├── .github/
392
+ │ └── workflows/
393
+ │ └── anhedral-ci.yml
394
+ ├── .gitignore
395
+ ├── .vercelignore
396
+ ├── ANHEDRAL.md
397
+ ├── PRODUCTION.md
398
+ ├── README.md
399
+ ├── SKILL.md
400
+ ├── anhedral.json
401
+ ├── apps/
402
+ │ ├── api/
403
+ │ │ ├── .env.example
404
+ │ │ ├── .gitignore
405
+ │ │ ├── package.json
406
+ │ │ ├── src/
407
+ │ │ │ ├── application.ts
408
+ │ │ │ ├── auth.ts
409
+ │ │ │ ├── env.ts
410
+ │ │ │ ├── index.ts
411
+ │ │ │ ├── routes/
412
+ │ │ │ │ └── app.ts
413
+ │ │ │ └── routes.ts
414
+ │ │ ├── tests/
415
+ │ │ │ ├── env.test.ts
416
+ │ │ │ └── health.test.ts
417
+ │ │ ├── tsconfig.json
418
+ │ │ └── vitest.config.ts
419
+ │ └── desktop/
420
+ │ ├── .env.example
421
+ │ ├── components.json
422
+ │ ├── index.html
423
+ │ ├── package.json
424
+ │ ├── postcss.config.mjs
425
+ │ ├── scripts/
426
+ │ │ └── dev.mjs
427
+ │ ├── src/
428
+ │ │ ├── main/
429
+ │ │ │ ├── app-window.ts
430
+ │ │ │ ├── main.ts
431
+ │ │ │ └── preload.cts
432
+ │ │ └── renderer/
433
+ │ │ ├── components/
434
+ │ │ │ └── ui/
435
+ │ │ │ └── button.tsx
436
+ │ │ ├── lib/
437
+ │ │ │ ├── api.ts
438
+ │ │ │ ├── auth.ts
439
+ │ │ │ └── utils.ts
440
+ │ │ ├── main.tsx
441
+ │ │ └── styles.css
442
+ │ ├── tsconfig.json
443
+ │ ├── tsconfig.main.json
444
+ │ └── vite.config.ts
445
+ ├── docs/
446
+ │ ├── DEVELOPMENT.md
447
+ │ └── STACK.md
448
+ ├── package.json
449
+ ├── packages/
450
+ │ ├── api-client/
451
+ │ │ ├── package.json
452
+ │ │ ├── src/
453
+ │ │ │ ├── app.ts
454
+ │ │ │ ├── generated.ts
455
+ │ │ │ └── index.ts
456
+ │ │ └── tsconfig.json
457
+ │ ├── contracts/
458
+ │ │ ├── package.json
459
+ │ │ ├── src/
460
+ │ │ │ ├── app.ts
461
+ │ │ │ ├── generated.ts
462
+ │ │ │ └── index.ts
463
+ │ │ └── tsconfig.json
464
+ │ └── db/
465
+ │ ├── .env.example
466
+ │ ├── drizzle.config.ts
467
+ │ ├── migrations/
468
+ │ │ └── .gitkeep
469
+ │ ├── package.json
470
+ │ ├── src/
471
+ │ │ ├── app-schema.ts
472
+ │ │ ├── generated-schema.ts
473
+ │ │ ├── index.ts
474
+ │ │ ├── migrate.ts
475
+ │ │ └── schema.ts
476
+ │ └── tsconfig.json
477
+ ├── pnpm-workspace.yaml
478
+ ├── scripts/
479
+ │ └── verify-db-migrations.mjs
480
+ ├── turbo.json
481
+ └── vercel.json
482
+ ```