@modern-js/main-doc 2.0.0-beta.0 → 2.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.turbo/turbo-build.log +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/_category_.json +8 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/build.md +44 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/dev.md +31 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/index.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/inspect.md +39 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/lint.md +22 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/new.md +59 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/start.md +32 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/test.md +36 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/commands/upgrade.md +21 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/_category_.json +8 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/framework/lambda.md +54 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/api.md +78 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/app.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/functions/common.md +10 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/api/test.md +10 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/html.md +8 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/icon.md +15 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/mock.md +6 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/public.md +28 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/storybook.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/config/upload.md +42 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/index.md +7 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/modern-config.md +8 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/index_.md +14 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/server/test.md +10 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/shared.md +6 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/app.md +45 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/index_.md +34 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/pages.md +180 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/stories.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/hooks/src/test.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/overview.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/_category_.json +9 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/app/define-config.md +60 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/hook.md +43 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/bff/use-context.md +36 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/_category_.json +5 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/bootstrap.md +55 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/create-app.md +47 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-loader.md +83 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-module-apps.md +101 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/core/use-runtime-context.md +59 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/default-alias.md +25 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/env.md +72 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/index.md +12 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/Provider.md +35 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/auto-actions.md +120 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/connect.md +140 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-app.md +73 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/create-store.md +62 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/handle-effect.md +105 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/model_.md +197 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-local-model.md +27 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-model.md +89 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-static-model.md +49 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/model/use-store.md +48 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/abstract.md +26 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook-api.md +896 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/hook.md +170 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/plugin/plugin-api.md +117 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/router/router.md +492 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/no-ssr.md +44 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/ssr/pre-render.md +91 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/act.md +34 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/cleanup.md +38 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/render.md +72 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/testing/renderApp.md +33 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/css-in-js.md +42 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/head.md +39 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/utility/loadable.md +85 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/_category_.json +4 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/hook.md +131 -0
- package/en/docusaurus-plugin-content-docs/current/apis/app/runtime/web-server/middleware.md +106 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/bff/fetcher.md +28 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/bff/prefix.md +33 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/bff/proxy.md +75 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/asset-prefix.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/hmr.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/https.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/port.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/progress-bar.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/proxy.md +80 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/dev/start-url.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/dev/with-master-app.md +32 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/experiments/lazy-compilation.md +12 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/app-icon.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/crossorigin.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/disable-html-folder.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/favicon-by-entries.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/favicon.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/inject-by-entries.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/inject.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/meta-by-entries.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/meta.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/mount-id.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-by-entries.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-parameters-by-entries.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template-parameters.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/template.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/title-by-entries.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/html/title.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/asset-prefix.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/assets-retry.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/charset.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/clean-dist-path.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/convert-to-rem.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/copy.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/css-module-local-ident-name.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/data-uri-limit.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-css-module-extension.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-filename-hash.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-inline-runtime-chunk.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-minimize.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-node-polyfill.md +20 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/disable-source-map.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/disable-ts-checker.md +12 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/dist-path.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-asset-fallback.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-asset-manifest.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-css-module-tsdeclaration.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-inline-scripts.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-inline-styles.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/enable-latest-decorators.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/output/enable-modern-mode.md +34 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/externals.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/filename.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/legal-comments.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/override-browserslist.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/polyfill.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/output/svg-default-export.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/build-cache.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/bundle-analyze.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/chunk-split.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/print-file-size.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/profile.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/remove-console.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/performance/remove-moment-locale.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/plugins.md +74 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/intro.md +91 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/master-app.md +60 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/router.md +19 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/runtime/state.md +41 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/security/sri.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/base-url.md +33 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/port.md +18 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/public-routes.md +26 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/routes.md +91 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr-by-entries.md +28 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/server/ssr.md +20 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/alias.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/compile-js-data-uri.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/config-dir.md +23 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/define.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/design-system.md +1150 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/disable-default-entries.md +28 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/enable-async-entry.md +50 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries-dir.md +38 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/entries.md +62 -0
- package/en/docusaurus-plugin-content-docs/current/configure/app/source/exclude.md +12 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/global-vars.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/include.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/module-scopes.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/pre-entry.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/resolve-extension-prefix.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/source/resolve-main-fields.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/testing/transformer.md +18 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/autoprefixer.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/babel.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/css-extract.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/css-loader.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/dev-server.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/esbuild.md +61 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/html-plugin.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/inspector.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/jest.md +39 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/less.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/minify-css.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/postcss.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/pug.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/sass.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/style-loader.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/styled-components.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/tools/tailwindcss.md +47 -0
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/terser.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/ts-checker.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/ts-loader.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/webpack-chain.md +0 -1
- package/en/{configure → docusaurus-plugin-content-docs/current/configure}/app/tools/webpack.md +0 -1
- package/en/docusaurus-plugin-content-docs/current/configure/app/usage.md +92 -0
- package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/_category_.json +0 -0
- package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/basic.md +0 -0
- package/en/{tutorials → docusaurus-plugin-content-docs/current/tutorials}/foundations/introduction.md +0 -0
- package/en/docusaurus-plugin-content-docs/current.json +262 -0
- package/package.json +7 -5
- package/scripts/config.ts +98 -0
- package/scripts/summary.en.json +1 -0
- package/scripts/summary.zh.json +1 -0
- package/scripts/sync.ts +26 -5
- package/zh/apis/app/commands/build.md +2 -2
- package/zh/apis/app/commands/dev.md +1 -1
- package/zh/apis/app/commands/index.md +1 -1
- package/zh/apis/app/commands/lint.md +2 -2
- package/zh/apis/app/commands/new.md +1 -1
- package/zh/apis/app/commands/start.md +1 -1
- package/zh/apis/app/commands/test.md +1 -1
- package/zh/apis/app/commands/upgrade.md +0 -2
- package/zh/apis/app/hooks/api/framework/_category_.json +1 -1
- package/zh/apis/app/hooks/api/framework/lambda.md +8 -33
- package/zh/apis/app/hooks/api/functions/_category_.json +1 -1
- package/zh/apis/app/hooks/api/functions/api.md +29 -2
- package/zh/apis/app/hooks/api/functions/app.md +5 -3
- package/zh/apis/app/hooks/api/functions/common.md +3 -5
- package/zh/apis/app/hooks/api/test.md +2 -4
- package/zh/apis/app/hooks/config/html.md +1 -3
- package/zh/apis/app/hooks/config/icon.md +2 -2
- package/zh/apis/app/hooks/config/mock.md +2 -8
- package/zh/apis/app/hooks/config/public.md +2 -4
- package/zh/apis/app/hooks/config/storybook.md +2 -4
- package/zh/apis/app/hooks/config/upload.md +1 -7
- package/zh/apis/app/hooks/modern-config.md +1 -3
- package/zh/apis/app/hooks/server/index_.md +12 -0
- package/zh/apis/app/hooks/server/test.md +3 -3
- package/zh/apis/app/hooks/shared.md +1 -2
- package/zh/apis/app/hooks/src/app.md +8 -4
- package/zh/apis/app/hooks/src/{index.md → index_.md} +2 -2
- package/zh/apis/app/hooks/src/pages.md +3 -4
- package/zh/apis/app/hooks/src/stories.md +2 -2
- package/zh/apis/app/hooks/src/test.md +1 -1
- package/zh/apis/app/overview.md +1 -1
- package/zh/apis/app/runtime/app/_category_.json +2 -2
- package/zh/apis/app/runtime/app/define-config.md +14 -10
- package/zh/apis/app/runtime/bff/_category_.json +4 -0
- package/zh/apis/app/runtime/bff/hook.md +43 -0
- package/zh/apis/app/runtime/bff/use-context.md +36 -0
- package/zh/apis/app/runtime/core/_category_.json +4 -0
- package/zh/apis/app/runtime/core/bootstrap.md +55 -0
- package/zh/apis/app/runtime/core/create-app.md +47 -0
- package/zh/apis/app/runtime/core/use-loader.md +83 -0
- package/zh/apis/app/runtime/core/use-module-apps.md +101 -0
- package/zh/apis/app/runtime/core/use-runtime-context.md +59 -0
- package/zh/apis/app/runtime/default-alias.md +4 -7
- package/zh/apis/app/runtime/env.md +22 -20
- package/zh/apis/app/runtime/model/Provider.md +6 -8
- package/zh/apis/app/runtime/model/_category_.json +1 -1
- package/zh/apis/app/runtime/model/auto-actions.md +1 -2
- package/zh/apis/app/runtime/model/connect.md +8 -5
- package/zh/apis/app/runtime/model/create-app.md +3 -4
- package/zh/apis/app/runtime/model/create-store.md +5 -3
- package/zh/apis/app/runtime/model/handle-effect.md +5 -5
- package/zh/apis/app/runtime/model/model_.md +3 -3
- package/zh/apis/app/runtime/model/use-local-model.md +2 -2
- package/zh/apis/app/runtime/model/use-model.md +6 -7
- package/zh/apis/app/runtime/model/use-static-model.md +2 -2
- package/zh/apis/app/runtime/model/use-store.md +3 -3
- package/zh/apis/app/runtime/router/_category_.json +4 -0
- package/zh/apis/app/runtime/{container → router}/router.md +0 -0
- package/zh/apis/app/runtime/ssr/_category_.json +4 -0
- package/zh/apis/app/runtime/ssr/no-ssr.md +41 -0
- package/zh/apis/app/runtime/ssr/pre-render.md +91 -0
- package/zh/apis/app/runtime/testing/_category_.json +1 -1
- package/zh/apis/app/runtime/testing/act.md +8 -8
- package/zh/apis/app/runtime/testing/cleanup.md +10 -9
- package/zh/apis/app/runtime/testing/render.md +43 -23
- package/zh/apis/app/runtime/testing/renderApp.md +8 -8
- package/zh/apis/app/runtime/utility/_category_.json +1 -1
- package/zh/apis/app/runtime/utility/css-in-js.md +17 -35
- package/zh/apis/app/runtime/{app → utility}/head.md +6 -10
- package/zh/apis/app/runtime/utility/{loadable/loadable_.md → loadable.md} +29 -56
- package/zh/apis/app/runtime/web-server/_category_.json +1 -1
- package/zh/apis/app/runtime/web-server/hook.md +100 -90
- package/zh/apis/app/runtime/web-server/middleware.md +106 -0
- package/zh/apis/monorepo/commands/bump.md +1 -1
- package/zh/apis/monorepo/commands/change.md +1 -1
- package/zh/apis/monorepo/commands/clear.md +1 -1
- package/zh/apis/monorepo/commands/deploy.md +1 -1
- package/zh/apis/monorepo/commands/gen-release-note.md +1 -1
- package/zh/apis/monorepo/commands/lint.md +1 -1
- package/zh/apis/monorepo/commands/new.md +1 -1
- package/zh/apis/monorepo/commands/pre.md +1 -1
- package/zh/apis/monorepo/commands/release.md +1 -1
- package/zh/configure/app/bff/fetcher.md +1 -2
- package/zh/configure/app/bff/prefix.md +2 -3
- package/zh/configure/app/bff/proxy.md +8 -13
- package/zh/configure/app/dev/asset-prefix.md +0 -1
- package/zh/configure/app/dev/hmr.md +0 -1
- package/zh/configure/app/dev/https.md +0 -1
- package/zh/configure/app/dev/port.md +0 -1
- package/zh/configure/app/dev/progress-bar.md +0 -1
- package/zh/configure/app/dev/proxy.md +2 -3
- package/zh/configure/app/dev/start-url.md +0 -1
- package/zh/configure/app/dev/with-master-app.md +0 -1
- package/zh/configure/app/experiments/lazy-compilation.md +12 -0
- package/zh/configure/app/html/app-icon.md +0 -1
- package/zh/configure/app/html/crossorigin.md +0 -1
- package/zh/configure/app/html/disable-html-folder.md +0 -1
- package/zh/configure/app/html/favicon-by-entries.md +0 -1
- package/zh/configure/app/html/favicon.md +0 -1
- package/zh/configure/app/html/inject-by-entries.md +0 -1
- package/zh/configure/app/html/inject.md +0 -1
- package/zh/configure/app/html/meta-by-entries.md +0 -1
- package/zh/configure/app/html/meta.md +0 -1
- package/zh/configure/app/html/mount-id.md +0 -1
- package/zh/configure/app/html/template-by-entries.md +0 -1
- package/zh/configure/app/html/template-parameters-by-entries.md +0 -1
- package/zh/configure/app/html/template-parameters.md +0 -1
- package/zh/configure/app/html/template.md +0 -1
- package/zh/configure/app/html/title-by-entries.md +0 -1
- package/zh/configure/app/html/title.md +0 -1
- package/zh/configure/app/output/asset-prefix.md +0 -1
- package/zh/configure/app/output/assets-retry.md +0 -1
- package/zh/configure/app/output/charset.md +0 -1
- package/zh/configure/app/output/clean-dist-path.md +0 -1
- package/zh/configure/app/output/convert-to-rem.md +0 -1
- package/zh/configure/app/output/copy.md +0 -1
- package/zh/configure/app/output/css-module-local-ident-name.md +0 -1
- package/zh/configure/app/output/data-uri-limit.md +0 -1
- package/zh/configure/app/output/disable-css-module-extension.md +0 -1
- package/zh/configure/app/output/disable-filename-hash.md +0 -1
- package/zh/configure/app/output/disable-inline-runtime-chunk.md +0 -1
- package/zh/configure/app/output/disable-minimize.md +0 -1
- package/zh/configure/app/output/disable-node-polyfill.md +2 -4
- package/zh/configure/app/output/disable-source-map.md +0 -1
- package/zh/configure/app/output/disable-ts-checker.md +12 -0
- package/zh/configure/app/output/dist-path.md +0 -1
- package/zh/configure/app/output/enable-asset-fallback.md +0 -1
- package/zh/configure/app/output/enable-asset-manifest.md +0 -1
- package/zh/configure/app/output/enable-css-module-tsdeclaration.md +0 -1
- package/zh/configure/app/output/enable-inline-scripts.md +0 -1
- package/zh/configure/app/output/enable-inline-styles.md +0 -1
- package/zh/configure/app/output/enable-latest-decorators.md +0 -1
- package/zh/configure/app/output/enable-modern-mode.md +13 -5
- package/zh/configure/app/output/externals.md +0 -1
- package/zh/configure/app/output/filename.md +0 -1
- package/zh/configure/app/output/legal-comments.md +0 -1
- package/zh/configure/app/output/override-browserslist.md +0 -1
- package/zh/configure/app/output/polyfill.md +0 -1
- package/zh/configure/app/output/svg-default-export.md +0 -1
- package/zh/configure/app/performance/build-cache.md +0 -1
- package/zh/configure/app/performance/bundle-analyze.md +0 -1
- package/zh/configure/app/performance/chunk-split.md +0 -1
- package/zh/configure/app/performance/print-file-size.md +0 -1
- package/zh/configure/app/performance/profile.md +0 -1
- package/zh/configure/app/performance/remove-console.md +0 -1
- package/zh/configure/app/performance/remove-moment-locale.md +0 -1
- package/zh/configure/app/runtime/intro.md +92 -0
- package/zh/configure/app/runtime/master-app.md +8 -21
- package/zh/configure/app/runtime/router.md +4 -38
- package/zh/configure/app/runtime/state.md +10 -13
- package/zh/configure/app/security/sri.md +0 -1
- package/zh/configure/app/server/base-url.md +1 -2
- package/zh/configure/app/server/port.md +1 -2
- package/zh/configure/app/server/public-routes.md +1 -2
- package/zh/configure/app/server/routes.md +4 -5
- package/zh/configure/app/server/ssr-by-entries.md +2 -3
- package/zh/configure/app/server/ssr.md +1 -2
- package/zh/configure/app/source/alias.md +0 -1
- package/zh/configure/app/source/compile-js-data-uri.md +0 -1
- package/zh/configure/app/source/config-dir.md +12 -4
- package/zh/configure/app/source/define.md +0 -1
- package/zh/configure/app/source/design-system.md +14 -24
- package/zh/configure/app/source/disable-default-entries.md +8 -3
- package/zh/configure/app/source/enable-async-entry.md +3 -3
- package/zh/configure/app/source/entries-dir.md +1 -1
- package/zh/configure/app/source/entries.md +16 -9
- package/zh/configure/app/source/exclude.md +12 -0
- package/zh/configure/app/source/global-vars.md +0 -1
- package/zh/configure/app/source/include.md +0 -1
- package/zh/configure/app/source/module-scopes.md +0 -1
- package/zh/configure/app/source/pre-entry.md +0 -1
- package/zh/configure/app/source/resolve-extension-prefix.md +0 -1
- package/zh/configure/app/source/resolve-main-fields.md +0 -1
- package/zh/configure/app/testing/transformer.md +2 -4
- package/zh/configure/app/tools/autoprefixer.md +0 -1
- package/zh/configure/app/tools/babel.md +0 -1
- package/zh/configure/app/tools/css-extract.md +0 -1
- package/zh/configure/app/tools/css-loader.md +0 -1
- package/zh/configure/app/tools/dev-server.md +0 -1
- package/zh/configure/app/tools/esbuild.md +5 -5
- package/zh/configure/app/tools/html-plugin.md +0 -1
- package/zh/configure/app/tools/inspector.md +0 -1
- package/zh/configure/app/tools/jest.md +2 -4
- package/zh/configure/app/tools/less.md +0 -1
- package/zh/configure/app/tools/minify-css.md +0 -1
- package/zh/configure/app/tools/postcss.md +0 -1
- package/zh/configure/app/tools/pug.md +0 -1
- package/zh/configure/app/tools/sass.md +0 -1
- package/zh/configure/app/tools/style-loader.md +0 -1
- package/zh/configure/app/tools/styled-components.md +0 -1
- package/zh/configure/app/tools/terser.md +0 -1
- package/zh/configure/app/tools/ts-checker.md +0 -1
- package/zh/configure/app/tools/ts-loader.md +0 -1
- package/zh/configure/app/tools/webpack-chain.md +0 -1
- package/zh/configure/app/tools/webpack.md +0 -1
- package/zh/configure/app/usage.md +15 -4
- package/zh/guides/advanced-features/bff/bff-server.md +1 -1
- package/zh/guides/advanced-features/bff/frameworks.md +0 -221
- package/zh/guides/advanced-features/code-split.md +1 -1
- package/zh/guides/advanced-features/low-level.md +2 -2
- package/zh/guides/advanced-features/ssg.md +2 -2
- package/zh/guides/advanced-features/ssr.md +4 -4
- package/zh/guides/basic-features/alias.md +1 -1
- package/zh/guides/basic-features/css/postcss.md +1 -1
- package/zh/guides/basic-features/css/tailwindcss.md +2 -2
- package/zh/guides/basic-features/env-vars.md +2 -3
- package/zh/guides/basic-features/proxy.md +2 -2
- package/zh/guides/topic-detail/compile-speed.md +5 -5
- package/zh/guides/topic-detail/generator/_category_.json +4 -0
- package/zh/guides/topic-detail/generator/codesmith/_category_.json +4 -0
- package/zh/guides/topic-detail/generator/codesmith/introduce.md +5 -0
- package/zh/guides/topic-detail/generator/config/_category_.json +4 -0
- package/zh/{configure/generator/introduce.md → guides/topic-detail/generator/config/common.md} +35 -42
- package/zh/{configure/generator → guides/topic-detail/generator/config}/module.md +7 -11
- package/zh/{configure/generator → guides/topic-detail/generator/config}/monorepo.md +4 -4
- package/zh/{configure/generator → guides/topic-detail/generator/config}/mwa.md +11 -45
- package/zh/guides/topic-detail/generator/plugin/_category_.json +4 -0
- package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/abstract.md +0 -0
- package/zh/guides/topic-detail/generator/plugin/api/_category_.json +4 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addFile.md +1 -1
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addHelper.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addManyFile.md +1 -1
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/addPartial.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/introduce.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/rmDir.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/rmFile.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateJSONFile.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateModernConfig.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/file/updateTextRawFile.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/gitAddAndCommit.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/initGitRepo.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/git/isInGitRepo.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/afterForged.md +1 -1
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/hook/onForged.md +1 -1
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/isFileExit.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/locale.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/info/readDir.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/addInputAfter.md +14 -6
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/addInputBefore.md +14 -6
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/setInput.md +2 -2
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/input/setInputValue.md +0 -0
- package/zh/guides/topic-detail/generator/plugin/api/input/type.md +65 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/introduce.md +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/createElement.md +1 -1
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/createSubProject.md +1 -1
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/enableFunc.md +1 -3
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/new/introduce.md +3 -3
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/npm/_category_.json +0 -0
- package/zh/{apis/generator/plugin → guides/topic-detail/generator/plugin/api}/npm/install.md +0 -0
- package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/develop.md +4 -4
- package/zh/guides/topic-detail/{generator-plugin → generator/plugin}/use.md +0 -0
- package/zh/guides/topic-detail/generator/project.md +117 -0
- package/zh/guides/topic-detail/micro-frontend/debugging.md +5 -5
- package/zh/guides/topic-detail/micro-frontend/route-mode.md +2 -2
- package/zh/guides/troubleshooting/compile.md +3 -3
- package/zh/tutorials/first-app/c01-getting-started/1.4-enable-ssr.md +2 -2
- package/zh/tutorials/first-app/c04-es6-plus-and-ts/4.3-compatibility.md +4 -4
- package/zh/tutorials/first-app/c06-css-and-component/6.4-design-system.md +3 -3
- package/zh/tutorials/first-app/c07-app-entry/7.3-manage-entries-by-hand.md +2 -2
- package/zh/tutorials/first-app/c08-client-side-routing/8.1-code-based-routing.md +1 -1
- package/scripts/gen-config.ts +0 -60
- package/zh/apis/app/hooks/api/framework/app.md +0 -100
- package/zh/apis/app/hooks/server/index.md +0 -14
- package/zh/apis/app/hooks/src/error.md +0 -10
- package/zh/apis/app/hooks/src/eslint.md +0 -9
- package/zh/apis/app/runtime/app/bootstrap.md +0 -83
- package/zh/apis/app/runtime/app/create-app.md +0 -47
- package/zh/apis/app/runtime/app/no-ssr.md +0 -41
- package/zh/apis/app/runtime/app/pre-render.md +0 -77
- package/zh/apis/app/runtime/app/use-module-app.md +0 -60
- package/zh/apis/app/runtime/app/use-module-apps.md +0 -64
- package/zh/apis/app/runtime/app/use-runtime-context.md +0 -39
- package/zh/apis/app/runtime/bff-server/_category_.json +0 -4
- package/zh/apis/app/runtime/bff-server/after-lambda-registed.md +0 -35
- package/zh/apis/app/runtime/bff-server/hook.md +0 -120
- package/zh/apis/app/runtime/bff-server/use-context.md +0 -70
- package/zh/apis/app/runtime/container/_category_.json +0 -4
- package/zh/apis/app/runtime/container/use-loader.md +0 -64
- package/zh/apis/app/runtime/utility/loadable/_category_.json +0 -4
- package/zh/apis/app/runtime/utility/loadable/lazy.md +0 -29
- package/zh/apis/app/runtime/utility/loadable/loadable-component.md +0 -61
- package/zh/apis/app/runtime/utility/loadable/loadable-library.md +0 -67
- package/zh/apis/generator/plugin/_category_.json +0 -4
- package/zh/apis/generator/plugin/input/addOptionAfter.md +0 -45
- package/zh/apis/generator/plugin/input/addOptionBefore.md +0 -45
- package/zh/apis/generator/plugin/input/type.md +0 -101
- package/zh/guides/topic-detail/generator-plugin/_category_.json +0 -4
@@ -0,0 +1,44 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 5
|
3
|
+
---
|
4
|
+
|
5
|
+
```bash
|
6
|
+
Usage: modern build [options]
|
7
|
+
|
8
|
+
build application
|
9
|
+
|
10
|
+
Options:
|
11
|
+
-c --config <config> configuration file path, which can be a relative path or an absolute path
|
12
|
+
-h, --help show command help
|
13
|
+
--analyze analyze the bundle and view size of each module
|
14
|
+
```
|
15
|
+
|
16
|
+
`modern build` command will by default build production in `dist/`.
|
17
|
+
|
18
|
+
you can configure the [`output.distPath`](/docs/configure/app/output/dist-path) specifies the output directory for the product.
|
19
|
+
|
20
|
+
## Analyze Bundle
|
21
|
+
|
22
|
+
execute `npx modern build --analyze` command,can produce an HTML file that analyzes the volume of the bundle while packaging the production code:
|
23
|
+
|
24
|
+
```
|
25
|
+
Bundle Analyzer saved report to /example/dist/report.html
|
26
|
+
File sizes after production build:
|
27
|
+
|
28
|
+
122.35 KB dist/static/js/885.1d4fbe5a.js
|
29
|
+
2.3 KB dist/static/js/main.4b8e8d64.js
|
30
|
+
761 B dist/static/js/runtime-main.edb7cf35.js
|
31
|
+
645 B dist/static/css/main.0dd3ecc1.css
|
32
|
+
```
|
33
|
+
|
34
|
+
Open the above HTML file in the browser, you can see the tile diagram of the packaged product, and perform package volume analysis and optimization:
|
35
|
+
|
36
|
+
<img src="https://lf3-static.bytednsdoc.com/obj/eden-cn/aphqeh7uhohpquloj/modern-js/mwa-build-analyze-8784f762c1ab0cb20935829d5f912c4c.png" />
|
37
|
+
|
38
|
+
> this features based on [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack-bundle-analyzer).
|
39
|
+
|
40
|
+
## Command Arguments
|
41
|
+
|
42
|
+
import CommandTip from '@site-docs/components/command-tip.md'
|
43
|
+
|
44
|
+
<CommandTip />
|
@@ -0,0 +1,31 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 1
|
3
|
+
---
|
4
|
+
|
5
|
+
# dev
|
6
|
+
|
7
|
+
```bash
|
8
|
+
Usage: modern dev [options]
|
9
|
+
|
10
|
+
Development commands
|
11
|
+
|
12
|
+
Options:
|
13
|
+
-e --entry <entry> compiler by entry
|
14
|
+
-c --config <config> configuration file path, which can be a relative path or an absolute path
|
15
|
+
-h, --help show command help
|
16
|
+
--analyze analyze the bundle and view size of each module
|
17
|
+
--api-only only start API service
|
18
|
+
```
|
19
|
+
|
20
|
+
`modern dev` start a development server,watch file change,default support React Fast Refresh:
|
21
|
+
|
22
|
+
```bash
|
23
|
+
App running at:
|
24
|
+
|
25
|
+
> Local: http://localhost:8080/
|
26
|
+
> Network: http://192.168.0.1:8080/
|
27
|
+
```
|
28
|
+
|
29
|
+
import CommandTip from '@site-docs/components/command-tip.md'
|
30
|
+
|
31
|
+
<CommandTip />
|
@@ -0,0 +1,39 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 7
|
3
|
+
---
|
4
|
+
|
5
|
+
```
|
6
|
+
Usage: modern inspect [options]
|
7
|
+
|
8
|
+
inspect internal webpack config
|
9
|
+
|
10
|
+
Options:
|
11
|
+
--env <env> view the configuration in the target environment (default: "development")
|
12
|
+
--output <output> Specify the path to output in the dist (default: "/")
|
13
|
+
--no-console Do not output the full result in shell
|
14
|
+
--verbose Show the full function in the result
|
15
|
+
-c --config <config> configuration file path, which can be a relative path or an absolute path
|
16
|
+
-h, --help show command help
|
17
|
+
```
|
18
|
+
|
19
|
+
`modern inspect` command used to view the full webpack configuration of the project.
|
20
|
+
|
21
|
+
Executing the command `npx modern inspect` in the project will output the webpack configuration on the shell, and will also generate a `webpack.client.inspect.js` file in the project's `dist` directory, which developers can open and view manually.
|
22
|
+
|
23
|
+
## Configuration Env
|
24
|
+
|
25
|
+
By default, the webpack configuration of the development environment is output. And the `env` option can be used to output the configuration of the production environment:
|
26
|
+
|
27
|
+
```bash
|
28
|
+
modern inspect --env production
|
29
|
+
```
|
30
|
+
|
31
|
+
## Configuration Type
|
32
|
+
|
33
|
+
### SSR Configuration
|
34
|
+
|
35
|
+
If the project has SSR enable, an additional `webpack.ssr.inspect.js` file will be generated in the `dist/`, corresponding to the webpack configuration at SSR build time.
|
36
|
+
|
37
|
+
### Modern Configuration
|
38
|
+
|
39
|
+
if project enable [enableModernMode](/docs/configure/app/output/enable-modern-mode), an additional `webpack.modern.inspect.js` file will be generated in the `dist/`corresponding to the webpack configuration at modern web build.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 4
|
3
|
+
title: lint
|
4
|
+
---
|
5
|
+
|
6
|
+
```bash
|
7
|
+
Usage: modern lint [options] [...files]
|
8
|
+
|
9
|
+
lint and fix source files
|
10
|
+
|
11
|
+
Options:
|
12
|
+
--no-fix disable auto fix source file
|
13
|
+
-h, --help display help for command
|
14
|
+
```
|
15
|
+
|
16
|
+
Run ESLint to check the syntax of the code. Normally, only the part of the code modified by this commit needs to be checked by `lint-staged` during the `git commit` phase.
|
17
|
+
|
18
|
+
* `--no-fix` close auto fix by lint.
|
19
|
+
|
20
|
+
import CommandTip from '@site-docs/components/command-tip.md'
|
21
|
+
|
22
|
+
<CommandTip />
|
@@ -0,0 +1,59 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 2
|
3
|
+
---
|
4
|
+
|
5
|
+
```bash
|
6
|
+
Usage: modern new [options]
|
7
|
+
|
8
|
+
Execution Generator in App
|
9
|
+
|
10
|
+
Options:
|
11
|
+
-d, --debug using debug mode to log something (default: false)
|
12
|
+
-c, --config <config> set default generator config(json string)
|
13
|
+
--dist-tag <tag> use specified tag version for its generator
|
14
|
+
--registry set npm registry url to run npm command
|
15
|
+
-h, --help show command help
|
16
|
+
```
|
17
|
+
|
18
|
+
The `modern new` command is used to enable features to an existing project.
|
19
|
+
|
20
|
+
For example, add application entry, enable some optional features such as Tailwind CSS, micro frontend, etc.
|
21
|
+
|
22
|
+
import CommandTip from '@site-docs/components/command-tip.md'
|
23
|
+
|
24
|
+
<CommandTip />
|
25
|
+
|
26
|
+
### Add Entry
|
27
|
+
|
28
|
+
In the project, execute the `new` command to add entries as follows:
|
29
|
+
|
30
|
+
```bash
|
31
|
+
$ npx modern new
|
32
|
+
? 请选择你想要的操作 创建工程元素
|
33
|
+
? 创建工程元素 新建「应用入口」
|
34
|
+
? 请填写入口名称 entry
|
35
|
+
? 是否需要调整默认配置? 否
|
36
|
+
```
|
37
|
+
|
38
|
+
### Enable Features
|
39
|
+
|
40
|
+
In the project, execute the `new` command to enable features as follows:
|
41
|
+
|
42
|
+
```bash
|
43
|
+
$ npx modern new
|
44
|
+
? 请选择你想要的操作 启用可选功能
|
45
|
+
? 启用可选功能 (Use arrow keys)
|
46
|
+
❯ 启用 Tailwind CSS 支持
|
47
|
+
启用 Less 支持
|
48
|
+
启用 Sass 支持
|
49
|
+
启用「BFF」功能
|
50
|
+
启用「微前端」模式
|
51
|
+
启用「单元测试 / 集成测试」功能
|
52
|
+
启用「Visual Testing (Storybook)」模式
|
53
|
+
```
|
54
|
+
|
55
|
+
:::caution
|
56
|
+
The `--config` parameter needs to use a JSON string.
|
57
|
+
|
58
|
+
pnpm does not support the use of JSON strings as parameter values currently. Use `npm new` to turn on.【[Relate Issue](https://github.com/pnpm/pnpm/issues/3876)】
|
59
|
+
:::
|
@@ -0,0 +1,32 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 6
|
3
|
+
---
|
4
|
+
|
5
|
+
```bash
|
6
|
+
Usage: modern start [options]
|
7
|
+
|
8
|
+
start server
|
9
|
+
|
10
|
+
Options:
|
11
|
+
-c --config <config> configuration file path, which can be a relative path or an absolute path
|
12
|
+
-h, --help show command help
|
13
|
+
--api-only only start API service
|
14
|
+
```
|
15
|
+
|
16
|
+
Usually use the `modern start` command to enable project start in the production environment, and you need to execute the [`build'](/docs/apis/app/commands/build) command in advance to build the product.
|
17
|
+
|
18
|
+
By default, the project will start in `localhost:8080`, you can modify the Server port number with `server.port`:
|
19
|
+
|
20
|
+
```js
|
21
|
+
export default defineConfig({
|
22
|
+
server: {
|
23
|
+
port: 8081,
|
24
|
+
}
|
25
|
+
})
|
26
|
+
```
|
27
|
+
|
28
|
+
import CommandTip from '@site-docs/components/command-tip.md'
|
29
|
+
|
30
|
+
<CommandTip />
|
31
|
+
|
32
|
+
|
@@ -0,0 +1,36 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 3
|
3
|
+
---
|
4
|
+
|
5
|
+
```bash
|
6
|
+
Usage: modern test [options]
|
7
|
+
|
8
|
+
Options:
|
9
|
+
-h, --help show command help
|
10
|
+
```
|
11
|
+
|
12
|
+
:::caution
|
13
|
+
`modern test` command need to execute the `new` command in advance to enable the `unit test/integration test`.
|
14
|
+
:::
|
15
|
+
|
16
|
+
`modern test` command will automatically run the test cases, the effect is as follows:
|
17
|
+
|
18
|
+
```bash
|
19
|
+
$ npx modern test
|
20
|
+
PASS src/tests/index.test.ts
|
21
|
+
The add method
|
22
|
+
✓ should work fine. (2ms)
|
23
|
+
|
24
|
+
Test Suites: 1 passed, 1 total
|
25
|
+
Tests: 1 passed, 1 total
|
26
|
+
Snapshots: 0 total
|
27
|
+
Time: 0.994 s, estimated 1 s
|
28
|
+
```
|
29
|
+
|
30
|
+
:::info
|
31
|
+
files match `*.test.(js|ts)` in `api/` or `src/` will be recognized as test cases by default。
|
32
|
+
:::
|
33
|
+
|
34
|
+
import CommandTip from '@site-docs/components/command-tip.md'
|
35
|
+
|
36
|
+
<CommandTip />
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
sidebar_position: 8
|
3
|
+
---
|
4
|
+
|
5
|
+
```
|
6
|
+
Usage: modern upgrade [options]
|
7
|
+
|
8
|
+
upgrade Modern.js to latest version.
|
9
|
+
|
10
|
+
Options:
|
11
|
+
--registry <registry> specify npm registry (default: "")
|
12
|
+
-d,--debug using debug mode to log something (default: false)
|
13
|
+
--cwd <cwd> app directory (default: "")
|
14
|
+
-h, --help show command help
|
15
|
+
```
|
16
|
+
|
17
|
+
Execute the command `npx modern upgrade` in the project, by default, dependencies in the `package.json` are updated to the latest version.
|
18
|
+
|
19
|
+
:::info
|
20
|
+
the command is available in `@modern-js/app-tools` version >= 1.17.0, previous versions can be upgraded with `npx @modern-js/upgrade`.
|
21
|
+
:::
|
@@ -0,0 +1,54 @@
|
|
1
|
+
---
|
2
|
+
title: lambda/*.[tj]s
|
3
|
+
sidebar_position: 1
|
4
|
+
---
|
5
|
+
|
6
|
+
Declaring API routing in BFF framework mode. Except [some files](/docs/apis/app/hooks/api/framework/lambda#allow-list),files in `api/` are registered as routes.
|
7
|
+
|
8
|
+
:::info
|
9
|
+
use `api/` need execute new command to enable the 「BFF」 feature.
|
10
|
+
:::
|
11
|
+
|
12
|
+
:::tip
|
13
|
+
this file supports the use `js` or `ts`, but the functions must be exported using the ESM syntax.
|
14
|
+
:::
|
15
|
+
|
16
|
+
## Routing Rule
|
17
|
+
|
18
|
+
### Default Route
|
19
|
+
|
20
|
+
The files named `index` will be upper level routing:
|
21
|
+
|
22
|
+
* `api/lambda/index.ts` -> `$BASENAME/`
|
23
|
+
* `api/lambda/user/index.ts` -> `$BASENAME/user`
|
24
|
+
|
25
|
+
### Multi Level Route
|
26
|
+
|
27
|
+
The routing system also supports parsing multiple levels of files. and if you create a folder, the files will still be automatically parsed in the same way.
|
28
|
+
|
29
|
+
* `api/lambda/hello.ts` -> `$BASENAME/hello`
|
30
|
+
* `api/lambda/user/list.ts` -> `$BASENAME/user/list`
|
31
|
+
|
32
|
+
### Dynamic Route
|
33
|
+
|
34
|
+
Dynamic named routing parameters can be supported by creating folders or files with `[xxx]`.
|
35
|
+
|
36
|
+
* `api/lambda/user/[username]/info.ts` -> `$BASENAME/user/:username/info`
|
37
|
+
* `api/lambda/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
|
38
|
+
* `api/lambda/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
|
39
|
+
|
40
|
+
the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`。
|
41
|
+
|
42
|
+
### Allow List
|
43
|
+
|
44
|
+
By default, all files in the `api/` will be parsed as BFF function. but we also set a allow list, and these files will not be parsed:
|
45
|
+
|
46
|
+
* file name start with `_`, for example: `_utils.ts`.
|
47
|
+
* files in directory that name start with `_`, for example:`_utils/index.ts`、`_utils/cp.ts`.
|
48
|
+
* test files, for example:`foo.test.ts`.
|
49
|
+
* TypeScript define files, for example:`hello.d.ts`.
|
50
|
+
* files in `node_module`.
|
51
|
+
|
52
|
+
## Define Function
|
53
|
+
|
54
|
+
the same as [Define Function](/docs/apis/app/hooks/api/functions/api#define-function).
|
@@ -0,0 +1,78 @@
|
|
1
|
+
---
|
2
|
+
title: "**/*.[tj]s"
|
3
|
+
sidebar_position: 1
|
4
|
+
---
|
5
|
+
|
6
|
+
Declaring API routing in BFF function mode. Except [some files](/docs/apis/app/hooks/api/functions/api#allow-list),files in `api/` are registered as routes.
|
7
|
+
|
8
|
+
:::info
|
9
|
+
use `api/` need execute new command to enable the 「BFF」 feature.
|
10
|
+
:::
|
11
|
+
|
12
|
+
:::tip
|
13
|
+
this file supports the use `js` or `ts`, but the functions must be exported using the ESM syntax.
|
14
|
+
:::
|
15
|
+
|
16
|
+
## Routing Rule
|
17
|
+
|
18
|
+
### Default Route
|
19
|
+
|
20
|
+
The files named `index` will be upper level routing:
|
21
|
+
|
22
|
+
* `api/index.ts` -> `$BASENAME/`
|
23
|
+
* `api/user/index.ts` -> `$BASENAME/user`
|
24
|
+
|
25
|
+
### Multi Level Route
|
26
|
+
|
27
|
+
The routing system also supports parsing multiple levels of files. and if you create a folder, the files will still be automatically parsed in the same way.
|
28
|
+
|
29
|
+
* `api/hello.ts` -> `$BASENAME/hello`
|
30
|
+
* `api/user/list.ts` -> `$BASENAME/user/list`
|
31
|
+
|
32
|
+
### Dynamic Route
|
33
|
+
|
34
|
+
Dynamic named routing parameters can be supported by creating folders or files with `[xxx]`.
|
35
|
+
|
36
|
+
* `api/user/[username]/info.ts` -> `$BASENAME/user/:username/info`
|
37
|
+
* `api/user/[username]/delete.ts` -> `$BASENAME/user/:username/delete`
|
38
|
+
* `api/article/[id]/info.ts` -> `$BASENAME/article/:id/info`
|
39
|
+
|
40
|
+
the `$BASENAME` can be configured in `modern.config.js`,the default value is `/api`。
|
41
|
+
|
42
|
+
### Allow List
|
43
|
+
|
44
|
+
By default, all files in the `api/` will be parsed as BFF function. but we also set a allow list, and these files will not be parsed:
|
45
|
+
|
46
|
+
* file name start with `_`, for example: `_utils.ts`.
|
47
|
+
* files in directory that name start with `_`, for example:`_utils/index.ts`、`_utils/cp.ts`.
|
48
|
+
* test files, for example:`foo.test.ts`.
|
49
|
+
* TypeScript define files, for example:`hello.d.ts`.
|
50
|
+
* files in `node_module`.
|
51
|
+
|
52
|
+
## Define Function
|
53
|
+
|
54
|
+
In addition to the above routing rules, the function definition and export in the code also have conventions.
|
55
|
+
|
56
|
+
function need named exports,and the name of the exported function is the HTTP Method:
|
57
|
+
|
58
|
+
```ts
|
59
|
+
export const get = async () => {
|
60
|
+
return {
|
61
|
+
name: 'Modern.js',
|
62
|
+
desc: 'Modern web Solutions',
|
63
|
+
};
|
64
|
+
};
|
65
|
+
```
|
66
|
+
|
67
|
+
Export the function like above will generate a `POST` interface.
|
68
|
+
|
69
|
+
App support 9 Method definitions: `GET`、`POST`、`PUT`、`DELETE`、`CONNECT`、`TRACE`、`PATCH`、`OPTION`、`HEAD`. so App can use these name as function export nane.
|
70
|
+
|
71
|
+
The name is insensitive, whaterver `get`、`Get`、`GEt`、`GET`, can be accurately identified. And default export, `export default xxx` will be `Get` method.
|
72
|
+
|
73
|
+
because `delete` is a keyword in JavaScript, use `del` or `DELETE` instead.
|
74
|
+
|
75
|
+
Multiple functions of different Methods can be defined in one file, but if multiple functions of the same Method are defined, only the first can work.
|
76
|
+
|
77
|
+
:::info
|
78
|
+
It should be noted that the defined functions should be asynchronous, which is related to the type when the function is called.
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
title: test.[tj]s
|
3
|
+
sidebar_position: 2
|
4
|
+
---
|
5
|
+
|
6
|
+
App's BFF test file,support for writing test cases in the `api/` directory which file with suffix `.test.[tj]s`.
|
7
|
+
|
8
|
+
:::info
|
9
|
+
To use unit test and integration test, you need to execute the `new` command in advance to enable the `unit test/integration test`.
|
10
|
+
:::
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
title: icon.png
|
3
|
+
sidebar_position: 2
|
4
|
+
---
|
5
|
+
|
6
|
+
When `config/icon.png` exist, it can inject app icon information into the html page at build time:
|
7
|
+
|
8
|
+
```
|
9
|
+
.config
|
10
|
+
└── icon.png
|
11
|
+
```
|
12
|
+
|
13
|
+
the app icon `link` meta will be injected into the html, as follows:
|
14
|
+
|
15
|
+

|
@@ -0,0 +1,28 @@
|
|
1
|
+
---
|
2
|
+
title: public/
|
3
|
+
sidebar_position: 3
|
4
|
+
---
|
5
|
+
|
6
|
+
Static resource files in any format can be placed in the `public/`, and the files will be Served under the web application domain name.
|
7
|
+
|
8
|
+
## Description
|
9
|
+
|
10
|
+
The routing of files to be served is based on the convention of the file system. `public/` is the root directory, which corresponds to the root path of the Web application.
|
11
|
+
|
12
|
+
For example, the `config/public/sdk/index.js` file will be Served under `${domain}/sdk/index.js` after deployment.
|
13
|
+
|
14
|
+
## Scene
|
15
|
+
|
16
|
+
For example, `robots.txt`, `auth.xml` and other authentication file.
|
17
|
+
|
18
|
+
SDK (requiring the same routing) for other business, or an HTML file for static host.
|
19
|
+
|
20
|
+
:::info
|
21
|
+
For static resources (such as SVG pictures) that need to be referenced by import in the source code, it is recommended to put them in the `src/assets/` for management.
|
22
|
+
:::
|
23
|
+
|
24
|
+
## Compression
|
25
|
+
|
26
|
+
If the file is a `.js` file, it will be automatically compressed when the production environment is built.
|
27
|
+
|
28
|
+
If the file ends with `.min.js`, it will not compression.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
title: storybook/
|
3
|
+
sidebar_position: 7
|
4
|
+
---
|
5
|
+
|
6
|
+
Modern.js.js supports debugging with Storybook. When you need to configure Storybook, configure it in the `config/storybook/`.
|
7
|
+
|
8
|
+
For detail, see [Storybook](https://storybook.js.org/docs/react/configure/overview).
|
9
|
+
|
10
|
+
:::info
|
11
|
+
Debugging with Storybook requires executing the `new` command to enable the 「Visual Testing (Storybook)」 mode feature.
|
12
|
+
:::
|
@@ -0,0 +1,42 @@
|
|
1
|
+
---
|
2
|
+
title: upload/
|
3
|
+
sidebar_position: 4
|
4
|
+
---
|
5
|
+
|
6
|
+
Static resource files in any format can be placed in the `upload/`.
|
7
|
+
|
8
|
+
## Description
|
9
|
+
|
10
|
+
In the development environment, the static resource files in this directory will be hosted in the '/upload' path. After building the application product, the files in this directory will be copied to the dist path.
|
11
|
+
|
12
|
+
This file convention is mainly used for developers to use plugins to upload static resource files to the CDN.
|
13
|
+
|
14
|
+
## Scene
|
15
|
+
|
16
|
+
For example, the SDK used by the project such as `google-analysis.js` (usually requires http caching).
|
17
|
+
|
18
|
+
Images, font files, generic CSS, etc.
|
19
|
+
|
20
|
+
## Compression
|
21
|
+
|
22
|
+
If the file is a `.js` file, it will be automatically compressed when the production environment is built.
|
23
|
+
|
24
|
+
If the file ends with `.min.js`, it will not compression.
|
25
|
+
|
26
|
+
## More Usage
|
27
|
+
|
28
|
+
Whether in [custom HTML](/docs/guides/basic-features/html), or in any HTML file under ['config/public/'](/docs/apis/app/hooks/config/public), you can directly use the HTML tag to refer to the resources in the `config/upload/`:
|
29
|
+
|
30
|
+
```html
|
31
|
+
<script src="/upload/index.js"></script>
|
32
|
+
```
|
33
|
+
|
34
|
+
if [`output.assetPrefix`](/docs/configure/app/output/asset-prefix) is configured,add this prefix directly using template syntax:
|
35
|
+
|
36
|
+
```html
|
37
|
+
<script src="<%=assetPrefix %>/upload/index.js"></script>
|
38
|
+
```
|
39
|
+
|
40
|
+
:::info
|
41
|
+
Modern.js does not support the use files under `upload/` in `config/public/*.css` via URL.
|
42
|
+
:::
|