@modern-js/module-tools-docs 2.0.0-beta.4 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (342) hide show
  1. package/.eslintrc.js +13 -0
  2. package/doc_build/html/main/index.html +16 -0
  3. package/doc_build/route.json +10 -0
  4. package/doc_build/static/css/main.css +3370 -0
  5. package/doc_build/static/css/main.css.map +1 -0
  6. 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 +85 -0
  7. 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 -0
  8. package/doc_build/static/js/async/api_.js +56 -0
  9. package/doc_build/static/js/async/api_.js.map +1 -0
  10. package/doc_build/static/js/async/api_config_build-config.js +11309 -0
  11. package/doc_build/static/js/async/api_config_build-config.js.map +1 -0
  12. package/doc_build/static/js/async/api_config_build-preset.js +7849 -0
  13. package/doc_build/static/js/async/api_config_build-preset.js.map +1 -0
  14. package/doc_build/static/js/async/api_config_design-system.js +48708 -0
  15. package/doc_build/static/js/async/api_config_design-system.js.map +1 -0
  16. package/doc_build/static/js/async/api_config_plugins.js +1492 -0
  17. package/doc_build/static/js/async/api_config_plugins.js.map +1 -0
  18. package/doc_build/static/js/async/api_config_testing.js +2130 -0
  19. package/doc_build/static/js/async/api_config_testing.js.map +1 -0
  20. package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js +14394 -0
  21. package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js.map +1 -0
  22. package/doc_build/static/js/async/en_.js +85 -0
  23. package/doc_build/static/js/async/en_.js.map +1 -0
  24. package/doc_build/static/js/async/en_api_.js +55 -0
  25. package/doc_build/static/js/async/en_api_.js.map +1 -0
  26. package/doc_build/static/js/async/en_api_config_build-config.js +8363 -0
  27. package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -0
  28. package/doc_build/static/js/async/en_api_config_build-preset.js +7845 -0
  29. package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -0
  30. package/doc_build/static/js/async/en_api_config_design-system.js +16345 -0
  31. package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -0
  32. package/doc_build/static/js/async/en_api_config_plugins.js +1492 -0
  33. package/doc_build/static/js/async/en_api_config_plugins.js.map +1 -0
  34. package/doc_build/static/js/async/en_api_config_testing.js +2137 -0
  35. package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
  36. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +14362 -0
  37. package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -0
  38. package/doc_build/static/js/async/en_guide_advance_asset.js +3997 -0
  39. package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -0
  40. package/doc_build/static/js/async/en_guide_advance_build-umd.js +9861 -0
  41. package/doc_build/static/js/async/en_guide_advance_build-umd.js.map +1 -0
  42. package/doc_build/static/js/async/en_guide_advance_copy.js +6539 -0
  43. package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -0
  44. package/doc_build/static/js/async/en_guide_advance_external-dependency.js +3810 -0
  45. package/doc_build/static/js/async/en_guide_advance_external-dependency.js.map +1 -0
  46. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +5046 -0
  47. package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -0
  48. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +150 -0
  49. package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -0
  50. package/doc_build/static/js/async/en_guide_advance_theme-config.js +2484 -0
  51. package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -0
  52. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +3671 -0
  53. package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -0
  54. package/doc_build/static/js/async/en_guide_basic_command-preview.js +3961 -0
  55. package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -0
  56. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +2970 -0
  57. package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -0
  58. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +2182 -0
  59. package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -0
  60. package/doc_build/static/js/async/en_guide_basic_test-your-project.js +3892 -0
  61. package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -0
  62. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +168 -0
  63. package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -0
  64. package/doc_build/static/js/async/en_guide_basic_using-storybook.js +4762 -0
  65. package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -0
  66. package/doc_build/static/js/async/en_guide_best-practices_components.js +21388 -0
  67. package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -0
  68. package/doc_build/static/js/async/en_guide_intro_getting-started.js +1906 -0
  69. package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -0
  70. package/doc_build/static/js/async/en_guide_intro_welcome.js +148 -0
  71. package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -0
  72. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +92 -0
  73. package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -0
  74. package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2560 -0
  75. package/doc_build/static/js/async/en_plugins_guide_getting-started.js.map +1 -0
  76. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +4177 -0
  77. package/doc_build/static/js/async/en_plugins_guide_plugin-object.js.map +1 -0
  78. package/doc_build/static/js/async/en_plugins_guide_setup-function.js +3819 -0
  79. package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -0
  80. package/doc_build/static/js/async/en_plugins_official-list_overview.js +70 -0
  81. package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
  82. package/doc_build/static/js/async/guide_advance_asset.js +3997 -0
  83. package/doc_build/static/js/async/guide_advance_asset.js.map +1 -0
  84. package/doc_build/static/js/async/guide_advance_build-umd.js +9863 -0
  85. package/doc_build/static/js/async/guide_advance_build-umd.js.map +1 -0
  86. package/doc_build/static/js/async/guide_advance_copy.js +6539 -0
  87. package/doc_build/static/js/async/guide_advance_copy.js.map +1 -0
  88. package/doc_build/static/js/async/guide_advance_external-dependency.js +3812 -0
  89. package/doc_build/static/js/async/guide_advance_external-dependency.js.map +1 -0
  90. package/doc_build/static/js/async/guide_advance_in-depth-about-build.js +5046 -0
  91. package/doc_build/static/js/async/guide_advance_in-depth-about-build.js.map +1 -0
  92. package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js +152 -0
  93. package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +1 -0
  94. package/doc_build/static/js/async/guide_advance_theme-config.js +2475 -0
  95. package/doc_build/static/js/async/guide_advance_theme-config.js.map +1 -0
  96. package/doc_build/static/js/async/guide_basic_before-getting-started.js +3662 -0
  97. package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +1 -0
  98. package/doc_build/static/js/async/guide_basic_command-preview.js +3793 -0
  99. package/doc_build/static/js/async/guide_basic_command-preview.js.map +1 -0
  100. package/doc_build/static/js/async/guide_basic_modify-output-product.js +2949 -0
  101. package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +1 -0
  102. package/doc_build/static/js/async/guide_basic_publish-your-project.js +2243 -0
  103. package/doc_build/static/js/async/guide_basic_publish-your-project.js.map +1 -0
  104. package/doc_build/static/js/async/guide_basic_test-your-project.js +3892 -0
  105. package/doc_build/static/js/async/guide_basic_test-your-project.js.map +1 -0
  106. package/doc_build/static/js/async/guide_basic_use-micro-generator.js +172 -0
  107. package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +1 -0
  108. package/doc_build/static/js/async/guide_basic_using-storybook.js +4762 -0
  109. package/doc_build/static/js/async/guide_basic_using-storybook.js.map +1 -0
  110. package/doc_build/static/js/async/guide_best-practices_components.js +21088 -0
  111. package/doc_build/static/js/async/guide_best-practices_components.js.map +1 -0
  112. package/doc_build/static/js/async/guide_intro_getting-started.js +1782 -0
  113. package/doc_build/static/js/async/guide_intro_getting-started.js.map +1 -0
  114. package/doc_build/static/js/async/guide_intro_welcome.js +148 -0
  115. package/doc_build/static/js/async/guide_intro_welcome.js.map +1 -0
  116. package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js +92 -0
  117. package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +1 -0
  118. package/doc_build/static/js/async/index.js +85 -0
  119. package/doc_build/static/js/async/index.js.map +1 -0
  120. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +447 -0
  121. package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -0
  122. package/doc_build/static/js/async/plugins_guide_getting-started.js +2608 -0
  123. package/doc_build/static/js/async/plugins_guide_getting-started.js.map +1 -0
  124. package/doc_build/static/js/async/plugins_guide_plugin-object.js +4173 -0
  125. package/doc_build/static/js/async/plugins_guide_plugin-object.js.map +1 -0
  126. package/doc_build/static/js/async/plugins_guide_setup-function.js +3819 -0
  127. package/doc_build/static/js/async/plugins_guide_setup-function.js.map +1 -0
  128. package/doc_build/static/js/async/plugins_official-list_overview.js +70 -0
  129. package/doc_build/static/js/async/plugins_official-list_overview.js.map +1 -0
  130. package/doc_build/static/js/async/vendors-node_modules_pnpm_code-hike_mdx_0_7_4_react_18_2_0_node_modules_code-hike_mdx_dist_co-06dd41.js +6656 -0
  131. package/doc_build/static/js/async/vendors-node_modules_pnpm_code-hike_mdx_0_7_4_react_18_2_0_node_modules_code-hike_mdx_dist_co-06dd41.js.map +1 -0
  132. package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js +54 -0
  133. package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js.map +1 -0
  134. package/doc_build/static/js/builder-runtime.js +1375 -0
  135. package/doc_build/static/js/builder-runtime.js.map +1 -0
  136. package/doc_build/static/js/lib-lodash.js +4907 -0
  137. package/doc_build/static/js/lib-lodash.js.map +1 -0
  138. package/doc_build/static/js/lib-polyfill.js +24769 -0
  139. package/doc_build/static/js/lib-polyfill.js.map +1 -0
  140. package/doc_build/static/js/lib-react.js +39510 -0
  141. package/doc_build/static/js/lib-react.js.map +1 -0
  142. package/doc_build/static/js/main.js +9237 -0
  143. package/doc_build/static/js/main.js.map +1 -0
  144. 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 +8532 -0
  145. 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 -0
  146. package/docs/en/api/config/_category_.json +4 -0
  147. package/docs/en/api/{build-config.md → config/build-config.md} +201 -108
  148. package/docs/en/api/{build-preset.md → config/build-preset.md} +65 -46
  149. package/docs/{zh/api → en/api/config}/design-system.md +130 -127
  150. package/docs/en/api/config/plugins.md +18 -0
  151. package/docs/en/api/{test.md → config/testing.md} +21 -12
  152. package/docs/en/api/index.md +3 -1
  153. package/docs/en/api/plugin-api/_category_.json +4 -0
  154. package/docs/en/api/plugin-api/plugin-hooks.md +501 -0
  155. package/docs/en/guide/advance/_category_.json +4 -0
  156. package/docs/en/guide/advance/asset.mdx +48 -31
  157. package/docs/en/guide/advance/build-umd.mdx +91 -83
  158. package/docs/en/guide/advance/copy.md +33 -30
  159. package/docs/en/guide/advance/external-dependency.mdx +27 -23
  160. package/docs/en/guide/advance/in-depth-about-build.md +61 -55
  161. package/docs/en/guide/advance/in-depth-about-dev-command.md +7 -4
  162. package/docs/en/guide/advance/theme-config.mdx +80 -0
  163. package/docs/en/guide/basic/_category_.json +4 -0
  164. package/docs/en/guide/basic/before-getting-started.md +29 -24
  165. package/docs/en/guide/basic/command-preview.md +20 -16
  166. package/docs/en/guide/basic/modify-output-product.md +45 -37
  167. package/docs/en/guide/basic/publish-your-project.md +21 -19
  168. package/docs/en/guide/basic/test-your-project.mdx +23 -18
  169. package/docs/en/guide/basic/use-micro-generator.md +15 -8
  170. package/docs/en/guide/basic/using-storybook.mdx +29 -26
  171. package/docs/en/guide/best-practices/_category_.json +4 -0
  172. package/docs/en/guide/best-practices/components.mdx +789 -0
  173. package/docs/en/guide/intro/_category_.json +4 -0
  174. package/docs/en/guide/intro/getting-started.md +11 -6
  175. package/docs/en/guide/intro/welcome.md +4 -0
  176. package/docs/en/guide/intro/why-module-engineering-solution.md +5 -1
  177. package/docs/en/index.md +15 -20
  178. package/docs/en/plugins/guide/_category_.json +4 -0
  179. package/docs/en/plugins/guide/getting-started.mdx +84 -0
  180. package/docs/en/plugins/guide/plugin-object.mdx +85 -0
  181. package/docs/en/plugins/guide/setup-function.mdx +117 -0
  182. package/docs/en/plugins/official-list/_category_.json +4 -0
  183. package/docs/en/plugins/official-list/overview.md +6 -0
  184. package/docs/zh/api/config/_category_.json +4 -0
  185. package/docs/zh/api/config/build-config.md +669 -0
  186. package/docs/zh/api/{build-preset.md → config/build-preset.md} +49 -36
  187. package/docs/zh/api/config/design-system.md +1166 -0
  188. package/docs/zh/api/config/plugins.md +18 -0
  189. package/docs/zh/api/{testing.md → config/testing.md} +18 -13
  190. package/docs/zh/api/index.md +5 -1
  191. package/docs/zh/api/plugin-api/_category_.json +4 -0
  192. package/docs/zh/api/plugin-api/plugin-hooks.md +501 -0
  193. package/docs/zh/guide/advance/_category_.json +4 -0
  194. package/docs/zh/guide/advance/asset.mdx +48 -31
  195. package/docs/zh/guide/advance/build-umd.mdx +91 -74
  196. package/docs/zh/guide/advance/copy.md +33 -30
  197. package/docs/zh/guide/advance/external-dependency.mdx +28 -24
  198. package/docs/zh/guide/advance/in-depth-about-build.md +60 -55
  199. package/docs/zh/guide/advance/in-depth-about-dev-command.md +7 -4
  200. package/docs/zh/guide/advance/theme-config.mdx +78 -0
  201. package/docs/zh/guide/basic/_category_.json +4 -0
  202. package/docs/zh/guide/basic/before-getting-started.md +28 -23
  203. package/docs/zh/guide/basic/command-preview.md +19 -15
  204. package/docs/zh/guide/basic/modify-output-product.md +45 -38
  205. package/docs/zh/guide/basic/publish-your-project.md +22 -17
  206. package/docs/zh/guide/basic/test-your-project.mdx +24 -18
  207. package/docs/zh/guide/basic/use-micro-generator.md +12 -9
  208. package/docs/zh/guide/basic/using-storybook.mdx +29 -24
  209. package/docs/zh/guide/best-practices/_category_.json +4 -0
  210. package/docs/zh/guide/best-practices/components.mdx +793 -0
  211. package/docs/zh/guide/intro/_category_.json +4 -0
  212. package/docs/zh/guide/intro/getting-started.md +12 -6
  213. package/docs/zh/guide/intro/welcome.md +4 -0
  214. package/docs/zh/guide/intro/why-module-engineering-solution.md +5 -1
  215. package/docs/zh/index.md +3 -2
  216. package/docs/zh/plugins/guide/_category_.json +4 -0
  217. package/docs/zh/plugins/guide/getting-started.mdx +84 -0
  218. package/docs/zh/plugins/guide/plugin-object.mdx +85 -0
  219. package/docs/zh/plugins/guide/setup-function.mdx +117 -0
  220. package/docs/zh/plugins/official-list/_category_.json +4 -0
  221. package/docs/zh/plugins/official-list/overview.md +5 -0
  222. package/modern.config.ts +119 -0
  223. package/package.json +8 -6
  224. package/{docs/.island/styles → theme}/index.css +0 -1
  225. package/theme/index.ts +4 -0
  226. package/tsconfig.json +7 -0
  227. package/docs/.island/config.ts +0 -245
  228. package/docs/.island/dist/404.html +0 -41
  229. package/docs/.island/dist/assets/before-getting-started.1b82b538.js +0 -87
  230. package/docs/.island/dist/assets/before-getting-started.582a31cc.js +0 -87
  231. package/docs/.island/dist/assets/build-config.72eb0918.js +0 -804
  232. package/docs/.island/dist/assets/build-config.d8bb1658.js +0 -809
  233. package/docs/.island/dist/assets/build-preset.96805d7d.js +0 -256
  234. package/docs/.island/dist/assets/build-preset.c20dcd40.js +0 -256
  235. package/docs/.island/dist/assets/build-your-ui.7f349247.js +0 -2
  236. package/docs/.island/dist/assets/build-your-ui.a8361604.js +0 -2
  237. package/docs/.island/dist/assets/command-preview.2d45fc82.js +0 -264
  238. package/docs/.island/dist/assets/command-preview.dc51b953.js +0 -264
  239. package/docs/.island/dist/assets/components.esm.03560353.js +0 -9
  240. package/docs/.island/dist/assets/design-system.86694ff5.js +0 -1254
  241. package/docs/.island/dist/assets/design-system.c4745cce.js +0 -639
  242. package/docs/.island/dist/assets/dev.1d326a37.js +0 -37
  243. package/docs/.island/dist/assets/dev.1fd06000.js +0 -37
  244. package/docs/.island/dist/assets/down.f35427d3.svg +0 -1
  245. package/docs/.island/dist/assets/extension.12299fd6.js +0 -2
  246. package/docs/.island/dist/assets/extension.96dc63a4.js +0 -2
  247. package/docs/.island/dist/assets/getting-started.40e9218d.js +0 -117
  248. package/docs/.island/dist/assets/getting-started.b1ed3f10.js +0 -114
  249. package/docs/.island/dist/assets/github.3bf8ccee.svg +0 -1
  250. package/docs/.island/dist/assets/index.2b2347ea.js +0 -33
  251. package/docs/.island/dist/assets/index.6cef6f5f.js +0 -4
  252. package/docs/.island/dist/assets/index.cb118238.js +0 -36
  253. package/docs/.island/dist/assets/index.ccb6ce27.js +0 -4
  254. package/docs/.island/dist/assets/island_inject.11a12ecc.js +0 -1
  255. package/docs/.island/dist/assets/island_inject.b13deaee.js +0 -1
  256. package/docs/.island/dist/assets/loading.8c9bb911.svg +0 -1
  257. package/docs/.island/dist/assets/modify-output-product.7f6bff35.js +0 -100
  258. package/docs/.island/dist/assets/modify-output-product.b91eff1f.js +0 -100
  259. package/docs/.island/dist/assets/moon.6b705924.svg +0 -3
  260. package/docs/.island/dist/assets/plugin.895932d8.js +0 -42
  261. package/docs/.island/dist/assets/plugin.d2fbc531.js +0 -42
  262. package/docs/.island/dist/assets/publish-your-project.21b8309f.js +0 -164
  263. package/docs/.island/dist/assets/publish-your-project.8d398b17.js +0 -166
  264. package/docs/.island/dist/assets/right.89674cd7.svg +0 -1
  265. package/docs/.island/dist/assets/search.0aea6901.svg +0 -1
  266. package/docs/.island/dist/assets/search.1c85d17c.js +0 -3
  267. package/docs/.island/dist/assets/search.484eca11.js +0 -222
  268. package/docs/.island/dist/assets/search.54fca8d0.js +0 -3
  269. package/docs/.island/dist/assets/style.09015a4b.css +0 -1
  270. package/docs/.island/dist/assets/style.2e5f7bc2.css +0 -1970
  271. package/docs/.island/dist/assets/sun.841dac10.svg +0 -11
  272. package/docs/.island/dist/assets/test-your-project.18bd4582.js +0 -190
  273. package/docs/.island/dist/assets/test-your-project.f53bebf7.js +0 -190
  274. package/docs/.island/dist/assets/test.0da1f99f.js +0 -67
  275. package/docs/.island/dist/assets/test.0e81f002.js +0 -66
  276. package/docs/.island/dist/assets/translator.b1077c44.svg +0 -1
  277. package/docs/.island/dist/assets/use-micro-generator.7d9e4016.js +0 -60
  278. package/docs/.island/dist/assets/use-micro-generator.db5520c1.js +0 -60
  279. package/docs/.island/dist/assets/using-storybook.57ea6b77.js +0 -260
  280. package/docs/.island/dist/assets/using-storybook.a2212f2e.js +0 -260
  281. package/docs/.island/dist/assets/welcome.0449a9c8.js +0 -13
  282. package/docs/.island/dist/assets/welcome.a8448931.js +0 -13
  283. package/docs/.island/dist/assets/why-module-engineering-solution.6ae8c0e3.js +0 -26
  284. package/docs/.island/dist/assets/why-module-engineering-solution.c9a45cbd.js +0 -26
  285. package/docs/.island/dist/chunk-COLCRJ2V.js +0 -1
  286. package/docs/.island/dist/chunk-K5FMOYDC.js +0 -10
  287. package/docs/.island/dist/chunk-WE42KMYS.js +0 -26
  288. package/docs/.island/dist/client-entry.js +0 -3
  289. package/docs/.island/dist/en/api/build-config.html +0 -344
  290. package/docs/.island/dist/en/api/build-preset.html +0 -82
  291. package/docs/.island/dist/en/api/design-system.html +0 -155
  292. package/docs/.island/dist/en/api/dev.html +0 -45
  293. package/docs/.island/dist/en/api/index.html +0 -41
  294. package/docs/.island/dist/en/api/plugin.html +0 -48
  295. package/docs/.island/dist/en/api/test.html +0 -58
  296. package/docs/.island/dist/en/guide/before-getting-started.html +0 -127
  297. package/docs/.island/dist/en/guide/build-your-ui.html +0 -41
  298. package/docs/.island/dist/en/guide/command-preview.html +0 -100
  299. package/docs/.island/dist/en/guide/extension.html +0 -41
  300. package/docs/.island/dist/en/guide/getting-started.html +0 -76
  301. package/docs/.island/dist/en/guide/modify-output-product.html +0 -140
  302. package/docs/.island/dist/en/guide/publish-your-project.html +0 -91
  303. package/docs/.island/dist/en/guide/test-your-project.html +0 -72
  304. package/docs/.island/dist/en/guide/use-micro-generator.html +0 -65
  305. package/docs/.island/dist/en/guide/using-storybook.html +0 -113
  306. package/docs/.island/dist/en/guide/welcome.html +0 -53
  307. package/docs/.island/dist/en/guide/why-module-engineering-solution.html +0 -49
  308. package/docs/.island/dist/en/index.html +0 -42
  309. package/docs/.island/dist/react-dom.js +0 -1
  310. package/docs/.island/dist/react-dom_client.js +0 -1
  311. package/docs/.island/dist/react.js +0 -1
  312. package/docs/.island/dist/react_jsx-runtime.js +0 -10
  313. package/docs/.island/dist/ssr-manifest.json +0 -57
  314. package/docs/.island/dist/test-result.png +0 -0
  315. package/docs/.island/dist/why-module-solution.png +0 -0
  316. package/docs/.island/dist/zh/api/build-config.html +0 -347
  317. package/docs/.island/dist/zh/api/build-preset.html +0 -82
  318. package/docs/.island/dist/zh/api/design-system.html +0 -149
  319. package/docs/.island/dist/zh/api/dev.html +0 -46
  320. package/docs/.island/dist/zh/api/index.html +0 -41
  321. package/docs/.island/dist/zh/api/plugin.html +0 -48
  322. package/docs/.island/dist/zh/api/test.html +0 -59
  323. package/docs/.island/dist/zh/guide/before-getting-started.html +0 -127
  324. package/docs/.island/dist/zh/guide/build-your-ui.html +0 -41
  325. package/docs/.island/dist/zh/guide/command-preview.html +0 -100
  326. package/docs/.island/dist/zh/guide/extension.html +0 -41
  327. package/docs/.island/dist/zh/guide/getting-started.html +0 -79
  328. package/docs/.island/dist/zh/guide/modify-output-product.html +0 -140
  329. package/docs/.island/dist/zh/guide/publish-your-project.html +0 -92
  330. package/docs/.island/dist/zh/guide/test-your-project.html +0 -72
  331. package/docs/.island/dist/zh/guide/use-micro-generator.html +0 -65
  332. package/docs/.island/dist/zh/guide/using-storybook.html +0 -114
  333. package/docs/.island/dist/zh/guide/welcome.html +0 -53
  334. package/docs/.island/dist/zh/guide/why-module-engineering-solution.html +0 -49
  335. package/docs/.island/dist/zh/index.html +0 -42
  336. package/docs/.island/index.html +0 -39
  337. package/docs/en/api/design-system.md +0 -524
  338. package/docs/en/api/dev.md +0 -32
  339. package/docs/en/api/plugin.md +0 -34
  340. package/docs/zh/api/build-config.md +0 -570
  341. package/docs/zh/api/dev.md +0 -33
  342. package/docs/zh/api/plugins.md +0 -108
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "Introduction",
3
+ "sidebar_position": 1
4
+ }
@@ -1,3 +1,7 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
1
5
  # Quick start
