@modern-js/main-doc 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (525) hide show
  1. package/.turbo/turbo-build.log +1 -1
  2. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/index.md +0 -5
  3. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +1 -1
  4. package/en/docusaurus-plugin-content-docs/current/apis/app/commands/serve.md +2 -4
  5. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/lambda.md +12 -12
  6. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/api.md +13 -13
  7. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/app.md +0 -2
  8. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/common.md +1 -3
  9. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/app.md +16 -9
  10. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/index_.md +0 -1
  11. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/routes.md +5 -3
  12. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/server.md +6 -4
  13. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/stories.md +2 -2
  14. package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/test.md +1 -1
  15. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/define-config.md +0 -1
  16. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/hook.md +3 -3
  17. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +3 -6
  18. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/create-app.md +1 -3
  19. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-loader.md +2 -2
  20. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-module-apps.md +58 -51
  21. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-runtime-context.md +3 -4
  22. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/index.md +0 -5
  23. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/Provider.md +1 -1
  24. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +8 -5
  25. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +1 -3
  26. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +3 -3
  27. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +0 -1
  28. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +0 -3
  29. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +0 -2
  30. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/router.md +23 -54
  31. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/no-ssr.md +1 -8
  32. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/pre-render.md +10 -6
  33. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/render.md +0 -2
  34. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/css-in-js.md +2 -2
  35. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/head.md +3 -5
  36. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/loadable.md +14 -15
  37. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/hook.md +4 -5
  38. package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/middleware.md +7 -6
  39. package/en/docusaurus-plugin-content-docs/current/components/command-tip.md +3 -2
  40. package/en/docusaurus-plugin-content-docs/current/components/debug-app.md +17 -0
  41. package/en/docusaurus-plugin-content-docs/current/components/enable-bff.md +10 -14
  42. package/en/docusaurus-plugin-content-docs/current/components/enable-micro-frontend.md +4 -4
  43. package/en/docusaurus-plugin-content-docs/current/components/global-proxy-config.md +6 -9
  44. package/en/docusaurus-plugin-content-docs/current/components/global-proxy.md +0 -1
  45. package/en/docusaurus-plugin-content-docs/current/components/micro-master-manifest-config.md +2 -2
  46. package/en/docusaurus-plugin-content-docs/current/components/micro-runtime-config.md +1 -1
  47. package/en/docusaurus-plugin-content-docs/current/components/prerequisites.md +19 -0
  48. package/en/docusaurus-plugin-content-docs/current/components/reduck-migration.md +0 -1
  49. package/en/docusaurus-plugin-content-docs/current/components/reduck-tip.md +1 -1
  50. package/en/docusaurus-plugin-content-docs/current/components/router-legacy-tip.md +0 -1
  51. package/en/docusaurus-plugin-content-docs/current/configure/app/auto-load-plugin.md +8 -9
  52. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/prefix.md +6 -6
  53. package/en/docusaurus-plugin-content-docs/current/configure/app/bff/proxy.md +8 -9
  54. package/en/docusaurus-plugin-content-docs/current/configure/app/builder-plugins.md +6 -6
  55. package/en/docusaurus-plugin-content-docs/current/configure/app/deploy/microFrontend.md +11 -13
  56. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/asset-prefix.md +2 -2
  57. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/hmr.md +2 -2
  58. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/https.md +2 -2
  59. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/port.md +2 -2
  60. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/progress-bar.md +2 -2
  61. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/proxy.md +0 -1
  62. package/en/docusaurus-plugin-content-docs/current/configure/app/dev/start-url.md +2 -2
  63. package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +2 -2
  64. package/en/docusaurus-plugin-content-docs/current/configure/app/html/app-icon.md +2 -2
  65. package/en/docusaurus-plugin-content-docs/current/configure/app/html/crossorigin.md +2 -2
  66. package/en/docusaurus-plugin-content-docs/current/configure/app/html/disable-html-folder.md +2 -2
  67. package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon-by-entries.md +2 -2
  68. package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon.md +2 -2
  69. package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject-by-entries.md +2 -2
  70. package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject.md +2 -2
  71. package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta-by-entries.md +2 -2
  72. package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta.md +2 -2
  73. package/en/docusaurus-plugin-content-docs/current/configure/app/html/mount-id.md +2 -2
  74. package/en/docusaurus-plugin-content-docs/current/configure/app/html/tags-by-entries.md +12 -0
  75. package/en/docusaurus-plugin-content-docs/current/configure/app/html/tags.md +12 -0
  76. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-by-entries.md +2 -2
  77. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters-by-entries.md +2 -2
  78. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters.md +2 -2
  79. package/en/docusaurus-plugin-content-docs/current/configure/app/html/template.md +2 -2
  80. package/en/docusaurus-plugin-content-docs/current/configure/app/html/title-by-entries.md +2 -2
  81. package/en/docusaurus-plugin-content-docs/current/configure/app/html/title.md +2 -2
  82. package/en/docusaurus-plugin-content-docs/current/configure/app/output/asset-prefix.md +2 -2
  83. package/en/docusaurus-plugin-content-docs/current/configure/app/output/assets-retry.md +2 -2
  84. package/en/docusaurus-plugin-content-docs/current/configure/app/output/charset.md +2 -2
  85. package/en/docusaurus-plugin-content-docs/current/configure/app/output/clean-dist-path.md +2 -2
  86. package/en/docusaurus-plugin-content-docs/current/configure/app/output/convert-to-rem.md +2 -2
  87. package/en/docusaurus-plugin-content-docs/current/configure/app/output/copy.md +2 -2
  88. package/en/docusaurus-plugin-content-docs/current/configure/app/output/css-module-local-ident-name.md +2 -2
  89. package/en/docusaurus-plugin-content-docs/current/configure/app/output/data-uri-limit.md +2 -2
  90. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-extract.md +2 -2
  91. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-module-extension.md +2 -2
  92. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-filename-hash.md +2 -2
  93. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-inline-runtime-chunk.md +2 -2
  94. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-minimize.md +2 -2
  95. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-node-polyfill.md +8 -6
  96. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-source-map.md +2 -2
  97. package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +2 -2
  98. package/en/docusaurus-plugin-content-docs/current/configure/app/output/dist-path.md +2 -2
  99. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-fallback.md +2 -2
  100. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-manifest.md +2 -2
  101. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-css-module-tsdeclaration.md +2 -2
  102. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-scripts.md +2 -2
  103. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-styles.md +2 -2
  104. package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-latest-decorators.md +2 -2
  105. package/en/docusaurus-plugin-content-docs/current/configure/app/output/externals.md +2 -2
  106. package/en/docusaurus-plugin-content-docs/current/configure/app/output/filename.md +2 -2
  107. package/en/docusaurus-plugin-content-docs/current/configure/app/output/legal-comments.md +2 -2
  108. package/en/docusaurus-plugin-content-docs/current/configure/app/output/override-browserslist.md +2 -2
  109. package/en/docusaurus-plugin-content-docs/current/configure/app/output/polyfill.md +2 -2
  110. package/en/docusaurus-plugin-content-docs/current/configure/app/output/ssg.md +3 -2
  111. package/en/docusaurus-plugin-content-docs/current/configure/app/output/svg-default-export.md +2 -2
  112. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/build-cache.md +2 -2
  113. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/bundle-analyze.md +2 -2
  114. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/chunk-split.md +2 -2
  115. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/print-file-size.md +2 -2
  116. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/profile.md +2 -2
  117. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-console.md +2 -2
  118. package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-moment-locale.md +2 -2
  119. package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +6 -6
  120. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/intro.md +11 -10
  121. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/master-app.md +1 -2
  122. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +7 -7
  123. package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/state.md +15 -15
  124. package/en/docusaurus-plugin-content-docs/current/configure/app/security/sri.md +2 -2
  125. package/en/docusaurus-plugin-content-docs/current/configure/app/server/base-url.md +3 -4
  126. package/en/docusaurus-plugin-content-docs/current/configure/app/server/enable-framework-ext.md +5 -4
  127. package/en/docusaurus-plugin-content-docs/current/configure/app/server/port.md +24 -4
  128. package/en/docusaurus-plugin-content-docs/current/configure/app/server/public-routes.md +6 -6
  129. package/en/docusaurus-plugin-content-docs/current/configure/app/server/routes.md +7 -7
  130. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr-by-entries.md +5 -5
  131. package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr.md +4 -4
  132. package/en/docusaurus-plugin-content-docs/current/configure/app/source/alias.md +2 -2
  133. package/en/docusaurus-plugin-content-docs/current/configure/app/source/compile-js-data-uri.md +2 -2
  134. package/en/docusaurus-plugin-content-docs/current/configure/app/source/config-dir.md +2 -2
  135. package/en/docusaurus-plugin-content-docs/current/configure/app/source/define.md +2 -2
  136. package/en/docusaurus-plugin-content-docs/current/configure/app/source/design-system.md +656 -634
  137. package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-default-entries.md +1 -1
  138. package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-entry-dirs.md +8 -8
  139. package/en/docusaurus-plugin-content-docs/current/configure/app/source/enable-async-entry.md +1 -1
  140. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries-dir.md +7 -7
  141. package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries.md +4 -6
  142. package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +2 -2
  143. package/en/docusaurus-plugin-content-docs/current/configure/app/source/global-vars.md +2 -2
  144. package/en/docusaurus-plugin-content-docs/current/configure/app/source/include.md +2 -2
  145. package/en/docusaurus-plugin-content-docs/current/configure/app/source/module-scopes.md +2 -2
  146. package/en/docusaurus-plugin-content-docs/current/configure/app/source/pre-entry.md +2 -2
  147. package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-extension-prefix.md +2 -2
  148. package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-main-fields.md +2 -2
  149. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/autoprefixer.md +2 -2
  150. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/babel.md +2 -2
  151. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-extract.md +2 -2
  152. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-loader.md +2 -2
  153. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/dev-server.md +2 -2
  154. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/html-plugin.md +2 -2
  155. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/inspector.md +2 -2
  156. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/jest.md +9 -9
  157. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/less.md +2 -2
  158. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/minify-css.md +2 -2
  159. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/postcss.md +2 -2
  160. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/pug.md +2 -2
  161. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/sass.md +2 -2
  162. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/style-loader.md +2 -2
  163. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/styled-components.md +2 -2
  164. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/swc.md +12 -1
  165. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/terser.md +2 -2
  166. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-checker.md +2 -2
  167. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-loader.md +2 -2
  168. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack-chain.md +2 -2
  169. package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack.md +2 -2
  170. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/frameworks.md +6 -6
  171. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/function.md +44 -38
  172. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/index.md +9 -9
  173. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/type.md +0 -1
  174. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/code-split.md +3 -4
  175. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/compatibility.md +6 -7
  176. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/eslint.md +0 -1
  177. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/index.md +0 -5
  178. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/low-level.md +17 -19
  179. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/ssg.md +8 -10
  180. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/ssr.md +5 -11
  181. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/testing.md +3 -3
  182. package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/web-server.md +3 -4
  183. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/alias.md +7 -11
  184. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/css-in-js.md +6 -6
  185. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/css-modules.md +2 -2
  186. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/less-sass.md +1 -2
  187. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/postcss.md +43 -47
  188. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/tailwindcss.md +3 -3
  189. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/data-fetch.md +106 -192
  190. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/env-vars.md +8 -8
  191. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/html.md +55 -47
  192. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/mock.md +4 -4
  193. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/proxy.md +4 -5
  194. package/en/docusaurus-plugin-content-docs/current/guides/basic-features/routes.md +90 -9
  195. package/en/docusaurus-plugin-content-docs/current/guides/concept/entries.md +1 -2
  196. package/en/docusaurus-plugin-content-docs/current/guides/get-started/quick-start.md +2 -2
  197. package/en/docusaurus-plugin-content-docs/current/guides/get-started/upgrade.md +1 -1
  198. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/extend.md +13 -13
  199. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/hook-list.md +2 -2
  200. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/hook.md +57 -54
  201. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/implement.md +11 -11
  202. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/lifecycle.md +0 -1
  203. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/plugin-api.md +4 -4
  204. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/app.md +33 -33
  205. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/ejs.md +3 -3
  206. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/fs.md +3 -3
  207. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/git.md +3 -2
  208. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/handlebars.md +3 -4
  209. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/json.md +9 -12
  210. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/npm.md +2 -3
  211. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/introduce.md +4 -3
  212. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/run-in-js.md +4 -5
  213. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/structure.md +13 -11
  214. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/common.md +18 -27
  215. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/abstract.md +1 -4
  216. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -1
  217. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +4 -5
  218. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/hook/onForged.md +0 -1
  219. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +1 -4
  220. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +1 -3
  221. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/setInput.md +1 -1
  222. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
  223. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/introduce.md +8 -9
  224. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/develop.md +11 -12
  225. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/use.md +8 -8
  226. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/project.md +1 -2
  227. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c01-introduction.md +7 -8
  228. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c02-development.md +18 -21
  229. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c03-main-app.md +41 -44
  230. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c04-communicate.md +7 -5
  231. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c05-mixed-stack.md +1 -1
  232. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/auto-actions.md +0 -1
  233. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/computed-state.md +0 -2
  234. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/define-model.md +3 -6
  235. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/faq.md +2 -5
  236. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/manage-effects.md +2 -5
  237. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/model-communicate.md +1 -4
  238. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/performance.md +1 -5
  239. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/quick-start.md +0 -6
  240. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/redux-integration.md +3 -2
  241. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/test-model.md +1 -1
  242. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/typescript-best-practice.md +13 -14
  243. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/use-model.md +14 -12
  244. package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/use-out-of-modernjs.md +4 -6
  245. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c01-start.md +19 -19
  246. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c02-component.md +11 -11
  247. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c03-css.md +52 -55
  248. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c04-routes.md +23 -23
  249. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c05-loader.md +12 -11
  250. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c06-model.md +28 -28
  251. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c07-container.md +25 -26
  252. package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c08-entries.md +36 -38
  253. package/en/docusaurus-plugin-content-docs/current.json +3 -47
  254. package/package.json +3 -3
  255. package/scripts/config.ts +4 -2
  256. package/scripts/summary.en.json +1 -1
  257. package/scripts/summary.zh.json +1 -1
  258. package/scripts/sync.ts +1 -1
  259. package/zh/apis/app/commands/index.md +0 -5
  260. package/zh/apis/app/commands/lint.md +1 -1
  261. package/zh/apis/app/commands/serve.md +2 -4
  262. package/zh/apis/app/hooks/api/framework/lambda.md +12 -12
  263. package/zh/apis/app/hooks/api/functions/api.md +13 -13
  264. package/zh/apis/app/hooks/api/functions/app.md +0 -2
  265. package/zh/apis/app/hooks/api/functions/common.md +1 -1
  266. package/zh/apis/app/hooks/index.md +0 -5
  267. package/zh/apis/app/hooks/shared.md +0 -1
  268. package/zh/apis/app/hooks/src/app.md +16 -9
  269. package/zh/apis/app/hooks/src/index_.md +0 -2
  270. package/zh/apis/app/hooks/src/routes.md +6 -7
  271. package/zh/apis/app/hooks/src/server.md +6 -4
  272. package/zh/apis/app/hooks/src/stories.md +1 -1
  273. package/zh/apis/app/hooks/src/test.md +1 -1
  274. package/zh/apis/app/runtime/app/define-config.md +1 -2
  275. package/zh/apis/app/runtime/bff/hook.md +3 -3
  276. package/zh/apis/app/runtime/core/bootstrap.md +2 -3
  277. package/zh/apis/app/runtime/core/use-loader.md +2 -2
  278. package/zh/apis/app/runtime/core/use-module-apps.md +53 -50
  279. package/zh/apis/app/runtime/core/use-runtime-context.md +3 -4
  280. package/zh/apis/app/runtime/index.md +0 -5
  281. package/zh/apis/app/runtime/model/Provider.md +1 -0
  282. package/zh/apis/app/runtime/model/auto-actions.md +1 -1
  283. package/zh/apis/app/runtime/model/connect.md +9 -5
  284. package/zh/apis/app/runtime/model/create-app.md +3 -3
  285. package/zh/apis/app/runtime/model/create-store.md +2 -4
  286. package/zh/apis/app/runtime/model/handle-effect.md +3 -4
  287. package/zh/apis/app/runtime/model/model_.md +0 -3
  288. package/zh/apis/app/runtime/model/use-local-model.md +0 -1
  289. package/zh/apis/app/runtime/model/use-store.md +0 -2
  290. package/zh/apis/app/runtime/router/router.md +23 -53
  291. package/zh/apis/app/runtime/ssr/no-ssr.md +1 -5
  292. package/zh/apis/app/runtime/ssr/pre-render.md +10 -6
  293. package/zh/apis/app/runtime/testing/cleanup.md +2 -2
  294. package/zh/apis/app/runtime/testing/render.md +0 -2
  295. package/zh/apis/app/runtime/utility/css-in-js.md +2 -2
  296. package/zh/apis/app/runtime/utility/head.md +3 -5
  297. package/zh/apis/app/runtime/utility/loadable.md +14 -15
  298. package/zh/apis/app/runtime/web-server/hook.md +5 -4
  299. package/zh/apis/app/runtime/web-server/middleware.md +8 -6
  300. package/zh/apis/monorepo/commands/bump.md +1 -1
  301. package/zh/apis/monorepo/commands/change.md +3 -2
  302. package/zh/apis/monorepo/commands/gen-release-note.md +1 -2
  303. package/zh/apis/monorepo/commands/index.md +1 -6
  304. package/zh/apis/monorepo/commands/lint.md +1 -1
  305. package/zh/apis/monorepo/commands/release.md +0 -1
  306. package/zh/apis/monorepo/hooks/index.md +1 -6
  307. package/zh/components/command-tip.md +3 -2
  308. package/zh/components/enable-bff.md +10 -14
  309. package/zh/components/enable-micro-frontend.md +4 -4
  310. package/zh/components/global-proxy-config.md +6 -9
  311. package/zh/components/global-proxy.md +0 -1
  312. package/zh/components/init-app.md +0 -1
  313. package/zh/components/micro-master-manifest-config.md +2 -2
  314. package/zh/components/micro-runtime-config.md +1 -1
  315. package/zh/components/reduck-migration.md +0 -1
  316. package/zh/components/router-legacy-tip.md +0 -1
  317. package/zh/configure/app/auto-load-plugin.md +9 -10
  318. package/zh/configure/app/bff/prefix.md +6 -10
  319. package/zh/configure/app/bff/proxy.md +9 -8
  320. package/zh/configure/app/builder-plugins.md +6 -6
  321. package/zh/configure/app/deploy/microFrontend.md +11 -11
  322. package/zh/configure/app/dev/asset-prefix.md +2 -2
  323. package/zh/configure/app/dev/hmr.md +2 -2
  324. package/zh/configure/app/dev/https.md +2 -2
  325. package/zh/configure/app/dev/port.md +2 -2
  326. package/zh/configure/app/dev/progress-bar.md +2 -2
  327. package/zh/configure/app/dev/proxy.md +0 -1
  328. package/zh/configure/app/dev/start-url.md +2 -2
  329. package/zh/configure/app/experiments/lazy-compilation.md +2 -2
  330. package/zh/configure/app/html/app-icon.md +2 -2
  331. package/zh/configure/app/html/crossorigin.md +2 -2
  332. package/zh/configure/app/html/disable-html-folder.md +2 -2
  333. package/zh/configure/app/html/favicon-by-entries.md +2 -2
  334. package/zh/configure/app/html/favicon.md +2 -2
  335. package/zh/configure/app/html/inject-by-entries.md +2 -2
  336. package/zh/configure/app/html/inject.md +2 -2
  337. package/zh/configure/app/html/meta-by-entries.md +2 -2
  338. package/zh/configure/app/html/meta.md +2 -2
  339. package/zh/configure/app/html/mount-id.md +2 -2
  340. package/zh/configure/app/html/tags-by-entries.md +12 -0
  341. package/zh/configure/app/html/tags.md +12 -0
  342. package/zh/configure/app/html/template-by-entries.md +2 -2
  343. package/zh/configure/app/html/template-parameters-by-entries.md +2 -2
  344. package/zh/configure/app/html/template-parameters.md +2 -2
  345. package/zh/configure/app/html/template.md +2 -2
  346. package/zh/configure/app/html/title-by-entries.md +2 -2
  347. package/zh/configure/app/html/title.md +2 -2
  348. package/zh/configure/app/output/asset-prefix.md +2 -2
  349. package/zh/configure/app/output/assets-retry.md +2 -2
  350. package/zh/configure/app/output/charset.md +2 -2
  351. package/zh/configure/app/output/clean-dist-path.md +2 -2
  352. package/zh/configure/app/output/convert-to-rem.md +2 -2
  353. package/zh/configure/app/output/copy.md +2 -2
  354. package/zh/configure/app/output/css-module-local-ident-name.md +2 -2
  355. package/zh/configure/app/output/data-uri-limit.md +2 -2
  356. package/zh/configure/app/output/disable-css-extract.md +2 -2
  357. package/zh/configure/app/output/disable-css-module-extension.md +2 -2
  358. package/zh/configure/app/output/disable-filename-hash.md +2 -2
  359. package/zh/configure/app/output/disable-inline-runtime-chunk.md +2 -2
  360. package/zh/configure/app/output/disable-minimize.md +2 -2
  361. package/zh/configure/app/output/disable-node-polyfill.md +8 -8
  362. package/zh/configure/app/output/disable-source-map.md +2 -2
  363. package/zh/configure/app/output/disable-ts-checker.md +2 -2
  364. package/zh/configure/app/output/dist-path.md +2 -2
  365. package/zh/configure/app/output/enable-asset-fallback.md +2 -2
  366. package/zh/configure/app/output/enable-asset-manifest.md +2 -2
  367. package/zh/configure/app/output/enable-css-module-tsdeclaration.md +2 -2
  368. package/zh/configure/app/output/enable-inline-scripts.md +2 -2
  369. package/zh/configure/app/output/enable-inline-styles.md +2 -2
  370. package/zh/configure/app/output/enable-latest-decorators.md +2 -2
  371. package/zh/configure/app/output/externals.md +2 -2
  372. package/zh/configure/app/output/filename.md +2 -2
  373. package/zh/configure/app/output/legal-comments.md +2 -2
  374. package/zh/configure/app/output/override-browserslist.md +2 -2
  375. package/zh/configure/app/output/polyfill.md +2 -2
  376. package/zh/configure/app/output/ssg.md +3 -2
  377. package/zh/configure/app/output/svg-default-export.md +2 -2
  378. package/zh/configure/app/performance/build-cache.md +2 -2
  379. package/zh/configure/app/performance/bundle-analyze.md +2 -2
  380. package/zh/configure/app/performance/chunk-split.md +2 -2
  381. package/zh/configure/app/performance/print-file-size.md +2 -2
  382. package/zh/configure/app/performance/profile.md +2 -2
  383. package/zh/configure/app/performance/remove-console.md +2 -2
  384. package/zh/configure/app/performance/remove-moment-locale.md +2 -2
  385. package/zh/configure/app/plugins.md +6 -6
  386. package/zh/configure/app/runtime/intro.md +39 -11
  387. package/zh/configure/app/runtime/master-app.md +1 -2
  388. package/zh/configure/app/runtime/router.md +6 -7
  389. package/zh/configure/app/runtime/state.md +15 -16
  390. package/zh/configure/app/security/sri.md +2 -2
  391. package/zh/configure/app/server/base-url.md +3 -6
  392. package/zh/configure/app/server/enable-framework-ext.md +5 -4
  393. package/zh/configure/app/server/port.md +24 -6
  394. package/zh/configure/app/server/public-routes.md +6 -8
  395. package/zh/configure/app/server/routes.md +6 -6
  396. package/zh/configure/app/server/ssr-by-entries.md +5 -8
  397. package/zh/configure/app/server/ssr.md +4 -5
  398. package/zh/configure/app/source/alias.md +2 -2
  399. package/zh/configure/app/source/compile-js-data-uri.md +2 -2
  400. package/zh/configure/app/source/config-dir.md +2 -2
  401. package/zh/configure/app/source/define.md +2 -2
  402. package/zh/configure/app/source/design-system.md +656 -630
  403. package/zh/configure/app/source/disable-default-entries.md +3 -3
  404. package/zh/configure/app/source/disable-entry-dirs.md +8 -7
  405. package/zh/configure/app/source/enable-async-entry.md +3 -3
  406. package/zh/configure/app/source/entries-dir.md +7 -7
  407. package/zh/configure/app/source/entries.md +5 -6
  408. package/zh/configure/app/source/exclude.md +2 -2
  409. package/zh/configure/app/source/global-vars.md +2 -2
  410. package/zh/configure/app/source/include.md +2 -2
  411. package/zh/configure/app/source/module-scopes.md +2 -2
  412. package/zh/configure/app/source/pre-entry.md +2 -2
  413. package/zh/configure/app/source/resolve-extension-prefix.md +2 -2
  414. package/zh/configure/app/source/resolve-main-fields.md +2 -2
  415. package/zh/configure/app/testing/transformer.md +2 -3
  416. package/zh/configure/app/tools/autoprefixer.md +2 -2
  417. package/zh/configure/app/tools/babel.md +2 -2
  418. package/zh/configure/app/tools/css-extract.md +2 -2
  419. package/zh/configure/app/tools/css-loader.md +2 -2
  420. package/zh/configure/app/tools/dev-server.md +2 -2
  421. package/zh/configure/app/tools/html-plugin.md +2 -2
  422. package/zh/configure/app/tools/inspector.md +2 -2
  423. package/zh/configure/app/tools/jest.md +9 -9
  424. package/zh/configure/app/tools/less.md +2 -2
  425. package/zh/configure/app/tools/minify-css.md +2 -2
  426. package/zh/configure/app/tools/postcss.md +2 -2
  427. package/zh/configure/app/tools/pug.md +2 -2
  428. package/zh/configure/app/tools/sass.md +2 -2
  429. package/zh/configure/app/tools/style-loader.md +2 -2
  430. package/zh/configure/app/tools/styled-components.md +2 -2
  431. package/zh/configure/app/tools/swc.md +12 -1
  432. package/zh/configure/app/tools/terser.md +2 -2
  433. package/zh/configure/app/tools/ts-checker.md +2 -2
  434. package/zh/configure/app/tools/ts-loader.md +2 -2
  435. package/zh/configure/app/tools/webpack-chain.md +2 -2
  436. package/zh/configure/app/tools/webpack.md +2 -2
  437. package/zh/guides/advanced-features/bff/frameworks.md +6 -6
  438. package/zh/guides/advanced-features/bff/function.md +49 -44
  439. package/zh/guides/advanced-features/bff/index.md +9 -9
  440. package/zh/guides/advanced-features/bff/type.md +0 -1
  441. package/zh/guides/advanced-features/code-split.md +3 -3
  442. package/zh/guides/advanced-features/compatibility.md +6 -7
  443. package/zh/guides/advanced-features/eslint.md +0 -1
  444. package/zh/guides/advanced-features/index.md +0 -5
  445. package/zh/guides/advanced-features/low-level.md +17 -19
  446. package/zh/guides/advanced-features/ssg.md +8 -9
  447. package/zh/guides/advanced-features/ssr.md +5 -11
  448. package/zh/guides/advanced-features/testing.md +3 -2
  449. package/zh/guides/advanced-features/web-server.md +3 -4
  450. package/zh/guides/basic-features/alias.md +7 -11
  451. package/zh/guides/basic-features/css/css-in-js.md +5 -5
  452. package/zh/guides/basic-features/css/css-modules.md +2 -2
  453. package/zh/guides/basic-features/css/postcss.md +42 -46
  454. package/zh/guides/basic-features/css/tailwindcss.md +5 -5
  455. package/zh/guides/basic-features/data-fetch.md +109 -192
  456. package/zh/guides/basic-features/env-vars.md +7 -6
  457. package/zh/guides/basic-features/html.md +54 -46
  458. package/zh/guides/basic-features/index.md +0 -5
  459. package/zh/guides/basic-features/mock.md +4 -4
  460. package/zh/guides/basic-features/proxy.md +4 -5
  461. package/zh/guides/basic-features/routes.md +105 -18
  462. package/zh/guides/concept/entries.md +5 -7
  463. package/zh/guides/get-started/quick-start.md +3 -4
  464. package/zh/guides/topic-detail/changesets/add.md +1 -3
  465. package/zh/guides/topic-detail/changesets/changelog.md +30 -31
  466. package/zh/guides/topic-detail/changesets/commit.md +44 -45
  467. package/zh/guides/topic-detail/changesets/config.md +2 -1
  468. package/zh/guides/topic-detail/changesets/github.md +6 -10
  469. package/zh/guides/topic-detail/changesets/introduce.md +0 -1
  470. package/zh/guides/topic-detail/changesets/release-note.md +9 -12
  471. package/zh/guides/topic-detail/changesets/release-pre.md +1 -1
  472. package/zh/guides/topic-detail/framework-plugin/extend.md +13 -13
  473. package/zh/guides/topic-detail/framework-plugin/hook-list.md +2 -2
  474. package/zh/guides/topic-detail/framework-plugin/hook.md +57 -54
  475. package/zh/guides/topic-detail/framework-plugin/implement.md +11 -11
  476. package/zh/guides/topic-detail/framework-plugin/plugin-api.md +4 -4
  477. package/zh/guides/topic-detail/generator/codesmith/api/app.md +36 -36
  478. package/zh/guides/topic-detail/generator/codesmith/api/ejs.md +2 -2
  479. package/zh/guides/topic-detail/generator/codesmith/api/fs.md +2 -2
  480. package/zh/guides/topic-detail/generator/codesmith/api/git.md +3 -2
  481. package/zh/guides/topic-detail/generator/codesmith/api/handlebars.md +2 -2
  482. package/zh/guides/topic-detail/generator/codesmith/api/json.md +9 -11
  483. package/zh/guides/topic-detail/generator/codesmith/api/npm.md +4 -2
  484. package/zh/guides/topic-detail/generator/codesmith/introduce.md +20 -7
  485. package/zh/guides/topic-detail/generator/codesmith/run-in-js.md +4 -5
  486. package/zh/guides/topic-detail/generator/codesmith/structure.md +13 -10
  487. package/zh/guides/topic-detail/generator/config/common.md +18 -27
  488. package/zh/guides/topic-detail/generator/plugin/abstract.md +1 -1
  489. package/zh/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -0
  490. package/zh/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +4 -4
  491. package/zh/guides/topic-detail/generator/plugin/api/info/locale.md +1 -1
  492. package/zh/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +2 -2
  493. package/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +3 -4
  494. package/zh/guides/topic-detail/generator/plugin/api/input/setInput.md +1 -1
  495. package/zh/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
  496. package/zh/guides/topic-detail/generator/plugin/api/introduce.md +8 -9
  497. package/zh/guides/topic-detail/generator/plugin/develop.md +13 -13
  498. package/zh/guides/topic-detail/generator/plugin/use.md +8 -8
  499. package/zh/guides/topic-detail/generator/project.md +1 -1
  500. package/zh/guides/topic-detail/micro-frontend/c01-introduction.md +7 -8
  501. package/zh/guides/topic-detail/micro-frontend/c02-development.md +20 -23
  502. package/zh/guides/topic-detail/micro-frontend/c03-main-app.md +41 -44
  503. package/zh/guides/topic-detail/micro-frontend/c04-communicate.md +7 -5
  504. package/zh/guides/topic-detail/micro-frontend/c05-mixed-stack.md +1 -1
  505. package/zh/guides/topic-detail/model/auto-actions.md +0 -1
  506. package/zh/guides/topic-detail/model/computed-state.md +0 -2
  507. package/zh/guides/topic-detail/model/define-model.md +3 -6
  508. package/zh/guides/topic-detail/model/faq.md +2 -5
  509. package/zh/guides/topic-detail/model/manage-effects.md +2 -5
  510. package/zh/guides/topic-detail/model/model-communicate.md +1 -4
  511. package/zh/guides/topic-detail/model/performance.md +1 -5
  512. package/zh/guides/topic-detail/model/quick-start.md +0 -6
  513. package/zh/guides/topic-detail/model/redux-integration.md +3 -2
  514. package/zh/guides/topic-detail/model/test-model.md +1 -1
  515. package/zh/guides/topic-detail/model/typescript-best-practice.md +13 -14
  516. package/zh/guides/topic-detail/model/use-model.md +14 -12
  517. package/zh/guides/topic-detail/model/use-out-of-modernjs.md +4 -6
  518. package/zh/guides/topic-detail/monorepo/intro.md +0 -1
  519. package/zh/guides/topic-detail/monorepo/sub-project-interface.md +14 -7
  520. package/zh/tutorials/first-app/c01-start.md +2 -2
  521. package/zh/tutorials/first-app/c03-css.md +6 -9
  522. package/zh/tutorials/first-app/c04-routes.md +1 -1
  523. package/zh/tutorials/first-app/c05-loader.md +2 -1
  524. package/zh/tutorials/first-app/c07-container.md +6 -7
  525. package/zh/tutorials/first-app/c08-entries.md +5 -7
