@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.99 → 3.8.1-ultramodern.1

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.
Files changed (411) hide show
  1. package/bin/modern-bundle-docs.js +7 -0
  2. package/dist/cjs/builder/generator/getBuilderEnvironments.js +73 -11
  3. package/dist/cjs/bundleDocs.js +114 -0
  4. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +1 -1
  5. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +94 -18
  6. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
  7. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
  8. package/dist/cjs/ultramodern-release-envelope/framework-output.js +109 -57
  9. package/dist/esm/builder/generator/getBuilderEnvironments.mjs +63 -10
  10. package/dist/esm/bundleDocs.mjs +62 -0
  11. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
  12. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
  13. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
  14. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
  15. package/dist/esm/ultramodern-release-envelope/framework-output.mjs +107 -58
  16. package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +63 -10
  17. package/dist/esm-node/bundleDocs.mjs +63 -0
  18. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
  19. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
  20. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
  21. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
  22. package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +107 -58
  23. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +29 -0
  24. package/dist/types/bundleDocs.d.ts +20 -0
  25. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +1 -1
  26. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -1
  27. package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +13 -0
  28. package/dist/types/ultramodern-release-envelope/framework-output.d.ts +1 -0
  29. package/docs/apis/app/{commands.mdx → commands.md} +35 -9
  30. package/docs/apis/app/hooks/api/{lambda.mdx → lambda.md} +2 -6
  31. package/docs/apis/app/hooks/config/{favicon.mdx → favicon.md} +1 -6
  32. package/docs/apis/app/hooks/config/{html.mdx → html.md} +1 -5
  33. package/docs/apis/app/hooks/config/{icon.mdx → icon.md} +1 -6
  34. package/docs/apis/app/hooks/config/{mock.mdx → mock.md} +1 -5
  35. package/docs/apis/app/hooks/config/{public.mdx → public.md} +0 -4
  36. package/docs/apis/app/hooks/config/{upload.mdx → upload.md} +3 -7
  37. package/docs/apis/app/hooks/{modern-config.mdx → modern-config.md} +1 -5
  38. package/docs/apis/app/hooks/server/{server.mdx → server.md} +1 -6
  39. package/docs/apis/app/hooks/{shared.mdx → shared.md} +0 -4
  40. package/docs/apis/app/hooks/src/{app.mdx → app.md} +2 -2
  41. package/docs/apis/app/hooks/src/{entry.mdx → entry.md} +1 -6
  42. package/docs/apis/app/hooks/src/{entry.server.mdx → entry.server.md} +0 -5
  43. package/docs/apis/app/hooks/src/{modern.runtime.mdx → modern.runtime.md} +1 -5
  44. package/docs/apis/app/hooks/src/{routes.mdx → routes.md} +3 -7
  45. package/docs/apis/app/hooks/src/{server.mdx → server.md} +1 -5
  46. package/docs/apis/app/runtime/bff/{use-backend-context.mdx → use-backend-context.md} +0 -3
  47. package/docs/apis/app/runtime/core/{create-root.mdx → create-root.md} +0 -3
  48. package/docs/apis/app/runtime/core/{render.mdx → render.md} +1 -4
  49. package/docs/apis/app/runtime/core/{runtime-context.mdx → runtime-context.md} +0 -4
  50. package/docs/apis/app/runtime/router/{router.mdx → router.md} +1 -6
  51. package/docs/apis/app/runtime/ssr/{no-ssr.mdx → no-ssr.md} +0 -3
  52. package/docs/apis/app/runtime/ssr/{renderStreaming.mdx → renderStreaming.md} +0 -4
  53. package/docs/apis/app/runtime/ssr/{renderString.mdx → renderString.md} +0 -4
  54. package/docs/apis/app/runtime/ssr/{requestHandler.mdx → requestHandler.md} +0 -4
  55. package/docs/apis/app/runtime/utility/{css-in-js.mdx → css-in-js.md} +0 -4
  56. package/docs/apis/app/runtime/utility/{head.mdx → head.md} +0 -3
  57. package/docs/apis/app/runtime/utility/{loadable.mdx → loadable.md} +0 -3
  58. package/docs/community/blog/2022-0708-updates.md +91 -0
  59. package/docs/community/blog/2022-0910-updates.md +76 -0
  60. package/docs/community/blog/overview.md +63 -0
  61. package/docs/community/blog/v2-release-note.md +238 -0
  62. package/docs/community/blog/v3-release-note.md +622 -0
  63. package/docs/community/contributing-guide.md +252 -0
  64. package/docs/community/releases.md +23 -0
  65. package/docs/community/showcase.md +24 -0
  66. package/docs/community/team.md +14 -0
  67. package/docs/configure/app/bff/{cross-project.mdx → cross-project.md} +4 -8
  68. package/docs/configure/app/bff/{effect.mdx → effect.md} +16 -22
  69. package/docs/configure/app/bff/{prefix.mdx → prefix.md} +3 -7
  70. package/docs/configure/app/bff/{runtime-framework.mdx → runtime-framework.md} +3 -7
  71. package/docs/configure/app/{builder-plugins.mdx → builder-plugins.md} +4 -8
  72. package/docs/configure/app/dev/{asset-prefix.mdx → asset-prefix.md} +4 -9
  73. package/docs/configure/app/dev/{before-start-url.mdx → before-start-url.md} +0 -4
  74. package/docs/configure/app/dev/{client.mdx → client.md} +3 -7
  75. package/docs/configure/app/dev/hmr.md +10 -0
  76. package/docs/configure/app/dev/{host.mdx → host.md} +0 -4
  77. package/docs/configure/app/dev/{https.mdx → https.md} +0 -4
  78. package/docs/configure/app/dev/{lazy-compilation.mdx → lazy-compilation.md} +2 -8
  79. package/docs/configure/app/dev/live-reload.md +10 -0
  80. package/docs/configure/app/dev/{mock-dir.mdx → mock-dir.md} +0 -4
  81. package/docs/configure/app/dev/progress-bar.md +19 -0
  82. package/docs/configure/app/dev/{server.mdx → server.md} +0 -4
  83. package/docs/configure/app/dev/{setup-middlewares.mdx → setup-middlewares.md} +3 -7
  84. package/docs/configure/app/dev/{start-url.mdx → start-url.md} +0 -5
  85. package/docs/configure/app/dev/{watch-files.mdx → watch-files.md} +3 -7
  86. package/docs/configure/app/dev/{write-to-disk.mdx → write-to-disk.md} +3 -7
  87. package/docs/configure/app/experiments/{source-build.mdx → source-build.md} +1 -3
  88. package/docs/configure/app/html/{app-icon.mdx → app-icon.md} +3 -7
  89. package/docs/configure/app/html/{crossorigin.mdx → crossorigin.md} +3 -7
  90. package/docs/configure/app/html/{favicon.mdx → favicon.md} +3 -7
  91. package/docs/configure/app/html/inject.md +10 -0
  92. package/docs/configure/app/html/{meta.mdx → meta.md} +3 -7
  93. package/docs/configure/app/html/{mount-id.mdx → mount-id.md} +3 -7
  94. package/docs/configure/app/html/output-structure.md +10 -0
  95. package/docs/configure/app/html/script-loading.md +10 -0
  96. package/docs/configure/app/html/{tags.mdx → tags.md} +3 -7
  97. package/docs/configure/app/html/{template-parameters.mdx → template-parameters.md} +3 -7
  98. package/docs/configure/app/html/template.md +10 -0
  99. package/docs/configure/app/html/title.md +18 -0
  100. package/docs/configure/app/output/asset-prefix.md +11 -0
  101. package/docs/configure/app/output/{assets-retry.mdx → assets-retry.md} +1 -5
  102. package/docs/configure/app/output/{charset.mdx → charset.md} +3 -7
  103. package/docs/configure/app/output/{clean-dist-path.mdx → clean-dist-path.md} +0 -4
  104. package/docs/configure/app/output/{convert-to-rem.mdx → convert-to-rem.md} +12 -16
  105. package/docs/configure/app/output/{copy.mdx → copy.md} +3 -7
  106. package/docs/configure/app/output/{css-modules.mdx → css-modules.md} +3 -7
  107. package/docs/configure/app/output/{data-uri-limit.mdx → data-uri-limit.md} +3 -7
  108. package/docs/configure/app/output/{disable-css-module-extension.mdx → disable-css-module-extension.md} +3 -7
  109. package/docs/configure/app/output/{disable-inline-runtime-chunk.mdx → disable-inline-runtime-chunk.md} +0 -4
  110. package/docs/configure/app/output/{disable-svgr.mdx → disable-svgr.md} +0 -4
  111. package/docs/configure/app/output/{disable-ts-checker.mdx → disable-ts-checker.md} +0 -4
  112. package/docs/configure/app/output/{dist-path.mdx → dist-path.md} +3 -11
  113. package/docs/configure/app/output/{enable-asset-manifest.mdx → enable-asset-manifest.md} +0 -4
  114. package/docs/configure/app/output/{enable-css-module-tsdeclaration.mdx → enable-css-module-tsdeclaration.md} +0 -4
  115. package/docs/configure/app/output/{enable-inline-route-manifests.mdx → enable-inline-route-manifests.md} +0 -4
  116. package/docs/configure/app/output/{externals.mdx → externals.md} +3 -7
  117. package/docs/configure/app/output/filename-hash.md +10 -0
  118. package/docs/configure/app/output/{filename.mdx → filename.md} +3 -7
  119. package/docs/configure/app/output/inject-styles.md +10 -0
  120. package/docs/configure/app/output/{inline-scripts.mdx → inline-scripts.md} +4 -8
  121. package/docs/configure/app/output/{inline-styles.mdx → inline-styles.md} +4 -8
  122. package/docs/configure/app/output/{legal-comments.mdx → legal-comments.md} +3 -7
  123. package/docs/configure/app/output/{minify.mdx → minify.md} +3 -7
  124. package/docs/configure/app/output/{override-browserslist.mdx → override-browserslist.md} +4 -8
  125. package/docs/configure/app/output/polyfill.md +12 -0
  126. package/docs/configure/app/output/{source-map.mdx → source-map.md} +3 -7
  127. package/docs/configure/app/output/{split-route-chunks.mdx → split-route-chunks.md} +0 -4
  128. package/docs/configure/app/output/{ssg.mdx → ssg.md} +3 -7
  129. package/docs/configure/app/output/{ssgByEntries.mdx → ssgByEntries.md} +1 -4
  130. package/docs/configure/app/output/{svg-default-export.mdx → svg-default-export.md} +0 -4
  131. package/docs/configure/app/output/{temp-dir.mdx → temp-dir.md} +0 -4
  132. package/docs/configure/app/performance/{build-cache.mdx → build-cache.md} +3 -7
  133. package/docs/configure/app/performance/{chunk-split.mdx → chunk-split.md} +3 -7
  134. package/docs/configure/app/performance/{dns-prefetch.mdx → dns-prefetch.md} +3 -7
  135. package/docs/configure/app/performance/preconnect.md +16 -0
  136. package/docs/configure/app/performance/{prefetch.mdx → prefetch.md} +3 -7
  137. package/docs/configure/app/performance/{preload.mdx → preload.md} +3 -7
  138. package/docs/configure/app/performance/{print-file-size.mdx → print-file-size.md} +3 -7
  139. package/docs/configure/app/performance/profile.md +10 -0
  140. package/docs/configure/app/performance/remove-console.md +10 -0
  141. package/docs/configure/app/performance/remove-moment-locale.md +10 -0
  142. package/docs/configure/app/performance/{rsdoctor.mdx → rsdoctor.md} +0 -4
  143. package/docs/configure/app/{plugins.mdx → plugins.md} +4 -4
  144. package/docs/configure/app/resolve/{alias-strategy.mdx → alias-strategy.md} +3 -7
  145. package/docs/configure/app/resolve/alias.md +9 -0
  146. package/docs/configure/app/resolve/{condition-names.mdx → condition-names.md} +3 -8
  147. package/docs/configure/app/resolve/{dedupe.mdx → dedupe.md} +3 -7
  148. package/docs/configure/app/resolve/{extensions.mdx → extensions.md} +3 -8
  149. package/docs/configure/app/runtime/{0-intro.mdx → 0-intro.md} +1 -4
  150. package/docs/configure/app/runtime/{plugins.mdx → plugins.md} +1 -1
  151. package/docs/configure/app/runtime/{router.mdx → router.md} +3 -7
  152. package/docs/configure/app/security/{check-syntax.mdx → check-syntax.md} +0 -4
  153. package/docs/configure/app/security/{nonce.mdx → nonce.md} +3 -7
  154. package/docs/configure/app/security/{sri.mdx → sri.md} +0 -4
  155. package/docs/configure/app/server/{base-url.mdx → base-url.md} +0 -4
  156. package/docs/configure/app/server/{port.mdx → port.md} +3 -7
  157. package/docs/configure/app/server/{public-routes.mdx → public-routes.md} +0 -4
  158. package/docs/configure/app/server/{routes.mdx → routes.md} +1 -5
  159. package/docs/configure/app/server/rsc.md +22 -0
  160. package/docs/configure/app/server/{ssr-by-entries.mdx → ssr-by-entries.md} +1 -5
  161. package/docs/configure/app/server/ssr.md +80 -0
  162. package/docs/configure/app/server/{tsconfig-path.mdx → tsconfig-path.md} +0 -4
  163. package/docs/configure/app/source/{alias-strategy.mdx → alias-strategy.md} +4 -8
  164. package/docs/configure/app/source/{alias.mdx → alias.md} +4 -8
  165. package/docs/configure/app/source/{config-dir.mdx → config-dir.md} +1 -5
  166. package/docs/configure/app/source/{decorators.mdx → decorators.md} +0 -4
  167. package/docs/configure/app/source/{define.mdx → define.md} +3 -7
  168. package/docs/configure/app/source/{disable-default-entries.mdx → disable-default-entries.md} +2 -6
  169. package/docs/{components/module-federation.mdx → configure/app/source/enable-async-entry.md} +47 -0
  170. package/docs/configure/app/source/{enable-async-pre-entry.mdx → enable-async-pre-entry.md} +0 -4
  171. package/docs/configure/app/source/{entries-dir.mdx → entries-dir.md} +0 -4
  172. package/docs/configure/app/source/{entries.mdx → entries.md} +1 -5
  173. package/docs/configure/app/source/{exclude.mdx → exclude.md} +4 -8
  174. package/docs/configure/app/source/{global-vars.mdx → global-vars.md} +0 -4
  175. package/docs/configure/app/source/{include.mdx → include.md} +4 -8
  176. package/docs/configure/app/source/{main-entry-name.mdx → main-entry-name.md} +0 -4
  177. package/docs/configure/app/source/{pre-entry.mdx → pre-entry.md} +3 -7
  178. package/docs/configure/app/source/{react-compiler.mdx → react-compiler.md} +0 -4
  179. package/docs/configure/app/source/{transform-import.mdx → transform-import.md} +3 -7
  180. package/docs/configure/app/{split-chunks.mdx → split-chunks.md} +3 -3
  181. package/docs/configure/app/tools/{autoprefixer.mdx → autoprefixer.md} +0 -4
  182. package/docs/configure/app/tools/{bundler-chain.mdx → bundler-chain.md} +0 -4
  183. package/docs/configure/app/tools/{css-extract.mdx → css-extract.md} +3 -7
  184. package/docs/configure/app/tools/{css-loader.mdx → css-loader.md} +3 -7
  185. package/docs/configure/app/tools/{dev-server.mdx → dev-server.md} +0 -4
  186. package/docs/configure/app/tools/{html-plugin.mdx → html-plugin.md} +3 -7
  187. package/docs/configure/app/tools/{less.mdx → less.md} +0 -4
  188. package/docs/configure/app/tools/{lightningcss-loader.mdx → lightningcss-loader.md} +3 -7
  189. package/docs/configure/app/tools/{minify-css.mdx → minify-css.md} +0 -4
  190. package/docs/configure/app/tools/{postcss.mdx → postcss.md} +3 -7
  191. package/docs/configure/app/tools/rspack.md +10 -0
  192. package/docs/configure/app/tools/{sass.mdx → sass.md} +0 -4
  193. package/docs/configure/app/tools/style-loader.md +10 -0
  194. package/docs/configure/app/tools/{swc.mdx → swc.md} +4 -8
  195. package/docs/configure/app/tools/{ts-checker.mdx → ts-checker.md} +20 -7
  196. package/docs/configure/app/{usage.mdx → usage.md} +1 -1
  197. package/docs/guides/advanced-features/bff/{cross-project.mdx → cross-project.md} +1 -2
  198. package/docs/guides/advanced-features/bff/{data-platform.mdx → data-platform.md} +0 -4
  199. package/docs/guides/advanced-features/bff/{extend-server.mdx → extend-server.md} +1 -1
  200. package/docs/guides/advanced-features/bff/frameworks.md +243 -0
  201. package/docs/guides/advanced-features/bff/{function.mdx → function.md} +60 -7
  202. package/docs/guides/advanced-features/bff/{operators.mdx → operators.md} +2 -77
  203. package/docs/{components/bff-upload.mdx → guides/advanced-features/bff/upload.md} +4 -0
  204. package/docs/guides/advanced-features/{bff.mdx → bff.md} +0 -4
  205. package/docs/guides/advanced-features/{build-performance.mdx → build-performance.md} +3 -7
  206. package/docs/guides/advanced-features/{compatibility.mdx → compatibility.md} +54 -15
  207. package/docs/guides/advanced-features/international/{advanced.mdx → advanced.md} +0 -4
  208. package/docs/guides/advanced-features/international/{api.mdx → api.md} +16 -20
  209. package/docs/guides/advanced-features/international/{best-practices.mdx → best-practices.md} +0 -4
  210. package/docs/guides/advanced-features/international/configuration.md +228 -0
  211. package/docs/guides/advanced-features/international/{locale-detection.mdx → locale-detection.md} +25 -29
  212. package/docs/guides/advanced-features/international/{quick-start.mdx → quick-start.md} +29 -13
  213. package/docs/guides/advanced-features/international/{resource-loading.mdx → resource-loading.md} +11 -15
  214. package/docs/guides/advanced-features/international/{routing.mdx → routing.md} +12 -16
  215. package/docs/guides/advanced-features/international.md +27 -0
  216. package/docs/guides/advanced-features/{low-level.mdx → low-level.md} +17 -21
  217. package/docs/guides/advanced-features/page-performance/{code-split.mdx → code-split.md} +2 -6
  218. package/docs/guides/advanced-features/page-performance/{inline-assets.mdx → inline-assets.md} +3 -7
  219. package/docs/guides/advanced-features/page-performance/{optimize-bundle.mdx → optimize-bundle.md} +4 -8
  220. package/docs/{components/internal-logger.mdx → guides/advanced-features/server-monitor/logger.md} +16 -0
  221. package/docs/guides/advanced-features/server-monitor/metrics.md +58 -0
  222. package/docs/guides/advanced-features/server-monitor/{monitors.mdx → monitors.md} +3 -3
  223. package/docs/guides/advanced-features/{source-build.mdx → source-build.md} +1 -5
  224. package/docs/guides/advanced-features/{web-server.mdx → web-server.md} +1 -9
  225. package/docs/guides/basic-features/{alias.mdx → alias.md} +3 -7
  226. package/docs/guides/basic-features/css/{css-in-js.mdx → css-in-js.md} +12 -9
  227. package/docs/guides/basic-features/css/{css-modules.mdx → css-modules.md} +3 -3
  228. package/docs/guides/basic-features/css/{css.mdx → css.md} +2 -6
  229. package/docs/guides/basic-features/data/{data-cache.mdx → data-cache.md} +1 -6
  230. package/docs/guides/basic-features/data/{data-fetch.mdx → data-fetch.md} +4 -8
  231. package/docs/guides/basic-features/data/{data-write.mdx → data-write.md} +6 -9
  232. package/docs/guides/basic-features/debug/{mock.mdx → mock.md} +1 -5
  233. package/docs/guides/basic-features/debug/{proxy.mdx → proxy.md} +1 -5
  234. package/docs/guides/basic-features/debug/{using-storybook.mdx → using-storybook.md} +20 -8
  235. package/docs/guides/basic-features/{deploy.mdx → deploy.md} +23 -13
  236. package/docs/guides/basic-features/{env-vars.mdx → env-vars.md} +8 -12
  237. package/docs/guides/basic-features/{html.mdx → html.md} +3 -7
  238. package/docs/guides/basic-features/{output-files.mdx → output-files.md} +6 -10
  239. package/docs/guides/basic-features/render/{before-render.mdx → before-render.md} +1 -1
  240. package/docs/guides/basic-features/render/overview.md +47 -0
  241. package/docs/guides/basic-features/render/{rsc.mdx → rsc.md} +16 -33
  242. package/docs/guides/basic-features/render/{ssg.mdx → ssg.md} +71 -10
  243. package/docs/guides/basic-features/render/{ssr-cache.mdx → ssr-cache.md} +5 -5
  244. package/docs/guides/basic-features/render/{ssr.mdx → ssr.md} +10 -12
  245. package/docs/guides/basic-features/render/{streaming-ssr.mdx → streaming-ssr.md} +5 -8
  246. package/docs/guides/basic-features/routes/{config-routes.mdx → config-routes.md} +10 -11
  247. package/docs/guides/basic-features/routes/{routes.mdx → routes.md} +8 -16
  248. package/docs/guides/basic-features/static-assets/{json-files.mdx → json-files.md} +0 -4
  249. package/docs/guides/basic-features/static-assets/{svg-assets.mdx → svg-assets.md} +3 -7
  250. package/docs/guides/basic-features/static-assets/{wasm-assets.mdx → wasm-assets.md} +1 -5
  251. package/docs/guides/basic-features/{static-assets.mdx → static-assets.md} +10 -14
  252. package/docs/guides/basic-features/testing/{playwright.mdx → playwright.md} +12 -3
  253. package/docs/guides/basic-features/testing/{rstest.mdx → rstest.md} +70 -11
  254. package/docs/guides/concept/{builder.mdx → builder.md} +3 -26
  255. package/docs/guides/concept/{entries.mdx → entries.md} +11 -17
  256. package/docs/guides/concept/{server.mdx → server.md} +3 -3
  257. package/docs/guides/get-started/{ai-coding-agents.mdx → ai-coding-agents.md} +4 -9
  258. package/docs/guides/get-started/glossary.md +63 -0
  259. package/docs/guides/get-started/{introduction.mdx → introduction.md} +1 -6
  260. package/docs/guides/get-started/quick-start.md +269 -0
  261. package/docs/guides/get-started/{tech-stack.mdx → tech-stack.md} +9 -15
  262. package/docs/guides/get-started/{ultramodern.mdx → ultramodern.md} +38 -31
  263. package/docs/guides/get-started/{upgrade.mdx → upgrade.md} +26 -22
  264. package/docs/guides/topic-detail/module-federation/{application.mdx → application.md} +3 -3
  265. package/docs/guides/topic-detail/module-federation/{deploy.mdx → deploy.md} +2 -2
  266. package/docs/guides/topic-detail/module-federation/{i18n.mdx → i18n.md} +14 -14
  267. package/docs/guides/topic-detail/module-federation/{introduce.mdx → introduce.md} +2 -3
  268. package/docs/guides/topic-detail/module-federation/{ssr.mdx → ssr.md} +12 -7
  269. package/docs/guides/topic-detail/module-federation/{usage.mdx → usage.md} +20 -3
  270. package/docs/guides/troubleshooting/{builder.mdx → builder.md} +10 -14
  271. package/docs/guides/troubleshooting/{cli.mdx → cli.md} +0 -4
  272. package/docs/guides/troubleshooting/{dependencies.mdx → dependencies.md} +7 -11
  273. package/docs/guides/troubleshooting/{hmr.mdx → hmr.md} +5 -9
  274. package/docs/guides/upgrade/{config.mdx → config.md} +8 -5
  275. package/docs/guides/upgrade/{entry.mdx → entry.md} +6 -6
  276. package/docs/guides/upgrade/{other.mdx → other.md} +8 -8
  277. package/docs/guides/upgrade/{overview.mdx → overview.md} +4 -4
  278. package/docs/guides/upgrade/{tailwindcss.mdx → tailwindcss.md} +0 -1
  279. package/docs/guides/upgrade/web-server.md +11 -11
  280. package/docs/index.md +33 -4
  281. package/docs/llms.txt +290 -0
  282. package/docs/plugin/cli-plugins/api.md +573 -0
  283. package/docs/plugin/cli-plugins/life-cycle.md +2 -0
  284. package/docs/plugin/introduction.md +152 -0
  285. package/docs/plugin/official/cli-plugins/plugin-bff.md +5 -0
  286. package/docs/plugin/official/cli-plugins/plugin-ssg.md +5 -0
  287. package/docs/plugin/official/cli-plugins/plugin-styled-components.md +5 -0
  288. package/docs/plugin/official/cli-plugins.md +4 -0
  289. package/docs/plugin/plugin-system.md +238 -0
  290. package/docs/plugin/runtime-plugins/api.md +194 -0
  291. package/docs/plugin/runtime-plugins/life-cycle.md +2 -0
  292. package/docs/plugin/server-plugins/api.md +209 -0
  293. package/docs/plugin/server-plugins/life-cycle.md +13 -0
  294. package/docs/tutorials/examples/csr-auth.md +9 -0
  295. package/docs/tutorials/foundations/introduction.md +16 -0
  296. package/package.json +33 -15
  297. package/docs/_nav.json +0 -36
  298. package/docs/apis/_meta.json +0 -13
  299. package/docs/apis/app/hooks/_meta.json +0 -28
  300. package/docs/apis/app/hooks/config/_meta.json +0 -1
  301. package/docs/apis/app/runtime/_meta.json +0 -32
  302. package/docs/components/auto-upgrade.mdx +0 -0
  303. package/docs/components/build-output.mdx +0 -45
  304. package/docs/components/bundler.mdx +0 -3
  305. package/docs/components/convention-routing-motivation.mdx +0 -0
  306. package/docs/components/debug-app.mdx +0 -15
  307. package/docs/components/default-browserslist.mdx +0 -7
  308. package/docs/components/deploy-command.mdx +0 -14
  309. package/docs/components/deploy.mdx +0 -1
  310. package/docs/components/enable-bff-caution.mdx +0 -3
  311. package/docs/components/enable-bff.mdx +0 -56
  312. package/docs/components/enable-ssg.mdx +0 -49
  313. package/docs/components/entry-mode.mdx +0 -0
  314. package/docs/components/entry-scan-logic.mdx +0 -7
  315. package/docs/components/extend-bff-function.mdx +0 -3
  316. package/docs/components/hono.mdx +0 -120
  317. package/docs/components/init-app.mdx +0 -93
  318. package/docs/components/init-rspack-app.mdx +0 -5
  319. package/docs/components/internal-metrics.mdx +0 -20
  320. package/docs/components/international/custom-instance-code.mdx +0 -16
  321. package/docs/components/international/init-options-desc.mdx +0 -1
  322. package/docs/components/international/install-command.mdx +0 -10
  323. package/docs/components/international/instance-code.mdx +0 -16
  324. package/docs/components/international/introduce.mdx +0 -5
  325. package/docs/components/international/platform-support.mdx +0 -0
  326. package/docs/components/language-config.mdx +0 -9
  327. package/docs/components/micro-frontend.mdx +0 -6
  328. package/docs/components/micro-master-manifest-config.mdx +0 -15
  329. package/docs/components/micro-runtime-config.mdx +0 -17
  330. package/docs/components/new-entry-tooltip.mdx +0 -0
  331. package/docs/components/nodeVersion.mdx +0 -28
  332. package/docs/components/other-plugins.mdx +0 -0
  333. package/docs/components/output-asset-prefix-extend.mdx +0 -0
  334. package/docs/components/output-distpath-warning.mdx +0 -0
  335. package/docs/components/output-polyfill-extend.mdx +0 -1
  336. package/docs/components/prerequisites.mdx +0 -18
  337. package/docs/components/release-note.mdx +0 -1
  338. package/docs/components/routes-practice.mdx +0 -0
  339. package/docs/components/rsbuild-config-tooltip.mdx +0 -5
  340. package/docs/components/rsbuild.mdx +0 -3
  341. package/docs/components/rsc-deploy-tip.mdx +0 -1
  342. package/docs/components/rspack.mdx +0 -3
  343. package/docs/components/rspackTip.mdx +0 -7
  344. package/docs/components/runtime-cli-config.mdx +0 -0
  345. package/docs/components/serve-command.mdx +0 -22
  346. package/docs/components/ssr-monitor.mdx +0 -3
  347. package/docs/components/stream-ssr-performance.mdx +0 -0
  348. package/docs/components/swc.mdx +0 -3
  349. package/docs/components/tech-stack-node-framework.mdx +0 -1
  350. package/docs/components/turtorials-example-list.mdx +0 -2
  351. package/docs/components/ua-polyfill.mdx +0 -44
  352. package/docs/components/upgrade-browserslist.mdx +0 -0
  353. package/docs/components/upgrade-config-deploy.mdx +0 -0
  354. package/docs/components/upgrade-faq.mdx +0 -0
  355. package/docs/configure/_meta.json +0 -78
  356. package/docs/configure/app/dev/hmr.mdx +0 -14
  357. package/docs/configure/app/dev/live-reload.mdx +0 -14
  358. package/docs/configure/app/dev/progress-bar.mdx +0 -23
  359. package/docs/configure/app/html/inject.mdx +0 -14
  360. package/docs/configure/app/html/output-structure.mdx +0 -14
  361. package/docs/configure/app/html/script-loading.mdx +0 -14
  362. package/docs/configure/app/html/template.mdx +0 -14
  363. package/docs/configure/app/html/title.mdx +0 -22
  364. package/docs/configure/app/output/asset-prefix.mdx +0 -18
  365. package/docs/configure/app/output/filename-hash.mdx +0 -14
  366. package/docs/configure/app/output/inject-styles.mdx +0 -14
  367. package/docs/configure/app/output/polyfill.mdx +0 -18
  368. package/docs/configure/app/performance/preconnect.mdx +0 -20
  369. package/docs/configure/app/performance/profile.mdx +0 -14
  370. package/docs/configure/app/performance/remove-console.mdx +0 -14
  371. package/docs/configure/app/performance/remove-moment-locale.mdx +0 -14
  372. package/docs/configure/app/resolve/alias.mdx +0 -13
  373. package/docs/configure/app/server/rsc.mdx +0 -30
  374. package/docs/configure/app/server/ssr.mdx +0 -85
  375. package/docs/configure/app/source/enable-async-entry.mdx +0 -54
  376. package/docs/configure/app/tools/rspack.mdx +0 -14
  377. package/docs/configure/app/tools/style-loader.mdx +0 -14
  378. package/docs/guides/_meta.json +0 -37
  379. package/docs/guides/advanced-features/_meta.json +0 -32
  380. package/docs/guides/advanced-features/bff/_meta.json +0 -10
  381. package/docs/guides/advanced-features/bff/frameworks.mdx +0 -131
  382. package/docs/guides/advanced-features/bff/upload.mdx +0 -7
  383. package/docs/guides/advanced-features/international/_meta.json +0 -10
  384. package/docs/guides/advanced-features/international/configuration.mdx +0 -222
  385. package/docs/guides/advanced-features/international.mdx +0 -29
  386. package/docs/guides/advanced-features/page-performance/_meta.json +0 -1
  387. package/docs/guides/advanced-features/server-monitor/_meta.json +0 -1
  388. package/docs/guides/advanced-features/server-monitor/logger.mdx +0 -19
  389. package/docs/guides/advanced-features/server-monitor/metrics.mdx +0 -41
  390. package/docs/guides/basic-features/_meta.json +0 -49
  391. package/docs/guides/basic-features/css/_meta.json +0 -1
  392. package/docs/guides/basic-features/data/_meta.json +0 -1
  393. package/docs/guides/basic-features/debug/_meta.json +0 -1
  394. package/docs/guides/basic-features/render/_meta.json +0 -1
  395. package/docs/guides/basic-features/render/overview.mdx +0 -51
  396. package/docs/guides/basic-features/routes/_meta.json +0 -1
  397. package/docs/guides/basic-features/static-assets/_meta.json +0 -1
  398. package/docs/guides/basic-features/testing/_meta.json +0 -1
  399. package/docs/guides/concept/_meta.json +0 -1
  400. package/docs/guides/get-started/_meta.json +0 -9
  401. package/docs/guides/get-started/glossary.mdx +0 -63
  402. package/docs/guides/get-started/quick-start.mdx +0 -92
  403. package/docs/guides/topic-detail/_meta.json +0 -8
  404. package/docs/guides/topic-detail/module-federation/_meta.json +0 -1
  405. package/docs/guides/troubleshooting/_meta.json +0 -1
  406. package/docs/guides/upgrade/_meta.json +0 -1
  407. package/scripts/copy-main-doc.mjs +0 -50
  408. /package/docs/guides/advanced-features/bff/{sdk.mdx → sdk.md} +0 -0
  409. /package/docs/guides/advanced-features/page-performance/{react-compiler.mdx → react-compiler.md} +0 -0
  410. /package/docs/guides/basic-features/css/{tailwindcss.mdx → tailwindcss.md} +0 -0
  411. /package/docs/guides/basic-features/debug/{rsdoctor.mdx → rsdoctor.md} +0 -0