2
6
 
3
7
  ## 3 minute demo
@@ -21,15 +25,16 @@ Then add the command `"build": "modern build"` to your project's `package.json`
21
25
 
22
26
  ```json
23
27
  {
24
- "scripts": {
25
- "build": "modern build"
26
- }
28
+ "scripts": {
29
+ "build": "modern build"
30
+ }
27
31
  }
28
32
  ```
29
33
 
30
34
  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.
31
35
 
32
36
  **If you want to see real projects that use the module engineering solution, you can execute the following command**.
37
+
33
38
  ```bash
34
39
  git clone https://github.com/modern-js-dev/module-tools-examples
35
40
  cd module-tools-example
@@ -62,6 +67,7 @@ Next, in the issue interaction, follow the options below.
62
67
  ? Please select the development language TS
63
68
  ? Please select the package management tool pnpm
64
69
  ```
70
+
65
71
  > The project name is the value of the `"name"` field in `package.json`.
66
72
 
67
73
  Then the process of initializing the project will start. After the project directory and files are generated and the dependencies are installed, a complete module project is created.
@@ -72,7 +78,6 @@ We can start the project build directly with the `pnpm build` command, and start
72
78
 
73
79
  Choose your tutorial scenario...
74
80
 
75
- - I'm a beginner and need to learn [basic usage](/en/guide/before-getting-started) of Module Tools.
76
- - I have learned the basic usage of Module Tools and can learn [advanced usage](/en/guide/before-getting-started) of Module Tools.
81
+ - I'm a beginner and need to learn [basic usage](/en/guide/basic/before-getting-started) of Module Tools.
82
+ - I have learned the basic usage of Module Tools and can learn [advanced usage](/en/guide/basic/before-getting-started) of Module Tools.
77
83
  - I am the maintainer of the project and need to learn how to develop plugins for Module Tools and learn more about Module Tools Advanced.
