@modern-js/module-tools-docs 2.0.2 → 2.2.0-beta.0

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 (308) hide show
  1. package/doc_build/html/main/index.html +1 -1
  2. package/doc_build/static/css/main.css +267 -660
  3. package/doc_build/static/css/main.css.map +1 -1
  4. package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css +6 -23
  5. package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css.map +1 -1
  6. package/doc_build/static/js/async/en_api_config_build-config.js +79 -36
  7. package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -1
  8. package/doc_build/static/js/async/en_api_config_build-preset.js +40 -20
  9. package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -1
  10. package/doc_build/static/js/async/en_api_config_design-system.js +33800 -2340
  11. package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -1
  12. package/doc_build/static/js/async/en_api_config_plugins.js +15 -19
  13. package/doc_build/static/js/async/en_api_config_testing.js +26 -24
  14. package/doc_build/static/js/async/en_api_config_testing.js.map +1 -1
  15. package/doc_build/static/js/async/{en_api_.js → en_api_index.js} +10 -14
  16. package/doc_build/static/js/async/en_api_index.js.map +1 -0
  17. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +24 -26
  18. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -1
  19. package/doc_build/static/js/async/en_guide_advance_asset.js +16 -41
  20. package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -1
  21. package/doc_build/static/js/async/en_guide_advance_build-umd.js +20 -24
  22. package/doc_build/static/js/async/en_guide_advance_copy.js +25 -23
  23. package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -1
  24. package/doc_build/static/js/async/en_guide_advance_external-dependency.js +15 -19
  25. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +352 -94
  26. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -1
  27. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +11 -15
  28. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -1
  29. package/doc_build/static/js/async/en_guide_advance_theme-config.js +26 -24
  30. package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -1
  31. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +275 -88
  32. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -1
  33. package/doc_build/static/js/async/en_guide_basic_command-preview.js +45 -33
  34. package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -1
  35. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +274 -196
  36. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -1
  37. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +18 -20
  38. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -1
  39. package/doc_build/static/js/async/en_guide_basic_test-your-project.js +27 -32
  40. package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -1
  41. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +33 -15
  42. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -1
  43. package/doc_build/static/js/async/en_guide_basic_using-storybook.js +24 -63
  44. package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -1
  45. package/doc_build/static/js/async/en_guide_best-practices_components.js +39 -27
  46. package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -1
  47. package/doc_build/static/js/async/en_guide_intro_getting-started.js +288 -45
  48. package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -1
  49. package/doc_build/static/js/async/en_guide_intro_welcome.js +27 -13
  50. package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -1
  51. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +16 -12
  52. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -1
  53. package/doc_build/static/js/async/{en_.js → en_index.js} +12 -16
  54. package/doc_build/static/js/async/en_index.js.map +1 -0
  55. package/doc_build/static/js/async/en_plugins_guide_getting-started.js +17 -21
  56. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +20 -24
  57. package/doc_build/static/js/async/en_plugins_guide_setup-function.js +19 -23
  58. package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -1
  59. package/doc_build/static/js/async/en_plugins_official-list_overview.js +8 -12
  60. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +166 -367
  61. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -1
  62. package/doc_build/static/js/async/{api_config_build-config.js → zh_api_config_build-config.js} +80 -35
  63. package/doc_build/static/js/async/{api_config_build-config.js.map → zh_api_config_build-config.js.map} +1 -1
  64. package/doc_build/static/js/async/{api_config_build-preset.js → zh_api_config_build-preset.js} +39 -21
  65. package/doc_build/static/js/async/{api_config_build-preset.js.map → zh_api_config_build-preset.js.map} +1 -1
  66. package/doc_build/static/js/async/{api_config_design-system.js → zh_api_config_design-system.js} +27 -23
  67. package/doc_build/static/js/async/{api_config_design-system.js.map → zh_api_config_design-system.js.map} +1 -1
  68. package/doc_build/static/js/async/{api_config_plugins.js → zh_api_config_plugins.js} +17 -21
  69. package/doc_build/static/js/async/{api_config_plugins.js.map → zh_api_config_plugins.js.map} +1 -1
  70. package/doc_build/static/js/async/{api_config_testing.js → zh_api_config_testing.js} +28 -26
  71. package/doc_build/static/js/async/{api_config_testing.js.map → zh_api_config_testing.js.map} +1 -1
  72. package/doc_build/static/js/async/{api_.js → zh_api_index.js} +10 -14
  73. package/doc_build/static/js/async/zh_api_index.js.map +1 -0
  74. package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js → zh_api_plugin-api_plugin-hooks.js} +25 -27
  75. package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js.map → zh_api_plugin-api_plugin-hooks.js.map} +1 -1
  76. package/doc_build/static/js/async/{guide_advance_asset.js → zh_guide_advance_asset.js} +18 -43
  77. package/doc_build/static/js/async/{guide_advance_asset.js.map → zh_guide_advance_asset.js.map} +1 -1
  78. package/doc_build/static/js/async/{guide_advance_build-umd.js → zh_guide_advance_build-umd.js} +22 -26
  79. package/doc_build/static/js/async/{guide_advance_build-umd.js.map → zh_guide_advance_build-umd.js.map} +1 -1
  80. package/doc_build/static/js/async/{guide_advance_copy.js → zh_guide_advance_copy.js} +26 -24
  81. package/doc_build/static/js/async/{guide_advance_copy.js.map → zh_guide_advance_copy.js.map} +1 -1
  82. package/doc_build/static/js/async/{guide_advance_external-dependency.js → zh_guide_advance_external-dependency.js} +17 -21
  83. package/doc_build/static/js/async/{guide_advance_external-dependency.js.map → zh_guide_advance_external-dependency.js.map} +1 -1
  84. package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js → zh_guide_advance_in-depth-about-build.js} +353 -95
  85. package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js.map → zh_guide_advance_in-depth-about-build.js.map} +1 -1
  86. package/doc_build/static/js/async/{guide_advance_in-depth-about-dev-command.js → zh_guide_advance_in-depth-about-dev-command.js} +16 -18
  87. package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
  88. package/doc_build/static/js/async/{guide_advance_theme-config.js → zh_guide_advance_theme-config.js} +24 -22
  89. package/doc_build/static/js/async/{guide_advance_theme-config.js.map → zh_guide_advance_theme-config.js.map} +1 -1
  90. package/doc_build/static/js/async/{guide_basic_before-getting-started.js → zh_guide_basic_before-getting-started.js} +272 -85
  91. package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
  92. package/doc_build/static/js/async/{guide_basic_command-preview.js → zh_guide_basic_command-preview.js} +47 -35
  93. package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
  94. package/doc_build/static/js/async/{guide_basic_modify-output-product.js → zh_guide_basic_modify-output-product.js} +203 -88
  95. package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
  96. package/doc_build/static/js/async/{guide_basic_publish-your-project.js → zh_guide_basic_publish-your-project.js} +20 -22
  97. package/doc_build/static/js/async/{guide_basic_publish-your-project.js.map → zh_guide_basic_publish-your-project.js.map} +1 -1
  98. package/doc_build/static/js/async/{guide_basic_test-your-project.js → zh_guide_basic_test-your-project.js} +30 -35
  99. package/doc_build/static/js/async/{guide_basic_test-your-project.js.map → zh_guide_basic_test-your-project.js.map} +1 -1
  100. package/doc_build/static/js/async/{guide_basic_use-micro-generator.js → zh_guide_basic_use-micro-generator.js} +40 -20
  101. package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
  102. package/doc_build/static/js/async/{guide_basic_using-storybook.js → zh_guide_basic_using-storybook.js} +78 -171
  103. package/doc_build/static/js/async/{guide_basic_using-storybook.js.map → zh_guide_basic_using-storybook.js.map} +1 -1
  104. package/doc_build/static/js/async/{guide_best-practices_components.js → zh_guide_best-practices_components.js} +41 -29
  105. package/doc_build/static/js/async/{guide_best-practices_components.js.map → zh_guide_best-practices_components.js.map} +1 -1
  106. package/doc_build/static/js/async/{guide_intro_getting-started.js → zh_guide_intro_getting-started.js} +291 -42
  107. package/doc_build/static/js/async/{guide_intro_getting-started.js.map → zh_guide_intro_getting-started.js.map} +1 -1
  108. package/doc_build/static/js/async/{guide_intro_welcome.js → zh_guide_intro_welcome.js} +28 -14
  109. package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
  110. package/doc_build/static/js/async/{guide_intro_why-module-engineering-solution.js → zh_guide_intro_why-module-engineering-solution.js} +18 -14
  111. package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
  112. package/doc_build/static/js/async/{index.js → zh_index.js} +11 -15
  113. package/doc_build/static/js/async/zh_index.js.map +1 -0
  114. package/doc_build/static/js/async/{plugins_guide_getting-started.js → zh_plugins_guide_getting-started.js} +19 -23
  115. package/doc_build/static/js/async/{plugins_guide_getting-started.js.map → zh_plugins_guide_getting-started.js.map} +1 -1
  116. package/doc_build/static/js/async/{plugins_guide_plugin-object.js → zh_plugins_guide_plugin-object.js} +22 -26
  117. package/doc_build/static/js/async/{plugins_guide_plugin-object.js.map → zh_plugins_guide_plugin-object.js.map} +1 -1
  118. package/doc_build/static/js/async/{plugins_guide_setup-function.js → zh_plugins_guide_setup-function.js} +21 -25
  119. package/doc_build/static/js/async/{plugins_guide_setup-function.js.map → zh_plugins_guide_setup-function.js.map} +1 -1
  120. package/doc_build/static/js/async/{plugins_official-list_overview.js → zh_plugins_official-list_overview.js} +10 -14
  121. package/doc_build/static/js/async/zh_plugins_official-list_overview.js.map +1 -0
  122. package/doc_build/static/js/builder-runtime.js +1 -1
  123. package/doc_build/static/js/builder-runtime.js.map +1 -1
  124. package/doc_build/static/js/lib-polyfill.js +3433 -16355
  125. package/doc_build/static/js/lib-polyfill.js.map +1 -1
  126. package/doc_build/static/js/main.js +2073 -2700
  127. package/doc_build/static/js/main.js.map +1 -1
  128. package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js +485 -1689
  129. package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js.map +1 -1
  130. package/doc_build/static/search_index.json +1 -0
  131. package/docs/.island/dist/404.html +41 -0
  132. package/docs/.island/dist/assets/asset.26aea654.js +160 -0
  133. package/docs/.island/dist/assets/asset.36e3d3c9.js +160 -0
  134. package/docs/.island/dist/assets/before-getting-started.0e863740.js +87 -0
  135. package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +87 -0
  136. package/docs/.island/dist/assets/build-config.460d11d9.js +804 -0
  137. package/docs/.island/dist/assets/build-config.e155e534.js +854 -0
  138. package/docs/.island/dist/assets/build-preset.6c2c6c62.js +256 -0
  139. package/docs/.island/dist/assets/build-preset.d3da921d.js +256 -0
  140. package/docs/.island/dist/assets/build-umd.ba00f028.js +264 -0
  141. package/docs/.island/dist/assets/build-umd.edb9d163.js +273 -0
  142. package/docs/.island/dist/assets/command-preview.1dc93921.js +264 -0
  143. package/docs/.island/dist/assets/command-preview.ef7a9d01.js +264 -0
  144. package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
  145. package/docs/.island/dist/assets/copy.28dc4d5f.js +277 -0
  146. package/docs/.island/dist/assets/copy.f4625565.js +277 -0
  147. package/docs/.island/dist/assets/design-system.8993234c.js +1254 -0
  148. package/docs/.island/dist/assets/design-system.b0ba163f.js +639 -0
  149. package/docs/.island/dist/assets/dev.b373b152.js +37 -0
  150. package/docs/.island/dist/assets/dev.b39fd42a.js +37 -0
  151. package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
  152. package/docs/.island/dist/assets/extension.4bf3526b.js +1 -0
  153. package/docs/.island/dist/assets/extension.d64ed0b8.js +469 -0
  154. package/docs/.island/dist/assets/external-dependency.2ede7532.js +156 -0
  155. package/docs/.island/dist/assets/external-dependency.92ca89e0.js +156 -0
  156. package/docs/.island/dist/assets/getting-started.822cf0b2.js +117 -0
  157. package/docs/.island/dist/assets/getting-started.e2764829.js +114 -0
  158. package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
  159. package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +375 -0
  160. package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +374 -0
  161. package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +33 -0
  162. package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +39 -0
  163. package/docs/.island/dist/assets/index.01786ba7.js +30 -0
  164. package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
  165. package/docs/.island/dist/assets/index.cb118238.js +36 -0
  166. package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
  167. package/docs/.island/dist/assets/island_inject.69495876.js +1 -0
  168. package/docs/.island/dist/assets/island_inject.cdfb22d9.js +1 -0
  169. package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
  170. package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +100 -0
  171. package/docs/.island/dist/assets/modify-output-product.f363845a.js +100 -0
  172. package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
  173. package/docs/.island/dist/assets/plugin.70a61997.js +42 -0
  174. package/docs/.island/dist/assets/plugin.80b12ee2.js +42 -0
  175. package/docs/.island/dist/assets/publish-your-project.7321c10e.js +164 -0
  176. package/docs/.island/dist/assets/publish-your-project.7326359f.js +166 -0
  177. package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
  178. package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
  179. package/docs/.island/dist/assets/search.11353245.js +222 -0
  180. package/docs/.island/dist/assets/search.a1b1cff3.js +3 -0
  181. package/docs/.island/dist/assets/search.f9025ced.js +3 -0
  182. package/docs/.island/dist/assets/style.09015a4b.css +1 -0
  183. package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
  184. package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
  185. package/docs/.island/dist/assets/test-your-project.8ab2809e.js +190 -0
  186. package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +190 -0
  187. package/docs/.island/dist/assets/test.2bfe276b.js +66 -0
  188. package/docs/.island/dist/assets/test.a2c00a3f.js +67 -0
  189. package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
  190. package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +60 -0
  191. package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +60 -0
  192. package/docs/.island/dist/assets/using-storybook.adb88cb8.js +260 -0
  193. package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +260 -0
  194. package/docs/.island/dist/assets/welcome.94880043.js +13 -0
  195. package/docs/.island/dist/assets/welcome.b2140e7e.js +13 -0
  196. package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +26 -0
  197. package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +26 -0
  198. package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
  199. package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
  200. package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
  201. package/docs/.island/dist/client-entry.js +3 -0
  202. package/docs/.island/dist/en/api/build-config.html +344 -0
  203. package/docs/.island/dist/en/api/build-preset.html +82 -0
  204. package/docs/.island/dist/en/api/design-system.html +155 -0
  205. package/docs/.island/dist/en/api/dev.html +45 -0
  206. package/docs/.island/dist/en/api/index.html +41 -0
  207. package/docs/.island/dist/en/api/plugin.html +48 -0
  208. package/docs/.island/dist/en/api/test.html +58 -0
  209. package/docs/.island/dist/en/guide/advance/asset.html +68 -0
  210. package/docs/.island/dist/en/guide/advance/build-umd.html +72 -0
  211. package/docs/.island/dist/en/guide/advance/copy.html +82 -0
  212. package/docs/.island/dist/en/guide/advance/extension.html +41 -0
  213. package/docs/.island/dist/en/guide/advance/external-dependency.html +71 -0
  214. package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +148 -0
  215. package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +51 -0
  216. package/docs/.island/dist/en/guide/basic/before-getting-started.html +127 -0
  217. package/docs/.island/dist/en/guide/basic/command-preview.html +100 -0
  218. package/docs/.island/dist/en/guide/basic/modify-output-product.html +140 -0
  219. package/docs/.island/dist/en/guide/basic/publish-your-project.html +91 -0
  220. package/docs/.island/dist/en/guide/basic/test-your-project.html +72 -0
  221. package/docs/.island/dist/en/guide/basic/use-micro-generator.html +65 -0
  222. package/docs/.island/dist/en/guide/basic/using-storybook.html +113 -0
  223. package/docs/.island/dist/en/guide/intro/getting-started.html +76 -0
  224. package/docs/.island/dist/en/guide/intro/welcome.html +53 -0
  225. package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +49 -0
  226. package/docs/.island/dist/en/index.html +42 -0
  227. package/docs/.island/dist/react-dom.js +1 -0
  228. package/docs/.island/dist/react-dom_client.js +1 -0
  229. package/docs/.island/dist/react.js +1 -0
  230. package/docs/.island/dist/react_jsx-runtime.js +10 -0
  231. package/docs/.island/dist/ssr-manifest.json +57 -0
  232. package/docs/.island/dist/test-result.png +0 -0
  233. package/docs/.island/dist/why-module-solution.png +0 -0
  234. package/docs/.island/dist/zh/api/build-config.html +361 -0
  235. package/docs/.island/dist/zh/api/build-preset.html +82 -0
  236. package/docs/.island/dist/zh/api/design-system.html +149 -0
  237. package/docs/.island/dist/zh/api/dev.html +46 -0
  238. package/docs/.island/dist/zh/api/index.html +41 -0
  239. package/docs/.island/dist/zh/api/plugin.html +48 -0
  240. package/docs/.island/dist/zh/api/test.html +59 -0
  241. package/docs/.island/dist/zh/guide/advance/asset.html +68 -0
  242. package/docs/.island/dist/zh/guide/advance/build-umd.html +72 -0
  243. package/docs/.island/dist/zh/guide/advance/copy.html +82 -0
  244. package/docs/.island/dist/zh/guide/advance/extension.html +127 -0
  245. package/docs/.island/dist/zh/guide/advance/external-dependency.html +71 -0
  246. package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +148 -0
  247. package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +53 -0
  248. package/docs/.island/dist/zh/guide/basic/before-getting-started.html +127 -0
  249. package/docs/.island/dist/zh/guide/basic/command-preview.html +100 -0
  250. package/docs/.island/dist/zh/guide/basic/modify-output-product.html +140 -0
  251. package/docs/.island/dist/zh/guide/basic/publish-your-project.html +92 -0
  252. package/docs/.island/dist/zh/guide/basic/test-your-project.html +72 -0
  253. package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +65 -0
  254. package/docs/.island/dist/zh/guide/basic/using-storybook.html +114 -0
  255. package/docs/.island/dist/zh/guide/intro/getting-started.html +79 -0
  256. package/docs/.island/dist/zh/guide/intro/welcome.html +53 -0
  257. package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +49 -0
  258. package/docs/.island/dist/zh/index.html +42 -0
  259. package/docs/en/api/config/build-config.md +15 -5
  260. package/docs/en/api/config/build-preset.md +3 -2
  261. package/docs/en/api/config/design-system.md +623 -615
  262. package/docs/en/api/config/plugins.md +2 -2
  263. package/docs/en/api/config/testing.md +2 -1
  264. package/docs/en/guide/advance/asset.mdx +0 -4
  265. package/docs/en/guide/advance/build-umd.mdx +3 -3
  266. package/docs/en/guide/advance/in-depth-about-build.md +14 -13
  267. package/docs/en/guide/advance/in-depth-about-dev-command.md +2 -1
  268. package/docs/en/guide/basic/before-getting-started.md +16 -9
  269. package/docs/en/guide/basic/command-preview.md +2 -2
  270. package/docs/en/guide/basic/modify-output-product.md +65 -69
  271. package/docs/en/guide/basic/test-your-project.mdx +1 -3
  272. package/docs/en/guide/basic/use-micro-generator.md +4 -0
  273. package/docs/en/guide/basic/using-storybook.mdx +1 -13
  274. package/docs/en/guide/intro/getting-started.md +16 -7
  275. package/docs/en/plugins/guide/getting-started.mdx +2 -2
  276. package/docs/en/plugins/guide/plugin-object.mdx +5 -5
  277. package/docs/zh/api/config/build-config.md +18 -6
  278. package/docs/zh/api/config/build-preset.md +3 -2
  279. package/docs/zh/api/config/design-system.md +2 -2
  280. package/docs/zh/api/config/plugins.md +2 -2
  281. package/docs/zh/api/config/testing.md +3 -2
  282. package/docs/zh/guide/advance/asset.mdx +0 -5
  283. package/docs/zh/guide/advance/build-umd.mdx +3 -3
  284. package/docs/zh/guide/advance/in-depth-about-build.md +14 -13
  285. package/docs/zh/guide/advance/in-depth-about-dev-command.md +2 -1
  286. package/docs/zh/guide/basic/before-getting-started.md +15 -8
  287. package/docs/zh/guide/basic/command-preview.md +2 -2
  288. package/docs/zh/guide/basic/modify-output-product.md +17 -19
  289. package/docs/zh/guide/basic/test-your-project.mdx +1 -3
  290. package/docs/zh/guide/basic/use-micro-generator.md +5 -1
  291. package/docs/zh/guide/basic/using-storybook.mdx +9 -19
  292. package/docs/zh/guide/intro/getting-started.md +17 -11
  293. package/docs/zh/plugins/guide/getting-started.mdx +2 -2
  294. package/docs/zh/plugins/guide/plugin-object.mdx +5 -5
  295. package/modern.config.ts +11 -5
  296. package/package.json +4 -4
  297. package/doc_build/static/js/async/api_.js.map +0 -1
  298. package/doc_build/static/js/async/en_.js.map +0 -1
  299. package/doc_build/static/js/async/en_api_.js.map +0 -1
  300. package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +0 -1
  301. package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +0 -1
  302. package/doc_build/static/js/async/guide_basic_command-preview.js.map +0 -1
  303. package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +0 -1
  304. package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +0 -1
  305. package/doc_build/static/js/async/guide_intro_welcome.js.map +0 -1
  306. package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +0 -1
  307. package/doc_build/static/js/async/index.js.map +0 -1
  308. package/doc_build/static/js/async/plugins_official-list_overview.js.map +0 -1
