@stardeck-customer-apps/compose 0.7.0 → 0.9.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.
package/SKILL.md CHANGED
@@ -14,6 +14,8 @@ Compose turns that declaration into the code Next.js actually builds:
14
14
  - `apps/web/src/module-i18n.gen.ts`
15
15
  - `apps/web/src/module-init.server.gen.ts`
16
16
  - `apps/web/src/module-datastores.gen.ts`
17
+ - `apps/web/src/module-server.gen.ts` — `MODULE_SERVER_REGISTRATIONS`, one entry
18
+ per composed Module that ships `server/registrations.ts`
17
19
  - one `page.tsx` / `route.ts` stub under `apps/web/src/app/**` per declared
18
20
  mount and endpoint
19
21
 
@@ -21,6 +23,7 @@ Compose turns that declaration into the code Next.js actually builds:
21
23
 
22
24
  ```bash
23
25
  npx stardeck-compose [--enabled=a,b,c] [--prune] [--cwd=<repo root>]
26
+ npx stardeck-compose --check-boundaries [--cwd=<repo root>]
24
27
  ```
25
28
 
26
29
  Run it from the repo root (the directory holding `apps/web`). The Blueprint
@@ -73,6 +76,24 @@ a silent fallback. It holds deployment facts: gitignore it (`apps/web/.gitignore
73
76
  a git checkout, and a clean one: it refuses when `git status --ignored`
74
77
  reports uncommitted or ignored files under `apps/web/src/modules`, and
75
78
  refuses outside a checkout — it is for throwaway deploy checkouts, not yours.
79
+ It also refuses, before deleting anything, when a file outside
80
+ `apps/web/src/modules` imports an excluded Module, or when a kept Module's own
81
+ file (tests included) would import a deleted path: an excluded Module, any
82
+ Module's `enhancements/<excluded>/`, a `.sql`/`.json` of theirs read by path,
83
+ or another kept file that does. Only a file inside the Module's own
84
+ `enhancements/<excluded>/` goes with the peer (with any excluded peer: a
85
+ booking slice may import membership when both are pruned). Fix: move the file into
86
+ `src/modules/<module>/enhancements/<peer>/`, or declare the peer in `uses` and
87
+ enable it. A test that needs two optional peers at once cannot live in one
88
+ `enhancements/` folder: load the second peer's harness only when
89
+ `isModuleEnabled(peer)` and `it.skipIf` without it. Needs compose 0.9.0 or
90
+ later for the Module-file check.
91
+ - `--check-boundaries` — Blueprint lint; composes nothing. Checks every Module
92
+ against every feature Module it does not list in `uses` (whether it lists it
93
+ in `enhancements` or not), as if all of them were switched off, and exits 1
94
+ listing the offending files. Library Modules are always composed and never
95
+ count. Run it in Blueprint CI so such an import is caught before a customer
96
+ prunes.
76
97
 
77
98
  ## Rules
78
99
 
@@ -101,6 +122,19 @@ a silent fallback. It holds deployment facts: gitignore it (`apps/web/.gitignore
101
122
  compose as a route collision.
102
123
  `isMountHeadless(key)` and `isHrefHeadless(href)` are exported from
103
124
  `@/modules.gen`. Needs compose 0.7.0 or later.
125
+ - **Server registrations.** Per-Module server wiring that the app layer runs
126
+ (seeds, schedule handlers, and similar) goes in the Module's
127
+ `server/registrations.ts`, any Module kind. Compose imports each composed
128
+ Module's file as a namespace into `module-server.gen.ts`:
129
+ `MODULE_SERVER_REGISTRATIONS` is a
130
+ `readonly { module: string; registrations: Readonly<Record<string, unknown>> }[]`.
131
+ A Module left out by `--enabled` is not imported at all, so its server code
132
+ drops out of the build. App code reads that array from `@/module-server.gen`
133
+ and narrows the exports it expects (e.g. `registrations.seed`); it must never
134
+ import a Module's seed or schedules directly, or a disabled Module stays in
135
+ the bundle. Compose does not check the export names or shapes. The file
136
+ counts as `server/**/*.ts`, so the Module also needs `server/index.ts`.
137
+ Needs compose 0.8.0 or later.
104
138
  - `@stardeck-customer-apps/compose/runtime` exports `isModuleEnabledByList`,
105
139
  the single enablement rule, and imports nothing — it is safe in client
106
140
  components.
@@ -111,5 +145,5 @@ After each run compose rewrites `apps/web/src/app/.gitignore` with one entry per
111
145
  stub it emits — stubs are scattered one-per-route and cannot be globbed. Commit
112
146
  that file: it is deterministic output, and compose rewrites it only when the set
113
147
  of stubs changes, so an unchanged compose leaves `git status` clean. It does not
114
- list the five `src/*.gen.ts`; a static `src/*.gen.ts` line in `apps/web/.gitignore`
148
+ list the six `src/*.gen.ts`; a static `src/*.gen.ts` line in `apps/web/.gitignore`
115
149
  covers those. Compose refuses to touch the file if line 1 is not its own header.