@modern-js/main-doc 2.0.3-alpha.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/index.md +0 -5
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/serve.md +2 -4
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/lambda.md +12 -12
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/api.md +13 -13
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/app.md +0 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/common.md +1 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/app.md +16 -9
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/index_.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/routes.md +5 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/server.md +6 -4
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/stories.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/test.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/define-config.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/hook.md +3 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +3 -6
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/create-app.md +1 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-loader.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-module-apps.md +58 -51
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-runtime-context.md +3 -4
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/index.md +0 -5
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +8 -5
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +1 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +3 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +0 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +0 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/router.md +23 -54
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/no-ssr.md +1 -8
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/pre-render.md +10 -6
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/render.md +0 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/css-in-js.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/head.md +3 -5
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/loadable.md +14 -15
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/hook.md +4 -5
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/middleware.md +7 -6
- package/en/docusaurus-plugin-content-docs/current/components/command-tip.md +3 -2
- package/en/docusaurus-plugin-content-docs/current/components/enable-bff.md +12 -16
- package/en/docusaurus-plugin-content-docs/current/components/enable-micro-frontend.md +4 -4
- package/en/docusaurus-plugin-content-docs/current/components/global-proxy-config.md +6 -9
- package/en/docusaurus-plugin-content-docs/current/components/global-proxy.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/components/micro-master-manifest-config.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/components/micro-runtime-config.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/components/reduck-migration.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/components/reduck-tip.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/components/router-legacy-tip.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/auto-load-plugin.md +8 -9
- package/en/docusaurus-plugin-content-docs/current/configure/app/bff/prefix.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/bff/proxy.md +8 -9
- package/en/docusaurus-plugin-content-docs/current/configure/app/builder-plugins.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/deploy/microFrontend.md +11 -13
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/asset-prefix.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/hmr.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/https.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/port.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/progress-bar.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/proxy.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/start-url.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/app-icon.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/crossorigin.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/disable-html-folder.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon-by-entries.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject-by-entries.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta-by-entries.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/mount-id.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/tags-by-entries.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/tags.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-by-entries.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters-by-entries.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/title-by-entries.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/title.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/asset-prefix.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/assets-retry.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/charset.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/clean-dist-path.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/convert-to-rem.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/copy.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/css-module-local-ident-name.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/data-uri-limit.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-extract.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-module-extension.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-filename-hash.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-inline-runtime-chunk.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-minimize.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-node-polyfill.md +8 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-source-map.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/dist-path.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-fallback.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-manifest.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-css-module-tsdeclaration.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-scripts.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-styles.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-latest-decorators.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/externals.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/filename.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/legal-comments.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/override-browserslist.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/polyfill.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/ssg.md +3 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/svg-default-export.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/build-cache.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/bundle-analyze.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/chunk-split.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/print-file-size.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/profile.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-console.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-moment-locale.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/intro.md +11 -10
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/master-app.md +1 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/state.md +15 -15
- package/en/docusaurus-plugin-content-docs/current/configure/app/security/sri.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/base-url.md +3 -4
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/enable-framework-ext.md +5 -4
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/port.md +24 -4
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/public-routes.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/routes.md +7 -7
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr-by-entries.md +5 -5
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr.md +4 -4
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/alias.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/compile-js-data-uri.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/config-dir.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/define.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/design-system.md +656 -634
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-default-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-entry-dirs.md +8 -8
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/enable-async-entry.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries-dir.md +7 -7
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries.md +4 -6
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/global-vars.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/include.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/module-scopes.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/pre-entry.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-extension-prefix.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-main-fields.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/autoprefixer.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/babel.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-extract.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-loader.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/dev-server.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/html-plugin.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/inspector.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/jest.md +9 -9
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/less.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/minify-css.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/postcss.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/pug.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/sass.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/style-loader.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/styled-components.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/swc.md +12 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/terser.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-checker.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-loader.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack-chain.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/frameworks.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/function.md +44 -38
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/index.md +9 -9
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/bff/type.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/code-split.md +3 -4
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/compatibility.md +6 -7
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/eslint.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/index.md +0 -5
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/low-level.md +17 -19
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/ssg.md +8 -10
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/ssr.md +5 -11
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/testing.md +3 -3
- package/en/docusaurus-plugin-content-docs/current/guides/advanced-features/web-server.md +3 -4
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/alias.md +7 -11
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/css-in-js.md +6 -6
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/css-modules.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/less-sass.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/postcss.md +43 -47
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/css/tailwindcss.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/data-fetch.md +106 -192
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/env-vars.md +8 -8
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/html.md +55 -47
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/mock.md +4 -4
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/proxy.md +4 -5
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/routes.md +90 -9
- package/en/docusaurus-plugin-content-docs/current/guides/concept/entries.md +1 -2
- package/en/docusaurus-plugin-content-docs/current/guides/get-started/quick-start.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/get-started/upgrade.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/extend.md +13 -13
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/hook-list.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/hook.md +57 -54
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/implement.md +11 -11
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/lifecycle.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/framework-plugin/plugin-api.md +4 -4
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/app.md +33 -33
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/ejs.md +3 -3
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/fs.md +3 -3
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/git.md +3 -2
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/handlebars.md +3 -4
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/json.md +9 -12
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/npm.md +2 -3
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/introduce.md +4 -3
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/run-in-js.md +4 -5
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/structure.md +13 -11
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/common.md +18 -27
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/abstract.md +1 -4
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +4 -5
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/hook/onForged.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +1 -4
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +1 -3
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/setInput.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/introduce.md +8 -9
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/develop.md +11 -12
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/use.md +8 -8
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/project.md +1 -2
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c01-introduction.md +7 -8
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c02-development.md +18 -21
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c03-main-app.md +41 -44
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c04-communicate.md +7 -5
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/micro-frontend/c05-mixed-stack.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/auto-actions.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/computed-state.md +0 -2
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/define-model.md +3 -6
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/faq.md +2 -5
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/manage-effects.md +2 -5
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/model-communicate.md +1 -4
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/performance.md +1 -5
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/quick-start.md +0 -6
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/redux-integration.md +3 -2
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/test-model.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/typescript-best-practice.md +13 -14
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/use-model.md +14 -12
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/model/use-out-of-modernjs.md +4 -6
- package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c01-start.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c03-css.md +6 -8
- package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c04-routes.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c05-loader.md +2 -1
- package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c07-container.md +5 -5
- package/en/docusaurus-plugin-content-docs/current/tutorials/first-app/c08-entries.md +5 -6
- package/package.json +4 -4
- package/scripts/config.ts +4 -2
- package/scripts/summary.en.json +1 -1
- package/scripts/summary.zh.json +1 -1
- package/scripts/sync.ts +1 -1
- package/zh/apis/app/commands/index.md +0 -5
- package/zh/apis/app/commands/lint.md +1 -1
- package/zh/apis/app/commands/serve.md +2 -4
- package/zh/apis/app/hooks/api/framework/lambda.md +12 -12
- package/zh/apis/app/hooks/api/functions/api.md +13 -13
- package/zh/apis/app/hooks/api/functions/app.md +0 -2
- package/zh/apis/app/hooks/api/functions/common.md +1 -1
- package/zh/apis/app/hooks/index.md +0 -5
- package/zh/apis/app/hooks/shared.md +0 -1
- package/zh/apis/app/hooks/src/app.md +16 -9
- package/zh/apis/app/hooks/src/index_.md +0 -2
- package/zh/apis/app/hooks/src/routes.md +6 -7
- package/zh/apis/app/hooks/src/server.md +6 -4
- package/zh/apis/app/hooks/src/stories.md +1 -1
- package/zh/apis/app/hooks/src/test.md +1 -1
- package/zh/apis/app/runtime/app/define-config.md +1 -2
- package/zh/apis/app/runtime/bff/hook.md +3 -3
- package/zh/apis/app/runtime/core/bootstrap.md +2 -3
- package/zh/apis/app/runtime/core/use-loader.md +2 -2
- package/zh/apis/app/runtime/core/use-module-apps.md +53 -50
- package/zh/apis/app/runtime/core/use-runtime-context.md +3 -4
- package/zh/apis/app/runtime/index.md +0 -5
- package/zh/apis/app/runtime/model/Provider.md +1 -0
- package/zh/apis/app/runtime/model/auto-actions.md +1 -1
- package/zh/apis/app/runtime/model/connect.md +9 -5
- package/zh/apis/app/runtime/model/create-app.md +3 -3
- package/zh/apis/app/runtime/model/create-store.md +2 -4
- package/zh/apis/app/runtime/model/handle-effect.md +3 -4
- package/zh/apis/app/runtime/model/model_.md +0 -3
- package/zh/apis/app/runtime/model/use-local-model.md +0 -1
- package/zh/apis/app/runtime/model/use-store.md +0 -2
- package/zh/apis/app/runtime/router/router.md +23 -53
- package/zh/apis/app/runtime/ssr/no-ssr.md +1 -5
- package/zh/apis/app/runtime/ssr/pre-render.md +10 -6
- package/zh/apis/app/runtime/testing/cleanup.md +2 -2
- package/zh/apis/app/runtime/testing/render.md +0 -2
- package/zh/apis/app/runtime/utility/css-in-js.md +2 -2
- package/zh/apis/app/runtime/utility/head.md +3 -5
- package/zh/apis/app/runtime/utility/loadable.md +14 -15
- package/zh/apis/app/runtime/web-server/hook.md +5 -4
- package/zh/apis/app/runtime/web-server/middleware.md +8 -6
- package/zh/apis/monorepo/commands/bump.md +1 -1
- package/zh/apis/monorepo/commands/change.md +3 -2
- package/zh/apis/monorepo/commands/gen-release-note.md +1 -2
- package/zh/apis/monorepo/commands/index.md +1 -6
- package/zh/apis/monorepo/commands/lint.md +1 -1
- package/zh/apis/monorepo/commands/release.md +0 -1
- package/zh/apis/monorepo/hooks/index.md +1 -6
- package/zh/components/command-tip.md +3 -2
- package/zh/components/enable-bff.md +12 -16
- package/zh/components/enable-micro-frontend.md +4 -4
- package/zh/components/global-proxy-config.md +6 -9
- package/zh/components/global-proxy.md +0 -1
- package/zh/components/init-app.md +0 -1
- package/zh/components/micro-master-manifest-config.md +2 -2
- package/zh/components/micro-runtime-config.md +1 -1
- package/zh/components/reduck-migration.md +0 -1
- package/zh/components/router-legacy-tip.md +0 -1
- package/zh/configure/app/auto-load-plugin.md +9 -10
- package/zh/configure/app/bff/prefix.md +6 -10
- package/zh/configure/app/bff/proxy.md +9 -8
- package/zh/configure/app/builder-plugins.md +6 -6
- package/zh/configure/app/deploy/microFrontend.md +11 -11
- package/zh/configure/app/dev/asset-prefix.md +2 -2
- package/zh/configure/app/dev/hmr.md +2 -2
- package/zh/configure/app/dev/https.md +2 -2
- package/zh/configure/app/dev/port.md +2 -2
- package/zh/configure/app/dev/progress-bar.md +2 -2
- package/zh/configure/app/dev/proxy.md +0 -1
- package/zh/configure/app/dev/start-url.md +2 -2
- package/zh/configure/app/experiments/lazy-compilation.md +2 -2
- package/zh/configure/app/html/app-icon.md +2 -2
- package/zh/configure/app/html/crossorigin.md +2 -2
- package/zh/configure/app/html/disable-html-folder.md +2 -2
- package/zh/configure/app/html/favicon-by-entries.md +2 -2
- package/zh/configure/app/html/favicon.md +2 -2
- package/zh/configure/app/html/inject-by-entries.md +2 -2
- package/zh/configure/app/html/inject.md +2 -2
- package/zh/configure/app/html/meta-by-entries.md +2 -2
- package/zh/configure/app/html/meta.md +2 -2
- package/zh/configure/app/html/mount-id.md +2 -2
- package/zh/configure/app/html/tags-by-entries.md +12 -0
- package/zh/configure/app/html/tags.md +12 -0
- package/zh/configure/app/html/template-by-entries.md +2 -2
- package/zh/configure/app/html/template-parameters-by-entries.md +2 -2
- package/zh/configure/app/html/template-parameters.md +2 -2
- package/zh/configure/app/html/template.md +2 -2
- package/zh/configure/app/html/title-by-entries.md +2 -2
- package/zh/configure/app/html/title.md +2 -2
- package/zh/configure/app/output/asset-prefix.md +2 -2
- package/zh/configure/app/output/assets-retry.md +2 -2
- package/zh/configure/app/output/charset.md +2 -2
- package/zh/configure/app/output/clean-dist-path.md +2 -2
- package/zh/configure/app/output/convert-to-rem.md +2 -2
- package/zh/configure/app/output/copy.md +2 -2
- package/zh/configure/app/output/css-module-local-ident-name.md +2 -2
- package/zh/configure/app/output/data-uri-limit.md +2 -2
- package/zh/configure/app/output/disable-css-extract.md +2 -2
- package/zh/configure/app/output/disable-css-module-extension.md +2 -2
- package/zh/configure/app/output/disable-filename-hash.md +2 -2
- package/zh/configure/app/output/disable-inline-runtime-chunk.md +2 -2
- package/zh/configure/app/output/disable-minimize.md +2 -2
- package/zh/configure/app/output/disable-node-polyfill.md +8 -8
- package/zh/configure/app/output/disable-source-map.md +2 -2
- package/zh/configure/app/output/disable-ts-checker.md +2 -2
- package/zh/configure/app/output/dist-path.md +2 -2
- package/zh/configure/app/output/enable-asset-fallback.md +2 -2
- package/zh/configure/app/output/enable-asset-manifest.md +2 -2
- package/zh/configure/app/output/enable-css-module-tsdeclaration.md +2 -2
- package/zh/configure/app/output/enable-inline-scripts.md +2 -2
- package/zh/configure/app/output/enable-inline-styles.md +2 -2
- package/zh/configure/app/output/enable-latest-decorators.md +2 -2
- package/zh/configure/app/output/externals.md +2 -2
- package/zh/configure/app/output/filename.md +2 -2
- package/zh/configure/app/output/legal-comments.md +2 -2
- package/zh/configure/app/output/override-browserslist.md +2 -2
- package/zh/configure/app/output/polyfill.md +2 -2
- package/zh/configure/app/output/ssg.md +3 -2
- package/zh/configure/app/output/svg-default-export.md +2 -2
- package/zh/configure/app/performance/build-cache.md +2 -2
- package/zh/configure/app/performance/bundle-analyze.md +2 -2
- package/zh/configure/app/performance/chunk-split.md +2 -2
- package/zh/configure/app/performance/print-file-size.md +2 -2
- package/zh/configure/app/performance/profile.md +2 -2
- package/zh/configure/app/performance/remove-console.md +2 -2
- package/zh/configure/app/performance/remove-moment-locale.md +2 -2
- package/zh/configure/app/plugins.md +6 -6
- package/zh/configure/app/runtime/intro.md +12 -11
- package/zh/configure/app/runtime/master-app.md +1 -2
- package/zh/configure/app/runtime/router.md +6 -7
- package/zh/configure/app/runtime/state.md +15 -16
- package/zh/configure/app/security/sri.md +2 -2
- package/zh/configure/app/server/base-url.md +3 -6
- package/zh/configure/app/server/enable-framework-ext.md +5 -4
- package/zh/configure/app/server/port.md +24 -6
- package/zh/configure/app/server/public-routes.md +6 -8
- package/zh/configure/app/server/routes.md +6 -6
- package/zh/configure/app/server/ssr-by-entries.md +5 -8
- package/zh/configure/app/server/ssr.md +4 -5
- package/zh/configure/app/source/alias.md +2 -2
- package/zh/configure/app/source/compile-js-data-uri.md +2 -2
- package/zh/configure/app/source/config-dir.md +2 -2
- package/zh/configure/app/source/define.md +2 -2
- package/zh/configure/app/source/design-system.md +656 -630
- package/zh/configure/app/source/disable-default-entries.md +3 -3
- package/zh/configure/app/source/disable-entry-dirs.md +8 -7
- package/zh/configure/app/source/enable-async-entry.md +3 -3
- package/zh/configure/app/source/entries-dir.md +7 -7
- package/zh/configure/app/source/entries.md +5 -6
- package/zh/configure/app/source/exclude.md +2 -2
- package/zh/configure/app/source/global-vars.md +2 -2
- package/zh/configure/app/source/include.md +2 -2
- package/zh/configure/app/source/module-scopes.md +2 -2
- package/zh/configure/app/source/pre-entry.md +2 -2
- package/zh/configure/app/source/resolve-extension-prefix.md +2 -2
- package/zh/configure/app/source/resolve-main-fields.md +2 -2
- package/zh/configure/app/testing/transformer.md +2 -3
- package/zh/configure/app/tools/autoprefixer.md +2 -2
- package/zh/configure/app/tools/babel.md +2 -2
- package/zh/configure/app/tools/css-extract.md +2 -2
- package/zh/configure/app/tools/css-loader.md +2 -2
- package/zh/configure/app/tools/dev-server.md +2 -2
- package/zh/configure/app/tools/html-plugin.md +2 -2
- package/zh/configure/app/tools/inspector.md +2 -2
- package/zh/configure/app/tools/jest.md +9 -9
- package/zh/configure/app/tools/less.md +2 -2
- package/zh/configure/app/tools/minify-css.md +2 -2
- package/zh/configure/app/tools/postcss.md +2 -2
- package/zh/configure/app/tools/pug.md +2 -2
- package/zh/configure/app/tools/sass.md +2 -2
- package/zh/configure/app/tools/style-loader.md +2 -2
- package/zh/configure/app/tools/styled-components.md +2 -2
- package/zh/configure/app/tools/swc.md +12 -1
- package/zh/configure/app/tools/terser.md +2 -2
- package/zh/configure/app/tools/ts-checker.md +2 -2
- package/zh/configure/app/tools/ts-loader.md +2 -2
- package/zh/configure/app/tools/webpack-chain.md +2 -2
- package/zh/configure/app/tools/webpack.md +2 -2
- package/zh/guides/advanced-features/bff/frameworks.md +6 -6
- package/zh/guides/advanced-features/bff/function.md +49 -44
- package/zh/guides/advanced-features/bff/index.md +9 -9
- package/zh/guides/advanced-features/bff/type.md +0 -1
- package/zh/guides/advanced-features/code-split.md +3 -3
- package/zh/guides/advanced-features/compatibility.md +6 -7
- package/zh/guides/advanced-features/eslint.md +0 -1
- package/zh/guides/advanced-features/index.md +0 -5
- package/zh/guides/advanced-features/low-level.md +17 -19
- package/zh/guides/advanced-features/ssg.md +8 -9
- package/zh/guides/advanced-features/ssr.md +5 -11
- package/zh/guides/advanced-features/testing.md +3 -2
- package/zh/guides/advanced-features/web-server.md +3 -4
- package/zh/guides/basic-features/alias.md +7 -11
- package/zh/guides/basic-features/css/css-in-js.md +5 -5
- package/zh/guides/basic-features/css/css-modules.md +2 -2
- package/zh/guides/basic-features/css/postcss.md +42 -46
- package/zh/guides/basic-features/css/tailwindcss.md +5 -5
- package/zh/guides/basic-features/data-fetch.md +109 -192
- package/zh/guides/basic-features/env-vars.md +7 -6
- package/zh/guides/basic-features/html.md +54 -46
- package/zh/guides/basic-features/index.md +0 -5
- package/zh/guides/basic-features/mock.md +4 -4
- package/zh/guides/basic-features/proxy.md +4 -5
- package/zh/guides/basic-features/routes.md +23 -20
- package/zh/guides/concept/entries.md +5 -7
- package/zh/guides/get-started/quick-start.md +3 -4
- package/zh/guides/topic-detail/changesets/add.md +1 -3
- package/zh/guides/topic-detail/changesets/changelog.md +30 -31
- package/zh/guides/topic-detail/changesets/commit.md +44 -45
- package/zh/guides/topic-detail/changesets/config.md +2 -1
- package/zh/guides/topic-detail/changesets/github.md +6 -10
- package/zh/guides/topic-detail/changesets/introduce.md +0 -1
- package/zh/guides/topic-detail/changesets/release-note.md +9 -12
- package/zh/guides/topic-detail/changesets/release-pre.md +1 -1
- package/zh/guides/topic-detail/framework-plugin/extend.md +13 -13
- package/zh/guides/topic-detail/framework-plugin/hook-list.md +2 -2
- package/zh/guides/topic-detail/framework-plugin/hook.md +57 -54
- package/zh/guides/topic-detail/framework-plugin/implement.md +11 -11
- package/zh/guides/topic-detail/framework-plugin/plugin-api.md +4 -4
- package/zh/guides/topic-detail/generator/codesmith/api/app.md +36 -36
- package/zh/guides/topic-detail/generator/codesmith/api/ejs.md +2 -2
- package/zh/guides/topic-detail/generator/codesmith/api/fs.md +2 -2
- package/zh/guides/topic-detail/generator/codesmith/api/git.md +3 -2
- package/zh/guides/topic-detail/generator/codesmith/api/handlebars.md +2 -2
- package/zh/guides/topic-detail/generator/codesmith/api/json.md +9 -11
- package/zh/guides/topic-detail/generator/codesmith/api/npm.md +4 -2
- package/zh/guides/topic-detail/generator/codesmith/introduce.md +20 -7
- package/zh/guides/topic-detail/generator/codesmith/run-in-js.md +4 -5
- package/zh/guides/topic-detail/generator/codesmith/structure.md +13 -10
- package/zh/guides/topic-detail/generator/config/common.md +18 -27
- package/zh/guides/topic-detail/generator/plugin/abstract.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -0
- package/zh/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +4 -4
- package/zh/guides/topic-detail/generator/plugin/api/info/locale.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +2 -2
- package/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +3 -4
- package/zh/guides/topic-detail/generator/plugin/api/input/setInput.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/introduce.md +8 -9
- package/zh/guides/topic-detail/generator/plugin/develop.md +13 -13
- package/zh/guides/topic-detail/generator/plugin/use.md +8 -8
- package/zh/guides/topic-detail/generator/project.md +1 -1
- package/zh/guides/topic-detail/micro-frontend/c01-introduction.md +7 -8
- package/zh/guides/topic-detail/micro-frontend/c02-development.md +20 -23
- package/zh/guides/topic-detail/micro-frontend/c03-main-app.md +41 -44
- package/zh/guides/topic-detail/micro-frontend/c04-communicate.md +7 -5
- package/zh/guides/topic-detail/micro-frontend/c05-mixed-stack.md +1 -1
- package/zh/guides/topic-detail/model/auto-actions.md +0 -1
- package/zh/guides/topic-detail/model/computed-state.md +0 -2
- package/zh/guides/topic-detail/model/define-model.md +3 -6
- package/zh/guides/topic-detail/model/faq.md +2 -5
- package/zh/guides/topic-detail/model/manage-effects.md +2 -5
- package/zh/guides/topic-detail/model/model-communicate.md +1 -4
- package/zh/guides/topic-detail/model/performance.md +1 -5
- package/zh/guides/topic-detail/model/quick-start.md +0 -6
- package/zh/guides/topic-detail/model/redux-integration.md +3 -2
- package/zh/guides/topic-detail/model/test-model.md +1 -1
- package/zh/guides/topic-detail/model/typescript-best-practice.md +13 -14
- package/zh/guides/topic-detail/model/use-model.md +14 -12
- package/zh/guides/topic-detail/model/use-out-of-modernjs.md +4 -6
- package/zh/guides/topic-detail/monorepo/intro.md +0 -1
- package/zh/guides/topic-detail/monorepo/sub-project-interface.md +14 -7
- package/zh/tutorials/first-app/c01-start.md +2 -2
- package/zh/tutorials/first-app/c03-css.md +6 -9
- package/zh/tutorials/first-app/c04-routes.md +1 -1
- package/zh/tutorials/first-app/c05-loader.md +2 -1
- package/zh/tutorials/first-app/c07-container.md +6 -7
- package/zh/tutorials/first-app/c08-entries.md +5 -7
@@ -2,7 +2,6 @@
|
|
2
2
|
sidebar_position: 4
|
3
3
|
---
|
4
4
|
|
5
|
-
|
6
5
|
# Execute microgenerator with JS code
|
7
6
|
|
8
7
|
In addition to using the cli method to execute the micro generator, we inevitably need to execute the micro generator in the code. The following describes how to execute the micro generator in the js code.
|
@@ -15,17 +14,17 @@ pnpm add @modern-js/codesmith
|
|
15
14
|
|
16
15
|
## Create codesmith instance
|
17
16
|
|
18
|
-
```
|
17
|
+
```ts
|
19
18
|
import { CodeSmith, Logger } from '@modern-js/codesmith';
|
20
19
|
|
21
20
|
const smith = new CodeSmith({
|
22
|
-
|
21
|
+
debug: false, //Whether to enable debug mode, if true, the debug information in the generator will be displayed
|
23
22
|
});
|
24
23
|
```
|
25
24
|
|
26
25
|
## Call the forge method to execute the generator
|
27
26
|
|
28
|
-
```
|
27
|
+
```ts
|
29
28
|
type RunnerTask = Array<{
|
30
29
|
name: string;
|
31
30
|
config: Record<string, any>;
|
@@ -33,7 +32,7 @@ type RunnerTask = Array<{
|
|
33
32
|
|
34
33
|
const task: RunnerTask = [
|
35
34
|
{
|
36
|
-
name:
|
35
|
+
name: 'generator', // generator npm package name
|
37
36
|
config: {}, //The default configuration performed by the generator
|
38
37
|
},
|
39
38
|
];
|
@@ -14,10 +14,11 @@ NPM package description information, including name, version, main and other fie
|
|
14
14
|
|
15
15
|
The js file corresponding to the above main field. The file exports a generator function by default, and the function format is as follows:
|
16
16
|
|
17
|
-
```
|
18
|
-
export default async (
|
19
|
-
|
20
|
-
|
17
|
+
```ts
|
18
|
+
export default async (
|
19
|
+
context: GeneratorContext,
|
20
|
+
generator: GeneratorCore,
|
21
|
+
) => {};
|
21
22
|
```
|
22
23
|
|
23
24
|
The function parameters are context and generator:
|
@@ -26,12 +27,12 @@ The function parameters are context and generator:
|
|
26
27
|
|
27
28
|
Context provides context information maintained by the codesmith runtime. Its type is defined as:
|
28
29
|
|
29
|
-
```
|
30
|
+
```ts
|
30
31
|
interface GeneratorContext {
|
31
32
|
materials: Record<string, FsMaterial>;
|
32
33
|
config: Record<string, any>;
|
33
34
|
data?: Record<string, any>;
|
34
|
-
current: { material: FsMaterial
|
35
|
+
current: { material: FsMaterial } | null;
|
35
36
|
[key: string]: any;
|
36
37
|
}
|
37
38
|
```
|
@@ -42,8 +43,10 @@ Materials also maintains this default mapping relationship, which is used to mai
|
|
42
43
|
|
43
44
|
For example, when you need to modify a field in the `package.json` of the current project:
|
44
45
|
|
45
|
-
```
|
46
|
-
const resource = context.materials.default.get(
|
46
|
+
```ts
|
47
|
+
const resource = context.materials.default.get(
|
48
|
+
path.join(appDir, 'package.json'),
|
49
|
+
);
|
47
50
|
```
|
48
51
|
|
49
52
|
Pass the acquired resources to the JSON API provided by codesmith to implement json operations.
|
@@ -54,7 +57,7 @@ The get method is provided in `FsMaterial` to get the resource file and pass the
|
|
54
57
|
|
55
58
|
For example:
|
56
59
|
|
57
|
-
```
|
60
|
+
```ts
|
58
61
|
const resourceMap = await material.find('templates/**/*');
|
59
62
|
```
|
60
63
|
|
@@ -64,7 +67,7 @@ All template files in the generator that match to the `templates /**/*` rules ca
|
|
64
67
|
|
65
68
|
Generator provides the function method of the codesmith runtime. Its type is defined as:
|
66
69
|
|
67
|
-
```
|
70
|
+
```ts
|
68
71
|
interface GeneratorCore {
|
69
72
|
logger: Logger;
|
70
73
|
outputPath: string;
|
@@ -77,7 +80,6 @@ interface GeneratorCore {
|
|
77
80
|
|
78
81
|
The outputPath and the `materials.default` in the context point to the same directory, the outputPath is used to directly calculate the target path and operate, and the `materials.default` is used to obtain resource files.
|
79
82
|
|
80
|
-
|
81
83
|
`runSubGenerator` provides a way to run other microgenerators in one microgenerator, which will automatically update and maintain new context information.
|
82
84
|
|
83
85
|
## Template File
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/common.md
CHANGED
@@ -42,7 +42,6 @@ Package management tool (packageManager), the options are as follows:
|
|
42
42
|
|
43
43
|
- Yarn(yarn)
|
44
44
|
|
45
|
-
|
46
45
|
:::info
|
47
46
|
In the custom type of the generator plugin to create a project scenario, only the `packageManager` configuration is provided by default.
|
48
47
|
:::
|
@@ -51,56 +50,48 @@ In the custom type of the generator plugin to create a project scenario, only th
|
|
51
50
|
|
52
51
|
### noNeedInstall
|
53
52
|
|
54
|
-
|
55
|
-
|
56
|
-
* Default: false
|
53
|
+
- Type: `boolean`
|
54
|
+
- Default: `false`
|
57
55
|
|
58
56
|
Whether to skip the dependency installation.
|
59
57
|
|
60
58
|
### noNeedGit
|
61
59
|
|
62
|
-
|
63
|
-
|
64
|
-
* Default: false
|
60
|
+
- Type: `boolean`
|
61
|
+
- Default: `false`
|
65
62
|
|
66
63
|
Whether to skip git initialization and commit initial commit.
|
67
64
|
|
68
65
|
### successInfo
|
69
66
|
|
70
|
-
|
71
|
-
|
72
|
-
* Default: Command operation prompts for different project schemes.
|
67
|
+
- Type: `string`
|
68
|
+
- Default: Command operation prompts for different project schemes.
|
73
69
|
|
74
70
|
Customize prompt information to create project success.
|
75
71
|
|
76
72
|
### isMonorepoSubProject
|
77
73
|
|
78
|
-
|
79
|
-
|
80
|
-
* Default: false
|
74
|
+
- Type: `boolean`
|
75
|
+
- Default: `false`
|
81
76
|
|
82
77
|
Whether it is a Monorepo subproject.
|
83
78
|
|
84
79
|
### isTest
|
85
80
|
|
86
|
-
|
87
|
-
|
88
|
-
- true: create project to `examples/`
|
81
|
+
- Type: `boolean`
|
82
|
+
- Default: `false`
|
89
83
|
|
90
|
-
|
84
|
+
Works on an Application project to identify whether it is a test project.
|
91
85
|
|
92
|
-
|
93
|
-
|
94
|
-
Works on an Application (MWA) project to identify whether it is a test project.
|
86
|
+
- `true`: create project to `examples/`
|
87
|
+
- `false`: create project to `apps/`
|
95
88
|
|
96
89
|
### isPublic
|
97
90
|
|
98
|
-
|
99
|
-
|
100
|
-
- true: create project to `packages/`
|
101
|
-
|
102
|
-
- false: create project to `features/`
|
103
|
-
|
104
|
-
* Default: false
|
91
|
+
- Type: `boolean`
|
92
|
+
- Default: `false`
|
105
93
|
|
106
94
|
Used in the Module project to identify whether it needs to be published to npm.
|
95
|
+
|
96
|
+
- `true`: create project to `packages/`
|
97
|
+
- `false`: create project to `features/`
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/abstract.md
CHANGED
@@ -4,13 +4,12 @@ sidebar_position: 1
|
|
4
4
|
|
5
5
|
# Why do you need a generator plugin
|
6
6
|
|
7
|
-
Modern.js provides application
|
7
|
+
Modern.js provides application, modules and Monorepo three engineering solutions, and by using the `@modern-js/create` tool can create the initial project template of the three engineering solutions, the initial project template will provide basic code development environment, simple sample code and configuration, etc.
|
8
8
|
|
9
9
|
Modern.js provides an initialization template that is versatile and can meet some general project development needs.
|
10
10
|
|
11
11
|
When you use Modern.js in depth, you will inevitably find that every time you create a project, you will make some similar changes specific to your own project, such as modifying the sample code, adding some configuration, enabling some functions, etc.
|
12
12
|
|
13
|
-
|
14
13
|
The generator plugin can help you precipitate these individual or team-specific changes. Simply bring the `--plugin` parameter when executing `npx @modern-js/create` to avoid the need to repeatedly modify the project every time the project is created..
|
15
14
|
|
16
15
|
The generator plugin is based on the initialization template project provided by the Modern.js, providing methods to add, delete and modify templates, and modifying `package.json`, `modernConfig` configuration and opening functions in a fast way.
|
@@ -19,8 +18,6 @@ The generator plugin provides two ways of customization:
|
|
19
18
|
|
20
19
|
1. Extended engineering: directly customize the three major engineering provided by default.
|
21
20
|
|
22
|
-
|
23
21
|
2. Create engineering scenes: Create corresponding engineering scenes based on the default three major engineering.
|
24
22
|
|
25
|
-
|
26
23
|
The next step will introduce how to use and develop the generator plugin step by step.
|
@@ -22,7 +22,7 @@ The jsx or tsx file using the variable is a binary file, and its syntax conflict
|
|
22
22
|
|
23
23
|
- JSON files: Files in JSON format, such as `package.json`, `tsconfig.json`.
|
24
24
|
|
25
|
-
-
|
25
|
+
- Text List File: A file consisting of lines of text, such as `.gitignore`, `.editorconfig`, `.npmrc`.
|
26
26
|
|
27
27
|
The file manipulation API for the generator plugin will operate on these four file types.
|
28
28
|
|
@@ -34,19 +34,18 @@ This information is represented in Record form.
|
|
34
34
|
|
35
35
|
For example, the name field needs to be updated:
|
36
36
|
|
37
|
-
|
38
37
|
```ts
|
39
38
|
api.updateJSONFile(file, {
|
40
|
-
|
41
|
-
})
|
39
|
+
name: 'new name',
|
40
|
+
});
|
42
41
|
```
|
43
42
|
|
44
43
|
Nested fields need to be updated:
|
45
44
|
|
46
45
|
```ts
|
47
46
|
api.updateJSONFile(file, {
|
48
|
-
|
49
|
-
})
|
47
|
+
'dependencies.name': 'new name',
|
48
|
+
});
|
50
49
|
```
|
51
50
|
|
52
51
|
:::warning
|
@@ -30,7 +30,6 @@ The onForged parameter is a callback function, and the function parameters are `
|
|
30
30
|
|
31
31
|
A list of supported functions in `onForged` time to live, specifically viewable [File API] (/docs/guides/topic-detail/generator/plugin/api/file/introduce) and [Enable function API] (/docs/guides/topic-detail/generator/plugin/api/new/introduce).
|
32
32
|
|
33
|
-
|
34
33
|
### inputData
|
35
34
|
|
36
35
|
Current user input, the user can be used to obtain the current input information and configuration information.
|
@@ -25,7 +25,6 @@ Modern.js the problem keyword of the configuration of the engineering solution,
|
|
25
25
|
|
26
26
|
Questions that need to be added, specific type definition viewable [Customize input related type definition](/docs/guides/topic-detail/generator/plugin/api/input/type).
|
27
27
|
|
28
|
-
|
29
28
|
## Example
|
30
29
|
|
31
30
|
Add input after package management tool:
|
@@ -43,15 +42,13 @@ context.addInputAfter('packageManager', {
|
|
43
42
|
],
|
44
43
|
},
|
45
44
|
},
|
46
|
-
})
|
45
|
+
});
|
47
46
|
```
|
48
47
|
|
49
48
|
:::info Notes
|
50
49
|
1. The key of the added question cannot be duplicated with the key of the question of the item type itself provided by the Modern.js.
|
51
50
|
|
52
|
-
|
53
51
|
2. The priority of adding the problem `addInputAfter` is higher than `addInputBefore`. When adding After problem to one `key` and Before problem to the next key at the same time, After problem will be before Before.
|
54
52
|
|
55
|
-
|
56
53
|
3. When multiple questions need to be added before or after the same `key`, the method can be called multiple times, and the order of questions will be permutated in the order in which they are called.
|
57
54
|
:::
|
@@ -42,15 +42,13 @@ context.addInputBefore('packageManager', {
|
|
42
42
|
],
|
43
43
|
},
|
44
44
|
},
|
45
|
-
})
|
45
|
+
});
|
46
46
|
```
|
47
47
|
|
48
48
|
:::info Notes
|
49
49
|
1. The key of the added question cannot be duplicated with the key of the question of the item type itself provided by the Modern.js.
|
50
50
|
|
51
|
-
|
52
51
|
2. The priority of adding the problem `addInputAfter` is higher than `addInputBefore`. When adding After problem to one `key` and Before problem to the next key at the same time, After problem will be before Before.
|
53
52
|
|
54
|
-
|
55
53
|
3. When multiple questions need to be added before or after the same `key`, the method can be called multiple times, and the order of questions will be permutated in the order in which they are called.
|
56
54
|
:::
|
@@ -10,7 +10,6 @@ Modern.js supports the customization of the provided engineering solutions by me
|
|
10
10
|
|
11
11
|
The generator plugin is a module that can be developed directly using Modern.js module engineering solutions. Of course, Modern.js also provides the corresponding generator plugin (`@modern-js/generator-plugin-plugin`) to directly create a new generator plugin project.
|
12
12
|
|
13
|
-
|
14
13
|
A generator plugin project directory is as follows:
|
15
14
|
|
16
15
|
```bash
|
@@ -44,9 +43,9 @@ The classification of the generator plugin is provided by the meta information i
|
|
44
43
|
|
45
44
|
```json
|
46
45
|
{
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
"meta": {
|
47
|
+
"extend": "mwa" // The three engineering is mwa, module, monorepo
|
48
|
+
}
|
50
49
|
}
|
51
50
|
```
|
52
51
|
|
@@ -54,11 +53,11 @@ The classification of the generator plugin is provided by the meta information i
|
|
54
53
|
|
55
54
|
```json
|
56
55
|
{
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
56
|
+
"meta": {
|
57
|
+
"key": "new_solution",
|
58
|
+
"name": "New Solution",
|
59
|
+
"type": "mwa" // In addition to the three major engineering solutions, the type here also supports the customize (custom) type
|
60
|
+
}
|
62
61
|
}
|
63
62
|
```
|
64
63
|
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/develop.md
CHANGED
@@ -41,7 +41,7 @@ Different plugin types will ask different questions. You can choose the plugin t
|
|
41
41
|
After the execution of the create project command is completed, a project for developing the generator plugin will be generated accordingly, and the `meta` information will also be generated according to your selection in the `package.json`.
|
42
42
|
|
43
43
|
:::info
|
44
|
-
For generator plugin development, please refer to
|
44
|
+
For generator plugin development, please refer to `@modern-js/generator-plugin-plugin`. [Source Code](https://github.com/modern-js-dev/modern.js/tree/main/packages/generator/plugins/generator-plugin)
|
45
45
|
:::
|
46
46
|
|
47
47
|
## Develop plugin logic
|
@@ -50,7 +50,6 @@ Complete plugin logic development in `src/index.ts`.
|
|
50
50
|
|
51
51
|
The plugin exports a function by default, the function parameter is `context`, and some methods are provided on `context` to directly operate on the current project.
|
52
52
|
|
53
|
-
|
54
53
|
A brief introduction to the provided methods, the complete API list viewable [Generator Plugin API](/docs/guides/topic-detail/generator/plugin/api/introduce).
|
55
54
|
|
56
55
|
### Customize input
|
@@ -78,8 +77,8 @@ context.addInputBefore('input2', {
|
|
78
77
|
Set attributes of existing problems.
|
79
78
|
|
80
79
|
```ts
|
81
|
-
context.setInput('test', 'type', 'number')
|
82
|
-
context.setInput('test', 'enum', [{ value: 'option1', label: '选项一' }])
|
80
|
+
context.setInput('test', 'type', 'number');
|
81
|
+
context.setInput('test', 'enum', [{ value: 'option1', label: '选项一' }]);
|
83
82
|
```
|
84
83
|
|
85
84
|
### onForged
|
@@ -98,14 +97,14 @@ API functions supported in `onForged` can also be found in [Generator Plugin API
|
|
98
97
|
|
99
98
|
```ts
|
100
99
|
context.onForged(async (api: ForgedAPI, input: Record<string, unknown>) => {
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
})
|
100
|
+
const { language } = input;
|
101
|
+
api.addFile({
|
102
|
+
type: FileType.Text,
|
103
|
+
file: `src/index.${language as string}`,
|
104
|
+
templateFile: `index.${language as string}.handlebars`,
|
105
|
+
force: true,
|
106
|
+
});
|
107
|
+
});
|
109
108
|
```
|
110
109
|
|
111
110
|
### afterForged
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/use.md
CHANGED
@@ -30,9 +30,9 @@ The classification of the generator plugin is provided by the meta information i
|
|
30
30
|
|
31
31
|
```json
|
32
32
|
{
|
33
|
-
|
34
|
-
|
35
|
-
|
33
|
+
"meta": {
|
34
|
+
"extend": "mwa" // The three engineering is mwa, module, monorepo
|
35
|
+
}
|
36
36
|
}
|
37
37
|
```
|
38
38
|
|
@@ -40,11 +40,11 @@ The classification of the generator plugin is provided by the meta information i
|
|
40
40
|
|
41
41
|
```json
|
42
42
|
{
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
43
|
+
"meta": {
|
44
|
+
"key": "new_solution",
|
45
|
+
"name": "New Solution",
|
46
|
+
"type": "mwa" // In addition to the three major engineering solutions, the type here also supports the customize (custom) type
|
47
|
+
}
|
48
48
|
}
|
49
49
|
```
|
50
50
|
|
@@ -56,7 +56,7 @@ npx @modern-js/create --config '{"packageManager": "pnpm"}'
|
|
56
56
|
|
57
57
|
Specific configuration information viewable [Project Configuration](/docs/guides/topic-detail/generator/config/common).
|
58
58
|
|
59
|
-
###
|
59
|
+
### --no-need-install
|
60
60
|
|
61
61
|
By default, `@modern-js/create` automatically installs dependency after the project is created, use this parameter to ignore the install dependency step.
|
62
62
|
|
@@ -114,5 +114,4 @@ A project is created by specifying a specific package version dependency.
|
|
114
114
|
|
115
115
|
If you need to specify a specific package version when creating a project, you can use this parameter. This parameter will lock the package version number in the `package.json` of the project root directory by configuration `pnpm.overrides` (package management tool selects pnpm) or `resolutions`.
|
116
116
|
|
117
|
-
|
118
117
|
The parameter value is a JSON character string.
|
@@ -7,8 +7,8 @@ title: 微前端介绍
|
|
7
7
|
|
8
8
|
它主要解决了两个问题:
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
- 随着项目迭代应用越来越庞大,难以维护。
|
11
|
+
- 跨团队或跨部门协作开发项目导致效率低下的问题。
|
12
12
|
|
13
13
|
## 微前端关键词
|
14
14
|
|
@@ -19,11 +19,10 @@ title: 微前端介绍
|
|
19
19
|
|
20
20
|
## 功能简介
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
- 基于 [Garfish](https://www.garfishjs.org/guide)
|
23
|
+
- 生成器支持微前端应用
|
24
|
+
- 支持 React 组件式引用微前端子应用
|
25
|
+
- 支持 loading
|
26
|
+
- 支持主应用线上、子应用线下调试模式
|
27
27
|
|
28
28
|
可以在 [体验微前端](/docs/guides/topic-detail/micro-frontend/c02-development) 一节学习如何开发微前端主子应用。
|
29
|
-
|
@@ -10,7 +10,7 @@ title: 体验微前端
|
|
10
10
|
|
11
11
|
## 创建应用
|
12
12
|
|
13
|
-
在这次的实践中,我们需要创建三个应用,分别为1个主应用,2个子应用:
|
13
|
+
在这次的实践中,我们需要创建三个应用,分别为 1 个主应用,2 个子应用:
|
14
14
|
|
15
15
|
- main 主应用
|
16
16
|
- dashboard 子应用
|
@@ -46,7 +46,6 @@ import MicroRuntimeConfig from '@site-docs/components/micro-runtime-config.md';
|
|
46
46
|
|
47
47
|
<MicroRuntimeConfig />
|
48
48
|
|
49
|
-
|
50
49
|
### 创建 dashboard 子应用
|
51
50
|
|
52
51
|
通过命令行工具初始化项目:
|
@@ -66,21 +65,22 @@ npx @modern-js/create
|
|
66
65
|
? 请选择你想要的操作 启用可选功能
|
67
66
|
? 启用可选功能 启用「微前端」模式
|
68
67
|
```
|
68
|
+
|
69
69
|
接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
|
70
70
|
|
71
|
-
```
|
72
|
-
import
|
73
|
-
import
|
71
|
+
```js title="modern.config.ts"
|
72
|
+
import appTools, { defineConfig } from '@modern-js/app-tools';
|
73
|
+
import garfishPlugin from '@modern-js/plugin-garfish';
|
74
74
|
|
75
75
|
export default defineConfig({
|
76
76
|
runtime: {
|
77
77
|
router: true,
|
78
|
-
state: true
|
78
|
+
state: true,
|
79
79
|
},
|
80
80
|
deploy: {
|
81
|
-
microFrontend: true
|
81
|
+
microFrontend: true,
|
82
82
|
},
|
83
|
-
plugins: [
|
83
|
+
plugins: [appTools(), garfishPlugin()],
|
84
84
|
});
|
85
85
|
```
|
86
86
|
|
@@ -106,19 +106,19 @@ npx @modern-js/create
|
|
106
106
|
|
107
107
|
接下来,让我们注册微前端插件并修改 `modern.config.ts`,添加微前端子应用的配置 `deploy.microFrontend`:
|
108
108
|
|
109
|
-
```
|
110
|
-
import
|
111
|
-
import
|
109
|
+
```js title="modern.config.ts"
|
110
|
+
import appTools, { defineConfig } from '@modern-js/app-tools';
|
111
|
+
import garfishPlugin from '@modern-js/plugin-garfish';
|
112
112
|
|
113
113
|
export default defineConfig({
|
114
114
|
runtime: {
|
115
115
|
router: true,
|
116
|
-
state: true
|
116
|
+
state: true,
|
117
117
|
},
|
118
118
|
deploy: {
|
119
|
-
microFrontend: true
|
119
|
+
microFrontend: true,
|
120
120
|
},
|
121
|
-
plugins: [
|
121
|
+
plugins: [appTools(), garfishPlugin()],
|
122
122
|
});
|
123
123
|
```
|
124
124
|
|
@@ -137,13 +137,13 @@ const App = () => {
|
|
137
137
|
return (
|
138
138
|
<div>
|
139
139
|
<div>
|
140
|
-
<Link to=
|
141
|
-
<Link to=
|
140
|
+
<Link to="/dashboard">Dashboard</Link>
|
141
|
+
<Link to="/table">Table</Link>
|
142
142
|
</div>
|
143
|
-
<Route path=
|
143
|
+
<Route path="/dashboard">
|
144
144
|
<DashBoard />
|
145
145
|
</Route>
|
146
|
-
<Route path=
|
146
|
+
<Route path="/table">
|
147
147
|
<TableList />
|
148
148
|
</Route>
|
149
149
|
</div>
|
@@ -183,9 +183,6 @@ export default () => <div>Table Page</div>;
|
|
183
183
|
|
184
184
|
在完成了微前端整体开发流程的体验后,你可以进一步了解如何 [开发主应用](./c03-main-app.md)
|
185
185
|
|
186
|
-
|
187
186
|
## 常见问题
|
188
187
|
|
189
188
|
自查手册: https://www.garfishjs.org/issues/
|
190
|
-
|
191
|
-
|