@modern-js/main-doc 2.0.0-beta.1 → 2.0.0-beta.3
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/build.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/dev.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/new.md +1 -4
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/start.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/test.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/overview.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +17 -3
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/auto-actions.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-app.md +2 -2
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-local-model.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-static-model.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +1 -23
- package/en/docusaurus-plugin-content-docs/current/components/command-tip.md +56 -0
- package/en/docusaurus-plugin-content-docs/current/components/reduck-migration.md +1 -0
- package/en/docusaurus-plugin-content-docs/current/components/reduck-tip.md +5 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/asset-prefix.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/hmr.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/https.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/port.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/progress-bar.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/start-url.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/app-icon.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/crossorigin.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/disable-html-folder.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon-by-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/favicon.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject-by-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/inject.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta-by-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/meta.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/mount-id.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-by-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters-by-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template-parameters.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/template.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/title-by-entries.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/html/title.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/asset-prefix.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/assets-retry.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/charset.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/clean-dist-path.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/convert-to-rem.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/copy.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/css-module-local-ident-name.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/data-uri-limit.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-extract.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-css-module-extension.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-filename-hash.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-inline-runtime-chunk.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-minimize.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-source-map.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/dist-path.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-fallback.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-asset-manifest.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-css-module-tsdeclaration.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-scripts.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-inline-styles.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-latest-decorators.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/externals.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/filename.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/legal-comments.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/override-browserslist.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/polyfill.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/svg-default-export.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/build-cache.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/bundle-analyze.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/chunk-split.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/print-file-size.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/profile.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-console.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/performance/remove-moment-locale.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/security/sri.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/alias.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/compile-js-data-uri.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/define.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/global-vars.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/include.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/module-scopes.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/pre-entry.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-extension-prefix.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/resolve-main-fields.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/autoprefixer.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/babel.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-extract.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/css-loader.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/dev-server.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/html-plugin.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/inspector.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/less.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/minify-css.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/postcss.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/pug.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/sass.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/style-loader.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/styled-components.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/swc.md +42 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/terser.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-checker.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/ts-loader.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack-chain.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/webpack.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/guides/basic-features/builder.md +46 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/app.md +152 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/ejs.md +56 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/fs.md +54 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/git.md +49 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/handlebars.md +58 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/json.md +59 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/npm.md +49 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/develop.md +52 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/introduce.md +46 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/run-in-js.md +48 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/structure.md +87 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/common.md +106 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/module.md +39 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/monorepo.md +28 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/config/mwa.md +89 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/abstract.md +26 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/addFile.md +52 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/addHelper.md +26 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/addManyFile.md +58 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/addPartial.md +26 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/introduce.md +38 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/rmDir.md +24 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/rmFile.md +24 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +54 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/updateModernConfig.md +26 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.md +33 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/git/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/git/gitAddAndCommit.md +20 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/git/initGitRepo.md +16 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/git/isInGitRepo.md +16 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/hook/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/hook/afterForged.md +35 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/hook/onForged.md +36 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/info/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/info/isFileExit.md +22 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/info/locale.md +17 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/info/readDir.md +22 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +57 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +56 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/setInput.md +42 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/setInputValue.md +30 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/input/type.md +65 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/introduce.md +91 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/new/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/new/createElement.md +33 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/new/createSubProject.md +35 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/new/enableFunc.md +44 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/new/introduce.md +15 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/npm/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/api/npm/install.md +18 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/develop.md +125 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/plugin/use.md +61 -0
- package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/project.md +118 -0
- package/en/docusaurus-plugin-content-docs/current.json +57 -21
- package/package.json +3 -3
- package/scripts/config.ts +2 -2
- package/scripts/summary.en.json +1 -1
- package/scripts/summary.zh.json +1 -1
- package/zh/apis/app/commands/new.md +0 -3
- package/zh/apis/app/hooks/server/test.md +2 -2
- package/zh/apis/app/runtime/app/_category_.json +1 -1
- package/zh/apis/app/runtime/bff/_category_.json +1 -1
- package/zh/apis/app/runtime/core/_category_.json +1 -1
- package/zh/apis/app/runtime/core/bootstrap.md +17 -3
- package/zh/apis/app/runtime/model/_category_.json +1 -1
- package/zh/apis/app/runtime/model/create-app.md +1 -1
- package/zh/apis/app/runtime/model/use-store.md +1 -23
- package/zh/apis/app/runtime/router/_category_.json +1 -1
- package/zh/apis/app/runtime/ssr/_category_.json +1 -1
- package/zh/apis/app/runtime/testing/_category_.json +1 -1
- package/zh/apis/app/runtime/utility/_category_.json +1 -1
- package/zh/apis/app/runtime/web-server/_category_.json +1 -1
- package/zh/apis/app/runtime/web-server/hook.md +4 -4
- package/zh/apis/app/runtime/web-server/middleware.md +4 -4
- package/zh/components/reduck-migration.md +1 -0
- package/zh/configure/app/dev/asset-prefix.md +1 -1
- package/zh/configure/app/dev/hmr.md +1 -1
- package/zh/configure/app/dev/https.md +1 -1
- package/zh/configure/app/dev/port.md +1 -1
- package/zh/configure/app/dev/progress-bar.md +1 -1
- package/zh/configure/app/dev/start-url.md +1 -1
- package/zh/configure/app/experiments/_category_.json +4 -0
- package/zh/configure/app/experiments/lazy-compilation.md +1 -1
- package/zh/configure/app/html/_category_.json +4 -0
- package/zh/configure/app/html/app-icon.md +1 -1
- package/zh/configure/app/html/crossorigin.md +1 -1
- package/zh/configure/app/html/disable-html-folder.md +1 -1
- package/zh/configure/app/html/favicon-by-entries.md +1 -1
- package/zh/configure/app/html/favicon.md +1 -1
- package/zh/configure/app/html/inject-by-entries.md +1 -1
- package/zh/configure/app/html/inject.md +1 -1
- package/zh/configure/app/html/meta-by-entries.md +1 -1
- package/zh/configure/app/html/meta.md +1 -1
- package/zh/configure/app/html/mount-id.md +1 -1
- package/zh/configure/app/html/template-by-entries.md +1 -1
- package/zh/configure/app/html/template-parameters-by-entries.md +1 -1
- package/zh/configure/app/html/template-parameters.md +1 -1
- package/zh/configure/app/html/template.md +1 -1
- package/zh/configure/app/html/title-by-entries.md +1 -1
- package/zh/configure/app/html/title.md +1 -1
- package/zh/configure/app/output/asset-prefix.md +1 -1
- package/zh/configure/app/output/assets-retry.md +1 -1
- package/zh/configure/app/output/charset.md +1 -1
- package/zh/configure/app/output/clean-dist-path.md +1 -1
- package/zh/configure/app/output/convert-to-rem.md +1 -1
- package/zh/configure/app/output/copy.md +1 -1
- package/zh/configure/app/output/css-module-local-ident-name.md +1 -1
- package/zh/configure/app/output/data-uri-limit.md +1 -1
- package/zh/configure/app/output/disable-css-extract.md +12 -0
- package/zh/configure/app/output/disable-css-module-extension.md +1 -1
- package/zh/configure/app/output/disable-filename-hash.md +1 -1
- package/zh/configure/app/output/disable-inline-runtime-chunk.md +1 -1
- package/zh/configure/app/output/disable-minimize.md +1 -1
- package/zh/configure/app/output/disable-source-map.md +1 -1
- package/zh/configure/app/output/disable-ts-checker.md +1 -1
- package/zh/configure/app/output/dist-path.md +1 -1
- package/zh/configure/app/output/enable-asset-fallback.md +1 -1
- package/zh/configure/app/output/enable-asset-manifest.md +1 -1
- package/zh/configure/app/output/enable-css-module-tsdeclaration.md +1 -1
- package/zh/configure/app/output/enable-inline-scripts.md +1 -1
- package/zh/configure/app/output/enable-inline-styles.md +1 -1
- package/zh/configure/app/output/enable-latest-decorators.md +1 -1
- package/zh/configure/app/output/externals.md +1 -1
- package/zh/configure/app/output/filename.md +1 -1
- package/zh/configure/app/output/legal-comments.md +1 -1
- package/zh/configure/app/output/override-browserslist.md +1 -1
- package/zh/configure/app/output/polyfill.md +1 -1
- package/zh/configure/app/output/ssg.md +118 -114
- package/zh/configure/app/output/svg-default-export.md +1 -1
- package/zh/configure/app/performance/_category_.json +4 -0
- package/zh/configure/app/performance/build-cache.md +1 -1
- package/zh/configure/app/performance/bundle-analyze.md +1 -1
- package/zh/configure/app/performance/chunk-split.md +1 -1
- package/zh/configure/app/performance/print-file-size.md +1 -1
- package/zh/configure/app/performance/profile.md +1 -1
- package/zh/configure/app/performance/remove-console.md +1 -1
- package/zh/configure/app/performance/remove-moment-locale.md +1 -1
- package/zh/configure/app/plugins.md +1 -1
- package/zh/configure/app/runtime/state.md +13 -0
- package/zh/configure/app/security/_category_.json +4 -0
- package/zh/configure/app/security/sri.md +1 -1
- package/zh/configure/app/server/ssr.md +0 -2
- package/zh/configure/app/source/alias.md +1 -1
- package/zh/configure/app/source/compile-js-data-uri.md +1 -1
- package/zh/configure/app/source/define.md +1 -1
- package/zh/configure/app/source/exclude.md +1 -1
- package/zh/configure/app/source/global-vars.md +1 -1
- package/zh/configure/app/source/include.md +1 -1
- package/zh/configure/app/source/module-scopes.md +1 -1
- package/zh/configure/app/source/pre-entry.md +1 -1
- package/zh/configure/app/source/resolve-extension-prefix.md +1 -1
- package/zh/configure/app/source/resolve-main-fields.md +1 -1
- package/zh/configure/app/tools/autoprefixer.md +1 -1
- package/zh/configure/app/tools/babel.md +1 -1
- package/zh/configure/app/tools/css-extract.md +1 -1
- package/zh/configure/app/tools/css-loader.md +1 -1
- package/zh/configure/app/tools/dev-server.md +1 -1
- package/zh/configure/app/tools/html-plugin.md +1 -1
- package/zh/configure/app/tools/inspector.md +1 -1
- package/zh/configure/app/tools/less.md +1 -1
- package/zh/configure/app/tools/minify-css.md +1 -1
- package/zh/configure/app/tools/postcss.md +1 -1
- package/zh/configure/app/tools/pug.md +1 -1
- package/zh/configure/app/tools/sass.md +1 -1
- package/zh/configure/app/tools/style-loader.md +1 -1
- package/zh/configure/app/tools/styled-components.md +1 -1
- package/zh/configure/app/tools/swc.md +42 -0
- package/zh/configure/app/tools/terser.md +1 -1
- package/zh/configure/app/tools/ts-checker.md +1 -1
- package/zh/configure/app/tools/ts-loader.md +1 -1
- package/zh/configure/app/tools/webpack-chain.md +1 -1
- package/zh/configure/app/tools/webpack.md +1 -1
- package/zh/guides/advanced-features/bff/_category_.json +5 -1
- package/zh/guides/advanced-features/bff/bff-proxy.md +5 -3
- package/zh/guides/advanced-features/bff/frameworks.md +72 -51
- package/zh/guides/advanced-features/bff/function.md +16 -30
- package/zh/guides/advanced-features/bff/index.md +20 -0
- package/zh/guides/advanced-features/bff/type.md +43 -0
- package/zh/guides/advanced-features/custom-app.md +69 -1
- package/zh/guides/advanced-features/ssg.md +74 -63
- package/zh/guides/advanced-features/ssr.md +74 -11
- package/zh/guides/advanced-features/web-server.md +21 -110
- package/zh/guides/basic-features/builder.md +46 -0
- package/zh/guides/basic-features/css/_category_.json +1 -1
- package/zh/guides/basic-features/css/less-sass.md +1 -14
- package/zh/guides/basic-features/data-fetch.md +62 -1
- package/zh/guides/basic-features/env-vars.md +122 -41
- package/zh/guides/basic-features/routes.md +264 -0
- package/zh/guides/concept/entries.md +112 -0
- package/zh/guides/concept/lifecycle.md +10 -0
- package/zh/guides/get-started/quick-start.md +199 -1
- package/zh/guides/get-started/upgrade.md +75 -1
- package/zh/guides/topic-detail/framework-plugin/extend.md +3 -4
- package/zh/{apis/app/runtime/plugin/hook-api.md → guides/topic-detail/framework-plugin/hook-list.md} +42 -135
- package/zh/{apis/app/runtime/plugin → guides/topic-detail/framework-plugin}/hook.md +2 -3
- package/zh/guides/topic-detail/framework-plugin/implement.md +21 -10
- package/zh/guides/topic-detail/framework-plugin/introduction.md +49 -0
- package/{en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin → zh/guides/topic-detail/framework-plugin}/plugin-api.md +3 -4
- package/zh/guides/topic-detail/framework-plugin/relationship.md +2 -3
- package/zh/guides/topic-detail/generator/codesmith/api/_category_.json +4 -0
- package/zh/guides/topic-detail/generator/codesmith/api/app.md +152 -0
- package/zh/guides/topic-detail/generator/codesmith/api/ejs.md +56 -0
- package/zh/guides/topic-detail/generator/codesmith/api/fs.md +54 -0
- package/zh/guides/topic-detail/generator/codesmith/api/git.md +48 -0
- package/zh/guides/topic-detail/generator/codesmith/api/handlebars.md +56 -0
- package/zh/guides/topic-detail/generator/codesmith/api/json.md +58 -0
- package/zh/guides/topic-detail/generator/codesmith/api/npm.md +45 -0
- package/zh/guides/topic-detail/generator/codesmith/develop.md +52 -0
- package/zh/guides/topic-detail/generator/codesmith/introduce.md +42 -1
- package/zh/guides/topic-detail/generator/codesmith/run-in-js.md +48 -0
- package/zh/guides/topic-detail/generator/codesmith/structure.md +86 -0
- package/zh/guides/topic-detail/generator/config/mwa.md +4 -8
- package/zh/guides/topic-detail/generator/plugin/api/file/addFile.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/file/addHelper.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/file/addPartial.md +2 -2
- package/zh/guides/topic-detail/generator/plugin/api/file/introduce.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/file/rmDir.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/file/rmFile.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/file/updateJSONFile.md +3 -2
- package/zh/guides/topic-detail/generator/plugin/api/file/updateModernConfig.md +2 -2
- package/zh/guides/topic-detail/generator/plugin/api/file/updateTextRawFile.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/hook/afterForged.md +3 -3
- package/zh/guides/topic-detail/generator/plugin/api/hook/onForged.md +3 -3
- package/zh/guides/topic-detail/generator/plugin/api/input/addInputAfter.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/input/addInputBefore.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/input/type.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/new/createElement.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/new/createSubProject.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/new/enableFunc.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/api/npm/install.md +1 -1
- package/zh/guides/topic-detail/generator/plugin/develop.md +11 -7
- package/zh/guides/topic-detail/model/quick-start.md +4 -0
- package/zh/guides/topic-detail/monorepo/sub-project-interface.md +0 -2
- package/zh/tutorials/first-app/c01-getting-started/1.1-prerequisites.md +2 -2
- package/zh/tutorials/first-app/c01-getting-started/1.2-minimal-mwa.md +2 -2
- package/zh/tutorials/first-app/c01-getting-started/1.4-enable-ssr.md +5 -2
- package/zh/tutorials/first-app/c02-generator-and-studio/2.1-generator.md +0 -8
- package/zh/tutorials/first-app/c02-generator-and-studio/2.2-boilerplates.md +12 -6
- package/zh/tutorials/first-app/c02-generator-and-studio/2.3-configuration.md +2 -4
- package/zh/tutorials/first-app/c03-ide/3.1-setting-up.md +1 -1
- package/zh/tutorials/first-app/c03-ide/3.2-hints-in-ide.md +44 -50
- package/zh/tutorials/first-app/c03-ide/3.3-autofix-in-ide.md +1 -1
- package/zh/tutorials/first-app/c03-ide/3.4-autofix-in-cli.md +4 -4
- package/zh/tutorials/first-app/c04-es6-plus-and-ts/4.1-use-es6-plus.md +8 -21
- package/zh/tutorials/first-app/c04-es6-plus-and-ts/4.2-use-typescript.md +37 -13
- package/zh/tutorials/first-app/c05-component/5.1-use-ui-library.md +3 -13
- package/zh/tutorials/first-app/c05-component/5.2-use-standalone-component.md +1 -21
- package/zh/tutorials/first-app/c06-css-and-component/6.1-css-in-js.md +9 -9
- package/zh/tutorials/first-app/c06-css-and-component/6.2-utility-class.md +9 -14
- package/zh/tutorials/first-app/c06-css-and-component/6.3-postcss.md +7 -7
- package/zh/tutorials/first-app/c06-css-and-component/6.4-design-system.md +1 -1
- package/zh/tutorials/first-app/c06-css-and-component/6.5-storybook.md +2 -2
- package/zh/tutorials/first-app/c06-css-and-component/6.6-testing.md +8 -17
- package/zh/tutorials/first-app/c07-app-entry/7.1-intro.md +24 -19
- package/zh/tutorials/first-app/c07-app-entry/7.2-add-entry-in-cli.md +31 -35
- package/zh/tutorials/first-app/c07-app-entry/7.3-manage-entries-by-hand.md +4 -9
- package/zh/tutorials/first-app/c08-client-side-routing/8.1-code-based-routing.md +66 -63
- package/zh/tutorials/first-app/c09-bff/9.2-enable-bff.md +35 -33
- package/zh/tutorials/first-app/c09-bff/9.3-fetch-bff.md +28 -102
- package/zh/tutorials/first-app/c10-model/10.1-application-architecture.md +4 -6
- package/zh/tutorials/first-app/c10-model/10.2-add-model.md +3 -3
- package/zh/tutorials/first-app/c10-model/10.3-use-model.md +21 -20
- package/zh/tutorials/first-app/c10-model/10.4-testing.md +2 -2
- package/zh/tutorials/first-app/c11-container/11.1-use-model-with-app-state.md +34 -68
- package/zh/tutorials/first-app/c11-container/11.2-add-container.md +40 -37
- package/zh/tutorials/first-app/c11-container/11.3-use-loader.md +6 -4
- package/zh/tutorials/first-app/c11-container/11.4-testing.md +2 -2
- package/zh/tutorials/foundations/introduction.md +1 -1
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/default-alias.md +0 -25
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/env.md +0 -72
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/_category_.json +0 -4
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/abstract.md +0 -26
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook-api.md +0 -896
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook.md +0 -170
- package/zh/apis/app/runtime/default-alias.md +0 -23
- package/zh/apis/app/runtime/env.md +0 -70
- package/zh/apis/app/runtime/plugin/_category_.json +0 -4
- package/zh/apis/app/runtime/plugin/abstract.md +0 -26
- package/zh/apis/app/runtime/plugin/plugin-api.md +0 -117
- package/zh/components/deploy.md +0 -60
- package/zh/components/dev-ide.md +0 -1
- package/zh/components/entry-name.md +0 -15
- package/zh/components/env-prepare.md +0 -1
- package/zh/components/launch-bff-choices.md +0 -6
- package/zh/guides/advanced-features/bff/bff-server.md +0 -142
- package/zh/guides/advanced-features/typescript.md +0 -4
- package/zh/guides/basic-features/image.md +0 -43
- package/zh/guides/concept/integrated.md +0 -4
- package/zh/guides/concept/solutions.md +0 -4
- package/zh/guides/topic-detail/compile-speed.md +0 -182
- package/zh/guides/topic-detail/framework-plugin/abstract.md +0 -27
- package/zh/guides/troubleshooting/compile.md +0 -379
- package/zh/tutorials/first-app/c08-client-side-routing/8.2-file-based-routing.md +0 -318
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
# addPartial
|
6
|
+
|
7
|
+
For text files, add a customized Partial fragment of Handlebars, the specific viewable document [Partials](https://handlebarsjs.com/guide/#partials).
|
8
|
+
|
9
|
+
This method is available on the `onForged` time to live API parameter.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export type ForgedAPI = {
|
15
|
+
addPartial: (name: string, str: Handlebars.Template) => void;
|
16
|
+
...
|
17
|
+
};
|
18
|
+
```
|
19
|
+
|
20
|
+
## name
|
21
|
+
|
22
|
+
partial name.
|
23
|
+
|
24
|
+
## str
|
25
|
+
|
26
|
+
partial template string.
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 1
|
3
|
+
---
|
4
|
+
|
5
|
+
# Introduction
|
6
|
+
|
7
|
+
The file operation API can be used in the `onForged` time to live function, which can add, delete and change the current project file.
|
8
|
+
|
9
|
+
File operation API related path to fill in the project relative path, generator plugin will automatically add the current project path prefix.
|
10
|
+
|
11
|
+
## File type
|
12
|
+
|
13
|
+
The generator plugin divides file types into the following categories:
|
14
|
+
|
15
|
+
- Text files: plain text content files, files that can be templated using handlebars.
|
16
|
+
|
17
|
+
- Binary files: pictures, audio, video and other files.
|
18
|
+
|
19
|
+
:::warning
|
20
|
+
The jsx or tsx file using the variable is a binary file, and its syntax conflicts with handlebars render, which will cause the template file failed to create.
|
21
|
+
:::
|
22
|
+
|
23
|
+
- JSON files: Files in JSON format, such as `package.json`, `tsconfig.json`.
|
24
|
+
|
25
|
+
- 文Text List File: A file consisting of lines of text, such as `.gitignore`, `.editorconfig`, `.npmrc`.
|
26
|
+
|
27
|
+
The file manipulation API for the generator plugin will operate on these four file types.
|
28
|
+
|
29
|
+
Its type is defined as:
|
30
|
+
|
31
|
+
```ts
|
32
|
+
export enum FileType {
|
33
|
+
Text = 'text',
|
34
|
+
Binary = 'binary',
|
35
|
+
Json = 'json',
|
36
|
+
TextRaw = 'textRaw',
|
37
|
+
}
|
38
|
+
```
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 10
|
3
|
+
---
|
4
|
+
|
5
|
+
# rmDir
|
6
|
+
|
7
|
+
Delete folder. This method deletes all files under the folder in recursion.
|
8
|
+
|
9
|
+
This method can be used for any file type.
|
10
|
+
|
11
|
+
This method is available on the `onForged` time to live API parameter.
|
12
|
+
|
13
|
+
Its type is defined as:
|
14
|
+
|
15
|
+
```ts
|
16
|
+
export type ForgedAPI = {
|
17
|
+
rmDir: (dirName: string) => Promise<void>;
|
18
|
+
...
|
19
|
+
};
|
20
|
+
```
|
21
|
+
|
22
|
+
## dirName
|
23
|
+
|
24
|
+
The folder name or folder path to delete.
|
@@ -0,0 +1,24 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 9
|
3
|
+
---
|
4
|
+
|
5
|
+
# rmFile
|
6
|
+
|
7
|
+
Delete the file.
|
8
|
+
|
9
|
+
This method can be used for any file type.
|
10
|
+
|
11
|
+
This method is available on the `onForged` time to live API parameter.
|
12
|
+
|
13
|
+
Its type is defined as:
|
14
|
+
|
15
|
+
```ts
|
16
|
+
export type ForgedAPI = {
|
17
|
+
rmFile: (fileName: string) => Promise<void>;
|
18
|
+
...
|
19
|
+
};
|
20
|
+
```
|
21
|
+
|
22
|
+
## fileName
|
23
|
+
|
24
|
+
File name or file path to delete.
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 6
|
3
|
+
---
|
4
|
+
|
5
|
+
# updateJSONFile
|
6
|
+
|
7
|
+
Update the JSON file fields.
|
8
|
+
|
9
|
+
This method is suitable for JSON file types, and can batch update field values in JSON files.
|
10
|
+
|
11
|
+
This method is available on the `onForged` time to live API parameter.
|
12
|
+
|
13
|
+
Its type is defined as:
|
14
|
+
|
15
|
+
```ts
|
16
|
+
export type ForgedAPI = {
|
17
|
+
updateJSONFile: (
|
18
|
+
fileName: string,
|
19
|
+
updateInfo: Record<string, unknown>,
|
20
|
+
) => Promise<void>;
|
21
|
+
...
|
22
|
+
};
|
23
|
+
```
|
24
|
+
|
25
|
+
## fileName
|
26
|
+
|
27
|
+
The filename or file path of the JSON file.
|
28
|
+
|
29
|
+
## updateInfo
|
30
|
+
|
31
|
+
Field update information.
|
32
|
+
|
33
|
+
This information is represented in Record form.
|
34
|
+
|
35
|
+
For example, the name field needs to be updated:
|
36
|
+
|
37
|
+
|
38
|
+
```ts
|
39
|
+
api.updateJSONFile(file, {
|
40
|
+
name: "new name"
|
41
|
+
})
|
42
|
+
```
|
43
|
+
|
44
|
+
Nested fields need to be updated:
|
45
|
+
|
46
|
+
```ts
|
47
|
+
api.updateJSONFile(file, {
|
48
|
+
"dependencies.name": "new name"
|
49
|
+
})
|
50
|
+
```
|
51
|
+
|
52
|
+
:::warning
|
53
|
+
Pay attention to the field name when updating the nested field. If it is not a total volume update, the nested key should also be written into the field name.
|
54
|
+
:::
|
@@ -0,0 +1,26 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 8
|
3
|
+
---
|
4
|
+
|
5
|
+
# updateModernConfig
|
6
|
+
|
7
|
+
Update the `modernConfig` field in `package.json`.
|
8
|
+
|
9
|
+
This method is available on the `onForged` time to live API parameter.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export type ForgedAPI = {
|
15
|
+
updateModernConfig: (updateInfo: Record<string, any>) => Promise<void>;
|
16
|
+
...
|
17
|
+
};
|
18
|
+
```
|
19
|
+
|
20
|
+
## updateInfo
|
21
|
+
|
22
|
+
Field update information.
|
23
|
+
|
24
|
+
:::info
|
25
|
+
This function is the package of updateJSONFile, which will automatically update the `modernConfig` field of `package.json`. Just fill in the update information relative to `modernConfig` in the updateInfo.
|
26
|
+
:::
|
@@ -0,0 +1,33 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 7
|
3
|
+
---
|
4
|
+
|
5
|
+
# updateTextRawFile
|
6
|
+
|
7
|
+
Update the text list file content.
|
8
|
+
|
9
|
+
This method works with the text list file type.
|
10
|
+
|
11
|
+
This method is available on the `onForged` time to live API parameter.
|
12
|
+
|
13
|
+
Its type is defined as:
|
14
|
+
|
15
|
+
```ts
|
16
|
+
export type ForgedAPI = {
|
17
|
+
updateTextRawFile: (
|
18
|
+
fileName: string,
|
19
|
+
update: (content: string[]) => string[],
|
20
|
+
) => Promise<void>;
|
21
|
+
...
|
22
|
+
};
|
23
|
+
```
|
24
|
+
|
25
|
+
## fileName
|
26
|
+
|
27
|
+
The filename or file path of the text list file.
|
28
|
+
|
29
|
+
## update
|
30
|
+
|
31
|
+
Update function.
|
32
|
+
|
33
|
+
The function parameter is the current file content. The content will be divided by `\n` and passed into function in the form of array. The return value of function is also array. The internal will be automatically merged with `\n` and written to the source file.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
# gitAddAndCommit
|
6
|
+
|
7
|
+
Commit the current repository changes.
|
8
|
+
|
9
|
+
Its type is defined as:
|
10
|
+
|
11
|
+
```ts
|
12
|
+
export type AfterForgedAPI = {
|
13
|
+
gitAddAndCommit: (commitMessage: string) => Promise<void>;
|
14
|
+
...
|
15
|
+
};
|
16
|
+
```
|
17
|
+
|
18
|
+
## commitMessage
|
19
|
+
|
20
|
+
Commit information.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 2
|
3
|
+
---
|
4
|
+
|
5
|
+
# AfterForged
|
6
|
+
|
7
|
+
`afterForged` function is the generator plugin time to live function, which is usually used to define operations such as installation dependency and Git. Professional operations will be performed after the onForged function is executed.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export type PluginAfterForgedFunc = (
|
15
|
+
api: AfterForgedAPI,
|
16
|
+
inputData: Record<string, unknown>,
|
17
|
+
) => Promise<void>;
|
18
|
+
|
19
|
+
export interface IPluginContext {
|
20
|
+
afterForged: (func: PluginAfterForgedFunc) => void;
|
21
|
+
...
|
22
|
+
}
|
23
|
+
```
|
24
|
+
|
25
|
+
## func
|
26
|
+
|
27
|
+
The onForged parameter is a callback function, and the function parameters are `api` and `inputData`.
|
28
|
+
|
29
|
+
### api
|
30
|
+
|
31
|
+
A list of supported functions in `afterForged` time to live, specifically viewabl [Git API](/docs/guides/topic-detail/generator/plugin/api/git/isInGitRepo) 和 [NPM API](/docs/guides/topic-detail/generator/plugin/api/npm/install).
|
32
|
+
|
33
|
+
### inputData
|
34
|
+
|
35
|
+
Current user input, the user can be used to obtain the current input information and configuration information.
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 1
|
3
|
+
---
|
4
|
+
|
5
|
+
# OnForged
|
6
|
+
|
7
|
+
`onForged` function is the generator plugin time to live function, which is usually used to define file type operations that will be performed after the completion of the base project solution file operation.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export type PluginForgedFunc = (
|
15
|
+
api: ForgedAPI,
|
16
|
+
inputData: Record<string, unknown>,
|
17
|
+
) => void | Promise<void>;
|
18
|
+
|
19
|
+
export interface IPluginContext {
|
20
|
+
onForged: (func: PluginForgedFunc) => void;
|
21
|
+
...
|
22
|
+
}
|
23
|
+
```
|
24
|
+
|
25
|
+
## func
|
26
|
+
|
27
|
+
The onForged parameter is a callback function, and the function parameters are `api` and `inputData`.
|
28
|
+
|
29
|
+
### api
|
30
|
+
|
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
|
+
|
33
|
+
|
34
|
+
### inputData
|
35
|
+
|
36
|
+
Current user input, the user can be used to obtain the current input information and configuration information.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 2
|
3
|
+
---
|
4
|
+
|
5
|
+
# isFileExit
|
6
|
+
|
7
|
+
Determine if the file exists.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export interface IPluginContext {
|
15
|
+
isFileExit: (fileName: string) => Promise<boolean>;
|
16
|
+
...
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## fileName
|
21
|
+
|
22
|
+
The file name or file path that needs to be judged is based on the relative path of the created project.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 1
|
3
|
+
---
|
4
|
+
|
5
|
+
# locale
|
6
|
+
|
7
|
+
Current language.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
There are two values for this field:
|
12
|
+
|
13
|
+
- zh: Chinese
|
14
|
+
|
15
|
+
- en: English
|
16
|
+
|
17
|
+
The generator plugin can adjust the value of the relevant display field according to this field.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
# readDir
|
6
|
+
|
7
|
+
Read the folder and get the file list.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export interface IPluginContext {
|
15
|
+
readDir: (dir: string) => Promise<string[]>;
|
16
|
+
...
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## dir
|
21
|
+
|
22
|
+
Its type is defined as: folder name or path, based on the relative path of the created project.
|
@@ -0,0 +1,57 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
# addInputAfter
|
6
|
+
|
7
|
+
Add input question after default input.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export interface IPluginContext {
|
15
|
+
addInputAfter: (key: string, input: Schema) => void;
|
16
|
+
...
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## key
|
21
|
+
|
22
|
+
Modern.js the problem keyword of the configuration of the engineering solution, the specific configuration viewable [Generator Configuration](/docs/guides/topic-detail/generator/config/common).
|
23
|
+
|
24
|
+
## input
|
25
|
+
|
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
|
+
|
28
|
+
|
29
|
+
## Example
|
30
|
+
|
31
|
+
Add input after package management tool:
|
32
|
+
|
33
|
+
```ts
|
34
|
+
context.addInputAfter('packageManager', {
|
35
|
+
type: 'object',
|
36
|
+
properties: {
|
37
|
+
language: {
|
38
|
+
type: 'string',
|
39
|
+
title: 'Develop Language',
|
40
|
+
enum: [
|
41
|
+
{ label: 'TS', value: 'ts' },
|
42
|
+
{ label: 'ES6+', value: 'js' },
|
43
|
+
],
|
44
|
+
},
|
45
|
+
},
|
46
|
+
})
|
47
|
+
```
|
48
|
+
|
49
|
+
:::info Notes
|
50
|
+
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
|
+
|
52
|
+
|
53
|
+
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
|
+
|
55
|
+
|
56
|
+
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
|
+
:::
|
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 2
|
3
|
+
---
|
4
|
+
|
5
|
+
# addInputBefore
|
6
|
+
|
7
|
+
Add input question before default input.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export interface IPluginContext {
|
15
|
+
addInputBefore: (key: string, input: Schema) => void;
|
16
|
+
...
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## key
|
21
|
+
|
22
|
+
Modern.js the problem keyword of the configuration of the engineering solution, the specific configuration viewable [Generator Configuration](/docs/guides/topic-detail/generator/config/common).
|
23
|
+
|
24
|
+
## input
|
25
|
+
|
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
|
+
|
28
|
+
## Example
|
29
|
+
|
30
|
+
Add input before package management tool:
|
31
|
+
|
32
|
+
```ts
|
33
|
+
context.addInputBefore('packageManager', {
|
34
|
+
type: 'object',
|
35
|
+
properties: {
|
36
|
+
language: {
|
37
|
+
type: 'string',
|
38
|
+
title: 'Develop Langauge',
|
39
|
+
enum: [
|
40
|
+
{ label: 'TS', value: 'ts' },
|
41
|
+
{ label: 'ES6+', value: 'js' },
|
42
|
+
],
|
43
|
+
},
|
44
|
+
},
|
45
|
+
})
|
46
|
+
```
|
47
|
+
|
48
|
+
:::info Notes
|
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
|
+
|
51
|
+
|
52
|
+
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
|
+
|
54
|
+
|
55
|
+
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
|
+
:::
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 4
|
3
|
+
---
|
4
|
+
|
5
|
+
# setInput
|
6
|
+
|
7
|
+
Set the problem attribute.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export interface IPluginContext {
|
15
|
+
setInput: (key: string, field: string, value: unknown) => void;
|
16
|
+
...
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## key
|
21
|
+
|
22
|
+
The problem keyword can be the problem keyword of the Modern.js project solution, or the keyword of the new problem in the generator plugin.
|
23
|
+
|
24
|
+
## filed
|
25
|
+
|
26
|
+
he problem field to be set, you can modify other fields except the key of the current Input, Input specific type definition viewable [Customize input related type definition](/docs/guides/topic-detail/generator/plugin/api/input/type).
|
27
|
+
|
28
|
+
## value
|
29
|
+
|
30
|
+
The value of the problem field to be setted. value supports function, the function parameter is the current field value, and the return value needs to be the complete new field value.
|
31
|
+
|
32
|
+
:::info
|
33
|
+
For the input options provided by the Modern.js project type, only delete is temporarily supported, and increase is not supported. The increase will cause problems in the logical judgment in the code.
|
34
|
+
:::
|
35
|
+
|
36
|
+
## Example
|
37
|
+
|
38
|
+
Modify the display name of `packageName`:
|
39
|
+
|
40
|
+
```ts
|
41
|
+
context.setInput('packageName', 'title', "Show title");
|
42
|
+
```
|
@@ -0,0 +1,30 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 7
|
3
|
+
---
|
4
|
+
|
5
|
+
# setInputValue
|
6
|
+
|
7
|
+
Sets the input default value.
|
8
|
+
|
9
|
+
The method is available directly on the context.
|
10
|
+
|
11
|
+
Its type is defined as:
|
12
|
+
|
13
|
+
```ts
|
14
|
+
export interface IPluginContext {
|
15
|
+
setInputValue: (value: Record<string, unknown>) => void;
|
16
|
+
...
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
## Example
|
21
|
+
|
22
|
+
```ts
|
23
|
+
context.setInputValue({
|
24
|
+
moduleRunWay: 'no',
|
25
|
+
});
|
26
|
+
```
|
27
|
+
|
28
|
+
:::warning
|
29
|
+
This method only supports setting the configuration parameter value corresponding to the project solution integrated by the generator plugin, and does not support setting the project solution type (solution) and project scene (scenes). These two configurations can be set by the `--config` parameter at execution default value.
|
30
|
+
:::
|