@modern-js/main-doc 2.0.0-beta.0 → 2.0.0-beta.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 (507) hide show
  1. package/.turbo/turbo-build.log +4 -0
  2. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/_category_.json +8 -0
  3. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/build.md +44 -0
  4. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/dev.md +31 -0
  5. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/index.md +12 -0
  6. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/inspect.md +39 -0
  7. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +22 -0
  8. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/new.md +59 -0
  9. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/start.md +32 -0
  10. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/test.md +36 -0
  11. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/upgrade.md +21 -0
  12. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/_category_.json +8 -0
  13. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/_category_.json +4 -0
  14. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/_category_.json +4 -0
  15. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/lambda.md +54 -0
  16. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/_category_.json +4 -0
  17. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/api.md +78 -0
  18. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/app.md +12 -0
  19. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/common.md +10 -0
  20. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/test.md +10 -0
  21. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/_category_.json +4 -0
  22. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/html.md +8 -0
  23. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/icon.md +15 -0
  24. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/mock.md +6 -0
  25. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/public.md +28 -0
  26. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/storybook.md +12 -0
  27. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/upload.md +42 -0
  28. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/index.md +7 -0
  29. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/modern-config.md +8 -0
  30. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/_category_.json +4 -0
  31. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/index_.md +14 -0
  32. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/test.md +10 -0
  33. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/shared.md +6 -0
  34. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/_category_.json +4 -0
  35. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/app.md +45 -0
  36. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/index_.md +34 -0
  37. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/pages.md +180 -0
  38. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/stories.md +12 -0
  39. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/test.md +12 -0
  40. package/en/docusaurus-plugin-content-docs/current/apis/app/overview.md +12 -0
  41. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/_category_.json +9 -0
  42. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/_category_.json +4 -0
  43. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/define-config.md +60 -0
  44. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/_category_.json +4 -0
  45. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/hook.md +43 -0
  46. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/use-context.md +36 -0
  47. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/_category_.json +5 -0
  48. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +55 -0
  49. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/create-app.md +47 -0
  50. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-loader.md +83 -0
  51. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-module-apps.md +101 -0
  52. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-runtime-context.md +59 -0
  53. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/default-alias.md +25 -0
  54. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/env.md +72 -0
  55. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/index.md +12 -0
  56. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/Provider.md +35 -0
  57. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/_category_.json +4 -0
  58. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/auto-actions.md +120 -0
  59. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +140 -0
  60. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-app.md +73 -0
  61. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +62 -0
  62. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +105 -0
  63. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +197 -0
  64. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-local-model.md +27 -0
  65. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +89 -0
  66. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-static-model.md +49 -0
  67. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +48 -0
  68. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/_category_.json +4 -0
  69. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/abstract.md +26 -0
  70. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook-api.md +896 -0
  71. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook.md +170 -0
  72. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/plugin-api.md +117 -0
  73. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/_category_.json +4 -0
  74. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/router.md +492 -0
  75. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/_category_.json +4 -0
  76. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/no-ssr.md +44 -0
  77. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/pre-render.md +91 -0
  78. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/_category_.json +4 -0
  79. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/act.md +34 -0
  80. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/cleanup.md +38 -0
  81. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/render.md +72 -0
  82. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/renderApp.md +33 -0
  83. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/_category_.json +4 -0
  84. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/css-in-js.md +42 -0
  85. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/head.md +39 -0
  86. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/loadable.md +85 -0
  87. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/_category_.json +4 -0
  88. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/hook.md +131 -0
  89. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/middleware.md +106 -0
  90. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/fetcher.md +28 -0
  91. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/prefix.md +33 -0
  92. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/proxy.md +75 -0
  93. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/asset-prefix.md +0 -1
  94. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/hmr.md +0 -1
  95. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/https.md +0 -1
  96. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/port.md +0 -1
  97. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/progress-bar.md +0 -1
  98. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/proxy.md +80 -0
  99. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/start-url.md +0 -1
  100. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/with-master-app.md +32 -0
  101. package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +12 -0
  102. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/app-icon.md +0 -1
  103. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/crossorigin.md +0 -1
  104. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/disable-html-folder.md +0 -1
  105. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/favicon-by-entries.md +0 -1
  106. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/favicon.md +0 -1
  107. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/inject-by-entries.md +0 -1
  108. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/inject.md +0 -1
  109. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/meta-by-entries.md +0 -1
  110. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/meta.md +0 -1
  111. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/mount-id.md +0 -1
  112. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-by-entries.md +0 -1
  113. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-parameters-by-entries.md +0 -1
  114. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-parameters.md +0 -1
  115. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template.md +0 -1
  116. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/title-by-entries.md +0 -1
  117. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/title.md +0 -1
  118. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/asset-prefix.md +0 -1
  119. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/assets-retry.md +0 -1
  120. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/charset.md +0 -1
  121. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/clean-dist-path.md +0 -1
  122. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/convert-to-rem.md +0 -1
  123. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/copy.md +0 -1
  124. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/css-module-local-ident-name.md +0 -1
  125. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/data-uri-limit.md +0 -1
  126. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-css-module-extension.md +0 -1
  127. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-filename-hash.md +0 -1
  128. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-inline-runtime-chunk.md +0 -1
  129. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-minimize.md +0 -1
  130. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-node-polyfill.md +20 -0
  131. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-source-map.md +0 -1
  132. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +12 -0
  133. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/dist-path.md +0 -1
  134. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-asset-fallback.md +0 -1
  135. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-asset-manifest.md +0 -1
  136. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-css-module-tsdeclaration.md +0 -1
  137. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-inline-scripts.md +0 -1
  138. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-inline-styles.md +0 -1
  139. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-latest-decorators.md +0 -1
  140. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-modern-mode.md +34 -0
  141. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/externals.md +0 -1
  142. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/filename.md +0 -1
  143. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/legal-comments.md +0 -1
  144. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/override-browserslist.md +0 -1
  145. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/polyfill.md +0 -1
  146. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/svg-default-export.md +0 -1
  147. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/build-cache.md +0 -1
  148. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/bundle-analyze.md +0 -1
  149. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/chunk-split.md +0 -1
  150. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/print-file-size.md +0 -1
  151. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/profile.md +0 -1
  152. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/remove-console.md +0 -1
  153. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/remove-moment-locale.md +0 -1
  154. package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +74 -0
  155. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/intro.md +91 -0
  156. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/master-app.md +60 -0
  157. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +19 -0
  158. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/state.md +41 -0
  159. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/security/sri.md +0 -1
  160. package/en/docusaurus-plugin-content-docs/current/configure/app/server/base-url.md +33 -0
  161. package/en/docusaurus-plugin-content-docs/current/configure/app/server/port.md +18 -0
  162. package/en/docusaurus-plugin-content-docs/current/configure/app/server/public-routes.md +26 -0
  163. package/en/docusaurus-plugin-content-docs/current/configure/app/server/routes.md +91 -0
  164. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr-by-entries.md +28 -0
  165. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr.md +20 -0
  166. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/alias.md +0 -1
  167. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/compile-js-data-uri.md +0 -1
  168. package/en/docusaurus-plugin-content-docs/current/configure/app/source/config-dir.md +23 -0
  169. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/define.md +0 -1
  170. package/en/docusaurus-plugin-content-docs/current/configure/app/source/design-system.md +1150 -0
  171. package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-default-entries.md +28 -0
  172. package/en/docusaurus-plugin-content-docs/current/configure/app/source/enable-async-entry.md +50 -0
  173. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries-dir.md +38 -0
  174. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries.md +62 -0
  175. package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +12 -0
  176. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/global-vars.md +0 -1
  177. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/include.md +0 -1
  178. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/module-scopes.md +0 -1
  179. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/pre-entry.md +0 -1
  180. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/resolve-extension-prefix.md +0 -1
  181. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/resolve-main-fields.md +0 -1
  182. package/en/docusaurus-plugin-content-docs/current/configure/app/testing/transformer.md +18 -0
  183. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/autoprefixer.md +0 -1
  184. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/babel.md +0 -1
  185. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/css-extract.md +0 -1
  186. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/css-loader.md +0 -1
  187. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/dev-server.md +0 -1
  188. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/esbuild.md +61 -0
  189. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/html-plugin.md +0 -1
  190. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/inspector.md +0 -1
  191. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/jest.md +39 -0
  192. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/less.md +0 -1
  193. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/minify-css.md +0 -1
  194. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/postcss.md +0 -1
  195. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/pug.md +0 -1
  196. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/sass.md +0 -1
  197. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/style-loader.md +0 -1
  198. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/styled-components.md +0 -1
  199. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/tailwindcss.md +47 -0
  200. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/terser.md +0 -1
  201. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/ts-checker.md +0 -1
  202. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/ts-loader.md +0 -1
  203. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/webpack-chain.md +0 -1
  204. package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/webpack.md +0 -1
  205. package/en/docusaurus-plugin-content-docs/current/configure/app/usage.md +92 -0
  206. package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/_category_.json +0 -0
  207. package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/basic.md +0 -0
  208. package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/introduction.md +0 -0
  209. package/en/docusaurus-plugin-content-docs/current.json +262 -0
  210. package/package.json +7 -5
  211. package/scripts/config.ts +98 -0
  212. package/scripts/summary.en.json +1 -0
  213. package/scripts/summary.zh.json +1 -0
  214. package/scripts/sync.ts +26 -5
  215. package/zh/apis/app/commands/build.md +2 -2
  216. package/zh/apis/app/commands/dev.md +1 -1
  217. package/zh/apis/app/commands/index.md +1 -1
  218. package/zh/apis/app/commands/lint.md +2 -2
  219. package/zh/apis/app/commands/new.md +1 -1
  220. package/zh/apis/app/commands/start.md +1 -1
  221. package/zh/apis/app/commands/test.md +1 -1
  222. package/zh/apis/app/commands/upgrade.md +0 -2
  223. package/zh/apis/app/hooks/api/framework/_category_.json +1 -1
  224. package/zh/apis/app/hooks/api/framework/lambda.md +8 -33
  225. package/zh/apis/app/hooks/api/functions/_category_.json +1 -1
  226. package/zh/apis/app/hooks/api/functions/api.md +29 -2
  227. package/zh/apis/app/hooks/api/functions/app.md +5 -3
  228. package/zh/apis/app/hooks/api/functions/common.md +3 -5
  229. package/zh/apis/app/hooks/api/test.md +2 -4
  230. package/zh/apis/app/hooks/config/html.md +1 -3
  231. package/zh/apis/app/hooks/config/icon.md +2 -2
  232. package/zh/apis/app/hooks/config/mock.md +2 -8
  233. package/zh/apis/app/hooks/config/public.md +2 -4
  234. package/zh/apis/app/hooks/config/storybook.md +2 -4
  235. package/zh/apis/app/hooks/config/upload.md +1 -7
  236. package/zh/apis/app/hooks/modern-config.md +1 -3
  237. package/zh/apis/app/hooks/server/index_.md +12 -0
  238. package/zh/apis/app/hooks/server/test.md +3 -3
  239. package/zh/apis/app/hooks/shared.md +1 -2
  240. package/zh/apis/app/hooks/src/app.md +8 -4
  241. package/zh/apis/app/hooks/src/{index.md → index_.md} +2 -2
  242. package/zh/apis/app/hooks/src/pages.md +3 -4
  243. package/zh/apis/app/hooks/src/stories.md +2 -2
  244. package/zh/apis/app/hooks/src/test.md +1 -1
  245. package/zh/apis/app/overview.md +1 -1
  246. package/zh/apis/app/runtime/app/_category_.json +2 -2
  247. package/zh/apis/app/runtime/app/define-config.md +14 -10
  248. package/zh/apis/app/runtime/bff/_category_.json +4 -0
  249. package/zh/apis/app/runtime/bff/hook.md +43 -0
  250. package/zh/apis/app/runtime/bff/use-context.md +36 -0
  251. package/zh/apis/app/runtime/core/_category_.json +4 -0
  252. package/zh/apis/app/runtime/core/bootstrap.md +55 -0
  253. package/zh/apis/app/runtime/core/create-app.md +47 -0
  254. package/zh/apis/app/runtime/core/use-loader.md +83 -0
  255. package/zh/apis/app/runtime/core/use-module-apps.md +101 -0
  256. package/zh/apis/app/runtime/core/use-runtime-context.md +59 -0
  257. package/zh/apis/app/runtime/default-alias.md +4 -7
  258. package/zh/apis/app/runtime/env.md +22 -20
  259. package/zh/apis/app/runtime/model/Provider.md +6 -8
  260. package/zh/apis/app/runtime/model/_category_.json +1 -1
  261. package/zh/apis/app/runtime/model/auto-actions.md +1 -2
  262. package/zh/apis/app/runtime/model/connect.md +8 -5
  263. package/zh/apis/app/runtime/model/create-app.md +3 -4
  264. package/zh/apis/app/runtime/model/create-store.md +5 -3
  265. package/zh/apis/app/runtime/model/handle-effect.md +5 -5
  266. package/zh/apis/app/runtime/model/model_.md +3 -3
  267. package/zh/apis/app/runtime/model/use-local-model.md +2 -2
  268. package/zh/apis/app/runtime/model/use-model.md +6 -7
  269. package/zh/apis/app/runtime/model/use-static-model.md +2 -2
  270. package/zh/apis/app/runtime/model/use-store.md +3 -3
  271. package/zh/apis/app/runtime/router/_category_.json +4 -0
  272. package/zh/apis/app/runtime/{container → router}/router.md +0 -0
  273. package/zh/apis/app/runtime/ssr/_category_.json +4 -0
  274. package/zh/apis/app/runtime/ssr/no-ssr.md +41 -0
  275. package/zh/apis/app/runtime/ssr/pre-render.md +91 -0
  276. package/zh/apis/app/runtime/testing/_category_.json +1 -1
  277. package/zh/apis/app/runtime/testing/act.md +8 -8
  278. package/zh/apis/app/runtime/testing/cleanup.md +10 -9
  279. package/zh/apis/app/runtime/testing/render.md +43 -23
  280. package/zh/apis/app/runtime/testing/renderApp.md +8 -8
  281. package/zh/apis/app/runtime/utility/_category_.json +1 -1
  282. package/zh/apis/app/runtime/utility/css-in-js.md +17 -35
  283. package/zh/apis/app/runtime/{app → utility}/head.md +6 -10
  284. package/zh/apis/app/runtime/utility/{loadable/loadable_.md → loadable.md} +29 -56
  285. package/zh/apis/app/runtime/web-server/_category_.json +1 -1
  286. package/zh/apis/app/runtime/web-server/hook.md +100 -90
  287. package/zh/apis/app/runtime/web-server/middleware.md +106 -0
  288. package/zh/apis/monorepo/commands/bump.md +1 -1
  289. package/zh/apis/monorepo/commands/change.md +1 -1
  290. package/zh/apis/monorepo/commands/clear.md +1 -1
  291. package/zh/apis/monorepo/commands/deploy.md +1 -1
  292. package/zh/apis/monorepo/commands/gen-release-note.md +1 -1
  293. package/zh/apis/monorepo/commands/lint.md +1 -1
  294. package/zh/apis/monorepo/commands/new.md +1 -1
  295. package/zh/apis/monorepo/commands/pre.md +1 -1
  296. package/zh/apis/monorepo/commands/release.md +1 -1
  297. package/zh/configure/app/bff/fetcher.md +1 -2
  298. package/zh/configure/app/bff/prefix.md +2 -3
  299. package/zh/configure/app/bff/proxy.md +8 -13
  300. package/zh/configure/app/dev/asset-prefix.md +0 -1
  301. package/zh/configure/app/dev/hmr.md +0 -1
  302. package/zh/configure/app/dev/https.md +0 -1
  303. package/zh/configure/app/dev/port.md +0 -1
  304. package/zh/configure/app/dev/progress-bar.md +0 -1
  305. package/zh/configure/app/dev/proxy.md +2 -3
  306. package/zh/configure/app/dev/start-url.md +0 -1
  307. package/zh/configure/app/dev/with-master-app.md +0 -1
  308. package/zh/configure/app/experiments/lazy-compilation.md +12 -0
  309. package/zh/configure/app/html/app-icon.md +0 -1
  310. package/zh/configure/app/html/crossorigin.md +0 -1
  311. package/zh/configure/app/html/disable-html-folder.md +0 -1
  312. package/zh/configure/app/html/favicon-by-entries.md +0 -1
  313. package/zh/configure/app/html/favicon.md +0 -1
  314. package/zh/configure/app/html/inject-by-entries.md +0 -1
  315. package/zh/configure/app/html/inject.md +0 -1
  316. package/zh/configure/app/html/meta-by-entries.md +0 -1
  317. package/zh/configure/app/html/meta.md +0 -1
  318. package/zh/configure/app/html/mount-id.md +0 -1
  319. package/zh/configure/app/html/template-by-entries.md +0 -1
  320. package/zh/configure/app/html/template-parameters-by-entries.md +0 -1
  321. package/zh/configure/app/html/template-parameters.md +0 -1
  322. package/zh/configure/app/html/template.md +0 -1
  323. package/zh/configure/app/html/title-by-entries.md +0 -1
  324. package/zh/configure/app/html/title.md +0 -1
  325. package/zh/configure/app/output/asset-prefix.md +0 -1
  326. package/zh/configure/app/output/assets-retry.md +0 -1
  327. package/zh/configure/app/output/charset.md +0 -1
  328. package/zh/configure/app/output/clean-dist-path.md +0 -1
  329. package/zh/configure/app/output/convert-to-rem.md +0 -1
  330. package/zh/configure/app/output/copy.md +0 -1
  331. package/zh/configure/app/output/css-module-local-ident-name.md +0 -1
  332. package/zh/configure/app/output/data-uri-limit.md +0 -1
  333. package/zh/configure/app/output/disable-css-module-extension.md +0 -1
  334. package/zh/configure/app/output/disable-filename-hash.md +0 -1
  335. package/zh/configure/app/output/disable-inline-runtime-chunk.md +0 -1
  336. package/zh/configure/app/output/disable-minimize.md +0 -1
  337. package/zh/configure/app/output/disable-node-polyfill.md +2 -4
  338. package/zh/configure/app/output/disable-source-map.md +0 -1
  339. package/zh/configure/app/output/disable-ts-checker.md +12 -0
  340. package/zh/configure/app/output/dist-path.md +0 -1
  341. package/zh/configure/app/output/enable-asset-fallback.md +0 -1
  342. package/zh/configure/app/output/enable-asset-manifest.md +0 -1
  343. package/zh/configure/app/output/enable-css-module-tsdeclaration.md +0 -1
  344. package/zh/configure/app/output/enable-inline-scripts.md +0 -1
  345. package/zh/configure/app/output/enable-inline-styles.md +0 -1
  346. package/zh/configure/app/output/enable-latest-decorators.md +0 -1
  347. package/zh/configure/app/output/enable-modern-mode.md +13 -5
  348. package/zh/configure/app/output/externals.md +0 -1
  349. package/zh/configure/app/output/filename.md +0 -1
  350. package/zh/configure/app/output/legal-comments.md +0 -1
  351. package/zh/configure/app/output/override-browserslist.md +0 -1
  352. package/zh/configure/app/output/polyfill.md +0 -1
  353. package/zh/configure/app/output/svg-default-export.md +0 -1
  354. package/zh/configure/app/performance/build-cache.md +0 -1
  355. package/zh/configure/app/performance/bundle-analyze.md +0 -1
  356. package/zh/configure/app/performance/chunk-split.md +0 -1
  357. package/zh/configure/app/performance/print-file-size.md +0 -1
  358. package/zh/configure/app/performance/profile.md +0 -1
  359. package/zh/configure/app/performance/remove-console.md +0 -1
  360. package/zh/configure/app/performance/remove-moment-locale.md +0 -1
  361. package/zh/configure/app/runtime/intro.md +92 -0
  362. package/zh/configure/app/runtime/master-app.md +8 -21
  363. package/zh/configure/app/runtime/router.md +4 -38
  364. package/zh/configure/app/runtime/state.md +10 -13
  365. package/zh/configure/app/security/sri.md +0 -1
  366. package/zh/configure/app/server/base-url.md +1 -2
  367. package/zh/configure/app/server/port.md +1 -2
  368. package/zh/configure/app/server/public-routes.md +1 -2
  369. package/zh/configure/app/server/routes.md +4 -5
  370. package/zh/configure/app/server/ssr-by-entries.md +2 -3
  371. package/zh/configure/app/server/ssr.md +1 -2
  372. package/zh/configure/app/source/alias.md +0 -1
  373. package/zh/configure/app/source/compile-js-data-uri.md +0 -1
  374. package/zh/configure/app/source/config-dir.md +12 -4
  375. package/zh/configure/app/source/define.md +0 -1
  376. package/zh/configure/app/source/design-system.md +14 -24
  377. package/zh/configure/app/source/disable-default-entries.md +8 -3
  378. package/zh/configure/app/source/enable-async-entry.md +3 -3
  379. package/zh/configure/app/source/entries-dir.md +1 -1
  380. package/zh/configure/app/source/entries.md +16 -9
  381. package/zh/configure/app/source/exclude.md +12 -0
  382. package/zh/configure/app/source/global-vars.md +0 -1
  383. package/zh/configure/app/source/include.md +0 -1
  384. package/zh/configure/app/source/module-scopes.md +0 -1
  385. package/zh/configure/app/source/pre-entry.md +0 -1
  386. package/zh/configure/app/source/resolve-extension-prefix.md +0 -1
  387. package/zh/configure/app/source/resolve-main-fields.md +0 -1
  388. package/zh/configure/app/testing/transformer.md +2 -4
  389. package/zh/configure/app/tools/autoprefixer.md +0 -1
  390. package/zh/configure/app/tools/babel.md +0 -1
  391. package/zh/configure/app/tools/css-extract.md +0 -1
  392. package/zh/configure/app/tools/css-loader.md +0 -1
  393. package/zh/configure/app/tools/dev-server.md +0 -1
  394. package/zh/configure/app/tools/esbuild.md +5 -5
  395. package/zh/configure/app/tools/html-plugin.md +0 -1
  396. package/zh/configure/app/tools/inspector.md +0 -1
  397. package/zh/configure/app/tools/jest.md +2 -4
  398. package/zh/configure/app/tools/less.md +0 -1
  399. package/zh/configure/app/tools/minify-css.md +0 -1
  400. package/zh/configure/app/tools/postcss.md +0 -1
  401. package/zh/configure/app/tools/pug.md +0 -1
  402. package/zh/configure/app/tools/sass.md +0 -1
  403. package/zh/configure/app/tools/style-loader.md +0 -1
  404. package/zh/configure/app/tools/styled-components.md +0 -1
  405. package/zh/configure/app/tools/terser.md +0 -1
  406. package/zh/configure/app/tools/ts-checker.md +0 -1
  407. package/zh/configure/app/tools/ts-loader.md +0 -1
  408. package/zh/configure/app/tools/webpack-chain.md +0 -1
  409. package/zh/configure/app/tools/webpack.md +0 -1
  410. package/zh/configure/app/usage.md +15 -4
  411. package/zh/guides/advanced-features/bff/bff-server.md +1 -1
  412. package/zh/guides/advanced-features/bff/frameworks.md +0 -221
  413. package/zh/guides/advanced-features/code-split.md +1 -1
  414. package/zh/guides/advanced-features/low-level.md +2 -2
  415. package/zh/guides/advanced-features/ssg.md +2 -2
  416. package/zh/guides/advanced-features/ssr.md +4 -4
  417. package/zh/guides/basic-features/alias.md +1 -1
  418. package/zh/guides/basic-features/css/postcss.md +1 -1
  419. package/zh/guides/basic-features/css/tailwindcss.md +2 -2
  420. package/zh/guides/basic-features/env-vars.md +2 -3
  421. package/zh/guides/basic-features/proxy.md +2 -2
  422. package/zh/guides/topic-detail/compile-speed.md +5 -5
  423. package/zh/guides/topic-detail/generator/_category_.json +4 -0
  424. package/zh/guides/topic-detail/generator/codesmith/_category_.json +4 -0
  425. package/zh/guides/topic-detail/generator/codesmith/introduce.md +5 -0
  426. package/zh/guides/topic-detail/generator/config/_category_.json +4 -0
  427. package/zh/{configure/generator/introduce.md → guides/topic-detail/generator/config/common.md} +35 -42
  428. package/zh/{configure/generator → guides/topic-detail/generator/config}/module.md +7 -11
  429. package/zh/{configure/generator → guides/topic-detail/generator/config}/monorepo.md +4 -4
  430. package/zh/{configure/generator → guides/topic-detail/generator/config}/mwa.md +11 -45
  431. package/zh/guides/topic-detail/generator/plugin/_category_.json +4 -0
  432. package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/abstract.md +0 -0
  433. package/zh/guides/topic-detail/generator/plugin/api/_category_.json +4 -0
  434. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/_category_.json +0 -0
  435. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addFile.md +1 -1
  436. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addHelper.md +0 -0
  437. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addManyFile.md +1 -1
  438. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addPartial.md +0 -0
  439. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/introduce.md +0 -0
  440. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/rmDir.md +0 -0
  441. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/rmFile.md +0 -0
  442. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateJSONFile.md +0 -0
  443. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateModernConfig.md +0 -0
  444. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateTextRawFile.md +0 -0
  445. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/_category_.json +0 -0
  446. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/gitAddAndCommit.md +0 -0
  447. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/initGitRepo.md +0 -0
  448. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/isInGitRepo.md +0 -0
  449. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/_category_.json +0 -0
  450. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/afterForged.md +1 -1
  451. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/onForged.md +1 -1
  452. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/_category_.json +0 -0
  453. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/isFileExit.md +0 -0
  454. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/locale.md +0 -0
  455. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/readDir.md +0 -0
  456. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/_category_.json +0 -0
  457. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/addInputAfter.md +14 -6
  458. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/addInputBefore.md +14 -6
  459. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/setInput.md +2 -2
  460. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/setInputValue.md +0 -0
  461. package/zh/guides/topic-detail/generator/plugin/api/input/type.md +65 -0
  462. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/introduce.md +0 -0
  463. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/_category_.json +0 -0
  464. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/createElement.md +1 -1
  465. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/createSubProject.md +1 -1
  466. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/enableFunc.md +1 -3
  467. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/introduce.md +3 -3
  468. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/npm/_category_.json +0 -0
  469. package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/npm/install.md +0 -0
  470. package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/develop.md +4 -4
  471. package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/use.md +0 -0
  472. package/zh/guides/topic-detail/generator/project.md +117 -0
  473. package/zh/guides/topic-detail/micro-frontend/debugging.md +5 -5
  474. package/zh/guides/topic-detail/micro-frontend/route-mode.md +2 -2
  475. package/zh/guides/troubleshooting/compile.md +3 -3
  476. package/zh/tutorials/first-app/c01-getting-started/1.4-enable-ssr.md +2 -2
  477. package/zh/tutorials/first-app/c04-es6-plus-and-ts/4.3-compatibility.md +4 -4
  478. package/zh/tutorials/first-app/c06-css-and-component/6.4-design-system.md +3 -3
  479. package/zh/tutorials/first-app/c07-app-entry/7.3-manage-entries-by-hand.md +2 -2
  480. package/zh/tutorials/first-app/c08-client-side-routing/8.1-code-based-routing.md +1 -1
  481. package/scripts/gen-config.ts +0 -60
  482. package/zh/apis/app/hooks/api/framework/app.md +0 -100
  483. package/zh/apis/app/hooks/server/index.md +0 -14
  484. package/zh/apis/app/hooks/src/error.md +0 -10
  485. package/zh/apis/app/hooks/src/eslint.md +0 -9
  486. package/zh/apis/app/runtime/app/bootstrap.md +0 -83
  487. package/zh/apis/app/runtime/app/create-app.md +0 -47
  488. package/zh/apis/app/runtime/app/no-ssr.md +0 -41
  489. package/zh/apis/app/runtime/app/pre-render.md +0 -77
  490. package/zh/apis/app/runtime/app/use-module-app.md +0 -60
  491. package/zh/apis/app/runtime/app/use-module-apps.md +0 -64
  492. package/zh/apis/app/runtime/app/use-runtime-context.md +0 -39
  493. package/zh/apis/app/runtime/bff-server/_category_.json +0 -4
  494. package/zh/apis/app/runtime/bff-server/after-lambda-registed.md +0 -35
  495. package/zh/apis/app/runtime/bff-server/hook.md +0 -120
  496. package/zh/apis/app/runtime/bff-server/use-context.md +0 -70
  497. package/zh/apis/app/runtime/container/_category_.json +0 -4
  498. package/zh/apis/app/runtime/container/use-loader.md +0 -64
  499. package/zh/apis/app/runtime/utility/loadable/_category_.json +0 -4
  500. package/zh/apis/app/runtime/utility/loadable/lazy.md +0 -29
  501. package/zh/apis/app/runtime/utility/loadable/loadable-component.md +0 -61
  502. package/zh/apis/app/runtime/utility/loadable/loadable-library.md +0 -67
  503. package/zh/apis/generator/plugin/_category_.json +0 -4
  504. package/zh/apis/generator/plugin/input/addOptionAfter.md +0 -45
  505. package/zh/apis/generator/plugin/input/addOptionBefore.md +0 -45
  506. package/zh/apis/generator/plugin/input/type.md +0 -101
  507. package/zh/guides/topic-detail/generator-plugin/_category_.json +0 -4