@@ -1,43 +1,16 @@
1
1
  import "node:module";
2
+ import { createHash } from "node:crypto";
2
3
  import promises from "node:fs/promises";
3
4
  import node_path from "node:path";
4
- import { parse } from "@babel/parser";
5
5
  import { BACKEND_FEDERATION_MANIFEST_FILE, BACKEND_FEDERATION_REMOTE_ENTRY_FILE, ULTRAMODERN_BUILD_ARTIFACT_FILE, isUltramodernBuildArtifact } from "@modern-js/utils/universal";
6
6
  import { canonicalSerializeMicroVerticalReleaseEnvelope, createMicroVerticalReleaseEnvelope, verifyMicroVerticalReleaseEnvelope } from "./index.mjs";
7
7
  const MICROVERTICAL_RELEASE_ENVELOPE_PATH = 'release/microvertical-release-envelope.json';
8
+ const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH = 'release/microvertical-release-identity-carriers.json';
9
+ const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_KIND = 'ultramodern-release-identity-carriers';
10
+ const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_SCHEMA_VERSION = 1;
8
11
  const COMPILED_MODULE_PATTERN = /\.(?:c|m)?js$/u;
9
12
  const EFFECT_BFF_WORKER_PATTERN = /^worker\/__modern_bff_effect\.(?:c|m)?js$/u;
