@bleedingdev/modern-js-create 3.2.0-ultramodern.7 → 3.2.0-ultramodern.70

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 (53) hide show
  1. package/README.md +120 -22
  2. package/dist/index.js +4890 -742
  3. package/dist/types/locale/en.d.ts +3 -0
  4. package/dist/types/locale/zh.d.ts +3 -0
  5. package/dist/types/ultramodern-workspace.d.ts +11 -0
  6. package/package.json +6 -6
  7. package/template/.agents/skills-lock.json +34 -0
  8. package/template/.codex/hooks.json +16 -0
  9. package/template/.github/renovate.json +53 -0
  10. package/template/.github/workflows/ultramodern-gates.yml.handlebars +34 -10
  11. package/template/.mise.toml.handlebars +2 -0
  12. package/template/AGENTS.md +23 -0
  13. package/template/README.md +60 -34
  14. package/template/api/effect/index.ts.handlebars +7 -45
  15. package/template/config/public/locales/cs/translation.json +39 -0
  16. package/template/config/public/locales/en/translation.json +39 -0
  17. package/template/lefthook.yml +10 -0
  18. package/template/modern.config.ts.handlebars +44 -23
  19. package/template/oxfmt.config.ts +8 -0
  20. package/template/oxlint.config.ts +12 -0
  21. package/template/package.json.handlebars +50 -31
  22. package/template/pnpm-workspace.yaml +19 -0
  23. package/template/rstest.config.mts +7 -0
  24. package/template/scripts/bootstrap-agent-skills.mjs +135 -0
  25. package/template/scripts/check-i18n-strings.mjs +83 -0
  26. package/template/scripts/validate-ultramodern.mjs.handlebars +439 -17
  27. package/template/shared/effect/api.ts.handlebars +1 -2
  28. package/template/src/modern-app-env.d.ts +2 -0
  29. package/template/src/modern.runtime.ts.handlebars +17 -3
  30. package/template/src/routes/[lang]/page.tsx.handlebars +212 -0
  31. package/template/src/routes/index.css.handlebars +14 -3
  32. package/template/src/routes/layout.tsx.handlebars +2 -1
  33. package/template/tests/tsconfig.json +7 -0
  34. package/template/tests/ultramodern.contract.test.ts.handlebars +78 -0
  35. package/template/tsconfig.json +106 -2
  36. package/template-workspace/.agents/agent-reference-repos.json +24 -0
  37. package/template-workspace/.agents/skills-lock.json +58 -0
  38. package/template-workspace/.codex/hooks.json +16 -0
  39. package/template-workspace/.github/renovate.json +29 -0
  40. package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +54 -0
  41. package/template-workspace/.gitignore.handlebars +5 -0
  42. package/template-workspace/.mise.toml.handlebars +2 -0
  43. package/template-workspace/AGENTS.md +52 -4
  44. package/template-workspace/README.md.handlebars +33 -10
  45. package/template-workspace/lefthook.yml +10 -0
  46. package/template-workspace/oxfmt.config.ts +17 -0
  47. package/template-workspace/oxlint.config.ts +20 -0
  48. package/template-workspace/pnpm-workspace.yaml +20 -10
  49. package/template-workspace/scripts/bootstrap-agent-skills.mjs +163 -0
  50. package/template-workspace/scripts/setup-agent-reference-repos.mjs +368 -0
  51. package/template/biome.json +0 -41
  52. package/template/src/routes/page.tsx.handlebars +0 -119
  53. package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +0 -343
