@bleedingdev/modern-js-main-doc 3.2.0-ultramodern.31 → 3.2.0-ultramodern.35

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.
@@ -76,6 +76,90 @@ In this repo, the reference examples are:
76
76
  - `bff-runtime-parity` for generated-client build/serve parity,
77
77
  - `bff-hono` for the compatibility lane.
78
78
 
79
+ ## Tractor Reference Workspace
80
+
81
+ The BleedingDev create entrypoint now scaffolds the real Tractor reference workspace instead of the earlier visual boundary demo:
82
+
83
+ ```bash
84
+ pnpm dlx @bleedingdev/modern-js-create tractor-super-app
85
+ cd tractor-super-app
86
+ mise install
87
+ mise exec -- pnpm install
88
+ mise exec -- pnpm ultramodern:check
89
+ ```
90
+
91
+ The generated workspace has one shell and three full-stack vertical remotes:
92
+
93
+ | Package | Owner role | Port | Owns |
94
+ | --- | --- | --- | --- |
95
+ | `apps/shell-super-app` | platform shell | `3020` | route assembly, topology selection, MF host config, shell CSS overlays, global fallback policy |
96
+ | `apps/remotes/remote-explore` | Explore vertical | `3021` | tractor discovery routes, header/footer/recommendations/store picker exposes, `/explore-api/effect/explore/*` |
97
+ | `apps/remotes/remote-decide` | Decide vertical | `3022` | product selection and configuration routes, `ProductPage`, `/decide-api/effect/decide/*` |
98
+ | `apps/remotes/remote-checkout` | Checkout vertical | `3023` | cart, checkout, thanks routes, cart exposes, `/checkout-api/effect/checkout/*` |
99
+
100
+ The shell consumes remotes through Module Federation references in topology metadata and `zephyr:dependencies`; it should not hardcode deployed remote URLs in source. Each vertical owns its UI route subtree, browser-safe MF exposes, Effect BFF contract, generated client export, locale JSON, CSS entrypoint, Cloudflare Worker metadata, and build marker.
101
+
102
+ ### Route-Owned I18n
103
+
104
+ Each app emits `src/routes/ultramodern-route-metadata` with `ultramodernLocalisedUrls`. The i18n plugin reads that map in `localeDetection.localisedUrls`, serves dynamic backend JSON from `/locales/{{lng}}/{{ns}}.json`, and keeps `reactI18next` disabled for the generated shell and remotes.
105
+
106
+ Examples:
107
+
108
+ | Vertical | Canonical route | English | Czech |
109
+ | --- | --- | --- | --- |
110
+ | Explore | `/tractors` | `/tractors` | `/traktory` |
111
+ | Explore | `/stores` | `/stores` | `/prodejci` |
112
+ | Decide | `/tractors/:slug` | `/tractors/:slug` | `/traktory/:slug` |
113
+ | Checkout | `/cart` | `/cart` | `/kosik` |
114
+ | Checkout | `/checkout/thank-you/:orderId?` | `/checkout/thank-you/:orderId?` | `/pokladna/dekujeme/:orderId?` |
115
+
116
+ The route owner changes localized paths and locale resource JSON together. Shell-owned URL rewrites are not part of the contract.
117
+
118
+ ### Federated CSS Contract
119
+
120
+ The generated contract writes `.modernjs/ultramodern-generated-contract.json` with a `cssFederation` section:
121
+
122
+ - `packages/shared-design-tokens` owns the shared token layer and exports `./tokens.css`.
123
+ - Shell CSS owns only shell base and overlay layers under `[data-app-id="shell-super-app"]`.
124
+ - Remote CSS owns one vertical layer, for example `[data-app-id="remote-explore"]` with `explore-` class prefixes.
125
+ - Tailwind CSS v4 is local to each generated app through `@tailwindcss/postcss`; shared base styles must not be duplicated by remotes.
126
+ - SSR first paint requires shared token CSS and app-owned CSS to be emitted by Modern/Rspack assets. Remote CSS is loaded through remote manifest ownership, not copied into shell source.
127
+
128
+ Version switching must select UI, Effect API, CSS, i18n JSON, and MF manifest evidence from the same vertical build marker. A shell render that only changes the UI marker is not enough.
129
+
130
+ ### Validation And Proof
131
+
132
+ Local gates:
133
+
134
+ ```bash
135
+ mise exec -- pnpm ultramodern:check
136
+ mise exec -- pnpm build
137
+ mise exec -- pnpm cloudflare:build
138
+ ```
139
+
140
+ Local Cloudflare artifact validation can run without public credentials:
141
+
142
+ ```bash
143
+ node scripts/ultramodern-cloudflare-ssr-validation/validate-cloudflare-ssr.js \
144
+ --root-dir apps/remotes/remote-explore \
145
+ --bff /explore-api/effect/explore/readiness \
146
+ --expect-en "Explore Remote" \
147
+ --match-build-marker \
148
+ --out .codex/reports/cloudflare-ssr/remote-explore-local.json
149
+ ```
150
+
151
+ Generated workspaces also include `scripts/proof-cloudflare-version.mjs`:
152
+
153
+ ```bash
154
+ ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP=https://shell-super-app.example.workers.dev \
155
+ ULTRAMODERN_PUBLIC_URL_REMOTE_EXPLORE=https://remote-explore.example.workers.dev \
156
+ ULTRAMODERN_PUBLIC_URL_REMOTE_DECIDE=https://remote-decide.example.workers.dev \
157
+ ULTRAMODERN_PUBLIC_URL_REMOTE_CHECKOUT=https://remote-checkout.example.workers.dev \
158
+ mise exec -- pnpm cloudflare:proof -- --require-public-urls
159
+ ```
160
+
161
+ Live Cloudflare and Zephyr proof requires public Worker URLs and Zephyr credentials. Without those, the repo can validate generated contracts, local builds, local Cloudflare output, dry-run Zephyr evidence plans, and local evidence schemas, but it cannot prove shell-driven live version selection.
162
+
79
163
  ## Baseline Switches (Opt-out)
80
164
 
81
165
  The generated `presetUltramodern(...)` starter enables strict platform contracts. Use these env switches to opt out per app or per environment:
package/package.json CHANGED
@@ -18,14 +18,14 @@
18
18
  "modern",
19
19
  "modern.js"
20
20
  ],
21
- "version": "3.2.0-ultramodern.31",
21
+ "version": "3.2.0-ultramodern.35",
22
22
  "publishConfig": {
23
23
  "registry": "https://registry.npmjs.org/",
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
27
  "mermaid": "^11.15.0",
28
- "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.31"
28
+ "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.35"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@rsbuild/plugin-sass": "1.5.2",