@@ -2,7 +2,6 @@
2
2
  sidebar_position: 4
3
3
  ---
4
4
 
5
-
6
5
  # Execute microgenerator with JS code
7
6
 
8
7
  In addition to using the cli method to execute the micro generator, we inevitably need to execute the micro generator in the code. The following describes how to execute the micro generator in the js code.
@@ -15,17 +14,17 @@ pnpm add @modern-js/codesmith
15
14
 
16
15
  ## Create codesmith instance
17
16
 
18
- ```typescript
17
+ ```ts
19
18
  import { CodeSmith, Logger } from '@modern-js/codesmith';
20
19
 
21
20
  const smith = new CodeSmith({
22
- debug: false, //Whether to enable debug mode, if true, the debug information in the generator will be displayed
21
+ debug: false, //Whether to enable debug mode, if true, the debug information in the generator will be displayed
23
22
  });
24
23
  ```
25
24
 
26
25
  ## Call the forge method to execute the generator
27
26
 
28
- ```typescript
27
+ ```ts
29
28
  type RunnerTask = Array<{
30
29
  name: string;
31
30
  config: Record<string, any>;
@@ -33,7 +32,7 @@ type RunnerTask = Array<{
33
32
 
34
33
  const task: RunnerTask = [
35
34
  {
36
- name: "generator", // generator npm package name
35
+ name: 'generator', // generator npm package name
37
36
  config: {}, //The default configuration performed by the generator
38
37
  },
39
38
  ];
@@ -14,10 +14,11 @@ NPM package description information, including name, version, main and other fie
14
14
 
15
15
  The js file corresponding to the above main field. The file exports a generator function by default, and the function format is as follows:
16
16
 
17
- ```typescript
18
- export default async (context: GeneratorContext, generator: GeneratorCore) => {
19
-
20
- };
17
+ ```ts
18
+ export default async (
19
+ context: GeneratorContext,
20
+ generator: GeneratorCore,
21
+ ) => {};
21
22
  ```