10
13
  const isRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
11
- const isAstNode = (value)=>isRecord(value) && 'string' == typeof value.type;
12
- const visitAst = (node, visitor)=>{
13
- visitor(node);
14
- for (const value of Object.values(node))if (isAstNode(value)) visitAst(value, visitor);
15
- else if (Array.isArray(value)) {
16
- for (const item of value)if (isAstNode(item)) visitAst(item, visitor);
17
- }
18
- };
19
- const compiledModuleIdentityValues = (source)=>{
20
- const values = new Set();
21
- const ast = parse(source, {
22
- sourceType: 'unambiguous'
23
- });
24
- visitAst(ast.program, (node)=>{
25
- if ('StringLiteral' === node.type && 'string' == typeof node.value) values.add(node.value);
26
- else if ('TemplateElement' === node.type && isRecord(node.value) && 'string' == typeof node.value.cooked) values.add(node.value.cooked);
27
- });
28
- return values;
29
- };
30
- const assertEveryCompiledIdentityCarrier = async (distDirectory, logicalPaths, identity, surface)=>{
31
- const compiledLogicalPaths = logicalPaths.filter((pathname)=>COMPILED_MODULE_PATTERN.test(pathname));
32
- if (0 === compiledLogicalPaths.length) throw new Error(`[ultramodern-release-envelope] ${surface} has no compiled execution module carrying release identity.`);
33
- for (const logicalPath of compiledLogicalPaths){
34
- const source = await promises.readFile(node_path.join(distDirectory, logicalPath), {
35
- encoding: 'utf8'
36
- });
37
- const values = compiledModuleIdentityValues(source);
38
- if (!values.has(identity.buildMarker) || !values.has(identity.sourceRevision) || !values.has(identity.releaseVersion)) throw new Error(`[ultramodern-release-envelope] ${surface} execution module ${logicalPath} does not carry exact buildMarker ${identity.buildMarker}, sourceRevision ${identity.sourceRevision}, and releaseVersion ${identity.releaseVersion}.`);
39
- }
40
- };
41
14
  const flattenStrings = (value)=>'string' == typeof value ? [
42
15
  value
43
16
  ] : Array.isArray(value) ? value.flatMap(flattenStrings) : [];