@@ -9,9 +9,9 @@ This chapter describes the configuration of the registered module-tools plugin.
9
9
  - type: `Array<ModuleToolsPlugin>`
10
10
 
11
11
  ```js modern.config.ts
12
- import { ExamplePlugin } from '. /plugins/example';
12
+ import { examplePlugin } from '. /plugins/example';
13
13
  export default defineConfig({
14
- plugins: [ExamplePlugin()],
14
+ plugins: [examplePlugin()],
15
15
  });
16
16
  ```
17
17
 
@@ -5,7 +5,8 @@ sidebar_position: 5
5
5
  # Testing
6
6
 
7
7
  This chapter describes the test-related configuration
8
- :::tips
8
+
9
+ :::tip
9
10
  You need to enable the unit testing feature with `pnpm run new` first.
10
11
  :::
11
12
 
@@ -18,7 +18,6 @@ For the handling of static files, the module project currently supports the foll
18
18
 
19
19
  - Set the static resource path to `. /assets`.
20
20
  - For files over **10kb** they are inlined into the code.
21
- - Use [SVGR](https://react-svgr.com/) for files with the `.svg` suffix.
22
21
 
23
22
  Let us look at the following example:
24
23
 
@@ -144,6 +143,3 @@ If the size of `bg.png` is larger than 10 kb, then the product content will be.
144
143
 
145
144
  </CH.Spotlight>
146
145
 
147
- ## SVGR
148
-
149
- WIP
@@ -164,7 +164,7 @@ console.info(React);
164
164
 
165
165
  At this point we will see the product code like this.
166
166
 
167
- ```js dist/index.js focus=7:12
167
+ ```js dist/index.js focus=12:18
168
168
  (function (global, factory) {
169
169
  if (typeof module === 'object' && typeof module.exports === 'object')
170
170
  factory();
@@ -203,7 +203,7 @@ export default () => {
203
203
 
204
204
  ** By default, the name of the source file is used as the name of the module's global variable in the browser. **For the above example, the product would read as follows:
205
205
 
206
- ```js ./dist/index.js focus=6:6
206
+ ```js ./dist/index.js focus=9:9
207
207
  (function (global, factory) {
208
208
  if (typeof module === 'object' && typeof module.exports === 'object')
209
209
  factory(exports);
@@ -233,7 +233,7 @@ export default defineConfig({
233
233
 
234
234
  The construction products at this point are:
235
235
 
236
- ```js ./dist/index.js focus=6:6
236
+ ```js ./dist/index.js focus=9:9
237
237
  (function (global, factory) {
238
238
  if (typeof module === 'object' && typeof module.exports === 'object')
239
239
  factory(exports);
@@ -10,7 +10,8 @@ In the [Basic Usage] section, we already knew that you can modify the output pro
10
10
  If you are not sure what `buildConfig` is, it is recommended to take some time to understand it by following this link.
11
11
 
12
12
  - [[modify-output-product](/en/guide/basic/modify-output-product)]
13
- :::
13
+
14
+ :::
14
15
 
15
16
  In this chapter we'll dive into the use of certain build configurations and understand what happens when the `modern build` command is executed.
16
17
 
@@ -34,7 +35,7 @@ In `buildConfig` you can specify whether the current build task is Bundle or Bun
34
35
  - When `buildType: 'bundleless'`, `input` defaults to `['src']`
35
36
  > In fact, at `buildType: 'bundle'`, the build tool detects the existence of a file matching the name rule `src/index.(j|t)sx?` and uses it as an entry file.
36
37
 
37
- :::warn{title=notes}
38
+ :::warning{title=notes}
38
39
  It is recommended that you do not specify multiple source file directories during a Bundleless build, as unintended results may occur. Bundleless builds with multiple source directories are currently in an unstable stage.
39
40
  :::
40
41
 
@@ -44,7 +45,7 @@ We know from the defaults: **Bundle builds can generally specify a file path as
44
45
 
45
46
  In addition to setting `input` to an array, you can also set it to an object during the Bundle build process. **By using the object form, we can modify the name of the file that the build product outputs**. So for the following example, `. /src/index.ts` corresponds to the path of the build product file as `. /dist/main.js`.
46
47
 
47
- ```tsx modern.config.ts
48
+ ```js modern.config.ts
48
49
  import { defineConfig } from '@modern-js/module-tools';
49
50
 
50
51
  export default defineConfig({
@@ -79,7 +80,7 @@ The [`buildConfig.dts`](/en/api/config/build-config#dts) configuration is mainly
79
80
 
80
81
  Type generation is turned on by default, if you need to turn it off, you can configure it as follows:
81
82
 
82
- ```ts ./modern.config.ts
83
+ ```js modern.config.ts
83
84
  import { defineConfig } from '@modern-js/module-tools';
84
85
 
85
86
  export default defineConfig({
@@ -106,7 +107,7 @@ The **module engineering solution also supports packaging of type files**, altho
106
107
 
107
108
  During the Bundleless build process, if an alias appears in the source code, e.g.
108
109
 
109
- ```ts ./src/index.ts
110
+ ```js ./src/index.ts
110
111
  import utils from '@common/utils';
111
112
  ```
112
113
 
@@ -123,7 +124,7 @@ However, there are some cases that cannot be handled at this time.
123
124
 
124
125
  General usage:
125
126
 
126
- ```ts
127
+ ```js
127
128
  import { defineConfig } from '@modern-js/module-tools';
128
129
 
129
130
  export default defineConfig({
@@ -141,7 +142,7 @@ export default defineConfig({
141
142
 
142
143
  For the use of `dts.only`:
143
144
 
144
- ```ts
145
+ ```js
145
146
  import { defineConfig } from '@modern-js/module-tools';
146
147
 
147
148
  export default defineConfig({
@@ -169,7 +170,7 @@ export default defineConfig({
169
170
 
170
171
  #### Environment variable replacement
171
172
 
172
- ```ts
173
+ ```js
173
174
  import { defineConfig } from '@modern-js/module-tools';
174
175
  export default defineConfig({
175
176
  buildConfig: {
@@ -182,21 +183,21 @@ export default defineConfig({
182
183
 
183
184
  With the above configuration, we can put the following code.
184
185
 
185
- ```
186
+ ```js
186
187
  // pre-compiler code
187
188
  console.log(process.env.VERSION);
188
189
  ```
189
190
 
190
191
  When executing `VERSION=1.0.0 modern build`, the conversion is:
191
192
 
192
- ```
193
+ ```js
193
194
  // compiled code
194
195
  console.log('1.0.0');
195
196
  ```
196
197
 
197
198
  #### Global variable replacement
198
199
 
199
- ```ts
200
+ ```js
200
201
  import { defineConfig } from '@modern-js/module-tools';
201
202
  export default defineConfig({
202
203
  buildConfig: {
@@ -209,14 +210,14 @@ export default defineConfig({
209
210
 
210
211
  With the above configuration, we can put the following code.
211
212
 
212
- ```
213
+ ```js
213
214
  // pre-compile code
214
215
  console.log(VERSION);
215
216
  ```
216
217
 
217
218
  Convert to:
218
219
 
219
- ```
220
+ ```js
220
221
  // post-compile code
221
222
  console.log('1.0.0');
222
223
  ```
@@ -10,7 +10,8 @@ sidebar_position: 2
10
10
  如果你还不清楚 `buildConfig` 是什么,建议花一些时间通过下面的链接了解一下:
11
11
 
12
12
  - 【[修改输出产物](/guide/basic/modify-output-product)】
13
- :::
13
+
14
+ :::
14
15
 
15
16
  而在本章里我们将要深入理解某些构建配置的使用以及了解执行 `modern build` 命令的时候发生了什么。
16
17
 
@@ -6,7 +6,7 @@ sidebar_position: 1
6
6
 
7
7
  ## Environment preparation
8
8
 
9
- In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.17.6**. because non-stable NodeJS releases frequently have bugs. You might consider installing via [nvm-windows](https://github.com/coreybutler/nvm-windows) and [nvm](https://github.com/nvm-sh/nvm) (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on.
9
+ In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.18.0**. because non-stable NodeJS releases frequently have bugs. You might consider installing via [nvm-windows](https://github.com/coreybutler/nvm-windows) and [nvm](https://github.com/nvm-sh/nvm) (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on.
10
10
 
11
11
  ## Getting Started with npm
12
12
 
@@ -71,6 +71,7 @@ Similarly, you can install **only packages needed for local development and test
71
71
  ```
72
72
 
73
73
  **When installing or using third-party npm packages be sure to determine what they are for and whether they should be placed in `"dependencies"` or `"devDependencies"` by distinguishing between their types.**
74
+
74
75
  :::tip
75
76
  In general, packages that need to be used in source code are `dependencies` dependencies. Unless you are exporting dependent code locally via packaging, in which case it can be treated as a `devDependencies` dependency.
76
77
  :::
@@ -161,25 +162,31 @@ npm install -g pnpm
161
162
 
162
163
  ## Module Tools configuration file
163
164
 
164
- A configuration file for Module Tools is provided in the initial module project directory -- `modern.config.(j|t)s`. By default, no configuration is required, so the `modern.config` configuration file is not required to exist.
165
+ The Module Tools configuration file - `modern.config.(j|t)s` - is provided in the project directory of the module project created with `@modern-js/create`. However, the `modern.config` configuration file is not required to exist.
165
166
 
166
- The contents of the initial configuration file are as follows.
167
+ By default, the contents of the generated configuration file are as follows.
167
168
 
168
169
  ```typescript
169
170
  // modern.config.ts
170
- import { defineConfig } from '@modern-js/module-tools';
171
+ import moduleTools, { defineConfig } from '@modern-js/module-tools';
171
172
 
172
- export default defineConfig({});
173
+ export default defineConfig({
174
+ plugins: [moduleTools()],
175
+ buildPreset: 'npm-library',
176
+ });
173
177
  ```
174
178
 
175
179
  ```js
176
180
  // modern.config.js
177
- const { defineConfig } = require('@modern-js/module-tools');
181
+ import moduleTools from '@modern-js/module-tools';
178
182
 
179
- module.exports = defineConfig({});
183
+ export default {
184
+ plugins: [moduleTools()],
185
+ buildPreset: 'npm-library',
186
+ };
180
187
  ```
181
188
 
182
- **We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the configuration file: the:
189
+ **We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the config file: the
183
190
 
184
191
  ```typescript
185
192
  // modern.config.ts
@@ -188,5 +195,5 @@ export default {};
188
195
 
189
196
  ```js
190
197
  // modern.config.js
191
- module.exports = {};
198
+ export default {};
192
199
  ```
@@ -55,6 +55,7 @@ The `modern new` command is used to start the microgenerator functionality, whic
55
55
 
56
56
  The following features can currently be enabled.
57
57
 
58
+ - Testing support
58
59
  - Storybook debugging
59
60
  - Tailwind CSS support
60
61
  - Modern.js Runtime API
@@ -88,6 +89,7 @@ Options:
88
89
  -h, --help display help for command
89
90
  ```
90
91
 
92
+ You need to execute `modern new` to turn on the test function before you can execute the `modern test` command.
91
93
  The `modern test` command will automatically run the `src/tests/*.test.(js|ts|jsx|tsx)` file as a test case.
92
94
 
93
95
  ## `modern lint`
@@ -204,5 +206,3 @@ Options:
204
206
  The `modern upgrade` command is used to upgrade the project Modern.js related dependencies to the latest version.
205
207
 
206
208
  Executing the command `npx modern upgrade` in the project root directory will update the Modern.js dependencies in `package.json` of the currently executing project to the latest version by default.
207
-
208
- command is provided in `@modern-js/module-tools` version **>= 1.17.0**, previous versions can be upgraded using `npx @modern-js/upgrade`.
@@ -2,143 +2,139 @@
2
2
  sidebar_position: 3
3
3
  ---
4
4
 
5
- # modify-output-product
6
-
7
- ## Modify output product
5
+ ## Modify the output product
8
6
 
9
7
  ## Default output products
10
8
 
11
- When the `modern build` command is used in an initialized project, the products are generated according to the default configuration supported by Module Tools. The default supported configurations are as follows.
9
+ When the `modern build` command is used in an initialized project, the products are generated according to the default configuration supported by Module Tools. The default supported configurations are specified as follows.
12
10
 
13
11
  ```typescript
14
- import { defineConfig } from '@modern-js/module-tools';
12
+ import moduleTools, { defineConfig } from '@modern-js/module-tools';
15
13
 
16
14
  export default defineConfig({
17
- buildPreset: 'base-config',
15
+ plugins: [moduleTools()],
16
+ buildPreset: 'npm-library',
18
17
  });
19
18
  ```
20
19
 
21
- **The default generated product has the following characteristics**:
22
-
23
- - The code format is [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules), or simply `cjs`.
24
- - Code syntax is supported up to `ES6`.
25
- - All code is packaged into a single file, i.e. **bundle** processing is performed.
26
- - The output root directory is the `dist` directory under the project, and the output directory for type files is `dist/types`.
20
+ **The default generation product has the following characteristics**.
27
21
 
28
- :::tip
22
+ - will generate [CommonJS](https://nodejs.org/api/modules.html#modules-commonjs-modules) and [ESM](https://nodejs.org/api/esm.html#modules- ecmascript-modules).
23
+ - The code syntax is supported up to `ES6` , and more advanced syntax will be converted.
24
+ - All code is packaged into one file, i.e. **bundle** processing is performed.
25
+ - The output root directory is the `dist` directory under the project, and the type file output directory is `dist/types`.
29
26
 
30
- 1. By "code syntax support up to ES6", we mean that the syntax supported by the product code will not exceed `ES6`. If the source code uses syntax above `ES6` (e.g. `ES2017`), it will be converted.
31
- :::
32
-
33
- You may have the following questions when you see this:
27
+ You may have the following questions when you see this.
34
28
 
35
29
  1. what is `buildPreset`?
36
- 2. what determines these characteristics of the output?
30
+ 2. what determines these characteristics of the product?
37
31
 
38
32
  Then the next step is to first explain `buildPreset`.
39
33
 
40
34
  ## buildPreset
41
35
 
42
- `buildPreset` represents one or more sets of build-related configurations prepared in advance. By using the corresponding preset values of `buildPreset`, you can eliminate the troublesome and complicated configuration work and get the expected product.
36
+ The `buildPreset` represents one or more sets of build-related configurations prepared in advance. By using the corresponding preset values of the `buildPreset`, you can eliminate the troublesome and complicated configuration work and get the expected product.
43
37
 
44
- ### String form of `buildPreset`
38
+ ### String form of build preset
45
39
 
46
40
  The value of a **build preset can be in the form of a string**, so a build preset of this form is called a preset string.
47
41
 
48
- The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/en/api/config/build-config). The relationship between **generic preset strings and variants** is explained here.
42
+ The module engineering solution provides generic build preset strings and corresponding variants, depending on the generic scenario in which the npm package is used. All currently supported preset strings can be viewed via the [BuildPreset API](/api/config/build-preset). Here is an explanation about the relationship between **generic preset strings and variants**.
49
43
 
50
- Among the generic preset strings, `"npm-library"` can be used in the scenario of developing npm packages of the library type, which is suitable for most common module type projects. When `"npm-library"` is set, the output product of the project will have the following characteristics:
44
+ Among the generic preset strings, `"npm-library"` can be used in the scenario of developing npm packages of the library type, which is suitable for most common module type projects. When `"npm-library"` is set, the output product of the project will have the following characteristics.
51
45
 
52
- - In the `dist/lib` directory you will get the product in the code format `cjs`, with syntax support up to `es6` and after packaging.
53
- - In the `dist/es` directory, you get code in the format `esm`, with syntax support up to `es6` and packaged.
46
+ - In the `dist/lib` directory you will get code formatted as `cjs`, syntax supported up to `es6` and packaged.
47
+ - In the `dist/es` directory, you get code in the format `esm`, with syntax support up to `es6` and after packaging.
54
48
  - In the `dist/types` directory, you get the type files. If it is not a TypeScript project, there is no such directory.
55
49
 
56
- The default string `"npm-library"` is a variant of the original product with modified **code-syntax support** and a string naming change to `"npm-library-[es5 | es2016.... . es2020 | esnext]"`.
50
+ The default string `"npm-library"` is a variant of the original product with a modified **code syntax support** feature and a string naming change to `"npm-library-[es5 | es2016.... . es2020 | esnext]"`.
57
51
 
58
- For example, if the output product is based on the preset string `"npm-library"` and the syntax supported by the product code is changed to `es2017`, then simply changing `"npm-library"` to `"npm-library-es2017"` would be sufficient.
52
+ For example, if the output product is based on the preset string `"npm-library"` and the syntax supported by the product code is changed to `es5`, then simply changing `"npm-library"` to `"npm-library-es5"` would be sufficient.
59
53
 
60
- ### Function form of `buildPreset`
54
+ ### Build pre-defined function forms
61
55
 
62
56
  **In addition to the string form, the value of a build preset can also be in the form of a function, where the specific configuration corresponding to a preset value can be printed or modified**.
63
57
 
64
- For example, if the same effect as the preset string `"npm-library-es2017"` is achieved using the preset function form, it can be done as follows:
58
+ For example, to achieve the same effect as the preset string ``npm-library-es5"` using the form of a preset function, you can do the following.
65
59
 
66
60
  ```typescript
67
- import { defineConfig } from "@modern-js/module-tools";
61
+ import { defineConfig } from '@modern-js/module-tools';
68
62
 
69
63
  export default defineConfig({
70
64
  buildPreset({ preset }) {
71
65
  return preset.NPM_LIBRARY.map(config => {
72
- return { ... .config, target: 'es2017' }
66
+ return { ... .config, target: 'es5' }
73
67
  });
74
68
  },
75
69
  });
76
70
  ```
77
71
 
78
- In the above code implementation, `preset.NPM_LIBRARY` corresponds to the preset string `"npm-library"`, which represents the `"npm-library"` equivalent of a multi-group build-related configuration. We traverse the `NPM_LIBRARY` array, which contains multiple `buildConfig` objects, with the `map` method. We make a shallow copy of the original `buildConfig` object and modify the shallow copy to get `buildConfig.target`, specifying it as `es2017`.
72
+ In the above code implementation, `preset.NPM_LIBRARY` corresponds to the preset string `"npm-library"`, which represents the `"npm-library"` equivalent of a multi-group build-related configuration. We traverse the `NPM_LIBRARY` array, which contains multiple `buildConfig` objects, with the `map` method. We make a shallow copy of the original `buildConfig` object and modify the shallow copy to get `buildConfig.target`, specifying it as `es5`.
79
73
 
80
- > The specific value of `preset.NPM_LIBRARY` can be viewed via the [BuildPreset API](/en/api/config/build-config). The `preset` object contains not only `NPM_LIBRARY`, but also other similar constants.
74
+ > NPM_LIBRARY`, you can check it with [BuildPreset API](/api/config/build-preset). The`preset`object contains not only`NPM_LIBRARY`, but also other similar constants.
81
75
 
82
- So what is the `buildConfig` object here? And what are the previously mentioned build product features based on?
76
+ So what is the `buildConfig` object here? What is the basis for the build product feature mentioned before?
83
77
 
84
- We explain it next.
78
+ Let's explain next.
85
79
 
86
80
  ## Build configuration (object)
87
81
 
88
- **`buildConfig` is a configuration object that describes how to compile and generate build products**. What was mentioned at the beginning about "_features of build products_" are actually properties supported by `buildConfig`. The currently supported properties cover the needs of most module type projects when building products. `buildConfig` not only contains some of the properties that products have, but also some of the features needed to build products. The following is a brief list from a classification point of view:
82
+ **`buildConfig` is a configuration object that describes how to compile and generate build products**. What was mentioned at the beginning about "_features of build products_" are actually properties supported by `buildConfig`. The currently supported properties cover the needs of most module type projects when building products. `buildConfig` not only contains some properties that products have, but also contains some features needed to build products. The following is a brief list from a classification point of view.
89
83
 
90
84
  **The basic attributes of a build product include:**
91
85
 
92
- - Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/en/api/config/build-config#buildtype).
93
- - Product support for syntax: the corresponding API is [`buildConfig.target`](/en/api/config/build-config#target).
94
- - Output format: The corresponding API is [`buildConfig.format`](/en/api/config/build-config#format).
95
- - How to handle the output type file: the corresponding API is [`buildConfig.dts`](/en/api/config/build-config#dts).
96
- - How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/en/api/config/build-config#sourcemap).
97
- - The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/en/api/config/build-config#input).
98
- - The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/en/api/config/build-config#outDir).
99
- - The source directory of the build: the corresponding API is [`buildConfig.sourceDir`](/en/api/config/build-config#sourcedir).
86
+ - Whether the product is packaged or not: the corresponding API is [`buildConfig.buildType`](/api/config/build-config#buildtype).
87
+ - Product support for syntax: the corresponding API is [`buildConfig.target`](/api/config/build-config#target).
88
+ - Output format: the corresponding API is [`buildConfig.format`](/api/config/build-config#format).
89
+ - How the output type file is handled: the corresponding API is [`buildConfig.dts`](/api/config/build-config#dts).
90
+ - How the sourceMap of the product is handled: the corresponding API is [`buildConfig.sourceMap`](/api/config/build-config#sourcemap).
91
+ - The input (or source file) corresponding to the output: the corresponding API is [`buildConfig.input`](/api/config/build-config#input).
92
+ - The directory of the output of the product: the corresponding API is [`buildConfig.outDir`](/api/config/build-config#outDir).
93
+ - Build source directory: the corresponding API is [`buildConfig.sourceDir`](/api/config/build-config#sourcedir).
100
94
 
101
- **Common functions needed to build products include:**
95
+ **Common functions required for build products include:**
102
96
 
103
- - Alias: The corresponding API is [`buildConfig.alias`](/en/api/config/build-config#alias).
104
- - Static resource handling: The corresponding API is [`buildConfig.asset`](/en/api/config/build-config#asset).
97
+ - Alias: The corresponding API is [`buildConfig.alias`](/api/config/build-config#alias).
98
+ - Static resource handling: the corresponding API is [`buildConfig.asset`](/api/config/build-config#asset).
105
99
  - Third-party dependency handling: The corresponding APIs are
106
- - [`buildConfig.autoExternal`](/en/api/config/build-config#autoexternal).
107
- - [`buildConfig.externals`](/en/api/config/build-config#externals).
108
- - Copy: The corresponding API is [`buildConfig.copy`](/en/api/config/build-config#copy).
109
- - Global variable substitution: the corresponding API is [`buildConfig.define`](/en/api/config/build-config#define).
110
- - Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/en/api/config/build-config#jsx).
100
+ - [`buildConfig.autoExternal`](/api/config/build-config#autoexternal).
101
+ - [`buildConfig.externals`](/api/config/build-config#externals).
102
+ - Copy: The corresponding API is [`buildConfig.copy`](/api/config/build-config#copy).
103
+ - Global variable substitution: the corresponding API is [`buildConfig.define`](/api/config/build-config#define).
104
+ - Specify [JSX](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) compilation method, the corresponding API is [`buildConfig.jsx`](/api/config/ build-config#jsx).
111
105
 
112
106
  **Some advanced properties or less frequently used functions:**
113
107
 
114
- - Product code compression: The corresponding API is [`buildConfig.minify`](/en/api/config/build-config#minify).
115
- - Code splitting: [`buildConfig.splitting`](/en/api/config/build-config#splitting)
116
- - Specify whether the build product is for the NodeJS environment or the browser environment: the corresponding API is [`buildConfig.platform`](/en/api/config/build-config#platform).
108
+ - Product code compression: The corresponding API is [`buildConfig.minify`](/api/config/build-config#minify).
109
+ - Code splitting: [`buildConfig.splitting`](/api/config/build-config#splitting)
110
+ - Specify whether the build product is for the NodeJS environment or the browser environment: the corresponding API is [`buildConfig.platform`](/api/config/build-config#platform).
117
111
  - umd product-related.
118
- - Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/en/api/config/build-config#umdglobals).
119
- - Specify the module name of the umd product: the corresponding API is [`buildConfig.umdModuleName`](/en/api/config/build-config#umdmodulename).
112
+ - Specifies the global variables imported externally to the umd product: the corresponding API is [`buildConfig.umdGlobals`](/api/config/build-config#umdglobals).
113
+ - Specify the module name of the umd product: the corresponding API is [`buildConfig.umdModuleName`](/api/config/build-config#umdmodulename).
120
114
 
121
- In addition to the above categories, frequently asked questions and best practices about these APIs can be found at the following links.
115
+ In addition to the above categories, frequently asked questions and best practices about these APIs can be found at the following links
122
116
 
123
- - [What are `bundle` and `bundleless`?](/en/guide/advance/in-depth-about-build#bundle-and-bundleless)
124
- - [The relationship between `input` and `sourceDir`](/en/guide/advance/in-depth-about-build#relationship-between-input-and-sourcedir)
125
- - [The multiple ways of generating type files in products](/en/guide/advance/in-depth-about-build#declaration-type-files)
126
- - [The use of `buildConfig.define` for different scenarios.](/en/guide/advance/in-depth-about-build#buildconfigdefine-usage-for-different-scenarios)
127
- - [How to handle third-party dependencies?](/en/guide/advance/external-dependency)
128
- - [How to use copy?](/en/guide/advance/copy)
129
- - [How to build umd products?](/en/guide/advance/build-umd)
130
- - [The capabilities currently supported by static resources.](/en/guide/advance/asset)
117
+ - [What are `bundle` and `bundleless`?](/guide/advance/in-depth-about-build#bundle- and-bundleless)
118
+ - [Relationship of `input` to `sourceDir`](/guide/advance/in-depth-about-build#input- to -sourcedir-)
119
+ - [Multiple ways to generate type files in product](/guide/advance/in-depth-about-build#type-files).
120
+ - [`buildConfig.define` Different ways to use it for different scenarios.](/guide/advance/in-depth-about-build#buildconfigdefine - How to use it for different scenarios)
121
+ - [How to handle third-party dependencies?](/guide/advance/external-dependency)
122
+ - [How to use copy?](/guide/advance/copy)
123
+ - How do I build umd products? (/guide/advance/build-umd# sets the global variable name of the project)
124
+ - [The capabilities currently supported by static resources.](/guide/advance/asset)
131
125
 
132
126
  ## When to use `buildConfig`
133
127
 
134
- `buildConfig` is one of the ways used to modify the product, **and only `buildConfig` will take effect when configured in conjunction with `buildPreset`**. So if configured as follows.
128
+ `buildConfig` is one of the methods used to modify the product, **only `buildConfig` will take effect when configured in conjunction with `buildPreset`**. So if configured as follows.
135
129
 
136
130
  ```typescript
137
131
  import { defineConfig } from '@modern-js/module-tools';
138
132
 
139
133
  export default defineConfig({
140
- buildConfig: [{}],
141
- buildPreset: 'base-config',
134
+ buildConfig: {
135
+ format: 'umd',
136
+ },
137
+ buildPreset: 'npm-library',
142
138
  });
143
139
  ```
144
140
 
@@ -150,4 +146,4 @@ Since both 'buildConfig' and 'buildPreset' are present, only the 'buildConfig' c
150
146
 
151
147
  The set or sets of build-related configurations represented by `buildPreset` are composed of `buildConfig`, **which can be used to customize output products** when the current project needs cannot be met using `buildPreset`.
152
148
 
153
- The process of using `buildConfig` is the process of thinking about "_what kind of build product to get_".
149
+ The process of using `buildConfig` is the process of thinking about **what kind of build product to get**.
@@ -8,9 +8,7 @@ This chapter will describe how to test modules.
8
8
 
9
9
  ## Prerequisites and conventions
10
10
 
11
- To use the testing functionality of the project, you need to make sure that the project contains the following dependencies:
12
-
13
- - `"@modern-js/plugin-testing"`
11
+ To use the testing features of the project, you need to make sure that the project contains the dependency: `"@modern-js/plugin-testing"` , which can be done with [modern new](/guide/basic/command-preview#modern-new).
14
12
 
15
13
  In the module engineering scheme, the following conventions are in place for test cases, or files for writing tests:
16
14
 
@@ -14,6 +14,10 @@ Thus with these capabilities, **Microgenerator can enable additional feature fun
14
14
 
15
15
  The microgenerator can be started via [`modern new`](/guide/basic/command-preview). The current Microgenerator features supported by the Module Engineering program are:
16
16
 
17
+ ## Test
18
+
19
+ When we want to test some modules, we can enable the test test feature. When this feature is enabled, **a `tests` directory and related files will be created in the project directory, and a new `"@modern-js/plugin-testing"` dependency will be added to package.json**.
20
+
17
21
  ## Storybook
18
22
 
19
23
  The **Storybook feature** can be enabled when we want to debug a component or a common module. When this feature is enabled, **the `stories` directory and related files are created in the project directory, and a new `"@modern-js/plugin-storybook"` dependency is added to package.json**.
@@ -150,8 +150,6 @@ Not only is it impossible to verify that the component product is correct using
150
150
 
151
151
  ## Configure Storybook
152
152
 
153
- ### Configuration file
154
-
155
153
  Storybook is officially configured for projects through a folder called `.storybook`, which contains various configuration files. **In a module project scenario, Storybook configuration files can be added to the `config/storybook` directory of the project.**
156
154
 
157
155
  For more information on how to use the various Storybook configuration files, see the following links:
@@ -165,17 +163,7 @@ For more information on how to use the various Storybook configuration files, se
165
163
 
166
164
  In the future we will consider whether these configurations can be allowed to be modified, but for now we are limiting their use to reduce unpredictable issues.
167
165
 
168
- ### `dev.storybook`
169
-
170
- In addition to the configuration file, the module engineering solution also provides a `dev.storybook` configuration item in the `modern.config.(j|t)s` project configuration file.
171
-
172
- The webpack configuration of Storybook can be modified via this configuration.
173
-
174
- {/* 链接待补充 */}
175
-
176
- - `dev.storybook.webpack`
177
-
178
- ### Building Storybook Products
166
+ ## Building Storybook Products
179
167
 
180
168
  In addition to Storybook debugging of components or common modules, you can also perform Storybook build tasks with the following commands.
181
169
 
@@ -6,22 +6,32 @@ sidebar_position: 3
6
6
 
7
7
  ## 3 minute demo
8
8
 
9
- Want to experience Module Tools in action? The only prerequisite you need is [Node.js LTS](https://github.com/nodejs/Release) and make sure your Node version is **>= 14.17.6**.
9
+ Want to experience Module Tools in action? The only prerequisite you need is [Node.js LTS](https://github.com/nodejs/Release) and make sure your Node version is **>= 14.18.0**.We recommend using the LTS version of Node.js 16.
10
10
 
11
11
  From your shell, install the following dependencies in your project.
12
12
 
13
13
  - `@modern-js/module-tools`
14
- - `@modern-js/plugin-testing`
14
+ - `"typescript"` (omitted if not a TypeScript project)
15
15
 
16
16
  > If it's a TypeScript project, add the `"typescript"` dependency.
17
17
 
18
18
  ```bash
19
- npm install -D @modern-js/module-tools @modern-js/plugin-testing
19
+ npm install -D @modern-js/module-tools typescript
20
20
  ```
21
21
 
22
22
  > For projects that use pnpm or the Yarn package manager, just replace npm. **pnpm is recommended**.
23
23
 
24
- Then add the command `"build": "modern build"` to your project's `package.json` file.
24
+ Next, create the `modern.config.(t|j)s` file in the root of the project.
25
+
26
+ ``` ts
27
+ import moduleTools, { defineConfig } from '@modern-js/module-tools';
28
+
29
+ export default defineConfig({
30
+ plugins: [moduleTools()],
31
+ })
32
+ ```
33
+
34
+ Finally, add the command `"build": "modern build"` to the project's `package.json` file.
25
35
 
26
36
  ```json
27
37
  {
@@ -33,11 +43,11 @@ Then add the command `"build": "modern build"` to your project's `package.json`
33
43
 
34
44
  If your project has a `src/index.(js|jsx)` file or both `src/index.(ts|tsx)` and `tsconfig.json` files, then congratulations you can run the `npm run build` command directly to build your project with Module Tools.
35
45
 
36
- **If you want to see real projects that use the module engineering solution, you can execute the following command**.
46
+ **If you want to see the complete project using the modular engineering scheme, you can execute the following command**.
37
47
 
38
48
  ```bash
39
49
  git clone https://github.com/modern-js-dev/module-tools-examples
40
- cd module-tools-example
50
+ cd module-tools-example/base
41
51
 
42
52
  ## Execute the build.
43
53
  pnpm build
@@ -50,7 +60,6 @@ pnpm dev storybook
50
60
 
51
61
  ## Test
52
62
  pnpm test
53
- pnpm test
54
63
  ```
55
64
 
56
65
  **If you want to create a complete module project, you can execute the following command:**
@@ -54,9 +54,9 @@ export const ExamplePlugin = (): CliPlugin<ModuleTools> => {
54
54
  Then we register the plugin we just wrote via the [`plugins`](/en/api/config/plugins) API.
55
55
 
56
56
  ```ts . /modern.config.ts
57
- import { ExamplePlugin } from '. /plugins/example';
57
+ import { examplePlugin } from '. /plugins/example';
58
58
  export default defineConfig({
59
- plugins: [ExamplePlugin()],
59
+ plugins: [examplePlugin()],
60
60
  });
61
61
  ```
62
62