22
23
 
23
24
  The function parameters are context and generator:
@@ -26,12 +27,12 @@ The function parameters are context and generator:
26
27
 
27
28
  Context provides context information maintained by the codesmith runtime. Its type is defined as:
28
29
 
29
- ```typescript
30
+ ```ts
30
31
  interface GeneratorContext {
31
32
  materials: Record<string, FsMaterial>;
32
33
  config: Record<string, any>;
33
34
  data?: Record<string, any>;
34
- current: { material: FsMaterial; } | null;
35
+ current: { material: FsMaterial } | null;
35
36
  [key: string]: any;
36
37
  }
37
38
  ```
@@ -42,8 +43,10 @@ Materials also maintains this default mapping relationship, which is used to mai
42
43
 
43
44
  For example, when you need to modify a field in the `package.json` of the current project:
44
45
 
45
- ```typescript
46
- const resource = context.materials.default.get(path.join(appDir, 'package.json'))
46
+ ```ts
47
+ const resource = context.materials.default.get(
48
+ path.join(appDir, 'package.json'),
49
+ );
47
50
  ```
48
51
 
49
52
  Pass the acquired resources to the JSON API provided by codesmith to implement json operations.
@@ -54,7 +57,7 @@ The get method is provided in `FsMaterial` to get the resource file and pass the
54
57
 
