@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.
- package/doc_build/html/main/index.html +1 -1
- package/doc_build/static/css/main.css +267 -660
- package/doc_build/static/css/main.css.map +1 -1
- 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
- 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
- package/doc_build/static/js/async/en_api_config_build-config.js +79 -36
- package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -1
- package/doc_build/static/js/async/en_api_config_build-preset.js +40 -20
- package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -1
- package/doc_build/static/js/async/en_api_config_design-system.js +33800 -2340
- package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -1
- package/doc_build/static/js/async/en_api_config_plugins.js +15 -19
- package/doc_build/static/js/async/en_api_config_testing.js +26 -24
- package/doc_build/static/js/async/en_api_config_testing.js.map +1 -1
- package/doc_build/static/js/async/{en_api_.js → en_api_index.js} +10 -14
- package/doc_build/static/js/async/en_api_index.js.map +1 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +24 -26
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_asset.js +16 -41
- package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_build-umd.js +20 -24
- package/doc_build/static/js/async/en_guide_advance_copy.js +25 -23
- package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js +15 -19
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +352 -94
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +11 -15
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -1
- package/doc_build/static/js/async/en_guide_advance_theme-config.js +26 -24
- package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +275 -88
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_command-preview.js +45 -33
- package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +274 -196
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +18 -20
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js +27 -32
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +33 -15
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -1
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js +24 -63
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -1
- package/doc_build/static/js/async/en_guide_best-practices_components.js +39 -27
- package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -1
- package/doc_build/static/js/async/en_guide_intro_getting-started.js +288 -45
- package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -1
- package/doc_build/static/js/async/en_guide_intro_welcome.js +27 -13
- package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -1
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +16 -12
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -1
- package/doc_build/static/js/async/{en_.js → en_index.js} +12 -16
- package/doc_build/static/js/async/en_index.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +17 -21
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +20 -24
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js +19 -23
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -1
- package/doc_build/static/js/async/en_plugins_official-list_overview.js +8 -12
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +166 -367
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -1
- package/doc_build/static/js/async/{api_config_build-config.js → zh_api_config_build-config.js} +80 -35
- package/doc_build/static/js/async/{api_config_build-config.js.map → zh_api_config_build-config.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_build-preset.js → zh_api_config_build-preset.js} +39 -21
- package/doc_build/static/js/async/{api_config_build-preset.js.map → zh_api_config_build-preset.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_design-system.js → zh_api_config_design-system.js} +27 -23
- package/doc_build/static/js/async/{api_config_design-system.js.map → zh_api_config_design-system.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_plugins.js → zh_api_config_plugins.js} +17 -21
- package/doc_build/static/js/async/{api_config_plugins.js.map → zh_api_config_plugins.js.map} +1 -1
- package/doc_build/static/js/async/{api_config_testing.js → zh_api_config_testing.js} +28 -26
- package/doc_build/static/js/async/{api_config_testing.js.map → zh_api_config_testing.js.map} +1 -1
- package/doc_build/static/js/async/{api_.js → zh_api_index.js} +10 -14
- package/doc_build/static/js/async/zh_api_index.js.map +1 -0
- package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js → zh_api_plugin-api_plugin-hooks.js} +25 -27
- package/doc_build/static/js/async/{api_plugin-api_plugin-hooks.js.map → zh_api_plugin-api_plugin-hooks.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_asset.js → zh_guide_advance_asset.js} +18 -43
- package/doc_build/static/js/async/{guide_advance_asset.js.map → zh_guide_advance_asset.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_build-umd.js → zh_guide_advance_build-umd.js} +22 -26
- package/doc_build/static/js/async/{guide_advance_build-umd.js.map → zh_guide_advance_build-umd.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_copy.js → zh_guide_advance_copy.js} +26 -24
- package/doc_build/static/js/async/{guide_advance_copy.js.map → zh_guide_advance_copy.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_external-dependency.js → zh_guide_advance_external-dependency.js} +17 -21
- package/doc_build/static/js/async/{guide_advance_external-dependency.js.map → zh_guide_advance_external-dependency.js.map} +1 -1
- package/doc_build/static/js/async/{guide_advance_in-depth-about-build.js → zh_guide_advance_in-depth-about-build.js} +353 -95
- 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
- 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
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/{guide_advance_theme-config.js → zh_guide_advance_theme-config.js} +24 -22
- package/doc_build/static/js/async/{guide_advance_theme-config.js.map → zh_guide_advance_theme-config.js.map} +1 -1
- package/doc_build/static/js/async/{guide_basic_before-getting-started.js → zh_guide_basic_before-getting-started.js} +272 -85
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_command-preview.js → zh_guide_basic_command-preview.js} +47 -35
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_modify-output-product.js → zh_guide_basic_modify-output-product.js} +203 -88
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_publish-your-project.js → zh_guide_basic_publish-your-project.js} +20 -22
- package/doc_build/static/js/async/{guide_basic_publish-your-project.js.map → zh_guide_basic_publish-your-project.js.map} +1 -1
- package/doc_build/static/js/async/{guide_basic_test-your-project.js → zh_guide_basic_test-your-project.js} +30 -35
- package/doc_build/static/js/async/{guide_basic_test-your-project.js.map → zh_guide_basic_test-your-project.js.map} +1 -1
- package/doc_build/static/js/async/{guide_basic_use-micro-generator.js → zh_guide_basic_use-micro-generator.js} +40 -20
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/{guide_basic_using-storybook.js → zh_guide_basic_using-storybook.js} +78 -171
- package/doc_build/static/js/async/{guide_basic_using-storybook.js.map → zh_guide_basic_using-storybook.js.map} +1 -1
- package/doc_build/static/js/async/{guide_best-practices_components.js → zh_guide_best-practices_components.js} +41 -29
- package/doc_build/static/js/async/{guide_best-practices_components.js.map → zh_guide_best-practices_components.js.map} +1 -1
- package/doc_build/static/js/async/{guide_intro_getting-started.js → zh_guide_intro_getting-started.js} +291 -42
- package/doc_build/static/js/async/{guide_intro_getting-started.js.map → zh_guide_intro_getting-started.js.map} +1 -1
- package/doc_build/static/js/async/{guide_intro_welcome.js → zh_guide_intro_welcome.js} +28 -14
- package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/{guide_intro_why-module-engineering-solution.js → zh_guide_intro_why-module-engineering-solution.js} +18 -14
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/{index.js → zh_index.js} +11 -15
- package/doc_build/static/js/async/zh_index.js.map +1 -0
- package/doc_build/static/js/async/{plugins_guide_getting-started.js → zh_plugins_guide_getting-started.js} +19 -23
- package/doc_build/static/js/async/{plugins_guide_getting-started.js.map → zh_plugins_guide_getting-started.js.map} +1 -1
- package/doc_build/static/js/async/{plugins_guide_plugin-object.js → zh_plugins_guide_plugin-object.js} +22 -26
- package/doc_build/static/js/async/{plugins_guide_plugin-object.js.map → zh_plugins_guide_plugin-object.js.map} +1 -1
- package/doc_build/static/js/async/{plugins_guide_setup-function.js → zh_plugins_guide_setup-function.js} +21 -25
- package/doc_build/static/js/async/{plugins_guide_setup-function.js.map → zh_plugins_guide_setup-function.js.map} +1 -1
- package/doc_build/static/js/async/{plugins_official-list_overview.js → zh_plugins_official-list_overview.js} +10 -14
- package/doc_build/static/js/async/zh_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/builder-runtime.js +1 -1
- package/doc_build/static/js/builder-runtime.js.map +1 -1
- package/doc_build/static/js/lib-polyfill.js +3433 -16355
- package/doc_build/static/js/lib-polyfill.js.map +1 -1
- package/doc_build/static/js/main.js +2073 -2700
- package/doc_build/static/js/main.js.map +1 -1
- 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
- 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
- package/doc_build/static/search_index.json +1 -0
- package/docs/.island/dist/404.html +41 -0
- package/docs/.island/dist/assets/asset.26aea654.js +160 -0
- package/docs/.island/dist/assets/asset.36e3d3c9.js +160 -0
- package/docs/.island/dist/assets/before-getting-started.0e863740.js +87 -0
- package/docs/.island/dist/assets/before-getting-started.2c6e6b8a.js +87 -0
- package/docs/.island/dist/assets/build-config.460d11d9.js +804 -0
- package/docs/.island/dist/assets/build-config.e155e534.js +854 -0
- package/docs/.island/dist/assets/build-preset.6c2c6c62.js +256 -0
- package/docs/.island/dist/assets/build-preset.d3da921d.js +256 -0
- package/docs/.island/dist/assets/build-umd.ba00f028.js +264 -0
- package/docs/.island/dist/assets/build-umd.edb9d163.js +273 -0
- package/docs/.island/dist/assets/command-preview.1dc93921.js +264 -0
- package/docs/.island/dist/assets/command-preview.ef7a9d01.js +264 -0
- package/docs/.island/dist/assets/components.esm.03560353.js +9 -0
- package/docs/.island/dist/assets/copy.28dc4d5f.js +277 -0
- package/docs/.island/dist/assets/copy.f4625565.js +277 -0
- package/docs/.island/dist/assets/design-system.8993234c.js +1254 -0
- package/docs/.island/dist/assets/design-system.b0ba163f.js +639 -0
- package/docs/.island/dist/assets/dev.b373b152.js +37 -0
- package/docs/.island/dist/assets/dev.b39fd42a.js +37 -0
- package/docs/.island/dist/assets/down.f35427d3.svg +1 -0
- package/docs/.island/dist/assets/extension.4bf3526b.js +1 -0
- package/docs/.island/dist/assets/extension.d64ed0b8.js +469 -0
- package/docs/.island/dist/assets/external-dependency.2ede7532.js +156 -0
- package/docs/.island/dist/assets/external-dependency.92ca89e0.js +156 -0
- package/docs/.island/dist/assets/getting-started.822cf0b2.js +117 -0
- package/docs/.island/dist/assets/getting-started.e2764829.js +114 -0
- package/docs/.island/dist/assets/github.3bf8ccee.svg +1 -0
- package/docs/.island/dist/assets/in-depth-about-build.94cc902d.js +375 -0
- package/docs/.island/dist/assets/in-depth-about-build.aa74de10.js +374 -0
- package/docs/.island/dist/assets/in-depth-about-dev-command.877bdb83.js +33 -0
- package/docs/.island/dist/assets/in-depth-about-dev-command.9736befd.js +39 -0
- package/docs/.island/dist/assets/index.01786ba7.js +30 -0
- package/docs/.island/dist/assets/index.6cef6f5f.js +4 -0
- package/docs/.island/dist/assets/index.cb118238.js +36 -0
- package/docs/.island/dist/assets/index.ccb6ce27.js +4 -0
- package/docs/.island/dist/assets/island_inject.69495876.js +1 -0
- package/docs/.island/dist/assets/island_inject.cdfb22d9.js +1 -0
- package/docs/.island/dist/assets/loading.8c9bb911.svg +1 -0
- package/docs/.island/dist/assets/modify-output-product.9e2394d7.js +100 -0
- package/docs/.island/dist/assets/modify-output-product.f363845a.js +100 -0
- package/docs/.island/dist/assets/moon.6b705924.svg +3 -0
- package/docs/.island/dist/assets/plugin.70a61997.js +42 -0
- package/docs/.island/dist/assets/plugin.80b12ee2.js +42 -0
- package/docs/.island/dist/assets/publish-your-project.7321c10e.js +164 -0
- package/docs/.island/dist/assets/publish-your-project.7326359f.js +166 -0
- package/docs/.island/dist/assets/right.89674cd7.svg +1 -0
- package/docs/.island/dist/assets/search.0aea6901.svg +1 -0
- package/docs/.island/dist/assets/search.11353245.js +222 -0
- package/docs/.island/dist/assets/search.a1b1cff3.js +3 -0
- package/docs/.island/dist/assets/search.f9025ced.js +3 -0
- package/docs/.island/dist/assets/style.09015a4b.css +1 -0
- package/docs/.island/dist/assets/style.2e5f7bc2.css +1970 -0
- package/docs/.island/dist/assets/sun.841dac10.svg +11 -0
- package/docs/.island/dist/assets/test-your-project.8ab2809e.js +190 -0
- package/docs/.island/dist/assets/test-your-project.9ae2a49e.js +190 -0
- package/docs/.island/dist/assets/test.2bfe276b.js +66 -0
- package/docs/.island/dist/assets/test.a2c00a3f.js +67 -0
- package/docs/.island/dist/assets/translator.b1077c44.svg +1 -0
- package/docs/.island/dist/assets/use-micro-generator.13c1a09f.js +60 -0
- package/docs/.island/dist/assets/use-micro-generator.dfe877f6.js +60 -0
- package/docs/.island/dist/assets/using-storybook.adb88cb8.js +260 -0
- package/docs/.island/dist/assets/using-storybook.b8e7dd04.js +260 -0
- package/docs/.island/dist/assets/welcome.94880043.js +13 -0
- package/docs/.island/dist/assets/welcome.b2140e7e.js +13 -0
- package/docs/.island/dist/assets/why-module-engineering-solution.bfe7981a.js +26 -0
- package/docs/.island/dist/assets/why-module-engineering-solution.e31cd19f.js +26 -0
- package/docs/.island/dist/chunk-COLCRJ2V.js +1 -0
- package/docs/.island/dist/chunk-K5FMOYDC.js +10 -0
- package/docs/.island/dist/chunk-WE42KMYS.js +26 -0
- package/docs/.island/dist/client-entry.js +3 -0
- package/docs/.island/dist/en/api/build-config.html +344 -0
- package/docs/.island/dist/en/api/build-preset.html +82 -0
- package/docs/.island/dist/en/api/design-system.html +155 -0
- package/docs/.island/dist/en/api/dev.html +45 -0
- package/docs/.island/dist/en/api/index.html +41 -0
- package/docs/.island/dist/en/api/plugin.html +48 -0
- package/docs/.island/dist/en/api/test.html +58 -0
- package/docs/.island/dist/en/guide/advance/asset.html +68 -0
- package/docs/.island/dist/en/guide/advance/build-umd.html +72 -0
- package/docs/.island/dist/en/guide/advance/copy.html +82 -0
- package/docs/.island/dist/en/guide/advance/extension.html +41 -0
- package/docs/.island/dist/en/guide/advance/external-dependency.html +71 -0
- package/docs/.island/dist/en/guide/advance/in-depth-about-build.html +148 -0
- package/docs/.island/dist/en/guide/advance/in-depth-about-dev-command.html +51 -0
- package/docs/.island/dist/en/guide/basic/before-getting-started.html +127 -0
- package/docs/.island/dist/en/guide/basic/command-preview.html +100 -0
- package/docs/.island/dist/en/guide/basic/modify-output-product.html +140 -0
- package/docs/.island/dist/en/guide/basic/publish-your-project.html +91 -0
- package/docs/.island/dist/en/guide/basic/test-your-project.html +72 -0
- package/docs/.island/dist/en/guide/basic/use-micro-generator.html +65 -0
- package/docs/.island/dist/en/guide/basic/using-storybook.html +113 -0
- package/docs/.island/dist/en/guide/intro/getting-started.html +76 -0
- package/docs/.island/dist/en/guide/intro/welcome.html +53 -0
- package/docs/.island/dist/en/guide/intro/why-module-engineering-solution.html +49 -0
- package/docs/.island/dist/en/index.html +42 -0
- package/docs/.island/dist/react-dom.js +1 -0
- package/docs/.island/dist/react-dom_client.js +1 -0
- package/docs/.island/dist/react.js +1 -0
- package/docs/.island/dist/react_jsx-runtime.js +10 -0
- package/docs/.island/dist/ssr-manifest.json +57 -0
- package/docs/.island/dist/test-result.png +0 -0
- package/docs/.island/dist/why-module-solution.png +0 -0
- package/docs/.island/dist/zh/api/build-config.html +361 -0
- package/docs/.island/dist/zh/api/build-preset.html +82 -0
- package/docs/.island/dist/zh/api/design-system.html +149 -0
- package/docs/.island/dist/zh/api/dev.html +46 -0
- package/docs/.island/dist/zh/api/index.html +41 -0
- package/docs/.island/dist/zh/api/plugin.html +48 -0
- package/docs/.island/dist/zh/api/test.html +59 -0
- package/docs/.island/dist/zh/guide/advance/asset.html +68 -0
- package/docs/.island/dist/zh/guide/advance/build-umd.html +72 -0
- package/docs/.island/dist/zh/guide/advance/copy.html +82 -0
- package/docs/.island/dist/zh/guide/advance/extension.html +127 -0
- package/docs/.island/dist/zh/guide/advance/external-dependency.html +71 -0
- package/docs/.island/dist/zh/guide/advance/in-depth-about-build.html +148 -0
- package/docs/.island/dist/zh/guide/advance/in-depth-about-dev-command.html +53 -0
- package/docs/.island/dist/zh/guide/basic/before-getting-started.html +127 -0
- package/docs/.island/dist/zh/guide/basic/command-preview.html +100 -0
- package/docs/.island/dist/zh/guide/basic/modify-output-product.html +140 -0
- package/docs/.island/dist/zh/guide/basic/publish-your-project.html +92 -0
- package/docs/.island/dist/zh/guide/basic/test-your-project.html +72 -0
- package/docs/.island/dist/zh/guide/basic/use-micro-generator.html +65 -0
- package/docs/.island/dist/zh/guide/basic/using-storybook.html +114 -0
- package/docs/.island/dist/zh/guide/intro/getting-started.html +79 -0
- package/docs/.island/dist/zh/guide/intro/welcome.html +53 -0
- package/docs/.island/dist/zh/guide/intro/why-module-engineering-solution.html +49 -0
- package/docs/.island/dist/zh/index.html +42 -0
- package/docs/en/api/config/build-config.md +15 -5
- package/docs/en/api/config/build-preset.md +3 -2
- package/docs/en/api/config/design-system.md +623 -615
- package/docs/en/api/config/plugins.md +2 -2
- package/docs/en/api/config/testing.md +2 -1
- package/docs/en/guide/advance/asset.mdx +0 -4
- package/docs/en/guide/advance/build-umd.mdx +3 -3
- package/docs/en/guide/advance/in-depth-about-build.md +14 -13
- package/docs/en/guide/advance/in-depth-about-dev-command.md +2 -1
- package/docs/en/guide/basic/before-getting-started.md +16 -9
- package/docs/en/guide/basic/command-preview.md +2 -2
- package/docs/en/guide/basic/modify-output-product.md +65 -69
- package/docs/en/guide/basic/test-your-project.mdx +1 -3
- package/docs/en/guide/basic/use-micro-generator.md +4 -0
- package/docs/en/guide/basic/using-storybook.mdx +1 -13
- package/docs/en/guide/intro/getting-started.md +16 -7
- package/docs/en/plugins/guide/getting-started.mdx +2 -2
- package/docs/en/plugins/guide/plugin-object.mdx +5 -5
- package/docs/zh/api/config/build-config.md +18 -6
- package/docs/zh/api/config/build-preset.md +3 -2
- package/docs/zh/api/config/design-system.md +2 -2
- package/docs/zh/api/config/plugins.md +2 -2
- package/docs/zh/api/config/testing.md +3 -2
- package/docs/zh/guide/advance/asset.mdx +0 -5
- package/docs/zh/guide/advance/build-umd.mdx +3 -3
- package/docs/zh/guide/advance/in-depth-about-build.md +14 -13
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +2 -1
- package/docs/zh/guide/basic/before-getting-started.md +15 -8
- package/docs/zh/guide/basic/command-preview.md +2 -2
- package/docs/zh/guide/basic/modify-output-product.md +17 -19
- package/docs/zh/guide/basic/test-your-project.mdx +1 -3
- package/docs/zh/guide/basic/use-micro-generator.md +5 -1
- package/docs/zh/guide/basic/using-storybook.mdx +9 -19
- package/docs/zh/guide/intro/getting-started.md +17 -11
- package/docs/zh/plugins/guide/getting-started.mdx +2 -2
- package/docs/zh/plugins/guide/plugin-object.mdx +5 -5
- package/modern.config.ts +11 -5
- package/package.json +4 -4
- package/doc_build/static/js/async/api_.js.map +0 -1
- package/doc_build/static/js/async/en_.js.map +0 -1
- package/doc_build/static/js/async/en_api_.js.map +0 -1
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_command-preview.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +0 -1
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +0 -1
- package/doc_build/static/js/async/guide_intro_welcome.js.map +0 -1
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +0 -1
- package/doc_build/static/js/async/index.js.map +0 -1
- package/doc_build/static/js/async/plugins_official-list_overview.js.map +0 -1
|
@@ -16,16 +16,15 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
16
16
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");
|
|
17
17
|
/* harmony import */ var _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../node_modules/.pnpm/@code-hike+mdx@0.7.4_react@18.2.0/node_modules/@code-hike/mdx/dist/components.esm.mjs");
|
|
18
18
|
/*@jsxRuntime automatic @jsxImportSource react*/
|
|
19
|
-
/*链接待补充*/
|
|
20
19
|
|
|
21
20
|
|
|
22
|
-
|
|
21
|
+
const CH = {
|
|
23
22
|
annotations: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.annotations,
|
|
24
23
|
Spotlight: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Spotlight,
|
|
25
24
|
CodeSlot: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.CodeSlot,
|
|
26
25
|
Code: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Code
|
|
27
26
|
};
|
|
28
|
-
|
|
27
|
+
const chCodeConfig = {
|
|
29
28
|
"staticMediaQuery": "not screen, (max-width: 768px)",
|
|
30
29
|
"theme": {
|
|
31
30
|
"name": "nord",
|
|
@@ -1188,12 +1187,12 @@ var chCodeConfig = {
|
|
|
1188
1187
|
"autoImport": true,
|
|
1189
1188
|
"showCopyButton": true,
|
|
1190
1189
|
"skipLanguages": [],
|
|
1191
|
-
"filepath": "/Users/
|
|
1190
|
+
"filepath": "/Users/targeral/github/targeral-modern-js/website/module-tools/docs/en/guide/basic/using-storybook.mdx"
|
|
1192
1191
|
};
|
|
1193
|
-
|
|
1192
|
+
const frontmatter = {
|
|
1194
1193
|
"sidebar_position": 5
|
|
1195
1194
|
};
|
|
1196
|
-
|
|
1195
|
+
const toc = [{
|
|
1197
1196
|
"id": "debugging-code",
|
|
1198
1197
|
"text": "Debugging code",
|
|
1199
1198
|
"depth": 2
|
|
@@ -1209,23 +1208,15 @@ var toc = [{
|
|
|
1209
1208
|
"id": "configure-storybook",
|
|
1210
1209
|
"text": "Configure Storybook",
|
|
1211
1210
|
"depth": 2
|
|
1212
|
-
}, {
|
|
1213
|
-
"id": "configuration-file",
|
|
1214
|
-
"text": "Configuration file",
|
|
1215
|
-
"depth": 3
|
|
1216
|
-
}, {
|
|
1217
|
-
"id": "devstorybook",
|
|
1218
|
-
"text": "dev.storybook",
|
|
1219
|
-
"depth": 3
|
|
1220
1211
|
}, {
|
|
1221
1212
|
"id": "building-storybook-products",
|
|
1222
1213
|
"text": "Building Storybook Products",
|
|
1223
|
-
"depth":
|
|
1214
|
+
"depth": 2
|
|
1224
1215
|
}];
|
|
1225
|
-
|
|
1226
|
-
|
|
1216
|
+
const title = `Using Storybook`;
|
|
1217
|
+
const content = "\"---\\nsidebar_position: 5\\n---\\n\\n# Using Storybook\\n\\nFirst of all, if you haven't read the following, take a few minutes to understand it first.\\n\\n- [use micro-generator to enable Storybook debugging](/en/guide/basic/use-micro-generator#storybook-debug)\\n- [`modern dev`](/en/guide/basic/command-preview#modern-dev)\\n\\n[Storybook](https://storybook.js.org/) is a tool dedicated to component debugging, providing around component development.\\n\\n- Develop UIs that are more durable\\n- Test UIs with less effort and no flakes\\n- Document UI for your team to reuse\\n- Share how the UI actually works\\n- Automate UI workflows\\n\\nSo it is a complex and powerful tool.\\n\\nThe modular engineering solution is integrated with Storybook, so you can pretty much follow the official Storybook documentation. However, there are still a few things to keep in mind, which are explained below.\\n\\n## Debugging code\\n\\nComponent code needs to be introduced during debugging code, and currently component code can be introduced in two ways:\\n\\n- Referencing the component product\\n- Referencing component source code\\n\\nWe recommend the first way of \\\"**referencing component product**\\\". Because it is almost close to the real usage scenario, not only can we debug the component functionality, but also verify the correctness of the build product.\\n\\nNext, we will talk about how to use each of these two methods.\\n\\n### Referencing component products\\n\\nIf the TypeScript project `foo` exists.\\n\\n<CH.Spotlight>\\n\\n```json package.json\\n{\\n \\\"name\\\": \\\"foo\\\",\\n \\\"main\\\": \\\"./dist/index.js\\\",\\n \\\"types\\\": \\\"./dist/types/index.d.ts\\\"\\n}\\n```\\n\\n---\\n\\nMake sure the `main` and `types` of `package.json`\\nvalues are real paths.\\n\\n```json package.json\\n{\\n \\\"name\\\": \\\"foo\\\",\\n \\\"main\\\": \\\"./dist/index.js\\\",\\n \\\"types\\\": \\\"./dist/types/index.d.ts\\\"\\n}\\n```\\n\\n---\\n\\nThe source code of the `foo` project.\\n\\n```typescript src/index.ts\\nexport const content = 'hello world';\\n```\\n\\n---\\n\\nMake sure that the `paths` configuration pointing to the project root is set in `stories/tsconfig.json`.\\nThe `key` of `paths` is the same as the project name.\\n\\n```json stories/tsconfig.json focus=7:9\\n{\\n \\\"extends\\\": \\\"../tsconfig.json\\\",\\n \\\"include\\\": [\\\"./\\\"],\\n \\\"compilerOptions\\\": {\\n \\\"jsx\\\": \\\"preserve\\\",\\n \\\"baseUrl\\\": \\\".\\\",\\n \\\"paths\\\": {\\n \\\"foo\\\": [\\\"../\\\"]\\n }\\n }\\n}\\n```\\n\\n---\\n\\nFinally, it is referenced directly in the Story code by the project name.\\n\\n```tsx stories/index.stories.tsx focus=1:1\\nimport { content } from 'foo';\\n\\nconst Component = () => <div>this is a Story Component {content}</div>;\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n</CH.Spotlight>\\n\\nIf, during development, you encounter a situation where the type definition is not available in real time, at that point.\\n\\nFor `pnpm` projects, `package.json` can be modified as follows.\\n\\n```ts focus=4:7\\n{\\n \\\"name\\\": \\\"foo\\\",\\n \\\"main\\\": \\\"./dist/index.js\\\",\\n \\\"types\\\": \\\"./src/index.ts\\\",\\n \\\"publishConfig\\\": {\\n \\\"types\\\": \\\"./dist/index.d.ts\\\",\\n }\\n}\\n```\\n\\n> For the use of pnpm's `publishConfig`, you can read the following [link](https://pnpm.io/package_json#publishconfig).\\n\\nFor npm and Yarn projects, the values of `types` of `package.json` can only be changed manually in **development phase** and **release phase**.\\n\\nSo why is it possible to reference the product directly?\\n\\n1. the `modern build` command is executed automatically before the `modern dev storybook` command, ensuring the existence of the project build product.\\n2. The project name is added as an alias inside Storybook to ensure that the path to the project's product can be parsed **according to `package.json`**.\\n\\n### Referencing component source code\\n\\nReferencing component source code can be done by means of relative paths to:\\n\\n```ts ./stories/index.tsx\\nimport { content } from '../src';\\n\\nconst Component = () => <div>this is a Story Component {content}</div>;\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\nSo why is the source code approach not recommended?\\n\\nNot only is it impossible to verify that the component product is correct using the component source code, **but also some of the configurations supported by the module project for building the product cannot be fully translated into Storybook internal configuration**. If some of the configurations cannot be converted to each other, there will be unintended results during Storybook debugging.\\n\\n## Configure Storybook\\n\\nStorybook 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.**\\n\\nFor more information on how to use the various Storybook configuration files, see the following links:\\n\\n- [Configure Storybook](https://storybook.js.org/docs/react/configure/overview)\\n\\n**But there are some limitations to Storybooking in a module project**:\\n\\n- It is currently not possible to change the location of the Story file, i.e., you cannot change the `stories` configuration in the `main.js` file.\\n- Currently you cannot modify Webpack and Babel related configuration, i.e. you cannot modify `webpackFinal` and `babel` configuration in the `main.js` file.\\n\\nIn 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.\\n\\n## Building Storybook Products\\n\\nIn addition to Storybook debugging of components or common modules, you can also perform Storybook build tasks with the following commands.\\n\\n```bash\\nmodern build --platform storybook\\n```\\n\\nFor the `modern build --platform` command you can see.\\n\\n- [`modern build`](/en/guide/basic/command-preview#modern-build)\\n\\nAfter the build is complete, you can see the build product files in the `dist/storybook-static` directory.\\n\"";
|
|
1227
1218
|
function _createMdxContent(props) {
|
|
1228
|
-
|
|
1219
|
+
const _components = Object.assign({
|
|
1229
1220
|
h1: "h1",
|
|
1230
1221
|
a: "a",
|
|
1231
1222
|
p: "p",
|
|
@@ -1256,12 +1247,12 @@ function _createMdxContent(props) {
|
|
|
1256
1247
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
1257
1248
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
1258
1249
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
1259
|
-
href: "/en/guide/basic/use-micro-generator#storybook-debug
|
|
1250
|
+
href: "/module-tools/en/guide/basic/use-micro-generator.html#storybook-debug",
|
|
1260
1251
|
children: "use micro-generator to enable Storybook debugging"
|
|
1261
1252
|
})
|
|
1262
1253
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
1263
1254
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
1264
|
-
href: "/en/guide/basic/command-preview#modern-dev
|
|
1255
|
+
href: "/module-tools/en/guide/basic/command-preview.html#modern-dev-3",
|
|
1265
1256
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
1266
1257
|
children: "modern dev"
|
|
1267
1258
|
})
|
|
@@ -1270,6 +1261,8 @@ function _createMdxContent(props) {
|
|
|
1270
1261
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
1271
1262
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
1272
1263
|
href: "https://storybook.js.org/",
|
|
1264
|
+
target: "_blank",
|
|
1265
|
+
rel: "nofollow",
|
|
1273
1266
|
children: "Storybook"
|
|
1274
1267
|
}), " is a tool dedicated to component debugging, providing around component development."]
|
|
1275
1268
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
@@ -4022,7 +4015,9 @@ function _createMdxContent(props) {
|
|
|
4022
4015
|
children: ["For the use of pnpm's ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4023
4016
|
children: "publishConfig"
|
|
4024
4017
|
}), ", you can read the following ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4025
|
-
href: "https://pnpm.io/package_json#publishconfig",
|
|
4018
|
+
href: "https://pnpm.io/package_json#publishconfig-1",
|
|
4019
|
+
target: "_blank",
|
|
4020
|
+
rel: "nofollow",
|
|
4026
4021
|
children: "link"
|
|
4027
4022
|
}), "."]
|
|
4028
4023
|
}), "\n"]
|
|
@@ -4614,14 +4609,6 @@ function _createMdxContent(props) {
|
|
|
4614
4609
|
href: "#configure-storybook",
|
|
4615
4610
|
children: "#"
|
|
4616
4611
|
}), "Configure Storybook"]
|
|
4617
|
-
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h3, {
|
|
4618
|
-
id: "configuration-file",
|
|
4619
|
-
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4620
|
-
className: "header-anchor",
|
|
4621
|
-
"aria-hidden": "true",
|
|
4622
|
-
href: "#configuration-file",
|
|
4623
|
-
children: "#"
|
|
4624
|
-
}), "Configuration file"]
|
|
4625
4612
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
4626
4613
|
children: ["Storybook is officially configured for projects through a folder called ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4627
4614
|
children: ".storybook"
|
|
@@ -4636,6 +4623,8 @@ function _createMdxContent(props) {
|
|
|
4636
4623
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4637
4624
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4638
4625
|
href: "https://storybook.js.org/docs/react/configure/overview",
|
|
4626
|
+
target: "_blank",
|
|
4627
|
+
rel: "nofollow",
|
|
4639
4628
|
children: "Configure Storybook"
|
|
4640
4629
|
})
|
|
4641
4630
|
}), "\n"]
|
|
@@ -4661,31 +4650,7 @@ function _createMdxContent(props) {
|
|
|
4661
4650
|
}), "\n"]
|
|
4662
4651
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
4663
4652
|
children: "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."
|
|
4664
|
-
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.
|
|
4665
|
-
id: "devstorybook",
|
|
4666
|
-
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4667
|
-
className: "header-anchor",
|
|
4668
|
-
"aria-hidden": "true",
|
|
4669
|
-
href: "#devstorybook",
|
|
4670
|
-
children: "#"
|
|
4671
|
-
}), (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4672
|
-
children: "dev.storybook"
|
|
4673
|
-
})]
|
|
4674
|
-
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
4675
|
-
children: ["In addition to the configuration file, the module engineering solution also provides a ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4676
|
-
children: "dev.storybook"
|
|
4677
|
-
}), " configuration item in the ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4678
|
-
children: "modern.config.(j|t)s"
|
|
4679
|
-
}), " project configuration file."]
|
|
4680
|
-
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
4681
|
-
children: "The webpack configuration of Storybook can be modified via this configuration."
|
|
4682
|
-
}), "\n", "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
4683
|
-
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4684
|
-
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4685
|
-
children: "dev.storybook.webpack"
|
|
4686
|
-
})
|
|
4687
|
-
}), "\n"]
|
|
4688
|
-
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h3, {
|
|
4653
|
+
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h2, {
|
|
4689
4654
|
id: "building-storybook-products",
|
|
4690
4655
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4691
4656
|
className: "header-anchor",
|
|
@@ -4727,7 +4692,7 @@ function _createMdxContent(props) {
|
|
|
4727
4692
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
4728
4693
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4729
4694
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4730
|
-
href: "/en/guide/basic/command-preview#modern-build
|
|
4695
|
+
href: "/module-tools/en/guide/basic/command-preview.html#modern-build-1",
|
|
4731
4696
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
4732
4697
|
children: "modern build"
|
|
4733
4698
|
})
|
|
@@ -4740,21 +4705,17 @@ function _createMdxContent(props) {
|
|
|
4740
4705
|
})]
|
|
4741
4706
|
});
|
|
4742
4707
|
}
|
|
4743
|
-
function MDXContent() {
|
|
4744
|
-
|
|
4745
|
-
var _ref = props.components || {},
|
|
4746
|
-
MDXLayout = _ref.wrapper;
|
|
4708
|
+
function MDXContent(props = {}) {
|
|
4709
|
+
const {wrapper: MDXLayout} = props.components || ({});
|
|
4747
4710
|
return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
|
|
4748
4711
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
|
|
4749
4712
|
})) : _createMdxContent(props);
|
|
4750
4713
|
}
|
|
4751
|
-
_c = MDXContent;
|
|
4752
4714
|
/* harmony default export */ __webpack_exports__["default"] = (MDXContent);
|
|
4753
4715
|
function _missingMdxReference(id, component, place) {
|
|
4754
|
-
throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/
|
|
4716
|
+
throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/targeral/github/targeral-modern-js/website/module-tools/docs/en/guide/basic/using-storybook.mdx`" : ""));
|
|
4755
4717
|
}
|
|
4756
|
-
|
|
4757
|
-
__webpack_require__.$Refresh$.register(_c, "MDXContent");
|
|
4718
|
+
|
|
4758
4719
|
|
|
4759
4720
|
/***/ })
|
|
4760
4721
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static/js/async/en_guide_basic_using-storybook.js","mappings":"
|
|
1
|
+
{"version":3,"file":"static/js/async/en_guide_basic_using-storybook.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAEA;;;;;AAEA;;;;;;;;;;;;;;;AAGA;AAAA;;;AAEA;;AACA;;AACA;;AACA;;AACA;;;AAEA;;AAEA;;;;;;;;AAEA;;AAEA;;;AAEA;;AACA;;;AAEA;AAAA;AAAA;;AAEA;;;;;;;;AAEA;;AAEA;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;;AAAA;;AAAA;;AAAA;;;;AAaA;;AAAA;;;;AAQA;;AAAA;;AAAA;;AACA;;AAAA;;;;AAkBA;;;;AAgBA;;AAEA;;AAAA;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAA;;;;AAAA;AAAA;;;AAEA;;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;AAEA;;;AAEA;;AAAA;;AAAA;;AACA;AAAA;;;AAAA;;;;;;;;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA;;AAEA;AAAA;AAAA;;;;;;;;AAEA;;AAEA;;AAAA;AAAA;;AAAA;;;AAEA;;;;;;;AAEA;;;;;AAEA;AAAA;;;AAEA;;AAAA;;AAAA;;AACA;;AAAA;;AAAA;;AAAA;;;AAEA;;;;;;;;AAEA;;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;;AAAA;;;;;;;;;;;AAIA;;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/en/guide/basic/using-storybook.mdx"],"names":[],"sourceRoot":""}
|
|
@@ -18,13 +18,13 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
18
18
|
/*@jsxRuntime automatic @jsxImportSource react*/
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
const CH = {
|
|
22
22
|
annotations: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.annotations,
|
|
23
23
|
Spotlight: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Spotlight,
|
|
24
24
|
CodeSlot: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.CodeSlot,
|
|
25
25
|
Code: _code_hike_mdx_dist_components_cjs_js__WEBPACK_IMPORTED_MODULE_1__.Code
|
|
26
26
|
};
|
|
27
|
-
|
|
27
|
+
const chCodeConfig = {
|
|
28
28
|
"staticMediaQuery": "not screen, (max-width: 768px)",
|
|
29
29
|
"theme": {
|
|
30
30
|
"name": "nord",
|
|
@@ -1187,10 +1187,10 @@ var chCodeConfig = {
|
|
|
1187
1187
|
"autoImport": true,
|
|
1188
1188
|
"showCopyButton": true,
|
|
1189
1189
|
"skipLanguages": [],
|
|
1190
|
-
"filepath": "/Users/
|
|
1190
|
+
"filepath": "/Users/targeral/github/targeral-modern-js/website/module-tools/docs/en/guide/best-practices/components.mdx"
|
|
1191
1191
|
};
|
|
1192
|
-
|
|
1193
|
-
|
|
1192
|
+
const frontmatter = undefined;
|
|
1193
|
+
const toc = [{
|
|
1194
1194
|
"id": "debugging-code-with-storybook",
|
|
1195
1195
|
"text": "Debugging code with Storybook",
|
|
1196
1196
|
"depth": 2
|
|
@@ -1247,10 +1247,10 @@ var toc = [{
|
|
|
1247
1247
|
"text": "Releasing components",
|
|
1248
1248
|
"depth": 2
|
|
1249
1249
|
}];
|
|
1250
|
-
|
|
1251
|
-
var content = "\"# Developing Components\\n\\nThis chapter will describe how to develop component projects using the module engineering solution.\\n\\n# # Initialize the project\\n\\n<CH.Spotlight>\\n\\n```bash Interactive questions\\nnpx @modern-js/create components-project\\n\\n? Please select the solution you want to create Module Solution\\n? Package Name components-demo\\n? Development Language TS\\n? Package Management Tool pnpm\\n```\\n\\n---\\n\\nIt is recommended to use the `@modern-js/create` command to initialize an npm project.\\n\\n```bash Interactive questions\\nnpx @modern-js/create components-project\\n\\n? Please select the solution you want to create Module Solution\\n? Package Name components-demo\\n? Development Language TS\\n? Package Management Tool pnpm\\n```\\n\\n---\\n\\nThe initialized directory structure.\\n\\n```bash The initialized directory structure\\n.\\n├── README.md\\n├── node_modules/\\n├── dist/\\n├── modern.config.ts\\n├── package.json\\n├── pnpm-lock.yaml\\n├── src\\n│ ├── index.ts\\n│ └── modern-app-env.d.ts\\n└── tsconfig.json\\n```\\n\\n---\\n\\nModify the `. /src/index.ts` file suffix and content.\\n\\nAt this point, a component project is initialized.\\n\\n```tsx ./src/index.tsx\\nexport default () => {\\n return <div>hello world</div>;\\n};\\n```\\n\\n</CH.Spotlight>\\n\\n## Debugging code with Storybook\\n\\n<CH.Spotlight>\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Visual Testing (Storybook)\\n```\\n\\n---\\n\\nExecute the `new` command in the project root directory to enable the Storybook feature.\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Visual Testing (Storybook)\\n```\\n\\n---\\n\\nOnce 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.\\n\\n<CH.Code>\\n\\n```json ./package.json focus=4:7\\n{\\n \\\"name\\\": \\\"components-demo\\\",\\n \\\"devDependencies\\\": {\\n \\\"@modern-js/plugin-storybook\\\": \\\"x.y.z\\\",\\n \\\"@modern-js/runtime\\\": \\\"x.y.z\\\",\\n \\\"react\\\": \\\"^17\\\",\\n \\\"react-dom\\\": \\\"^17\\\"\\n }\\n}\\n```\\n\\n```bash Directory Structure\\n.\\n├── src\\n│ ├── index.ts\\n│ └── modern-app-env.d.ts\\n├── stories\\n│ ├── .eslintrc.js\\n│ ├── index.stories.tsx\\n│ └── tsconfig.json\\n```\\n\\n</CH.Code>\\n\\n---\\n\\nAfter 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.\\n\\n```json ./stories/tsconfig.json focus=5:7\\n{\\n \\\"extends\\\": \\\"../tsconfig.json\\\",\\n \\\"compilerOptions\\\": {\\n \\\"baseUrl\\\": \\\"../\\\",\\n \\\"paths\\\": {\\n \\\"components-demo\\\": [\\\"./\\\"],\\n \\\"components-demo/*\\\": [\\\"./*\\\"]\\n }\\n },\\n \\\"include\\\": [\\\"**/*\\\"]\\n}\\n```\\n\\n---\\n\\nSuch a configuration allows you to introduce code in Story code directly using the name of the project.\\n\\n<CH.Code>\\n\\n```tsx ./stories/index.stories.tsx\\nimport Component from 'components-demo';\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n---\\n\\n```tsx ./src/index.tsx\\nexport default () => {\\n return <div>hello world</div>;\\n};\\n```\\n\\n</CH.Code>\\n\\n---\\n\\nAt this point Storybook identifies the entry point for the imported code based on fields like `main`, `exports` in the project's `package.json` file.\\nThe location of the type file is determined by the `types` field.\\n\\n```json package.json\\n{\\n \\\"name\\\": \\\"components-demo\\\",\\n \\\"main\\\": \\\"./dist/esm/index.js\\\",\\n \\\"types\\\": \\\"./dist/types/index.d.ts\\\"\\n}\\n```\\n\\n---\\n\\nWhile importing source code for debugging is also supported, debugging using project artifacts is more reliable.\\n\\nDebugging with source code has a limitation: some configurations are not equivalent in Storybook and in the original build support.\\n\\n**This is why debugging with the product is recommended**.\\n\\n```tsx ./stories/index.stories.tsx\\nimport Component from '../src';\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n</CH.Spotlight>\\n\\n## Developing Styles\\n\\nNext we can add styles to the component.\\n\\nThe following capabilities are currently supported for developing styles.\\n\\n- CSS/PostCSS\\n- Less\\n- Scss/Sass\\n- Tailwind CSS\\n- CSS Modules\\n\\n### CSS/PostCSS\\n\\nThe module project supports PostCSS and has the following built-in postcss plugins.\\n\\n- [flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes)\\n- [custom-properties](https://github.com/postcss/postcss-custom-properties)\\n- [initial](https://github.com/maximkoretskiy/postcss-initial)\\n- [page-break](https://github.com/shrpne/postcss-page-break)\\n- [font-variant](https://github.com/postcss/postcss-font-variant)\\n- [media-minmax](https://github.com/postcss/postcss-media-minmax)\\n- [nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme)\\n\\nSo we can create `.css` files in our projects and use the syntax support and capabilities provided by these plugins directly in our css files.\\n\\n<CH.Spotlight>\\n\\n```css ./src/index.css\\na,\\nb {\\n color: red;\\n\\n /* \\\"&\\\" comes first */\\n & c,\\n & d {\\n color: white;\\n }\\n\\n /* \\\"&\\\" comes later, requiring \\\"@nest\\\" */\\n @nest e & {\\n color: yellow;\\n }\\n}\\n```\\n\\n---\\n\\nSource Code.\\n\\n```css ./src/index.css\\n\\n```\\n\\n---\\n\\ncss product.\\n\\n```css ./dist/es/index.css\\na,\\nb {\\n color: red;\\n}\\na c,\\nb c,\\na d,\\nb d {\\n color: white;\\n}\\ne a,\\ne b {\\n color: yellow;\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n### Less\\n\\nModule projects support development styles using Less.\\n\\n> Currently supported version is 4.1.3\\n\\n<CH.Spotlight>\\n\\n```less ./src/common.less\\n@bg: black;\\n@bg-light: boolean(luma(@bg) > 50%);\\n\\ndiv {\\n background: @bg;\\n color: if(@bg-light, black, white);\\n}\\n```\\n\\n---\\n\\nSource Code.\\n\\n```less ./src/common.less\\n\\n```\\n\\n---\\n\\nLess product.\\n\\n```css ./dist/es/common.css\\ndiv {\\n background: black;\\n color: white;\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n### Sass/Scss\\n\\nModule projects support developing styles using Scss/Sass.\\n\\n> Currently supported version is 1.54.4\\n\\n<CH.Spotlight>\\n\\n```sass ./src/common.sass\\n$font-stack: Helvetica, sans-serif;\\n$primary-color: #333;\\n\\nbody {\\n font: 100% $font-stack;\\n color: $primary-color;\\n}\\n```\\n\\n---\\n\\n源代码。\\n\\n```sass ./src/common.sass\\n\\n```\\n\\n---\\n\\nLess product.\\n\\n```css ./dist/es/common.css\\nbody {\\n font: 100% Helvetica, sans-serif;\\n color: #333;\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n### Tailwind CSS\\n\\nThe module project supports the development of component styles using Tailwind CSS.\\n\\nBy default, this feature is not enabled in the module project, you need to enable it as follows.\\n\\n<CH.Spotlight>\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Visual Testing (Storybook)\\n```\\n\\n---\\n\\nThe Tailwind CSS feature can be enabled by executing the `new` command in the project root directory.\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Tailwind CSS\\n```\\n\\n---\\n\\nOnce successfully opened, you will see that a new dependency has been added to `package.json`.\\n\\n```json ./package.json\\n{\\n \\\"devDependencies\\\": {\\n \\\"@modern-js/plugin-tailwindcss\\\": \\\"x.y.z\\\"\\n }\\n}\\n```\\n\\n</CH.Spotlight>\\n\\nTailwind CSS offers two ways to use it.\\n\\n#### HTML class\\n\\n<CH.Spotlight>\\n\\n```tsx ./src/index.tsx\\nimport 'tailwindcss/utilities.css';\\n\\nexport default () => {\\n return <div className=\\\"bg-black text-white\\\">hello world</div>;\\n};\\n```\\n\\n---\\n\\nTailwind CSS supports adding styles to HTML tags by using class names.\\n\\n```tsx ./src/index.tsx focus=5:5\\n\\n```\\n\\n---\\n\\n**When using HTML class names, be sure to import the Tailwind CSS equivalent css file. **\\n\\n```tsx ./src/index.tsx focus=1:1\\n\\n```\\n\\n---\\n\\nStyle product.\\n\\n> This is a bundle build.\\n\\n```css ./dist/es/index.css\\n/* ../../node_modules/.pnpm/tailwindcss@2.2.19/node_modules/tailwindcss/utilities.css */\\n.table {\\n display: table;\\n}\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes ping {\\n 75%,\\n 100% {\\n transform: scale(2);\\n opacity: 0;\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: 0.5;\\n }\\n}\\n@keyframes bounce {\\n 0%,\\n 100% {\\n transform: translateY(-25%);\\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\\n }\\n 50% {\\n transform: none;\\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\\n }\\n}\\n.bg-black {\\n --tw-bg-opacity: 1;\\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity));\\n}\\n.text-white {\\n --tw-text-opacity: 1;\\n color: rgba(255, 255, 255, var(--tw-text-opacity));\\n}\\n*,\\n::before,\\n::after {\\n --tw-shadow: 0 0 #0000;\\n}\\n*,\\n::before,\\n::after {\\n --tw-ring-inset: var(--tw-empty);\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-color: rgba(59, 130, 246, 0.5);\\n --tw-ring-offset-shadow: 0 0 #0000;\\n --tw-ring-shadow: 0 0 #0000;\\n}\\n@media (min-width: 640px) {\\n}\\n@media (min-width: 768px) {\\n}\\n@media (min-width: 1024px) {\\n}\\n@media (min-width: 1280px) {\\n}\\n@media (min-width: 1536px) {\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n#### `@apply`\\n\\nTailwind 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.\\n\\n`@apply` can be used in CSS, Less, and Sass.\\n\\n```css\\n.btn {\\n @apply font-bold py-2 px-4 rounded;\\n}\\n```\\n\\nHowever, there are some things to keep in mind when using Less and Sass.\\n\\n##### Sass\\n\\nWhen using Tailwind with Sass, the presence of `!important` after `@apply` requires interpolation to get Sass to compile correctly.\\n\\n<CH.Spotlight>\\n\\n```sass\\n.alert {\\n @apply bg-red-500 !important;\\n}\\n```\\n\\n---\\n\\nIt does not work properly.\\n\\n```sass\\n\\n```\\n\\n---\\n\\nCan work properly.\\n\\n```sass\\n.alert {\\n @apply bg-red-500 #{!important};\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n##### Less\\n\\nWhen using Tailwind with Less, you cannot nest Tailwind's `@screen` directive.\\n\\n<CH.Spotlight>\\n\\n```less\\n.card {\\n @apply rounded-none;\\n\\n @screen sm {\\n @apply rounded-lg;\\n }\\n}\\n```\\n\\n---\\n\\nIt does not work properly.\\n\\n```less\\n\\n```\\n\\n---\\n\\nInstead, use regular media queries and the `theme()` function to reference your screen size, or simply don't nest your `@screen` directive.\\n\\n<CH.Code>\\n\\n```less Method One\\n// Use a regular media query and theme()\\n.card {\\n @apply rounded-none;\\n\\n @media (min-width: theme('screens.sm')) {\\n @apply rounded-lg;\\n }\\n}\\n```\\n\\n---\\n\\n```less Method Two\\n// Use the @screen directive at the top-level\\n.card {\\n @apply rounded-none;\\n\\n @media (min-width: theme('screens.sm')) {\\n @apply rounded-lg;\\n }\\n}\\n```\\n\\n</CH.Code>\\n\\n</CH.Spotlight>\\n\\n#### Recommended method\\n\\n**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. **\\n\\nWhen 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.\\n\\n#### The difference between bundle and bundleless build products\\n\\nFor the following code, there is a big difference between the bundle and bundleless modes of building products.\\n\\n> The so-called bundle and bundleless can be found in [[Bundle and Bundleless]](/en/guide/advance/in-depth-about-build#bundle- and-bundleless)\\n\\n```tsx ./src/index.tsx\\nimport 'tailwindcss/utilities.css';\\n\\nexport default () => {\\n return <div className=\\\"bg-black text-white\\\">hello world11</div>;\\n};\\n```\\n\\nIn Bundle mode, third-party dependencies are packaged in.\\n\\nFor styles, a separate product file is generated, and there is no code related to importing styles in the Js product file.\\n\\nIf you need to inject styles into Js products, you can enable the [`style.inject` API](/en/api/config/build-config#inject).\\n\\n<CH.Code>\\n```css ./dist/es/index.css\\n/* ../../node_modules/.pnpm/tailwindcss@2.2.19/node_modules/tailwindcss/utilities.css */\\n.table {\\n display: table;\\n}\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes ping {\\n 75%, 100% {\\n transform: scale(2);\\n opacity: 0;\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: .5;\\n }\\n}\\n@keyframes bounce {\\n 0%, 100% {\\n transform: translateY(-25%);\\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\\n }\\n 50% {\\n transform: none;\\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\\n }\\n}\\n.bg-black {\\n --tw-bg-opacity: 1;\\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity));\\n}\\n.text-white {\\n --tw-text-opacity: 1;\\n color: rgba(255, 255, 255, var(--tw-text-opacity));\\n}\\n*,\\n::before,\\n::after {\\n --tw-shadow: 0 0 #0000 ;\\n}\\n*,\\n::before,\\n::after {\\n --tw-ring-inset: var(--tw-empty, );\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-color: rgba(59, 130, 246, 0.5);\\n --tw-ring-offset-shadow: 0 0 #0000;\\n --tw-ring-shadow: 0 0 #0000 ;\\n}\\n@media (min-width: 640px) {\\n}\\n@media (min-width: 768px) {\\n}\\n@media (min-width: 1024px) {\\n}\\n@media (min-width: 1280px) {\\n}\\n@media (min-width: 1536px) {\\n}\\n```\\n---\\n``` js ./dist/es/index.js\\n// src/index.tsx\\nimport { jsx } from \\\"react/jsx-runtime\\\";\\nvar src_default = () => {\\n return /* @__PURE__ */ jsx(\\\"div\\\", {\\n className: \\\"bg-black text-white\\\",\\n children: \\\"hello world11\\\"\\n });\\n};\\nexport {\\n src_default as default\\n};\\n```\\n</CH.Code>\\n\\nIn Bundleless mode, no third-party dependencies are packaged in, and no style products are generated at this time.\\n\\n```js ./dist/es/index.js\\nimport { jsx } from 'react/jsx-runtime';\\nimport 'tailwindcss/utilities.css';\\nvar src_default = () => {\\n return /* @__PURE__ */ jsx('div', {\\n className: 'bg-black text-white',\\n children: 'hello world11',\\n });\\n};\\nexport { src_default as default };\\n```\\n\\n### CSS Modules\\n\\nModule projects support the development of styles using CSS Modules. By default, the following files are recognized as CSS Module files.\\n\\n- `.module.css`\\n- `.module.less`\\n- `.module.scss`\\n- `.module.sass`\\n\\nIf you need to configure CSS Modules, you can check out the API at\\n\\n- [autoModules](en/api/config/build-config#automodules)\\n- [modules](/en/api/config/build-config#modules)\\n\\nThe following is a code example.\\n\\n<CH.Code>\\n\\n```tsx ./src/index.tsx\\nimport style from './index.module.css';\\n\\nexport default () => {\\n return <div className={style.btn}>hello world</div>;\\n};\\n```\\n\\n```css ./src/index.module.css\\n.btn {\\n color: blue;\\n}\\n```\\n\\n</CH.Code>\\n\\n## Configuring build products\\n\\nBased 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\\n\\n```bash\\n.\\n├── dist\\n│ ├── es\\n│ ├── lib\\n│ └── types\\n```\\n\\n- `. /dist/es`: Contains bundleless products in ES modules format that support the es6 syntax.\\n- `. /dist/lib`: Contains bundleless products in CommonJS format with support for es6 syntax.\\n- `. /dist/types`: Contains the types file.\\n\\nThe [`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`.\\n\\n```tsx\\nexport default defineConfig({\\n buildPreset: 'npm-component-es2019',\\n});\\n```\\n\\nIf 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.\\n\\n- [modify-output-product](/en/guide/basic/modify-output-product#build-configuration-object)\\n- [in-depth-about-build](/en/guide/advance/in-depth-about-build)\\n\\n## Testing components\\n\\nFor more information on how to test components, please refer to [[Test project]](/en/guide/basic/test-your-project).\\n\\n## Releasing components\\n\\nIt is recommended to use module project to provide version publishing function, you can refer to [[Versioning and publishing]](/en/guide/basic/publish-your-project).\\n\"";
|
|
1250
|
+
const title = `# Initialize the project`;
|
|
1251
|
+
const content = "\"# Developing Components\\n\\nThis chapter will describe how to develop component projects using the module engineering solution.\\n\\n# # Initialize the project\\n\\n<CH.Spotlight>\\n\\n```bash Interactive questions\\nnpx @modern-js/create components-project\\n\\n? Please select the solution you want to create Module Solution\\n? Package Name components-demo\\n? Development Language TS\\n? Package Management Tool pnpm\\n```\\n\\n---\\n\\nIt is recommended to use the `@modern-js/create` command to initialize an npm project.\\n\\n```bash Interactive questions\\nnpx @modern-js/create components-project\\n\\n? Please select the solution you want to create Module Solution\\n? Package Name components-demo\\n? Development Language TS\\n? Package Management Tool pnpm\\n```\\n\\n---\\n\\nThe initialized directory structure.\\n\\n```bash The initialized directory structure\\n.\\n├── README.md\\n├── node_modules/\\n├── dist/\\n├── modern.config.ts\\n├── package.json\\n├── pnpm-lock.yaml\\n├── src\\n│ ├── index.ts\\n│ └── modern-app-env.d.ts\\n└── tsconfig.json\\n```\\n\\n---\\n\\nModify the `. /src/index.ts` file suffix and content.\\n\\nAt this point, a component project is initialized.\\n\\n```tsx ./src/index.tsx\\nexport default () => {\\n return <div>hello world</div>;\\n};\\n```\\n\\n</CH.Spotlight>\\n\\n## Debugging code with Storybook\\n\\n<CH.Spotlight>\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Visual Testing (Storybook)\\n```\\n\\n---\\n\\nExecute the `new` command in the project root directory to enable the Storybook feature.\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Visual Testing (Storybook)\\n```\\n\\n---\\n\\nOnce 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.\\n\\n<CH.Code>\\n\\n```json ./package.json focus=4:7\\n{\\n \\\"name\\\": \\\"components-demo\\\",\\n \\\"devDependencies\\\": {\\n \\\"@modern-js/plugin-storybook\\\": \\\"x.y.z\\\",\\n \\\"@modern-js/runtime\\\": \\\"x.y.z\\\",\\n \\\"react\\\": \\\"^17\\\",\\n \\\"react-dom\\\": \\\"^17\\\"\\n }\\n}\\n```\\n\\n```bash Directory Structure\\n.\\n├── src\\n│ ├── index.ts\\n│ └── modern-app-env.d.ts\\n├── stories\\n│ ├── .eslintrc.js\\n│ ├── index.stories.tsx\\n│ └── tsconfig.json\\n```\\n\\n</CH.Code>\\n\\n---\\n\\nAfter 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.\\n\\n```json ./stories/tsconfig.json focus=5:7\\n{\\n \\\"extends\\\": \\\"../tsconfig.json\\\",\\n \\\"compilerOptions\\\": {\\n \\\"baseUrl\\\": \\\"../\\\",\\n \\\"paths\\\": {\\n \\\"components-demo\\\": [\\\"./\\\"],\\n \\\"components-demo/*\\\": [\\\"./*\\\"]\\n }\\n },\\n \\\"include\\\": [\\\"**/*\\\"]\\n}\\n```\\n\\n---\\n\\nSuch a configuration allows you to introduce code in Story code directly using the name of the project.\\n\\n<CH.Code>\\n\\n```tsx ./stories/index.stories.tsx\\nimport Component from 'components-demo';\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n---\\n\\n```tsx ./src/index.tsx\\nexport default () => {\\n return <div>hello world</div>;\\n};\\n```\\n\\n</CH.Code>\\n\\n---\\n\\nAt this point Storybook identifies the entry point for the imported code based on fields like `main`, `exports` in the project's `package.json` file.\\nThe location of the type file is determined by the `types` field.\\n\\n```json package.json\\n{\\n \\\"name\\\": \\\"components-demo\\\",\\n \\\"main\\\": \\\"./dist/esm/index.js\\\",\\n \\\"types\\\": \\\"./dist/types/index.d.ts\\\"\\n}\\n```\\n\\n---\\n\\nWhile importing source code for debugging is also supported, debugging using project artifacts is more reliable.\\n\\nDebugging with source code has a limitation: some configurations are not equivalent in Storybook and in the original build support.\\n\\n**This is why debugging with the product is recommended**.\\n\\n```tsx ./stories/index.stories.tsx\\nimport Component from '../src';\\n\\nexport const YourStory = () => <Component />;\\n\\nexport default {\\n title: 'Your Stories',\\n};\\n```\\n\\n</CH.Spotlight>\\n\\n## Developing Styles\\n\\nNext we can add styles to the component.\\n\\nThe following capabilities are currently supported for developing styles.\\n\\n- CSS/PostCSS\\n- Less\\n- Scss/Sass\\n- Tailwind CSS\\n- CSS Modules\\n\\n### CSS/PostCSS\\n\\nThe module project supports PostCSS and has the following built-in postcss plugins.\\n\\n- [flexbugs-fixes](https://github.com/luisrudge/postcss-flexbugs-fixes)\\n- [custom-properties](https://github.com/postcss/postcss-custom-properties)\\n- [initial](https://github.com/maximkoretskiy/postcss-initial)\\n- [page-break](https://github.com/shrpne/postcss-page-break)\\n- [font-variant](https://github.com/postcss/postcss-font-variant)\\n- [media-minmax](https://github.com/postcss/postcss-media-minmax)\\n- [nesting](https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme)\\n\\nSo we can create `.css` files in our projects and use the syntax support and capabilities provided by these plugins directly in our css files.\\n\\n<CH.Spotlight>\\n\\n```css ./src/index.css\\na,\\nb {\\n color: red;\\n\\n /* \\\"&\\\" comes first */\\n & c,\\n & d {\\n color: white;\\n }\\n\\n /* \\\"&\\\" comes later, requiring \\\"@nest\\\" */\\n @nest e & {\\n color: yellow;\\n }\\n}\\n```\\n\\n---\\n\\nSource Code.\\n\\n```css ./src/index.css\\n\\n```\\n\\n---\\n\\ncss product.\\n\\n```css ./dist/es/index.css\\na,\\nb {\\n color: red;\\n}\\na c,\\nb c,\\na d,\\nb d {\\n color: white;\\n}\\ne a,\\ne b {\\n color: yellow;\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n### Less\\n\\nModule projects support development styles using Less.\\n\\n> Currently supported version is 4.1.3\\n\\n<CH.Spotlight>\\n\\n```less ./src/common.less\\n@bg: black;\\n@bg-light: boolean(luma(@bg) > 50%);\\n\\ndiv {\\n background: @bg;\\n color: if(@bg-light, black, white);\\n}\\n```\\n\\n---\\n\\nSource Code.\\n\\n```less ./src/common.less\\n\\n```\\n\\n---\\n\\nLess product.\\n\\n```css ./dist/es/common.css\\ndiv {\\n background: black;\\n color: white;\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n### Sass/Scss\\n\\nModule projects support developing styles using Scss/Sass.\\n\\n> Currently supported version is 1.54.4\\n\\n<CH.Spotlight>\\n\\n```sass ./src/common.sass\\n$font-stack: Helvetica, sans-serif;\\n$primary-color: #333;\\n\\nbody {\\n font: 100% $font-stack;\\n color: $primary-color;\\n}\\n```\\n\\n---\\n\\n源代码。\\n\\n```sass ./src/common.sass\\n\\n```\\n\\n---\\n\\nLess product.\\n\\n```css ./dist/es/common.css\\nbody {\\n font: 100% Helvetica, sans-serif;\\n color: #333;\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n### Tailwind CSS\\n\\nThe module project supports the development of component styles using Tailwind CSS.\\n\\nBy default, this feature is not enabled in the module project, you need to enable it as follows.\\n\\n<CH.Spotlight>\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Visual Testing (Storybook)\\n```\\n\\n---\\n\\nThe Tailwind CSS feature can be enabled by executing the `new` command in the project root directory.\\n\\n```bash Terminal\\npnpm run new\\n\\n? Action Enable features\\n? Enable features Enable Tailwind CSS\\n```\\n\\n---\\n\\nOnce successfully opened, you will see that a new dependency has been added to `package.json`.\\n\\n```json ./package.json\\n{\\n \\\"devDependencies\\\": {\\n \\\"@modern-js/plugin-tailwindcss\\\": \\\"x.y.z\\\"\\n }\\n}\\n```\\n\\n</CH.Spotlight>\\n\\nTailwind CSS offers two ways to use it.\\n\\n#### HTML class\\n\\n<CH.Spotlight>\\n\\n```tsx ./src/index.tsx\\nimport 'tailwindcss/utilities.css';\\n\\nexport default () => {\\n return <div className=\\\"bg-black text-white\\\">hello world</div>;\\n};\\n```\\n\\n---\\n\\nTailwind CSS supports adding styles to HTML tags by using class names.\\n\\n```tsx ./src/index.tsx focus=5:5\\n\\n```\\n\\n---\\n\\n**When using HTML class names, be sure to import the Tailwind CSS equivalent css file. **\\n\\n```tsx ./src/index.tsx focus=1:1\\n\\n```\\n\\n---\\n\\nStyle product.\\n\\n> This is a bundle build.\\n\\n```css ./dist/es/index.css\\n/* ../../node_modules/.pnpm/tailwindcss@2.2.19/node_modules/tailwindcss/utilities.css */\\n.table {\\n display: table;\\n}\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes ping {\\n 75%,\\n 100% {\\n transform: scale(2);\\n opacity: 0;\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: 0.5;\\n }\\n}\\n@keyframes bounce {\\n 0%,\\n 100% {\\n transform: translateY(-25%);\\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\\n }\\n 50% {\\n transform: none;\\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\\n }\\n}\\n.bg-black {\\n --tw-bg-opacity: 1;\\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity));\\n}\\n.text-white {\\n --tw-text-opacity: 1;\\n color: rgba(255, 255, 255, var(--tw-text-opacity));\\n}\\n*,\\n::before,\\n::after {\\n --tw-shadow: 0 0 #0000;\\n}\\n*,\\n::before,\\n::after {\\n --tw-ring-inset: var(--tw-empty);\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-color: rgba(59, 130, 246, 0.5);\\n --tw-ring-offset-shadow: 0 0 #0000;\\n --tw-ring-shadow: 0 0 #0000;\\n}\\n@media (min-width: 640px) {\\n}\\n@media (min-width: 768px) {\\n}\\n@media (min-width: 1024px) {\\n}\\n@media (min-width: 1280px) {\\n}\\n@media (min-width: 1536px) {\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n#### `@apply`\\n\\nTailwind 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.\\n\\n`@apply` can be used in CSS, Less, and Sass.\\n\\n```css\\n.btn {\\n @apply font-bold py-2 px-4 rounded;\\n}\\n```\\n\\nHowever, there are some things to keep in mind when using Less and Sass.\\n\\n##### Sass\\n\\nWhen using Tailwind with Sass, the presence of `!important` after `@apply` requires interpolation to get Sass to compile correctly.\\n\\n<CH.Spotlight>\\n\\n```sass\\n.alert {\\n @apply bg-red-500 !important;\\n}\\n```\\n\\n---\\n\\nIt does not work properly.\\n\\n```sass\\n\\n```\\n\\n---\\n\\nCan work properly.\\n\\n```sass\\n.alert {\\n @apply bg-red-500 #{!important};\\n}\\n```\\n\\n</CH.Spotlight>\\n\\n##### Less\\n\\nWhen using Tailwind with Less, you cannot nest Tailwind's `@screen` directive.\\n\\n<CH.Spotlight>\\n\\n```less\\n.card {\\n @apply rounded-none;\\n\\n @screen sm {\\n @apply rounded-lg;\\n }\\n}\\n```\\n\\n---\\n\\nIt does not work properly.\\n\\n```less\\n\\n```\\n\\n---\\n\\nInstead, use regular media queries and the `theme()` function to reference your screen size, or simply don't nest your `@screen` directive.\\n\\n<CH.Code>\\n\\n```less Method One\\n// Use a regular media query and theme()\\n.card {\\n @apply rounded-none;\\n\\n @media (min-width: theme('screens.sm')) {\\n @apply rounded-lg;\\n }\\n}\\n```\\n\\n---\\n\\n```less Method Two\\n// Use the @screen directive at the top-level\\n.card {\\n @apply rounded-none;\\n\\n @media (min-width: theme('screens.sm')) {\\n @apply rounded-lg;\\n }\\n}\\n```\\n\\n</CH.Code>\\n\\n</CH.Spotlight>\\n\\n#### Recommended method\\n\\n**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. **\\n\\nWhen 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.\\n\\n#### The difference between bundle and bundleless build products\\n\\nFor the following code, there is a big difference between the bundle and bundleless modes of building products.\\n\\n> The so-called bundle and bundleless can be found in [[Bundle and Bundleless]](/en/guide/advance/in-depth-about-build#bundle- and-bundleless)\\n\\n```tsx ./src/index.tsx\\nimport 'tailwindcss/utilities.css';\\n\\nexport default () => {\\n return <div className=\\\"bg-black text-white\\\">hello world11</div>;\\n};\\n```\\n\\nIn Bundle mode, third-party dependencies are packaged in.\\n\\nFor styles, a separate product file is generated, and there is no code related to importing styles in the Js product file.\\n\\nIf you need to inject styles into Js products, you can enable the [`style.inject` API](/en/api/config/build-config#inject).\\n\\n<CH.Code>\\n```css ./dist/es/index.css\\n/* ../../node_modules/.pnpm/tailwindcss@2.2.19/node_modules/tailwindcss/utilities.css */\\n.table {\\n display: table;\\n}\\n@keyframes spin {\\n to {\\n transform: rotate(360deg);\\n }\\n}\\n@keyframes ping {\\n 75%, 100% {\\n transform: scale(2);\\n opacity: 0;\\n }\\n}\\n@keyframes pulse {\\n 50% {\\n opacity: .5;\\n }\\n}\\n@keyframes bounce {\\n 0%, 100% {\\n transform: translateY(-25%);\\n animation-timing-function: cubic-bezier(0.8, 0, 1, 1);\\n }\\n 50% {\\n transform: none;\\n animation-timing-function: cubic-bezier(0, 0, 0.2, 1);\\n }\\n}\\n.bg-black {\\n --tw-bg-opacity: 1;\\n background-color: rgba(0, 0, 0, var(--tw-bg-opacity));\\n}\\n.text-white {\\n --tw-text-opacity: 1;\\n color: rgba(255, 255, 255, var(--tw-text-opacity));\\n}\\n*,\\n::before,\\n::after {\\n --tw-shadow: 0 0 #0000 ;\\n}\\n*,\\n::before,\\n::after {\\n --tw-ring-inset: var(--tw-empty, );\\n --tw-ring-offset-width: 0px;\\n --tw-ring-offset-color: #fff;\\n --tw-ring-color: rgba(59, 130, 246, 0.5);\\n --tw-ring-offset-shadow: 0 0 #0000;\\n --tw-ring-shadow: 0 0 #0000 ;\\n}\\n@media (min-width: 640px) {\\n}\\n@media (min-width: 768px) {\\n}\\n@media (min-width: 1024px) {\\n}\\n@media (min-width: 1280px) {\\n}\\n@media (min-width: 1536px) {\\n}\\n```\\n---\\n``` js ./dist/es/index.js\\n// src/index.tsx\\nimport { jsx } from \\\"react/jsx-runtime\\\";\\nvar src_default = () => {\\n return /* @__PURE__ */ jsx(\\\"div\\\", {\\n className: \\\"bg-black text-white\\\",\\n children: \\\"hello world11\\\"\\n });\\n};\\nexport {\\n src_default as default\\n};\\n```\\n</CH.Code>\\n\\nIn Bundleless mode, no third-party dependencies are packaged in, and no style products are generated at this time.\\n\\n```js ./dist/es/index.js\\nimport { jsx } from 'react/jsx-runtime';\\nimport 'tailwindcss/utilities.css';\\nvar src_default = () => {\\n return /* @__PURE__ */ jsx('div', {\\n className: 'bg-black text-white',\\n children: 'hello world11',\\n });\\n};\\nexport { src_default as default };\\n```\\n\\n### CSS Modules\\n\\nModule projects support the development of styles using CSS Modules. By default, the following files are recognized as CSS Module files.\\n\\n- `.module.css`\\n- `.module.less`\\n- `.module.scss`\\n- `.module.sass`\\n\\nIf you need to configure CSS Modules, you can check out the API at\\n\\n- [autoModules](en/api/config/build-config#automodules)\\n- [modules](/en/api/config/build-config#modules)\\n\\nThe following is a code example.\\n\\n<CH.Code>\\n\\n```tsx ./src/index.tsx\\nimport style from './index.module.css';\\n\\nexport default () => {\\n return <div className={style.btn}>hello world</div>;\\n};\\n```\\n\\n```css ./src/index.module.css\\n.btn {\\n color: blue;\\n}\\n```\\n\\n</CH.Code>\\n\\n## Configuring build products\\n\\nBased 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\\n\\n```bash\\n.\\n├── dist\\n│ ├── es\\n│ ├── lib\\n│ └── types\\n```\\n\\n- `. /dist/es`: Contains bundleless products in ES modules format that support the es6 syntax.\\n- `. /dist/lib`: Contains bundleless products in CommonJS format with support for es6 syntax.\\n- `. /dist/types`: Contains the types file.\\n\\nThe [`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`.\\n\\n```tsx\\nexport default defineConfig({\\n buildPreset: 'npm-component-es2019',\\n});\\n```\\n\\nIf 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.\\n\\n- [modify-output-product](/en/guide/basic/modify-output-product#build-configuration-object)\\n- [in-depth-about-build](/en/guide/advance/in-depth-about-build)\\n\\n## Testing components\\n\\nFor more information on how to test components, please refer to [[Test project]](/en/guide/basic/test-your-project).\\n\\n## Releasing components\\n\\nIt is recommended to use module project to provide version publishing function, you can refer to [[Versioning and publishing]](/en/guide/basic/publish-your-project).\\n\"";
|
|
1252
1252
|
function _createMdxContent(props) {
|
|
1253
|
-
|
|
1253
|
+
const _components = Object.assign({
|
|
1254
1254
|
h1: "h1",
|
|
1255
1255
|
a: "a",
|
|
1256
1256
|
p: "p",
|
|
@@ -4755,36 +4755,50 @@ function _createMdxContent(props) {
|
|
|
4755
4755
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4756
4756
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4757
4757
|
href: "https://github.com/luisrudge/postcss-flexbugs-fixes",
|
|
4758
|
+
target: "_blank",
|
|
4759
|
+
rel: "nofollow",
|
|
4758
4760
|
children: "flexbugs-fixes"
|
|
4759
4761
|
})
|
|
4760
4762
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4761
4763
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4762
4764
|
href: "https://github.com/postcss/postcss-custom-properties",
|
|
4765
|
+
target: "_blank",
|
|
4766
|
+
rel: "nofollow",
|
|
4763
4767
|
children: "custom-properties"
|
|
4764
4768
|
})
|
|
4765
4769
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4766
4770
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4767
4771
|
href: "https://github.com/maximkoretskiy/postcss-initial",
|
|
4772
|
+
target: "_blank",
|
|
4773
|
+
rel: "nofollow",
|
|
4768
4774
|
children: "initial"
|
|
4769
4775
|
})
|
|
4770
4776
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4771
4777
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4772
4778
|
href: "https://github.com/shrpne/postcss-page-break",
|
|
4779
|
+
target: "_blank",
|
|
4780
|
+
rel: "nofollow",
|
|
4773
4781
|
children: "page-break"
|
|
4774
4782
|
})
|
|
4775
4783
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4776
4784
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4777
4785
|
href: "https://github.com/postcss/postcss-font-variant",
|
|
4786
|
+
target: "_blank",
|
|
4787
|
+
rel: "nofollow",
|
|
4778
4788
|
children: "font-variant"
|
|
4779
4789
|
})
|
|
4780
4790
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4781
4791
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4782
4792
|
href: "https://github.com/postcss/postcss-media-minmax",
|
|
4793
|
+
target: "_blank",
|
|
4794
|
+
rel: "nofollow",
|
|
4783
4795
|
children: "media-minmax"
|
|
4784
4796
|
})
|
|
4785
4797
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
4786
4798
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
4787
|
-
href: "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme",
|
|
4799
|
+
href: "https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-nesting#readme-1",
|
|
4800
|
+
target: "_blank",
|
|
4801
|
+
rel: "nofollow",
|
|
4788
4802
|
children: "nesting"
|
|
4789
4803
|
})
|
|
4790
4804
|
}), "\n"]
|
|
@@ -11886,7 +11900,9 @@ function _createMdxContent(props) {
|
|
|
11886
11900
|
})]
|
|
11887
11901
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
11888
11902
|
children: ["Tailwind CSS provides the ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
11889
|
-
href: "https://v2.tailwindcss.com/docs/functions-and-directives#apply",
|
|
11903
|
+
href: "https://v2.tailwindcss.com/docs/functions-and-directives#apply-3",
|
|
11904
|
+
target: "_blank",
|
|
11905
|
+
rel: "nofollow",
|
|
11890
11906
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
11891
11907
|
children: "@apply"
|
|
11892
11908
|
})
|
|
@@ -13554,7 +13570,7 @@ function _createMdxContent(props) {
|
|
|
13554
13570
|
children: "For styles, a separate product file is generated, and there is no code related to importing styles in the Js product file."
|
|
13555
13571
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
13556
13572
|
children: ["If you need to inject styles into Js products, you can enable the ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.a, {
|
|
13557
|
-
href: "/en/api/config/build-config#inject
|
|
13573
|
+
href: "/module-tools/en/api/config/build-config.html#inject-1",
|
|
13558
13574
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
13559
13575
|
children: "style.inject"
|
|
13560
13576
|
}), " API"]
|
|
@@ -20356,12 +20372,12 @@ function _createMdxContent(props) {
|
|
|
20356
20372
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
20357
20373
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
20358
20374
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
20359
|
-
href: "/en/api/config/build-config#automodules
|
|
20375
|
+
href: "/module-tools/en/api/config/build-config.html#automodules-1",
|
|
20360
20376
|
children: "autoModules"
|
|
20361
20377
|
})
|
|
20362
20378
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
20363
20379
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
20364
|
-
href: "/en/api/config/build-config#modules
|
|
20380
|
+
href: "/module-tools/en/api/config/build-config.html#modules-1",
|
|
20365
20381
|
children: "modules"
|
|
20366
20382
|
})
|
|
20367
20383
|
}), "\n"]
|
|
@@ -21163,7 +21179,7 @@ function _createMdxContent(props) {
|
|
|
21163
21179
|
}), "\n"]
|
|
21164
21180
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
21165
21181
|
children: ["The ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
21166
|
-
href: "/en/api/config/build-preset.html",
|
|
21182
|
+
href: "/module-tools/en/api/config/build-preset.html",
|
|
21167
21183
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
21168
21184
|
children: "buildPreset"
|
|
21169
21185
|
})
|
|
@@ -21320,7 +21336,7 @@ function _createMdxContent(props) {
|
|
|
21320
21336
|
}]
|
|
21321
21337
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
21322
21338
|
children: ["If you have special needs for the build product directory structure, you can use the ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.a, {
|
|
21323
|
-
href: "/en/api/config/build-config.html",
|
|
21339
|
+
href: "/module-tools/en/api/config/build-config.html",
|
|
21324
21340
|
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.code, {
|
|
21325
21341
|
children: "buildConfig"
|
|
21326
21342
|
}), " API"]
|
|
@@ -21328,12 +21344,12 @@ function _createMdxContent(props) {
|
|
|
21328
21344
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.ul, {
|
|
21329
21345
|
children: ["\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
21330
21346
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
21331
|
-
href: "/en/guide/basic/modify-output-product#build-configuration-object
|
|
21347
|
+
href: "/module-tools/en/guide/basic/modify-output-product.html#build-configuration-object",
|
|
21332
21348
|
children: "modify-output-product"
|
|
21333
21349
|
})
|
|
21334
21350
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.li, {
|
|
21335
21351
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
21336
|
-
href: "/en/guide/advance/in-depth-about-build.html",
|
|
21352
|
+
href: "/module-tools/en/guide/advance/in-depth-about-build.html",
|
|
21337
21353
|
children: "in-depth-about-build"
|
|
21338
21354
|
})
|
|
21339
21355
|
}), "\n"]
|
|
@@ -21347,7 +21363,7 @@ function _createMdxContent(props) {
|
|
|
21347
21363
|
}), "Testing components"]
|
|
21348
21364
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
21349
21365
|
children: ["For more information on how to test components, please refer to ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
21350
|
-
href: "/en/guide/basic/test-your-project.html",
|
|
21366
|
+
href: "/module-tools/en/guide/basic/test-your-project.html",
|
|
21351
21367
|
children: "[Test project]"
|
|
21352
21368
|
}), "."]
|
|
21353
21369
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h2, {
|
|
@@ -21360,27 +21376,23 @@ function _createMdxContent(props) {
|
|
|
21360
21376
|
}), "Releasing components"]
|
|
21361
21377
|
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.p, {
|
|
21362
21378
|
children: ["It is recommended to use module project to provide version publishing function, you can refer to ", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
21363
|
-
href: "/en/guide/basic/publish-your-project.html",
|
|
21379
|
+
href: "/module-tools/en/guide/basic/publish-your-project.html",
|
|
21364
21380
|
children: "[Versioning and publishing]"
|
|
21365
21381
|
}), "."]
|
|
21366
21382
|
})]
|
|
21367
21383
|
});
|
|
21368
21384
|
}
|
|
21369
|
-
function MDXContent() {
|
|
21370
|
-
|
|
21371
|
-
var _ref = props.components || {},
|
|
21372
|
-
MDXLayout = _ref.wrapper;
|
|
21385
|
+
function MDXContent(props = {}) {
|
|
21386
|
+
const {wrapper: MDXLayout} = props.components || ({});
|
|
21373
21387
|
return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
|
|
21374
21388
|
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
|
|
21375
21389
|
})) : _createMdxContent(props);
|
|
21376
21390
|
}
|
|
21377
|
-
_c = MDXContent;
|
|
21378
21391
|
/* harmony default export */ __webpack_exports__["default"] = (MDXContent);
|
|
21379
21392
|
function _missingMdxReference(id, component, place) {
|
|
21380
|
-
throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/
|
|
21393
|
+
throw new Error("Expected " + (component ? "component" : "object") + " `" + id + "` to be defined: you likely forgot to import, pass, or provide it." + (place ? "\nIt’s referenced in your code at `" + place + "` in `/Users/targeral/github/targeral-modern-js/website/module-tools/docs/en/guide/best-practices/components.mdx`" : ""));
|
|
21381
21394
|
}
|
|
21382
|
-
|
|
21383
|
-
__webpack_require__.$Refresh$.register(_c, "MDXContent");
|
|
21395
|
+
|
|
21384
21396
|
|
|
21385
21397
|
/***/ })
|
|
21386
21398
|
|