@bleedingdev/modern-js-main-doc 3.2.0-ultramodern.120 → 3.2.0-ultramodern.122
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/docs/en/apis/app/commands.mdx +59 -69
- package/docs/en/community/blog/v2-release-note.mdx +5 -5
- package/docs/en/community/blog/v3-release-note.mdx +1 -1
- package/docs/en/community/releases.mdx +1 -5
- package/docs/en/components/build-output.mdx +1 -1
- package/docs/en/components/debug-app.mdx +1 -1
- package/docs/en/components/deploy-command.mdx +3 -3
- package/docs/en/components/init-app.mdx +4 -0
- package/docs/en/components/serve-command.mdx +3 -3
- package/docs/en/configure/app/bff/effect.mdx +27 -3
- package/docs/en/configure/app/performance/rsdoctor.mdx +7 -4
- package/docs/en/configure/app/usage.mdx +6 -6
- package/docs/en/guides/advanced-features/bff/data-platform.mdx +3 -1
- package/docs/en/guides/advanced-features/bff/frameworks.mdx +3 -1
- package/docs/en/guides/advanced-features/international/api.mdx +1 -1
- package/docs/en/guides/advanced-features/international/configuration.mdx +1 -1
- package/docs/en/guides/advanced-features/international/locale-detection.mdx +1 -1
- package/docs/en/guides/advanced-features/international/routing.mdx +5 -3
- package/docs/en/guides/basic-features/debug/rsdoctor.mdx +2 -3
- package/docs/en/guides/basic-features/debug/using-storybook.mdx +1 -1
- package/docs/en/guides/basic-features/deploy.mdx +14 -14
- package/docs/en/guides/basic-features/env-vars.mdx +2 -2
- package/docs/en/guides/basic-features/render/_meta.json +1 -10
- package/docs/en/guides/basic-features/render/overview.mdx +0 -1
- package/docs/en/guides/basic-features/render/rsc.mdx +0 -1
- package/docs/en/guides/basic-features/routes/config-routes.mdx +2 -2
- package/docs/en/guides/basic-features/routes/routes.mdx +7 -7
- package/docs/en/guides/concept/server.mdx +2 -2
- package/docs/en/guides/get-started/quick-start.mdx +1 -1
- package/docs/en/guides/get-started/ultramodern.mdx +10 -4
- package/docs/en/guides/topic-detail/module-federation/application.mdx +1 -1
- package/docs/en/guides/topic-detail/module-federation/deploy.mdx +2 -2
- package/docs/en/guides/topic-detail/module-federation/usage.mdx +5 -5
- package/docs/en/guides/troubleshooting/builder.mdx +1 -1
- package/docs/en/guides/upgrade/config.mdx +1 -2
- package/docs/en/guides/upgrade/other.mdx +4 -4
- package/docs/zh/apis/app/commands.mdx +56 -66
- package/docs/zh/community/blog/v2-release-note.mdx +5 -5
- package/docs/zh/community/blog/v3-release-note.mdx +1 -1
- package/docs/zh/community/releases.mdx +1 -5
- package/docs/zh/components/build-output.mdx +1 -1
- package/docs/zh/components/debug-app.mdx +1 -1
- package/docs/zh/components/deploy-command.mdx +3 -3
- package/docs/zh/components/init-app.mdx +16 -47
- package/docs/zh/components/serve-command.mdx +3 -3
- package/docs/zh/configure/app/bff/effect.mdx +26 -2
- package/docs/zh/configure/app/performance/rsdoctor.mdx +7 -4
- package/docs/zh/configure/app/usage.mdx +6 -6
- package/docs/zh/guides/advanced-features/bff/data-platform.mdx +3 -1
- package/docs/zh/guides/advanced-features/bff/frameworks.mdx +3 -1
- package/docs/zh/guides/advanced-features/international/api.mdx +1 -1
- package/docs/zh/guides/advanced-features/international/configuration.mdx +1 -1
- package/docs/zh/guides/advanced-features/international/locale-detection.mdx +1 -1
- package/docs/zh/guides/advanced-features/international/routing.mdx +5 -3
- package/docs/zh/guides/basic-features/debug/rsdoctor.mdx +2 -3
- package/docs/zh/guides/basic-features/debug/using-storybook.mdx +1 -1
- package/docs/zh/guides/basic-features/deploy.mdx +13 -13
- package/docs/zh/guides/basic-features/env-vars.mdx +2 -2
- package/docs/zh/guides/basic-features/render/_meta.json +1 -10
- package/docs/zh/guides/basic-features/render/overview.mdx +0 -1
- package/docs/zh/guides/basic-features/render/rsc.mdx +0 -1
- package/docs/zh/guides/basic-features/routes/config-routes.mdx +2 -2
- package/docs/zh/guides/basic-features/routes/routes.mdx +7 -7
- package/docs/zh/guides/concept/server.mdx +2 -2
- package/docs/zh/guides/get-started/quick-start.mdx +1 -1
- package/docs/zh/guides/get-started/ultramodern.mdx +17 -22
- package/docs/zh/guides/topic-detail/module-federation/application.mdx +1 -1
- package/docs/zh/guides/topic-detail/module-federation/deploy.mdx +2 -2
- package/docs/zh/guides/topic-detail/module-federation/usage.mdx +5 -5
- package/docs/zh/guides/troubleshooting/builder.mdx +1 -1
- package/docs/zh/guides/upgrade/config.mdx +1 -2
- package/docs/zh/guides/upgrade/other.md +4 -4
- package/package.json +5 -4
- package/rspress.config.ts +17 -5
- package/src/components/Footer/index.tsx +3 -3
- package/src/components/SecondaryTitle/index.module.css +7 -2
- package/src/components/ShowcaseList/useShowcases.ts +23 -65
- package/src/i18n/enUS.ts +0 -9
- package/src/i18n/zhCN.ts +0 -9
- package/src/sandbox/csr-auth/src/routes/page-tsx.txt +1 -1
- package/static/img/logo.svg +7 -0
- package/static/img/social-card.svg +12 -0
- package/builder-doc/docs/en/config/performance/rsdoctor.md +0 -37
- package/builder-doc/docs/zh/config/performance/rsdoctor.md +0 -37
- package/docs/en/guides/basic-features/render/tanstack-rsc.mdx +0 -226
- package/docs/zh/guides/basic-features/render/tanstack-rsc.mdx +0 -226
- package/main-doc/docs/en/guides/get-started/ultramodern.mdx +0 -403
- package/main-doc/docs/zh/guides/get-started/ultramodern.mdx +0 -363
|
@@ -26,10 +26,10 @@ Modern.js 开发环境和生产环境的 Web 服务器流程是完全同构的
|
|
|
26
26
|
|
|
27
27
|
Modern.js 支持在任何 Node.js 环境运行构建产物。在 CI 环境中,通常情况下已经安装了应用全部的依赖。
|
|
28
28
|
|
|
29
|
-
你可以执行 [`
|
|
29
|
+
你可以执行 [`modern build`](/apis/app/commands#modern-build) 来构建应用,执行 [`modern serve`](/apis/app/commands#modern-serve) 命令来运行 Web 服务器,启动 UltraModern.js 应用。
|
|
30
30
|
|
|
31
31
|
## 在生产环境中运行
|
|
32
32
|
|
|
33
33
|
在部署到生产环境时,产物体积应该尽可能小,而上述在 CI 中运行的方案,会保留原项目的所有产物。因此在生产环境,不推荐通过上述命令运行应用。
|
|
34
34
|
|
|
35
|
-
UltraModern.js 提供了独立的部署方案,当运行 [`
|
|
35
|
+
UltraModern.js 提供了独立的部署方案,当运行 [`modern deploy`](/apis/app/commands#modern-deploy) 命令时,产物中会包含可运行 Web 服务器的入口文件。
|
|
@@ -46,7 +46,7 @@ export default defineConfig({
|
|
|
46
46
|
|
|
47
47
|
在新创建的工程中,默认会安装 `@modern-js/app-tools` npm 包,它是 Modern.js 框架的核心包,主要提供以下能力:
|
|
48
48
|
|
|
49
|
-
- 提供 `
|
|
49
|
+
- 提供 `modern dev`, `modern build` 等常用的 CLI 命令。
|
|
50
50
|
- 集成 Rsbuild,提供构建能力。
|
|
51
51
|
- 集成 Modern.js Server,提供开发和生产服务器相关能力。
|
|
52
52
|
|
|
@@ -30,7 +30,7 @@ UltraModern.js 的增强能力是新 SuperApp 的默认产品面。兼容分支
|
|
|
30
30
|
|
|
31
31
|
| 领域 | Modern.js 3.0 基线 | UltraModern.js 3.0 |
|
|
32
32
|
| --- | --- | --- |
|
|
33
|
-
| 构建诊断能力 | RsDoctor 多为显式开启 |
|
|
33
|
+
| 构建诊断能力 | RsDoctor 多为显式开启 | 新增一等的 `performance.rsdoctor` 配置项(按需开启;早期的默认开启行为与诊断契约产物已回退) |
|
|
34
34
|
| 输出与静态资源回源 | 预压缩策略通常由业务自定义 | 默认开启 `output.precompress`,并按 `Accept-Encoding` 协商 `.br` / `.gz` 回源 |
|
|
35
35
|
| BFF 运行时与契约 | 提供标准 BFF 运行时与客户端生成能力 | 增加 `requestId` 维度隔离、初始化 fail-fast 校验与操作/追踪关联 Header |
|
|
36
36
|
| BFF 运行时选型 | Modern.js 3.0 基线仅提供 Hono 运行时路径(无内建 Effect 运行时) | 将 Effect 设为默认运行时,并采用严格运行时拆分(`effect` -> `api/effect`,`hono` -> `api/lambda`),同时补齐 Effect-Schema-first 契约与 MF failure-injection 覆盖 |
|
|
@@ -40,7 +40,7 @@ UltraModern.js 的增强能力是新 SuperApp 的默认产品面。兼容分支
|
|
|
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 模板 |
|
|
43
|
-
| Starter 预设约束 | 生成应用默认没有 UltraModern 预设 gate 工作流 |
|
|
43
|
+
| Starter 预设约束 | 生成应用默认没有 UltraModern 预设 gate 工作流 | 生成 workspace 会附带 `.github/workflows/ultramodern-workspace-gates.yml`、`pnpm check`、基础本地 gate 与生成契约校验 |
|
|
44
44
|
|
|
45
45
|
## 我们刻意不做的事情
|
|
46
46
|
|
|
@@ -56,31 +56,21 @@ UltraModern.js 的增强能力是新 SuperApp 的默认产品面。兼容分支
|
|
|
56
56
|
1. 既有 React Router 应用可以继续按现状运行。TanStack Router 是新脚手架与增量迁移的优先路径,但 React Router 兼容分支仍然保留,团队可以按自己的节奏迁移。
|
|
57
57
|
2. 新建或迁移中的 BFF 能力优先使用 `bff.runtimeFramework: 'effect'`,并将入口实现放在 `api/effect/index.ts`。如果当前应用已经在 `api/lambda/**` 下使用 Hono 处理函数,就继续显式使用 `bff.runtimeFramework: 'hono'`,等准备好再迁移;Hono 仍是受支持的兼容分支。
|
|
58
58
|
3. 将基线契约视为渐进式默认值,而不是一次性强制切换。`MODERN_BASELINE_ENABLE_MF_SSR`、`MODERN_BASELINE_ENABLE_BFF_REQUEST_ID` 和 `MODERN_BASELINE_ENABLE_TELEMETRY_EXPORTERS` 已经提供了按应用、按环境关闭的能力,方便在收敛到目标栈之前逐步过渡。
|
|
59
|
-
4. 这套公开预设现在已经附带显式的发布 / 认证 gate
|
|
59
|
+
4. 这套公开预设现在已经附带显式的发布 / 认证 gate。生成 workspace 会自带 `.github/workflows/ultramodern-workspace-gates.yml`,因此 `pnpm check` 与 `pnpm build` 从第一天开始就是本地接入契约的一部分;CI 会以并行矩阵运行这些基础 gate。
|
|
60
60
|
|
|
61
61
|
## 人类工作流
|
|
62
62
|
|
|
63
|
-
公开的 BleedingDev create
|
|
64
|
-
可上线的 UltraModern
|
|
65
|
-
TanStack Router、Tailwind CSS v4、i18n、Effect BFF
|
|
66
|
-
Cloudflare 部署基础:
|
|
63
|
+
公开的 BleedingDev create 包只有一个受支持的生成产品。默认命令会创建一个
|
|
64
|
+
可上线的 UltraModern SuperApp workspace,包含 `presetUltramodern(...)`、
|
|
65
|
+
SSR、TanStack Router、Tailwind CSS v4、i18n、Effect BFF、Module Federation
|
|
66
|
+
topology、生成质量 gate,以及 Cloudflare 部署基础:
|
|
67
67
|
|
|
68
68
|
```bash
|
|
69
69
|
pnpm dlx @bleedingdev/modern-js-create myapp
|
|
70
70
|
cd myapp
|
|
71
71
|
mise install
|
|
72
72
|
mise exec -- pnpm install
|
|
73
|
-
mise exec -- pnpm
|
|
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
|
|
73
|
+
mise exec -- pnpm check
|
|
84
74
|
```
|
|
85
75
|
|
|
86
76
|
workspace 从 shell 和平台契约起步,不强制生成演示业务域。真实业务边界出现后,
|
|
@@ -91,7 +81,7 @@ pnpm dlx @bleedingdev/modern-js-create transportation --vertical
|
|
|
91
81
|
pnpm dlx @bleedingdev/modern-js-create food-delivery --vertical
|
|
92
82
|
pnpm dlx @bleedingdev/modern-js-create payments --vertical
|
|
93
83
|
pnpm dlx @bleedingdev/modern-js-create maps --vertical
|
|
94
|
-
mise exec -- pnpm
|
|
84
|
+
mise exec -- pnpm check
|
|
95
85
|
```
|
|
96
86
|
|
|
97
87
|
`--vertical` 会修改当前 workspace:创建 vertical 包,并更新 topology 元数据、
|
|
@@ -106,8 +96,13 @@ Module Federation SSR 时会加入 `server.ssr.moduleFederationAppSSR`,但这
|
|
|
106
96
|
|
|
107
97
|
每个应用都会产出 `src/routes/ultramodern-route-metadata` 和
|
|
108
98
|
`ultramodernLocalisedUrls`。i18n 插件在 `localeDetection.localisedUrls` 中读取它,
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
这就是在 `localePathRedirect` 之上启用路径片段翻译的显式非空映射。i18n 插件也会从
|
|
100
|
+
`/locales/{{lng}}/{{ns}}.json` 提供动态后端 JSON。路由 owner 需要同时维护本地化路径和
|
|
101
|
+
locale resource JSON。
|
|
102
|
+
|
|
103
|
+
JSON-LD 是可选的路由 metadata,不会自动推断。私有路由和不可索引路由默认不输出
|
|
104
|
+
JSON-LD。公开路由 owner 可以在本地化路径旁显式添加 `jsonLd`,并使用生成的
|
|
105
|
+
`src/routes/ultramodern-jsonld.ts` helper 编写常见 schema.org 结构。
|
|
111
106
|
|
|
112
107
|
生成契约会在 `.modernjs/ultramodern-generated-contract.json` 中写入
|
|
113
108
|
`cssFederation`:
|
|
@@ -125,7 +120,7 @@ Module Federation SSR 时会加入 `server.ssr.moduleFederationAppSSR`,但这
|
|
|
125
120
|
本地 gate:
|
|
126
121
|
|
|
127
122
|
```bash
|
|
128
|
-
mise exec -- pnpm
|
|
123
|
+
mise exec -- pnpm check
|
|
129
124
|
mise exec -- pnpm build
|
|
130
125
|
mise exec -- pnpm cloudflare:build
|
|
131
126
|
```
|
|
@@ -104,7 +104,7 @@ export default RemoteApp;
|
|
|
104
104
|
|
|
105
105
|
## 启动应用
|
|
106
106
|
|
|
107
|
-
现在,生产者应用和消费者应用都已经搭建完毕,我们可以在本地运行 `
|
|
107
|
+
现在,生产者应用和消费者应用都已经搭建完毕,我们可以在本地运行 `modern dev` 启动两个应用。
|
|
108
108
|
|
|
109
109
|
启动后,消费者应用访问 `/remote` 路由时,会进入生产者应用中。访问 `http://localhost:8080/remote`,可以看到页面中已经包含了生产者的远程模块的完整页面。
|
|
110
110
|
|
|
@@ -88,10 +88,10 @@ export default createModuleFederationConfig({
|
|
|
88
88
|
|
|
89
89
|
## 本地验证部署
|
|
90
90
|
|
|
91
|
-
Modern.js 提供了 `
|
|
91
|
+
Modern.js 提供了 `modern deploy` 命令,可以方便生成可运行在 Node.js 环境的产物。
|
|
92
92
|
|
|
93
93
|
```bash
|
|
94
|
-
|
|
94
|
+
modern deploy
|
|
95
95
|
```
|
|
96
96
|
|
|
97
97
|
执行命令后,可以在控制台看到以下输出:
|
|
@@ -154,7 +154,7 @@ export default Index;
|
|
|
154
154
|
|
|
155
155
|
## 启动应用
|
|
156
156
|
|
|
157
|
-
现在,生产者应用和消费者应用都已经搭建完毕,我们可以在本地运行 `
|
|
157
|
+
现在,生产者应用和消费者应用都已经搭建完毕,我们可以在本地运行 `modern dev` 启动两个应用。
|
|
158
158
|
|
|
159
159
|
启动后,消费者中对生产者模块的引入,不会再出现抛错,类型已经下载到消费者应用中。
|
|
160
160
|
|
|
@@ -164,7 +164,7 @@ export default Index;
|
|
|
164
164
|
|
|
165
165
|
访问 `http://localhost:8080/remote`,可以看到页面中已经包含了生产者的远程模块 `Button` 组件。
|
|
166
166
|
|
|
167
|
-
我们也可以在本地执行 `
|
|
167
|
+
我们也可以在本地执行 `modern serve` 来模拟生产环境。
|
|
168
168
|
|
|
169
169
|
因为 Module Federation 插件会自动读取 Modern.js 的 `output.assetPrefix` 配置作为远程模块的访问地址,而该值在生产环境下构建后默认是 `/`。如果不做特殊处理,消费者将从自己的域名下拉取远程模块的入口文件。我们可以添加如下配置:
|
|
170
170
|
|
|
@@ -178,7 +178,7 @@ export default defineConfig({
|
|
|
178
178
|
port: 3051,
|
|
179
179
|
},
|
|
180
180
|
output: {
|
|
181
|
-
// Now this configuration is only used in the local when you run
|
|
181
|
+
// Now this configuration is only used in the local when you run modern serve command.
|
|
182
182
|
// If you want to deploy the application to the platform, use your own domain name.
|
|
183
183
|
// Module federation will automatically write it to mf-manifest.json, which influences consumer to fetch remoteEntry.js.
|
|
184
184
|
assetPrefix: 'http://127.0.0.1:3051',
|
|
@@ -187,10 +187,10 @@ export default defineConfig({
|
|
|
187
187
|
});
|
|
188
188
|
```
|
|
189
189
|
|
|
190
|
-
现在,在生产者中运行 `
|
|
190
|
+
现在,在生产者中运行 `modern build && MODERN_MF_AUTO_CORS=true modern serve`,在消费者中运行 `modern build && modern serve`,即可在本地模拟生产环境,访问到远程模块。
|
|
191
191
|
|
|
192
192
|
:::tip
|
|
193
|
-
在使用 `
|
|
193
|
+
在使用 `modern serve` 命令时,需要在启动生产者项目时携带 `MODERN_MF_AUTO_CORS=true` 环境变量,以自动处理跨域问题,确保消费者可以正常访问生产者的远程模块资源。
|
|
194
194
|
:::
|
|
195
195
|
|
|
196
196
|
上述用例可以参考:[Modern.js & Module Federation 基础用法示例](https://github.com/web-infra-dev/modern-js-examples/tree/main/examples/module-federation/base)。
|
|
@@ -23,7 +23,7 @@ Modern.js 内部基于 [Rsbuild](https://v2.rsbuild.rs/) 封装了自身的构
|
|
|
23
23
|
Modern.js 提供 [inspect 命令](/apis/app/commands.html) 用于查看项目最终生成的 Modern.js 配置以及 Rspack 配置。
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
➜ npx
|
|
26
|
+
➜ npx modern inspect
|
|
27
27
|
|
|
28
28
|
Inspect config succeed, open following files to view the content:
|
|
29
29
|
|
|
@@ -334,7 +334,7 @@ export default {
|
|
|
334
334
|
|
|
335
335
|
### tools.rsdoctor
|
|
336
336
|
|
|
337
|
-
**变更内容**:该配置已废弃。v3
|
|
337
|
+
**变更内容**:该配置已废弃。v3 中可通过 [`performance.rsdoctor`](/configure/app/performance/rsdoctor) 显式启用 Rsdoctor 诊断能力。
|
|
338
338
|
|
|
339
339
|
**迁移示例**:
|
|
340
340
|
|
|
@@ -350,7 +350,6 @@ tools: {
|
|
|
350
350
|
// v3
|
|
351
351
|
export default {
|
|
352
352
|
performance: {
|
|
353
|
-
// 生产构建默认启用
|
|
354
353
|
rsdoctor: {
|
|
355
354
|
enabled: true,
|
|
356
355
|
},
|
|
@@ -95,7 +95,7 @@ Modern.js 3.0 不再支持通过 `@bleedingdev/modern-js-create` 创建 Monorepo
|
|
|
95
95
|
**变更内容**:
|
|
96
96
|
|
|
97
97
|
- 在 [v2.53.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.53.0) 版本中,移除了使用 `@bleedingdev/modern-js-create` 创建 Monorepo 项目的功能
|
|
98
|
-
- 在 [v2.61.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.61.0) 版本中,移除了使用 `@bleedingdev/modern-js-create` 和 `
|
|
98
|
+
- 在 [v2.61.0](https://github.com/web-infra-dev/modern.js/releases/tag/v2.61.0) 版本中,移除了使用 `@bleedingdev/modern-js-create` 和 `modern new` 命令创建 Modern.js Module 项目的功能
|
|
99
99
|
|
|
100
100
|
**处理方式**:
|
|
101
101
|
|
|
@@ -104,12 +104,12 @@ Modern.js 3.0 不再支持通过 `@bleedingdev/modern-js-create` 创建 Monorepo
|
|
|
104
104
|
|
|
105
105
|
## new 命令和 upgrade 命令移除
|
|
106
106
|
|
|
107
|
-
Modern.js 3.0 移除了 `
|
|
107
|
+
Modern.js 3.0 移除了 `modern new` 和 `modern upgrade` 命令,需要按照文档手动操作。
|
|
108
108
|
|
|
109
109
|
**变更内容**:
|
|
110
110
|
|
|
111
|
-
- `
|
|
112
|
-
- `
|
|
111
|
+
- `modern new` 命令在 Modern.js 3.0 中不再支持,无法通过命令添加入口或启用功能
|
|
112
|
+
- `modern upgrade` 命令在 Modern.js 3.0 中不再支持,无法通过命令自动升级依赖
|
|
113
113
|
|
|
114
114
|
**处理方式**:
|
|
115
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bleedingdev/modern-js-main-doc",
|
|
3
|
-
"description": "Documentation
|
|
3
|
+
"description": "Documentation for the UltraModern.js framework",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://github.com/BleedingDev/ultramodern.js#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -16,16 +16,17 @@
|
|
|
16
16
|
"react",
|
|
17
17
|
"framework",
|
|
18
18
|
"modern",
|
|
19
|
-
"modern.js"
|
|
19
|
+
"modern.js",
|
|
20
|
+
"ultramodern.js"
|
|
20
21
|
],
|
|
21
|
-
"version": "3.2.0-ultramodern.
|
|
22
|
+
"version": "3.2.0-ultramodern.122",
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"registry": "https://registry.npmjs.org/",
|
|
24
25
|
"access": "public"
|
|
25
26
|
},
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"mermaid": "^11.15.0",
|
|
28
|
-
"@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.
|
|
29
|
+
"@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.2.0-ultramodern.122"
|
|
29
30
|
},
|
|
30
31
|
"devDependencies": {
|
|
31
32
|
"@rsbuild/plugin-sass": "1.5.3",
|
package/rspress.config.ts
CHANGED
|
@@ -5,13 +5,12 @@ import path from 'path';
|
|
|
5
5
|
import { pluginOpenGraph } from 'rsbuild-plugin-open-graph';
|
|
6
6
|
|
|
7
7
|
const docPath = path.join(__dirname, 'docs');
|
|
8
|
+
const staticPath = path.join(__dirname, 'static');
|
|
8
9
|
const siteTitle = 'UltraModern.js 3.0';
|
|
9
10
|
const siteDescription =
|
|
10
11
|
'UltraModern.js 3.0 is a SuperApp framework forked from Modern.js for Effect, TanStack Router, SSR, BFF, and independently deployable Micro Verticals.';
|
|
11
12
|
const socialDescription =
|
|
12
13
|
'A SuperApp framework for Effect, TanStack Router, SSR, BFF, and Micro Verticals.';
|
|
13
|
-
const socialImage =
|
|
14
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/nuvjhpqnuvr/modern-website/banner.jpeg';
|
|
15
14
|
|
|
16
15
|
function normalizeBase(base = '/') {
|
|
17
16
|
const trimmed = base.trim();
|
|
@@ -23,6 +22,14 @@ function normalizeBase(base = '/') {
|
|
|
23
22
|
|
|
24
23
|
// Set by CI for GitHub Pages project sites. Defaults to root for local dev/custom domains.
|
|
25
24
|
const docsBase = normalizeBase(process.env.DOCS_BASE);
|
|
25
|
+
const docsOrigin = (
|
|
26
|
+
process.env.DOCS_ORIGIN || 'https://bleedingdev.github.io'
|
|
27
|
+
).replace(/\/+$/, '');
|
|
28
|
+
const siteUrl = new URL(docsBase, `${docsOrigin}/`).toString();
|
|
29
|
+
const socialImage = new URL('img/social-card.svg', siteUrl).toString();
|
|
30
|
+
const faviconUrl = new URL('img/favicon.ico', siteUrl).toString();
|
|
31
|
+
const docsAsset = (assetPath: string) =>
|
|
32
|
+
`${docsBase}${assetPath.replace(/^\//, '')}`;
|
|
26
33
|
|
|
27
34
|
export default defineConfig({
|
|
28
35
|
root: docPath,
|
|
@@ -30,8 +37,8 @@ export default defineConfig({
|
|
|
30
37
|
title: siteTitle,
|
|
31
38
|
description: siteDescription,
|
|
32
39
|
base: docsBase,
|
|
33
|
-
logo: '
|
|
34
|
-
icon:
|
|
40
|
+
logo: docsAsset('/img/logo.svg'),
|
|
41
|
+
icon: faviconUrl,
|
|
35
42
|
lang: 'en',
|
|
36
43
|
themeDir: path.join(__dirname, 'src'),
|
|
37
44
|
markdown: {
|
|
@@ -121,6 +128,11 @@ export default defineConfig({
|
|
|
121
128
|
output: {
|
|
122
129
|
dataUriLimit: 0,
|
|
123
130
|
},
|
|
131
|
+
server: {
|
|
132
|
+
publicDir: {
|
|
133
|
+
name: staticPath,
|
|
134
|
+
},
|
|
135
|
+
},
|
|
124
136
|
dev: {
|
|
125
137
|
lazyCompilation: process.env.LAZY !== 'false',
|
|
126
138
|
},
|
|
@@ -139,7 +151,7 @@ export default defineConfig({
|
|
|
139
151
|
// While site name is site wide
|
|
140
152
|
siteName: siteTitle,
|
|
141
153
|
type: 'website',
|
|
142
|
-
url:
|
|
154
|
+
url: siteUrl,
|
|
143
155
|
image: socialImage,
|
|
144
156
|
description: socialDescription,
|
|
145
157
|
twitter: {
|
|
@@ -81,15 +81,15 @@ export default function Footer() {
|
|
|
81
81
|
items: [
|
|
82
82
|
{
|
|
83
83
|
label: t('changelog'),
|
|
84
|
-
to: 'https://github.com/
|
|
84
|
+
to: 'https://github.com/BleedingDev/ultramodern.js/releases',
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
87
|
label: 'GitHub Issues',
|
|
88
|
-
to: 'https://github.com/
|
|
88
|
+
to: 'https://github.com/BleedingDev/ultramodern.js/issues',
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
label: t('githubDiscussion'),
|
|
92
|
-
to: 'https://github.com/
|
|
92
|
+
to: 'https://github.com/BleedingDev/ultramodern.js/discussions',
|
|
93
93
|
},
|
|
94
94
|
],
|
|
95
95
|
},
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
.titleWrap {
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
|
-
background-image:
|
|
5
|
-
|
|
4
|
+
background-image: linear-gradient(
|
|
5
|
+
90deg,
|
|
6
|
+
rgba(20, 184, 166, 0.36),
|
|
7
|
+
rgba(14, 165, 233, 0.18) 58%,
|
|
8
|
+
transparent
|
|
9
|
+
);
|
|
10
|
+
background-size: min(374px, 100%) 32.7px;
|
|
6
11
|
background-repeat: no-repeat;
|
|
7
12
|
}
|
|
8
13
|
.title {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { withBase } from '@rspress/core/runtime';
|
|
2
2
|
|
|
3
3
|
export type ShowcaseType = 'framework' | 'builder' | 'doc' | 'module';
|
|
4
4
|
|
|
@@ -10,92 +10,50 @@ export type ShowcaseItem = {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
export const useShowcases = (): ShowcaseItem[] => {
|
|
13
|
-
const
|
|
13
|
+
const preview = (name: string) => withBase(`/img/features/${name}.svg`);
|
|
14
14
|
|
|
15
15
|
return [
|
|
16
16
|
{
|
|
17
|
-
name: '
|
|
18
|
-
url: 'https://
|
|
19
|
-
preview:
|
|
20
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/tiktok-seller-showcase-08172.png',
|
|
17
|
+
name: 'UltraModern.js',
|
|
18
|
+
url: 'https://bleedingdev.github.io/ultramodern.js/',
|
|
19
|
+
preview: preview('framework'),
|
|
21
20
|
type: 'framework',
|
|
22
21
|
},
|
|
23
22
|
{
|
|
24
|
-
name: '
|
|
25
|
-
url: 'https://
|
|
26
|
-
preview:
|
|
27
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/tiktok-steamer-showcase-08172.png',
|
|
23
|
+
name: 'Effect',
|
|
24
|
+
url: 'https://effect.website/',
|
|
25
|
+
preview: preview('api'),
|
|
28
26
|
type: 'framework',
|
|
29
27
|
},
|
|
30
28
|
{
|
|
31
|
-
name: '
|
|
32
|
-
url: 'https://
|
|
33
|
-
preview:
|
|
34
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/tiktok-shop-partner-0817.png',
|
|
35
|
-
type: 'framework',
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: t('doubao'),
|
|
39
|
-
url: 'https://www.doubao.com/',
|
|
40
|
-
preview:
|
|
41
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/doubao-showcase-0817.png',
|
|
42
|
-
type: 'framework',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: t('volctrans'),
|
|
46
|
-
url: 'https://translate.volcengine.com/',
|
|
47
|
-
preview:
|
|
48
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/volctrans-0424.jpeg',
|
|
49
|
-
type: 'framework',
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: t('writingo'),
|
|
53
|
-
url: 'https://writingo.net/',
|
|
54
|
-
preview:
|
|
55
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/writingo-0424.jpeg',
|
|
29
|
+
name: 'TanStack Router',
|
|
30
|
+
url: 'https://tanstack.com/router',
|
|
31
|
+
preview: preview('url'),
|
|
56
32
|
type: 'framework',
|
|
57
33
|
},
|
|
58
34
|
{
|
|
59
35
|
name: 'Rspack',
|
|
60
36
|
url: 'https://rspack.rs/',
|
|
61
|
-
preview:
|
|
62
|
-
|
|
37
|
+
preview: preview('compiler'),
|
|
38
|
+
type: 'builder',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'Rspress',
|
|
42
|
+
url: 'https://rspress.rs/',
|
|
43
|
+
preview: preview('visual'),
|
|
63
44
|
type: 'doc',
|
|
64
45
|
},
|
|
65
46
|
{
|
|
66
47
|
name: 'Modern.js',
|
|
67
48
|
url: 'https://modernjs.dev/en/',
|
|
68
|
-
preview:
|
|
69
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/modernjs-dev-0425.jpeg',
|
|
49
|
+
preview: preview('app'),
|
|
70
50
|
type: 'doc',
|
|
71
51
|
},
|
|
72
52
|
{
|
|
73
|
-
name:
|
|
74
|
-
url: 'https://
|
|
75
|
-
preview:
|
|
76
|
-
|
|
77
|
-
type: 'framework',
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: t('xiaohe'),
|
|
81
|
-
url: 'https://xiaohe.cn/',
|
|
82
|
-
preview:
|
|
83
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/xiaohe-0424.png',
|
|
84
|
-
type: 'framework',
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
name: t('dongchedi'),
|
|
88
|
-
url: 'https://m.dcdapp.com/motor/feoffline/usedcar_channel/channel.html',
|
|
89
|
-
preview:
|
|
90
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/dongchedi-0425.png',
|
|
91
|
-
type: 'builder',
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
name: t('volcengineDeveloper'),
|
|
95
|
-
url: 'https://developer.volcengine.com/',
|
|
96
|
-
preview:
|
|
97
|
-
'https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/showcase/developer-volcengine-0425.png',
|
|
98
|
-
type: 'framework',
|
|
53
|
+
name: 'Module Federation',
|
|
54
|
+
url: 'https://module-federation.io/',
|
|
55
|
+
preview: preview('frameworks'),
|
|
56
|
+
type: 'module',
|
|
99
57
|
},
|
|
100
58
|
];
|
|
101
59
|
};
|
package/src/i18n/enUS.ts
CHANGED
|
@@ -43,13 +43,4 @@ export const EN_US = {
|
|
|
43
43
|
pluginSystem: 'Plugin System',
|
|
44
44
|
githubDiscussion: 'Github Discussion',
|
|
45
45
|
changelog: 'Changelog',
|
|
46
|
-
|
|
47
|
-
// Showcases
|
|
48
|
-
doubao: 'Doubao',
|
|
49
|
-
writingo: 'Writingo',
|
|
50
|
-
volctrans: 'Volctrans',
|
|
51
|
-
shidianbaike: 'Shidian Baike',
|
|
52
|
-
xiaohe: 'Xiaohe',
|
|
53
|
-
dongchedi: 'Dongchedi',
|
|
54
|
-
volcengineDeveloper: 'Volcengine Developer',
|
|
55
46
|
} as const;
|
package/src/i18n/zhCN.ts
CHANGED
|
@@ -42,13 +42,4 @@ export const ZH_CN: Record<keyof typeof EN_US, string> = {
|
|
|
42
42
|
pluginSystem: '插件系统',
|
|
43
43
|
githubDiscussion: 'Github 讨论区',
|
|
44
44
|
changelog: '更新日志',
|
|
45
|
-
|
|
46
|
-
// Showcase
|
|
47
|
-
doubao: '豆包',
|
|
48
|
-
writingo: '火山写作',
|
|
49
|
-
volctrans: '火山翻译',
|
|
50
|
-
shidianbaike: '识典百科',
|
|
51
|
-
xiaohe: '小荷健康',
|
|
52
|
-
dongchedi: '懂车帝',
|
|
53
|
-
volcengineDeveloper: '火山引擎开发者社区',
|
|
54
45
|
};
|
|
@@ -7,7 +7,7 @@ const PublicPage = (): JSX.Element => (
|
|
|
7
7
|
<link
|
|
8
8
|
rel="icon"
|
|
9
9
|
type="image/x-icon"
|
|
10
|
-
href="https://
|
|
10
|
+
href="https://bleedingdev.github.io/ultramodern.js/img/favicon.ico"
|
|
11
11
|
/>
|
|
12
12
|
</Helmet>
|
|
13
13
|
<h3>Public</h3>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="220" height="48" viewBox="0 0 220 48" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">UltraModern.js</title>
|
|
3
|
+
<rect width="48" height="48" rx="12" fill="#0f172a"/>
|
|
4
|
+
<path fill="#14b8a6" d="M13 13h7v13c0 5 2.6 8 7 8s7-3 7-8V13h7v13c0 8.8-5.6 14-14 14s-14-5.2-14-14V13z"/>
|
|
5
|
+
<path fill="#38bdf8" d="M31 13h8v27h-8V13z"/>
|
|
6
|
+
<text x="60" y="31" fill="#0f172a" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="23" font-weight="700">UltraModern.js</text>
|
|
7
|
+
</svg>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1200" height="630" viewBox="0 0 1200 630" role="img" aria-labelledby="title desc">
|
|
2
|
+
<title id="title">UltraModern.js 3.0</title>
|
|
3
|
+
<desc id="desc">A SuperApp framework for Effect, TanStack Router, SSR, BFF, and Micro Verticals.</desc>
|
|
4
|
+
<rect width="1200" height="630" fill="#0f172a"/>
|
|
5
|
+
<path fill="#14b8a6" opacity=".22" d="M0 360c180-92 330-116 498-48 173 70 310 61 480-22 77-38 149-58 222-62v402H0V360z"/>
|
|
6
|
+
<path fill="#38bdf8" opacity=".18" d="M0 438c160-54 316-49 468 15 160 67 337 67 531 0 74-26 141-39 201-40v217H0V438z"/>
|
|
7
|
+
<rect x="86" y="90" width="96" height="96" rx="24" fill="#020617"/>
|
|
8
|
+
<path fill="#14b8a6" d="M111 116h15v35c0 13 7 21 18 21s18-8 18-21v-35h15v35c0 22-13 35-33 35s-33-13-33-35v-35z"/>
|
|
9
|
+
<path fill="#38bdf8" d="M157 116h18v70h-18v-70z"/>
|
|
10
|
+
<text x="86" y="284" fill="#f8fafc" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="76" font-weight="800">UltraModern.js 3.0</text>
|
|
11
|
+
<text x="90" y="360" fill="#cbd5e1" font-family="Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif" font-size="35" font-weight="500">Effect, TanStack Router, SSR, BFF, and Micro Verticals.</text>
|
|
12
|
+
</svg>
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
- **Type:** `boolean | { enabled?: boolean; disableClientServer?: boolean; reportDir?: string; mode?: 'normal' | 'brief' | 'lite' }`
|
|
2
|
-
- **Default:** enabled in production build, disabled in development build
|
|
3
|
-
|
|
4
|
-
Configure [Rsdoctor](https://rsdoctor.dev/) diagnostics for build.
|
|
5
|
-
|
|
6
|
-
- This config only takes effect when using the Rspack provider.
|
|
7
|
-
- `disableClientServer` defaults to `true` to avoid hanging the build process after report generation.
|
|
8
|
-
- `reportDir` lets you move diagnostics artifacts to a deterministic directory.
|
|
9
|
-
- `mode` controls RsDoctor report mode (`normal`, `brief`, `lite`).
|
|
10
|
-
- Modern.js writes a machine-readable diagnostics contract artifact to:
|
|
11
|
-
- `<reportDir or outputPath>/.rsdoctor/ultramodern-diagnostics.json`
|
|
12
|
-
- This contract points coding agents and tools to `.rsdoctor/manifest.json`.
|
|
13
|
-
|
|
14
|
-
### Example
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
export default {
|
|
18
|
-
performance: {
|
|
19
|
-
rsdoctor: {
|
|
20
|
-
enabled: true,
|
|
21
|
-
disableClientServer: true,
|
|
22
|
-
reportDir: './artifacts',
|
|
23
|
-
mode: 'brief',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
You can also use a boolean:
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
export default {
|
|
33
|
-
performance: {
|
|
34
|
-
rsdoctor: false,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
```
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
- **类型:** `boolean | { enabled?: boolean; disableClientServer?: boolean; reportDir?: string; mode?: 'normal' | 'brief' | 'lite' }`
|
|
2
|
-
- **默认值:** 生产构建默认开启,开发构建默认关闭
|
|
3
|
-
|
|
4
|
-
用于配置 [Rsdoctor](https://rsdoctor.dev/) 构建诊断。
|
|
5
|
-
|
|
6
|
-
- 该配置仅在使用 Rspack provider 时生效。
|
|
7
|
-
- `disableClientServer` 默认值为 `true`,用于避免报告生成后构建进程不退出。
|
|
8
|
-
- `reportDir` 可将诊断产物输出到确定的目录。
|
|
9
|
-
- `mode` 用于控制 RsDoctor 报告模式(`normal`、`brief`、`lite`)。
|
|
10
|
-
- Modern.js 会额外生成机器可读诊断契约文件:
|
|
11
|
-
- `<reportDir 或 outputPath>/.rsdoctor/ultramodern-diagnostics.json`
|
|
12
|
-
- 该文件可指向 `.rsdoctor/manifest.json`,便于开发者工具与编码代理稳定消费。
|
|
13
|
-
|
|
14
|
-
### 示例
|
|
15
|
-
|
|
16
|
-
```js
|
|
17
|
-
export default {
|
|
18
|
-
performance: {
|
|
19
|
-
rsdoctor: {
|
|
20
|
-
enabled: true,
|
|
21
|
-
disableClientServer: true,
|
|
22
|
-
reportDir: './artifacts',
|
|
23
|
-
mode: 'brief',
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
也可以直接使用布尔值:
|
|
30
|
-
|
|
31
|
-
```js
|
|
32
|
-
export default {
|
|
33
|
-
performance: {
|
|
34
|
-
rsdoctor: false,
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
```
|