55
58
  For example:
56
59
 
57
- ```typescript
60
+ ```ts
58
61
  const resourceMap = await material.find('templates/**/*');
59
62
  ```
60
63
 
@@ -64,7 +67,7 @@ All template files in the generator that match to the `templates /**/*` rules ca
64
67
 
65
68
  Generator provides the function method of the codesmith runtime. Its type is defined as:
66
69
 
67
- ```typescript
70
+ ```ts
68
71
  interface GeneratorCore {
69
72
  logger: Logger;
70
73
  outputPath: string;
@@ -77,7 +80,6 @@ interface GeneratorCore {
77
80
 
78
81
  The outputPath and the `materials.default` in the context point to the same directory, the outputPath is used to directly calculate the target path and operate, and the `materials.default` is used to obtain resource files.
79
82
 
80
-
81
83
  `runSubGenerator` provides a way to run other microgenerators in one microgenerator, which will automatically update and maintain new context information.
82
84
 
83
85
  ## Template File
@@ -42,7 +42,6 @@ Package management tool (packageManager), the options are as follows:
42
42
 
43
43
  - Yarn(yarn)
44
44
 
45
-
46
45
  :::info
47
46
  In the custom type of the generator plugin to create a project scenario, only the `packageManager` configuration is provided by default.
48
47
  :::
@@ -51,56 +50,48 @@ In the custom type of the generator plugin to create a project scenario, only th
51
50
 
52
51
  ### noNeedInstall
53
52
 
54
- * Type: Boolean
55
-
56
- * Default: false
53
+ - Type: `boolean`
54
+ - Default: `false`
57
55
 
58
56
  Whether to skip the dependency installation.
59
57
 
60
58
  ### noNeedGit
61
59
 
62
- * Type: Boolean
63
-
64
- * Default: false
60
+ - Type: `boolean`
61
+ - Default: `false`
65
62
 
66
63
  Whether to skip git initialization and commit initial commit.
67
64
 
68
65
  ### successInfo
69
66
 
70
- * Type: String
71
-
72
- * Default: Command operation prompts for different project schemes.
67
+ - Type: `string`
68
+ - Default: Command operation prompts for different project schemes.
73
69
 
74
70
  Customize prompt information to create project success.
75
71
 
76
72
  ### isMonorepoSubProject
77
73
 
78
- * Type: Boolean
79
-
80
- * Default: false
74
+ - Type: `boolean`
75
+ - Default: `false`
81
76
 
82
77
  Whether it is a Monorepo subproject.
83
78
 
84
79
  ### isTest
85
80
 
86
- * Type: Boolean
87
-
88
- - true: create project to `examples/`
81
+ - Type: `boolean`
82
+ - Default: `false`
89
83
 
90
- - false: create project to `apps/`
84
+ Works on an Application project to identify whether it is a test project.
91
85
 
92
- * Default: false
93
-
94
- Works on an Application (MWA) project to identify whether it is a test project.
86
+ - `true`: create project to `examples/`
87
+ - `false`: create project to `apps/`
95
88
 
96
89
  ### isPublic
97
90
 
98
- * Type: Boolean
99
-
100
- - true: create project to `packages/`
101
-
102
- - false: create project to `features/`
103
-
104
- * Default: false
91
+ - Type: `boolean`
92
+ - Default: `false`
105
93
 
106
94
  Used in the Module project to identify whether it needs to be published to npm.
95
+
96
+ - `true`: create project to `packages/`
97
+ - `false`: create project to `features/`
@@ -4,13 +4,12 @@ sidebar_position: 1
4
4
 
5
5
  # Why do you need a generator plugin
6
6
 
7
- Modern.js provides application (MWA), modules and Monorepo three engineering solutions, and by using the `@modern-js/create` tool can create the initial project template of the three engineering solutions, the initial project template will provide basic code development environment, simple sample code and configuration, etc.
7
+ Modern.js provides application, modules and Monorepo three engineering solutions, and by using the `@modern-js/create` tool can create the initial project template of the three engineering solutions, the initial project template will provide basic code development environment, simple sample code and configuration, etc.
8
8
 
9
9
  Modern.js provides an initialization template that is versatile and can meet some general project development needs.
10
10
 
11
11
  When you use Modern.js in depth, you will inevitably find that every time you create a project, you will make some similar changes specific to your own project, such as modifying the sample code, adding some configuration, enabling some functions, etc.
12
12
 
13
-
14
13
  The generator plugin can help you precipitate these individual or team-specific changes. Simply bring the `--plugin` parameter when executing `npx @modern-js/create` to avoid the need to repeatedly modify the project every time the project is created..
15
14
 
16
15
  The generator plugin is based on the initialization template project provided by the Modern.js, providing methods to add, delete and modify templates, and modifying `package.json`, `modernConfig` configuration and opening functions in a fast way.
@@ -19,8 +18,6 @@ The generator plugin provides two ways of customization:
19
18
 
20
19
  1. Extended engineering: directly customize the three major engineering provided by default.
21
20
 
22
-
23
21
  2. Create engineering scenes: Create corresponding engineering scenes based on the default three major engineering.
24
22
 
25
-
26
23
  The next step will introduce how to use and develop the generator plugin step by step.
@@ -22,7 +22,7 @@ The jsx or tsx file using the variable is a binary file, and its syntax conflict
22
22
 
23
23
  - JSON files: Files in JSON format, such as `package.json`, `tsconfig.json`.
24
24
 
25
- - Text List File: A file consisting of lines of text, such as `.gitignore`, `.editorconfig`, `.npmrc`.
25
+ - Text List File: A file consisting of lines of text, such as `.gitignore`, `.editorconfig`, `.npmrc`.
26
26
 
27
27
  The file manipulation API for the generator plugin will operate on these four file types.
28
28
 
@@ -34,19 +34,18 @@ This information is represented in Record form.
34
34
 
35
35
  For example, the name field needs to be updated:
36
36
 
37
-
38
37
  ```ts
