@bleedingdev/modern-js-main-doc 3.5.0-ultramodern.1 → 3.5.0-ultramodern.11
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/configure/app/bff/effect.mdx +16 -4
- package/docs/en/configure/app/performance/build-cache.mdx +5 -0
- package/docs/en/guides/get-started/ultramodern.mdx +19 -13
- package/docs/zh/configure/app/bff/effect.mdx +15 -4
- package/docs/zh/configure/app/performance/build-cache.mdx +4 -0
- package/docs/zh/guides/get-started/ultramodern.mdx +16 -11
- package/package.json +7 -7
|
@@ -197,18 +197,30 @@ The generated `api.client.*` API only exists for loader-materialized `@api/index
|
|
|
197
197
|
## Effect cohort
|
|
198
198
|
|
|
199
199
|
UltraModern-generated workspaces pin the framework-compatible Effect cohort
|
|
200
|
-
through `pnpm-workspace.yaml` overrides. For `3.5.0-ultramodern.
|
|
200
|
+
through `pnpm-workspace.yaml` overrides. For `3.5.0-ultramodern.10`, generated
|
|
201
201
|
apps use:
|
|
202
202
|
|
|
203
203
|
```yaml
|
|
204
|
+
minimumReleaseAgeExclude:
|
|
205
|
+
- 'effect@4.0.0-beta.91'
|
|
206
|
+
- '@effect/opentelemetry@4.0.0-beta.91'
|
|
207
|
+
|
|
208
|
+
trustPolicyExclude:
|
|
209
|
+
- 'effect@4.0.0-beta.91'
|
|
210
|
+
- '@effect/opentelemetry@4.0.0-beta.91'
|
|
211
|
+
|
|
204
212
|
overrides:
|
|
205
|
-
'@effect/vitest': 4.0.0-beta.
|
|
206
|
-
effect: 4.0.0-beta.
|
|
213
|
+
'@effect/vitest': 4.0.0-beta.91
|
|
214
|
+
effect: 4.0.0-beta.91
|
|
207
215
|
```
|
|
208
216
|
|
|
209
217
|
Do not add a different direct `effect` version in an app package. A mismatched
|
|
210
218
|
Effect beta can fail while building layers or HTTP middleware because runtime
|
|
211
|
-
services come from different package instances.
|
|
219
|
+
services come from different package instances. Keep the generated
|
|
220
|
+
policy exclusion entries with the same Effect cohort; they handle the
|
|
221
|
+
framework-selected Effect beta versions before the 24-hour maturity window and
|
|
222
|
+
the `effect`/`@effect/opentelemetry` trusted-publisher to provenance metadata
|
|
223
|
+
transition without weakening UltraModern API architecture checks.
|
|
212
224
|
|
|
213
225
|
## Contract tests
|
|
214
226
|
|
|
@@ -28,6 +28,11 @@ type BuildCacheConfig =
|
|
|
28
28
|
|
|
29
29
|
Controls the caching behavior during the build process.
|
|
30
30
|
|
|
31
|
+
When persistent Rspack cache is enabled, Modern.js treats `cacheDirectory` as a
|
|
32
|
+
base directory and stores each Rsbuild/Rspack environment in its own child
|
|
33
|
+
directory, such as `client`, `server`, or `workerSSR`. This avoids concurrent
|
|
34
|
+
environment compilers writing to the same filesystem cache root.
|
|
35
|
+
|
|
31
36
|
Modern.js will enable build cache by default to improve the compile speed. You can disable the build cache by setting it to `false`:
|
|
32
37
|
|
|
33
38
|
```js
|
|
@@ -78,33 +78,39 @@ mise exec -- pnpm check
|
|
|
78
78
|
mise exec -- pnpm build
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
Strict generated API migration requires `3.5.0-ultramodern.
|
|
81
|
+
Strict generated API migration requires `3.5.0-ultramodern.10` or newer.
|
|
82
82
|
`3.4.0-ultramodern.20` and earlier cohorts do not include this full direct
|
|
83
83
|
`api/index.ts` generator, generated `.mts` checks, strict Oxlint boundary rule
|
|
84
84
|
set, Effect cohort overrides, and strict Effect migration command. Agents that
|
|
85
85
|
cannot install that BleedingDev cohort yet should use the local Modern.js
|
|
86
|
-
workspace for migration validation; otherwise pin `3.5.0-ultramodern.
|
|
86
|
+
workspace for migration validation; otherwise pin `3.5.0-ultramodern.10` or
|
|
87
87
|
newer with `--ultramodern-package-version`.
|
|
88
88
|
|
|
89
89
|
Before hand-editing package aliases or generated metadata, run the framework
|
|
90
90
|
migration command from the target workspace:
|
|
91
91
|
|
|
92
92
|
```bash
|
|
93
|
-
pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.
|
|
94
|
-
migrate-strict-effect --version 3.5.0-ultramodern.
|
|
93
|
+
pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.10 ultramodern \
|
|
94
|
+
migrate-strict-effect --version 3.5.0-ultramodern.10
|
|
95
95
|
pnpm api:check
|
|
96
96
|
pnpm contract:check
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
The command updates `.modernjs/ultramodern.json`, root
|
|
100
|
-
`modernjs.packageSource`, generated Modern package aliases,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
`modernjs.packageSource`, generated Modern package aliases, framework-owned
|
|
101
|
+
toolchain pins, direct topology API metadata, strict Effect pnpm
|
|
102
|
+
overrides/trust policy, and the pnpm lockfile. Remaining failures are source
|
|
103
|
+
migration work: move code to `shared/api.ts`, `api/index.ts`, and
|
|
104
|
+
`src/api/*-client.ts`, then delete `api/effect`, `api/lambda`, `shared/effect`,
|
|
105
|
+
and `src/effect`.
|
|
104
106
|
|
|
105
107
|
Generated strict Effect workspaces pin the compatible Effect cohort with pnpm
|
|
106
|
-
overrides: `effect@4.0.0-beta.
|
|
107
|
-
add app-local direct Effect versions that disagree with those overrides.
|
|
108
|
+
overrides: `effect@4.0.0-beta.91` and `@effect/vitest@4.0.0-beta.91`. Do not
|
|
109
|
+
add app-local direct Effect versions that disagree with those overrides. They
|
|
110
|
+
also carry generated pnpm policy exclusions for `effect@4.0.0-beta.91` and
|
|
111
|
+
`@effect/opentelemetry@4.0.0-beta.91` so the framework-selected Effect beta
|
|
112
|
+
cohort is not blocked by the 24-hour age gate or trusted-publisher to
|
|
113
|
+
provenance metadata transition.
|
|
108
114
|
|
|
109
115
|
Gradual migration means old, unmigrated Modern.js apps can keep their existing
|
|
110
116
|
runtime until they are converted. Once a surface is generated or migrated as
|
|
@@ -183,9 +189,9 @@ instead of patching generated output by hand.
|
|
|
183
189
|
Cloudflare D1 bindings are first-class on `deploy.worker.d1Databases`; use that
|
|
184
190
|
config instead of app-local postprocessing when a generated app owns D1
|
|
185
191
|
migrations. Cloudflare public output excludes server-only `api` and `shared`
|
|
186
|
-
directories by default, and generated Modern/Rspack caches are isolated per app
|
|
187
|
-
|
|
188
|
-
same
|
|
192
|
+
directories by default, and generated Modern/Rspack caches are isolated per app,
|
|
193
|
+
build target, and Rspack environment so local `build`, `cloudflare:build`, and
|
|
194
|
+
multi-environment compilers do not share the same filesystem cache directory.
|
|
189
195
|
|
|
190
196
|
## Human Workflow
|
|
191
197
|
|
|
@@ -195,16 +195,27 @@ export default defineConfig({
|
|
|
195
195
|
## Effect 版本组
|
|
196
196
|
|
|
197
197
|
UltraModern 生成的 workspace 会通过 `pnpm-workspace.yaml` overrides 锁定与框架兼容的
|
|
198
|
-
Effect 版本组。`3.5.0-ultramodern.
|
|
198
|
+
Effect 版本组。`3.5.0-ultramodern.10` 使用:
|
|
199
199
|
|
|
200
200
|
```yaml
|
|
201
|
+
minimumReleaseAgeExclude:
|
|
202
|
+
- 'effect@4.0.0-beta.91'
|
|
203
|
+
- '@effect/opentelemetry@4.0.0-beta.91'
|
|
204
|
+
|
|
205
|
+
trustPolicyExclude:
|
|
206
|
+
- 'effect@4.0.0-beta.91'
|
|
207
|
+
- '@effect/opentelemetry@4.0.0-beta.91'
|
|
208
|
+
|
|
201
209
|
overrides:
|
|
202
|
-
'@effect/vitest': 4.0.0-beta.
|
|
203
|
-
effect: 4.0.0-beta.
|
|
210
|
+
'@effect/vitest': 4.0.0-beta.91
|
|
211
|
+
effect: 4.0.0-beta.91
|
|
204
212
|
```
|
|
205
213
|
|
|
206
214
|
不要在应用包里添加不同版本的直接 `effect` 依赖。Effect beta 不一致时,Layer 或 HTTP
|
|
207
|
-
middleware 构建可能因为运行时 service
|
|
215
|
+
middleware 构建可能因为运行时 service 来自不同包实例而失败。保留生成的 policy
|
|
216
|
+
exclusion 条目并让它跟随同一个 Effect 版本组;它用于处理框架选定 Effect beta 版本在
|
|
217
|
+
24 小时成熟期内的安装,以及 `effect` 和 `@effect/opentelemetry` 从 trusted-publisher
|
|
218
|
+
metadata 迁移到 provenance attestation 时的 pnpm no-downgrade 检查。
|
|
208
219
|
|
|
209
220
|
## 契约测试
|
|
210
221
|
|
|
@@ -28,6 +28,10 @@ type BuildCacheConfig =
|
|
|
28
28
|
|
|
29
29
|
控制 Modern.js 在构建过程中的缓存行为。
|
|
30
30
|
|
|
31
|
+
启用 Rspack 持久化缓存时,Modern.js 会把 `cacheDirectory` 视为基础目录,并为每个
|
|
32
|
+
Rsbuild/Rspack environment 写入独立子目录,例如 `client`、`server` 或
|
|
33
|
+
`workerSSR`。这样可以避免并发 environment compiler 写入同一个文件系统 cache 根目录。
|
|
34
|
+
|
|
31
35
|
在构建时,Modern.js 默认会开启构建缓存来提升二次构建的速度。如果不希望缓存,你可以将 `buildCache` 置为 `false` 将其禁用掉:
|
|
32
36
|
|
|
33
37
|
```js
|
|
@@ -71,30 +71,34 @@ mise exec -- pnpm check
|
|
|
71
71
|
mise exec -- pnpm build
|
|
72
72
|
```
|
|
73
73
|
|
|
74
|
-
严格生成 API 迁移要求 `3.5.0-ultramodern.
|
|
74
|
+
严格生成 API 迁移要求 `3.5.0-ultramodern.10` 或更新版本。
|
|
75
75
|
`3.4.0-ultramodern.20` 及更早 cohort 还没有这套完整的直接
|
|
76
76
|
`api/index.ts` 生成器、生成的 `.mts` 检查、严格 Oxlint 边界规则、Effect 版本组
|
|
77
77
|
overrides 和严格 Effect 迁移命令。还不能安装该 BleedingDev cohort 的 agent 应使用本地
|
|
78
78
|
Modern.js workspace 做迁移校验;否则用 `--ultramodern-package-version` 固定
|
|
79
|
-
`3.5.0-ultramodern.
|
|
79
|
+
`3.5.0-ultramodern.10` 或更新版本。
|
|
80
80
|
|
|
81
81
|
手写 package alias 或生成 metadata 之前,先在目标 workspace 运行框架迁移命令:
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
|
-
pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.
|
|
85
|
-
migrate-strict-effect --version 3.5.0-ultramodern.
|
|
84
|
+
pnpm dlx @bleedingdev/modern-js-create@3.5.0-ultramodern.10 ultramodern \
|
|
85
|
+
migrate-strict-effect --version 3.5.0-ultramodern.10
|
|
86
86
|
pnpm api:check
|
|
87
87
|
pnpm contract:check
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
该命令会更新 `.modernjs/ultramodern.json`、根 `modernjs.packageSource`、生成的
|
|
91
|
-
Modern package alias、直接 topology API metadata
|
|
92
|
-
|
|
93
|
-
`api
|
|
91
|
+
Modern package alias、框架拥有的 toolchain pin、直接 topology API metadata、严格 Effect
|
|
92
|
+
pnpm overrides/trust policy 和 pnpm lockfile。剩余失败就是源码迁移:把代码移到
|
|
93
|
+
`shared/api.ts`、`api/index.ts` 和 `src/api/*-client.ts`,再删除 `api/effect`、
|
|
94
|
+
`api/lambda`、`shared/effect` 和 `src/effect`。
|
|
94
95
|
|
|
95
96
|
严格 Effect 生成 workspace 会通过 pnpm overrides 固定兼容版本组:
|
|
96
|
-
`effect@4.0.0-beta.
|
|
97
|
-
overrides 冲突的 app 本地直接 Effect
|
|
97
|
+
`effect@4.0.0-beta.91` 和 `@effect/vitest@4.0.0-beta.91`。不要添加与这些
|
|
98
|
+
overrides 冲突的 app 本地直接 Effect 版本。生成的 pnpm policy 还会为
|
|
99
|
+
`effect@4.0.0-beta.91` 和 `@effect/opentelemetry@4.0.0-beta.91` 添加例外,避免框架选定的
|
|
100
|
+
Effect beta 版本组被 24 小时成熟期检查,或从 trusted-publisher metadata 迁移到
|
|
101
|
+
provenance attestation 时被 no-downgrade 检查误拦截。
|
|
98
102
|
|
|
99
103
|
渐进迁移意味着尚未迁移的旧 Modern.js app 可以保留现有 runtime,直到被转换为
|
|
100
104
|
UltraModern。一个 surface 一旦生成为或迁移为 UltraModern HTTP API,就只能使用
|
|
@@ -157,8 +161,9 @@ Federation 冲突,都应在对应归属文件中修复,不要手写补丁覆
|
|
|
157
161
|
|
|
158
162
|
Cloudflare D1 绑定使用一等配置 `deploy.worker.d1Databases`;生成 app 拥有 D1
|
|
159
163
|
migration 时不要再用 app 本地 postprocess。Cloudflare public output 默认排除服务端
|
|
160
|
-
`api` 和 `shared` 目录,并且生成的 Modern/Rspack cache 会按 app
|
|
161
|
-
|
|
164
|
+
`api` 和 `shared` 目录,并且生成的 Modern/Rspack cache 会按 app、构建目标和 Rspack
|
|
165
|
+
environment 隔离,避免本地 `build`、`cloudflare:build` 以及多 environment compiler
|
|
166
|
+
共享同一个文件系统 cache 目录。
|
|
162
167
|
|
|
163
168
|
## 人类工作流
|
|
164
169
|
|
package/package.json
CHANGED
|
@@ -19,24 +19,24 @@
|
|
|
19
19
|
"modern.js",
|
|
20
20
|
"ultramodern.js"
|
|
21
21
|
],
|
|
22
|
-
"version": "3.5.0-ultramodern.
|
|
22
|
+
"version": "3.5.0-ultramodern.11",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"registry": "https://registry.npmjs.org/",
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"mermaid": "^11.
|
|
29
|
-
"@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.5.0-ultramodern.
|
|
28
|
+
"mermaid": "^11.16.0",
|
|
29
|
+
"@modern-js/sandpack-react": "npm:@bleedingdev/modern-js-sandpack-react@3.5.0-ultramodern.11"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@rsbuild/plugin-sass": "2.0.0",
|
|
33
|
-
"@rspress/core": "2.0.
|
|
34
|
-
"@rspress/plugin-llms": "2.0.
|
|
35
|
-
"@rspress/shared": "2.0.
|
|
33
|
+
"@rspress/core": "2.0.15",
|
|
34
|
+
"@rspress/plugin-llms": "2.0.15",
|
|
35
|
+
"@rspress/shared": "2.0.15",
|
|
36
36
|
"@shikijs/transformers": "^4.3.0",
|
|
37
37
|
"@types/fs-extra": "11.0.4",
|
|
38
38
|
"@types/node": "^26.0.1",
|
|
39
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
39
|
+
"@typescript/native-preview": "7.0.0-dev.20260628.1",
|
|
40
40
|
"classnames": "^2.5.1",
|
|
41
41
|
"clsx": "^2.1.1",
|
|
42
42
|
"fs-extra": "^11.3.5",
|