@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,789 @@
1
+ # Developing Components
2
+
3
+ This chapter will describe how to develop component projects using the module engineering solution.
4
+
5
+ # # Initialize the project
6
+
7
+ <CH.Spotlight>
8
+
9
+ ```bash Interactive questions
10
+ npx @modern-js/create components-project
11
+
12
+ ? Please select the solution you want to create Module Solution
13
+ ? Package Name components-demo
14
+ ? Development Language TS
15
+ ? Package Management Tool pnpm
16
+ ```
17
+
18
+ ---
19
+
20
+ It is recommended to use the `@modern-js/create` command to initialize an npm project.
21
+
22
+ ```bash Interactive questions
23
+ npx @modern-js/create components-project
24
+
25
+ ? Please select the solution you want to create Module Solution
26
+ ? Package Name components-demo
27
+ ? Development Language TS
28
+ ? Package Management Tool pnpm
29
+ ```
30
+
31
+ ---
32
+
33
+ The initialized directory structure.
34
+
35
+ ```bash The initialized directory structure
36
+ .
37
+ ├── README.md
38
+ ├── node_modules/
39
+ ├── dist/
40
+ ├── modern.config.ts
41
+ ├── package.json
42
+ ├── pnpm-lock.yaml
43
+ ├── src
44
+ │ ├── index.ts
45
+ │ └── modern-app-env.d.ts
46
+ └── tsconfig.json
47
+ ```
48
+
49
+ ---
50
+
51
+ Modify the `. /src/index.ts` file suffix and content.
52
+
53
+ At this point, a component project is initialized.
54
+
55
+ ```tsx ./src/index.tsx
56
+ export default () => {
57
+ return <div>hello world</div>;
58
+ };
59
+ ```
60
+
61
+ </CH.Spotlight>
62
+
63
+ ## Debugging code with Storybook
64
+
65
+ <CH.Spotlight>
66
+
67
+ ```bash Terminal
68
+ pnpm run new
69
+
70
+ ? Action Enable features
71
+ ? Enable features Enable Visual Testing (Storybook)
72
+ ```
73
+
74
+ ---
75
+
76
+ Execute the `new` command in the project root directory to enable the Storybook feature.
77
+
78
+ ```bash Terminal
79
+ pnpm run new
80
+
81
+ ? Action Enable features
82
+ ? Enable features Enable Visual Testing (Storybook)
83
+ ```
84
+
85
+ ---
86
+
87
+ Once successfully opened, you will see that a new dependency has been added to `package.json`. The `stories` directory and related initialization files are also created.
88
+
89
+ <CH.Code>
90
+
91
+ ```json ./package.json focus=4:7
92
+ {
93
+ "name": "components-demo",
94
+ "devDependencies": {
95
+ "@modern-js/plugin-storybook": "x.y.z",
96
+ "@modern-js/runtime": "x.y.z",
97
+ "react": "^17",
98
+ "react-dom": "^17"
99
+ }
100
+ }
101
+ ```
102
+
103
+ ```bash Directory Structure
104
+ .
105
+ ├── src
106
+ │ ├── index.ts
107
+ │ └── modern-app-env.d.ts
108
+ ├── stories
109
+ │ ├── .eslintrc.js
110
+ │ ├── index.stories.tsx
111
+ │ └── tsconfig.json
112
+ ```
113
+
114
+ </CH.Code>
115
+
116
+ ---
117
+
118
+ After initialization, the `tsconfig.json` file in the `. /stories` directory, the `tsconfig.json` file is set by default with the `paths` configuration of the same name as the project.
119
+
120
+ ```json ./stories/tsconfig.json focus=5:7
121
+ {
122
+ "extends": "../tsconfig.json",
123
+ "compilerOptions": {
124
+ "baseUrl": "../",
125
+ "paths": {
126
+ "components-demo": ["./"],
127
+ "components-demo/*": ["./*"]
128
+ }
129
+ },
130
+ "include": ["**/*"]
131
+ }
132
+ ```
133
+
134
+ ---
135
+
136
+ Such a configuration allows you to introduce code in Story code directly using the name of the project.
137
+
138
+ <CH.Code>
139
+
140
+ ```tsx ./stories/index.stories.tsx
141
+ import Component from 'components-demo';
142
+
143
+ export const YourStory = () => <Component />;
144
+
145
+ export default {
146
+ title: 'Your Stories',
147
+ };
148
+ ```
149
+
150
+ ---
151
+
152
+ ```tsx ./src/index.tsx
153
+ export default () => {
154
+ return <div>hello world</div>;
155
+ };
156
+ ```
157
+
158
+ </CH.Code>
159
+
160
+ ---
161
+
162
+ At this point Storybook identifies the entry point for the imported code based on fields like `main`, `exports` in the project's `package.json` file.
163
+ The location of the type file is determined by the `types` field.
164
+
165
+ ```json package.json
166
+ {
167
+ "name": "components-demo",
168
+ "main": "./dist/esm/index.js",
169
+ "types": "./dist/types/index.d.ts"
170
+ }
171
+ ```
172
+
173
+ ---
174
+
175
+ While importing source code for debugging is also supported, debugging using project artifacts is more reliable.
176
+
177
+ Debugging with source code has a limitation: some configurations are not equivalent in Storybook and in the original build support.
178
+
179
+ **This is why debugging with the product is recommended**.
180
+
181
+ ```tsx ./stories/index.stories.tsx
182
+ import Component from '../src';
183
+
184
+ export const YourStory = () => <Component />;
185
+
186
+ export default {
187
+ title: 'Your Stories',
188
+ };
189
+ ```
190
+
191
+ </CH.Spotlight>
192
+
193
+ ## Developing Styles
194
+
195
+ Next we can add styles to the component.
196
+
197
+ The following capabilities are currently supported for developing styles.
198
+
199
+ - CSS/PostCSS
200
+ - Less
201
+ - Scss/Sass
202
+ - Tailwind CSS
203
+ - CSS Modules
204
+
205
+ ### CSS/PostCSS
206
+
207
+ The module project supports PostCSS and has the following built-in postcss plugins.
208
+
209
+ - [flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes)
210
+ - [custom-properties](https://github.com/postcss/postcss-custom-properties)
211
+ - [initial](https://github.com/maximkoretskiy/postcss-initial)
212
+ - [page-break](https://github.com/shrpne/postcss-page-break)
213
+ - [font-variant](https://github.com/postcss/postcss-font-variant)
214
+ - [media-minmax](https://github.com/postcss/postcss-media-minmax)
215
+ - [nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme)
216
+
217
+ So we can create `.css` files in our projects and use the syntax support and capabilities provided by these plugins directly in our css files.
218
+
219
+ <CH.Spotlight>
220
+
221
+ ```css ./src/index.css
222
+ a,
223
+ b {
224
+ color: red;
225
+
226
+ /* "&" comes first */
227
+ & c,
228
+ & d {
229
+ color: white;
230
+ }
231
+
232
+ /* "&" comes later, requiring "@nest" */
233
+ @nest e & {
234
+ color: yellow;
235
+ }
236
+ }
237
+ ```
238
+
239
+ ---
240
+
241
+ Source Code.
242
+
243
+ ```css ./src/index.css
244
+
245
+ ```
246
+
247
+ ---
248
+
249
+ css product.
250
+
251
+ ```css ./dist/es/index.css
252
+ a,
253
+ b {
254
+ color: red;
255
+ }
256
+ a c,
257
+ b c,
258
+ a d,
259
+ b d {
260
+ color: white;
261
+ }
262
+ e a,
263
+ e b {
264
+ color: yellow;
265
+ }
266
+ ```
267
+
268
+ </CH.Spotlight>
269
+
270
+ ### Less
271
+
272
+ Module projects support development styles using Less.
273
+
274
+ > Currently supported version is 4.1.3
275
+
276
+ <CH.Spotlight>
277
+
278
+ ```less ./src/common.less
279
+ @bg: black;
280
+ @bg-light: boolean(luma(@bg) > 50%);
281
+
282
+ div {
283
+ background: @bg;
284
+ color: if(@bg-light, black, white);
285
+ }
286
+ ```
287
+
288
+ ---
289
+
290
+ Source Code.
291
+
292
+ ```less ./src/common.less
293
+
294
+ ```
295
+
296
+ ---
297
+
298
+ Less product.
299
+
300
+ ```css ./dist/es/common.css
301
+ div {
302
+ background: black;
303
+ color: white;
304
+ }
305
+ ```
306
+
307
+ </CH.Spotlight>
308
+
309
+ ### Sass/Scss
310
+
311
+ Module projects support developing styles using Scss/Sass.
312
+
313
+ > Currently supported version is 1.54.4
314
+
315
+ <CH.Spotlight>
316
+
317
+ ```sass ./src/common.sass
318
+ $font-stack: Helvetica, sans-serif;
319
+ $primary-color: #333;
320
+
321
+ body {
322
+ font: 100% $font-stack;
323
+ color: $primary-color;
324
+ }
325
+ ```
326
+
327
+ ---
328
+
329
+ 源代码。
330
+
331
+ ```sass ./src/common.sass
332
+
333
+ ```
334
+
335
+ ---
336
+
337
+ Less product.
338
+
339
+ ```css ./dist/es/common.css
340
+ body {
341
+ font: 100% Helvetica, sans-serif;
342
+ color: #333;
343
+ }
344
+ ```
345
+
346
+ </CH.Spotlight>
347
+
348
+ ### Tailwind CSS
349
+
350
+ The module project supports the development of component styles using Tailwind CSS.
351
+
352
+ By default, this feature is not enabled in the module project, you need to enable it as follows.
353
+
354
+ <CH.Spotlight>
355
+
356
+ ```bash Terminal
357
+ pnpm run new
358
+
359
+ ? Action Enable features
360
+ ? Enable features Enable Visual Testing (Storybook)
361
+ ```
362
+
363
+ ---
364
+
365
+ The Tailwind CSS feature can be enabled by executing the `new` command in the project root directory.
366
+
367
+ ```bash Terminal
368
+ pnpm run new
369
+
370
+ ? Action Enable features
371
+ ? Enable features Enable Tailwind CSS
372
+ ```
373
+
374
+ ---
375
+
376
+ Once successfully opened, you will see that a new dependency has been added to `package.json`.
377
+
378
+ ```json ./package.json
379
+ {
380
+ "devDependencies": {
381
+ "@modern-js/plugin-tailwindcss": "x.y.z"
382
+ }
383
+ }
384
+ ```
385
+
386
+ </CH.Spotlight>
387
+
388
+ Tailwind CSS offers two ways to use it.
389
+
390
+ #### HTML class
391
+
392
+ <CH.Spotlight>
393
+
394
+ ```tsx ./src/index.tsx
395
+ import 'tailwindcss/utilities.css';
396
+
397
+ export default () => {
398
+ return <div className="bg-black text-white">hello world</div>;
399
+ };
400
+ ```
401
+
402
+ ---
403
+
404
+ Tailwind CSS supports adding styles to HTML tags by using class names.
405
+
406
+ ```tsx ./src/index.tsx focus=5:5
407
+
408
+ ```
409
+
410
+ ---
411
+
412
+ **When using HTML class names, be sure to import the Tailwind CSS equivalent css file. **
413
+
414
+ ```tsx ./src/index.tsx focus=1:1
415
+
416
+ ```
417
+
418
+ ---
419
+
420
+ Style product.
421
+
422
+ > This is a bundle build.
423
+
424
+ ```css ./dist/es/index.css
425
+ /* ../../node_modules/.pnpm/tailwindcss@2.2.19/node_modules/tailwindcss/utilities.css */
426
+ .table {
427
+ display: table;
428
+ }
429
+ @keyframes spin {
430
+ to {
431
+ transform: rotate(360deg);
432
+ }
433
+ }
434
+ @keyframes ping {
435
+ 75%,
436
+ 100% {
437
+ transform: scale(2);
438
+ opacity: 0;
439
+ }
440
+ }
441
+ @keyframes pulse {
442
+ 50% {
443
+ opacity: 0.5;
444
+ }
445
+ }
446
+ @keyframes bounce {
447
+ 0%,
448
+ 100% {
449
+ transform: translateY(-25%);
450
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
451
+ }
452
+ 50% {
453
+ transform: none;
454
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
455
+ }
456
+ }
457
+ .bg-black {
458
+ --tw-bg-opacity: 1;
459
+ background-color: rgba(0, 0, 0, var(--tw-bg-opacity));
460
+ }
461
+ .text-white {
462
+ --tw-text-opacity: 1;
463
+ color: rgba(255, 255, 255, var(--tw-text-opacity));
464
+ }
465
+ *,
466
+ ::before,
467
+ ::after {
468
+ --tw-shadow: 0 0 #0000;
469
+ }
470
+ *,
471
+ ::before,
472
+ ::after {
473
+ --tw-ring-inset: var(--tw-empty);
474
+ --tw-ring-offset-width: 0px;
475
+ --tw-ring-offset-color: #fff;
476
+ --tw-ring-color: rgba(59, 130, 246, 0.5);
477
+ --tw-ring-offset-shadow: 0 0 #0000;
478
+ --tw-ring-shadow: 0 0 #0000;
479
+ }
480
+ @media (min-width: 640px) {
481
+ }
482
+ @media (min-width: 768px) {
483
+ }
484
+ @media (min-width: 1024px) {
485
+ }
486
+ @media (min-width: 1280px) {
487
+ }
488
+ @media (min-width: 1536px) {
489
+ }
490
+ ```
491
+
492
+ </CH.Spotlight>
493
+
494
+ #### `@apply`
495
+
496
+ Tailwind CSS provides the [`@apply`](https://v2.tailwindcss.com/docs/functions-and-directives#apply) directive, which allows us to inline the styles provided by Tailwind CSS into the styles we write.
497
+
498
+ `@apply` can be used in CSS, Less, and Sass.
499
+
500
+ ```css
501
+ .btn {
502
+ @apply font-bold py-2 px-4 rounded;
503
+ }
504
+ ```
505
+
506
+ However, there are some things to keep in mind when using Less and Sass.
507
+
508
+ ##### Sass
509
+
510
+ When using Tailwind with Sass, the presence of `!important` after `@apply` requires interpolation to get Sass to compile correctly.
511
+
512
+ <CH.Spotlight>
513
+
514
+ ```sass
515
+ .alert {
516
+ @apply bg-red-500 !important;
517
+ }
518
+ ```
519
+
520
+ ---
521
+
522
+ It does not work properly.
523
+
524
+ ```sass
525
+
526
+ ```
527
+
528
+ ---
529
+
530
+ Can work properly.
531
+
532
+ ```sass
533
+ .alert {
534
+ @apply bg-red-500 #{!important};
535
+ }
536
+ ```
537
+
538
+ </CH.Spotlight>
539
+
540
+ ##### Less
541
+
542
+ When using Tailwind with Less, you cannot nest Tailwind's `@screen` directive.
543
+
544
+ <CH.Spotlight>
545
+
546
+ ```less
547
+ .card {
548
+ @apply rounded-none;
549
+
550
+ @screen sm {
551
+ @apply rounded-lg;
552
+ }
553
+ }
554
+ ```
555
+
556
+ ---
557
+
558
+ It does not work properly.
559
+
560
+ ```less
561
+
562
+ ```
563
+
564
+ ---
565
+
566
+ Instead, use regular media queries and the `theme()` function to reference your screen size, or simply don't nest your `@screen` directive.
567
+
568
+ <CH.Code>
569
+
570
+ ```less Method One
571
+ // Use a regular media query and theme()
572
+ .card {
573
+ @apply rounded-none;
574
+
575
+ @media (min-width: theme('screens.sm')) {
576
+ @apply rounded-lg;
577
+ }
578
+ }
579
+ ```
580
+
581
+ ---
582
+
583
+ ```less Method Two
584
+ // Use the @screen directive at the top-level
585
+ .card {
586
+ @apply rounded-none;
587
+
588
+ @media (min-width: theme('screens.sm')) {
589
+ @apply rounded-lg;
590
+ }
591
+ }
592
+ ```
593
+
594
+ </CH.Code>
595
+
596
+ </CH.Spotlight>
597
+
598
+ #### Recommended method
599
+
600
+ **It is recommended to develop styles in the way specified by `@apply`, so that only styles inlined by directives are included in the style product. **
601
+
602
+ When adding styles using HTML class names, by default Tailwind will not only add the styles corresponding to its own class name to the product, but will also have additional style code that may not affect its own styles.
603
+
604
+ #### The difference between bundle and bundleless build products
605
+
606
+ For the following code, there is a big difference between the bundle and bundleless modes of building products.
607
+
608
+ > The so-called bundle and bundleless can be found in [[Bundle and Bundleless]](/en/guide/advance/in-depth-about-build#bundle- and-bundleless)
609
+
610
+ ```tsx ./src/index.tsx
611
+ import 'tailwindcss/utilities.css';
612
+
613
+ export default () => {
614
+ return <div className="bg-black text-white">hello world11</div>;
615
+ };
616
+ ```
617
+
618
+ In Bundle mode, third-party dependencies are packaged in.
619
+
620
+ For styles, a separate product file is generated, and there is no code related to importing styles in the Js product file.
621
+
622
+ If you need to inject styles into Js products, you can enable the [`style.inject` API](/en/api/config/build-config#inject).
623
+
624
+ <CH.Code>
625
+ ```css ./dist/es/index.css
626
+ /* ../../node_modules/.pnpm/tailwindcss@2.2.19/node_modules/tailwindcss/utilities.css */
627
+ .table {
628
+ display: table;
629
+ }
630
+ @keyframes spin {
631
+ to {
632
+ transform: rotate(360deg);
633
+ }
634
+ }
635
+ @keyframes ping {
636
+ 75%, 100% {
637
+ transform: scale(2);
638
+ opacity: 0;
639
+ }
640
+ }
641
+ @keyframes pulse {
642
+ 50% {
643
+ opacity: .5;
644
+ }
645
+ }
646
+ @keyframes bounce {
647
+ 0%, 100% {
648
+ transform: translateY(-25%);
649
+ animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
650
+ }
651
+ 50% {
652
+ transform: none;
653
+ animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
654
+ }
655
+ }
656
+ .bg-black {
657
+ --tw-bg-opacity: 1;
658
+ background-color: rgba(0, 0, 0, var(--tw-bg-opacity));
659
+ }
660
+ .text-white {
661
+ --tw-text-opacity: 1;
662
+ color: rgba(255, 255, 255, var(--tw-text-opacity));
663
+ }
664
+ *,
665
+ ::before,
666
+ ::after {
667
+ --tw-shadow: 0 0 #0000 ;
668
+ }
669
+ *,
670
+ ::before,
671
+ ::after {
672
+ --tw-ring-inset: var(--tw-empty, );
673
+ --tw-ring-offset-width: 0px;
674
+ --tw-ring-offset-color: #fff;
675
+ --tw-ring-color: rgba(59, 130, 246, 0.5);
676
+ --tw-ring-offset-shadow: 0 0 #0000;
677
+ --tw-ring-shadow: 0 0 #0000 ;
678
+ }
679
+ @media (min-width: 640px) {
680
+ }
681
+ @media (min-width: 768px) {
682
+ }
683
+ @media (min-width: 1024px) {
684
+ }
685
+ @media (min-width: 1280px) {
686
+ }
687
+ @media (min-width: 1536px) {
688
+ }
689
+ ```
690
+ ---
691
+ ``` js ./dist/es/index.js
692
+ // src/index.tsx
693
+ import { jsx } from "react/jsx-runtime";
694
+ var src_default = () => {
695
+ return /* @__PURE__ */ jsx("div", {
696
+ className: "bg-black text-white",
697
+ children: "hello world11"
698
+ });
699
+ };
700
+ export {
701
+ src_default as default
702
+ };
703
+ ```
704
+ </CH.Code>
705
+
706
+ In Bundleless mode, no third-party dependencies are packaged in, and no style products are generated at this time.
707
+
708
+ ```js ./dist/es/index.js
709
+ import { jsx } from 'react/jsx-runtime';
710
+ import 'tailwindcss/utilities.css';
711
+ var src_default = () => {
712
+ return /* @__PURE__ */ jsx('div', {
713
+ className: 'bg-black text-white',
714
+ children: 'hello world11',
715
+ });
716
+ };
717
+ export { src_default as default };
718
+ ```
719
+
720
+ ### CSS Modules
721
+
722
+ Module projects support the development of styles using CSS Modules. By default, the following files are recognized as CSS Module files.
723
+
724
+ - `.module.css`
725
+ - `.module.less`
726
+ - `.module.scss`
727
+ - `.module.sass`
728
+
729
+ If you need to configure CSS Modules, you can check out the API at
730
+
731
+ - [autoModules](en/api/config/build-config#automodules)
732
+ - [modules](/en/api/config/build-config#modules)
733
+
734
+ The following is a code example.
735
+
736
+ <CH.Code>
737
+
738
+ ```tsx ./src/index.tsx
739
+ import style from './index.module.css';
740
+
741
+ export default () => {
742
+ return <div className={style.btn}>hello world</div>;
743
+ };
744
+ ```
745
+
746
+ ```css ./src/index.module.css
747
+ .btn {
748
+ color: blue;
749
+ }
750
+ ```
751
+
752
+ </CH.Code>
753
+
754
+ ## Configuring build products
755
+
756
+ Based on most scenarios of component project usage, **it is recommended to use the `npm-component` build preset**. This preset yields a product directory structure of
757
+
758
+ ```bash
759
+ .
760
+ ├── dist
761
+ │ ├── es
762
+ │ ├── lib
763
+ │ └── types
764
+ ```
765
+
766
+ - `. /dist/es`: Contains bundleless products in ES modules format that support the es6 syntax.
767
+ - `. /dist/lib`: Contains bundleless products in CommonJS format with support for es6 syntax.
768
+ - `. /dist/types`: Contains the types file.
769
+
770
+ The [`buildPreset`](/en/api/config/build-preset) can be configured manually if there is a requirement to use syntax support, and supports modifying the supported syntax by adding a suffix to `npm-component`.
771
+
772
+ ```tsx
773
+ export default defineConfig({
774
+ buildPreset: 'npm-component-es2019',
775
+ });
776
+ ```
777
+
778
+ If you have special needs for the build product directory structure, you can use the [`buildConfig` API](/en/api/config/build-config), which can be used by the following documentation.
779
+
780
+ - [modify-output-product](/en/guide/basic/modify-output-product#build-configuration-object)
781
+ - [in-depth-about-build](/en/guide/advance/in-depth-about-build)
782
+
783
+ ## Testing components
784
+
785
+ For more information on how to test components, please refer to [[Test project]](/en/guide/basic/test-your-project).
786
+
787
+ ## Releasing components
788
+
789
+ It is recommended to use module project to provide version publishing function, you can refer to [[Versioning and publishing]](/en/guide/basic/publish-your-project).