39
38
  api.updateJSONFile(file, {
40
- name: "new name"
41
- })
39
+ name: 'new name',
40
+ });
42
41
  ```
43
42
 
44
43
  Nested fields need to be updated:
45
44
 
46
45
  ```ts
47
46
  api.updateJSONFile(file, {
48
- "dependencies.name": "new name"
49
- })
47
+ 'dependencies.name': 'new name',
48
+ });
50
49
  ```
51
50
 
52
51
  :::warning
@@ -30,7 +30,6 @@ The onForged parameter is a callback function, and the function parameters are `
30
30
 
31
31
  A list of supported functions in `onForged` time to live, specifically viewable [File API] (/docs/guides/topic-detail/generator/plugin/api/file/introduce) and [Enable function API] (/docs/guides/topic-detail/generator/plugin/api/new/introduce).
32
32
 
33
-
34
33
  ### inputData
35
34
 
36
35
  Current user input, the user can be used to obtain the current input information and configuration information.
@@ -25,7 +25,6 @@ Modern.js the problem keyword of the configuration of the engineering solution,
25
25
 
26
26
  Questions that need to be added, specific type definition viewable [Customize input related type definition](/docs/guides/topic-detail/generator/plugin/api/input/type).
27
27
 
28
-
29
28
  ## Example
