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

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
@@ -0,0 +1,209 @@
1
+ # Plugin API
2
+
3
+ Modern.js's Server plugins allow you to extend and customize functionality during the server-side request processing phase, such as adding middleware, modifying request responses, etc.
4
+
5
+ :::info
6
+
7
+ Server plugins need to be configured via the `plugins` field in `server/modern.server.ts`.
8
+
9
+ :::
10
+
11
+ ## Plugin Basic Structure
12
+
13
+ A typical Server plugin structure is as follows:
14
+
15
+ ```typescript
16
+ import type { ServerPlugin } from '@modern-js/server-runtime';
17
+
18
+ const myServerPlugin = (): ServerPlugin => ({
19
+ name: '@my-org/my-server-plugin', // Plugin name, ensure uniqueness
20
+ setup: api => {
21
+ // Use the API here to register hooks, add middleware, etc.
22
+ api.onPrepare(() => {
23
+ const { middlewares } = api.getServerContext();
24
+ middlewares?.push({
25
+ name: 'my-middleware',
26
+ handler: async (c, next) => {
27
+ console.log('Processing request...');
28
+ await next();
29
+ },
30
+ });
31
+ });
32
+ },
33
+ });
34
+
35
+ export default myServerPlugin;
36
+ ```
37
+
38
+ - `name`: A unique identifier for the plugin.
39
+ - The `setup` function receives an `api` object, which provides all available Server plugin APIs.
40
+
41
+ ## Information Retrieval
42
+
43
+ #### `api.getServerContext`
44
+
45
+ Gets the context information of the Modern.js server.
46
+
47
+ - **Returns:** A `ServerContext` object containing the following fields:
48
+
49
+ | Field Name | Type | Description |
50
+ | ------------------- | ----------------- | -------------------------------------- |
51
+ | `middlewares` | `MiddlewareObj[]` | Middleware list |
52
+ | `renderMiddlewares` | `MiddlewareObj[]` | Render middleware list |
53
+ | `routes` | `ServerRoute[]` | Server routing information |
54
+ | `appDirectory` | `string` | Absolute path to the project root |
55
+ | `apiDirectory` | `string` | Absolute path to the API module dir |
56
+ | `lambdaDirectory` | `string` | Absolute path to the Lambda module dir |
57
+ | `sharedDirectory` | `string` | Absolute path to the shared module dir |
58
+ | `distDirectory` | `string` | Absolute path to the output directory |
59
+ | `plugins` | `ServerPlugin[]` | List of currently registered plugins |
60
+
61
+ - **Example:**
62
+
63
+ ```typescript
64
+ api.onPrepare(() => {
65
+ const serverContext = api.getServerContext();
66
+ console.log(`App directory: ${serverContext.appDirectory}`);
67
+ console.log(`${serverContext.plugins.length} plugins registered`);
68
+ });
69
+ ```
70
+
71
+ :::info
72
+ The context information returned by `getServerContext` is read-only. Use `updateServerContext` if you need to modify it.
73
+ :::
74
+
75
+ ***
76
+
77
+ #### `api.getServerConfig`
78
+
79
+ Gets the server configuration defined by the user in the `server/modern.server.ts` file.
80
+
81
+ - **Returns:** The user-defined server configuration object.
82
+ - **Example:**
83
+
84
+ ```typescript
85
+ api.onPrepare(() => {
86
+ const serverConfig = api.getServerConfig();
87
+ if (serverConfig.middlewares) {
88
+ console.log('User has customized middleware configuration');
89
+ }
90
+ });
91
+ ```
92
+
93
+ ***
94
+
95
+ #### `api.getHooks`
96
+
97
+ Gets all registered hook functions.
98
+
99
+ - **Returns:** An object containing all hook functions.
100
+ - **Example:**
101
+
102
+ ```typescript
103
+ const hooks = api.getHooks();
104
+ // Manually trigger the onPrepare hook
105
+ await hooks.onPrepare.call();
106
+ ```
107
+
108
+ :::warning
109
+ In custom plugins, you can only manually call the hooks registered by the corresponding plugin and cannot call official hooks to avoid affecting the normal execution order of the application.
110
+ :::
111
+
112
+ ***
113
+
114
+ ## Context Modification
115
+
116
+ #### `api.updateServerContext`
117
+
118
+ Updates the server context information.
119
+
120
+ - **Type:** `api.updateServerContext(updateContext: DeepPartial<ServerContext>)`
121
+ - **Parameters:**
122
+ - `updateContext`: The context object to update (partial update).
123
+ - **Execution Phase:** Can be used at any stage.
124
+ - **Example:**
125
+
126
+ ```typescript
127
+ api.onPrepare(() => {
128
+ const context = api.getServerContext();
129
+ api.updateServerContext({
130
+ middlewares: [
131
+ ...context.middlewares,
132
+ {
133
+ name: 'new-middleware',
134
+ handler: async (c, next) => {
135
+ await next();
136
+ },
137
+ },
138
+ ],
139
+ });
140
+ });
141
+ ```
142
+
143
+ ***
144
+
145
+ ## Lifecycle Hooks
146
+
147
+ #### `api.onPrepare`
148
+
149
+ Adds additional logic during the server preparation phase.
150
+
151
+ - **Type:** `api.onPrepare(prepareFn: () => void | Promise<void>)`
152
+ - **Parameters:**
153
+ - `prepareFn`: A preparation function, without parameters, can be asynchronous.
154
+ - **Execution Phase:** After the server completes configuration validation and before applying middleware.
155
+ - **Example:**
156
+
157
+ ```typescript
158
+ api.onPrepare(async () => {
159
+ const { middlewares } = api.getServerContext();
160
+
161
+ // Add custom middleware
162
+ middlewares.push({
163
+ name: 'request-logger',
164
+ handler: async (c, next) => {
165
+ const start = Date.now();
166
+ await next();
167
+ const duration = Date.now() - start;
168
+ console.log(`Request duration: ${duration}ms`);
169
+ },
170
+ });
171
+ });
172
+ ```
173
+
174
+ :::info
175
+ In the `onPrepare` hook, you can modify the context object returned by `getServerContext()` (such as `middlewares`, `renderMiddlewares`), and these modifications will take effect when the server starts.
176
+ :::
177
+
178
+ ***
179
+
180
+ #### `api.onReset`
181
+
182
+ Adds additional logic when the server resets.
183
+
184
+ - **Type:** `api.onReset(resetFn: (params: { event: ResetEvent }) => void | Promise<void>)`
185
+ - **Parameters:**
186
+ - `resetFn`: A reset handler function that receives reset event parameters.
187
+ - `event.type`: Event type, possible values:
188
+ - `'repack'`: Repack event
189
+ - `'file-change'`: File change event
190
+ - `event.payload`: When `type` is `'file-change'`, contains an array of file change information.
191
+ - **Execution Phase:** When files change or repack is needed.
192
+ - **Example:**
193
+
194
+ ```typescript
195
+ api.onReset(async ({ event }) => {
196
+ if (event.type === 'file-change') {
197
+ console.log('File changes detected:', event.payload);
198
+ // Perform cleanup or re-initialization operations
199
+ } else if (event.type === 'repack') {
200
+ }
201
+ });
202
+ ```
203
+
204
+ ***
205
+
206
+ ## Other Notes
207
+
208
+ - Refer to [Server Plugin Lifecycle](/plugin/server-plugins/life-cycle.md) to understand the execution order of plugin hooks.
209
+ - The execution order of middleware can be controlled through the `order` field (`'pre'`, `'default'`, `'post'`), or through the `before` field to specify execution before other middleware.
@@ -0,0 +1,13 @@
1
+ # Life Cycle
2
+
3
+
4
+ :::info
5
+
6
+ **Runtime Hooks**
7
+
8
+ The `onReset` hook is triggered at runtime when files change or code recompilation (rspack) is needed. It is not part of the initialization flow, so it is not shown in the diagram above.
9
+
10
+ - **Trigger Timing**: File changes (`event.type: 'file-change'`) or code recompilation (rspack) completion (`event.type: 'repack'`)
11
+ - **Use Cases**: Clearing cache, re-initializing resources, etc.
12
+
13
+ :::
@@ -0,0 +1,9 @@
1
+ # Route Authorization
2
+
3
+ Modern.js defaults to the convention-based routing based on React Router. For more details, please refer to [Routing](/guides/basic-features/routes/routes.md#routing).
4
+
5
+ In a web application, if there are multiple routes, we may need to authorize access to some of them before accessing them. For example, in the following scenario:
6
+
7
+ - Access to the `/` route does not require authorization and can be accessed directly.
8
+ - Access to the `/protected` route requires authorization. If there is no authorization, it will automatically redirect to the `/login` route. After successful login, it returns to `/protected`.
9
+
@@ -0,0 +1,16 @@
1
+ # Modern.js Example Library
2
+
3
+ Welcome to Modern.js Example Library! Here you'll find practical code examples to help you get started with Modern.js quickly.
4
+
5
+ If you're new to Modern.js, we recommend reading the [Modern.js Introduction](/guides/get-started/introduction.md) first.
6
+
7
+ ## 📚 Example List
8
+
9
+ - [Route Authorization](/tutorials/examples/csr-auth.md)
10
+ - ...
11
+
12
+ ***
13
+
14
+ ## 💡 Contribute Examples
15
+
16
+ If you have good examples to share, feel free to submit a PR on [GitHub](https://github.com/web-infra-dev/modern.js)!
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "modern",
18
18
  "modern.js"
19
19
  ],
20
- "version": "3.5.0-ultramodern.99",
20
+ "version": "3.8.1-ultramodern.2",
21
21
  "types": "./dist/types/index.d.ts",
22
22
  "main": "./dist/cjs/index.js",
23
23
  "exports": {
@@ -68,6 +68,10 @@
68
68
  "./types": {
69
69
  "types": "./lib/types.d.ts",
70
70
  "default": "./lib/types.d.ts"
71
+ },
72
+ "./bundle-docs": {
73
+ "types": "./dist/types/bundleDocs.d.ts",
74
+ "default": "./dist/esm-node/bundleDocs.mjs"
71
75
  }
72
76
  },
73
77
  "engines": {
@@ -89,20 +93,34 @@
89
93
  ],
90
94
  "config": [
91
95
  "./dist/types/config/public.d.ts"
96
+ ],
97
+ "bundle-docs": [
98
+ "./dist/types/bundleDocs.d.ts"
92
99
  ]
93
100
  }