@@ -0,0 +1,4 @@
1
+
2
+ > @modern-js/main-doc@2.0.0-beta.1 build /github/workspace/packages/toolkit/main-doc
3
+ > npx ts-node ./scripts/sync.ts
4
+
@@ -0,0 +1,8 @@
1
+ {
2
+ "label": "Commands",
3
+ "position": 3,
4
+ "link": {
5
+ "type": "doc",
6
+ "id": "apis/app/commands/index"
7
+ }
8
+ }
@@ -0,0 +1,44 @@
1
+ ---
2
+ sidebar_position: 5
3
+ ---
4
+
5
+ ```bash
6
+ Usage: modern build [options]
7
+
8
+ build application
9
+
10
+ Options:
11
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
12
+ -h, --help show command help
13
+ --analyze analyze the bundle and view size of each module
14
+ ```
15
+
16
+ `modern build` command will by default build production in `dist/`.
17
+
18
+ you can configure the [`output.distPath`](/docs/configure/app/output/dist-path) specifies the output directory for the product.
19
+
20
+ ## Analyze Bundle
21
+
22
+ execute `npx modern build --analyze` command,can produce an HTML file that analyzes the volume of the bundle while packaging the production code:
23
+
24
+ ```
25
+ Bundle Analyzer saved report to /example/dist/report.html
26
+ File sizes after production build:
27
+
28
+ 122.35 KB dist/static/js/885.1d4fbe5a.js
29
+ 2.3 KB dist/static/js/main.4b8e8d64.js
30
+ 761 B dist/static/js/runtime-main.edb7cf35.js
31
+ 645 B dist/static/css/main.0dd3ecc1.css
32
+ ```
33
+
34
+ Open the above HTML file in the browser, you can see the tile diagram of the packaged product, and perform package volume analysis and optimization:
35
+
36
+ <img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/aphqeh7uhohpquloj/modern-js/mwa-build-analyze-8784f762c1ab0cb20935829d5f912c4c.png" />
37
+
38
+ > this features based on [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer).
39
+
40
+ ## Command Arguments
41
+
42
+ import CommandTip from '@site-docs/components/command-tip.md'
43
+
44
+ <CommandTip />
@@ -0,0 +1,31 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # dev
6
+
7
+ ```bash
8
+ Usage: modern dev [options]
9
+
10
+ Development commands
11
+
12
+ Options:
13
+ -e --entry <entry> compiler by entry
14
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
15
+ -h, --help show command help
16
+ --analyze analyze the bundle and view size of each module
17
+ --api-only only start API service
18
+ ```
19
+
20
+ `modern dev` start a development server,watch file change,default support React Fast Refresh:
21
+
22
+ ```bash
23
+ App running at:
24
+
25
+ > Local: http://localhost:8080/
26
+ > Network: http://192.168.0.1:8080/
27
+ ```
28
+
29
+ import CommandTip from '@site-docs/components/command-tip.md'
30
+
31
+ <CommandTip />
@@ -0,0 +1,12 @@
1
+ ---
2
+ type: ref
3
+ ---
4
+
5
+ # Commands
6
+
7
+ This section covers all commands.
8
+
9
+
10
+
11
+
12
+
@@ -0,0 +1,39 @@
1
+ ---
2
+ sidebar_position: 7
3
+ ---
4
+
5
+ ```
6
+ Usage: modern inspect [options]
7
+
8
+ inspect internal webpack config
9
+
10
+ Options:
11
+ --env <env> view the configuration in the target environment (default: "development")
12
+ --output <output> Specify the path to output in the dist (default: "/")
13
+ --no-console Do not output the full result in shell
14
+ --verbose Show the full function in the result
15
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
16
+ -h, --help show command help
17
+ ```
18
+
19
+ `modern inspect` command used to view the full webpack configuration of the project.
20
+
21
+ Executing the command `npx modern inspect` in the project will output the webpack configuration on the shell, and will also generate a `webpack.client.inspect.js` file in the project's `dist` directory, which developers can open and view manually.
22
+
23
+ ## Configuration Env
24
+
25
+ By default, the webpack configuration of the development environment is output. And the `env` option can be used to output the configuration of the production environment:
26
+
27
+ ```bash
28
+ modern inspect --env production
29
+ ```
30
+
31
+ ## Configuration Type
32
+
33
+ ### SSR Configuration
34
+
35
+ If the project has SSR enable, an additional `webpack.ssr.inspect.js` file will be generated in the `dist/`, corresponding to the webpack configuration at SSR build time.
36
+
37
+ ### Modern Configuration
38
+
39
+ if project enable [enableModernMode](/docs/configure/app/output/enable-modern-mode), an additional `webpack.modern.inspect.js` file will be generated in the `dist/`corresponding to the webpack configuration at modern web build.
@@ -0,0 +1,22 @@
1
+ ---
2
+ sidebar_position: 4
3
+ title: lint
4
+ ---
5
+
6
+ ```bash
7
+ Usage: modern lint [options] [...files]
8
+
9
+ lint and fix source files
10
+
11
+ Options:
12
+ --no-fix disable auto fix source file
13
+ -h, --help display help for command
14
+ ```
15
+
16
+ Run ESLint to check the syntax of the code. Normally, only the part of the code modified by this commit needs to be checked by `lint-staged` during the `git commit` phase.
17
+
18
+ * `--no-fix` close auto fix by lint.
19
+
20
+ import CommandTip from '@site-docs/components/command-tip.md'
21
+
22
+ <CommandTip />
@@ -0,0 +1,59 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
5
+ ```bash
6
+ Usage: modern new [options]
7
+
8
+ Execution Generator in App
9
+
10
+ Options:
11
+ -d, --debug using debug mode to log something (default: false)
12
+ -c, --config <config> set default generator config(json string)
13
+ --dist-tag <tag> use specified tag version for its generator
14
+ --registry set npm registry url to run npm command
15
+ -h, --help show command help
16
+ ```
17
+
18
+ The `modern new` command is used to enable features to an existing project.
19
+
20
+ For example, add application entry, enable some optional features such as Tailwind CSS, micro frontend, etc.
21
+
22
+ import CommandTip from '@site-docs/components/command-tip.md'
23
+
24
+ <CommandTip />
25
+
26
+ ### Add Entry
27
+
28
+ In the project, execute the `new` command to add entries as follows:
29
+
30
+ ```bash
31
+ $ npx modern new
32
+ ? 请选择你想要的操作 创建工程元素
33
+ ? 创建工程元素 新建「应用入口」
34
+ ? 请填写入口名称 entry
35
+ ? 是否需要调整默认配置? 否
36
+ ```
37
+
38
+ ### Enable Features
39
+
40
+ In the project, execute the `new` command to enable features as follows:
41
+
42
+ ```bash
43
+ $ npx modern new
44
+ ? 请选择你想要的操作 启用可选功能
45
+ ? 启用可选功能 (Use arrow keys)
46
+ ❯ 启用 Tailwind CSS 支持
47
+ 启用 Less 支持
48
+ 启用 Sass 支持
49
+ 启用「BFF」功能
50
+ 启用「微前端」模式
51
+ 启用「单元测试 / 集成测试」功能
52
+ 启用「Visual Testing (Storybook)」模式
53
+ ```
54
+
55
+ :::caution
56
+ The `--config` parameter needs to use a JSON string.
57
+
58
+ pnpm does not support the use of JSON strings as parameter values currently. Use `npm new` to turn on.【[Relate Issue](https://github.com/pnpm/pnpm/issues/3876)】
59
+ :::
@@ -0,0 +1,32 @@
1
+ ---
2
+ sidebar_position: 6
3
+ ---
4
+
5
+ ```bash
6
+ Usage: modern start [options]
7
+
8
+ start server
9
+
10
+ Options:
11
+ -c --config <config> configuration file path, which can be a relative path or an absolute path
12
+ -h, --help show command help
13
+ --api-only only start API service
14
+ ```
15
+
16
+ Usually use the `modern start` command to enable project start in the production environment, and you need to execute the [`build'](/docs/apis/app/commands/build) command in advance to build the product.
17
+
18
+ By default, the project will start in `localhost:8080`, you can modify the Server port number with `server.port`:
19
+
20
+ ```js
21
+ export default defineConfig({
22
+ server: {
23
+ port: 8081,
24
+ }
25
+ })
26
+ ```
27
+
28
+ import CommandTip from '@site-docs/components/command-tip.md'
29
+
30
+ <CommandTip />
31
+
32
+
@@ -0,0 +1,36 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
5
+ ```bash
6
+ Usage: modern test [options]
7
+
8
+ Options:
9
+ -h, --help show command help
10
+ ```
11
+
12
+ :::caution
13
+ `modern test` command need to execute the `new` command in advance to enable the `unit test/integration test`.
14
+ :::
15
+
16
+ `modern test` command will automatically run the test cases, the effect is as follows:
17
+
18
+ ```bash
19
+ $ npx modern test
20
+ PASS src/tests/index.test.ts
21
+ The add method
22
+ ✓ should work fine. (2ms)
23
+
24
+ Test Suites: 1 passed, 1 total
25
+ Tests: 1 passed, 1 total
26
+ Snapshots: 0 total
27
+ Time: 0.994 s, estimated 1 s
28
+ ```
29
+
30
+ :::info
31
+ files match `*.test.(js|ts)` in `api/` or `src/` will be recognized as test cases by default。
32
+ :::
33
+
34
+ import CommandTip from '@site-docs/components/command-tip.md'
35
+
36
+ <CommandTip />
@@ -0,0 +1,21 @@
1
+ ---
2
+ sidebar_position: 8
3
+ ---
4
+
5
+ ```
6
+ Usage: modern upgrade [options]
7
+
8
+ upgrade Modern.js to latest version.
9
+
10
+ Options:
11
+ --registry <registry> specify npm registry (default: "")
12
+ -d,--debug using debug mode to log something (default: false)
13
+ --cwd <cwd> app directory (default: "")
14
+ -h, --help show command help
15
+ ```
16
+
17
+ Execute the command `npx modern upgrade` in the project, by default, dependencies in the `package.json` are updated to the latest version.
18
+
19
+ :::info
20
+ the command is available in `@modern-js/app-tools` version >= 1.17.0, previous versions can be upgraded with `npx @modern-js/upgrade`.
21
+ :::
@@ -0,0 +1,8 @@
1
+ {
2
+ "label": "Convention",
3
+ "position": 1,
4
+ "link": {
5
+ "type": "doc",
6
+ "id": "apis/app/hooks/index"
7
+ }
8
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "api/",
3
+ "position": 2
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "框架写法",
3
+ "position": 2
4
+ }
@@ -0,0 +1,54 @@
1
+ ---
2
+ title: lambda/*.[tj]s
3
+ sidebar_position: 1
4
+ ---
5
+
6
+ Declaring API routing in BFF framework mode. Except [some files](/docs/apis/app/hooks/api/framework/lambda#allow-list),files in `api/` are registered as routes.
7
+
8
+ :::info
9
+ use `api/` need execute new command to enable the 「BFF」 feature.
10
+ :::
11
+
12
+ :::tip
13
+ this file supports the use `js` or `ts`, but the functions must be exported using the ESM syntax.
14
+ :::
15
+
16
+ ## Routing Rule
17
+
18
+ ### Default Route
19
+
20
+ The files named `index` will be upper level routing:
21
+
22
+ * `api/lambda/index.ts` -> `$BASENAME/`
23
+ * `api/lambda/user/index.ts` -> `$BASENAME/user`
24
+
25
+ ### Multi Level Route
26
+
27
+ The routing system also supports parsing multiple levels of files. and if you create a folder, the files will still be automatically parsed in the same way.
28
+
29
+ * `api/lambda/hello.ts` -> `$BASENAME/hello`
30
+ * `api/lambda/user/list.ts` -> `$BASENAME/user/list`
31
+
32
+ ### Dynamic Route
33
+
34
+ Dynamic named routing parameters can be supported by creating folders or files with `[xxx]`.
35
+
36
+ * `api/lambda/user/[username]/info.ts` -> `$BASENAME/user/:username/info`
37
+ * `api/lambda/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
38
+ * `api/lambda/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
39
+
40
+ the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`。
41
+
42
+ ### Allow List
43
+
44
+ By default, all files in the `api/` will be parsed as BFF function. but we also set a allow list, and these files will not be parsed:
45
+
46
+ * file name start with `_`, for example: `_utils.ts`.
47
+ * files in directory that name start with `_`, for example:`_utils/index.ts`、`_utils/cp.ts`.
48
+ * test files, for example:`foo.test.ts`.
49
+ * TypeScript define files, for example:`hello.d.ts`.
50
+ * files in `node_module`.
51
+
52
+ ## Define Function
53
+
54
+ the same as [Define Function](/docs/apis/app/hooks/api/functions/api#define-function).
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "函数写法",
3
+ "position": 1
4
+ }
@@ -0,0 +1,78 @@
1
+ ---
2
+ title: "**/*.[tj]s"
3
+ sidebar_position: 1
4
+ ---
5
+
6
+ Declaring API routing in BFF function mode. Except [some files](/docs/apis/app/hooks/api/functions/api#allow-list),files in `api/` are registered as routes.
7
+
8
+ :::info
9
+ use `api/` need execute new command to enable the 「BFF」 feature.
10
+ :::
11
+
12
+ :::tip
13
+ this file supports the use `js` or `ts`, but the functions must be exported using the ESM syntax.
14
+ :::
15
+
16
+ ## Routing Rule
17
+
18
+ ### Default Route
19
+
20
+ The files named `index` will be upper level routing:
21
+
22
+ * `api/index.ts` -> `$BASENAME/`
23
+ * `api/user/index.ts` -> `$BASENAME/user`
24
+
25
+ ### Multi Level Route
26
+
27
+ The routing system also supports parsing multiple levels of files. and if you create a folder, the files will still be automatically parsed in the same way.
28
+
29
+ * `api/hello.ts` -> `$BASENAME/hello`
30
+ * `api/user/list.ts` -> `$BASENAME/user/list`
31
+
32
+ ### Dynamic Route
33
+
34
+ Dynamic named routing parameters can be supported by creating folders or files with `[xxx]`.
35
+
36
+ * `api/user/[username]/info.ts` -> `$BASENAME/user/:username/info`
37
+ * `api/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
38
+ * `api/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
39
+
40
+ the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`。
41
+
42
+ ### Allow List
43
+
44
+ By default, all files in the `api/` will be parsed as BFF function. but we also set a allow list, and these files will not be parsed:
45
+
46
+ * file name start with `_`, for example: `_utils.ts`.
47
+ * files in directory that name start with `_`, for example:`_utils/index.ts`、`_utils/cp.ts`.
48
+ * test files, for example:`foo.test.ts`.
49
+ * TypeScript define files, for example:`hello.d.ts`.
50
+ * files in `node_module`.
51
+
52
+ ## Define Function
53
+
54
+ In addition to the above routing rules, the function definition and export in the code also have conventions.
55
+
56
+ function need named exports,and the name of the exported function is the HTTP Method:
57
+
58
+ ```ts
59
+ export const get = async () => {
60
+ return {
61
+ name: 'Modern.js',
62
+ desc: 'Modern web Solutions',
63
+ };
64
+ };
65
+ ```
66
+
67
+ Export the function like above will generate a `POST` interface.
68
+
69
+ App support 9 Method definitions: `GET`、`POST`、`PUT`、`DELETE`、`CONNECT`、`TRACE`、`PATCH`、`OPTION`、`HEAD`. so App can use these name as function export nane.
70
+
71
+ The name is insensitive, whaterver `get`、`Get`、`GEt`、`GET`, can be accurately identified. And default export, `export default xxx` will be `Get` method.
72
+
73
+ because `delete` is a keyword in JavaScript, use `del` or `DELETE` instead.
74
+
75
+ Multiple functions of different Methods can be defined in one file, but if multiple functions of the same Method are defined, only the first can work.
76
+
77
+ :::info
78
+ It should be noted that the defined functions should be asynchronous, which is related to the type when the function is called.
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: _app.[tj]s
3
+ sidebar_position: 3
4
+ ---
5
+
6
+ in BFF function mode,this file can add middleware before [BFF 函数](/docs/apis/app/hooks/api/functions/api).
7
+
8
+ :::note
9
+ For detail, see [hook](/docs/apis/app/runtime/bff/hook)
10
+ :::
11
+
12
+
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: "**/_*.[tj]s, _*/**"
3
+ sidebar_position: 2
4
+ ---
5
+
6
+ under BFF function mode, these files are not registered as routes.
7
+
8
+ Any files that not routes, but required in the project can be named in this way.
9
+
10
+
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: test.[tj]s
3
+ sidebar_position: 2
4
+ ---
5
+
6
+ App's BFF test file,support for writing test cases in the `api/` directory which file with suffix `.test.[tj]s`.
7
+
8
+ :::info
9
+ To use unit test and integration test, you need to execute the `new` command in advance to enable the `unit test/integration test`.
10
+ :::
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "config/",
3
+ "position": 6
4
+ }
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: html/
3
+ sidebar_position: 1
4
+ ---
5
+
6
+ The `config/html` directory allows you to inject custom html snippets in different places in the default html template.
7
+
8
+ For detail, see [HTML](/docs/guides/basic-features/html).
@@ -0,0 +1,15 @@
1
+ ---
2
+ title: icon.png
3
+ sidebar_position: 2
4
+ ---
5
+
6
+ When `config/icon.png` exist, it can inject app icon information into the html page at build time:
7
+
8
+ ```
9
+ .config
10
+ └── icon.png
11
+ ```
12
+
13
+ the app icon `link` meta will be injected into the html, as follows:
14
+
15
+ ![app-icon](https://lf3-static.bytednsdoc.com/obj/eden-cn/aphqeh7uhohpquloj/modern-js/api/app-icon.png)
@@ -0,0 +1,6 @@
1
+ ---
2
+ title: mock/
3
+ sidebar_position: 5
4
+ ---
5
+
6
+ when `config/mock/index.js` exist,Modernjs auto start the Mock service in the development.
@@ -0,0 +1,28 @@
1
+ ---
2
+ title: public/
3
+ sidebar_position: 3
4
+ ---
5
+
6
+ Static resource files in any format can be placed in the `public/`, and the files will be Served under the web application domain name.
7
+
8
+ ## Description
9
+
10
+ The routing of files to be served is based on the convention of the file system. `public/` is the root directory, which corresponds to the root path of the Web application.
11
+
12
+ For example, the `config/public/sdk/index.js` file will be Served under `${domain}/sdk/index.js` after deployment.
13
+
14
+ ## Scene
15
+
16
+ For example, `robots.txt`, `auth.xml` and other authentication file.
17
+
18
+ SDK (requiring the same routing) for other business, or an HTML file for static host.
19
+
20
+ :::info
21
+ For static resources (such as SVG pictures) that need to be referenced by import in the source code, it is recommended to put them in the `src/assets/` for management.
22
+ :::
23
+
24
+ ## Compression
25
+
26
+ If the file is a `.js` file, it will be automatically compressed when the production environment is built.
27
+
28
+ If the file ends with `.min.js`, it will not compression.
@@ -0,0 +1,12 @@
1
+ ---
2
+ title: storybook/
3
+ sidebar_position: 7
4
+ ---
5
+
6
+ Modern.js.js supports debugging with Storybook. When you need to configure Storybook, configure it in the `config/storybook/`.
7
+
8
+ For detail, see [Storybook](https://storybook.js.org/docs/react/configure/overview).
9
+
10
+ :::info
11
+ Debugging with Storybook requires executing the `new` command to enable the 「Visual Testing (Storybook)」 mode feature.
12
+ :::
@@ -0,0 +1,42 @@
1
+ ---
2
+ title: upload/
3
+ sidebar_position: 4
4
+ ---
5
+
6
+ Static resource files in any format can be placed in the `upload/`.
7
+
8
+ ## Description
9
+
10
+ In the development environment, the static resource files in this directory will be hosted in the '/upload' path. After building the application product, the files in this directory will be copied to the dist path.
11
+
12
+ This file convention is mainly used for developers to use plugins to upload static resource files to the CDN.
13
+
14
+ ## Scene
15
+
16
+ For example, the SDK used by the project such as `google-analysis.js` (usually requires http caching).
17
+
18
+ Images, font files, generic CSS, etc.
19
+
20
+ ## Compression
21
+
22
+ If the file is a `.js` file, it will be automatically compressed when the production environment is built.
23
+
24
+ If the file ends with `.min.js`, it will not compression.
25
+
26
+ ## More Usage
27
+
28
+ Whether in [custom HTML](/docs/guides/basic-features/html), or in any HTML file under ['config/public/'](/docs/apis/app/hooks/config/public), you can directly use the HTML tag to refer to the resources in the `config/upload/`:
29
+
30
+ ```html
31
+ <script src="/upload/index.js"></script>
32
+ ```
33
+
34
+ if [`output.assetPrefix`](/docs/configure/app/output/asset-prefix) is configured,add this prefix directly using template syntax:
35
+
36
+ ```html
37
+ <script src="<%=assetPrefix %>/upload/index.js"></script>
38
+ ```
39
+
40
+ :::info
41
+ Modern.js does not support the use files under `upload/` in `config/public/*.css` via URL.
42
+ :::
@@ -0,0 +1,7 @@
1
+ ---
2
+ type: ref
3
+ ---
4
+
5
+ # Convention
6
+
7
+ This section covers all documentation conventions.
@@ -0,0 +1,8 @@
1
+ ---
2
+ title: modern.config.js
3
+ sidebar_position: 8
4
+ ---
5
+
6
+ Modern.js config file, through which you can confiured all aspects of the current project.
7
+
8
+ For detail, see [configure](/docs/configure/app/usage).
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "server/",
3
+ "position": 3
4
+ }