30
29
 
31
30
  Add input after package management tool:
@@ -43,15 +42,13 @@ context.addInputAfter('packageManager', {
43
42
  ],
44
43
  },
45
44
  },
46
- })
45
+ });
47
46
  ```
48
47
 
49
48
  :::info Notes
50
49
  1. The key of the added question cannot be duplicated with the key of the question of the item type itself provided by the Modern.js.
51
50
 
52
-
53
51
  2. The priority of adding the problem `addInputAfter` is higher than `addInputBefore`. When adding After problem to one `key` and Before problem to the next key at the same time, After problem will be before Before.
54
52
 
55
-
56
53
  3. When multiple questions need to be added before or after the same `key`, the method can be called multiple times, and the order of questions will be permutated in the order in which they are called.
57
54
  :::
@@ -42,15 +42,13 @@ context.addInputBefore('packageManager', {
42
42
  ],
43
43
  },
44
44
  },
45
- })
45
+ });
46
46
  ```
47
47
 
48
48
  :::info Notes
49
49
  1. The key of the added question cannot be duplicated with the key of the question of the item type itself provided by the Modern.js.
50
50
 
51
-
52
51
  2. The priority of adding the problem `addInputAfter` is higher than `addInputBefore`. When adding After problem to one `key` and Before problem to the next key at the same time, After problem will be before Before.