78
-
@@ -1,3 +1,7 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
1
5
  # Welcome to Module Tools
2
6
 
3
7
  Module Tools is a modules engineering solution for Modern.js, as well as a core dependency. It allows developers to build, debug, and publish module type project more easily. A module type project can mostly be thought of as an npm package type project, which may be a component, component library or tool library project.
@@ -1,3 +1,7 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
1
5
  # Why module project solution
2
6
 
3
7
  You've probably all experienced it: when developing a component library or tool library from scratch, we have to consider not only how to write the code logic of the project itself, but also how to build, debug, test, format the code, and other things that have nothing to do with the code logic.
@@ -12,6 +16,6 @@ To ensure the quality of the code and the integrity of the project, we often nee
12
16
 
13
17
  If you have to go through all this work every time you develop a module type project, you will spend most of your development time in the beginning on these things that are not related to code implementation. If we could provide a module engineering solution that would help developers to solve the project engineering issues and allow them to focus more on code implementation, it would greatly improve the module type project development experience.
14
18
 
15
- ![Not using engineering solution vs. using engineering solution](/why-module-solution.png)
19
+ ![Not using engineering solution vs. using engineering solution](https://lf3-static.bytednsdoc.com/obj/eden-cn/uhbfnupenuhf/module-tools/why-module-solution.png)
16
20
 
17
21
  Modern.js, in order to make developing module type projects easier, provides a module engineering solution in order to solve the above mentioned problems and provides the main features using Module Tools. **Module-tools can be understood as a tool dedicated to the development of module type projects**.
package/docs/en/index.md CHANGED
@@ -2,34 +2,29 @@
2
2
  pageType: home
3
3
 
4
4
  hero:
5
- name: Module tools
6
- text: 模块工程解决方案
7
- tagline: 简单、强大、高性能的现代化npm包开发方案
8
- image:
9
- src: /island.png
10
- alt: Island
5
+ name: Module Tools
6
+ text: Module engineering solutions
7
+ tagline: simple, powerful, high-performance modern npm package development solution
11
8
  actions:
12
9
  - theme: brand
13
- text: 快速开始
14
- link: /zh/guide/getting-started
10
+ text: welcome
11
+ link: /guide/intro/welcome
15
12
 
16
13
  features:
17
- - title: 'Libuild: 现代库构建方案'
18
- details: 基于 Libuild 构建,构建速度极快,带给你极致的开发体验。
14
+ - title: 'Esbuild: The High Performance JS Bundler'
15
+ details: Built on Esbuild, the build is extremely fast and gives you the ultimate development experience.
19
16
  icon: 🚀
20
- - title: 'Storybook: 社区流行的UI开发工具'
21
- details: 集成了Storybook,你可以使用它调试UI
17
+ - title: 'Storybook: The community popular UI development tool'
18
+ details: Integrated with Storybook, you can use it to debug UI.
22
19
  icon: 📦
23
- - title: 'Island: 强大的现代化SSG方案'
24
- details: 高性能的静态站点生成器。
25
- icon: 🔑
26
20
  - title: 'transform + bundle'
27
- details: 支持bundlebundleless两种构建模式。
21
+ details: Both bundle and bundleless build modes are supported.
28
22
  icon: ✨
29
- - title: '零配置'
30
- details: 无需任何配置即可开发你的npm包,内置预设覆盖多种场景。
23
+ - title: 'zero configuration'
24
+ details: Develop your npm packages without any configuration, with built-in presets covering multiple scenarios.
31
25
  icon: 🛠️
32
- - title: '扩展性强: 提供强大的插件机制'
33
- details: 通过其插件扩展机制,你可以轻松的扩展Module tools的各项能力。
26
+ - title: 'Extensible: Provides a powerful plugin mechanism'
27
+ details: With its plugin extension mechanism, you can easily extend the capabilities of Module Tools.
34
28
  icon: 🎨
35
29
  ---
30
+ # index
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "Guide",
3
+ "sidebar_position": 1
4
+ }
@@ -0,0 +1,84 @@
1
+ ---
2
+ sidebar_position: 1
3
+ ---
4
+
5
+ # Quick Start
6
+
7
+ Module engineering solution not only provides a rich set of features, but also supports extending the capabilities of the current project by way of plugins.
8
+
9
+ We can quickly see how to write a module-tools plugin by using the following example.
10
+
11
+ <CH.Spotlight>
12
+
13
+ ```md . /project
14
+ . /project .
15
+ ├── plugins
16
+ │ └── example.ts
17
+ ├── src/
18
+ └── modern.config.ts
19
+ ```
20
+
21
+ ---
22
+
23
+ First we create `. /plugins/example.ts` file under the initialized project.
24
+
25
+ ```md . /project
26
+
27
+ ```
28
+
29
+ ---
30
+
31
+ Next add the code for the plugin to the `example.ts` file.
32
+
33
+ ```ts
34
+ import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
35
+
36
+ export const ExamplePlugin = (): CliPlugin<ModuleTools> => {
37
+ return {
38
+ name: 'example',
39
+ setup() {
40
+ console.info('this is example plugin');
41
+ return {
42
+ // use hooks
43
+ afterBuild() {
44
+ console.info('build over');
45
+ }
46
+ };
47
+ };
48
+ };
49
+ };
50
+ ```
51
+
52
+ ---
53
+
54
+ Then we register the plugin we just wrote via the [`plugins`](/en/api/config/plugins) API.
55
+
56
+ ```ts . /modern.config.ts
57
+ import { ExamplePlugin } from '. /plugins/example';
58
+ export default defineConfig({
59
+ plugins: [ExamplePlugin()],
60
+ });
61
+ ```
62
+
63
+ ---
64
+
65
+ Finally, run `modern build` and you will see.
66
+
67
+ ```bash terminal
68
+ This is example plugin
69
+ Build succeed: 510.684ms
70
+ build over
71
+ ```
72
+
73
+ </CH.Spotlight>
74
+
75
+ With the above example, we learned the following things.
76
+
77
+ - The recommended plugin directory structure
78
+ - The initialization code of the plugin
79
+ - Plugin registration
80
+
81
+ In addition to the above, we also need to understand.
82
+
83
+ - [plugin objects, type definitions and recommended configuration items](/en/plugins/guide/plugin-object)
84
+ - [setup functions, `api` object parameters, lifecycle hooks](/en/plugins/guide/setup-function)
@@ -0,0 +1,85 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
5
+ # Plugin Object
6
+
7
+ The module-tools plugin is an object, and the object contains the following properties.
8
+
9
+ - `name`: The name of the plugin, a unique identifier.
10
+ - `setup`: plugin initialization function, which will be executed only once. setup function can return a [Hooks object](), and module-tools will execute the function corresponding to the Hook defined on the Hooks object at a specific time.
11
+
12
+ For example, in the following plugin code example, the `beforeBuild` function is triggered before the project starts the build task and the `build start` log is printed.
13
+
14
+ <CH.Code>
15
+
16
+ ```ts . /plugins/demo.tsx
17
+ import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
18
+
19
+ const MyPlugin: CliPlugin<ModuleTools> = {
20
+ name: 'my-plugin',
21
+
22
+ setup() {
23
+ return {
24
+ // this is hook
25
+ beforeBuild: () => {
26
+ console.info('build start');
27
+ },
28
+ };
29
+ },
30
+ };
31
+ ```
32
+
33
+ ---
34
+
35
+ ```ts . /modern.config.ts
36
+ import { MyPlugin } from '. /plugins/demo';
37
+ export default {
38
+ plugins: [MyPlugin()],
39
+ };
40
+ ```
41
+
42
+ </CH.Code>
43
+
44
+ ## Plugin type definitions
45
+
46
+ When using TypeScript, you can introduce the built-in `CliPlugin` and `ModuleTools` types to provide the correct type derivation for plugins: ``
47
+
48
+ ```ts
49
+ import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
50
+
51
+ const MyPlugin: CliPlugin<ModuleTools> = {
52
+ name: 'my-plugin',
53
+
54
+ setup() {
55
+ const foo = '1';
56
+
57
+ return {
58
+ // this is hook
59
+ afterBuild: () => {
60
+ //...
61
+ },
62
+ };
63
+ },
64
+ };
65
+ ```
66
+
67
+ ## Plugin configuration items
68
+
69
+ **It is recommended to write the plugin as a function**, so that the plugin can receive configuration items via function entry.
70
+
71
+ ```ts
72
+ import type { CliPlugin, ModuleTools } from '@modern-js/module-tools';
73
+
74
+ type MyPluginOptions = {
75
+ foo: string;
76
+ };
77
+
78
+ const MyPlugin = (options: MyPluginOptions): CliPlugin<ModuleTools> => ({
79
+ name: 'my-plugin',
80
+
81
+ setup() {
82
+ console.log(options.foo);
83
+ },
84
+ });
85
+ ```
@@ -0,0 +1,117 @@
1
+ ---
2
+ sidebar_position: 3
3
+ ---
4
+
5
+ # Setup function
6
+
7
+ In the [[Plugin object]](/plugins/guide/plugin-object) section we know that the plug-in object contains a `setup` function that not only contains an `api` object parameter, but also returns a Hooks object.
8
+
9
+ ## Plugin API objects
10
+
11
+ The `setup` function of the plugin will provide an `api` object parameter, and you can call some of the methods provided on this object to get information about the configuration, project context, etc.
12
+
13
+ ```ts
14
+ export default (): CliPlugin<ModuleTools> => ({
15
+ name: 'my-plugin',
16
+
17
+ setup(api) {
18
+ // Get the original configuration of the application
19
+ const config = api.useConfigContext();
20
+ // Get the application runtime context
21
+ const appContext = api.useAppContext();
22
+ // Get the final configuration after resolving
23
+ const resolvedConfig = api.useResolvedConfigContext();
24
+ },
25
+ });
26
+ ```
27
+
28
+ ### `api.useAppContext`
29
+
30
+ Used to get project context information.
31
+
32
+ ```ts
33
+ const useAppContext: () => IAppContext;
34
+
35
+ interface IAppContext {
36
+ appDirectory: string;
37
+ configFile: string | false;
38
+ packageName: string;
39
+ nodeModulesDirectory: string;
40
+ internalDirectory: string;
41
+ plugins: {
42
+ cli?: any;
43
+ server?: any;
44
+ }[];
45
+ }
46
+ ```
47
+
48
+ :::info
49
+ We can see through the actual type file that there are other fields, but the only ones that make sense for the module project at the moment are the above. api object other methods are the same.
50
+ :::
51
+
52
+ ### `api.useResolvedConfigContext`
53
+
54
+ Used to get the final configuration after parsing.
55
+
56
+ :::info
57
+ If you need to get the build-related final configuration, you need to use the [`beforeBuild`]() Hook.
58
+ :::
59
+
60
+ ```ts
61
+ const useResolvedConfigContext: () => NormalizedConfig;
62
+
63
+ interface NormalizedConfig {
64
+ buildConfig: PartialBuildConfig;
65
+ buildPreset: BuildPreset;
66
+ designSystem?: Record<string, any>;
67
+ dev: Dev;
68
+ plugins: PluginConfig;
69
+ runtime: RuntimeConfig;
70
+ runtimeByEntries?: RuntimeByEntriesConfig;
71
+ _raw: UserConfig;
72
+ }
73
+ ```
74
+
75
+ ### `api.useHookRunners`
76
+
77
+ Used to get the executors of Hooks and trigger the execution of a specific Hook.
78
+
79
+ ```ts
80
+ import type { CliPlugin } from '@modern-js/core';
81
+
82
+ export default (): CliPlugin => ({
83
+ name: 'my-plugin',
84
+
85
+ async setup(api) {
86
+ const hookRunners = api.useHookRunners();
87
+ // trigger the afterBuild Hook
88
+ await hookRunners.afterBuild();
89
+ },
90
+ });
91
+ ```
92
+
93
+ ## Asynchronous setup
94
+
95
+ The setup of a CLI plugin can be an asynchronous function that performs asynchronous logic during the initialization process.
96
+
97
+ ```ts
98
+ export default (): CliPlugin<ModuleTools> => ({
99
+ name: 'my-plugin',
100
+
101
+ async setup(api) {
102
+ await doSomething();
103
+ },
104
+ });
105
+ ```
106
+
107
+ ## Life cycle hooks
108
+
109
+ We know that the `setup` function returns a Hooks object, which can also be understood as an object with module-tools lifecycle hooks.
110
+
111
+ Currently there are two main types of hooks.
112
+
113
+ - build hooks: triggered only when the `build` command is executed to build the source code product.
114
+ - `buildPlatform` hook: triggered only when the `build --platform` command is executed to generate other build products.
115
+ - debug hooks: hooks that are triggered when running the `dev` command.
116
+
117
+ See the [API documentation](/en/api/plugin-api/plugin-hooks) for a full list of lifecycle hooks.
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "Plugins List",
3
+ "sidebar_position": 2
4
+ }
@@ -0,0 +1,6 @@
1
+ # Overview
2
+
3
+ ## Official Plugin
4
+
5
+ (Under Building)
6
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "label": "配置项",
3
+ "sidebar_position": 2
4
+ }