@bleedingdev/modern-js-create 3.2.0-ultramodern.6 → 3.2.0-ultramodern.61
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 +116 -22
- package/dist/index.js +4563 -603
- package/dist/types/locale/en.d.ts +3 -0
- package/dist/types/locale/zh.d.ts +3 -0
- package/dist/types/ultramodern-workspace.d.ts +11 -0
- package/package.json +6 -6
- package/template/.agents/skills-lock.json +34 -0
- package/template/.codex/hooks.json +16 -0
- package/template/.github/renovate.json +53 -0
- package/template/.github/workflows/ultramodern-gates.yml.handlebars +34 -10
- package/template/.mise.toml.handlebars +2 -0
- package/template/AGENTS.md +23 -0
- package/template/README.md +60 -34
- package/template/api/effect/index.ts.handlebars +7 -45
- package/template/config/public/locales/cs/translation.json +39 -0
- package/template/config/public/locales/en/translation.json +39 -0
- package/template/lefthook.yml +15 -0
- package/template/modern.config.ts.handlebars +44 -23
- package/template/oxfmt.config.ts +8 -0
- package/template/oxlint.config.ts +12 -0
- package/template/package.json.handlebars +50 -31
- package/template/pnpm-workspace.yaml +19 -0
- package/template/rstest.config.mts +7 -0
- package/template/scripts/bootstrap-agent-skills.mjs +135 -0
- package/template/scripts/check-i18n-strings.mjs +83 -0
- package/template/scripts/validate-ultramodern.mjs.handlebars +439 -17
- package/template/shared/effect/api.ts.handlebars +1 -2
- package/template/src/modern-app-env.d.ts +2 -0
- package/template/src/modern.runtime.ts.handlebars +17 -3
- package/template/src/routes/[lang]/page.tsx.handlebars +212 -0
- package/template/src/routes/index.css.handlebars +14 -3
- package/template/src/routes/layout.tsx.handlebars +2 -1
- package/template/tests/tsconfig.json +7 -0
- package/template/tests/ultramodern.contract.test.ts.handlebars +78 -0
- package/template/tsconfig.json +106 -2
- package/template-workspace/.agents/agent-reference-repos.json +24 -0
- package/template-workspace/.agents/rstackjs-agent-skills-LICENSE +21 -0
- package/template-workspace/.agents/skills/rsbuild-best-practices/SKILL.md +57 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/SKILL.md +96 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/command-map.md +113 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/common-analysis-patterns.md +190 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-common.md +88 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-rspack.md +138 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor-webpack.md +71 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/install-rsdoctor.md +39 -0
- package/template-workspace/.agents/skills/rsdoctor-analysis/references/rsdoctor-data-types.md +103 -0
- package/template-workspace/.agents/skills/rslib-best-practices/SKILL.md +58 -0
- package/template-workspace/.agents/skills/rslib-modern-package/SKILL.md +173 -0
- package/template-workspace/.agents/skills/rspack-best-practices/SKILL.md +70 -0
- package/template-workspace/.agents/skills/rspack-tracing/SKILL.md +75 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/bottlenecks.md +47 -0
- package/template-workspace/.agents/skills/rspack-tracing/references/tracing-guide.md +38 -0
- package/template-workspace/.agents/skills/rspack-tracing/scripts/analyze_trace.js +184 -0
- package/template-workspace/.agents/skills/rstest-best-practices/SKILL.md +133 -0
- package/template-workspace/.agents/skills-lock.json +114 -0
- package/template-workspace/.codex/hooks.json +16 -0
- package/template-workspace/.github/renovate.json +29 -0
- package/template-workspace/.github/workflows/ultramodern-workspace-gates.yml.handlebars +54 -0
- package/template-workspace/.gitignore.handlebars +5 -0
- package/template-workspace/.mise.toml.handlebars +2 -0
- package/template-workspace/AGENTS.md +76 -0
- package/template-workspace/README.md.handlebars +33 -10
- package/template-workspace/lefthook.yml +15 -0
- package/template-workspace/oxfmt.config.ts +16 -0
- package/template-workspace/oxlint.config.ts +19 -0
- package/template-workspace/pnpm-workspace.yaml +20 -10
- package/template-workspace/scripts/bootstrap-agent-skills.mjs +163 -0
- package/template-workspace/scripts/setup-agent-reference-repos.mjs +368 -0
- package/template/biome.json +0 -41
- package/template/src/routes/page.tsx.handlebars +0 -119
- package/template-workspace/scripts/validate-ultramodern-workspace.mjs.handlebars +0 -276
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
|
-
|
|
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
|
-
|
|
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
|
|
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 --
|
|
96
|
+
npx @modern-js/create my-app --router tanstack --bff-runtime effect
|
|
72
97
|
```
|
|
73
98
|
|
|
74
|
-
###
|
|
99
|
+
### Vertical Workspace Recipes
|
|
75
100
|
|
|
76
|
-
Use the
|
|
77
|
-
|
|
78
|
-
|
|
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
|
|
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
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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,60 @@ 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
|
+
|
|
160
|
+
Version switching evidence must keep UI, Effect API, CSS, i18n JSON, and MF
|
|
161
|
+
manifest markers in lockstep for the same vertical version.
|
|
162
|
+
|
|
163
|
+
### Cloudflare And Zephyr Proof
|
|
164
|
+
|
|
165
|
+
Each generated app has:
|
|
166
|
+
|
|
167
|
+
- `cloudflare:build`, `cloudflare:deploy`, `cloudflare:preview`, and
|
|
168
|
+
`cloudflare:proof` scripts.
|
|
169
|
+
- Cloudflare metadata in `.modernjs/ultramodern-generated-contract.json`.
|
|
170
|
+
- `zephyr:dependencies` for any consumed verticals.
|
|
171
|
+
- `zephyr-rspack-plugin` wired through the generated Modern.js Rspack bridge.
|
|
172
|
+
|
|
173
|
+
Public URL proof is intentionally separate from local build validation:
|
|
174
|
+
|
|
175
|
+
```bash
|
|
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 \
|
|
179
|
+
ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP=https://shell-super-app.example.workers.dev \
|
|
180
|
+
pnpm cloudflare:proof -- --require-public-urls
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Live Zephyr switching proof requires Zephyr credentials and public runtime,
|
|
184
|
+
manifest, and API URLs for v1 and v2 of Explore, Decide, and Checkout. Without
|
|
185
|
+
public URLs and credentials, use dry-run evidence only; do not claim live
|
|
186
|
+
Zephyr selection has been proven.
|
|
187
|
+
|
|
104
188
|
### Local Monorepo Testing
|
|
105
189
|
|
|
106
190
|
When testing unreleased Modern.js packages from a local monorepo checkout, use
|
|
@@ -110,6 +194,16 @@ workspace protocol dependencies:
|
|
|
110
194
|
npx @modern-js/create my-app --router tanstack --bff-runtime effect --workspace
|
|
111
195
|
```
|
|
112
196
|
|
|
197
|
+
For package-source validation of the full Tractor workspace, generate with the
|
|
198
|
+
workspace package source, then run the generated contract gate:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
npx @modern-js/create tractor-super-app --workspace
|
|
202
|
+
cd tractor-super-app
|
|
203
|
+
pnpm install
|
|
204
|
+
pnpm ultramodern:check
|
|
205
|
+
```
|
|
206
|
+
|
|
113
207
|
## Documentation
|
|
114
208
|
|
|
115
209
|
- [English Documentation](https://modernjs.dev/en/)
|