53
52
 
54
-
55
53
  3. When multiple questions need to be added before or after the same `key`, the method can be called multiple times, and the order of questions will be permutated in the order in which they are called.
56
54
  :::
@@ -38,5 +38,5 @@ For the input options provided by the Modern.js project type, only delete is tem
38
38
  Modify the display name of `packageName`:
39
39
 
40
40
  ```ts
41
- context.setInput('packageName', 'title', "Show title");
41
+ context.setInput('packageName', 'title', 'Show title');
42
42
  ```
@@ -48,7 +48,7 @@ When schema type is `object`, define its subforms.
48
48
 
49
49
  ## Example
50
50
 
51
- ```typescript
51
+ ```ts
52
52
  const schema = {
53
53
  type: 'object',
54
54
  properties: {
@@ -10,7 +10,6 @@ Modern.js supports the customization of the provided engineering solutions by me
10
10
 
11
11
  The generator plugin is a module that can be developed directly using Modern.js module engineering solutions. Of course, Modern.js also provides the corresponding generator plugin (`@modern-js/generator-plugin-plugin`) to directly create a new generator plugin project.
12
12
 
13
-
14
13
  A generator plugin project directory is as follows:
15
14
 
16
15
  ```bash
@@ -44,9 +43,9 @@ The classification of the generator plugin is provided by the meta information i
44
43
 
45
44
  ```json
46
45
  {
47
- "meta": {
48
- "extend": "mwa" // The three engineering is mwa, module, monorepo
49
- }
46
+ "meta": {
47
+ "extend": "mwa" // The three engineering is mwa, module, monorepo
48
+ }
50
49
  }
51
50
  ```
52
51
 
@@ -54,11 +53,11 @@ The classification of the generator plugin is provided by the meta information i
54
53
 
55
54
  ```json
56
55
  {
57
- "meta": {
58
- "key": "new_solution",
59
- "name": "New Solution",
60
- "type": "mwa" // In addition to the three major engineering solutions, the type here also supports the customize (custom) type
61
- }
56
+ "meta": {
57
+ "key": "new_solution",
58
+ "name": "New Solution",
59
+ "type": "mwa" // In addition to the three major engineering solutions, the type here also supports the customize (custom) type
60
+ }
62
61
  }
63
62
  ```
64
63
 
@@ -41,7 +41,7 @@ Different plugin types will ask different questions. You can choose the plugin t
41
41
  After the execution of the create project command is completed, a project for developing the generator plugin will be generated accordingly, and the `meta` information will also be generated according to your selection in the `package.json`.
42
42
 
43
43
  :::info
44
- For generator plugin development, please refer to `@modern-js/generator-plugin-plugin`. [Source Code](https://github.com/modern-js-dev/modern.js/tree/main/packages/generator/plugins/generator-plugin)
44
+ For generator plugin development, please refer to `@modern-js/generator-plugin-plugin`. [Source Code](https://github.com/modern-js-dev/modern.js/tree/main/packages/generator/plugins/generator-plugin)
45
45
  :::
46
46
 
47
47
  ## Develop plugin logic
@@ -50,7 +50,6 @@ Complete plugin logic development in `src/index.ts`.
50
50
 
51
51
  The plugin exports a function by default, the function parameter is `context`, and some methods are provided on `context` to directly operate on the current project.
52
52
 
53
-
54
53
  A brief introduction to the provided methods, the complete API list viewable [Generator Plugin API](/docs/guides/topic-detail/generator/plugin/api/introduce).
55
54
 
56
55
  ### Customize input
@@ -78,8 +77,8 @@ context.addInputBefore('input2', {
78
77
  Set attributes of existing problems.
79
78
 
80
79
  ```ts
81
- context.setInput('test', 'type', 'number')
82
- context.setInput('test', 'enum', [{ value: 'option1', label: '选项一' }])
80
+ context.setInput('test', 'type', 'number');
81
+ context.setInput('test', 'enum', [{ value: 'option1', label: '选项一' }]);
83
82
  ```
84
83
 
85
84
  ### onForged
@@ -98,14 +97,14 @@ API functions supported in `onForged` can also be found in [Generator Plugin API
98
97
 
99
98
  ```ts
100
99
  context.onForged(async (api: ForgedAPI, input: Record<string, unknown>) => {
101
- const { language } = input;
102
- api.addFile({
103
- type: FileType.Text,
104
- file: `src/index.${language as string}`,
105
- templateFile: `index.${language as string}.handlebars`,
106
- force: true,
107
- });
108
- })
100
+ const { language } = input;
101
+ api.addFile({
102
+ type: FileType.Text,
103
+ file: `src/index.${language as string}`,
104
+ templateFile: `index.${language as string}.handlebars`,
105
+ force: true,
106
+ });
107
+ });
109
108
  ```
110
109
 
111
110
  ### afterForged
@@ -30,9 +30,9 @@ The classification of the generator plugin is provided by the meta information i
30
30
 
31
31
  ```json
