@bleedingdev/modern-js-main-doc 3.2.0-ultramodern.57 → 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.
@@ -107,13 +107,32 @@ When `--bff` or `--bff-runtime effect` is enabled, `modern.config.ts` enables `@
107
107
  When `--bff-runtime hono` is enabled, `modern.config.ts` enables `@modern-js/plugin-bff`, generates `api/lambda/hello.ts`, and sets `bff.runtimeFramework` to `hono`.
108
108
  When `--workspace` is enabled, `@modern-js/*` dependencies use `workspace:*` versions for local monorepo linkage.
109
109
 
110
- If you want the public UltraModern.js SuperApp path, use the BleedingDev create
111
- package. It defaults to the canonical Effect + TanStack + SSR + Micro Verticals
112
- workspace and published BleedingDev package aliases:
110
+ If you want the public UltraModern.js path, use the BleedingDev create package.
111
+ It creates a simple production-ready UltraModern app by default and installs
112
+ the published BleedingDev package aliases:
113
113
 
114
114
  ```bash
115
115
  pnpm dlx @bleedingdev/modern-js-create myapp
116
116
  ```
117
117
 
118
- The lower-level `--ultramodern-*` flags are reserved for release engineering
119
- and local package-source testing.
118
+ Create a SuperApp workspace only when you need independently owned verticals:
119
+
120
+ ```bash
121
+ pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
122
+ ```
123
+
124
+ From a generated SuperApp workspace, add a business MicroVertical in place:
125
+
126
+ ```bash
127
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
128
+ ```
129
+
130
+ The `--vertical` command mutates the current workspace: it adds the vertical
131
+ package and wires topology, ownership metadata, shell Module Federation,
132
+ development overlays, package dependencies, generated contracts, route-owned
133
+ i18n, CSS isolation, and the Effect BFF/client surface.
134
+
135
+ The lower-level `--ultramodern-package-*` flags are reserved for release
136
+ engineering and local package-source testing. BleedingDev packages are published
137
+ through GitHub Actions trusted publishing; do not publish them manually from a
138
+ developer machine.
@@ -36,7 +36,7 @@ UltraModern.js additions are designed as the default product surface for new Sup
36
36
  | BFF runtime choices | Hono runtime path only in Modern.js 3.0 baseline (no built-in Effect runtime path) | Sets Effect as default runtime, enforces strict runtime split (`effect` -> `api/effect`, `hono` -> `api/lambda`), and adds Effect-Schema-first contracts plus MF failure-injection reliability coverage |
37
37
  | Telemetry standardization | Observability wiring is often app-specific | Adds framework-level telemetry pipeline with OTLP/VictoriaMetrics exporters, redaction, batching, and backpressure controls |
38
38
  | App-level MF SSR handshake | No dedicated super-app app-level stability contract focus | Adds `server.ssr.moduleFederationAppSSR` plus integration-tested env/config handshake |
39
- | MF remote reliability | Retry/fallback patterns are often implemented per app | Adds deterministic timeout/network/contract-error reliability matrix and distributed OTEL continuity tests |
39
+ | MF vertical loading reliability | Retry/fallback patterns are often implemented per app | Adds deterministic timeout/network/contract-error reliability matrix and distributed OTEL continuity tests |
40
40
  | Module onboarding governance | No module-certification evidence profile in baseline | Adds module SDK contracts, boundary anti-pattern guards, and release/module certification gate workflows |
41
41
  | Router runtime | Default runtime path centers on React Router | Adds first-class TanStack Router runtime/CLI path (React Router remains supported) |
42
42
  | Scaffolding templates | Default create templates center on React Router starter path | Adds TanStack-ready and Tailwind-ready create templates |
@@ -60,74 +60,74 @@ For teams already on Modern.js 3.0, the adoption path remains compatibility-awar
60
60
 
61
61
  This page is not a migration guide or codemod plan. Migration guidance for existing applications is intentionally deferred from the current Micro Verticals framework scope.
62
62
 
63
- ## Micro Vertical Delivery Path
63
+ ## Human Workflow
64
64
 
65
- `presetUltramodern(...)` is also the single public entrypoint for Micro Verticals. The intended adoption sequence is:
66
-
67
- 1. start with one app and keep route/data ownership inside the shell,
68
- 2. extract stable route subtrees into MF remotes once fallback and compatibility behavior are explicit,
69
- 3. extract shared workflows into strict Effect services when request, identity, locale, and trace context must survive deployment boundaries,
70
- 4. keep Hono only as an explicit compatibility lane for existing Modern.js-style BFF handlers.
71
-
72
- In this repo, the reference examples are:
73
-
74
- - `routes-tanstack-mf` for shell + remote composition and MF SSR contracts,
75
- - `bff-corss-project` for cross-project producer/consumer wiring,
76
- - `bff-runtime-parity` for generated-client build/serve parity,
77
- - `bff-hono` for the compatibility lane.
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:
65
+ The public BleedingDev create package starts small. The default command creates
66
+ one production-ready UltraModern app with `presetUltramodern(...)`, SSR,
67
+ TanStack Router, Tailwind CSS v4, i18n, Effect BFF, generated quality gates, and
68
+ Cloudflare deploy basics:
82
69
 
83
70
  ```bash
84
- pnpm dlx @bleedingdev/modern-js-create tractor-super-app
85
- cd tractor-super-app
71
+ pnpm dlx @bleedingdev/modern-js-create myapp
72
+ cd myapp
86
73
  mise install
87
74
  mise exec -- pnpm install
88
75
  mise exec -- pnpm ultramodern:check
89
76
  ```
90
77
 
91
- The generated workspace has one shell and three full-stack vertical remotes:
78
+ Create a SuperApp workspace only when independent ownership is useful:
92
79
 
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.
80
+ ```bash
81
+ pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
82
+ cd my-super-app
83
+ mise install
84
+ mise exec -- pnpm install
85
+ mise exec -- pnpm ultramodern:check
86
+ ```
101
87
 
102
- ### Route-Owned I18n
88
+ The workspace starts from a shell and generated platform contracts. It does not
89
+ generate a demo domain by default. Add real business MicroVerticals when they
90
+ become real ownership boundaries:
103
91
 
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.
92
+ ```bash
93
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
94
+ pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
95
+ pnpm dlx @bleedingdev/modern-js-create payments --vertical
96
+ pnpm dlx @bleedingdev/modern-js-create maps --vertical
97
+ mise exec -- pnpm ultramodern:check
98
+ ```
105
99
 
106
- Examples:
100
+ The `--vertical` command mutates the current workspace. It creates the vertical
101
+ package and updates topology metadata, ownership records, shell Module
102
+ Federation wiring, local development overlays, package dependencies, generated
103
+ contracts, ports, route-owned i18n, CSS isolation, and the vertical-owned Effect
104
+ BFF/client surface.
107
105
 
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?` |
106
+ ### Runtime Contracts
115
107
 
116
- The route owner changes localized paths and locale resource JSON together. Shell-owned URL rewrites are not part of the contract.
108
+ Generated apps and verticals keep SSR on the normal Modern.js path. SuperApp
109
+ workspaces add `server.ssr.moduleFederationAppSSR` when Module Federation SSR is
110
+ needed, but the flag remains an explicit contract rather than a requirement for
111
+ every app.
117
112
 
118
- ### Federated CSS Contract
113
+ Each app emits `src/routes/ultramodern-route-metadata` with
114
+ `ultramodernLocalisedUrls`. The i18n plugin reads that map in
115
+ `localeDetection.localisedUrls` and serves dynamic backend JSON from
116
+ `/locales/{{lng}}/{{ns}}.json`. The route owner changes localized paths and
117
+ locale resource JSON together.
119
118
 
120
- The generated contract writes `.modernjs/ultramodern-generated-contract.json` with a `cssFederation` section:
119
+ The generated contract writes `.modernjs/ultramodern-generated-contract.json`
120
+ with a `cssFederation` section:
121
121
 
122
122
  - `packages/shared-design-tokens` owns the shared token layer and exports `./tokens.css`.
123
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.
124
+ - Each vertical owns one CSS layer, for example `[data-app-id="vertical-transportation"]` with app-local class prefixes.
125
+ - Tailwind CSS v4 is local to each generated app through `@tailwindcss/postcss`; shared base styles must not be duplicated by verticals.
126
+ - SSR first paint requires shared token CSS and app-owned CSS to be emitted by Modern/Rspack assets. Vertical CSS is loaded through manifest ownership, not copied into shell source.
127
127
 
128
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
129
 
130
- ### Validation And Proof
130
+ ### Validation And Deploy
131
131
 
132
132
  Local gates:
133
133
 
@@ -137,29 +137,22 @@ mise exec -- pnpm build
137
137
  mise exec -- pnpm cloudflare:build
138
138
  ```
139
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`:
140
+ Generated workspaces include `scripts/proof-cloudflare-version.mjs` for live
141
+ Cloudflare and Zephyr proof:
152
142
 
153
143
  ```bash
154
144
  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 \
145
+ ULTRAMODERN_PUBLIC_URL_TRANSPORTATION=https://transportation.example.workers.dev \
146
+ ULTRAMODERN_PUBLIC_URL_PAYMENTS=https://payments.example.workers.dev \
158
147
  mise exec -- pnpm cloudflare:proof -- --require-public-urls
159
148
  ```
160
149
 
161
150
  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
151
 
152
+ BleedingDev packages are published through GitHub Actions trusted publishing.
153
+ The public workflow is tokenless; do not publish packages manually from a
154
+ developer machine.
155
+
163
156
  ## Baseline Switches (Opt-out)
164
157
 
165
158
  The generated `presetUltramodern(...)` starter enables strict platform contracts. Use these env switches to opt out per app or per environment:
@@ -107,11 +107,30 @@ npx @modern-js/create@latest myapp --router tanstack --bff-runtime effect --work
107
107
  当启用 `--bff-runtime hono` 时,会在 `modern.config.ts` 中启用 `@modern-js/plugin-bff`,生成 `api/lambda/hello.ts`,并将 `bff.runtimeFramework` 设置为 `hono`。
108
108
  当启用 `--workspace` 时,`@modern-js/*` 依赖会使用 `workspace:*` 版本,便于本地 monorepo 联调。
109
109
 
110
- 如果你需要公开的 UltraModern.js SuperApp 路径,请使用 BleedingDev create 包。
111
- 它默认生成规范的 Effect + TanStack + SSR + Micro Verticals workspace,并使用已发布的 BleedingDev 包别名:
110
+ 如果你需要公开的 UltraModern.js 路径,请使用 BleedingDev create 包。
111
+ 它默认创建一个简单、可上线的 UltraModern 应用,并安装已发布的
112
+ BleedingDev 包别名:
112
113
 
113
114
  ```bash
114
115
  pnpm dlx @bleedingdev/modern-js-create myapp
115
116
  ```
116
117
 
117
- 底层 `--ultramodern-*` 参数只保留给发布工程和本地包源测试使用。
118
+ 只有在需要多个独立归属的 vertical 时,才显式创建 SuperApp workspace:
119
+
120
+ ```bash
121
+ pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
122
+ ```
123
+
124
+ 在已生成的 SuperApp workspace 根目录中,可以就地添加业务
125
+ MicroVertical:
126
+
127
+ ```bash
128
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
129
+ ```
130
+
131
+ `--vertical` 会修改当前 workspace:新增 vertical 包,并写入 topology、
132
+ ownership 元数据、shell Module Federation、开发 overlays、包依赖、生成契约、
133
+ 路由归属 i18n、CSS 隔离,以及 Effect BFF/client surface。
134
+
135
+ 底层 `--ultramodern-package-*` 参数只保留给发布工程和本地包源测试使用。
136
+ BleedingDev 包通过 GitHub Actions trusted publishing 发布;不要从开发机器手动发布。
@@ -36,7 +36,7 @@ UltraModern.js 的增强能力是新 SuperApp 的默认产品面。兼容分支
36
36
  | BFF 运行时选型 | Modern.js 3.0 基线仅提供 Hono 运行时路径(无内建 Effect 运行时) | 将 Effect 设为默认运行时,并采用严格运行时拆分(`effect` -> `api/effect`,`hono` -> `api/lambda`),同时补齐 Effect-Schema-first 契约与 MF failure-injection 覆盖 |
37
37
  | Telemetry 标准化 | 可观测链路通常由业务侧自行拼装 | 增加框架级 telemetry 管线,内置 OTLP/VictoriaMetrics,支持脱敏、批处理与背压 |
38
38
  | 应用级 MF SSR 协议 | 没有以 super-app 为重点的应用级稳定性契约开关 | 增加 `server.ssr.moduleFederationAppSSR` 配置/环境变量握手,并补齐集成级回归保障 |
39
- | MF 远程加载可靠性 | 重试/降级策略通常由各业务单独实现 | 增加 timeout/network/contract-error 的确定性可靠性矩阵与分布式 OTEL 连续性断言 |
39
+ | MF vertical 加载可靠性 | 重试/降级策略通常由各业务单独实现 | 增加 timeout/network/contract-error 的确定性可靠性矩阵与分布式 OTEL 连续性断言 |
40
40
  | 模块准入治理 | 基线无模块认证证据化 gate profile | 新增模块 SDK 契约、边界反模式守卫与发布/模块认证 gate 工作流 |
41
41
  | 路由运行时 | 默认运行时路径以 React Router 为中心 | 增加 TanStack Router 运行时/CLI 一等支持(React Router 继续可用) |
42
42
  | 脚手架模板 | 默认 create 模板以 React Router 起步路径为中心 | 增加 TanStack-ready 与 Tailwind-ready 的 create 模板 |
@@ -58,6 +58,95 @@ UltraModern.js 的增强能力是新 SuperApp 的默认产品面。兼容分支
58
58
  3. 将基线契约视为渐进式默认值,而不是一次性强制切换。`MODERN_BASELINE_ENABLE_MF_SSR`、`MODERN_BASELINE_ENABLE_BFF_REQUEST_ID` 和 `MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS` 已经提供了按应用、按环境关闭的能力,方便在收敛到目标栈之前逐步过渡。
59
59
  4. 这套公开预设现在已经附带显式的发布 / 认证 gate。生成脚手架也会自带 `.github/workflows/ultramodern-gates.yml`,因此 `pnpm run ultramodern:check` 与 `pnpm run build` 从第一天开始就是接入契约的一部分。
60
60
 
61
+ ## 人类工作流
62
+
63
+ 公开的 BleedingDev create 包默认从简单路径开始。默认命令会创建一个
64
+ 可上线的 UltraModern 单应用,包含 `presetUltramodern(...)`、SSR、
65
+ TanStack Router、Tailwind CSS v4、i18n、Effect BFF、生成质量 gate,以及
66
+ Cloudflare 部署基础:
67
+
68
+ ```bash
69
+ pnpm dlx @bleedingdev/modern-js-create myapp
70
+ cd myapp
71
+ mise install
72
+ mise exec -- pnpm install
73
+ mise exec -- pnpm ultramodern:check
74
+ ```
75
+
76
+ 只有当独立归属边界有实际价值时,才创建 SuperApp workspace:
77
+
78
+ ```bash
79
+ pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
80
+ cd my-super-app
81
+ mise install
82
+ mise exec -- pnpm install
83
+ mise exec -- pnpm ultramodern:check
84
+ ```
85
+
86
+ workspace 从 shell 和平台契约起步,不强制生成演示业务域。真实业务边界出现后,
87
+ 再添加对应 MicroVertical:
88
+
89
+ ```bash
90
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
91
+ pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
92
+ pnpm dlx @bleedingdev/modern-js-create payments --vertical
93
+ pnpm dlx @bleedingdev/modern-js-create maps --vertical
94
+ mise exec -- pnpm ultramodern:check
95
+ ```
96
+
97
+ `--vertical` 会修改当前 workspace:创建 vertical 包,并更新 topology 元数据、
98
+ ownership 记录、shell Module Federation、开发 overlays、包依赖、生成契约、
99
+ 端口、路由归属 i18n、CSS 隔离,以及 vertical 自己拥有的 Effect BFF/client surface。
100
+
101
+ ### 运行时契约
102
+
103
+ 生成应用和 vertical 沿用正常的 Modern.js SSR 路径。SuperApp workspace 在需要
104
+ Module Federation SSR 时会加入 `server.ssr.moduleFederationAppSSR`,但这个开关是
105
+ 显式契约,不是所有应用的强制要求。
106
+
107
+ 每个应用都会产出 `src/routes/ultramodern-route-metadata` 和
108
+ `ultramodernLocalisedUrls`。i18n 插件在 `localeDetection.localisedUrls` 中读取它,
109
+ 并从 `/locales/{{lng}}/{{ns}}.json` 提供动态后端 JSON。路由 owner 需要同时维护
110
+ 本地化路径和 locale resource JSON。
111
+
112
+ 生成契约会在 `.modernjs/ultramodern-generated-contract.json` 中写入
113
+ `cssFederation`:
114
+
115
+ - `packages/shared-design-tokens` 拥有共享 token layer,并导出 `./tokens.css`。
116
+ - Shell CSS 只拥有 `[data-app-id="shell-super-app"]` 下的 shell base 和 overlay layer。
117
+ - 每个 vertical 拥有自己的 CSS layer,例如 `[data-app-id="vertical-transportation"]` 和应用本地 class 前缀。
118
+ - Tailwind CSS v4 通过 `@tailwindcss/postcss` 保持在每个生成应用内部;共享 base style 不应由 vertical 重复定义。
119
+ - SSR 首屏依赖 Modern/Rspack 产出共享 token CSS 和应用自己的 CSS。Vertical CSS 通过 manifest 归属加载,不复制到 shell 源码中。
120
+
121
+ 版本切换必须从同一个 vertical build marker 选择 UI、Effect API、CSS、i18n JSON 与 MF manifest 证据。只切换 shell 渲染里的 UI marker 不足以证明完整版本切换。
122
+
123
+ ### 校验与部署
124
+
125
+ 本地 gate:
126
+
127
+ ```bash
128
+ mise exec -- pnpm ultramodern:check
129
+ mise exec -- pnpm build
130
+ mise exec -- pnpm cloudflare:build
131
+ ```
132
+
133
+ 生成 workspace 包含 `scripts/proof-cloudflare-version.mjs`,用于 live Cloudflare 和
134
+ Zephyr 证据:
135
+
136
+ ```bash
137
+ ULTRAMODERN_PUBLIC_URL_SHELL_SUPER_APP=https://shell-super-app.example.workers.dev \
138
+ ULTRAMODERN_PUBLIC_URL_TRANSPORTATION=https://transportation.example.workers.dev \
139
+ ULTRAMODERN_PUBLIC_URL_PAYMENTS=https://payments.example.workers.dev \
140
+ mise exec -- pnpm cloudflare:proof -- --require-public-urls
141
+ ```
142
+
143
+ Live Cloudflare 与 Zephyr 证明需要公开 Worker URL 和 Zephyr 凭据。没有这些凭据时,
144
+ 仓库仍可校验生成契约、本地构建、本地 Cloudflare 输出、dry-run Zephyr 证据计划和
145
+ 本地证据 schema,但不能证明由 shell 驱动的 live 版本选择。
146
+
147
+ BleedingDev 包通过 GitHub Actions trusted publishing 发布。公开发布 workflow 不使用
148
+ 长期 npm token;不要从开发机器手动发布包。
149
+
61
150
  ## 基线开关(可按需关闭)
62
151
 
63
152
  生成的 `presetUltramodern(...)` 脚手架会开启更严格的平台契约。以下环境变量会在生成的 `modern.config.ts` 中读取,可按应用或按环境关闭/覆盖:
@@ -38,7 +38,7 @@ This page is the complete public difference reference for the UltraModern.js 3.0
38
38
  | Metrics/trace correlation | SSR metrics tags do not parse W3C trace context | `traceparent` is parsed and emits `trace_id` / `span_id` tags | Implemented | Improves cross-system observability joins |
39
39
  | App-level MF SSR contract flag | No dedicated app-level MF SSR stability contract switch | Adds `server.ssr.moduleFederationAppSSR` contract and auto-enables env wiring when MF SSR markers are detected | Implemented | Sets `process.env.MODERN_MF_APP_SSR` |
40
40
  | App-level MF SSR runtime bridge | Not a stable default bridge path | V3 applies stable bridge defaults for MF SSR node output/runtime env when server rendering + MF markers are present | Implemented | Keeps explicit opt-out path via config/env |
41
- | MF remote loader reliability contracts | Remote loading fallback patterns are typically app-defined | Adds deterministic timeout/network/contract-error fallback matrix and distributed OTEL continuity assertions | Implemented | `routes-tanstack-mf` reliability suite |
41
+ | MF vertical loading reliability contracts | Loading fallback patterns are typically app-defined | Adds deterministic timeout/network/contract-error fallback matrix and distributed OTEL continuity assertions | Implemented | `routes-tanstack-mf` reliability suite |
42
42
  | BFF runtime choices | Hono runtime path only in Modern.js 3.0 baseline (no built-in Effect runtime path) | Sets Effect as default runtime, enforces strict runtime split (`effect` -> `api/effect`, `hono` -> `api/lambda`), and adds Effect-Schema-only MF data contracts plus failure-injection coverage for federated data fetch | Implemented (Effect-default + strict split) | Stream is explicit about no Zod introduction |
43
43
  | Module SDK contract artifact | No framework-level module contract artifact | Adds machine-readable module contract + typed module SDK interfaces | Implemented | `module-sdk-contracts.json` + `moduleSdk.d.ts` |
44
44
  | Boundary anti-pattern CI guards | No dedicated boundary anti-pattern workflow | Adds profile-driven CI checks for boundary imports, required hooks, and forbidden module patterns | Implemented | `.github/workflows/boundary-anti-patterns.yml` |
@@ -239,7 +239,7 @@ UltraModern.js 3.0 shipped additional reliability work aligned to Beads stream D
239
239
 
240
240
  - `@modern-js/plugin-bff` runtime path migrated to Effect v4.
241
241
  - Effect-only MF data-fetch contract guidance (explicitly no Zod layer in this stream).
242
- - MF reliability matrix includes deterministic failure injection (timeout/network/contract error).
242
+ - MF vertical loading reliability matrix includes deterministic failure injection (timeout/network/contract error).
243
243
  - Distributed trace continuity checks were re-enabled for build and serve paths.
244
244
  - Data-platform architecture defines operation identity, envelope integrity, scoped invalidation, and trace propagation contracts.
245
245
 
@@ -247,7 +247,7 @@ Reference materials:
247
247
 
248
248
  - `docs/super-app-rfc-adr/ADR-0003-effect-only-mf-data-fetch-reliability.md`
249
249
  - `packages/cli/plugin-bff/docs/data-platform-architecture.md`
250
- - `tests/integration/routes-tanstack-mf/test/remote-loader-reliability.test.ts`
250
+ - `routes-tanstack-mf` reliability coverage
251
251
 
252
252
  ### 11) Release and module certification gate model
253
253
 
@@ -280,21 +280,71 @@ The following are intentionally out of scope for this public V3 preset profile:
280
280
  - Forcing Effect-only data-fetch runtime as the mandatory default for every app.
281
281
  - Forcing app-level MF SSR for every app regardless of readiness.
282
282
 
283
- ## Micro Vertical Delivery Path
283
+ ## Human Workflow
284
284
 
285
- `presetUltramodern(...)` is also the single public entrypoint for Micro Verticals. The intended adoption sequence is:
285
+ The public BleedingDev create package starts small. The default command creates
286
+ one production-ready UltraModern app with `presetUltramodern(...)`, SSR,
287
+ TanStack Router, Tailwind CSS v4, i18n, Effect BFF, generated quality gates, and
288
+ Cloudflare deploy basics:
286
289
 
287
- 1. start with one app and keep route/data ownership inside the shell,
288
- 2. extract stable route subtrees into MF remotes once fallback and compatibility behavior are explicit,
289
- 3. extract shared workflows into strict Effect services when request, identity, locale, and trace context must survive deployment boundaries,
290
- 4. keep Hono only as an explicit compatibility lane for existing Modern.js-style BFF handlers.
290
+ ```bash
291
+ pnpm dlx @bleedingdev/modern-js-create myapp
292
+ cd myapp
293
+ mise install
294
+ mise exec -- pnpm install
295
+ mise exec -- pnpm ultramodern:check
296
+ ```
297
+
298
+ Create a SuperApp workspace only when independent ownership is useful:
299
+
300
+ ```bash
301
+ pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
302
+ cd my-super-app
303
+ mise install
304
+ mise exec -- pnpm install
305
+ mise exec -- pnpm ultramodern:check
306
+ ```
307
+
308
+ Add real business MicroVerticals as they become ownership boundaries:
291
309
 
292
- In this repo, the reference examples are:
310
+ ```bash
311
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
312
+ pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
313
+ pnpm dlx @bleedingdev/modern-js-create payments --vertical
314
+ pnpm dlx @bleedingdev/modern-js-create maps --vertical
315
+ mise exec -- pnpm ultramodern:check
316
+ ```
293
317
 
294
- - `routes-tanstack-mf` for shell + remote composition and MF SSR contracts,
295
- - `bff-corss-project` for cross-project producer/consumer wiring,
296
- - `bff-runtime-parity` for generated-client build/serve parity,
297
- - `bff-hono` for the compatibility lane.
318
+ The `--vertical` command mutates the current workspace. It creates the vertical
319
+ package and updates topology metadata, ownership records, shell Module
320
+ Federation wiring, local development overlays, package dependencies, generated
321
+ contracts, ports, route-owned i18n, CSS isolation, and the vertical-owned Effect
322
+ BFF/client surface.
323
+
324
+ Generated apps and verticals keep SSR on the normal Modern.js path. SuperApp
325
+ workspaces add `server.ssr.moduleFederationAppSSR` when Module Federation SSR is
326
+ needed, but the flag remains an explicit contract rather than a requirement for
327
+ every app.
328
+
329
+ Each app emits `src/routes/ultramodern-route-metadata` with
330
+ `ultramodernLocalisedUrls`. The i18n plugin reads that map in
331
+ `localeDetection.localisedUrls` and serves dynamic backend JSON from
332
+ `/locales/{{lng}}/{{ns}}.json`.
333
+
334
+ The generated contract writes `.modernjs/ultramodern-generated-contract.json`
335
+ with `cssFederation`: shared design tokens stay in `packages/shared-design-tokens`,
336
+ shell CSS owns shell layers, each vertical owns one CSS layer with app-local
337
+ prefixes, and SSR first paint uses Modern/Rspack assets plus manifest-owned
338
+ vertical CSS.
339
+
340
+ Generated workspaces include `scripts/proof-cloudflare-version.mjs` for live
341
+ Cloudflare and Zephyr proof. Live proof requires public Worker URLs and Zephyr
342
+ credentials; local checks still validate generated contracts, builds,
343
+ Cloudflare output, dry-run Zephyr evidence plans, and local evidence schemas.
344
+
345
+ BleedingDev packages are published through GitHub Actions trusted publishing.
346
+ The public workflow is tokenless; do not publish packages manually from a
347
+ developer machine.
298
348
 
299
349
  ## Baseline Switches (Opt-out)
300
350
 
@@ -38,7 +38,7 @@ UltraModern.js V3 记录的是一套“更强默认值的 Modern.js 参考档案
38
38
  | Metrics 与 Trace 关联 | SSR metrics 不解析 W3C trace 上下文 | 解析 `traceparent` 并注入 `trace_id` / `span_id` 标签 | 已实现 | 提升跨系统观测关联度 |
39
39
  | 应用级 MF SSR 合约开关 | 无专门 app-level MF SSR 稳定性契约开关 | 新增 `server.ssr.moduleFederationAppSSR`,并在检测到 MF SSR 标记时自动启用环境变量握手 | 已实现 | 注入 `process.env.MODERN_MF_APP_SSR` |
40
40
  | 应用级 MF SSR 运行时桥接 | 非稳定默认桥接路径 | V3 在「服务端渲染 + MF 标记」场景下提供稳定桥接默认行为 | 已实现 | 保留显式关闭路径 |
41
- | MF 远程加载可靠性契约 | 远程加载重试/降级策略通常由业务自管 | 新增 timeout/network/contract-error 的确定性降级矩阵与分布式 OTEL 连续性断言 | 已实现 | 对应 `routes-tanstack-mf` 可靠性套件 |
41
+ | MF vertical 加载可靠性契约 | 加载重试/降级策略通常由业务自管 | 新增 timeout/network/contract-error 的确定性降级矩阵与分布式 OTEL 连续性断言 | 已实现 | 对应 `routes-tanstack-mf` 可靠性套件 |
42
42
  | BFF 运行时选型 | Modern.js V3 基线仅提供 Hono 运行时路径(无内建 Effect 运行时) | 将 Effect 设为默认运行时,并采用严格运行时拆分(`effect` -> `api/effect`,`hono` -> `api/lambda`),同时补齐 Effect-Schema-only MF 数据契约与 failure-injection 覆盖 | 已实现(Effect 默认 + 严格拆分) | 该流明确不引入 Zod |
43
43
  | 模块 SDK 合约产物 | 无框架级模块契约产物 | 新增机器可读模块家族契约与类型化模块 SDK 接口 | 已实现 | `module-sdk-contracts.json` + `moduleSdk.d.ts` |
44
44
  | 边界反模式 CI 守卫 | 无专门边界反模式工作流 | 新增基于 profile 的边界检查(导入边界/必需钩子/模块禁用模式) | 已实现 | `.github/workflows/boundary-anti-patterns.yml` |
@@ -239,7 +239,7 @@ UltraModern.js V3 对应 Beads Stream D 落地了额外可靠性能力:
239
239
 
240
240
  - `@modern-js/plugin-bff` 运行时路径迁移到 Effect v4。
241
241
  - MF 数据拉取契约采用 Effect-only 指导(该流明确不引入 Zod)。
242
- - 远程加载可靠性矩阵覆盖 timeout/network/contract error 的确定性注入场景。
242
+ - MF vertical 加载可靠性矩阵覆盖 timeout/network/contract error 的确定性注入场景。
243
243
  - build 与 serve 路径重新启用分布式 trace 连续性断言。
244
244
  - 数据平台架构补齐 operation identity、请求/水合 envelope 完整性、scope key 与失效路由契约。
245
245
 
@@ -247,7 +247,7 @@ UltraModern.js V3 对应 Beads Stream D 落地了额外可靠性能力:
247
247
 
248
248
  - `docs/super-app-rfc-adr/ADR-0003-effect-only-mf-data-fetch-reliability.md`
249
249
  - `packages/cli/plugin-bff/docs/data-platform-architecture.md`
250
- - `tests/integration/routes-tanstack-mf/test/remote-loader-reliability.test.ts`
250
+ - `routes-tanstack-mf` 可靠性覆盖
251
251
 
252
252
  ### 11) 发布与模块认证 Gate 模型
253
253
 
@@ -280,6 +280,65 @@ UltraModern.js V3 对应 Beads Stream D 落地了额外可靠性能力:
280
280
  - 将应用级 MF SSR 强制为所有应用的默认路径。
281
281
  - 将 Effect-only 数据获取运行时强制为所有应用的默认路径。
282
282
 
283
+ ## 人类工作流
284
+
285
+ 公开的 BleedingDev create 包默认从简单路径开始。默认命令会创建一个
286
+ 可上线的 UltraModern 单应用,包含 `presetUltramodern(...)`、SSR、
287
+ TanStack Router、Tailwind CSS v4、i18n、Effect BFF、生成质量 gate,以及
288
+ Cloudflare 部署基础:
289
+
290
+ ```bash
291
+ pnpm dlx @bleedingdev/modern-js-create myapp
292
+ cd myapp
293
+ mise install
294
+ mise exec -- pnpm install
295
+ mise exec -- pnpm ultramodern:check
296
+ ```
297
+
298
+ 只有当独立归属边界有实际价值时,才创建 SuperApp workspace:
299
+
300
+ ```bash
301
+ pnpm dlx @bleedingdev/modern-js-create my-super-app --ultramodern-workspace
302
+ cd my-super-app
303
+ mise install
304
+ mise exec -- pnpm install
305
+ mise exec -- pnpm ultramodern:check
306
+ ```
307
+
308
+ 真实业务边界出现后,再添加对应 MicroVertical:
309
+
310
+ ```bash
311
+ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
312
+ pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
313
+ pnpm dlx @bleedingdev/modern-js-create payments --vertical
314
+ pnpm dlx @bleedingdev/modern-js-create maps --vertical
315
+ mise exec -- pnpm ultramodern:check
316
+ ```
317
+
318
+ `--vertical` 会修改当前 workspace:创建 vertical 包,并更新 topology 元数据、
319
+ ownership 记录、shell Module Federation、开发 overlays、包依赖、生成契约、
320
+ 端口、路由归属 i18n、CSS 隔离,以及 vertical 自己拥有的 Effect BFF/client surface。
321
+
322
+ 生成应用和 vertical 沿用正常的 Modern.js SSR 路径。SuperApp workspace 在需要
323
+ Module Federation SSR 时会加入 `server.ssr.moduleFederationAppSSR`,但这个开关是
324
+ 显式契约,不是所有应用的强制要求。
325
+
326
+ 每个应用都会产出 `src/routes/ultramodern-route-metadata` 和
327
+ `ultramodernLocalisedUrls`。i18n 插件在 `localeDetection.localisedUrls` 中读取它,
328
+ 并从 `/locales/{{lng}}/{{ns}}.json` 提供动态后端 JSON。
329
+
330
+ 生成契约会在 `.modernjs/ultramodern-generated-contract.json` 中写入
331
+ `cssFederation`:共享 design tokens 保留在 `packages/shared-design-tokens`,
332
+ shell CSS 拥有 shell layer,每个 vertical 拥有自己的 CSS layer 与应用本地前缀,
333
+ SSR 首屏使用 Modern/Rspack 产物和 manifest 归属的 vertical CSS。
334
+
335
+ 生成 workspace 包含 `scripts/proof-cloudflare-version.mjs`,用于 live Cloudflare 和
336
+ Zephyr 证据。Live 证明需要公开 Worker URL 和 Zephyr 凭据;本地检查仍可校验
337
+ 生成契约、构建、Cloudflare 输出、dry-run Zephyr 证据计划和本地证据 schema。
338
+
339
+ BleedingDev 包通过 GitHub Actions trusted publishing 发布。公开发布 workflow 不使用
340
+ 长期 npm token;不要从开发机器手动发布包。
341
+
283
342
  ## 基线开关(可按需关闭)
284
343
 
285
344
  生成的 `presetUltramodern(...)` create 模板会开启更严格的平台契约。以下环境变量会在生成的 `modern.config.ts` 中读取,可按应用或按环境关闭/覆盖:
package/package.json CHANGED
@@ -18,14 +18,14 @@
18
18
  "modern",
19
19
  "modern.js"
20
20
  ],
21
- "version": "3.2.0-ultramodern.57",
21
+ "version": "3.2.0-ultramodern.61",
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.57"
28
+ "@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.61"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@rsbuild/plugin-sass": "1.5.2",