94
101
  },
95
102
  "bin": {
96
103
  "modern": "bin/modern.js",
97
- "modern-app": "bin/modern.js"
104
+ "modern-app": "bin/modern.js",
105
+ "modern-bundle-docs": "bin/modern-bundle-docs.js"
98
106
  },
99
107
  "nx": {
100
108
  "targets": {
101
109
  "build": {
110
+ "dependsOn": [
111
+ "^build",
112
+ {
113
+ "projects": [
114
+ "@modern-js/main-doc"
115
+ ],
116
+ "target": "build"
117
+ }
118
+ ],
102
119
  "inputs": [
103
120
  "build",
104
121
  "^build",
105
- "{workspaceRoot}/packages/document/docs/en/**/*"
122
+ "{workspaceRoot}/packages/document/doc_build/**/*.md",
123
+ "{workspaceRoot}/packages/document/doc_build/llms.txt"
106
124
  ],
107
125
  "outputs": [
108
126
  "{projectRoot}/dist",
@@ -116,16 +134,16 @@
116
134
  "@babel/traverse": "^8.0.0",
117
135
  "@babel/types": "^8.0.0",
118
136
  "@loadable/component": "5.16.7",
119
- "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.5.0-ultramodern.99",
120
- "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.5.0-ultramodern.99",
121
- "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.5.0-ultramodern.99",
122
- "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.5.0-ultramodern.99",
123
- "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.5.0-ultramodern.99",
124
- "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.5.0-ultramodern.99",
125
- "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.5.0-ultramodern.99",
126
- "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.5.0-ultramodern.99",
127
- "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.5.0-ultramodern.99",
128
- "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.5.0-ultramodern.99",
137
+ "@modern-js/builder": "npm:@bleedingdev/modern-js-builder@3.8.1-ultramodern.2",
138
+ "@modern-js/i18n-utils": "npm:@bleedingdev/modern-js-i18n-utils@3.8.1-ultramodern.2",
139
+ "@modern-js/plugin": "npm:@bleedingdev/modern-js-plugin@3.8.1-ultramodern.2",
140
+ "@modern-js/plugin-data-loader": "npm:@bleedingdev/modern-js-plugin-data-loader@3.8.1-ultramodern.2",
141
+ "@modern-js/prod-server": "npm:@bleedingdev/modern-js-prod-server@3.8.1-ultramodern.2",
142
+ "@modern-js/server": "npm:@bleedingdev/modern-js-server@3.8.1-ultramodern.2",
143
+ "@modern-js/server-core": "npm:@bleedingdev/modern-js-server-core@3.8.1-ultramodern.2",
144
+ "@modern-js/server-utils": "npm:@bleedingdev/modern-js-server-utils@3.8.1-ultramodern.2",
145
+ "@modern-js/types": "npm:@bleedingdev/modern-js-types@3.8.1-ultramodern.2",
146
+ "@modern-js/utils": "npm:@bleedingdev/modern-js-utils@3.8.1-ultramodern.2",
129
147
  "@rsbuild/core": "2.1.5",
130
148
  "@swc/core": "1.15.43",
131
149
  "@swc/helpers": "^0.5.23",
@@ -143,7 +161,7 @@
143
161
  "@rslib/core": "0.23.2",
144
162
  "@scripts/rstest-config": "2.66.0",
145
163
  "@types/babel__traverse": "7.28.0",
146
- "@types/node": "^26.1.1",
164
+ "@types/node": "^26.2.0",
147
165
  "@typescript/native-preview": "7.0.0-dev.20260707.2",
148
166
  "ts-node": "^10.9.2",
149
167
  "tsconfig-paths": "^4.2.0",
@@ -167,7 +185,7 @@
167
185
  },
168
186
  "scripts": {
169
187
  "dev": "rslib build --watch",
170
- "build": "rslib build && pnpm -w tsgo:dts \"$PWD\" && pnpm run verify:public-surface && node ./scripts/copy-main-doc.mjs",
188
+ "build": "rslib build && pnpm -w tsgo:dts \"$PWD\" && pnpm run verify:public-surface && node ./bin/modern-bundle-docs.js",
171
189
  "verify:public-surface": "node ./tests/config/verify-public-surface.mjs",
172
190
  "test": "rstest"
173
191
  }
package/docs/_nav.json DELETED
@@ -1,36 +0,0 @@
1
- [
2
- {
3
- "text": "UltraModern Guide",
4
- "link": "/guides/get-started/ultramodern",
5
- "activeMatch": "/guides/"
6
- },
7
- {
8
- "text": "configure",
9
- "link": "/configure/app/usage",
10
- "activeMatch": "/configure/"
11
- },
12
- {
13
- "text": "plugin-menu",
14
- "link": "/plugin/introduction",
15
- "activeMatch": "/plugin/"
16
- },
17
- {
18
- "text": "apis",
19
- "link": "/apis/app/commands",
20
- "activeMatch": "/apis/"
21
- },
22
- {
23
- "text": "Examples",
24
- "link": "/tutorials/foundations/introduction",
25
- "activeMatch": "/tutorials/"
26
- },
27
- {
28
- "text": "community",
29
- "link": "/community/showcase",
30
- "activeMatch": "/community/"
31
- },
32
- {
33
- "text": "Upstream Modern.js 2.x Docs",
34
- "link": "https://modernjs.dev/v2"
35
- }
36
- ]
@@ -1,13 +0,0 @@
1
- [
2
- "app/commands",
3
- {
4
- "type": "dir",
5
- "name": "app/hooks",
6
- "label": "file-conventions"
7
- },
8
- {
9
- "type": "dir",
10
- "name": "app/runtime",
11
- "label": "runtime-api"
12
- }
13
- ]
@@ -1,28 +0,0 @@
1
- [
2
- {
3
- "type": "dir",
4
- "name": "src",
5
- "label": "src/",
6
- "collapsed": true
7
- },
8
- {
9
- "type": "dir",
10
- "name": "api",
11
- "label": "api/",
12
- "collapsed": true
13
- },
14
- {
15
- "type": "dir",
16
- "name": "server",
17
- "label": "server/",
18
- "collapsed": true
19
- },
20
- "shared",
21
- {
22
- "type": "dir",
23
- "name": "config",
24
- "label": "config/",
25
- "collapsed": true
26
- },
27
- "modern-config"
28
- ]
@@ -1 +0,0 @@
1
- ["html", "favicon", "icon", "mock", "public", "upload"]
@@ -1,32 +0,0 @@
1
- [
2
- {
3
- "type": "dir",
4
- "name": "core",
5
- "label": "Core",
6
- "collapsed": true
7
- },
8
- {
9
- "type": "dir",
10
- "name": "router",
11
- "label": "Router",
12
- "collapsed": true
13
- },
14
- {
15
- "type": "dir",
16
- "name": "ssr",
17
- "label": "SSR",
18
- "collapsed": true
19
- },
20
- {
21
- "type": "dir",
22
- "name": "bff",
23
- "label": "BFF",
24
- "collapsed": true
25
- },
26
- {
27
- "type": "dir",
28
- "name": "utility",
29
- "label": "Utility",
30
- "collapsed": true
31
- }
32
- ]
File without changes
@@ -1,45 +0,0 @@
1
- To build the production artifacts of the project, run `pnpm run build` in the project:
2
-
3
- ```bash
4
- $ pnpm run build
5
-
6
- > modern build
7
-
8
- Modern.js Framework
9
-
10
- info Starting production build...
11
- info Type checker is enabled. It may take some time.
12
- ready Client compiled in 6.19 s
13
- info Production file sizes:
14
-
15
- File Size Gzipped
16
- dist/routes-manifest.json 0.74 kB 0.28 kB
17
- dist/static/css/async/page.d7915515.css 1.4 kB 0.69 kB
18
- dist/static/js/main.5ae469e7.js 3.0 kB 1.3 kB
19
- dist/html/index/index.html 6.0 kB 2.6 kB
20
- dist/static/js/async/page.ddc8a4c1.js 19.2 kB 6.7 kB
21
- dist/static/js/34.171fffdb.js 21.3 kB 7.1 kB
22
- dist/static/js/lib-router.8995a55e.js 55.3 kB 18.1 kB
23
- dist/static/js/lib-lodash.53ec3384.js 71.4 kB 24.8 kB
24
- dist/static/js/lib-react.b5856db9.js 140.0 kB 45.2 kB
25
- dist/static/js/lib-polyfill.86c452b3.js 213.3 kB 69.9 kB
26
-
27
- Total size: 531.8 kB
28
- Gzipped size: 176.7 kB
29
- ```
30
-
31
- By default, the build artifacts are generated in `dist/`, with the following directory structure:
32
-
33
- ```
34
- dist
35
- ├── html
36
- │ └── index
37
- ├── modern.config.json
38
- ├── route.json
39
- ├── routes-manifest.json
40
- └── static
41
- ├── css
42
- └── js
43
- ```
44
-
45
- > If you need to customize the directory of the build artifacts, please refer to [Output files](/guides/basic-features/output-files).
@@ -1,3 +0,0 @@
1
- Refers to module bundlers such as [Rspack](https://rspack.rs/).
2
-
3
- The main goal of bundlers is to bundle JavaScript, CSS and other files together, and the bundled files can be used in the browser, Node.js or other environments. When bundler processes the Web application, it builds a dependency graph and then combines every module into one or more bundles.
File without changes
@@ -1,15 +0,0 @@
1
- Run `pnpm run dev` in the project to start the project:
2
-
3
- ```bash
4
- $ pnpm run dev
5
- > modern dev
6
-
7
- Modern.js Framework
8
-
9
- ready Client compiled in 0.86 s
10
-
11
- > Local: http://localhost:8080/
12
- > Network: http://192.168.0.1:8080/
13
- ```
14
-
15
- Open `http://localhost:8080/` in your browser to see the page content.
@@ -1,7 +0,0 @@
1
-
2
- ```yaml title=".browserslistrc"
3
- chrome >= 87
4
- edge >= 88
5
- firefox >= 78
6
- safari >= 14
7
- ```
@@ -1,14 +0,0 @@
1
- ## modern deploy
2
-
3
- The `modern deploy` command is used to generate artifacts required for the deployment platform.
4
-
5
- ```bash
6
- Usage: modern deploy [options]
7
-
8
- Options:
9
- -c --config <config> Specify configuration file path, either relative or absolute
10
- -s --skip-build Skip the build stage
11
- -h, --help Display command help
12
- ```
13
-
14
- For more details, refer to [Deploy Application](/guides/basic-features/deploy).
@@ -1 +0,0 @@
1
- After local develop, you can refer to the [Deployment](/guides/basic-features/deploy.html) section to deploy the project to the server.
@@ -1,3 +0,0 @@
1
- :::tip
2
- Please refer to the [Enable BFF](/en/guides/advanced-features/bff/function.html#enable-bff) section in Basic Usage to enable BFF functionality first.
3
- :::
@@ -1,56 +0,0 @@
1
- To enable BFF functionality in a Modern.js project, follow these steps to modify the code:
2
-
3
- 1. Install BFF plugin dependencies
4
-
5
- If the BFF plugin is not yet installed in your project, install it first:
6
-
7
- ```bash
8
- pnpm add @modern-js/plugin-bff
9
- ```
10
-
11
- :::tip Version Consistency
12
- Make sure the version of `@modern-js/plugin-bff` matches the version of `@modern-js/app-tools` in your project. All Modern.js official packages are released with a uniform version number, and version mismatches may cause compatibility issues.
13
-
14
- Check the version of `@modern-js/app-tools` first, then install the same version of `@modern-js/plugin-bff`:
15
-
16
- ```bash
17
- # Check the current version of @modern-js/app-tools
18
- pnpm list @modern-js/app-tools
19
-
20
- # Install the same version of @modern-js/plugin-bff
21
- pnpm add @modern-js/plugin-bff@<version>
22
- ```
23
-
24
- :::
25
-
26
- 2. Configure `modern.config.ts`
27
-
28
- Import and add the BFF plugin in the `modern.config.ts` file:
29
-
30
- ```ts title="modern.config.ts"
31
- import { defineConfig, appTools } from '@modern-js/app-tools';
32
- import { bffPlugin } from '@modern-js/plugin-bff';
33
-
34
- export default defineConfig({
35
- plugins: [appTools(), bffPlugin()],
36
- });
37
- ```
38
-
39
- 3. Configure TypeScript alias
40
-
41
- To correctly recognize the `@api` alias in TypeScript, it is recommended to add path mapping in `tsconfig.json`:
42
-
43
- ```json title="tsconfig.json"
44
- {
45
- "compilerOptions": {
46
- "paths": {
47
- ..., // other paths,
48
- "@api/*": ["./api/lambda/*"]
49
- }
50
- },
51
- "include": [
52
- ..., // other include directories
53
- "api" // Add api directory
54
- ]
55
- }
56
- ```