@@ -180,6 +153,49 @@ const releaseArtifact = (logicalPath, runtime)=>({
180
153
  logicalPath,
181
154
  runtime
182
155
  });
156
+ const writeReleaseIdentityCarrierMetadata = async (artifactRoot, identity, carrierPaths)=>{
157
+ const surfacesByPath = new Map();
158
+ for (const [surface, logicalPaths] of Object.entries(carrierPaths)){
159
+ if (0 === logicalPaths.length) throw new Error(`[ultramodern-release-envelope] ${surface} has no declared release-identity carrier artifact.`);
160
+ for (const logicalPath of logicalPaths){
161
+ const surfaces = surfacesByPath.get(logicalPath) ?? new Set();
162
+ surfaces.add(surface);
163
+ surfacesByPath.set(logicalPath, surfaces);
164
+ }
165
+ }
166
+ const carriers = await Promise.all([
167
+ ...surfacesByPath
168
+ ].sort(([left], [right])=>left.localeCompare(right)).map(async ([logicalPath, surfaces])=>{
169
+ const bytes = await promises.readFile(node_path.join(artifactRoot, logicalPath));
170
+ return {
171
+ logicalPath,
172
+ byteLength: bytes.byteLength,
173
+ sha256: createHash('sha256').update(bytes).digest('hex'),
174
+ surfaces: [
175
+ ...surfaces
176
+ ].sort((left, right)=>left.localeCompare(right))
177
+ };
178
+ }));
179
+ const releaseEnvelopePath = await resolveSafeReleaseEnvelopePath({
180
+ artifactRoot,
181
+ createDirectory: true
182
+ });
183
+ if (!releaseEnvelopePath) throw new Error('[ultramodern-release-envelope] could not resolve private release metadata directory.');
184
+ const metadataPath = node_path.join(node_path.dirname(releaseEnvelopePath), node_path.basename(MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH));
185
+ try {
186
+ const metadataStat = await promises.lstat(metadataPath);
187
+ if (metadataStat.isSymbolicLink() || !metadataStat.isFile()) throw new Error('[ultramodern-release-envelope] release identity carrier metadata must be a real file inside artifactRoot.');
188
+ } catch (error) {
189
+ if (!isMissingPathError(error)) throw error;
190
+ }
191
+ await promises.writeFile(metadataPath, `${JSON.stringify({
192
+ schemaVersion: MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_SCHEMA_VERSION,
193
+ kind: MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_KIND,
194
+ identity,
195
+ carriers
196
+ }, null, 2)}\n`);
197
+ return releaseArtifact(MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH, 'release-identity-metadata');
198
+ };
183
199
  const createReleaseArtifactInputs = async (distDirectory, identity, target)=>{
184
200
  const files = await collectFiles(distDirectory);
185
201
  if ('node' === target && files.some((logicalPath)=>EFFECT_BFF_WORKER_PATTERN.test(logicalPath))) throw new Error('[ultramodern-release-envelope] Node target conflicts with a Cloudflare Effect API/BFF worker artifact; resolve the canonical deploy target instead of emitting a Node envelope for Cloudflare output.');
@@ -203,13 +219,7 @@ const createReleaseArtifactInputs = async (distDirectory, identity, target)=>{
203
219
  const clientExecutionPaths = await manifestReferencedClientModules(distDirectory, files);
204
220
  if (0 === clientExecutionPaths.length) throw new Error('[ultramodern-release-envelope] UI/client manifest references no compiled execution module.');
205
221
  const ssrExecutionPaths = await routeReferencedSsrModules(distDirectory, files, target);
206
- await assertEveryCompiledIdentityCarrier(distDirectory, clientExecutionPaths, identity, 'manifest-referenced UI/client');
207
- await assertEveryCompiledIdentityCarrier(distDirectory, ssrExecutionPaths, identity, 'node' === target ? 'route-referenced Node SSR' : 'route-referenced Cloudflare SSR');
208
- await assertEveryCompiledIdentityCarrier(distDirectory, ssrPaths, identity, 'node' === target ? 'compiled Node SSR closure' : 'compiled Cloudflare SSR/workerd closure');
209
- await assertEveryCompiledIdentityCarrier(distDirectory, 'node' === target ? nodeApiEntryPaths : apiBackendPaths, identity, 'node' === target ? 'Node API/backend' : 'Cloudflare API/backend');
210
- await assertEveryCompiledIdentityCarrier(distDirectory, [
211
- BACKEND_FEDERATION_REMOTE_ENTRY_FILE
212
- ], identity, 'backend Module Federation container');
222
+ if (0 === ssrExecutionPaths.length) throw new Error(`[ultramodern-release-envelope] route manifest references no emitted ${'node' === target ? 'Node' : 'Cloudflare'} SSR execution module.`);
213
223
  const runtimeByPath = new Map();
214
224
  const add = (paths, runtime)=>{
215
225
  for (const logicalPath of paths){
@@ -245,8 +255,25 @@ const createReleaseArtifactInputs = async (distDirectory, identity, target)=>{
245
255
  const artifacts = [
246
256
  ...runtimeByPath
247
257
  ].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)).sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath));
258
+ const identityCarrierMetadata = await writeReleaseIdentityCarrierMetadata(distDirectory, identity, {
259
+ apiBackend: apiBackendPaths,
260
+ backendFederation: [
261
+ BACKEND_FEDERATION_MANIFEST_FILE,
262
+ BACKEND_FEDERATION_REMOTE_ENTRY_FILE
263
+ ],
264
+ ssr: [
265
+ ...new Set([
266
+ ...ssrExecutionPaths,
267
+ ...ssrPaths
268
+ ])
269
+ ],
270
+ uiClient: uiClientPaths.filter((logicalPath)=>COMPILED_MODULE_PATTERN.test(logicalPath))
271
+ });
248
272
  return {
249
- artifacts,
273
+ artifacts: [
274
+ ...artifacts,
275
+ identityCarrierMetadata
276
+ ].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
250
277
  surfaces
251
278
  };
252
279
  };