package/README.md CHANGED
@@ -13,12 +13,36 @@
13
13
  Please follow [Quick Start](https://modernjs.dev/en/guides/get-started/quick-start) to get started with Modern.js.
14
14
 
15
15
  For UltraModern.js, use the BleedingDev create package. It defaults to the
16
- canonical SuperApp workspace and published BleedingDev package aliases:
16
+ canonical Tractor SuperApp workspace and published BleedingDev package aliases:
17
17
 
18
18
  ```bash
19
19
  pnpm dlx @bleedingdev/modern-js-create my-super-app
20
20
  ```
21
21
 
22
+ The default workspace is a full-stack reference, not a visual-only commerce
23
+ boundary demo. It generates:
24
+
25
+ - `apps/shell-super-app` as the Module Federation host and topology owner.
26
+ - `verticals/explore` for discovery UI plus
27
+ `/explore-api/effect/explore/*`.
28
+ - `verticals/decide` for product selection UI plus
29
+ `/decide-api/effect/decide/*`.
30
+ - `verticals/checkout` for cart and checkout UI plus
31
+ `/checkout-api/effect/checkout/*`.
32
+ - `packages/shared-design-tokens` as the shared CSS token owner.
33
+ - `.modernjs/ultramodern-generated-contract.json` with MF, Effect, i18n,
34
+ federated CSS, Cloudflare, and Zephyr dependency metadata.
35
+
36
+ Validate the generated workspace before making application changes:
37
+
38
+ ```bash
39
+ cd my-super-app
40
+ mise install
41
+ pnpm install
42
+ pnpm ultramodern:check
43
+ pnpm build
44
+ ```
45
+
22
46
  ### Router Template
23
47
 
24
48
  You can scaffold a TanStack Router first template:
@@ -29,16 +53,17 @@ npx @modern-js/create my-app --router tanstack
29
53
 
30
54
  ### Tailwind Template
31
55
 
32
- You can scaffold Tailwind CSS v4 setup (PostCSS + starter utility classes):
56
+ Tailwind CSS v4 setup is generated by default. Disable it explicitly when you
57
+ need a plain CSS starter:
33
58
 
34
59
  ```bash
35
- npx @modern-js/create my-app --tailwind
60
+ npx @modern-js/create my-app --no-tailwind
36
61
  ```
37
62
 
38
- You can combine both options:
63
+ TanStack Router and Tailwind CSS work together without extra flags:
39
64
 
40
65
  ```bash
41
- npx @modern-js/create my-app --router tanstack --tailwind
66
+ npx @modern-js/create my-app --router tanstack
42
67
  ```
43
68
 
44
69
  ### BFF Runtime Template
@@ -65,32 +90,37 @@ Generated starters expose `presetUltramodern(...)` as the public opinionated
65
90
  config wrapper when you want the full Ultramodern setup surface in
66
91
  `modern.config.ts`.
67
92
 
68
- You can combine TanStack Router + Tailwind + Effect BFF in one command:
93
+ You can combine TanStack Router + default Tailwind + Effect BFF in one command:
69
94
 
70
95
  ```bash
71
- npx @modern-js/create my-app --router tanstack --tailwind --bff-runtime effect
96
+ npx @modern-js/create my-app --router tanstack --bff-runtime effect
72
97
  ```
73
98
 
74
- ### Micro Vertical Workspace Recipes
99
+ ### Vertical Workspace Recipes
75
100
 
76
- Use the existing create flags to scaffold packages inside a Micro Vertical
77
- workspace. The shell and remotes use TanStack Router; services use Effect by
78
- default, with Hono kept as an explicit compatibility lane.
101
+ Use the workspace add flow from the UltraModern workspace root. It derives the
102
+ package path, package name, port, Module Federation name, topology entry, local
103
+ overlay, ownership entry, Effect BFF surface, and root `dev:*` script from the
104
+ requested vertical name.
79
105
 
80
106
  ```bash
81
- npx @modern-js/create apps/shell --router tanstack --tailwind --workspace --sub
82
- npx @modern-js/create apps/remotes/catalog --router tanstack --tailwind --workspace --sub
83
- npx @modern-js/create apps/remotes/design-system --router tanstack --tailwind --workspace --sub
84
- npx @modern-js/create services/catalog-api --bff-runtime effect --workspace --sub
85
- npx @modern-js/create services/legacy-api --bff-runtime hono --workspace --sub
107
+ npx @modern-js/create catalog --vertical
86
108
  ```
87
109
 
88
- When a design system needs independent deployment, treat it as a horizontal
89
- Module Federation remote with the same topology, trust, SSR, compatibility, and
90
- fallback expectations as feature remotes. Otherwise shared packages should be
91
- regular workspace packages for tokens, primitives, generated clients, or
92
- domain-neutral utilities. Keep feature composites and workflow logic owned by a
93
- shell, remote, or service package.
110
+ Use this decision table before adding a vertical:
111
+
112
+ | Need | Keep inside current vertical | Create a new vertical |
113
+ | --- | --- | --- |
114
+ | Route or widget changes with the same product owner, release train, and fallback behavior | Yes | No |
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 |
119
+
120
+ The lower-level `--router`, `--workspace`, and `--sub` flags remain available
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.
94
124
 
95
125
  See
96
126
  `docs/super-app-rfc-adr/WORKSPACE-0001-micro-vertical-workspace-scaffolding.md`
@@ -101,6 +131,64 @@ UltraModern.js entrypoint. The lower-level `--ultramodern-*` flags remain
101
131
  available for release engineering and local package-source testing, but users
102
132
  should not need them for normal app creation.
103
133
 
134
+ ### Tractor Architecture Contracts
135
+
136
+ The generated shell owns route assembly and policy. The generated Explore,
137
+ Decide, and Checkout verticals own their own route subtree, MF exposes, Effect BFF
138
+ contract, generated client, `localisedUrls`, locale JSON, CSS layer, and
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.
142
+
143
+ Route localization is route-owned. Each app writes
144
+ `src/routes/ultramodern-route-metadata` and passes
145
+ `ultramodernLocalisedUrls` into `@modern-js/plugin-i18n`. Locale JSON is served
146
+ from `/locales/{{lng}}/{{ns}}.json`; Czech and English routes are generated from
147
+ the route owner, not from shell rewrites.
148
+
149
+ CSS federation is explicit:
150
+
151
+ - `packages/shared-design-tokens` exports `./tokens.css` and owns
152
+ `ultramodern-shared-tokens`.
153
+ - The shell owns shell base and overlay CSS only.
154
+ - Verticals own their vertical CSS layer and `[data-app-id="<vertical>"]`
155
+ root marker.
156
+ - Tailwind CSS v4 is configured per app through `@tailwindcss/postcss`.
157
+ - Duplicate base styles are forbidden; SSR first paint depends on shared token
158
+ CSS plus Modern/Rspack-emitted app CSS.
159
+ - Apps should not inject remote `async-index.css` paths, hardcode remote
160
+ stylesheet links, or disable filename hashing to make CSS URLs predictable.
161
+ UltraModern SSR resolves federated CSS from build output and MF manifests so
162
+ generated shells and demos can keep normal hashed assets.
163
+
164
+ Version switching evidence must keep UI, Effect API, CSS, i18n JSON, and MF
165
+ manifest markers in lockstep for the same vertical version.
166
+
167
+ ### Cloudflare And Zephyr Proof
168
+
169
+ Each generated app has:
170
+
171
+ - `cloudflare:build`, `cloudflare:deploy`, `cloudflare:preview`, and
172
+ `cloudflare:proof` scripts.
173
+ - Cloudflare metadata in `.modernjs/ultramodern-generated-contract.json`.
174
+ - `zephyr:dependencies` for any consumed verticals.
175
+ - `zephyr-rspack-plugin` wired through the generated Modern.js Rspack bridge.
176
+
177
+ Public URL proof is intentionally separate from local build validation:
178
+
179
+ ```bash
180
+ ULTRAMODERN_PUBLIC_URL_EXPLORE=https://explore.example.workers.dev \
181
+ ULTRAMODERN_PUBLIC_URL_DECIDE=https://decide.example.workers.dev \
182
+ ULTRAMODERN_PUBLIC_URL_CHECKOUT=https://checkout.example.workers.dev \
183
+ ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP=https://shell-super-app.example.workers.dev \
184
+ pnpm cloudflare:proof -- --require-public-urls
185
+ ```
186
+
187
+ Live Zephyr switching proof requires Zephyr credentials and public runtime,
188
+ manifest, and API URLs for v1 and v2 of Explore, Decide, and Checkout. Without
189
+ public URLs and credentials, use dry-run evidence only; do not claim live
190
+ Zephyr selection has been proven.
191
+
104
192
  ### Local Monorepo Testing
105
193
 
106
194
  When testing unreleased Modern.js packages from a local monorepo checkout, use
@@ -110,6 +198,16 @@ workspace protocol dependencies:
110
198
  npx @modern-js/create my-app --router tanstack --bff-runtime effect --workspace
111
199
  ```
112
200
 
201
+ For package-source validation of the full Tractor workspace, generate with the
202
+ workspace package source, then run the generated contract gate:
203
+
204
+ ```bash
205
+ npx @modern-js/create tractor-super-app --workspace
206
+ cd tractor-super-app
207
+ pnpm install
208
+ pnpm ultramodern:check
209
+ ```
210
+
113
211
  ## Documentation
114
212
 
115
213
  - [English Documentation](https://modernjs.dev/en/)