@bleedingdev/modern-js-create 3.2.0-ultramodern.57 → 3.2.0-ultramodern.59
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/README.md +30 -39
- package/dist/index.js +670 -702
- package/dist/types/locale/en.d.ts +1 -1
- package/dist/types/locale/zh.d.ts +1 -1
- package/dist/types/ultramodern-workspace.d.ts +2 -4
- package/package.json +3 -3
- package/template/.codex/hooks.json +16 -0
- package/template/AGENTS.md +4 -8
- package/template/README.md +40 -43
- package/template/lefthook.yml +15 -0
- package/template/package.json.handlebars +5 -15
- package/template/pnpm-workspace.yaml +1 -1
- package/template/scripts/bootstrap-agent-skills.mjs +39 -7
- package/template/scripts/validate-ultramodern.mjs.handlebars +18 -8
- package/template/src/routes/[lang]/page.tsx.handlebars +1 -1
- package/template-workspace/.codex/hooks.json +16 -0
- package/template-workspace/AGENTS.md +4 -2
- package/template-workspace/README.md.handlebars +10 -11
- package/template-workspace/lefthook.yml +15 -0
- package/template-workspace/pnpm-workspace.yaml +2 -3
- package/template-workspace/scripts/assert-mf-types.mjs +3 -3
- package/template-workspace/scripts/setup-agent-reference-repos.mjs +6 -2
- package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +106 -103
package/README.md
CHANGED
|
@@ -23,11 +23,11 @@ The default workspace is a full-stack reference, not a visual-only commerce
|
|
|
23
23
|
boundary demo. It generates:
|
|
24
24
|
|
|
25
25
|
- `apps/shell-super-app` as the Module Federation host and topology owner.
|
|
26
|
-
- `
|
|
26
|
+
- `verticals/explore` for discovery UI plus
|
|
27
27
|
`/explore-api/effect/explore/*`.
|
|
28
|
-
- `
|
|
28
|
+
- `verticals/decide` for product selection UI plus
|
|
29
29
|
`/decide-api/effect/decide/*`.
|
|
30
|
-
- `
|
|
30
|
+
- `verticals/checkout` for cart and checkout UI plus
|
|
31
31
|
`/checkout-api/effect/checkout/*`.
|
|
32
32
|
- `packages/shared-design-tokens` as the shared CSS token owner.
|
|
33
33
|
- `.modernjs/ultramodern-generated-contract.json` with MF, Effect, i18n,
|
|
@@ -38,9 +38,9 @@ Validate the generated workspace before making application changes:
|
|
|
38
38
|
```bash
|
|
39
39
|
cd my-super-app
|
|
40
40
|
mise install
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
pnpm install
|
|
42
|
+
pnpm ultramodern:check
|
|
43
|
+
pnpm build
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
### Router Template
|
|
@@ -96,41 +96,31 @@ You can combine TanStack Router + default Tailwind + Effect BFF in one command:
|
|
|
96
96
|
npx @modern-js/create my-app --router tanstack --bff-runtime effect
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
###
|
|
99
|
+
### Vertical Workspace Recipes
|
|
100
100
|
|
|
101
101
|
Use the workspace add flow from the UltraModern workspace root. It derives the
|
|
102
102
|
package path, package name, port, Module Federation name, topology entry, local
|
|
103
|
-
overlay, ownership entry, and root `dev:*` script from the
|
|
104
|
-
|
|
103
|
+
overlay, ownership entry, Effect BFF surface, and root `dev:*` script from the
|
|
104
|
+
requested vertical name.
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
npx @modern-js/create catalog --
|
|
108
|
-
npx @modern-js/create design-system --microvertical horizontal-remote
|
|
109
|
-
npx @modern-js/create catalog-api --microvertical service
|
|
110
|
-
npx @modern-js/create catalog-contracts --microvertical shared
|
|
107
|
+
npx @modern-js/create catalog --vertical
|
|
111
108
|
```
|
|
112
109
|
|
|
113
|
-
Use this decision table before adding a
|
|
110
|
+
Use this decision table before adding a vertical:
|
|
114
111
|
|
|
115
|
-
| Need | Keep inside current vertical | Create a new vertical
|
|
112
|
+
| Need | Keep inside current vertical | Create a new vertical |
|
|
116
113
|
| --- | --- | --- |
|
|
117
114
|
| Route or widget changes with the same product owner, release train, and fallback behavior | Yes | No |
|
|
118
|
-
| Route subtree needs independent rollout, rollback, or incident ownership | No | `--
|
|
119
|
-
|
|
|
120
|
-
| Design tokens, primitives, generated clients, or domain-neutral utilities |
|
|
121
|
-
| Feature composites or workflow state shared across verticals | No | Revisit ownership; do not hide it in
|
|
122
|
-
|
|
123
|
-
When a design system needs independent deployment, treat it as a horizontal
|
|
124
|
-
Module Federation remote with the same topology, trust, SSR, compatibility, and
|
|
125
|
-
fallback expectations as feature remotes. Otherwise shared packages should be
|
|
126
|
-
regular workspace packages for tokens, primitives, generated clients, or
|
|
127
|
-
domain-neutral utilities. Keep feature composites and workflow logic owned by a
|
|
128
|
-
shell, remote, or service package.
|
|
115
|
+
| Route subtree needs independent rollout, rollback, or incident ownership | No | `--vertical` |
|
|
116
|
+
| UI and Effect BFF must version, deploy, and roll back together | No | `--vertical` |
|
|
117
|
+
| Design tokens, primitives, generated clients, or domain-neutral utilities | Yes | Use an ordinary workspace package, not a vertical |
|
|
118
|
+
| Feature composites or workflow state shared across verticals | No | Revisit ownership; do not hide it in shared code |
|
|
129
119
|
|
|
130
120
|
The lower-level `--router`, `--workspace`, and `--sub` flags remain available
|
|
131
|
-
for manual package scaffolding, but UltraModern
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
for manual package scaffolding, but UltraModern vertical additions should use
|
|
122
|
+
`--vertical` so paths, topology, Effect BFF contracts, and local overlays stay
|
|
123
|
+
consistent.
|
|
134
124
|
|
|
135
125
|
See
|
|
136
126
|
`docs/super-app-rfc-adr/WORKSPACE-0001-micro-vertical-workspace-scaffolding.md`
|
|
@@ -144,10 +134,11 @@ should not need them for normal app creation.
|
|
|
144
134
|
### Tractor Architecture Contracts
|
|
145
135
|
|
|
146
136
|
The generated shell owns route assembly and policy. The generated Explore,
|
|
147
|
-
Decide, and Checkout
|
|
137
|
+
Decide, and Checkout verticals own their own route subtree, MF exposes, Effect BFF
|
|
148
138
|
contract, generated client, `localisedUrls`, locale JSON, CSS layer, and
|
|
149
|
-
Cloudflare Worker output. The shell consumes
|
|
150
|
-
|
|
139
|
+
Cloudflare Worker output. The shell consumes vertical UI through MF manifests
|
|
140
|
+
and vertical APIs through generated Effect clients exported by the vertical
|
|
141
|
+
packages.
|
|
151
142
|
|
|
152
143
|
Route localization is route-owned. Each app writes
|
|
153
144
|
`src/routes/ultramodern-route-metadata` and passes
|
|
@@ -160,7 +151,7 @@ CSS federation is explicit:
|
|
|
160
151
|
- `packages/shared-design-tokens` exports `./tokens.css` and owns
|
|
161
152
|
`ultramodern-shared-tokens`.
|
|
162
153
|
- The shell owns shell base and overlay CSS only.
|
|
163
|
-
-
|
|
154
|
+
- Verticals own their vertical CSS layer and `[data-app-id="<vertical>"]`
|
|
164
155
|
root marker.
|
|
165
156
|
- Tailwind CSS v4 is configured per app through `@tailwindcss/postcss`.
|
|
166
157
|
- Duplicate base styles are forbidden; SSR first paint depends on shared token
|
|
@@ -176,15 +167,15 @@ Each generated app has:
|
|
|
176
167
|
- `cloudflare:build`, `cloudflare:deploy`, `cloudflare:preview`, and
|
|
177
168
|
`cloudflare:proof` scripts.
|
|
178
169
|
- Cloudflare metadata in `.modernjs/ultramodern-generated-contract.json`.
|
|
179
|
-
- `zephyr:dependencies` for any consumed
|
|
170
|
+
- `zephyr:dependencies` for any consumed verticals.
|
|
180
171
|
- `zephyr-rspack-plugin` wired through the generated Modern.js Rspack bridge.
|
|
181
172
|
|
|
182
173
|
Public URL proof is intentionally separate from local build validation:
|
|
183
174
|
|
|
184
175
|
```bash
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
176
|
+
ULTRAMODERN_PUBLIC_URL_EXPLORE=https://explore.example.workers.dev \
|
|
177
|
+
ULTRAMODERN_PUBLIC_URL_DECIDE=https://decide.example.workers.dev \
|
|
178
|
+
ULTRAMODERN_PUBLIC_URL_CHECKOUT=https://checkout.example.workers.dev \
|
|
188
179
|
ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP=https://shell-super-app.example.workers.dev \
|
|
189
180
|
pnpm cloudflare:proof -- --require-public-urls
|
|
190
181
|
```
|
|
@@ -209,8 +200,8 @@ workspace package source, then run the generated contract gate:
|
|
|
209
200
|
```bash
|
|
210
201
|
npx @modern-js/create tractor-super-app --workspace
|
|
211
202
|
cd tractor-super-app
|
|
212
|
-
|
|
213
|
-
|
|
203
|
+
pnpm install
|
|
204
|
+
pnpm ultramodern:check
|
|
214
205
|
```
|
|
215
206
|
|
|
216
207
|
## Documentation
|