@@ -368,13 +395,7 @@ const createNodeStagedReleaseArtifactInputs = async (outputDirectory, identity)=
368
395
  ])if (0 === paths.length) throw new Error(`[ultramodern-release-envelope] final Node staging has no ${surface} artifacts.`);
369
396
  const clientExecutionPaths = await manifestReferencedClientModules(outputDirectory, files);
370
397
  const ssrExecutionPaths = await routeReferencedSsrModules(outputDirectory, files, 'node');
371
- await assertEveryCompiledIdentityCarrier(outputDirectory, clientExecutionPaths, identity, 'final manifest-referenced Node UI/client');
372
- await assertEveryCompiledIdentityCarrier(outputDirectory, ssrExecutionPaths, identity, 'final route-referenced Node SSR');
373
- await assertEveryCompiledIdentityCarrier(outputDirectory, ssrPaths.filter((logicalPath)=>'index.js' !== logicalPath), identity, 'final compiled Node SSR closure');
374
- await assertEveryCompiledIdentityCarrier(outputDirectory, apiBackendPaths.filter((logicalPath)=>logicalPath.startsWith('api/')), identity, 'final Node API/backend');
375
- await assertEveryCompiledIdentityCarrier(outputDirectory, [
376
- BACKEND_FEDERATION_REMOTE_ENTRY_FILE
377
- ], identity, 'final Node backend Module Federation container');
398
+ if (0 === clientExecutionPaths.length || 0 === ssrExecutionPaths.length) throw new Error('[ultramodern-release-envelope] final Node manifests must reference emitted UI/client and SSR execution modules.');
378
399
  const runtimeByPath = new Map(files.filter((logicalPath)=>!backendFederationPaths.has(logicalPath)).map((logicalPath)=>[
379
400
  logicalPath,
380
401
  'nodejs-deployment'
@@ -384,10 +405,27 @@ const createNodeStagedReleaseArtifactInputs = async (outputDirectory, identity)=
384
405
  for (const logicalPath of apiBackendPaths)runtimeByPath.set(logicalPath, 'nodejs');
385
406
  runtimeByPath.set(BACKEND_FEDERATION_MANIFEST_FILE, 'module-federation-manifest');
386
407
  runtimeByPath.set(BACKEND_FEDERATION_REMOTE_ENTRY_FILE, 'nodejs');
408
+ const identityCarrierMetadata = await writeReleaseIdentityCarrierMetadata(outputDirectory, identity, {
409
+ apiBackend: apiBackendPaths,
410
+ backendFederation: [
411
+ BACKEND_FEDERATION_MANIFEST_FILE,
412
+ BACKEND_FEDERATION_REMOTE_ENTRY_FILE
413
+ ],
414
+ ssr: [
415
+ ...new Set([
416
+ ...ssrExecutionPaths,
417
+ ...ssrPaths.filter((logicalPath)=>'index.js' !== logicalPath)
418
+ ])
419
+ ],
420
+ uiClient: uiClientPaths.filter((logicalPath)=>COMPILED_MODULE_PATTERN.test(logicalPath))
421
+ });
387
422
  return {
388
423
  artifacts: [
389
- ...runtimeByPath
390
- ].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)).sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
424
+ ...[
425
+ ...runtimeByPath
426
+ ].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)),
427
+ identityCarrierMetadata
428
+ ].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
391
429
  surfaces: {
392
430
  uiClient: [
393
431
  ...uiClientPaths
@@ -461,13 +499,7 @@ const createCloudflareStagedReleaseArtifactInputs = async (outputDirectory, iden
461
499
  ])if (!files.includes(logicalPath)) throw new Error(`[ultramodern-release-envelope] final Cloudflare staging is missing ${logicalPath}.`);
462
500
  const clientExecutionPaths = await manifestReferencedClientModules(outputDirectory, files, 'public/mf-manifest.json');
463
501
  const ssrExecutionPaths = await routeReferencedSsrModules(outputDirectory, files, 'cloudflare', 'server/route.json');
464
- await assertEveryCompiledIdentityCarrier(outputDirectory, clientExecutionPaths, identity, 'final manifest-referenced Cloudflare UI/client');
465
- await assertEveryCompiledIdentityCarrier(outputDirectory, ssrExecutionPaths, identity, 'final route-referenced Cloudflare SSR');
466
- await assertEveryCompiledIdentityCarrier(outputDirectory, ssrPaths.filter((logicalPath)=>logicalPath.startsWith('worker/')), identity, 'final compiled Cloudflare SSR/workerd closure');
467
- await assertEveryCompiledIdentityCarrier(outputDirectory, apiBackendPaths, identity, 'final Cloudflare API/backend');
468
- await assertEveryCompiledIdentityCarrier(outputDirectory, [
469
- backendContainerPath
470
- ], identity, 'final Cloudflare backend Module Federation container');
502
+ if (0 === clientExecutionPaths.length || 0 === ssrExecutionPaths.length) throw new Error('[ultramodern-release-envelope] final Cloudflare manifests must reference emitted UI/client and SSR execution modules.');
471
503
  const runtimeByPath = new Map();
472
504
  for (const logicalPath of files)runtimeByPath.set(logicalPath, 'cloudflare-deployment');
473
505
  const add = (paths, runtime)=>{
@@ -482,10 +514,27 @@ const createCloudflareStagedReleaseArtifactInputs = async (outputDirectory, iden
482
514
  add([
483
515
  backendContainerPath
484
516
  ], 'commonjs-module');
517
+ const identityCarrierMetadata = await writeReleaseIdentityCarrierMetadata(outputDirectory, identity, {
518
+ apiBackend: apiBackendPaths,
519
+ backendFederation: [
520
+ backendManifestPath,
521
+ backendContainerPath
522
+ ],
523
+ ssr: [
524
+ ...new Set([
525
+ ...ssrExecutionPaths,
526
+ ...ssrPaths.filter((logicalPath)=>logicalPath.startsWith('worker/'))
527
+ ])
528
+ ],
529
+ uiClient: uiClientPaths.filter((logicalPath)=>COMPILED_MODULE_PATTERN.test(logicalPath))
530
+ });
485
531
  return {
486
532
  artifacts: [
487
- ...runtimeByPath
488
- ].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)).sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
533
+ ...[
534
+ ...runtimeByPath
535
+ ].map(([logicalPath, runtime])=>releaseArtifact(logicalPath, runtime)),
536
+ identityCarrierMetadata
537
+ ].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath)),
489
538
  surfaces: {
490
539
  uiClient: [
491
540
  ...uiClientPaths
@@ -522,4 +571,4 @@ const verifyCloudflareReleaseEnvelopeStaging = async (outputDirectory)=>readFram
522
571
  expectedTarget: 'cloudflare',
523
572
  required: true
524
573
  });