32
32
  {
33
- "meta": {
34
- "extend": "mwa" // The three engineering is mwa, module, monorepo
35
- }
33
+ "meta": {
34
+ "extend": "mwa" // The three engineering is mwa, module, monorepo
35
+ }
36
36
  }
37
37
  ```
38
38
 
@@ -40,11 +40,11 @@ The classification of the generator plugin is provided by the meta information i
40
40
 
41
41
  ```json
42
42
  {
43
- "meta": {
44
- "key": "new_solution",
45
- "name": "New Solution",
46
- "type": "mwa" // In addition to the three major engineering solutions, the type here also supports the customize (custom) type
47
- }
43
+ "meta": {
44
+ "key": "new_solution",
45
+ "name": "New Solution",
46
+ "type": "mwa" // In addition to the three major engineering solutions, the type here also supports the customize (custom) type
47
+ }
48
48
  }
49
49
  ```
50
50
 
@@ -56,7 +56,7 @@ npx @modern-js/create --config '{"packageManager": "pnpm"}'
56
56
 
57
57
  Specific configuration information viewable [Project Configuration](/docs/guides/topic-detail/generator/config/common).
58
58
 
59
- ### --no-need-install
59
+ ### --no-need-install
60
60
 
61
61
  By default, `@modern-js/create` automatically installs dependency after the project is created, use this parameter to ignore the install dependency step.
62
62
 
@@ -114,5 +114,4 @@ A project is created by specifying a specific package version dependency.
114
114
 
115
115
  If you need to specify a specific package version when creating a project, you can use this parameter. This parameter will lock the package version number in the `package.json` of the project root directory by configuration `pnpm.overrides` (package management tool selects pnpm) or `resolutions`.
116
116
 
117
-
118
117
  The parameter value is a JSON character string.
@@ -7,8 +7,8 @@ title: 微前端介绍
7
7
 
8
8
  它主要解决了两个问题:
9
9
 
10
- * 随着项目迭代应用越来越庞大,难以维护。
11
- * 跨团队或跨部门协作开发项目导致效率低下的问题。
10
+ - 随着项目迭代应用越来越庞大,难以维护。
11
+ - 跨团队或跨部门协作开发项目导致效率低下的问题。
12
12
 
13
13
  ## 微前端关键词
14
14
 
@@ -19,11 +19,10 @@ title: 微前端介绍
19
19
 
20
20
  ## 功能简介
21
21
 
22
- * 基于 [Garfish](https://www.garfishjs.org/guide)
23
- * 生成器支持微前端应用
24
- * 支持 React 组件式引用微前端子应用
25
- * 支持 loading
26
- * 支持主应用线上、子应用线下调试模式
22
+ - 基于 [Garfish](https://www.garfishjs.org/guide)
23
+ - 生成器支持微前端应用
24
+ - 支持 React 组件式引用微前端子应用
25
+ - 支持 loading
26
+ - 支持主应用线上、子应用线下调试模式
27
27
 
28
28
  可以在 [体验微前端](/docs/guides/topic-detail/micro-frontend/c02-development) 一节学习如何开发微前端主子应用。
29
-
@@ -10,7 +10,7 @@ title: 体验微前端
10
10
 
11
11
  ## 创建应用
12
12
 
13
- 在这次的实践中,我们需要创建三个应用,分别为1个主应用,2个子应用:
13
+ 在这次的实践中,我们需要创建三个应用,分别为 1 个主应用,2 个子应用:
14
14
 
15
15
  - main 主应用
16
16
  - dashboard 子应用
@@ -46,7 +46,6 @@ import MicroRuntimeConfig from '@site-docs/components/micro-runtime-config.md';
46
46
 
47
47
  <MicroRuntimeConfig />
48
48
 
49
-
50
49
  ### 创建 dashboard 子应用
51
50
 
52
51
  通过命令行工具初始化项目:
@@ -66,21 +65,22 @@ npx @modern-js/create
66
65
  ? 请选择你想要的操作 启用可选功能
67
66
  ? 启用可选功能 启用「微前端」模式
68
67
  ```
68
+
69
69
  接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
70
70
 
71
- ```javascript title="modern.config.ts"
72
- import AppToolPlugin, { defineConfig } from '@modern-js/app-tools';
73
- import GarfishPlugin from '@modern-js/plugin-garfish';
71
+ ```js title="modern.config.ts"
72
+ import appTools, { defineConfig } from '@modern-js/app-tools';
73
+ import garfishPlugin from '@modern-js/plugin-garfish';
74
74
 
75
75
  export default defineConfig({
76
76
  runtime: {
77
77
  router: true,
78
- state: true
78
+ state: true,
79
79
  },
80
80
  deploy: {
81
- microFrontend: true
81
+ microFrontend: true,
82
82
  },
83
- plugins: [AppToolPlugin(), GarfishPlugin()],
83
+ plugins: [appTools(), garfishPlugin()],
84
84
  });
85
85
  ```
86
86
 
@@ -106,19 +106,19 @@ npx @modern-js/create
106
106
 
107
107
  接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
108
108
 
109
- ```javascript title="modern.config.ts"
110
- import AppToolPlugin, { defineConfig } from '@modern-js/app-tools';
111
- import GarfishPlugin from '@modern-js/plugin-garfish';
109
+ ```js title="modern.config.ts"
110
+ import appTools, { defineConfig } from '@modern-js/app-tools';
111
+ import garfishPlugin from '@modern-js/plugin-garfish';
112
112
 
113
113
  export default defineConfig({
114
114
  runtime: {
115
115
  router: true,
116
- state: true
116
+ state: true,
117
117
  },
118
118
  deploy: {
119
- microFrontend: true
119
+ microFrontend: true,
120
120
  },
121
- plugins: [AppToolPlugin(), GarfishPlugin()],
121
+ plugins: [appTools(), garfishPlugin()],
122
122
  });
123
123
  ```
124
124
 
@@ -137,13 +137,13 @@ const App = () => {
137
137
  return (
138
138
  <div>
139
139
  <div>
140
- <Link to='/dashboard'>Dashboard</Link> &nbsp;
141
- <Link to='/table'>Table</Link>
140
+ <Link to="/dashboard">Dashboard</Link> &nbsp;
141
+ <Link to="/table">Table</Link>
142
142
  </div>
143
- <Route path='/dashboard'>
143
+ <Route path="/dashboard">
144
144
  <DashBoard />
145
145
  </Route>
146
- <Route path='/table'>
146
+ <Route path="/table">
147
147
  <TableList />
148
148
  </Route>
149
149
  </div>
@@ -183,9 +183,6 @@ export default () => <div>Table Page</div>;
183
183
 
184
184
  在完成了微前端整体开发流程的体验后,你可以进一步了解如何 [开发主应用](./c03-main-app.md)
185
185
 
186
-
187
186
  ## 常见问题
188
187
 
189
188
  自查手册: https://www.garfishjs.org/issues/
190
-
191
-