@modern-js/module-tools-docs 2.2.0 → 2.2.1-beta.1
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/LICENSE +144 -0
- package/doc_build/html/main/index.html +16 -0
- package/doc_build/route.json +10 -0
- package/doc_build/static/css/main.css +2977 -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 +68 -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/en_api_config_build-config.js +8406 -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 +7865 -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 +47805 -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 +1488 -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 +2139 -0
- package/doc_build/static/js/async/en_api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/en_api_index.js +51 -0
- 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 +14360 -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 +3972 -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 +9857 -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 +6541 -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 +3806 -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 +5304 -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 +2526 -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 +2486 -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 +3720 -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 +3973 -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 +3137 -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 +2180 -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 +3887 -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 +2973 -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 +4723 -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 +21400 -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 +2149 -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 +162 -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 +96 -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_index.js +81 -0
- package/doc_build/static/js/async/en_index.js.map +1 -0
- package/doc_build/static/js/async/en_plugins_guide_getting-started.js +2556 -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 +4173 -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 +3815 -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 +66 -0
- package/doc_build/static/js/async/en_plugins_official-list_overview.js.map +1 -0
- package/doc_build/static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js +246 -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/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/async/zh_api_config_build-config.js +11354 -0
- package/doc_build/static/js/async/zh_api_config_build-config.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_build-preset.js +7867 -0
- package/doc_build/static/js/async/zh_api_config_build-preset.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_design-system.js +48712 -0
- package/doc_build/static/js/async/zh_api_config_design-system.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_plugins.js +1488 -0
- package/doc_build/static/js/async/zh_api_config_plugins.js.map +1 -0
- package/doc_build/static/js/async/zh_api_config_testing.js +2132 -0
- package/doc_build/static/js/async/zh_api_config_testing.js.map +1 -0
- package/doc_build/static/js/async/zh_api_index.js +52 -0
- package/doc_build/static/js/async/zh_api_index.js.map +1 -0
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js +14392 -0
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_asset.js +3972 -0
- package/doc_build/static/js/async/zh_guide_advance_asset.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_build-umd.js +9859 -0
- package/doc_build/static/js/async/zh_guide_advance_build-umd.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_copy.js +6541 -0
- package/doc_build/static/js/async/zh_guide_advance_copy.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.js +3808 -0
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js +5304 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js +2526 -0
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_advance_theme-config.js +2477 -0
- package/doc_build/static/js/async/zh_guide_advance_theme-config.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js +3711 -0
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js +3805 -0
- package/doc_build/static/js/async/zh_guide_basic_command-preview.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js +3142 -0
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js +2241 -0
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.js +4286 -0
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js +2979 -0
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.js +4760 -0
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_best-practices_components.js +21100 -0
- package/doc_build/static/js/async/zh_guide_best-practices_components.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_intro_getting-started.js +2031 -0
- package/doc_build/static/js/async/zh_guide_intro_getting-started.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_intro_welcome.js +162 -0
- package/doc_build/static/js/async/zh_guide_intro_welcome.js.map +1 -0
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js +96 -0
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.js.map +1 -0
- package/doc_build/static/js/async/zh_index.js +81 -0
- package/doc_build/static/js/async/zh_index.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.js +2604 -0
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js +4169 -0
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.js +3815 -0
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.js.map +1 -0
- package/doc_build/static/js/async/zh_plugins_official-list_overview.js +66 -0
- package/doc_build/static/js/async/zh_plugins_official-list_overview.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 +11847 -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 +8610 -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 +7328 -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/doc_build/static/search_index.json +1 -1
- package/docs/en/guide/advance/in-depth-about-dev-command.md +65 -12
- package/docs/en/guide/basic/before-getting-started.md +4 -14
- package/docs/en/guide/basic/command-preview.md +1 -1
- package/docs/en/guide/basic/modify-output-product.md +6 -2
- package/docs/en/guide/basic/use-micro-generator.md +62 -1
- package/docs/en/guide/basic/using-storybook.mdx +4 -4
- package/docs/en/guide/intro/getting-started.md +16 -7
- package/docs/zh/guide/advance/in-depth-about-dev-command.md +60 -13
- package/docs/zh/guide/basic/before-getting-started.md +4 -14
- package/docs/zh/guide/basic/command-preview.md +2 -2
- package/docs/zh/guide/basic/modify-output-product.md +5 -3
- package/docs/zh/guide/basic/publish-your-project.md +4 -4
- package/docs/zh/guide/basic/test-your-project.mdx +18 -5
- package/docs/zh/guide/basic/use-micro-generator.md +61 -1
- package/docs/zh/guide/basic/using-storybook.mdx +13 -10
- package/docs/zh/guide/intro/getting-started.md +17 -11
- package/package.json +3 -3
- package/doc_build/api/config/build-config.html +0 -332
- package/doc_build/api/config/build-preset.html +0 -43
- package/doc_build/api/config/design-system.html +0 -103
- package/doc_build/api/config/plugins.html +0 -7
- package/doc_build/api/config/testing.html +0 -21
- package/doc_build/api/index.html +0 -1
- package/doc_build/api/plugin-api/plugin-hooks.html +0 -113
- package/doc_build/en/api/config/build-config.html +0 -316
- package/doc_build/en/api/config/build-preset.html +0 -43
- package/doc_build/en/api/config/design-system.html +0 -117
- package/doc_build/en/api/config/plugins.html +0 -7
- package/doc_build/en/api/config/testing.html +0 -21
- package/doc_build/en/api/index.html +0 -1
- package/doc_build/en/api/plugin-api/plugin-hooks.html +0 -113
- package/doc_build/en/guide/advance/asset.html +0 -25
- package/doc_build/en/guide/advance/build-umd.html +0 -32
- package/doc_build/en/guide/advance/copy.html +0 -42
- package/doc_build/en/guide/advance/external-dependency.html +0 -31
- package/doc_build/en/guide/advance/in-depth-about-build.html +0 -112
- package/doc_build/en/guide/advance/in-depth-about-dev-command.html +0 -12
- package/doc_build/en/guide/advance/theme-config.html +0 -29
- package/doc_build/en/guide/basic/before-getting-started.html +0 -89
- package/doc_build/en/guide/basic/command-preview.html +0 -63
- package/doc_build/en/guide/basic/modify-output-product.html +0 -98
- package/doc_build/en/guide/basic/publish-your-project.html +0 -50
- package/doc_build/en/guide/basic/test-your-project.html +0 -31
- package/doc_build/en/guide/basic/use-micro-generator.html +0 -29
- package/doc_build/en/guide/basic/using-storybook.html +0 -66
- package/doc_build/en/guide/best-practices/components.html +0 -111
- package/doc_build/en/guide/intro/getting-started.html +0 -36
- package/doc_build/en/guide/intro/welcome.html +0 -13
- package/doc_build/en/guide/intro/why-module-engineering-solution.html +0 -9
- package/doc_build/en/index.html +0 -1
- package/doc_build/en/plugins/guide/getting-started.html +0 -15
- package/doc_build/en/plugins/guide/plugin-object.html +0 -14
- package/doc_build/en/plugins/guide/setup-function.html +0 -30
- package/doc_build/en/plugins/official-list/overview.html +0 -3
- package/doc_build/guide/advance/asset.html +0 -25
- package/doc_build/guide/advance/build-umd.html +0 -32
- package/doc_build/guide/advance/copy.html +0 -42
- package/doc_build/guide/advance/external-dependency.html +0 -31
- package/doc_build/guide/advance/in-depth-about-build.html +0 -112
- package/doc_build/guide/advance/in-depth-about-dev-command.html +0 -14
- package/doc_build/guide/advance/theme-config.html +0 -28
- package/doc_build/guide/basic/before-getting-started.html +0 -89
- package/doc_build/guide/basic/command-preview.html +0 -63
- package/doc_build/guide/basic/modify-output-product.html +0 -97
- package/doc_build/guide/basic/publish-your-project.html +0 -52
- package/doc_build/guide/basic/test-your-project.html +0 -32
- package/doc_build/guide/basic/use-micro-generator.html +0 -27
- package/doc_build/guide/basic/using-storybook.html +0 -67
- package/doc_build/guide/best-practices/components.html +0 -111
- package/doc_build/guide/intro/getting-started.html +0 -39
- package/doc_build/guide/intro/welcome.html +0 -13
- package/doc_build/guide/intro/why-module-engineering-solution.html +0 -9
- package/doc_build/index.html +0 -1
- package/doc_build/plugins/guide/getting-started.html +0 -15
- package/doc_build/plugins/guide/plugin-object.html +0 -14
- package/doc_build/plugins/guide/setup-function.html +0 -30
- package/doc_build/plugins/official-list/overview.html +0 -3
- package/doc_build/static/css/main.edaad072.css +0 -1
- package/doc_build/static/js/1607.70af642a.js +0 -2
- package/doc_build/static/js/1607.70af642a.js.LICENSE.txt +0 -23
- package/doc_build/static/js/async/3799.e31e8293.js +0 -1
- package/doc_build/static/js/async/8652.6fbf1cb7.js +0 -1
- package/doc_build/static/js/async/en_api_config_build-config.367a5701.js +0 -1
- package/doc_build/static/js/async/en_api_config_build-preset.0d78b268.js +0 -1
- package/doc_build/static/js/async/en_api_config_design-system.b28d6723.js +0 -1
- package/doc_build/static/js/async/en_api_config_plugins.fc95fb77.js +0 -1
- package/doc_build/static/js/async/en_api_config_testing.8bc7f316.js +0 -1
- package/doc_build/static/js/async/en_api_index.669f0a56.js +0 -1
- package/doc_build/static/js/async/en_api_plugin-api_plugin-hooks.60d0260c.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_asset.5ff1d623.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_build-umd.c254ed46.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_copy.45c0a51d.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_external-dependency.a52d3247.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-build.51bf3569.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_in-depth-about-dev-command.aec0b4e1.js +0 -1
- package/doc_build/static/js/async/en_guide_advance_theme-config.db0ad9fc.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_before-getting-started.a22fc49a.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_command-preview.1707ed29.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_modify-output-product.ad453d13.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_publish-your-project.08c5112f.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_test-your-project.f5f6b204.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_use-micro-generator.56325139.js +0 -1
- package/doc_build/static/js/async/en_guide_basic_using-storybook.9d721554.js +0 -1
- package/doc_build/static/js/async/en_guide_best-practices_components.45155af9.js +0 -1
- package/doc_build/static/js/async/en_guide_intro_getting-started.f8682be3.js +0 -1
- package/doc_build/static/js/async/en_guide_intro_welcome.9cc45924.js +0 -1
- package/doc_build/static/js/async/en_guide_intro_why-module-engineering-solution.7f2dae5c.js +0 -1
- package/doc_build/static/js/async/en_index.7bd869c4.js +0 -1
- package/doc_build/static/js/async/en_plugins_guide_getting-started.b850249c.js +0 -1
- package/doc_build/static/js/async/en_plugins_guide_plugin-object.bf6c6221.js +0 -1
- package/doc_build/static/js/async/en_plugins_guide_setup-function.80a2bd97.js +0 -1
- package/doc_build/static/js/async/en_plugins_official-list_overview.84e5cea0.js +0 -1
- package/doc_build/static/js/async/zh_api_config_build-config.048fd5ec.js +0 -1
- package/doc_build/static/js/async/zh_api_config_build-preset.7c13584d.js +0 -1
- package/doc_build/static/js/async/zh_api_config_design-system.1eecd474.js +0 -1
- package/doc_build/static/js/async/zh_api_config_plugins.c22dc4be.js +0 -1
- package/doc_build/static/js/async/zh_api_config_testing.a9888eed.js +0 -1
- package/doc_build/static/js/async/zh_api_index.22957707.js +0 -1
- package/doc_build/static/js/async/zh_api_plugin-api_plugin-hooks.a4d81bf6.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_asset.5b936003.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_build-umd.b6d541ff.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_copy.21a1aea4.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_external-dependency.c7cf5d4b.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-build.64e795f3.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_in-depth-about-dev-command.168ce7dd.js +0 -1
- package/doc_build/static/js/async/zh_guide_advance_theme-config.b9570109.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_before-getting-started.6b06b54a.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_command-preview.1199124a.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_modify-output-product.8ccbc8d1.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_publish-your-project.bf11b1c4.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_test-your-project.ae52c47a.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_use-micro-generator.a091d57d.js +0 -1
- package/doc_build/static/js/async/zh_guide_basic_using-storybook.27829e44.js +0 -1
- package/doc_build/static/js/async/zh_guide_best-practices_components.7454d916.js +0 -1
- package/doc_build/static/js/async/zh_guide_intro_getting-started.a4c00d9a.js +0 -1
- package/doc_build/static/js/async/zh_guide_intro_welcome.71c3fe16.js +0 -1
- package/doc_build/static/js/async/zh_guide_intro_why-module-engineering-solution.6f8b5ff6.js +0 -1
- package/doc_build/static/js/async/zh_index.c19f9dcf.js +0 -1
- package/doc_build/static/js/async/zh_plugins_guide_getting-started.099dfaea.js +0 -1
- package/doc_build/static/js/async/zh_plugins_guide_plugin-object.963289d5.js +0 -1
- package/doc_build/static/js/async/zh_plugins_guide_setup-function.67d07b91.js +0 -1
- package/doc_build/static/js/async/zh_plugins_official-list_overview.a7635714.js +0 -1
- package/doc_build/static/js/lib-lodash.c5845536.js +0 -1
- package/doc_build/static/js/lib-polyfill.b3038509.js +0 -1
- package/doc_build/static/js/lib-react.d41ace5e.js +0 -2
- package/doc_build/static/js/lib-react.d41ace5e.js.LICENSE.txt +0 -29
- package/doc_build/static/js/main.2d3257a4.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/js/async/en_plugins_guide_setup-function.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AEA;;AAAA;AAAA","sources":["webpack://@modern-js/module-tools-docs/./docs/en/plugins/guide/setup-function.mdx"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["en_plugins_official-list_overview"],{
|
|
3
|
+
|
|
4
|
+
/***/ "./docs/en/plugins/official-list/overview.md":
|
|
5
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ "content": function() { return /* binding */ content; },
|
|
10
|
+
/* harmony export */ "frontmatter": function() { return /* binding */ frontmatter; },
|
|
11
|
+
/* harmony export */ "title": function() { return /* binding */ title; },
|
|
12
|
+
/* harmony export */ "toc": function() { return /* binding */ toc; }
|
|
13
|
+
/* harmony export */ });
|
|
14
|
+
/* 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");
|
|
15
|
+
/*@jsxRuntime automatic @jsxImportSource react*/
|
|
16
|
+
|
|
17
|
+
const frontmatter = undefined;
|
|
18
|
+
const toc = [{
|
|
19
|
+
"id": "official-plugin",
|
|
20
|
+
"text": "Official Plugin",
|
|
21
|
+
"depth": 2
|
|
22
|
+
}];
|
|
23
|
+
const title = `Overview`;
|
|
24
|
+
const content = "\"# Overview\\n\\n## Official Plugin\\n\\n(Under Building)\\n\\n\"";
|
|
25
|
+
function _createMdxContent(props) {
|
|
26
|
+
const _components = Object.assign({
|
|
27
|
+
h1: "h1",
|
|
28
|
+
a: "a",
|
|
29
|
+
h2: "h2",
|
|
30
|
+
p: "p"
|
|
31
|
+
}, props.components);
|
|
32
|
+
return (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
|
33
|
+
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h1, {
|
|
34
|
+
id: "overview",
|
|
35
|
+
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
36
|
+
className: "header-anchor",
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
href: "#overview",
|
|
39
|
+
children: "#"
|
|
40
|
+
}), "Overview"]
|
|
41
|
+
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(_components.h2, {
|
|
42
|
+
id: "official-plugin",
|
|
43
|
+
children: [(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.a, {
|
|
44
|
+
className: "header-anchor",
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
href: "#official-plugin",
|
|
47
|
+
children: "#"
|
|
48
|
+
}), "Official Plugin"]
|
|
49
|
+
}), "\n", (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_components.p, {
|
|
50
|
+
children: "(Under Building)"
|
|
51
|
+
})]
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function MDXContent(props = {}) {
|
|
55
|
+
const {wrapper: MDXLayout} = props.components || ({});
|
|
56
|
+
return MDXLayout ? (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(MDXLayout, Object.assign({}, props, {
|
|
57
|
+
children: (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)(_createMdxContent, props)
|
|
58
|
+
})) : _createMdxContent(props);
|
|
59
|
+
}
|
|
60
|
+
/* harmony default export */ __webpack_exports__["default"] = (MDXContent);
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/***/ })
|
|
64
|
+
|
|
65
|
+
}]);
|
|
66
|
+
//# sourceMappingURL=en_plugins_official-list_overview.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/js/async/en_plugins_official-list_overview.js","mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;AAEA;;AAEA","sources":["webpack://@modern-js/module-tools-docs/./docs/en/plugins/official-list/overview.md"],"names":[],"sourceRoot":""}
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
(self["webpackChunk_modern_js_module_tools_docs"] = self["webpackChunk_modern_js_module_tools_docs"] || []).push([["packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts"],{
|
|
3
|
+
|
|
4
|
+
/***/ "../../packages/cli/doc-core/src/theme-default/components/Search/logic/search.ts":
|
|
5
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
6
|
+
|
|
7
|
+
__webpack_require__.r(__webpack_exports__);
|
|
8
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9
|
+
/* harmony export */ "PageSearcher": function() { return /* binding */ PageSearcher; }
|
|
10
|
+
/* harmony export */ });
|
|
11
|
+
/* harmony import */ var lodash_es_uniqBy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqBy.js");
|
|
12
|
+
/* harmony import */ var flexsearch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("../../node_modules/.pnpm/flexsearch@0.6.32/node_modules/flexsearch/dist/flexsearch.min.js");
|
|
13
|
+
/* harmony import */ var flexsearch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(flexsearch__WEBPACK_IMPORTED_MODULE_0__);
|
|
14
|
+
/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("../../packages/cli/doc-core/src/theme-default/components/Search/logic/util.ts");
|
|
15
|
+
/* harmony import */ var _runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("../../packages/cli/doc-core/src/runtime/utils.ts");
|
|
16
|
+
/* harmony import */ var _shared_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("../../packages/cli/doc-core/src/shared/utils/index.ts");
|
|
17
|
+
/* provided dependency */ var __react_refresh_utils__ = __webpack_require__("../../node_modules/.pnpm/@pmmmwh+react-refresh-webpack-plugin@0.5.9_xsftmjzvfioxqs4ify53ibh7ay/node_modules/@pmmmwh/react-refresh-webpack-plugin/lib/runtime/RefreshUtils.js");
|
|
18
|
+
__webpack_require__.$Refresh$.runtime = __webpack_require__("../../node_modules/.pnpm/react-refresh@0.14.0/node_modules/react-refresh/runtime.js");
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
const THRESHOLD_CONTENT_LENGTH = 100;
|
|
26
|
+
const cjkRegex = /[\u3131-\u314e|\u314f-\u3163|\uac00-\ud7a3]|[\u4E00-\u9FCC\u3400-\u4DB5\uFA0E\uFA0F\uFA11\uFA13\uFA14\uFA1F\uFA21\uFA23\uFA24\uFA27-\uFA29]|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34\udf40-\udfff]|\ud86e[\udc00-\udc1d]|[\u3041-\u3096]|[\u30A1-\u30FA]/giu;
|
|
27
|
+
const WHITE_PAGE_TYPES = ['home', 'api', '404', 'custom'];
|
|
28
|
+
class PageSearcher {
|
|
29
|
+
#index;
|
|
30
|
+
#cjkIndex;
|
|
31
|
+
#headerToIdMap = {};
|
|
32
|
+
#langRoutePrefix;
|
|
33
|
+
#defaultLang;
|
|
34
|
+
#langs = [];
|
|
35
|
+
#pages;
|
|
36
|
+
constructor(options) {
|
|
37
|
+
this.#langRoutePrefix = options.langRoutePrefix;
|
|
38
|
+
this.#defaultLang = options.defaultLang;
|
|
39
|
+
this.#langs = options.langs;
|
|
40
|
+
}
|
|
41
|
+
async init(options = {}) {
|
|
42
|
+
this.#pages = await this.#getPages();
|
|
43
|
+
const pages = this.#pages.filter(page => {
|
|
44
|
+
// Hit the default language route
|
|
45
|
+
if (this.#langRoutePrefix === '/') {
|
|
46
|
+
const otherLangsWithBase = this.#langs.filter(lang => lang !== this.#defaultLang).map(lang => (0,_runtime__WEBPACK_IMPORTED_MODULE_1__.withBase)(lang));
|
|
47
|
+
return !otherLangsWithBase.every(otherLangWithBase => page.routePath.startsWith(otherLangWithBase));
|
|
48
|
+
} else {
|
|
49
|
+
return page.routePath.startsWith((0,_runtime__WEBPACK_IMPORTED_MODULE_1__.withBase)(this.#langRoutePrefix));
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
const pagesForSearch = pages.filter(page => {
|
|
53
|
+
return !WHITE_PAGE_TYPES.includes(page.frontmatter?.pageType || '');
|
|
54
|
+
}).map(page => {
|
|
55
|
+
const headers = (page.toc || []).map(header => header.text);
|
|
56
|
+
return {
|
|
57
|
+
title: page.title ?? page.frontmatter?.title ?? page.routePath.split('/').pop() ?? '',
|
|
58
|
+
headers,
|
|
59
|
+
headerStr: headers.join(' '),
|
|
60
|
+
content: (0,_util__WEBPACK_IMPORTED_MODULE_2__.normalizeContent)(page.content || ''),
|
|
61
|
+
path: page.routePath,
|
|
62
|
+
rawHeaders: page.toc || []
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
this.#headerToIdMap = pages.reduce((acc, page) => {
|
|
66
|
+
(page.toc || []).forEach(header => {
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
68
|
+
acc[page.routePath + header.text] = header.id;
|
|
69
|
+
});
|
|
70
|
+
return acc;
|
|
71
|
+
}, {});
|
|
72
|
+
const createOptions = {
|
|
73
|
+
encode: 'simple',
|
|
74
|
+
tokenize: 'forward',
|
|
75
|
+
split: /\W+/,
|
|
76
|
+
async: true,
|
|
77
|
+
doc: {
|
|
78
|
+
id: 'path',
|
|
79
|
+
field: ['title', 'headerStr', 'content']
|
|
80
|
+
},
|
|
81
|
+
...options
|
|
82
|
+
};
|
|
83
|
+
// Init Search Indexes
|
|
84
|
+
// English Index
|
|
85
|
+
this.#index = flexsearch__WEBPACK_IMPORTED_MODULE_0___default().create(createOptions);
|
|
86
|
+
// CJK: Chinese, Japanese, Korean
|
|
87
|
+
this.#cjkIndex = flexsearch__WEBPACK_IMPORTED_MODULE_0___default().create({
|
|
88
|
+
...createOptions,
|
|
89
|
+
encode: false,
|
|
90
|
+
tokenize(str) {
|
|
91
|
+
const cjkWords = [];
|
|
92
|
+
let m = null;
|
|
93
|
+
do {
|
|
94
|
+
m = cjkRegex.exec(str);
|
|
95
|
+
if (m) {
|
|
96
|
+
cjkWords.push(m[0]);
|
|
97
|
+
}
|
|
98
|
+
} while (m);
|
|
99
|
+
return cjkWords;
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
this.#index.add(pagesForSearch);
|
|
103
|
+
this.#cjkIndex.add(pagesForSearch);
|
|
104
|
+
}
|
|
105
|
+
async match(query, limit = 7) {
|
|
106
|
+
const searchResult = await Promise.all([this.#index?.search({
|
|
107
|
+
query,
|
|
108
|
+
limit
|
|
109
|
+
}), this.#cjkIndex?.search(query, limit)]);
|
|
110
|
+
const flattenSearchResult = searchResult.flat(2).filter(Boolean);
|
|
111
|
+
const matchedResult = [];
|
|
112
|
+
flattenSearchResult.forEach(item => {
|
|
113
|
+
// Header match
|
|
114
|
+
const matchedHeader = this.#matchHeader(item, query, matchedResult);
|
|
115
|
+
// If we have matched header, we don't need to match content
|
|
116
|
+
// Because the header is already in the content
|
|
117
|
+
if (matchedHeader) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
// Content match
|
|
121
|
+
this.#matchContent(item, query, matchedResult);
|
|
122
|
+
});
|
|
123
|
+
const res = (0,lodash_es_uniqBy__WEBPACK_IMPORTED_MODULE_3__["default"])(matchedResult, 'link');
|
|
124
|
+
return res;
|
|
125
|
+
}
|
|
126
|
+
async #getPages() {
|
|
127
|
+
const result = await fetch(
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
129
|
+
// @ts-expect-error __ASSET_PREFIX__ is injected by webpack
|
|
130
|
+
`${""}/static/${_shared_utils__WEBPACK_IMPORTED_MODULE_4__.SEARCH_INDEX_JSON}`);
|
|
131
|
+
return result.json();
|
|
132
|
+
}
|
|
133
|
+
#matchHeader(item, query, matchedResult) {
|
|
134
|
+
const {
|
|
135
|
+
headers,
|
|
136
|
+
rawHeaders
|
|
137
|
+
} = item;
|
|
138
|
+
for (const [index, header] of headers.entries()) {
|
|
139
|
+
if (header.includes(query)) {
|
|
140
|
+
const headerAnchor = this.#headerToIdMap[item.path + header];
|
|
141
|
+
// Find the all parent headers (except h1)
|
|
142
|
+
// So we can show the full path of the header in search result
|
|
143
|
+
// e.g. header2 > header3 > header4
|
|
144
|
+
const headerGroup = (0,_util__WEBPACK_IMPORTED_MODULE_2__.backTrackHeaders)(rawHeaders, index);
|
|
145
|
+
const headerStr = headerGroup.map(item => item.text).join(' > ');
|
|
146
|
+
matchedResult.push({
|
|
147
|
+
type: 'header',
|
|
148
|
+
title: item.title,
|
|
149
|
+
header: headerStr,
|
|
150
|
+
headerHighlightIndex: headerStr.indexOf(query),
|
|
151
|
+
link: `${(0,_shared_utils__WEBPACK_IMPORTED_MODULE_4__.normalizeHref)(item.path)}#${headerAnchor}`
|
|
152
|
+
});
|
|
153
|
+
return true;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
#matchContent(item, query, matchedResult) {
|
|
159
|
+
const {
|
|
160
|
+
content,
|
|
161
|
+
headers
|
|
162
|
+
} = item;
|
|
163
|
+
const queryIndex = content.indexOf(query);
|
|
164
|
+
if (queryIndex === -1) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
const headersIndex = headers.map(h => content.indexOf(h));
|
|
168
|
+
const currentHeaderIndex = headersIndex.findIndex((hIndex, position) => {
|
|
169
|
+
if (position < headers.length - 1) {
|
|
170
|
+
const next = headersIndex[position + 1];
|
|
171
|
+
if (hIndex <= queryIndex && next >= queryIndex) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
return hIndex < queryIndex;
|
|
176
|
+
}
|
|
177
|
+
return false;
|
|
178
|
+
});
|
|
179
|
+
const currentHeader = headers[currentHeaderIndex] ?? item.title;
|
|
180
|
+
let statementStartIndex = content.slice(0, queryIndex).lastIndexOf('\n');
|
|
181
|
+
statementStartIndex = statementStartIndex === -1 ? 0 : statementStartIndex;
|
|
182
|
+
const statementEndIndex = content.indexOf('\n', queryIndex + query.length);
|
|
183
|
+
let statement = content.slice(statementStartIndex, statementEndIndex);
|
|
184
|
+
if (statement.length > THRESHOLD_CONTENT_LENGTH) {
|
|
185
|
+
statement = this.#normalizeStatement(statement, query);
|
|
186
|
+
}
|
|
187
|
+
matchedResult.push({
|
|
188
|
+
type: 'content',
|
|
189
|
+
title: item.title,
|
|
190
|
+
header: currentHeader,
|
|
191
|
+
statement,
|
|
192
|
+
statementHighlightIndex: statement.indexOf(query),
|
|
193
|
+
link: `${(0,_shared_utils__WEBPACK_IMPORTED_MODULE_4__.normalizeHref)(item.path)}#${currentHeader}`
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
#normalizeStatement(statement, query) {
|
|
197
|
+
// If statement is too long, we will only show 120 characters
|
|
198
|
+
const queryIndex = statement.indexOf(query);
|
|
199
|
+
const maxPrefixOrSuffix = Math.floor((THRESHOLD_CONTENT_LENGTH - query.length) / 2);
|
|
200
|
+
let prefix = statement.slice(0, queryIndex);
|
|
201
|
+
if (prefix.length > maxPrefixOrSuffix) {
|
|
202
|
+
prefix = `...${statement.slice(queryIndex - maxPrefixOrSuffix + 3, queryIndex)}`;
|
|
203
|
+
}
|
|
204
|
+
let suffix = statement.slice(queryIndex + query.length);
|
|
205
|
+
if (suffix.length > maxPrefixOrSuffix) {
|
|
206
|
+
suffix = `${statement.slice(queryIndex + query.length, queryIndex + maxPrefixOrSuffix - 3)}...`;
|
|
207
|
+
}
|
|
208
|
+
return prefix + query + suffix;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
var $ReactRefreshModuleId$ = __webpack_require__.$Refresh$.moduleId;
|
|
213
|
+
var $ReactRefreshCurrentExports$ = __react_refresh_utils__.getModuleExports(
|
|
214
|
+
$ReactRefreshModuleId$
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
function $ReactRefreshModuleRuntime$(exports) {
|
|
218
|
+
if (true) {
|
|
219
|
+
var errorOverlay;
|
|
220
|
+
if (true) {
|
|
221
|
+
errorOverlay = false;
|
|
222
|
+
}
|
|
223
|
+
var testMode;
|
|
224
|
+
if (typeof __react_refresh_test__ !== 'undefined') {
|
|
225
|
+
testMode = __react_refresh_test__;
|
|
226
|
+
}
|
|
227
|
+
return __react_refresh_utils__.executeRuntime(
|
|
228
|
+
exports,
|
|
229
|
+
$ReactRefreshModuleId$,
|
|
230
|
+
module.hot,
|
|
231
|
+
errorOverlay,
|
|
232
|
+
testMode
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (typeof Promise !== 'undefined' && $ReactRefreshCurrentExports$ instanceof Promise) {
|
|
238
|
+
$ReactRefreshCurrentExports$.then($ReactRefreshModuleRuntime$);
|
|
239
|
+
} else {
|
|
240
|
+
$ReactRefreshModuleRuntime$($ReactRefreshCurrentExports$);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/***/ })
|
|
244
|
+
|
|
245
|
+
}]);
|
|
246
|
+
//# sourceMappingURL=packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"static/js/async/packages_cli_doc-core_src_theme-default_components_Search_logic_search_ts.js","mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAIA;AACA;AAEA;AAEA;AAoCA;AAGA;AAEA;AACA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AAGA;AACA;AACA;AACA;AAEA;AAEA;AAGA;AAEA;AACA;AACA;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AACA;AACA;AAGA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AAEA;AACA;AAEA;AAKA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAKA;AAAA;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;AAIA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA","sources":["webpack://@modern-js/module-tools-docs/../../packages/cli/doc-core/src/theme-default/components/Search/logic/search.ts"],"sourcesContent":["import FlexSearch from 'flexsearch';\nimport type { Index as SearchIndex, CreateOptions } from 'flexsearch';\nimport { uniqBy } from 'lodash-es';\nimport { SearchOptions } from '..';\nimport { backTrackHeaders, normalizeContent } from './util';\nimport { normalizeHref, withBase } from '@/runtime';\nimport { PageBasicInfo } from '@/shared/types';\nimport { SEARCH_INDEX_JSON } from '@/shared/utils';\n\nconst THRESHOLD_CONTENT_LENGTH = 100;\n\nexport interface Header {\n id: string;\n text: string;\n depth: number;\n}\n\ninterface PageDataForSearch {\n title: string;\n content: string;\n path: string;\n rawHeaders: Header[];\n headers: string[];\n headerStr: string;\n}\n\ninterface CommonMatchResult {\n title: string;\n header: string;\n link: string;\n}\n\ninterface HeaderMatch extends CommonMatchResult {\n type: 'header';\n headerHighlightIndex: number;\n}\n\ninterface ContentMatch extends CommonMatchResult {\n type: 'content';\n statement: string;\n statementHighlightIndex: number;\n}\n\nexport type MatchResultItem = HeaderMatch | ContentMatch;\n\nconst cjkRegex =\n /[\\u3131-\\u314e|\\u314f-\\u3163|\\uac00-\\ud7a3]|[\\u4E00-\\u9FCC\\u3400-\\u4DB5\\uFA0E\\uFA0F\\uFA11\\uFA13\\uFA14\\uFA1F\\uFA21\\uFA23\\uFA24\\uFA27-\\uFA29]|[\\ud840-\\ud868][\\udc00-\\udfff]|\\ud869[\\udc00-\\uded6\\udf00-\\udfff]|[\\ud86a-\\ud86c][\\udc00-\\udfff]|\\ud86d[\\udc00-\\udf34\\udf40-\\udfff]|\\ud86e[\\udc00-\\udc1d]|[\\u3041-\\u3096]|[\\u30A1-\\u30FA]/giu;\n\nconst WHITE_PAGE_TYPES = ['home', 'api', '404', 'custom'];\n\nexport class PageSearcher {\n #index?: SearchIndex<PageDataForSearch[]>;\n\n #cjkIndex?: SearchIndex<PageDataForSearch[]>;\n\n #headerToIdMap: Record<string, string> = {};\n\n #langRoutePrefix: string;\n\n #defaultLang: string;\n\n #langs: string[] = [];\n\n #pages?: PageBasicInfo[];\n\n constructor(options: SearchOptions) {\n this.#langRoutePrefix = options.langRoutePrefix;\n this.#defaultLang = options.defaultLang;\n this.#langs = options.langs;\n }\n\n async init(options: CreateOptions = {}) {\n this.#pages = await this.#getPages();\n const pages = this.#pages.filter(page => {\n // Hit the default language route\n if (this.#langRoutePrefix === '/') {\n const otherLangsWithBase = this.#langs\n .filter(lang => lang !== this.#defaultLang)\n .map(lang => withBase(lang));\n return !otherLangsWithBase.every(otherLangWithBase =>\n page.routePath.startsWith(otherLangWithBase),\n );\n } else {\n return page.routePath.startsWith(withBase(this.#langRoutePrefix));\n }\n });\n\n const pagesForSearch: PageDataForSearch[] = pages\n .filter(page => {\n return !WHITE_PAGE_TYPES.includes(\n (page.frontmatter?.pageType as string) || '',\n );\n })\n .map(page => {\n const headers = (page.toc || []).map((header: Header) => header.text);\n return {\n title:\n page.title ??\n page.frontmatter?.title ??\n page.routePath.split('/').pop() ??\n '',\n headers,\n headerStr: headers.join(' '),\n content: normalizeContent(page.content || ''),\n path: page.routePath,\n rawHeaders: page.toc || [],\n };\n });\n this.#headerToIdMap = pages.reduce((acc: any, page: any) => {\n (page.toc || []).forEach((header: Header) => {\n // eslint-disable-next-line @typescript-eslint/restrict-plus-operands\n acc[page.routePath + header.text] = header.id;\n });\n return acc;\n }, {} as Record<string, string>);\n\n const createOptions: CreateOptions = {\n encode: 'simple',\n tokenize: 'forward',\n split: /\\W+/,\n async: true,\n doc: {\n id: 'path',\n field: ['title', 'headerStr', 'content'],\n },\n ...options,\n };\n // Init Search Indexes\n // English Index\n this.#index = FlexSearch.create(createOptions);\n // CJK: Chinese, Japanese, Korean\n this.#cjkIndex = FlexSearch.create({\n ...createOptions,\n encode: false,\n tokenize(str: string) {\n const cjkWords: string[] = [];\n let m: RegExpExecArray | null = null;\n do {\n m = cjkRegex.exec(str);\n if (m) {\n cjkWords.push(m[0]);\n }\n } while (m);\n return cjkWords;\n },\n });\n this.#index.add(pagesForSearch);\n this.#cjkIndex.add(pagesForSearch);\n }\n\n async match(query: string, limit = 7) {\n const searchResult = await Promise.all([\n this.#index?.search({\n query,\n limit,\n }),\n this.#cjkIndex?.search(query, limit),\n ]);\n const flattenSearchResult = searchResult\n .flat(2)\n .filter(Boolean) as PageDataForSearch[];\n const matchedResult: MatchResultItem[] = [];\n flattenSearchResult.forEach(item => {\n // Header match\n const matchedHeader = this.#matchHeader(item, query, matchedResult);\n // If we have matched header, we don't need to match content\n // Because the header is already in the content\n if (matchedHeader) {\n return;\n }\n // Content match\n this.#matchContent(item, query, matchedResult);\n });\n const res = uniqBy(matchedResult, 'link');\n return res;\n }\n\n async #getPages(): Promise<PageBasicInfo[]> {\n const result = await fetch(\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error __ASSET_PREFIX__ is injected by webpack\n `${__ASSET_PREFIX__}/static/${SEARCH_INDEX_JSON}`,\n );\n return result.json();\n }\n\n #matchHeader(\n item: PageDataForSearch,\n query: string,\n matchedResult: MatchResultItem[],\n ): boolean {\n const { headers, rawHeaders } = item;\n for (const [index, header] of headers.entries()) {\n if (header.includes(query)) {\n const headerAnchor = this.#headerToIdMap[item.path + header];\n // Find the all parent headers (except h1)\n // So we can show the full path of the header in search result\n // e.g. header2 > header3 > header4\n const headerGroup = backTrackHeaders(rawHeaders, index);\n const headerStr = headerGroup.map(item => item.text).join(' > ');\n matchedResult.push({\n type: 'header',\n title: item.title,\n header: headerStr,\n headerHighlightIndex: headerStr.indexOf(query),\n link: `${normalizeHref(item.path)}#${headerAnchor}`,\n });\n return true;\n }\n }\n return false;\n }\n\n #matchContent(\n item: PageDataForSearch,\n query: string,\n matchedResult: MatchResultItem[],\n ) {\n const { content, headers } = item;\n const queryIndex = content.indexOf(query);\n if (queryIndex === -1) {\n return;\n }\n const headersIndex = headers.map(h => content.indexOf(h));\n const currentHeaderIndex = headersIndex.findIndex((hIndex, position) => {\n if (position < headers.length - 1) {\n const next = headersIndex[position + 1];\n if (hIndex <= queryIndex && next >= queryIndex) {\n return true;\n }\n } else {\n return hIndex < queryIndex;\n }\n return false;\n });\n const currentHeader = headers[currentHeaderIndex] ?? item.title;\n\n let statementStartIndex = content.slice(0, queryIndex).lastIndexOf('\\n');\n statementStartIndex = statementStartIndex === -1 ? 0 : statementStartIndex;\n const statementEndIndex = content.indexOf('\\n', queryIndex + query.length);\n let statement = content.slice(statementStartIndex, statementEndIndex);\n if (statement.length > THRESHOLD_CONTENT_LENGTH) {\n statement = this.#normalizeStatement(statement, query);\n }\n matchedResult.push({\n type: 'content',\n title: item.title,\n header: currentHeader,\n statement,\n statementHighlightIndex: statement.indexOf(query),\n link: `${normalizeHref(item.path)}#${currentHeader}`,\n });\n }\n\n #normalizeStatement(statement: string, query: string) {\n // If statement is too long, we will only show 120 characters\n const queryIndex = statement.indexOf(query);\n const maxPrefixOrSuffix = Math.floor(\n (THRESHOLD_CONTENT_LENGTH - query.length) / 2,\n );\n let prefix = statement.slice(0, queryIndex);\n if (prefix.length > maxPrefixOrSuffix) {\n prefix = `...${statement.slice(\n queryIndex - maxPrefixOrSuffix + 3,\n queryIndex,\n )}`;\n }\n let suffix = statement.slice(queryIndex + query.length);\n if (suffix.length > maxPrefixOrSuffix) {\n suffix = `${statement.slice(\n queryIndex + query.length,\n queryIndex + maxPrefixOrSuffix - 3,\n )}...`;\n }\n return prefix + query + suffix;\n }\n}\n"],"names":[],"sourceRoot":""}
|