525
- export { MICROVERTICAL_RELEASE_ENVELOPE_PATH, emitCloudflareStagedReleaseEnvelope, emitFrameworkMicroVerticalReleaseEnvelope, emitNodeStagedReleaseEnvelope, readFrameworkMicroVerticalReleaseEnvelope, stageCloudflareReleaseEnvelope, verifyBuildOutputReleaseEnvelope, verifyCloudflareReleaseEnvelopeStaging, verifyNodeReleaseEnvelopeStaging };
574
+ export { MICROVERTICAL_RELEASE_ENVELOPE_PATH, MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH, emitCloudflareStagedReleaseEnvelope, emitFrameworkMicroVerticalReleaseEnvelope, emitNodeStagedReleaseEnvelope, readFrameworkMicroVerticalReleaseEnvelope, stageCloudflareReleaseEnvelope, verifyBuildOutputReleaseEnvelope, verifyCloudflareReleaseEnvelopeStaging, verifyNodeReleaseEnvelopeStaging };
@@ -1,5 +1,34 @@
1
+ import type { ModifyBundlerChainFn } from '@rsbuild/core';
1
2
  import type { AppNormalizedConfig } from '../../types';
2
3
  import type { AppToolsContext } from '../../types/plugin';
4
+ export declare function getCloudflareWorkerRspackConfig(workerEntryNames: Iterable<string>): {
5
+ readonly experiments: {
6
+ readonly outputModule: true;
7
+ };
8
+ readonly externals: {
9
+ [k: string]: string;
10
+ };
11
+ readonly externalsType: 'module-import';
12
+ readonly module: {
13
+ readonly parser: {
14
+ readonly javascript: {
15
+ readonly dynamicImportMode: 'eager';
16
+ };
17
+ };
18
+ };
19
+ readonly optimization: {
20
+ readonly runtimeChunk: {
21
+ readonly name: string;
22
+ };
23
+ readonly splitChunks: {
24
+ readonly chunks: 'all';
25
+ readonly minSize: 0;
26
+ readonly name: string;
27
+ };
28
+ };
29
+ };
30
+ export declare function applyCloudflareWorkerRspackConfig(chain: Parameters<ModifyBundlerChainFn>[0], workerEntryNames: Iterable<string>): void;
31
+ export declare function applyCloudflareWorkerMfRuntimeBoundary(chain: Parameters<ModifyBundlerChainFn>[0]): void;
3
32
  export declare function getBuilderEnvironments(normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, tempBuilderConfig: Omit<AppNormalizedConfig, 'plugins'>): {
4
33
  environments: Record<string, import("@rsbuild/core").EnvironmentConfig>;
5
34
  builderConfig: Omit<AppNormalizedConfig, "plugins">;
@@ -0,0 +1,20 @@
1
+ export interface BundleDocsOptions {
2
+ /** Docs site build output (e.g. `doc_build`). */
3
+ source: string;
4
+ /** Directory to write the bundle to. */
5
+ target: string;
6
+ /** Index file to ship alongside the pages. */
7
+ indexFile?: string;
8
+ /** Top-level directories to skip. */
9
+ excludedDirs?: string[];
10
+ }
11
+ /** @returns files copied, or 0 when the source is absent */
12
+ export declare function bundleDocs({ source, target, indexFile, excludedDirs, }: BundleDocsOptions): number;
13
+ /**
14
+ * `modern-bundle-docs --source <doc_build> --target <pkg>/docs`; both default
15
+ * to this repo's layout.
16
+ *
17
+ * @param pkgRoot supplied by the bin shim — the compiled module cannot know
18
+ * its own package root portably across output formats.
19
+ */
20
+ export declare function runBundleDocsCli(pkgRoot: string): void;
@@ -16,5 +16,5 @@ interface WorkerBundleVerificationContract {
16
16
  workerRoot: string;
17
17
  }
18
18
  export declare const verifyWorkerBundleReferences: (issues: CloudflareOutputVerifierIssue[], worker: ResolvedWorkerBundleReference, source: string, contract: WorkerBundleVerificationContract) => Promise<void>;
19
- export declare const verifyWorkerImport: (issues: CloudflareOutputVerifierIssue[], entryPath: string) => Promise<void>;
19
+ export declare const verifyWorkerImport: (issues: CloudflareOutputVerifierIssue[], entryPath: string, expectedManifest?: JsonObject) => Promise<void>;
20
20
  export {};
@@ -1 +1 @@
1
- export {};
1
+ export declare const modernWorkerManifest: any;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Workerd cannot initialize Module Federation's Node-oriented SSR data-fetch
3
+ * runtime. Cloudflare workers do not load native MF remotes, so retain the
4
+ * runtime-plugin contract without installing its server data-fetch hooks.
5
+ */
6
+ export declare const injectDataFetchFunctionPlugin: () => {
7
+ name: string;
8
+ setup(): void;
9
+ };
10
+ export declare const mfSSRDevPlugin: () => {
11
+ name: string;
12
+ setup(): void;
13
+ };
@@ -1,5 +1,6 @@
1
1
  import type { MicroVerticalReleaseArtifact, MicroVerticalReleaseEnvelope, MicroVerticalReleaseTarget } from './types';
2
2
  export declare const MICROVERTICAL_RELEASE_ENVELOPE_PATH = "release/microvertical-release-envelope.json";
3
+ export declare const MICROVERTICAL_RELEASE_IDENTITY_CARRIERS_PATH = "release/microvertical-release-identity-carriers.json";
3
4
  export declare const emitFrameworkMicroVerticalReleaseEnvelope: ({ apiOnly, distDirectory, target, }: {
4
5
  apiOnly: boolean;
5
6
  distDirectory: string;
@@ -1,7 +1,3 @@
1
- ---
2
- sidebar_position: 1
3
- ---
4
-
5
1
  # Commands
6
2
 
7
3
  UltraModern.js has some built-in commands that can help you quickly start a development server, build production environment code, and more.
@@ -69,7 +65,7 @@ modern dev --entry foo,bar
69
65
 
70
66
  ## modern build
71
67
 
72
- The `modern build` command will build production-ready artifacts in the `dist/` directory by default. You can specify the output directory by modifying the configuration [`output.distPath`](/configure/app/output/dist-path).
68
+ The `modern build` command will build production-ready artifacts in the `dist/` directory by default. You can specify the output directory by modifying the configuration [`output.distPath`](/configure/app/output/dist-path.md).
73
69
 
74
70
  ```bash
75
71
  Usage: modern build [options]
@@ -134,9 +130,28 @@ The request body always includes `appName`, `reason`, and `phase`. It includes `
134
130
  modern runtime fallback-signal --app crm-shell --reason remote_load_failed --phase load --json
135
131
  ```
136
132
 
137
- import ServeCommand from '@site-docs-en/components/serve-command';
133
+ ## modern serve
134
+
135
+ The `modern serve` command is used to start an UltraModern.js project in the production environment. It can also be used to preview the artifacts built for the production environment locally. Please note that you need to execute the [`build`](/apis/app/commands.md#modern-build) command beforehand to generate the corresponding artifacts.
136
+
137
+ ```bash
138
+ Usage: modern serve [options]
139
+
140
+ Options:
141
+ -c --config <config> specify the configuration file, which can be a relative or absolute path
142
+ -h, --help show command help
143
+ --api-only only run API service
144
+ ```
138
145
 
139
- <ServeCommand />
146
+ By default, the project will run in `localhost:8080`, you can modify the server port number with `server.port`:
147
+
148
+ ```js
149
+ export default defineConfig({
150
+ server: {
151
+ port: 8081,
152
+ },
153
+ });
154
+ ```
140
155
 
141
156
  ## modern inspect
142
157
 
@@ -200,6 +215,17 @@ Inspect config succeed, open following files to view the content:
200
215
  - Modern.js Config: /root/my-project/dist/modern.js.config.mjs
201
216
  ```
202
217
 
203
- import DeployCommand from '@site-docs-en/components/deploy-command';
218
+ ## modern deploy
219
+
220
+ The `modern deploy` command is used to generate artifacts required for the deployment platform.
221
+
222
+ ```bash
223
+ Usage: modern deploy [options]
224
+
225
+ Options:
226
+ -c --config <config> Specify configuration file path, either relative or absolute
227
+ -s --skip-build Skip the build stage
228
+ -h, --help Display command help
229
+ ```
204
230
 
205
- <DeployCommand />
231
+ For more details, refer to [Deploy Application](/guides/basic-features/deploy.md).
@@ -1,8 +1,4 @@
1
- ---
2
- title: lambda/*.ts
3
- sidebar_position: 3
4
- ---
5
- # lambda/*.ts
1
+ # lambda/\*.ts
6
2
 
7
3
  After enabling BFF, the files under the `lambda/` directory will be registered as BFF routes according to conventions.
8
4
 
@@ -10,4 +6,4 @@ After enabling BFF, the files under the `lambda/` directory will be registered a
10
6
  The files can be written in `js` or `ts` languages, but they must use `esm` syntax to export functions.
11
7
  :::
12
8
 
13
- For detailed information, refer to [BFF API Routes](/guides/advanced-features/bff/function.html#api-routes).
9
+ For detailed information, refer to [BFF API Routes](/guides/advanced-features/bff/function.md#api-routes).
@@ -1,11 +1,6 @@
1
- ---
2
- title: favicon.*
3
- sidebar_position: 3
4
- ---
5
-
6
1
  # Favicon
7
2
 
8
- When there is a `favicon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.favicon](/configure/app/html/favicon) configuration option for generating the favicon icon on the page:
3
+ When there is a `favicon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.favicon](/configure/app/html/favicon.md) configuration option for generating the favicon icon on the page:
9
4
 
10
5
  ```
11
6
  ./config
@@ -1,9 +1,5 @@
1
- ---
2
- title: html/
3
- sidebar_position: 1
4
- ---
5
1
  # html/
6
2
 
7
3
  You can inject custom HTML fragments at different locations of the default internal HTML template through the `config/html` directory.
8
4
 
9
- For specific usage, please refer to: [Custom HTML](/guides/basic-features/html).
5
+ For specific usage, please refer to: [Custom HTML](/guides/basic-features/html.md).
@@ -1,11 +1,6 @@
1
- ---
2
- title: icon.*
3
- sidebar_position: 2
4
- ---
5
-
6
1
  # Apple Touch Icon
7
2
 
8
- When there is an `icon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.appIcon](/configure/app/html/app-icon) configuration option for generating the Apple Touch Icon icon under the iOS system.
3
+ When there is an `icon.*` file in the `config` directory at the root of the project, Modern.js will automatically set the file to the [html.appIcon](/configure/app/html/app-icon.md) configuration option for generating the Apple Touch Icon icon under the iOS system.
9
4
 
10
5
  ```
11
6
  ./config
@@ -1,10 +1,6 @@
1
- ---
2
- title: mock/
3
- sidebar_position: 5
4
- ---
5
1
  # mock/
6
2
 
7
3
  When there is a `config/mock/index.ts` or `config/mock/index.js` file in the
8
4
  project directory, Modern.js will automatically enable the Mock service during
9
- development. Use [`dev.mockDir`](/configure/app/dev/mock-dir) to customize
5
+ development. Use [`dev.mockDir`](/configure/app/dev/mock-dir.md) to customize
10
6
  this directory.
@@ -1,7 +1,3 @@
1
- ---
2
- title: public/
3
- sidebar_position: 3
4
- ---
5
1
  # public/
6
2
 
7
3
  Any static assets can be placed in the `public/` directory, and the files will be deployed to the corresponding application domain by the server.
@@ -1,7 +1,3 @@
1
- ---
2
- title: upload/
3
- sidebar_position: 4
4
- ---
5
1
  # upload/
6
2
 
7
3
  Any static assets can be placed in the `upload/` directory.
@@ -26,7 +22,7 @@ If the file ends with `.min.js`, it will not be compressed.
26
22
 
27
23
  ## More Usage
28
24
 
29
- In React components, you can add this prefix through [Environment Variables](/guides/basic-features/env-vars.html#asset_prefix):
25
+ In React components, you can add this prefix through [Environment Variables](/guides/basic-features/env-vars.md#asset_prefix):
30
26
 
31
27
  ```tsx
32
28
  export default () => {
@@ -36,13 +32,13 @@ export default () => {
36
32
  };
37
33
  ```
38
34
 
39
- In addition, whether it is in [Custom HTML](/guides/basic-features/html) or any HTML file under [`config/public/`](/apis/app/hooks/config/public), you can directly use HTML tags to reference resources in the `config/upload/` directory:
35
+ In addition, whether it is in [Custom HTML](/guides/basic-features/html.md) or any HTML file under [`config/public/`](/apis/app/hooks/config/public.md), you can directly use HTML tags to reference resources in the `config/upload/` directory:
40
36
 
41
37
  ```html
42
38
  <script src="/upload/index.js"></script>
43
39
  ```
44
40
 
45
- If you set the [`dev.assetPrefix`](/configure/app/dev/asset-prefix) or [`output.assetPrefix`](/configure/app/output/asset-prefix) prefix, you can also use template syntax to add the prefix directly:
41
+ If you set the [`dev.assetPrefix`](/configure/app/dev/asset-prefix.md) or [`output.assetPrefix`](/configure/app/output/asset-prefix.md) prefix, you can also use template syntax to add the prefix directly:
46
42
 
47
43
  ```html
48
44
  <script src="<%=assetPrefix %>/upload/index.js"></script>
@@ -1,9 +1,5 @@
1
- ---
2
- title: modern.config.ts
3
- sidebar_position: 8
4
- ---
5
1
  # modern.config.ts
6
2
 
7
3
  The Modern.js configuration file. Through this file, you can personalize the configuration of various aspects of the current project.
8
4
 
9
- To learn more about how to use the configuration, please refer to [Configuration Usage](/configure/app/usage).
5
+ To learn more about how to use the configuration, please refer to [Configuration Usage](/configure/app/usage.md).
@@ -1,10 +1,5 @@
1
- ---
2
- title: modern.server.ts
3
- sidebar_position: 1
4
- ---
5
-
6
1
  # modern.server.ts
7
2
 
8
- This file extends the Modern.js Server. In this file, you can configure [Middleware](/guides/advanced-features/web-server.html#middleware), [RenderMiddleware](/guides/advanced-features/web-server.html#rendermiddleware), or [Plugin](/guides/advanced-features/web-server.html#plugin) for the Server that starts with the Modern.js project.
3
+ This file extends the Modern.js Server. In this file, you can configure [Middleware](/guides/advanced-features/web-server.md#middleware), [RenderMiddleware](/guides/advanced-features/web-server.md#rendermiddleware), or [Plugin](/guides/advanced-features/web-server.md#plugin) for the Server that starts with the Modern.js project.
9
4
 
10
5
  You can intercept and handle requests and responses, perform authentication and role checks, preprocess requests, and handle exceptions, etc. You can also insert specific business logic into the built-in processing logic (including route matching, resource addressing, header injection, page rendering, and static web hosting).
@@ -1,7 +1,3 @@
1
- ---
2
- title: shared/
3
- sidebar_position: 5
4
- ---
5
1
  # shared/
6
2
 
7
3
  Shared source code directory. When there is common code in `api/`, `server/`, and `src/` in the project, you can put these codes in the `shared` directory instead of directly referencing them.
@@ -1,6 +1,6 @@
1
1
  # App.tsx
2
2
 
3
- The entry identifier when using [Self-controlled Routing](/guides/concept/entries.html#self-controlled-routing) in the application.
3
+ The entry identifier when using [Self-controlled Routing](/guides/concept/entries.md#self-controlled-routing) in the application.
4
4
 
5
5
  `App.tsx` is not the actual application entry; Modern.js will automatically generate the real entry file, which is roughly as follows:
6
6
 
@@ -26,5 +26,5 @@ render(<ModernRoot />, 'root');
26
26
  When `createRoot` is executed, it will retrieve the registered Global App and generate the actual React component.
27
27
 
28
28
  :::note
29
- In scenarios with multiple entry points, each entry can have its own independent `App.tsx`. For more details, see [Entry Points](/guides/concept/entries).
29
+ In scenarios with multiple entry points, each entry can have its own independent `App.tsx`. For more details, see [Entry Points](/guides/concept/entries.md).
30
30
  :::
@@ -1,11 +1,6 @@
1
- ---
2
- title: entry.ts
3
- sidebar_position: 4
4
- ---
5
-
6
1
  # entry.tsx
7
2
 
8
- Normally, the [`routes/`](/apis/app/hooks/src/routes.html) and [`App.tsx`](/apis/app/hooks/src/app) hook files can meet our needs. When we need to add custom behavior before component rendering or take full control of the Rspack packaging entry, we can create `entry.ts` file in the src or entry directory. Here are two cases for discussion。
3
+ Normally, the [`routes/`](/apis/app/hooks/src/routes.md) and [`App.tsx`](/apis/app/hooks/src/app.md) hook files can meet our needs. When we need to add custom behavior before component rendering or take full control of the Rspack packaging entry, we can create `entry.ts` file in the src or entry directory. Here are two cases for discussion。
9
4
 
10
5
  ## Add custom behavior before Render
11
6
 
@@ -1,8 +1,3 @@
1
- ---
2
- title: entry.server.tsx
3
- sidebar_position: 5
4
- ---
5
-
6
1
  # entry.server.tsx
7
2
 
8
3
  When the project initiates `server.ssr`, Modern.js generates a default Server-Side entry. The sample code is as follows:
@@ -1,9 +1,5 @@
1
- ---
2
- title: modern.runtime.ts
3
- sidebar_position: 4
4
- ---
5
1
  # modern.runtime.ts
6
2
 
7
3
  The Modern.js Runtime configuration file allows for personalized configuration of the Runtime capabilities for the current project.
8
4
 
9
- For specific usage of the configuration, please refer to [Runtime Configuration](/configure/app/runtime/0-intro.html).
5
+ For specific usage of the configuration, please refer to [Runtime Configuration](/configure/app/runtime/0-intro.md).
@@ -1,10 +1,6 @@
1
- ---
2
- title: routes/
3
- sidebar_position: 2
4
- ---
5
1
  # routes/
6
2
 
7
- The identifier for the entry point when the application uses [Conventional Routing](/guides/basic-features/routes/routes#conventional-routing).
3
+ The identifier for the entry point when the application uses [Conventional Routing](/guides/basic-features/routes/routes.md#conventional-routing).
8
4
 
9
5
  Conventional routing uses `routes/` as the convention for the entry point and analyzes the files in the `src/routes` directory to obtain the client-side routing configuration.
10
6
 
@@ -52,9 +48,9 @@ If the directory name of the route file is named with `[]`, the generated route
52
48
 
53
49
  The `routes/[id]/page.tsx` file will be converted to the `/:id` route. Except for the `/blog` route that can be matched exactly, all other `/xxx` routes will be matched to this route.
54
50
 
55
- In the component, you can use [useParams](/apis/app/runtime/router/router#useparams) to obtain the corresponding named parameter.
51
+ In the component, you can use [useParams](/apis/app/runtime/router/router.md#useparams) to obtain the corresponding named parameter.
56
52
 
57
- When using the [loader](/guides/basic-features/data/data-fetch#the-loader-function) function to obtain data, `params` will be passed as an input parameter to the `loader` function, and the corresponding parameter can be obtained through the attribute of `params`.
53
+ When using the [loader](/guides/basic-features/data/data-fetch.md#the-loader-function) function to obtain data, `params` will be passed as an input parameter to the `loader` function, and the corresponding parameter can be obtained through the attribute of `params`.
58
54
 
59
55
  ## Layout Component
60
56
 
@@ -1,7 +1,3 @@
1
- ---
2
- title: '*.[server|node].tsx'
3
- sidebar_position: 8
4
- ---
5
- # *.[server|node].tsx
1
+ # \*.\[server|node].tsx
6
2
 
7
3
  Used in the application project to place server-side code. When `*.tsx` and `*.[server|node].tsx` coexist, SSR will prefer to use the `*.[server|node].tsx` file instead of the `*.tsx` file when rendering on the server.
@@ -1,6 +1,3 @@
1
- ---
2
- title: useHonoContext
3
- ---
4
1
  # useHonoContext
5
2
 
6
3
  Used to obtain backend request context in an integrated BFF function.