@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
@@ -4,7 +4,7 @@ sidebar_label: sass
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.sass](https://modernjs.dev/builder/zh/api/config-tools.html#tools-sass)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/sass.md'
|
@@ -4,7 +4,7 @@ sidebar_label: styleLoader
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.styleLoader](https://modernjs.dev/builder/zh/api/config-tools.html#tools-styleloader)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/styleLoader.md'
|
@@ -4,7 +4,7 @@ sidebar_label: styledComponents
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.styledComponents](https://modernjs.dev/builder/zh/api/config-tools.html#tools-styledcomponents)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/styledComponents.md'
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
title: tools.swc
|
3
|
+
sidebar_label: swc
|
4
|
+
---
|
5
|
+
|
6
|
+
- Type: `Object`
|
7
|
+
- Default: `undefined`
|
8
|
+
|
9
|
+
## Introduction
|
10
|
+
|
11
|
+
[SWC](https://SWC.rs/) (Speedy Web Compiler) is a transformer and minimizer for JavaScript and TypeScript based on `Rust`. SWC can provide the same abilities with Babel, and it's more than 10x faster than Babel.
|
12
|
+
|
13
|
+
Modern.js Builder has a out-of-box plugin for SWC, power your Web application with Polyfill and minification, we also port some common used Babel plugins to SWC.
|
14
|
+
|
15
|
+
## Install
|
16
|
+
|
17
|
+
The `@modern-js/plugin-swc` plugin needs to be installed before use. After the installation, the SWC compilation and compression will be automatically enabled.
|
18
|
+
|
19
|
+
```bash
|
20
|
+
pnpm add @modern-js/plugin-swc -D
|
21
|
+
```
|
22
|
+
|
23
|
+
## Config
|
24
|
+
|
25
|
+
You can set the SWC compilation behavior through the `tools.swc` config.
|
26
|
+
|
27
|
+
```js title="modern.config.ts"
|
28
|
+
import { defineConfig } from '@modern-js/app-tools';
|
29
|
+
|
30
|
+
export default defineConfig({
|
31
|
+
tools: {
|
32
|
+
swc: {
|
33
|
+
jsMinify: {
|
34
|
+
compress: {},
|
35
|
+
mangle: true,
|
36
|
+
},
|
37
|
+
},
|
38
|
+
},
|
39
|
+
});
|
40
|
+
```
|
41
|
+
|
42
|
+
For config details, please refer to [Modern.js Builder - SWC Plugin Configuration](https://modernjs.dev/builder/en/plugins/plugin-swc.html#config).
|
@@ -4,7 +4,7 @@ sidebar_label: terser
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.terser](https://modernjs.dev/builder/zh/api/config-tools.html#tools-terser)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/terser.md'
|
@@ -4,7 +4,7 @@ sidebar_label: tsChecker
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.tsChecker](https://modernjs.dev/builder/zh/api/config-tools.html#tools-tschecker)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/tsChecker.md'
|
@@ -4,7 +4,7 @@ sidebar_label: tsLoader
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.tsLoader](https://modernjs.dev/builder/zh/api/config-tools.html#tools-tsloader)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/tsLoader.md'
|
@@ -4,7 +4,7 @@ sidebar_label: webpackChain
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.webpackChain](https://modernjs.dev/builder/zh/api/config-tools.html#tools-webpackchain)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/webpackChain.md'
|
@@ -4,7 +4,7 @@ sidebar_label: webpack
|
|
4
4
|
---
|
5
5
|
|
6
6
|
:::info BUILDER
|
7
|
-
This configuration is Modern.js Builder configuration,
|
7
|
+
This configuration is Modern.js Builder configuration, more detail can see [tools.webpack](https://modernjs.dev/builder/zh/api/config-tools.html#tools-webpack)。
|
8
8
|
:::
|
9
9
|
|
10
10
|
import Main from '@modern-js/builder-doc/en/config/tools/webpack.md'
|
@@ -0,0 +1,46 @@
|
|
1
|
+
---
|
2
|
+
title: Builder
|
3
|
+
sidebar_position: 2
|
4
|
+
---
|
5
|
+
|
6
|
+
**Modern.js uses [Modern.js Builder](https://modernjs.dev/builder) to build your Web APP. **
|
7
|
+
|
8
|
+
Modern.js Builder is one of the core components of Modern.js. It is a build engine for modern Web development and can be used independently of Modern.js. Modern.js Builder supports multiple bundlers such as webpack and rspack, and it uses webpack by default.
|
9
|
+
|
10
|
+
## Build Architecture
|
11
|
+
|
12
|
+
From the perspective of building, Modern.js is divided into three layers, from top to bottom:
|
13
|
+
|
14
|
+
- Upper-layer framework: Modern.js.
|
15
|
+
- Universal build engine: Modern.js Builder.
|
16
|
+
- Low-level bundlers: webpack and rspack.
|
17
|
+
|
18
|
+
<img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/zq-uylkvT/ljhwZthlaukjlkulzlp/builder-layers-1117.png" style={{ maxWidth: '540px' }} />
|
19
|
+
|
20
|
+
## Builder Documentation
|
21
|
+
|
22
|
+
Since Modern.js Builder is a module that can be used independently, we provide a separate document for it, the site address is: [modernjs.dev/builder](https://modernjs.dev/builder).
|
23
|
+
|
24
|
+
In this document, you can learn about the detailed introduction of Modern.js Builder, and you can also find a complete usage guide for each building features. When you encounter building issues, it is recommended that you first read the Modern.js Builder documentation to solve them.
|
25
|
+
|
26
|
+
## Builder Config
|
27
|
+
|
28
|
+
The config of Modern.js is inherited from Modern.js Builder, so you can use all build configs provided by Modern.js Builder in Modern.js.
|
29
|
+
|
30
|
+
Take the `html.title` config of Modern.js Builder as an example, you can directly use this config in the `modern.config.ts` file, and it will be automatically passed to Modern.js Builder.
|
31
|
+
|
32
|
+
```ts title="modern.config.js"
|
33
|
+
export default defineConfig({
|
34
|
+
html: {
|
35
|
+
title: 'example',
|
36
|
+
},
|
37
|
+
});
|
38
|
+
```
|
39
|
+
|
40
|
+
For details of building configs, please refer to [「Modern.js Builder - Builder Config」](https://modernjs.dev/builder/en/guide/basic/builder-config.html).
|
41
|
+
|
42
|
+
## Building Features
|
43
|
+
|
44
|
+
Modern.js Builder provides a wealth of building features, including dozens of features such as JavaScript compilation, CSS compilation, static resource processing, hot module replacement, code compression, and TS type checking.
|
45
|
+
|
46
|
+
We recommend you to read [「Modern.js Builder - All Features」](https://modernjs.dev/builder/en/guide/features.html) to learn all the building features provided by Modern.js Builder.
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/app.md
ADDED
@@ -0,0 +1,152 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 1
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-app
|
6
|
+
|
7
|
+
The combination encapsulation of APIs commonly used in the development of microgenerators, including APIs encapsulation of other packages such as fs, git, npm, etc. When the requirements can be met, it is recommended to use the API of the npm package.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { AppAPI } from '@modern-js/codesmith-api-app';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const appApi = new AppAPI(context, generator);
|
16
|
+
await appApi.runInstall();
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
- Create AppAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
21
|
+
- Just call the API on its example.
|
22
|
+
|
23
|
+
## API
|
24
|
+
|
25
|
+
### checkEnvironment
|
26
|
+
|
27
|
+
Check the current generator operating environment, the check items are:
|
28
|
+
|
29
|
+
1. The node and node versions, the default is greater than 12.22.12, and the node version can be executed by passing parameters.
|
30
|
+
2. Yarn, pnpm or npm can be used.
|
31
|
+
|
32
|
+
Parameter:
|
33
|
+
|
34
|
+
- nodeVersion?: `string`. Node version want to check.
|
35
|
+
|
36
|
+
### runInstall
|
37
|
+
|
38
|
+
To install dependency, you can pass in the install dependency command, which defaults to the `packageManager` value in config.
|
39
|
+
|
40
|
+
Parameter:
|
41
|
+
|
42
|
+
- command?: `string`, Install dependency command.
|
43
|
+
|
44
|
+
### runGitAndInstall
|
45
|
+
|
46
|
+
This function performs the following actions:
|
47
|
+
|
48
|
+
1. Check whether the current generator execution directory is a git repository.
|
49
|
+
2. If not a git repository, initialization is a git repository.
|
50
|
+
3. Install dependencies.
|
51
|
+
4. Commit the initial commit in a non-monorepo project (judging the condition, `isMonorepoSubProject` does not exist or is false in the config), the commit information is feat: init, and customize is supported.
|
52
|
+
|
53
|
+
|
54
|
+
Parameter:
|
55
|
+
- commitMessage?: `string`, Initialization commit message
|
56
|
+
- installFunc?: `() => Promise<void>`. Install dependency function
|
57
|
+
|
58
|
+
### forgeTemplate
|
59
|
+
|
60
|
+
Render generator template file.
|
61
|
+
|
62
|
+
Parameter:
|
63
|
+
|
64
|
+
- templatePattern: `string`. Template files match regularities,for example: `templates/base-templates/**/*` .
|
65
|
+
- filter?: `(resourceKey: string) => boolean`. Filter function, the parameter is the file path matching the `templatePattern`, return true to render the file, return false to render the file.
|
66
|
+
- rename?: `(resourceKey: string) => string`. Rename function, the parameter is the file path matching `templatePattern`, and the new filename is returned. The templates directory at the beginning of `resourceKey` and the `.handlebars` suffix at the end will be replaced by default.
|
67
|
+
- parameters?: `Record<string, any>`. Render parameter, when there is a handlebars or ejs variable in the template, use it to pass the corresponding variable value.
|
68
|
+
- type?: `'handlebars' | 'ejs'`. Template file type, defaults to handlebars.
|
69
|
+
|
70
|
+
For example:
|
71
|
+
|
72
|
+
```typescript
|
73
|
+
await appApi.forgeTemplate(
|
74
|
+
'templates/base-templates/**/*',
|
75
|
+
undefined,
|
76
|
+
resourceKey =>
|
77
|
+
resourceKey
|
78
|
+
.replace('templates/base-templates/', '')
|
79
|
+
.replace('.handlebars', ''),
|
80
|
+
);
|
81
|
+
|
82
|
+
await appApi.forgeTemplate(
|
83
|
+
'templates/base-template/**/*',
|
84
|
+
resourceKey => !resourceKey.include('eslintrc.json'),
|
85
|
+
resourceKey =>
|
86
|
+
resourceKey
|
87
|
+
.replace('templates/base-template/', projectPath)
|
88
|
+
.replace('language', language as string)
|
89
|
+
.replace('.handlebars', ''),
|
90
|
+
{
|
91
|
+
name: packageName as string,
|
92
|
+
language,
|
93
|
+
isTs: language === Language.TS,
|
94
|
+
packageManager: getPackageManagerText(packageManager as any),
|
95
|
+
},
|
96
|
+
);
|
97
|
+
```
|
98
|
+
|
99
|
+
### showSuccessInfo
|
100
|
+
|
101
|
+
Display success information.
|
102
|
+
|
103
|
+
Parameter:
|
104
|
+
|
105
|
+
- successInfo?: `string`. Default is Success.
|
106
|
+
|
107
|
+
### runSubGenerator
|
108
|
+
|
109
|
+
Run the subgenerator.
|
110
|
+
|
111
|
+
Parameter:
|
112
|
+
|
113
|
+
- subGenerator: `string`. Subgenerator name or path.
|
114
|
+
- relativePwdPath?: `string`. The relative path to which the'string 'subgenerator runs.
|
115
|
+
- config?: `Record<string, unknown>`. Default config configuration for subgenerator runs.
|
116
|
+
|
117
|
+
For example:
|
118
|
+
|
119
|
+
```typescript
|
120
|
+
await appApi.runSubGenerator(
|
121
|
+
getGeneratorPath('@modern-js/repo-generator', context.config.distTag),
|
122
|
+
undefined,
|
123
|
+
{ ...context.config, hasPlugin: false },
|
124
|
+
);
|
125
|
+
```
|
126
|
+
|
127
|
+
### getInputBySchema
|
128
|
+
|
129
|
+
User interaction input is done through schema.
|
130
|
+
|
131
|
+
Parameter:
|
132
|
+
|
133
|
+
- schema: `FormilySchema | Question[]`. Question list, supports Formily schema and inquirer types.
|
134
|
+
- type: `'formily' | 'inquirer'`. Schema type, the default value is formily.
|
135
|
+
- configValue: `Record<string, unknown> = {}`. Schema default value, the problem corresponding to the schema field passed in this value will no longer interact with the user.
|
136
|
+
- validateMap?: `Record<string, (input: unknown, data?: Record<string, unknown>) => { success: boolean; error?: string }>`. Validation function for special fields in schema.
|
137
|
+
- initValue?: `Record<string, any>`. Schema the initialization value of the field.
|
138
|
+
|
139
|
+
For Formily Schema type support, please refer to [Customize input related type definition](/docs/guides/topic-detail/generator/plugin/api/input/type).
|
140
|
+
|
141
|
+
### getInputBySchemaFunc
|
142
|
+
|
143
|
+
By schema to complete user interaction input, schema parameter value as function, the user handles globalization problems, and only supports Formily schema.
|
144
|
+
|
145
|
+
Parameter:
|
146
|
+
|
147
|
+
- schema: `config?: Record<string, any>) => FormilySchema`. Get the problem list function, the config parameter is the config configuration information in the current generator.
|
148
|
+
- configValue: `Record<string, unknown> = {}`. Schema default value, the problem corresponding to the schema field passed in this value will no longer interact with the user.
|
149
|
+
- validateMap?: `Record<string, (input: unknown, data?: Record<string, unknown>) => { success: boolean; error?: string }>`. Validation function for special fields in schema.
|
150
|
+
- initValue?: `Record<string, any>`. Schema the initialization value of the field.
|
151
|
+
|
152
|
+
For Formily Schema type support, please refer to [Customize input related type definition](/docs/guides/topic-detail/generator/plugin/api/input/type).
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/ejs.md
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 6
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-ejs
|
6
|
+
|
7
|
+
An API wrapper for file operations using [ejs] (https://ejs.co/) in microgenerators, providing a way to render individual template files and folders.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { EjsAPI } from '@modern-js/codesmith-api-ejs';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const ejsAPI = new EjsAPI(generator);
|
16
|
+
await ejsAPI.renderTemplate(
|
17
|
+
material.get('templates/a.js'),
|
18
|
+
target: 'b.js',
|
19
|
+
{ data: "data" }
|
20
|
+
);
|
21
|
+
}
|
22
|
+
```
|
23
|
+
|
24
|
+
- Create EjsAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
25
|
+
- Just call the API on its example.
|
26
|
+
|
27
|
+
## API
|
28
|
+
|
29
|
+
### renderTemplate
|
30
|
+
|
31
|
+
Render a single template file.
|
32
|
+
|
33
|
+
Parameter:
|
34
|
+
|
35
|
+
- templateResource: `FsResource`. Template file resource, used by `context.materials.get(<filename>)`.
|
36
|
+
- target: `string`. Target file path name.
|
37
|
+
- parameters?: `Record<string, string>`. Render parameter.
|
38
|
+
|
39
|
+
### renderTemplateDir
|
40
|
+
|
41
|
+
Render template folder.
|
42
|
+
|
43
|
+
Parameter:
|
44
|
+
|
45
|
+
- material: `FsMaterial`. The material context of the current microgenerator execution.
|
46
|
+
- findGlob: `string`. Template file matches the regular.
|
47
|
+
- target: `(globMatch: string) => string`. The target file path generation function, the parameter is `resourceKey.`
|
48
|
+
- options?: `RenderTemplateDirOptions`. Glob Find the file configuration, the specific function viewable is here [glob] (https://www.npmjs.com/package/glob).
|
49
|
+
|
50
|
+
```typescript
|
51
|
+
type RenderTemplateDirOptions = {
|
52
|
+
nodir?: boolean;
|
53
|
+
dot?: boolean;
|
54
|
+
ignore?: string | readonly string[];
|
55
|
+
};
|
56
|
+
```
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/fs.md
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-fs
|
6
|
+
|
7
|
+
API wrapper for file operations in microgenerators, providing methods to render individual template files and folders. FsAPI is usually used to handle binaries or template files that cannot be handled with handlebars, ejs.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { FsAPI } from '@modern-js/codesmith-api-fs';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const handlebarApi = new HandlebarsAPI(generator);
|
16
|
+
await handlebarsAPI.renderFile(
|
17
|
+
material.get('templates/a.js'),
|
18
|
+
target: 'b.js'
|
19
|
+
);
|
20
|
+
}
|
21
|
+
```
|
22
|
+
|
23
|
+
- Create FsAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
24
|
+
- Just call the API on its example.
|
25
|
+
|
26
|
+
## API
|
27
|
+
|
28
|
+
### renderFile
|
29
|
+
|
30
|
+
Render a single template file.
|
31
|
+
|
32
|
+
Parameter:
|
33
|
+
|
34
|
+
- resource: `FsResource`. Template file resource, used by `context.materials.get(<filename>)`.
|
35
|
+
- target: `string`. Target file path name.
|
36
|
+
|
37
|
+
### renderDir
|
38
|
+
|
39
|
+
Render template folder.
|
40
|
+
|
41
|
+
Parameter:
|
42
|
+
|
43
|
+
- material: `FsMaterial`. The material context of the current microgenerator execution.
|
44
|
+
- findGlob: `string`. Template file matches the regular.
|
45
|
+
- target: `(globMatch: string) => string`. The target file path generation function, the parameter is `resourceKey.`
|
46
|
+
- options?: `RenderTemplateDirOptions`. Glob Find the file configuration, the specific function viewable is here [glob] (https://www.npmjs.com/package/glob).
|
47
|
+
|
48
|
+
```typescript
|
49
|
+
type RenderTemplateDirOptions = {
|
50
|
+
nodir?: boolean;
|
51
|
+
dot?: boolean;
|
52
|
+
ignore?: string | readonly string[];
|
53
|
+
};
|
54
|
+
```
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/git.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 4
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-git
|
6
|
+
|
7
|
+
The API encapsulation of git-related operations in the micro-generator provides methods for judging git repository, initialization and commit code.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { GitAPI } from '@modern-js/codesmith-api-git';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const gitApi = new GitAPI(generatorCore, generatorContext);
|
16
|
+
await gitApi.initGitRepo();
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
- Create GitAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
21
|
+
|
22
|
+
- Just call the API on its example.
|
23
|
+
|
24
|
+
## API
|
25
|
+
|
26
|
+
### isInGitRepo
|
27
|
+
|
28
|
+
Whether the current directory is a git repository.
|
29
|
+
|
30
|
+
Parameter:
|
31
|
+
|
32
|
+
- cwd?: `string`. The execution directory of the git command, the default is microgenerator `outputPath`.
|
33
|
+
|
34
|
+
### initGitRepo
|
35
|
+
|
36
|
+
The initialization is the git repository. The default branch name for init can be configured via `defaultBranch` in the generator config.
|
37
|
+
|
38
|
+
Parameter:
|
39
|
+
|
40
|
+
- cwd?: `string`. The execution directory of the git command, the default is microgenerator `outputPath`.
|
41
|
+
- force?: `boolean`. Use this parameter to force git init when the current directory is already a git repository.
|
42
|
+
|
43
|
+
### addAndCommit
|
44
|
+
|
45
|
+
Execute `git add .` and `git commit` commit the current changes.
|
46
|
+
|
47
|
+
Parameter:
|
48
|
+
- commitMessage: `string`. Commit information.
|
49
|
+
- cwd?: `string`. The execution directory of the git command, the default is microgenerator `outputPath`.
|
@@ -0,0 +1,58 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 5
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-handlebars
|
6
|
+
|
7
|
+
An API wrapper for file operations using [handlebars] (https://handlebarsjs.com/) in the microgenerator, providing a way to render individual template files and folders.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { HandlebarsAPI } from '@modern-js/codesmith-api-handlebars';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const handlebarApi = new HandlebarsAPI(generator);
|
16
|
+
await handlebarsAPI.renderTemplate(
|
17
|
+
material.get('templates/a.js'),
|
18
|
+
target: 'b.js',
|
19
|
+
{ data: "data" }
|
20
|
+
);
|
21
|
+
}
|
22
|
+
```
|
23
|
+
|
24
|
+
- Create HandlebarsAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
25
|
+
|
26
|
+
- Just call the API on its example.
|
27
|
+
|
28
|
+
|
29
|
+
## API
|
30
|
+
|
31
|
+
### renderTemplate
|
32
|
+
|
33
|
+
Render a single template file.
|
34
|
+
|
35
|
+
Parameter:
|
36
|
+
|
37
|
+
- templateResource: `FsResource`. Template file resource, used by `context.materials.get(<filename>)`.
|
38
|
+
- target: `string`. Target file path name.
|
39
|
+
- parameters?: `Record<string, string>`. Render parameter.
|
40
|
+
|
41
|
+
### renderTemplateDir
|
42
|
+
|
43
|
+
Render template folder.
|
44
|
+
|
45
|
+
Parameter:
|
46
|
+
|
47
|
+
- material: `FsMaterial`. The material context of the current microgenerator execution.
|
48
|
+
- findGlob: `string`. Template file matches the regular.
|
49
|
+
- target: `(globMatch: string) => string`. The target file path generation function, the parameter is `resourceKey.`
|
50
|
+
- options?: `RenderTemplateDirOptions`. Glob Find the file configuration, the specific function viewable is here [glob] (https://www.npmjs.com/package/glob).
|
51
|
+
|
52
|
+
```typescript
|
53
|
+
type RenderTemplateDirOptions = {
|
54
|
+
nodir?: boolean;
|
55
|
+
dot?: boolean;
|
56
|
+
ignore?: string | readonly string[];
|
57
|
+
};
|
58
|
+
```
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 2
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-json
|
6
|
+
|
7
|
+
The JSON API encapsulation in the microgenerator provides common JSON file operation methods.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { JsonAPI } from '@modern-js/codesmith-api-json';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const jsonAPI = new JsonAPI(generator);
|
16
|
+
await jsonAPI.update(
|
17
|
+
context.materials.default.get('package.json'),
|
18
|
+
{
|
19
|
+
query: {},
|
20
|
+
update: {
|
21
|
+
$set: {
|
22
|
+
'dependencies.@modern-js/plugin-bff': `^2.0.0`,
|
23
|
+
},
|
24
|
+
},
|
25
|
+
},
|
26
|
+
);
|
27
|
+
}
|
28
|
+
```
|
29
|
+
|
30
|
+
- Create JsonAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
31
|
+
- Just call the API on its example.
|
32
|
+
|
33
|
+
|
34
|
+
## API
|
35
|
+
|
36
|
+
### get
|
37
|
+
|
38
|
+
Get the JSON file content.
|
39
|
+
|
40
|
+
Parameter:
|
41
|
+
- resource: `FsResource`. A file resource,get by `context.materials.default.get(<filename>)`.
|
42
|
+
|
43
|
+
### extend
|
44
|
+
|
45
|
+
Merge objects into a JSON file.
|
46
|
+
|
47
|
+
Parameter:
|
48
|
+
|
49
|
+
- resource: `FsResource`. A file resource,get by `context.materials.default.get(<filename>)`.
|
50
|
+
- obj: `Record<string, any>`. Object to be merged.
|
51
|
+
|
52
|
+
### update
|
53
|
+
|
54
|
+
pdate object fields to JSON file.
|
55
|
+
|
56
|
+
Parameter:
|
57
|
+
|
58
|
+
- resource: `FsResource`. A file resource,get by `context.materials.default.get(<filename>)`.
|
59
|
+
- operation: `{ query: Record<string, any>; update: Record<string, any> }`. Update operation, use gesture to view [declaration-update](https://www.npmjs.com/package/declaration-update) in detail.
|
package/en/docusaurus-plugin-content-docs/current/guides/topic-detail/generator/codesmith/api/npm.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 7
|
3
|
+
---
|
4
|
+
|
5
|
+
# @modern-js/codesmith-api-npm
|
6
|
+
|
7
|
+
The NPM API encapsulation in the microgenerator provides a common method for installing dependencies of different NPM package management tools.
|
8
|
+
|
9
|
+
## Use
|
10
|
+
|
11
|
+
```typescript
|
12
|
+
import { NpmAPI } from '@modern-js/codesmith-api-npm';
|
13
|
+
|
14
|
+
export default async (context: GeneratorContext, generator: GeneratorCore) => {
|
15
|
+
const npmApi = new NpmAPI(generator);
|
16
|
+
await npmApi.pnpmInstall();
|
17
|
+
}
|
18
|
+
```
|
19
|
+
|
20
|
+
- Create NpmAPI instance, the parameter is the generator of the microgenerator function parameter, please see the composition of the microgenerator project for details.
|
21
|
+
|
22
|
+
- Just call the API on its example.
|
23
|
+
|
24
|
+
|
25
|
+
## API
|
26
|
+
|
27
|
+
### npmInstall
|
28
|
+
|
29
|
+
Install dependency using npm.
|
30
|
+
|
31
|
+
Parameter:
|
32
|
+
|
33
|
+
- cwd?: `string`. The execution directory of the install command, the default is microgenerator `outputPath`.
|
34
|
+
|
35
|
+
### yarnInstall
|
36
|
+
|
37
|
+
Install dependency using yarn.
|
38
|
+
|
39
|
+
Parameter:
|
40
|
+
|
41
|
+
- cwd?: `string`. The execution directory of the install command, the default is microgenerator `outputPath`.
|
42
|
+
|
43
|
+
### pnpmInstall
|
44
|
+
|
45
|
+
Install dependency using pnpm.
|
46
|
+
|
47
|
+
Parameter:
|
48
|
+
|
49
|
+
- cwd?: `string`. The execution directory of the install command, the default is microgenerator `outputPath`.
|