@modern-js/module-tools-docs 2.0.0-beta.4 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +13 -0
- package/doc_build/html/main/index.html +16 -0
- package/doc_build/route.json +10 -0
- package/doc_build/static/css/main.css +3370 -0
- package/doc_build/static/css/main.css.map +1 -0
- package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css +85 -0
- package/doc_build/static/css/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.css.map +1 -0
- package/doc_build/static/js/async/api_.js +56 -0
- package/doc_build/static/js/async/api_.js.map +1 -0
- package/doc_build/static/js/async/api_config_build-config.js +11309 -0
- package/doc_build/static/js/async/api_config_build-config.js.map +1 -0
- package/doc_build/static/js/async/api_config_build-preset.js +7849 -0
- package/doc_build/static/js/async/api_config_build-preset.js.map +1 -0
- package/doc_build/static/js/async/api_config_design-system.js +48708 -0
- package/doc_build/static/js/async/api_config_design-system.js.map +1 -0
- package/doc_build/static/js/async/api_config_plugins.js +1492 -0
- package/doc_build/static/js/async/api_config_plugins.js.map +1 -0
- package/doc_build/static/js/async/api_config_testing.js +2130 -0
- package/doc_build/static/js/async/api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js +14394 -0
- package/doc_build/static/js/async/api_plugin-api_plugin-hooks.js.map +1 -0
- package/doc_build/static/js/async/en_.js +85 -0
- package/doc_build/static/js/async/en_.js.map +1 -0
- package/doc_build/static/js/async/en_api_.js +55 -0
- package/doc_build/static/js/async/en_api_.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_build-config.js +8363 -0
- package/doc_build/static/js/async/en_api_config_build-config.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_build-preset.js +7845 -0
- package/doc_build/static/js/async/en_api_config_build-preset.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_design-system.js +16345 -0
- package/doc_build/static/js/async/en_api_config_design-system.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_plugins.js +1492 -0
- package/doc_build/static/js/async/en_api_config_plugins.js.map +1 -0
- package/doc_build/static/js/async/en_api_config_testing.js +2137 -0
- package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js +14362 -0
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_asset.js +3997 -0
- package/doc_build/static/js/async/en_guide_advance_asset.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_build-umd.js +9861 -0
- package/doc_build/static/js/async/en_guide_advance_build-umd.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_copy.js +6539 -0
- package/doc_build/static/js/async/en_guide_advance_copy.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js +3810 -0
- package/doc_build/static/js/async/en_guide_advance_external-dependency.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js +5046 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js +150 -0
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/en_guide_advance_theme-config.js +2484 -0
- package/doc_build/static/js/async/en_guide_advance_theme-config.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js +3671 -0
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_command-preview.js +3961 -0
- package/doc_build/static/js/async/en_guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js +2970 -0
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js +2182 -0
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js +3892 -0
- package/doc_build/static/js/async/en_guide_basic_test-your-project.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js +168 -0
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js +4762 -0
- package/doc_build/static/js/async/en_guide_basic_using-storybook.js.map +1 -0
- package/doc_build/static/js/async/en_guide_best-practices_components.js +21388 -0
- package/doc_build/static/js/async/en_guide_best-practices_components.js.map +1 -0
- package/doc_build/static/js/async/en_guide_intro_getting-started.js +1906 -0
- package/doc_build/static/js/async/en_guide_intro_getting-started.js.map +1 -0
- package/doc_build/static/js/async/en_guide_intro_welcome.js +148 -0
- package/doc_build/static/js/async/en_guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js +92 -0
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2560 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js +4177 -0
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js +3819 -0
- package/doc_build/static/js/async/en_plugins_guide_setup-function.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.js +70 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_asset.js +3997 -0
- package/doc_build/static/js/async/guide_advance_asset.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_build-umd.js +9863 -0
- package/doc_build/static/js/async/guide_advance_build-umd.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_copy.js +6539 -0
- package/doc_build/static/js/async/guide_advance_copy.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_external-dependency.js +3812 -0
- package/doc_build/static/js/async/guide_advance_external-dependency.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-build.js +5046 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-build.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js +152 -0
- package/doc_build/static/js/async/guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/guide_advance_theme-config.js +2475 -0
- package/doc_build/static/js/async/guide_advance_theme-config.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_before-getting-started.js +3662 -0
- package/doc_build/static/js/async/guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_command-preview.js +3793 -0
- package/doc_build/static/js/async/guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_modify-output-product.js +2949 -0
- package/doc_build/static/js/async/guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_publish-your-project.js +2243 -0
- package/doc_build/static/js/async/guide_basic_publish-your-project.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_test-your-project.js +3892 -0
- package/doc_build/static/js/async/guide_basic_test-your-project.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js +172 -0
- package/doc_build/static/js/async/guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/guide_basic_using-storybook.js +4762 -0
- package/doc_build/static/js/async/guide_basic_using-storybook.js.map +1 -0
- package/doc_build/static/js/async/guide_best-practices_components.js +21088 -0
- package/doc_build/static/js/async/guide_best-practices_components.js.map +1 -0
- package/doc_build/static/js/async/guide_intro_getting-started.js +1782 -0
- package/doc_build/static/js/async/guide_intro_getting-started.js.map +1 -0
- package/doc_build/static/js/async/guide_intro_welcome.js +148 -0
- package/doc_build/static/js/async/guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js +92 -0
- package/doc_build/static/js/async/guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/index.js +85 -0
- package/doc_build/static/js/async/index.js.map +1 -0
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +447 -0
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map +1 -0
- package/doc_build/static/js/async/plugins_guide_getting-started.js +2608 -0
- package/doc_build/static/js/async/plugins_guide_getting-started.js.map +1 -0
- package/doc_build/static/js/async/plugins_guide_plugin-object.js +4173 -0
- package/doc_build/static/js/async/plugins_guide_plugin-object.js.map +1 -0
- package/doc_build/static/js/async/plugins_guide_setup-function.js +3819 -0
- package/doc_build/static/js/async/plugins_guide_setup-function.js.map +1 -0
- package/doc_build/static/js/async/plugins_official-list_overview.js +70 -0
- package/doc_build/static/js/async/plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/async/vendors-node_modules_pnpm_code-hike_mdx_0_7_4_react_18_2_0_node_modules_code-hike_mdx_dist_co-06dd41.js +6656 -0
- package/doc_build/static/js/async/vendors-node_modules_pnpm_code-hike_mdx_0_7_4_react_18_2_0_node_modules_code-hike_mdx_dist_co-06dd41.js.map +1 -0
- package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js +54 -0
- package/doc_build/static/js/async/vendors-node_modules_pnpm_flexsearch_0_6_32_node_modules_flexsearch_dist_flexsearch_min_js.js.map +1 -0
- package/doc_build/static/js/builder-runtime.js +1375 -0
- package/doc_build/static/js/builder-runtime.js.map +1 -0
- package/doc_build/static/js/lib-lodash.js +4907 -0
- package/doc_build/static/js/lib-lodash.js.map +1 -0
- package/doc_build/static/js/lib-polyfill.js +24769 -0
- package/doc_build/static/js/lib-polyfill.js.map +1 -0
- package/doc_build/static/js/lib-react.js +39510 -0
- package/doc_build/static/js/lib-react.js.map +1 -0
- package/doc_build/static/js/main.js +9237 -0
- package/doc_build/static/js/main.js.map +1 -0
- package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js +8532 -0
- package/doc_build/static/js/vendors-node_modules_pnpm_remix-run_router_1_2_0_node_modules_remix-run_router_dist_router_js-9d5e9c.js.map +1 -0
- package/docs/en/api/config/_category_.json +4 -0
- package/docs/en/api/{build-config.md → config/build-config.md} +201 -108
- package/docs/en/api/{build-preset.md → config/build-preset.md} +65 -46
- package/docs/{zh/api → en/api/config}/design-system.md +130 -127
- package/docs/en/api/config/plugins.md +18 -0
- package/docs/en/api/{test.md → config/testing.md} +21 -12
- package/docs/en/api/index.md +3 -1
- package/docs/en/api/plugin-api/_category_.json +4 -0
- package/docs/en/api/plugin-api/plugin-hooks.md +501 -0
- package/docs/en/guide/advance/_category_.json +4 -0
- package/docs/en/guide/advance/asset.mdx +48 -31
- package/docs/en/guide/advance/build-umd.mdx +91 -83
- package/docs/en/guide/advance/copy.md +33 -30
- package/docs/en/guide/advance/external-dependency.mdx +27 -23
- package/docs/en/guide/advance/in-depth-about-build.md +61 -55
- package/docs/en/guide/advance/in-depth-about-dev-command.md +7 -4
- package/docs/en/guide/advance/theme-config.mdx +80 -0
- package/docs/en/guide/basic/_category_.json +4 -0
- package/docs/en/guide/basic/before-getting-started.md +29 -24
- package/docs/en/guide/basic/command-preview.md +20 -16
- package/docs/en/guide/basic/modify-output-product.md +45 -37
- package/docs/en/guide/basic/publish-your-project.md +21 -19
- package/docs/en/guide/basic/test-your-project.mdx +23 -18
- package/docs/en/guide/basic/use-micro-generator.md +15 -8
- package/docs/en/guide/basic/using-storybook.mdx +29 -26
- package/docs/en/guide/best-practices/_category_.json +4 -0
- package/docs/en/guide/best-practices/components.mdx +789 -0
- package/docs/en/guide/intro/_category_.json +4 -0
- package/docs/en/guide/intro/getting-started.md +11 -6
- package/docs/en/guide/intro/welcome.md +4 -0
- package/docs/en/guide/intro/why-module-engineering-solution.md +5 -1
- package/docs/en/index.md +15 -20
- package/docs/en/plugins/guide/_category_.json +4 -0
- package/docs/en/plugins/guide/getting-started.mdx +84 -0
- package/docs/en/plugins/guide/plugin-object.mdx +85 -0
- package/docs/en/plugins/guide/setup-function.mdx +117 -0
- package/docs/en/plugins/official-list/_category_.json +4 -0
- package/docs/en/plugins/official-list/overview.md +6 -0
- package/docs/zh/api/config/_category_.json +4 -0
- package/docs/zh/api/config/build-config.md +669 -0
- package/docs/zh/api/{build-preset.md → config/build-preset.md} +49 -36
- package/docs/zh/api/config/design-system.md +1166 -0
- package/docs/zh/api/config/plugins.md +18 -0
- package/docs/zh/api/{testing.md → config/testing.md} +18 -13
- package/docs/zh/api/index.md +5 -1
- package/docs/zh/api/plugin-api/_category_.json +4 -0
- package/docs/zh/api/plugin-api/plugin-hooks.md +501 -0
- package/docs/zh/guide/advance/_category_.json +4 -0
- package/docs/zh/guide/advance/asset.mdx +48 -31
- package/docs/zh/guide/advance/build-umd.mdx +91 -74
- package/docs/zh/guide/advance/copy.md +33 -30
- package/docs/zh/guide/advance/external-dependency.mdx +28 -24
- package/docs/zh/guide/advance/in-depth-about-build.md +60 -55
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +7 -4
- package/docs/zh/guide/advance/theme-config.mdx +78 -0
- package/docs/zh/guide/basic/_category_.json +4 -0
- package/docs/zh/guide/basic/before-getting-started.md +28 -23
- package/docs/zh/guide/basic/command-preview.md +19 -15
- package/docs/zh/guide/basic/modify-output-product.md +45 -38
- package/docs/zh/guide/basic/publish-your-project.md +22 -17
- package/docs/zh/guide/basic/test-your-project.mdx +24 -18
- package/docs/zh/guide/basic/use-micro-generator.md +12 -9
- package/docs/zh/guide/basic/using-storybook.mdx +29 -24
- package/docs/zh/guide/best-practices/_category_.json +4 -0
- package/docs/zh/guide/best-practices/components.mdx +793 -0
- package/docs/zh/guide/intro/_category_.json +4 -0
- package/docs/zh/guide/intro/getting-started.md +12 -6
- package/docs/zh/guide/intro/welcome.md +4 -0
- package/docs/zh/guide/intro/why-module-engineering-solution.md +5 -1
- package/docs/zh/index.md +3 -2
- package/docs/zh/plugins/guide/_category_.json +4 -0
- package/docs/zh/plugins/guide/getting-started.mdx +84 -0
- package/docs/zh/plugins/guide/plugin-object.mdx +85 -0
- package/docs/zh/plugins/guide/setup-function.mdx +117 -0
- package/docs/zh/plugins/official-list/_category_.json +4 -0
- package/docs/zh/plugins/official-list/overview.md +5 -0
- package/modern.config.ts +119 -0
- package/package.json +8 -6
- package/{docs/.island/styles → theme}/index.css +0 -1
- package/theme/index.ts +4 -0
- package/tsconfig.json +7 -0
- package/docs/.island/config.ts +0 -245
- package/docs/.island/dist/404.html +0 -41
- package/docs/.island/dist/assets/before-getting-started.1b82b538.js +0 -87
- package/docs/.island/dist/assets/before-getting-started.582a31cc.js +0 -87
- package/docs/.island/dist/assets/build-config.72eb0918.js +0 -804
- package/docs/.island/dist/assets/build-config.d8bb1658.js +0 -809
- package/docs/.island/dist/assets/build-preset.96805d7d.js +0 -256
- package/docs/.island/dist/assets/build-preset.c20dcd40.js +0 -256
- package/docs/.island/dist/assets/build-your-ui.7f349247.js +0 -2
- package/docs/.island/dist/assets/build-your-ui.a8361604.js +0 -2
- package/docs/.island/dist/assets/command-preview.2d45fc82.js +0 -264
- package/docs/.island/dist/assets/command-preview.dc51b953.js +0 -264
- package/docs/.island/dist/assets/components.esm.03560353.js +0 -9
- package/docs/.island/dist/assets/design-system.86694ff5.js +0 -1254
- package/docs/.island/dist/assets/design-system.c4745cce.js +0 -639
- package/docs/.island/dist/assets/dev.1d326a37.js +0 -37
- package/docs/.island/dist/assets/dev.1fd06000.js +0 -37
- package/docs/.island/dist/assets/down.f35427d3.svg +0 -1
- package/docs/.island/dist/assets/extension.12299fd6.js +0 -2
- package/docs/.island/dist/assets/extension.96dc63a4.js +0 -2
- package/docs/.island/dist/assets/getting-started.40e9218d.js +0 -117
- package/docs/.island/dist/assets/getting-started.b1ed3f10.js +0 -114
- package/docs/.island/dist/assets/github.3bf8ccee.svg +0 -1
- package/docs/.island/dist/assets/index.2b2347ea.js +0 -33
- package/docs/.island/dist/assets/index.6cef6f5f.js +0 -4
- package/docs/.island/dist/assets/index.cb118238.js +0 -36
- package/docs/.island/dist/assets/index.ccb6ce27.js +0 -4
- package/docs/.island/dist/assets/island_inject.11a12ecc.js +0 -1
- package/docs/.island/dist/assets/island_inject.b13deaee.js +0 -1
- package/docs/.island/dist/assets/loading.8c9bb911.svg +0 -1
- package/docs/.island/dist/assets/modify-output-product.7f6bff35.js +0 -100
- package/docs/.island/dist/assets/modify-output-product.b91eff1f.js +0 -100
- package/docs/.island/dist/assets/moon.6b705924.svg +0 -3
- package/docs/.island/dist/assets/plugin.895932d8.js +0 -42
- package/docs/.island/dist/assets/plugin.d2fbc531.js +0 -42
- package/docs/.island/dist/assets/publish-your-project.21b8309f.js +0 -164
- package/docs/.island/dist/assets/publish-your-project.8d398b17.js +0 -166
- package/docs/.island/dist/assets/right.89674cd7.svg +0 -1
- package/docs/.island/dist/assets/search.0aea6901.svg +0 -1
- package/docs/.island/dist/assets/search.1c85d17c.js +0 -3
- package/docs/.island/dist/assets/search.484eca11.js +0 -222
- package/docs/.island/dist/assets/search.54fca8d0.js +0 -3
- package/docs/.island/dist/assets/style.09015a4b.css +0 -1
- package/docs/.island/dist/assets/style.2e5f7bc2.css +0 -1970
- package/docs/.island/dist/assets/sun.841dac10.svg +0 -11
- package/docs/.island/dist/assets/test-your-project.18bd4582.js +0 -190
- package/docs/.island/dist/assets/test-your-project.f53bebf7.js +0 -190
- package/docs/.island/dist/assets/test.0da1f99f.js +0 -67
- package/docs/.island/dist/assets/test.0e81f002.js +0 -66
- package/docs/.island/dist/assets/translator.b1077c44.svg +0 -1
- package/docs/.island/dist/assets/use-micro-generator.7d9e4016.js +0 -60
- package/docs/.island/dist/assets/use-micro-generator.db5520c1.js +0 -60
- package/docs/.island/dist/assets/using-storybook.57ea6b77.js +0 -260
- package/docs/.island/dist/assets/using-storybook.a2212f2e.js +0 -260
- package/docs/.island/dist/assets/welcome.0449a9c8.js +0 -13
- package/docs/.island/dist/assets/welcome.a8448931.js +0 -13
- package/docs/.island/dist/assets/why-module-engineering-solution.6ae8c0e3.js +0 -26
- package/docs/.island/dist/assets/why-module-engineering-solution.c9a45cbd.js +0 -26
- package/docs/.island/dist/chunk-COLCRJ2V.js +0 -1
- package/docs/.island/dist/chunk-K5FMOYDC.js +0 -10
- package/docs/.island/dist/chunk-WE42KMYS.js +0 -26
- package/docs/.island/dist/client-entry.js +0 -3
- package/docs/.island/dist/en/api/build-config.html +0 -344
- package/docs/.island/dist/en/api/build-preset.html +0 -82
- package/docs/.island/dist/en/api/design-system.html +0 -155
- package/docs/.island/dist/en/api/dev.html +0 -45
- package/docs/.island/dist/en/api/index.html +0 -41
- package/docs/.island/dist/en/api/plugin.html +0 -48
- package/docs/.island/dist/en/api/test.html +0 -58
- package/docs/.island/dist/en/guide/before-getting-started.html +0 -127
- package/docs/.island/dist/en/guide/build-your-ui.html +0 -41
- package/docs/.island/dist/en/guide/command-preview.html +0 -100
- package/docs/.island/dist/en/guide/extension.html +0 -41
- package/docs/.island/dist/en/guide/getting-started.html +0 -76
- package/docs/.island/dist/en/guide/modify-output-product.html +0 -140
- package/docs/.island/dist/en/guide/publish-your-project.html +0 -91
- package/docs/.island/dist/en/guide/test-your-project.html +0 -72
- package/docs/.island/dist/en/guide/use-micro-generator.html +0 -65
- package/docs/.island/dist/en/guide/using-storybook.html +0 -113
- package/docs/.island/dist/en/guide/welcome.html +0 -53
- package/docs/.island/dist/en/guide/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/en/index.html +0 -42
- package/docs/.island/dist/react-dom.js +0 -1
- package/docs/.island/dist/react-dom_client.js +0 -1
- package/docs/.island/dist/react.js +0 -1
- package/docs/.island/dist/react_jsx-runtime.js +0 -10
- package/docs/.island/dist/ssr-manifest.json +0 -57
- 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 +0 -347
- package/docs/.island/dist/zh/api/build-preset.html +0 -82
- package/docs/.island/dist/zh/api/design-system.html +0 -149
- package/docs/.island/dist/zh/api/dev.html +0 -46
- package/docs/.island/dist/zh/api/index.html +0 -41
- package/docs/.island/dist/zh/api/plugin.html +0 -48
- package/docs/.island/dist/zh/api/test.html +0 -59
- package/docs/.island/dist/zh/guide/before-getting-started.html +0 -127
- package/docs/.island/dist/zh/guide/build-your-ui.html +0 -41
- package/docs/.island/dist/zh/guide/command-preview.html +0 -100
- package/docs/.island/dist/zh/guide/extension.html +0 -41
- package/docs/.island/dist/zh/guide/getting-started.html +0 -79
- package/docs/.island/dist/zh/guide/modify-output-product.html +0 -140
- package/docs/.island/dist/zh/guide/publish-your-project.html +0 -92
- package/docs/.island/dist/zh/guide/test-your-project.html +0 -72
- package/docs/.island/dist/zh/guide/use-micro-generator.html +0 -65
- package/docs/.island/dist/zh/guide/using-storybook.html +0 -114
- package/docs/.island/dist/zh/guide/welcome.html +0 -53
- package/docs/.island/dist/zh/guide/why-module-engineering-solution.html +0 -49
- package/docs/.island/dist/zh/index.html +0 -42
- package/docs/.island/index.html +0 -39
- package/docs/en/api/design-system.md +0 -524
- package/docs/en/api/dev.md +0 -32
- package/docs/en/api/plugin.md +0 -34
- package/docs/zh/api/build-config.md +0 -570
- package/docs/zh/api/dev.md +0 -33
- package/docs/zh/api/plugins.md +0 -108
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# In-depth understanding of build
|
|
2
6
|
|
|
3
7
|
In the [Basic Usage] section, we already knew that you can modify the output product of a project through the `buildConfig` configuration. `buildConfig` not only describes some of the features of the product, but also provides some functionality for building the product.
|
|
@@ -5,8 +9,8 @@ In the [Basic Usage] section, we already knew that you can modify the output pro
|
|
|
5
9
|
:::tip{title=notes}
|
|
6
10
|
If you are not sure what `buildConfig` is, it is recommended to take some time to understand it by following this link.
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
:::
|
|
12
|
+
- [[modify-output-product](/en/guide/basic/modify-output-product)]
|
|
13
|
+
:::
|
|
10
14
|
|
|
11
15
|
In this chapter we'll dive into the use of certain build configurations and understand what happens when the `modern build` command is executed.
|
|
12
16
|
|
|
@@ -20,15 +24,15 @@ A Bundle is a package of build products, which may be a single file or multiple
|
|
|
20
24
|
|
|
21
25
|
Bundleless, on the other hand, means that each source file is compiled and built separately, but not packaged together. Each product file can be found with its corresponding source code file. The process of **Bundleless build can also be understood as the process of code conversion of source files only**.
|
|
22
26
|
|
|
23
|
-
In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/build-config#buildtype).
|
|
27
|
+
In `buildConfig` you can specify whether the current build task is Bundle or Bundleless by using [`buildConfig.buildType`](/en/api/config/build-config#buildtype).
|
|
24
28
|
|
|
25
29
|
### Relationship between `input` and `sourceDir`
|
|
26
30
|
|
|
27
|
-
[`buildConfig.input`](/en/api/build-config#input) is used to specify the file path or directory path where the source code is read, and its default value differs between Bundle and Bundleless builds.
|
|
31
|
+
[`buildConfig.input`](/en/api/config/build-config#input) is used to specify the file path or directory path where the source code is read, and its default value differs between Bundle and Bundleless builds.
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
> In fact, at `buildType: 'bundle'`, the build tool detects the existence of a file matching the name rule `src/index.(j|t)sx?` and uses it as an entry file.
|
|
33
|
+
- When `buildType: 'bundle'`, `input` defaults to `['src/index.ts']`
|
|
34
|
+
- When `buildType: 'bundleless'`, `input` defaults to `['src']`
|
|
35
|
+
> In fact, at `buildType: 'bundle'`, the build tool detects the existence of a file matching the name rule `src/index.(j|t)sx?` and uses it as an entry file.
|
|
32
36
|
|
|
33
37
|
:::warn{title=notes}
|
|
34
38
|
It is recommended that you do not specify multiple source file directories during a Bundleless build, as unintended results may occur. Bundleless builds with multiple source directories are currently in an unstable stage.
|
|
@@ -40,16 +44,16 @@ We know from the defaults: **Bundle builds can generally specify a file path as
|
|
|
40
44
|
|
|
41
45
|
In addition to setting `input` to an array, you can also set it to an object during the Bundle build process. **By using the object form, we can modify the name of the file that the build product outputs**. So for the following example, `. /src/index.ts` corresponds to the path of the build product file as `. /dist/main.js`.
|
|
42
46
|
|
|
43
|
-
```
|
|
47
|
+
```tsx modern.config.ts
|
|
44
48
|
import { defineConfig } from '@modern-js/module-tools';
|
|
45
49
|
|
|
46
50
|
export default defineConfig({
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
outdir: './dist',
|
|
51
|
+
buildConfig: {
|
|
52
|
+
input: {
|
|
53
|
+
main: ['./src/index.ts'],
|
|
52
54
|
},
|
|
55
|
+
outDir: './dist',
|
|
56
|
+
},
|
|
53
57
|
});
|
|
54
58
|
```
|
|
55
59
|
|
|
@@ -57,19 +61,19 @@ The Bundleless build process also supports such use, but it is not recommended.
|
|
|
57
61
|
|
|
58
62
|
#### `sourceDir`
|
|
59
63
|
|
|
60
|
-
[`sourceDir`](/en/api/build-config#sourcedir) is used to specify the source code directory, which is related to both.
|
|
64
|
+
[`sourceDir`](/en/api/config/build-config#sourcedir) is used to specify the source code directory, which is related to both.
|
|
61
65
|
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
- type file generation
|
|
67
|
+
- [`outbase`](https://esbuild.github.io/api/#outbase) for specifying the build process
|
|
64
68
|
|
|
65
69
|
In general:
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
- **During the Bundleless build process, the values of `sourceDir` and `input` should be the same, and their default values are both `src`**.
|
|
72
|
+
- It is rarely necessary to use `sourceDir` during the Bundle build process.
|
|
69
73
|
|
|
70
74
|
### Declaration Type Files
|
|
71
75
|
|
|
72
|
-
The [`buildConfig.dts`](/en/api/build-config#dts) configuration is mainly used for type file generation.
|
|
76
|
+
The [`buildConfig.dts`](/en/api/config/build-config#dts) configuration is mainly used for type file generation.
|
|
73
77
|
|
|
74
78
|
#### Turn off type generation
|
|
75
79
|
|
|
@@ -80,8 +84,8 @@ import { defineConfig } from '@modern-js/module-tools';
|
|
|
80
84
|
|
|
81
85
|
export default defineConfig({
|
|
82
86
|
buildConfig: {
|
|
83
|
-
dts: false
|
|
84
|
-
}
|
|
87
|
+
dts: false,
|
|
88
|
+
},
|
|
85
89
|
});
|
|
86
90
|
```
|
|
87
91
|
|
|
@@ -95,8 +99,8 @@ With `buildType: 'bundleless'`, type files are generated using the project's `ts
|
|
|
95
99
|
|
|
96
100
|
The **module engineering solution also supports packaging of type files**, although care needs to be taken when using this feature.
|
|
97
101
|
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
- Some third-party dependencies have incorrect syntax that can cause the packaging process to fail. So in this case, you need to exclude such third-party packages manually with [`buildConfig.externals`](/en/api/config/build-config#externals).
|
|
103
|
+
- It is not possible to handle the case where the type file of a third-party dependency points to a `.ts` file. For example, the `package.json` of a third-party dependency contains something like this: `{"types": ". /src/index.ts"}`.
|
|
100
104
|
|
|
101
105
|
#### Alias Conversion
|
|
102
106
|
|
|
@@ -108,18 +112,18 @@ import utils from '@common/utils';
|
|
|
108
112
|
|
|
109
113
|
Normally, product type files generated with `tsc` will also contain these aliases. However, Module Tools will convert the aliases in the type file generated by `tsc` to:
|
|
110
114
|
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
- Alias conversion is possible for code of the form `import '@common/utils'` or `import utils from '@common/utils'`.
|
|
116
|
+
- Aliasing is possible for code of the form `export { utils } from '@common/utils'`.
|
|
113
117
|
|
|
114
118
|
However, there are some cases that cannot be handled at this time.
|
|
115
119
|
|
|
116
|
-
|
|
120
|
+
- Output types of the form `Promise<import('@common/utils')>` cannot be converted at this time.
|
|
117
121
|
|
|
118
122
|
#### Some examples of the use of `dts`
|
|
119
123
|
|
|
120
124
|
General usage:
|
|
121
125
|
|
|
122
|
-
```
|
|
126
|
+
```ts
|
|
123
127
|
import { defineConfig } from '@modern-js/module-tools';
|
|
124
128
|
|
|
125
129
|
export default defineConfig({
|
|
@@ -130,13 +134,14 @@ export default defineConfig({
|
|
|
130
134
|
tsconfigPath: './other-tsconfig.json',
|
|
131
135
|
distPath: './types',
|
|
132
136
|
},
|
|
133
|
-
|
|
134
|
-
}
|
|
137
|
+
outDir: './dist',
|
|
138
|
+
},
|
|
135
139
|
});
|
|
136
140
|
```
|
|
141
|
+
|
|
137
142
|
For the use of `dts.only`:
|
|
138
143
|
|
|
139
|
-
```
|
|
144
|
+
```ts
|
|
140
145
|
import { defineConfig } from '@modern-js/module-tools';
|
|
141
146
|
|
|
142
147
|
export default defineConfig({
|
|
@@ -145,33 +150,33 @@ export default defineConfig({
|
|
|
145
150
|
{
|
|
146
151
|
buildType: 'bundle',
|
|
147
152
|
dts: false,
|
|
148
|
-
|
|
153
|
+
outDir: './dist',
|
|
149
154
|
},
|
|
150
155
|
{
|
|
151
156
|
buildType: 'bundleless',
|
|
152
157
|
dts: {
|
|
153
158
|
only: true,
|
|
154
159
|
},
|
|
155
|
-
|
|
156
|
-
}
|
|
157
|
-
]
|
|
160
|
+
outDir: './dist/types',
|
|
161
|
+
},
|
|
162
|
+
],
|
|
158
163
|
});
|
|
159
164
|
```
|
|
160
165
|
|
|
161
166
|
### `buildConfig.define` Usage for different scenarios
|
|
162
167
|
|
|
163
|
-
[`buildConfig.define`](/en/api/build-config#define) functions somewhat similar to [`webpack.DefinePlugin`](https://webpack.js.org/plugins/define-plugin/). A few usage scenarios are described here.
|
|
168
|
+
[`buildConfig.define`](/en/api/config/build-config#define) functions somewhat similar to [`webpack.DefinePlugin`](https://webpack.js.org/plugins/define-plugin/). A few usage scenarios are described here.
|
|
164
169
|
|
|
165
170
|
#### Environment variable replacement
|
|
166
171
|
|
|
167
|
-
```
|
|
172
|
+
```ts
|
|
168
173
|
import { defineConfig } from '@modern-js/module-tools';
|
|
169
174
|
export default defineConfig({
|
|
170
175
|
buildConfig: {
|
|
171
176
|
define: {
|
|
172
|
-
'process.env.VERSION': JSON.stringify(process.env.VERSION || '0.0.0')
|
|
173
|
-
}
|
|
174
|
-
}
|
|
177
|
+
'process.env.VERSION': JSON.stringify(process.env.VERSION || '0.0.0'),
|
|
178
|
+
},
|
|
179
|
+
},
|
|
175
180
|
});
|
|
176
181
|
```
|
|
177
182
|
|
|
@@ -182,7 +187,7 @@ With the above configuration, we can put the following code.
|
|
|
182
187
|
console.log(process.env.VERSION);
|
|
183
188
|
```
|
|
184
189
|
|
|
185
|
-
When executing
|
|
190
|
+
When executing `VERSION=1.0.0 modern build`, the conversion is:
|
|
186
191
|
|
|
187
192
|
```
|
|
188
193
|
// compiled code
|
|
@@ -191,14 +196,14 @@ console.log('1.0.0');
|
|
|
191
196
|
|
|
192
197
|
#### Global variable replacement
|
|
193
198
|
|
|
194
|
-
```
|
|
199
|
+
```ts
|
|
195
200
|
import { defineConfig } from '@modern-js/module-tools';
|
|
196
201
|
export default defineConfig({
|
|
197
202
|
buildConfig: {
|
|
198
203
|
define: {
|
|
199
|
-
|
|
200
|
-
}
|
|
201
|
-
}
|
|
204
|
+
VERSION: JSON.stringify(require('. /package.json').version || '0.0.0'),
|
|
205
|
+
},
|
|
206
|
+
},
|
|
202
207
|
});
|
|
203
208
|
```
|
|
204
209
|
|
|
@@ -217,9 +222,10 @@ console.log('1.0.0');
|
|
|
217
222
|
```
|
|
218
223
|
|
|
219
224
|
Note, however: If the project is a TypeScript project, then you may need to add the following to the `.d.ts` file in the project source directory.
|
|
225
|
+
|
|
220
226
|
> If the `.d.ts` file does not exist, then you can create it manually.
|
|
221
227
|
|
|
222
|
-
```
|
|
228
|
+
```ts env.d.ts
|
|
223
229
|
declare const YOUR_ADD_GLOBAL_VAR;
|
|
224
230
|
```
|
|
225
231
|
|
|
@@ -227,10 +233,10 @@ declare const YOUR_ADD_GLOBAL_VAR;
|
|
|
227
233
|
|
|
228
234
|
When the `modern build` command is executed, the
|
|
229
235
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
236
|
+
- Clear the products directory according to `buildConfig.outDir`.
|
|
237
|
+
- Compile `js/ts` source code to generate the JS build product for Bundle/Bundleless.
|
|
238
|
+
- Generate Bundle/Bundleless type files using `tsc`.
|
|
239
|
+
- Handle Copy tasks.
|
|
234
240
|
|
|
235
241
|
## Build errors
|
|
236
242
|
|
|
@@ -238,7 +244,7 @@ When a build error occurs, based on the information learned above, it is easy to
|
|
|
238
244
|
|
|
239
245
|
**Errors reported for js or ts builds:**
|
|
240
246
|
|
|
241
|
-
```
|
|
247
|
+
```bash
|
|
242
248
|
error ModuleBuildError:
|
|
243
249
|
|
|
244
250
|
╭───────────────────────╮
|
|
@@ -252,7 +258,7 @@ Detailed Information:
|
|
|
252
258
|
|
|
253
259
|
**Errors reported for the type file generation process:**
|
|
254
260
|
|
|
255
|
-
```
|
|
261
|
+
```bash
|
|
256
262
|
error ModuleBuildError:
|
|
257
263
|
|
|
258
264
|
bundle DTS failed:
|
|
@@ -260,7 +266,7 @@ bundle DTS failed:
|
|
|
260
266
|
|
|
261
267
|
For `js/ts` build errors, we can tell from the error message.
|
|
262
268
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
269
|
+
- By `'bundle failed:'` to determine if the error is reported for a Bundle build or a Bundleless build?
|
|
270
|
+
- What is the `format` of the build process?
|
|
271
|
+
- What is the `target` of the build process?
|
|
272
|
+
- The specific error message.
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 深入理解 dev 命令
|
|
2
6
|
|
|
3
7
|
在【基础使用】的部分,我们已经知道可以通过 `buildConfig` 配置对项目的输出产物进行修改。`buildConfig` 不仅描述了产物的一些特性,同时还为构建产物提供了一些功能。
|
|
4
8
|
|
|
5
9
|
:::tip{title=注意}
|
|
6
10
|
如果你还不清楚 `buildConfig` 是什么,建议花一些时间通过下面的链接了解一下:
|
|
7
11
|
|
|
8
|
-
|
|
9
|
-
:::
|
|
12
|
+
- 【[修改输出产物](/guide/basic/modify-output-product)】
|
|
13
|
+
:::
|
|
10
14
|
|
|
11
15
|
而在本章里我们将要深入理解某些构建配置的使用以及了解执行 `modern build` 命令的时候发生了什么。
|
|
12
16
|
|
|
@@ -19,4 +23,3 @@
|
|
|
19
23
|
### input 与 sourceDir 的关系
|
|
20
24
|
|
|
21
25
|
## 构建过程
|
|
22
|
-
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 7
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Theme Configuration
|
|
6
|
+
|
|
7
|
+
The module project provides the ability to configure themes through the [`designSystem`](/en/api/config/design-system) API.
|
|
8
|
+
|
|
9
|
+
## Motivation and rationale
|
|
10
|
+
|
|
11
|
+
Theme configuration is somewhat similar to the custom theme functionality in the component library and is mainly used in style development. We can use the `designToken` generated by the `designSystem` configuration in different style development environments.
|
|
12
|
+
|
|
13
|
+
The so-called `designToken` corresponds to different things in different style development environments.
|
|
14
|
+
|
|
15
|
+
- tailwindcss: use `designSystem` as the `theme` configuration for tailwindcss. So you can use.
|
|
16
|
+
- The name of the HTML class supported by tailwindcss.
|
|
17
|
+
- `@apply` custom directive under css/less/sass to use a string with the same name as the HTML class name supported by tailwindcss.
|
|
18
|
+
- css/less/scss: Generate global style variables via `designSystem`.
|
|
19
|
+
|
|
20
|
+
The data structure of the `designSystem` API is borrowed from the [theme API](https://tailwindcss.com/docs/theme) in the `tailwindcss` configuration object, so a default set of `designToken` exists. For the default values, see the [`designSystem` API](/api/config/design-system).
|
|
21
|
+
|
|
22
|
+
:::info
|
|
23
|
+
The css/less/sass global variables are not supported yet.
|
|
24
|
+
:::
|
|
25
|
+
|
|
26
|
+
## Usage examples
|
|
27
|
+
|
|
28
|
+
### tailwindcss
|
|
29
|
+
|
|
30
|
+
When using tailwindcss, its [`theme`](https://v2.tailwindcss.com/docs/theme#extending-the-default-theme) configuration can be set via `designSystem`.
|
|
31
|
+
|
|
32
|
+
For example, the following configuration extends the original color configuration:
|
|
33
|
+
|
|
34
|
+
```ts ./modern.config.ts
|
|
35
|
+
export default {
|
|
36
|
+
designSystem: {
|
|
37
|
+
extend: {
|
|
38
|
+
colors: {
|
|
39
|
+
primary: '#1677ff',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
We can have two ways of using tailwindcss in our code.
|
|
47
|
+
|
|
48
|
+
#### HTML Class
|
|
49
|
+
|
|
50
|
+
```tsx ./src/index.tsx
|
|
51
|
+
import 'tailwindcss/utilities.css';
|
|
52
|
+
|
|
53
|
+
export default () => {
|
|
54
|
+
return <div className="bg-primary"></div>;
|
|
55
|
+
};
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
#### `@apply` Directives
|
|
59
|
+
|
|
60
|
+
:::info
|
|
61
|
+
About [`@apply`](https://tailwindcss.com/docs/functions-and-directives#apply)。
|
|
62
|
+
:::
|
|
63
|
+
|
|
64
|
+
<CH.Code>
|
|
65
|
+
|
|
66
|
+
```tsx ./src/index.tsx
|
|
67
|
+
import './index.css';
|
|
68
|
+
|
|
69
|
+
export default () => {
|
|
70
|
+
return <div className="btn-primary"></div>;
|
|
71
|
+
};
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```css ./src/index.css
|
|
75
|
+
.btn-primary {
|
|
76
|
+
@apply bg-primary;
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
</CH.Code>
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Before you start
|
|
2
6
|
|
|
3
7
|
## Environment preparation
|
|
4
8
|
|
|
5
9
|
In order to use the Modern.js module engineering solution, you first need [NodeJS](https://nodejs.org/zh/) engine, we recommend the latest [LTS version](https://github.com/nodejs/Release), and make sure the Node version is **>=14.17.6**. because non-stable NodeJS releases frequently have bugs. You might consider installing via [nvm-windows](https://github.com/coreybutler/nvm-windows) and [nvm](https://github.com/nvm-sh/nvm) (Mac/linux), so you can easily switch to different NodeJS versions that might be required for different projects that you work on.
|
|
10
|
+
|
|
6
11
|
## Getting Started with npm
|
|
7
12
|
|
|
8
13
|
Once NodeJS is installed, not only can you access the `node` executable from the command line, but you can also execute the `npm` command.
|
|
9
14
|
|
|
10
15
|
Npm is the standard package manager for NodeJS. It started out as a tool for downloading and managing NodeJS package dependencies, but it has since evolved into a tool for front-end JavaScript.
|
|
11
16
|
|
|
12
|
-
**If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/before-getting-started#npm-package-manager) section.**
|
|
17
|
+
**If you already know something about usage of npm and npm packages, then you can directly see [npm package manager](/en/guide/basic/before-getting-started#npm-package-manager) section.**
|
|
13
18
|
|
|
14
19
|
## npm package type project
|
|
15
20
|
|
|
16
|
-
So what is an npm package type project? When we execute the `npm init` command in an empty project directory, it creates a JSON file with the file name `package.json` under the current directory. During the creation process, we will need to fill in information including but not limited to the
|
|
21
|
+
So what is an npm package type project? When we execute the `npm init` command in an empty project directory, it creates a JSON file with the file name `package.json` under the current directory. During the creation process, we will need to fill in information including but not limited to the _name_, _version_ _number_, _description_, etc. of the npm package, which will be found in the resulting `package.json` file as follows
|
|
17
22
|
|
|
18
|
-
```
|
|
23
|
+
```json
|
|
19
24
|
{
|
|
20
25
|
"name": "npm-demo",
|
|
21
26
|
"version": "1.0.0",
|
|
@@ -41,27 +46,27 @@ When adding a third-party npm package to an initial project, we can call this pr
|
|
|
41
46
|
|
|
42
47
|
- `"dependencies"`: a type of package that your application will need in a production environment.
|
|
43
48
|
- `"devDependencies"`: another type of package that is only needed for local development and testing.
|
|
44
|
-
> packages can be understood as third-party npm packages.
|
|
49
|
+
> packages can be understood as third-party npm packages.
|
|
45
50
|
|
|
46
51
|
You can install the packages you need in a **production environment** by running `npm install npm-package-name` or `npm add npm-package-name`, or you can manually write the packages you need to install and the corresponding [semantic version](https://docs.npmjs.com/about-semantic-versioning) in `"dependencies"` in the `package.json` file, and run the `npm install` command to.
|
|
47
52
|
|
|
48
|
-
```
|
|
53
|
+
```json
|
|
49
54
|
{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
55
|
+
"name": "your-npm-project",
|
|
56
|
+
"dependencies": {
|
|
57
|
+
"npm-package-name": "0.1.0"
|
|
58
|
+
}
|
|
54
59
|
}
|
|
55
60
|
```
|
|
56
61
|
|
|
57
62
|
Similarly, you can install **only packages needed for local development and testing** by running `npm install npm-package-name --save-dev` or `npm add npm-package-name --save-dev`, or you can manually write the packages to be installed and the corresponding [semantic version](https://docs.npmjs.com/about-semantic-versioning) in `"devDependencies"` in the `package.json` file, and run the `npm install` command as follows
|
|
58
63
|
|
|
59
|
-
```
|
|
64
|
+
```json
|
|
60
65
|
{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
66
|
+
"name": "your-npm-project",
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"npm-package-name": "0.1.0"
|
|
69
|
+
}
|
|
65
70
|
}
|
|
66
71
|
```
|
|
67
72
|
|
|
@@ -92,13 +97,13 @@ These can be executed by running `npm run-script <stage>` or simply `npm run <st
|
|
|
92
97
|
|
|
93
98
|
Name matching [pre and post commands](https://docs.npmjs.com/cli/v9/using-npm/scripts#pre--post-scripts) will also be run (e.g. `premyscript`, `myscript`, `postmyscript` ).
|
|
94
99
|
|
|
95
|
-
```
|
|
100
|
+
```json
|
|
96
101
|
{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
"scripts": {
|
|
103
|
+
"premyscript": "",
|
|
104
|
+
"myscript": "",
|
|
105
|
+
"postmyscript": ""
|
|
106
|
+
}
|
|
102
107
|
}
|
|
103
108
|
```
|
|
104
109
|
|
|
@@ -160,14 +165,14 @@ A configuration file for Module Tools is provided in the initial module project
|
|
|
160
165
|
|
|
161
166
|
The contents of the initial configuration file are as follows.
|
|
162
167
|
|
|
163
|
-
```
|
|
168
|
+
```typescript
|
|
164
169
|
// modern.config.ts
|
|
165
170
|
import { defineConfig } from '@modern-js/module-tools';
|
|
166
171
|
|
|
167
172
|
export default defineConfig({});
|
|
168
173
|
```
|
|
169
174
|
|
|
170
|
-
```
|
|
175
|
+
```js
|
|
171
176
|
// modern.config.js
|
|
172
177
|
const { defineConfig } = require('@modern-js/module-tools');
|
|
173
178
|
|
|
@@ -176,12 +181,12 @@ module.exports = defineConfig({});
|
|
|
176
181
|
|
|
177
182
|
**We recommend using the `defineConfig` function**, but it is not mandatory to use it. So you can also return an object directly in the configuration file: the:
|
|
178
183
|
|
|
179
|
-
```
|
|
184
|
+
```typescript
|
|
180
185
|
// modern.config.ts
|
|
181
186
|
export default {};
|
|
182
187
|
```
|
|
183
188
|
|
|
184
|
-
```
|
|
189
|
+
```js
|
|
185
190
|
// modern.config.js
|
|
186
191
|
module.exports = {};
|
|
187
192
|
```
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 2
|
|
3
|
+
---
|
|
4
|
+
|
|
1
5
|
# Command Preview
|
|
2
6
|
|
|
3
7
|
Commands available for module engineering projects.
|
|
4
8
|
|
|
5
9
|
## `modern build`
|
|
6
10
|
|
|
7
|
-
```
|
|
11
|
+
```bash
|
|
8
12
|
Usage: modern build [options]
|
|
9
13
|
|
|
10
14
|
Build module command
|
|
@@ -22,7 +26,7 @@ Options:
|
|
|
22
26
|
When you want to start a project build, you can execute the `modern build` command. When using this command, we can:
|
|
23
27
|
|
|
24
28
|
- When wanting to start a build in watch mode, use the `--watch` option.
|
|
25
|
-
- When you want to specify the path to the TypeScript configuration file read by the project build, use `-build --tsconfig . /path/config.json` option. This option overrides all [`buildConfig`](/
|
|
29
|
+
- When you want to specify the path to the TypeScript configuration file read by the project build, use `-build --tsconfig . /path/config.json` option. This option overrides all [`buildConfig`](/api/config/build-config) configurations in [`dts.tsconfigPath`](/api/config/build-config).
|
|
26
30
|
- The `-no-dts` option can be used when the DTS type file generation and type checking behavior of the project needs to be turned off. **Note: The generation of type files depends on the results of type checking. If type checking is turned off, then type files will not be generated either**.
|
|
27
31
|
- The `--no-clear` option can be used when the automatic clearing of the product output directory needs to be turned off.
|
|
28
32
|
|
|
@@ -34,7 +38,7 @@ When executing a Storybook build, it needs to read the project's build product.
|
|
|
34
38
|
|
|
35
39
|
## `modern new`
|
|
36
40
|
|
|
37
|
-
```
|
|
41
|
+
```bash
|
|
38
42
|
Usage: modern new [options]
|
|
39
43
|
|
|
40
44
|
Execute the generator in a modular project scenario
|
|
@@ -55,11 +59,11 @@ The following features can currently be enabled.
|
|
|
55
59
|
- Tailwind CSS support
|
|
56
60
|
- Modern.js Runtime API
|
|
57
61
|
|
|
58
|
-
You can learn more about these features in the [Using the micro generator](/
|
|
62
|
+
You can learn more about these features in the [Using the micro generator](/guide/basic/use-micro-generator) section.
|
|
59
63
|
|
|
60
64
|
## `modern dev`
|
|
61
65
|
|
|
62
|
-
```
|
|
66
|
+
```bash
|
|
63
67
|
Usage: modern dev [options]
|
|
64
68
|
|
|
65
69
|
Local development commands
|
|
@@ -71,24 +75,24 @@ Commands:
|
|
|
71
75
|
[dev-tools-subCommand]
|
|
72
76
|
```
|
|
73
77
|
|
|
74
|
-
The module engineering solution provides the ability to use debugging tools, which can be started with the `modern dev` command. Note, however, that no debugging-related plugins are provided by default, so executing `modern dev` will prompt:
|
|
78
|
+
The module engineering solution provides the ability to use debugging tools, which can be started with the `modern dev` command. Note, however, that no debugging-related plugins are provided by default, so executing `modern dev` will prompt: _"No dev tools found available "_.
|
|
75
79
|
|
|
76
80
|
The officially supported debugging tool is [Storybook](https://storybook.js.org/), so you can run `modern dev` or `modern dev storybook` to execute it after you run `modern new` to enable it.
|
|
77
81
|
|
|
78
82
|
## `modern test`
|
|
79
83
|
|
|
80
|
-
```
|
|
84
|
+
```bash
|
|
81
85
|
Usage: modern test [options]
|
|
82
86
|
|
|
83
87
|
Options:
|
|
84
88
|
-h, --help display help for command
|
|
85
89
|
```
|
|
86
|
-
The `modern test` command will automatically run the `src/tests/*.test.(js|ts|jsx|tsx)` file as a test case.
|
|
87
90
|
|
|
91
|
+
The `modern test` command will automatically run the `src/tests/*.test.(js|ts|jsx|tsx)` file as a test case.
|
|
88
92
|
|
|
89
93
|
## `modern lint`
|
|
90
94
|
|
|
91
|
-
```
|
|
95
|
+
```bash
|
|
92
96
|
Usage: modern lint [options] [. .files]
|
|
93
97
|
|
|
94
98
|
lint and fix source files
|
|
@@ -104,7 +108,7 @@ Run [ESLint](https://eslint.org/) to check the syntax of the code. Usually, we o
|
|
|
104
108
|
|
|
105
109
|
## `-modern change`
|
|
106
110
|
|
|
107
|
-
```
|
|
111
|
+
```bash
|
|
108
112
|
Usage: modern change [options]
|
|
109
113
|
|
|
110
114
|
Create a changeset
|
|
@@ -119,7 +123,7 @@ The `modern change` command is used to generate the required Markdown file for [
|
|
|
119
123
|
|
|
120
124
|
## `modern pre`
|
|
121
125
|
|
|
122
|
-
```
|
|
126
|
+
```bash
|
|
123
127
|
Usage: modern pre [options] <enter|exit> [tag]
|
|
124
128
|
|
|
125
129
|
Entering and exiting pre-publishing mode
|
|
@@ -132,7 +136,7 @@ You can use the `modern pre` command to [pre-release](https://github.com/atlassi
|
|
|
132
136
|
|
|
133
137
|
## `modern bump`
|
|
134
138
|
|
|
135
|
-
```
|
|
139
|
+
```bash
|
|
136
140
|
Usage: modern bump [options]
|
|
137
141
|
|
|
138
142
|
Use changesets to automatically update releases and changelogs
|
|
@@ -148,7 +152,7 @@ Modify the version number in `package.json` according to the Markdown file of th
|
|
|
148
152
|
|
|
149
153
|
## `modern release`
|
|
150
154
|
|
|
151
|
-
```
|
|
155
|
+
```bash
|
|
152
156
|
Usage: modern release [options]
|
|
153
157
|
|
|
154
158
|
Release npm packages
|
|
@@ -166,7 +170,7 @@ The `-modern release` command releases the module to the [npm Registry](https://
|
|
|
166
170
|
|
|
167
171
|
## `modern gen-release-note`
|
|
168
172
|
|
|
169
|
-
```
|
|
173
|
+
```bash
|
|
170
174
|
Usage: modern gen-release-note [options]
|
|
171
175
|
|
|
172
176
|
Generate Release Note based on current repository changeset information
|
|
@@ -180,12 +184,12 @@ Options:
|
|
|
180
184
|
Automatically generate [Release Note](https://en.wikipedia.org/wiki/Release_notes) based on the changeset information of the current repository.
|
|
181
185
|
|
|
182
186
|
:::tip{title=Note}
|
|
183
|
-
needs to be executed before the
|
|
187
|
+
needs to be executed before the `bump` command.
|
|
184
188
|
:::
|
|
185
189
|
|
|
186
190
|
## `modern upgrade`
|
|
187
191
|
|
|
188
|
-
```
|
|
192
|
+
```bash
|
|
189
193
|
Usage: modern upgrade [options]
|
|
190
194
|
|
|
191
195
|
Upgrade Modern.js to the latest version
|