@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.99 → 3.8.1-ultramodern.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/modern-bundle-docs.js +7 -0
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +73 -11
- package/dist/cjs/bundleDocs.js +114 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +1 -1
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +94 -18
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
- package/dist/cjs/ultramodern-release-envelope/framework-output.js +109 -57
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +63 -10
- package/dist/esm/bundleDocs.mjs +62 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
- package/dist/esm/ultramodern-release-envelope/framework-output.mjs +107 -58
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +63 -10
- package/dist/esm-node/bundleDocs.mjs +63 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +93 -18
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +1 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +14 -0
- package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +107 -58
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +29 -0
- package/dist/types/bundleDocs.d.ts +20 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +13 -0
- package/dist/types/ultramodern-release-envelope/framework-output.d.ts +1 -0
- package/docs/apis/app/{commands.mdx → commands.md} +35 -9
- package/docs/apis/app/hooks/api/{lambda.mdx → lambda.md} +2 -6
- package/docs/apis/app/hooks/config/{favicon.mdx → favicon.md} +1 -6
- package/docs/apis/app/hooks/config/{html.mdx → html.md} +1 -5
- package/docs/apis/app/hooks/config/{icon.mdx → icon.md} +1 -6
- package/docs/apis/app/hooks/config/{mock.mdx → mock.md} +1 -5
- package/docs/apis/app/hooks/config/{public.mdx → public.md} +0 -4
- package/docs/apis/app/hooks/config/{upload.mdx → upload.md} +3 -7
- package/docs/apis/app/hooks/{modern-config.mdx → modern-config.md} +1 -5
- package/docs/apis/app/hooks/server/{server.mdx → server.md} +1 -6
- package/docs/apis/app/hooks/{shared.mdx → shared.md} +0 -4
- package/docs/apis/app/hooks/src/{app.mdx → app.md} +2 -2
- package/docs/apis/app/hooks/src/{entry.mdx → entry.md} +1 -6
- package/docs/apis/app/hooks/src/{entry.server.mdx → entry.server.md} +0 -5
- package/docs/apis/app/hooks/src/{modern.runtime.mdx → modern.runtime.md} +1 -5
- package/docs/apis/app/hooks/src/{routes.mdx → routes.md} +3 -7
- package/docs/apis/app/hooks/src/{server.mdx → server.md} +1 -5
- package/docs/apis/app/runtime/bff/{use-backend-context.mdx → use-backend-context.md} +0 -3
- package/docs/apis/app/runtime/core/{create-root.mdx → create-root.md} +0 -3
- package/docs/apis/app/runtime/core/{render.mdx → render.md} +1 -4
- package/docs/apis/app/runtime/core/{runtime-context.mdx → runtime-context.md} +0 -4
- package/docs/apis/app/runtime/router/{router.mdx → router.md} +1 -6
- package/docs/apis/app/runtime/ssr/{no-ssr.mdx → no-ssr.md} +0 -3
- package/docs/apis/app/runtime/ssr/{renderStreaming.mdx → renderStreaming.md} +0 -4
- package/docs/apis/app/runtime/ssr/{renderString.mdx → renderString.md} +0 -4
- package/docs/apis/app/runtime/ssr/{requestHandler.mdx → requestHandler.md} +0 -4
- package/docs/apis/app/runtime/utility/{css-in-js.mdx → css-in-js.md} +0 -4
- package/docs/apis/app/runtime/utility/{head.mdx → head.md} +0 -3
- package/docs/apis/app/runtime/utility/{loadable.mdx → loadable.md} +0 -3
- package/docs/community/blog/2022-0708-updates.md +91 -0
- package/docs/community/blog/2022-0910-updates.md +76 -0
- package/docs/community/blog/overview.md +63 -0
- package/docs/community/blog/v2-release-note.md +238 -0
- package/docs/community/blog/v3-release-note.md +622 -0
- package/docs/community/contributing-guide.md +252 -0
- package/docs/community/releases.md +23 -0
- package/docs/community/showcase.md +24 -0
- package/docs/community/team.md +14 -0
- package/docs/configure/app/bff/{cross-project.mdx → cross-project.md} +4 -8
- package/docs/configure/app/bff/{effect.mdx → effect.md} +16 -22
- package/docs/configure/app/bff/{prefix.mdx → prefix.md} +3 -7
- package/docs/configure/app/bff/{runtime-framework.mdx → runtime-framework.md} +3 -7
- package/docs/configure/app/{builder-plugins.mdx → builder-plugins.md} +4 -8
- package/docs/configure/app/dev/{asset-prefix.mdx → asset-prefix.md} +4 -9
- package/docs/configure/app/dev/{before-start-url.mdx → before-start-url.md} +0 -4
- package/docs/configure/app/dev/{client.mdx → client.md} +3 -7
- package/docs/configure/app/dev/hmr.md +10 -0
- package/docs/configure/app/dev/{host.mdx → host.md} +0 -4
- package/docs/configure/app/dev/{https.mdx → https.md} +0 -4
- package/docs/configure/app/dev/{lazy-compilation.mdx → lazy-compilation.md} +2 -8
- package/docs/configure/app/dev/live-reload.md +10 -0
- package/docs/configure/app/dev/{mock-dir.mdx → mock-dir.md} +0 -4
- package/docs/configure/app/dev/progress-bar.md +19 -0
- package/docs/configure/app/dev/{server.mdx → server.md} +0 -4
- package/docs/configure/app/dev/{setup-middlewares.mdx → setup-middlewares.md} +3 -7
- package/docs/configure/app/dev/{start-url.mdx → start-url.md} +0 -5
- package/docs/configure/app/dev/{watch-files.mdx → watch-files.md} +3 -7
- package/docs/configure/app/dev/{write-to-disk.mdx → write-to-disk.md} +3 -7
- package/docs/configure/app/experiments/{source-build.mdx → source-build.md} +1 -3
- package/docs/configure/app/html/{app-icon.mdx → app-icon.md} +3 -7
- package/docs/configure/app/html/{crossorigin.mdx → crossorigin.md} +3 -7
- package/docs/configure/app/html/{favicon.mdx → favicon.md} +3 -7
- package/docs/configure/app/html/inject.md +10 -0
- package/docs/configure/app/html/{meta.mdx → meta.md} +3 -7
- package/docs/configure/app/html/{mount-id.mdx → mount-id.md} +3 -7
- package/docs/configure/app/html/output-structure.md +10 -0
- package/docs/configure/app/html/script-loading.md +10 -0
- package/docs/configure/app/html/{tags.mdx → tags.md} +3 -7
- package/docs/configure/app/html/{template-parameters.mdx → template-parameters.md} +3 -7
- package/docs/configure/app/html/template.md +10 -0
- package/docs/configure/app/html/title.md +18 -0
- package/docs/configure/app/output/asset-prefix.md +11 -0
- package/docs/configure/app/output/{assets-retry.mdx → assets-retry.md} +1 -5
- package/docs/configure/app/output/{charset.mdx → charset.md} +3 -7
- package/docs/configure/app/output/{clean-dist-path.mdx → clean-dist-path.md} +0 -4
- package/docs/configure/app/output/{convert-to-rem.mdx → convert-to-rem.md} +12 -16
- package/docs/configure/app/output/{copy.mdx → copy.md} +3 -7
- package/docs/configure/app/output/{css-modules.mdx → css-modules.md} +3 -7
- package/docs/configure/app/output/{data-uri-limit.mdx → data-uri-limit.md} +3 -7
- package/docs/configure/app/output/{disable-css-module-extension.mdx → disable-css-module-extension.md} +3 -7
- package/docs/configure/app/output/{disable-inline-runtime-chunk.mdx → disable-inline-runtime-chunk.md} +0 -4
- package/docs/configure/app/output/{disable-svgr.mdx → disable-svgr.md} +0 -4
- package/docs/configure/app/output/{disable-ts-checker.mdx → disable-ts-checker.md} +0 -4
- package/docs/configure/app/output/{dist-path.mdx → dist-path.md} +3 -11
- package/docs/configure/app/output/{enable-asset-manifest.mdx → enable-asset-manifest.md} +0 -4
- package/docs/configure/app/output/{enable-css-module-tsdeclaration.mdx → enable-css-module-tsdeclaration.md} +0 -4
- package/docs/configure/app/output/{enable-inline-route-manifests.mdx → enable-inline-route-manifests.md} +0 -4
- package/docs/configure/app/output/{externals.mdx → externals.md} +3 -7
- package/docs/configure/app/output/filename-hash.md +10 -0
- package/docs/configure/app/output/{filename.mdx → filename.md} +3 -7
- package/docs/configure/app/output/inject-styles.md +10 -0
- package/docs/configure/app/output/{inline-scripts.mdx → inline-scripts.md} +4 -8
- package/docs/configure/app/output/{inline-styles.mdx → inline-styles.md} +4 -8
- package/docs/configure/app/output/{legal-comments.mdx → legal-comments.md} +3 -7
- package/docs/configure/app/output/{minify.mdx → minify.md} +3 -7
- package/docs/configure/app/output/{override-browserslist.mdx → override-browserslist.md} +4 -8
- package/docs/configure/app/output/polyfill.md +12 -0
- package/docs/configure/app/output/{source-map.mdx → source-map.md} +3 -7
- package/docs/configure/app/output/{split-route-chunks.mdx → split-route-chunks.md} +0 -4
- package/docs/configure/app/output/{ssg.mdx → ssg.md} +3 -7
- package/docs/configure/app/output/{ssgByEntries.mdx → ssgByEntries.md} +1 -4
- package/docs/configure/app/output/{svg-default-export.mdx → svg-default-export.md} +0 -4
- package/docs/configure/app/output/{temp-dir.mdx → temp-dir.md} +0 -4
- package/docs/configure/app/performance/{build-cache.mdx → build-cache.md} +3 -7
- package/docs/configure/app/performance/{chunk-split.mdx → chunk-split.md} +3 -7
- package/docs/configure/app/performance/{dns-prefetch.mdx → dns-prefetch.md} +3 -7
- package/docs/configure/app/performance/preconnect.md +16 -0
- package/docs/configure/app/performance/{prefetch.mdx → prefetch.md} +3 -7
- package/docs/configure/app/performance/{preload.mdx → preload.md} +3 -7
- package/docs/configure/app/performance/{print-file-size.mdx → print-file-size.md} +3 -7
- package/docs/configure/app/performance/profile.md +10 -0
- package/docs/configure/app/performance/remove-console.md +10 -0
- package/docs/configure/app/performance/remove-moment-locale.md +10 -0
- package/docs/configure/app/performance/{rsdoctor.mdx → rsdoctor.md} +0 -4
- package/docs/configure/app/{plugins.mdx → plugins.md} +4 -4
- package/docs/configure/app/resolve/{alias-strategy.mdx → alias-strategy.md} +3 -7
- package/docs/configure/app/resolve/alias.md +9 -0
- package/docs/configure/app/resolve/{condition-names.mdx → condition-names.md} +3 -8
- package/docs/configure/app/resolve/{dedupe.mdx → dedupe.md} +3 -7
- package/docs/configure/app/resolve/{extensions.mdx → extensions.md} +3 -8
- package/docs/configure/app/runtime/{0-intro.mdx → 0-intro.md} +1 -4
- package/docs/configure/app/runtime/{plugins.mdx → plugins.md} +1 -1
- package/docs/configure/app/runtime/{router.mdx → router.md} +3 -7
- package/docs/configure/app/security/{check-syntax.mdx → check-syntax.md} +0 -4
- package/docs/configure/app/security/{nonce.mdx → nonce.md} +3 -7
- package/docs/configure/app/security/{sri.mdx → sri.md} +0 -4
- package/docs/configure/app/server/{base-url.mdx → base-url.md} +0 -4
- package/docs/configure/app/server/{port.mdx → port.md} +3 -7
- package/docs/configure/app/server/{public-routes.mdx → public-routes.md} +0 -4
- package/docs/configure/app/server/{routes.mdx → routes.md} +1 -5
- package/docs/configure/app/server/rsc.md +22 -0
- package/docs/configure/app/server/{ssr-by-entries.mdx → ssr-by-entries.md} +1 -5
- package/docs/configure/app/server/ssr.md +80 -0
- package/docs/configure/app/server/{tsconfig-path.mdx → tsconfig-path.md} +0 -4
- package/docs/configure/app/source/{alias-strategy.mdx → alias-strategy.md} +4 -8
- package/docs/configure/app/source/{alias.mdx → alias.md} +4 -8
- package/docs/configure/app/source/{config-dir.mdx → config-dir.md} +1 -5
- package/docs/configure/app/source/{decorators.mdx → decorators.md} +0 -4
- package/docs/configure/app/source/{define.mdx → define.md} +3 -7
- package/docs/configure/app/source/{disable-default-entries.mdx → disable-default-entries.md} +2 -6
- package/docs/{components/module-federation.mdx → configure/app/source/enable-async-entry.md} +47 -0
- package/docs/configure/app/source/{enable-async-pre-entry.mdx → enable-async-pre-entry.md} +0 -4
- package/docs/configure/app/source/{entries-dir.mdx → entries-dir.md} +0 -4
- package/docs/configure/app/source/{entries.mdx → entries.md} +1 -5
- package/docs/configure/app/source/{exclude.mdx → exclude.md} +4 -8
- package/docs/configure/app/source/{global-vars.mdx → global-vars.md} +0 -4
- package/docs/configure/app/source/{include.mdx → include.md} +4 -8
- package/docs/configure/app/source/{main-entry-name.mdx → main-entry-name.md} +0 -4
- package/docs/configure/app/source/{pre-entry.mdx → pre-entry.md} +3 -7
- package/docs/configure/app/source/{react-compiler.mdx → react-compiler.md} +0 -4
- package/docs/configure/app/source/{transform-import.mdx → transform-import.md} +3 -7
- package/docs/configure/app/{split-chunks.mdx → split-chunks.md} +3 -3
- package/docs/configure/app/tools/{autoprefixer.mdx → autoprefixer.md} +0 -4
- package/docs/configure/app/tools/{bundler-chain.mdx → bundler-chain.md} +0 -4
- package/docs/configure/app/tools/{css-extract.mdx → css-extract.md} +3 -7
- package/docs/configure/app/tools/{css-loader.mdx → css-loader.md} +3 -7
- package/docs/configure/app/tools/{dev-server.mdx → dev-server.md} +0 -4
- package/docs/configure/app/tools/{html-plugin.mdx → html-plugin.md} +3 -7
- package/docs/configure/app/tools/{less.mdx → less.md} +0 -4
- package/docs/configure/app/tools/{lightningcss-loader.mdx → lightningcss-loader.md} +3 -7
- package/docs/configure/app/tools/{minify-css.mdx → minify-css.md} +0 -4
- package/docs/configure/app/tools/{postcss.mdx → postcss.md} +3 -7
- package/docs/configure/app/tools/rspack.md +10 -0
- package/docs/configure/app/tools/{sass.mdx → sass.md} +0 -4
- package/docs/configure/app/tools/style-loader.md +10 -0
- package/docs/configure/app/tools/{swc.mdx → swc.md} +4 -8
- package/docs/configure/app/tools/{ts-checker.mdx → ts-checker.md} +20 -7
- package/docs/configure/app/{usage.mdx → usage.md} +1 -1
- package/docs/guides/advanced-features/bff/{cross-project.mdx → cross-project.md} +1 -2
- package/docs/guides/advanced-features/bff/{data-platform.mdx → data-platform.md} +0 -4
- package/docs/guides/advanced-features/bff/{extend-server.mdx → extend-server.md} +1 -1
- package/docs/guides/advanced-features/bff/frameworks.md +243 -0
- package/docs/guides/advanced-features/bff/{function.mdx → function.md} +60 -7
- package/docs/guides/advanced-features/bff/{operators.mdx → operators.md} +2 -77
- package/docs/{components/bff-upload.mdx → guides/advanced-features/bff/upload.md} +4 -0
- package/docs/guides/advanced-features/{bff.mdx → bff.md} +0 -4
- package/docs/guides/advanced-features/{build-performance.mdx → build-performance.md} +3 -7
- package/docs/guides/advanced-features/{compatibility.mdx → compatibility.md} +54 -15
- package/docs/guides/advanced-features/international/{advanced.mdx → advanced.md} +0 -4
- package/docs/guides/advanced-features/international/{api.mdx → api.md} +16 -20
- package/docs/guides/advanced-features/international/{best-practices.mdx → best-practices.md} +0 -4
- package/docs/guides/advanced-features/international/configuration.md +228 -0
- package/docs/guides/advanced-features/international/{locale-detection.mdx → locale-detection.md} +25 -29
- package/docs/guides/advanced-features/international/{quick-start.mdx → quick-start.md} +29 -13
- package/docs/guides/advanced-features/international/{resource-loading.mdx → resource-loading.md} +11 -15
- package/docs/guides/advanced-features/international/{routing.mdx → routing.md} +12 -16
- package/docs/guides/advanced-features/international.md +27 -0
- package/docs/guides/advanced-features/{low-level.mdx → low-level.md} +17 -21
- package/docs/guides/advanced-features/page-performance/{code-split.mdx → code-split.md} +2 -6
- package/docs/guides/advanced-features/page-performance/{inline-assets.mdx → inline-assets.md} +3 -7
- package/docs/guides/advanced-features/page-performance/{optimize-bundle.mdx → optimize-bundle.md} +4 -8
- package/docs/{components/internal-logger.mdx → guides/advanced-features/server-monitor/logger.md} +16 -0
- package/docs/guides/advanced-features/server-monitor/metrics.md +58 -0
- package/docs/guides/advanced-features/server-monitor/{monitors.mdx → monitors.md} +3 -3
- package/docs/guides/advanced-features/{source-build.mdx → source-build.md} +1 -5
- package/docs/guides/advanced-features/{web-server.mdx → web-server.md} +1 -9
- package/docs/guides/basic-features/{alias.mdx → alias.md} +3 -7
- package/docs/guides/basic-features/css/{css-in-js.mdx → css-in-js.md} +12 -9
- package/docs/guides/basic-features/css/{css-modules.mdx → css-modules.md} +3 -3
- package/docs/guides/basic-features/css/{css.mdx → css.md} +2 -6
- package/docs/guides/basic-features/data/{data-cache.mdx → data-cache.md} +1 -6
- package/docs/guides/basic-features/data/{data-fetch.mdx → data-fetch.md} +4 -8
- package/docs/guides/basic-features/data/{data-write.mdx → data-write.md} +6 -9
- package/docs/guides/basic-features/debug/{mock.mdx → mock.md} +1 -5
- package/docs/guides/basic-features/debug/{proxy.mdx → proxy.md} +1 -5
- package/docs/guides/basic-features/debug/{using-storybook.mdx → using-storybook.md} +20 -8
- package/docs/guides/basic-features/{deploy.mdx → deploy.md} +23 -13
- package/docs/guides/basic-features/{env-vars.mdx → env-vars.md} +8 -12
- package/docs/guides/basic-features/{html.mdx → html.md} +3 -7
- package/docs/guides/basic-features/{output-files.mdx → output-files.md} +6 -10
- package/docs/guides/basic-features/render/{before-render.mdx → before-render.md} +1 -1
- package/docs/guides/basic-features/render/overview.md +47 -0
- package/docs/guides/basic-features/render/{rsc.mdx → rsc.md} +16 -33
- package/docs/guides/basic-features/render/{ssg.mdx → ssg.md} +71 -10
- package/docs/guides/basic-features/render/{ssr-cache.mdx → ssr-cache.md} +5 -5
- package/docs/guides/basic-features/render/{ssr.mdx → ssr.md} +10 -12
- package/docs/guides/basic-features/render/{streaming-ssr.mdx → streaming-ssr.md} +5 -8
- package/docs/guides/basic-features/routes/{config-routes.mdx → config-routes.md} +10 -11
- package/docs/guides/basic-features/routes/{routes.mdx → routes.md} +8 -16
- package/docs/guides/basic-features/static-assets/{json-files.mdx → json-files.md} +0 -4
- package/docs/guides/basic-features/static-assets/{svg-assets.mdx → svg-assets.md} +3 -7
- package/docs/guides/basic-features/static-assets/{wasm-assets.mdx → wasm-assets.md} +1 -5
- package/docs/guides/basic-features/{static-assets.mdx → static-assets.md} +10 -14
- package/docs/guides/basic-features/testing/{playwright.mdx → playwright.md} +12 -3
- package/docs/guides/basic-features/testing/{rstest.mdx → rstest.md} +70 -11
- package/docs/guides/concept/{builder.mdx → builder.md} +3 -26
- package/docs/guides/concept/{entries.mdx → entries.md} +11 -17
- package/docs/guides/concept/{server.mdx → server.md} +3 -3
- package/docs/guides/get-started/{ai-coding-agents.mdx → ai-coding-agents.md} +4 -9
- package/docs/guides/get-started/glossary.md +63 -0
- package/docs/guides/get-started/{introduction.mdx → introduction.md} +1 -6
- package/docs/guides/get-started/quick-start.md +269 -0
- package/docs/guides/get-started/{tech-stack.mdx → tech-stack.md} +9 -15
- package/docs/guides/get-started/{ultramodern.mdx → ultramodern.md} +38 -31
- package/docs/guides/get-started/{upgrade.mdx → upgrade.md} +26 -22
- package/docs/guides/topic-detail/module-federation/{application.mdx → application.md} +3 -3
- package/docs/guides/topic-detail/module-federation/{deploy.mdx → deploy.md} +2 -2
- package/docs/guides/topic-detail/module-federation/{i18n.mdx → i18n.md} +14 -14
- package/docs/guides/topic-detail/module-federation/{introduce.mdx → introduce.md} +2 -3
- package/docs/guides/topic-detail/module-federation/{ssr.mdx → ssr.md} +12 -7
- package/docs/guides/topic-detail/module-federation/{usage.mdx → usage.md} +20 -3
- package/docs/guides/troubleshooting/{builder.mdx → builder.md} +10 -14
- package/docs/guides/troubleshooting/{cli.mdx → cli.md} +0 -4
- package/docs/guides/troubleshooting/{dependencies.mdx → dependencies.md} +7 -11
- package/docs/guides/troubleshooting/{hmr.mdx → hmr.md} +5 -9
- package/docs/guides/upgrade/{config.mdx → config.md} +8 -5
- package/docs/guides/upgrade/{entry.mdx → entry.md} +6 -6
- package/docs/guides/upgrade/{other.mdx → other.md} +8 -8
- package/docs/guides/upgrade/{overview.mdx → overview.md} +4 -4
- package/docs/guides/upgrade/{tailwindcss.mdx → tailwindcss.md} +0 -1
- package/docs/guides/upgrade/web-server.md +11 -11
- package/docs/index.md +33 -4
- package/docs/llms.txt +290 -0
- package/docs/plugin/cli-plugins/api.md +573 -0
- package/docs/plugin/cli-plugins/life-cycle.md +2 -0
- package/docs/plugin/introduction.md +152 -0
- package/docs/plugin/official/cli-plugins/plugin-bff.md +5 -0
- package/docs/plugin/official/cli-plugins/plugin-ssg.md +5 -0
- package/docs/plugin/official/cli-plugins/plugin-styled-components.md +5 -0
- package/docs/plugin/official/cli-plugins.md +4 -0
- package/docs/plugin/plugin-system.md +238 -0
- package/docs/plugin/runtime-plugins/api.md +194 -0
- package/docs/plugin/runtime-plugins/life-cycle.md +2 -0
- package/docs/plugin/server-plugins/api.md +209 -0
- package/docs/plugin/server-plugins/life-cycle.md +13 -0
- package/docs/tutorials/examples/csr-auth.md +9 -0
- package/docs/tutorials/foundations/introduction.md +16 -0
- package/package.json +33 -15
- package/docs/_nav.json +0 -36
- package/docs/apis/_meta.json +0 -13
- package/docs/apis/app/hooks/_meta.json +0 -28
- package/docs/apis/app/hooks/config/_meta.json +0 -1
- package/docs/apis/app/runtime/_meta.json +0 -32
- package/docs/components/auto-upgrade.mdx +0 -0
- package/docs/components/build-output.mdx +0 -45
- package/docs/components/bundler.mdx +0 -3
- package/docs/components/convention-routing-motivation.mdx +0 -0
- package/docs/components/debug-app.mdx +0 -15
- package/docs/components/default-browserslist.mdx +0 -7
- package/docs/components/deploy-command.mdx +0 -14
- package/docs/components/deploy.mdx +0 -1
- package/docs/components/enable-bff-caution.mdx +0 -3
- package/docs/components/enable-bff.mdx +0 -56
- package/docs/components/enable-ssg.mdx +0 -49
- package/docs/components/entry-mode.mdx +0 -0
- package/docs/components/entry-scan-logic.mdx +0 -7
- package/docs/components/extend-bff-function.mdx +0 -3
- package/docs/components/hono.mdx +0 -120
- package/docs/components/init-app.mdx +0 -93
- package/docs/components/init-rspack-app.mdx +0 -5
- package/docs/components/internal-metrics.mdx +0 -20
- package/docs/components/international/custom-instance-code.mdx +0 -16
- package/docs/components/international/init-options-desc.mdx +0 -1
- package/docs/components/international/install-command.mdx +0 -10
- package/docs/components/international/instance-code.mdx +0 -16
- package/docs/components/international/introduce.mdx +0 -5
- package/docs/components/international/platform-support.mdx +0 -0
- package/docs/components/language-config.mdx +0 -9
- package/docs/components/micro-frontend.mdx +0 -6
- package/docs/components/micro-master-manifest-config.mdx +0 -15
- package/docs/components/micro-runtime-config.mdx +0 -17
- package/docs/components/new-entry-tooltip.mdx +0 -0
- package/docs/components/nodeVersion.mdx +0 -28
- package/docs/components/other-plugins.mdx +0 -0
- package/docs/components/output-asset-prefix-extend.mdx +0 -0
- package/docs/components/output-distpath-warning.mdx +0 -0
- package/docs/components/output-polyfill-extend.mdx +0 -1
- package/docs/components/prerequisites.mdx +0 -18
- package/docs/components/release-note.mdx +0 -1
- package/docs/components/routes-practice.mdx +0 -0
- package/docs/components/rsbuild-config-tooltip.mdx +0 -5
- package/docs/components/rsbuild.mdx +0 -3
- package/docs/components/rsc-deploy-tip.mdx +0 -1
- package/docs/components/rspack.mdx +0 -3
- package/docs/components/rspackTip.mdx +0 -7
- package/docs/components/runtime-cli-config.mdx +0 -0
- package/docs/components/serve-command.mdx +0 -22
- package/docs/components/ssr-monitor.mdx +0 -3
- package/docs/components/stream-ssr-performance.mdx +0 -0
- package/docs/components/swc.mdx +0 -3
- package/docs/components/tech-stack-node-framework.mdx +0 -1
- package/docs/components/turtorials-example-list.mdx +0 -2
- package/docs/components/ua-polyfill.mdx +0 -44
- package/docs/components/upgrade-browserslist.mdx +0 -0
- package/docs/components/upgrade-config-deploy.mdx +0 -0
- package/docs/components/upgrade-faq.mdx +0 -0
- package/docs/configure/_meta.json +0 -78
- package/docs/configure/app/dev/hmr.mdx +0 -14
- package/docs/configure/app/dev/live-reload.mdx +0 -14
- package/docs/configure/app/dev/progress-bar.mdx +0 -23
- package/docs/configure/app/html/inject.mdx +0 -14
- package/docs/configure/app/html/output-structure.mdx +0 -14
- package/docs/configure/app/html/script-loading.mdx +0 -14
- package/docs/configure/app/html/template.mdx +0 -14
- package/docs/configure/app/html/title.mdx +0 -22
- package/docs/configure/app/output/asset-prefix.mdx +0 -18
- package/docs/configure/app/output/filename-hash.mdx +0 -14
- package/docs/configure/app/output/inject-styles.mdx +0 -14
- package/docs/configure/app/output/polyfill.mdx +0 -18
- package/docs/configure/app/performance/preconnect.mdx +0 -20
- package/docs/configure/app/performance/profile.mdx +0 -14
- package/docs/configure/app/performance/remove-console.mdx +0 -14
- package/docs/configure/app/performance/remove-moment-locale.mdx +0 -14
- package/docs/configure/app/resolve/alias.mdx +0 -13
- package/docs/configure/app/server/rsc.mdx +0 -30
- package/docs/configure/app/server/ssr.mdx +0 -85
- package/docs/configure/app/source/enable-async-entry.mdx +0 -54
- package/docs/configure/app/tools/rspack.mdx +0 -14
- package/docs/configure/app/tools/style-loader.mdx +0 -14
- package/docs/guides/_meta.json +0 -37
- package/docs/guides/advanced-features/_meta.json +0 -32
- package/docs/guides/advanced-features/bff/_meta.json +0 -10
- package/docs/guides/advanced-features/bff/frameworks.mdx +0 -131
- package/docs/guides/advanced-features/bff/upload.mdx +0 -7
- package/docs/guides/advanced-features/international/_meta.json +0 -10
- package/docs/guides/advanced-features/international/configuration.mdx +0 -222
- package/docs/guides/advanced-features/international.mdx +0 -29
- package/docs/guides/advanced-features/page-performance/_meta.json +0 -1
- package/docs/guides/advanced-features/server-monitor/_meta.json +0 -1
- package/docs/guides/advanced-features/server-monitor/logger.mdx +0 -19
- package/docs/guides/advanced-features/server-monitor/metrics.mdx +0 -41
- package/docs/guides/basic-features/_meta.json +0 -49
- package/docs/guides/basic-features/css/_meta.json +0 -1
- package/docs/guides/basic-features/data/_meta.json +0 -1
- package/docs/guides/basic-features/debug/_meta.json +0 -1
- package/docs/guides/basic-features/render/_meta.json +0 -1
- package/docs/guides/basic-features/render/overview.mdx +0 -51
- package/docs/guides/basic-features/routes/_meta.json +0 -1
- package/docs/guides/basic-features/static-assets/_meta.json +0 -1
- package/docs/guides/basic-features/testing/_meta.json +0 -1
- package/docs/guides/concept/_meta.json +0 -1
- package/docs/guides/get-started/_meta.json +0 -9
- package/docs/guides/get-started/glossary.mdx +0 -63
- package/docs/guides/get-started/quick-start.mdx +0 -92
- package/docs/guides/topic-detail/_meta.json +0 -8
- package/docs/guides/topic-detail/module-federation/_meta.json +0 -1
- package/docs/guides/troubleshooting/_meta.json +0 -1
- package/docs/guides/upgrade/_meta.json +0 -1
- package/scripts/copy-main-doc.mjs +0 -50
- /package/docs/guides/advanced-features/bff/{sdk.mdx → sdk.md} +0 -0
- /package/docs/guides/advanced-features/page-performance/{react-compiler.mdx → react-compiler.md} +0 -0
- /package/docs/guides/basic-features/css/{tailwindcss.mdx → tailwindcss.md} +0 -0
- /package/docs/guides/basic-features/debug/{rsdoctor.mdx → rsdoctor.md} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// The CLI body lives in the compiled ESM output; a CommonJS shim keeps the
|
|
3
|
+
// shebang and stays executable on any Node without a loader.
|
|
4
|
+
const path = require('path');
|
|
5
|
+
import('../dist/esm-node/bundleDocs.mjs').then(m =>
|
|
6
|
+
m.runBundleDocsCli(path.resolve(__dirname, '..')),
|
|
7
|
+
);
|
|
@@ -37,7 +37,10 @@ var __webpack_require__ = {};
|
|
|
37
37
|
var __webpack_exports__ = {};
|
|
38
38
|
__webpack_require__.r(__webpack_exports__);
|
|
39
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
-
|
|
40
|
+
applyCloudflareWorkerMfRuntimeBoundary: ()=>applyCloudflareWorkerMfRuntimeBoundary,
|
|
41
|
+
applyCloudflareWorkerRspackConfig: ()=>applyCloudflareWorkerRspackConfig,
|
|
42
|
+
getBuilderEnvironments: ()=>getBuilderEnvironments,
|
|
43
|
+
getCloudflareWorkerRspackConfig: ()=>getCloudflareWorkerRspackConfig
|
|
41
44
|
});
|
|
42
45
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
43
46
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
@@ -48,6 +51,8 @@ const utils_namespaceObject = require("@modern-js/utils");
|
|
|
48
51
|
const cloudflare_output_contract_js_namespaceObject = require("../../plugins/deploy/platforms/cloudflare-output-contract.js");
|
|
49
52
|
const BFF_EFFECT_WORKER_ENTRY_NAME = '__modern_bff_effect';
|
|
50
53
|
const BFF_EFFECT_WORKER_RUNTIME_QUERY = 'modern-bff-runtime';
|
|
54
|
+
const MF_SSR_DATA_FETCH_RUNTIME_PLUGIN = '@module-federation/modern-js-v3/ssr-inject-data-fetch-function-plugin';
|
|
55
|
+
const MF_SSR_DEV_RUNTIME_PLUGIN = '@module-federation/modern-js-v3/ssr-dev-plugin';
|
|
51
56
|
const JS_OR_TS_EXTS = [
|
|
52
57
|
'.js',
|
|
53
58
|
'.jsx',
|
|
@@ -128,6 +133,64 @@ function getCloudflareWorkerNodeExternals() {
|
|
|
128
133
|
];
|
|
129
134
|
}));
|
|
130
135
|
}
|
|
136
|
+
const reserveWorkerChunkName = (baseName, reservedOutputNames)=>{
|
|
137
|
+
let name = baseName;
|
|
138
|
+
while(reservedOutputNames.has(normalizeWorkerOutputName(name)))name = `${name}_`;
|
|
139
|
+
return name;
|
|
140
|
+
};
|
|
141
|
+
const normalizeWorkerOutputName = (name)=>external_node_path_default().posix.normalize(name.replace(/\\/gu, '/')).toLowerCase();
|
|
142
|
+
function getCloudflareWorkerRspackConfig(workerEntryNames) {
|
|
143
|
+
const entryNames = [
|
|
144
|
+
...workerEntryNames
|
|
145
|
+
];
|
|
146
|
+
for (const entryName of entryNames){
|
|
147
|
+
const slashName = entryName.replace(/\\/gu, '/');
|
|
148
|
+
const normalizedName = external_node_path_default().posix.normalize(slashName);
|
|
149
|
+
if (entryName !== slashName || normalizedName !== slashName || '.' === normalizedName || normalizedName.startsWith('../') || external_node_path_default().posix.isAbsolute(normalizedName) || external_node_path_default().win32.isAbsolute(slashName) || /^[A-Za-z]:/u.test(slashName)) throw new Error(`Cloudflare worker entry name "${entryName}" must be a canonical relative output path without dot segments or backslashes.`);
|
|
150
|
+
}
|
|
151
|
+
const reservedNames = new Set(entryNames.map(normalizeWorkerOutputName));
|
|
152
|
+
const runtimeName = reserveWorkerChunkName('__modern_worker_runtime', reservedNames);
|
|
153
|
+
reservedNames.add(normalizeWorkerOutputName(runtimeName));
|
|
154
|
+
const sharedName = reserveWorkerChunkName('__modern_worker_shared', reservedNames);
|
|
155
|
+
return {
|
|
156
|
+
experiments: {
|
|
157
|
+
outputModule: true
|
|
158
|
+
},
|
|
159
|
+
externals: getCloudflareWorkerNodeExternals(),
|
|
160
|
+
externalsType: 'module-import',
|
|
161
|
+
module: {
|
|
162
|
+
parser: {
|
|
163
|
+
javascript: {
|
|
164
|
+
dynamicImportMode: 'eager'
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
optimization: {
|
|
169
|
+
runtimeChunk: {
|
|
170
|
+
name: runtimeName
|
|
171
|
+
},
|
|
172
|
+
splitChunks: {
|
|
173
|
+
chunks: 'all',
|
|
174
|
+
minSize: 0,
|
|
175
|
+
name: sharedName
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
function applyCloudflareWorkerRspackConfig(chain, workerEntryNames) {
|
|
181
|
+
const config = getCloudflareWorkerRspackConfig(workerEntryNames);
|
|
182
|
+
chain.experiments(config.experiments);
|
|
183
|
+
chain.externals(config.externals);
|
|
184
|
+
chain.externalsType(config.externalsType);
|
|
185
|
+
chain.module.parser.merge(config.module.parser);
|
|
186
|
+
chain.optimization.runtimeChunk(config.optimization.runtimeChunk);
|
|
187
|
+
chain.optimization.splitChunks(config.optimization.splitChunks);
|
|
188
|
+
}
|
|
189
|
+
function applyCloudflareWorkerMfRuntimeBoundary(chain) {
|
|
190
|
+
chain.plugins.delete('plugin-module-federation');
|
|
191
|
+
chain.resolve.alias.set(`${MF_SSR_DATA_FETCH_RUNTIME_PLUGIN}$`, getCloudflareWorkerCompatFile('cloudflare-worker-mf-ssr-runtime-plugin.mjs'));
|
|
192
|
+
chain.resolve.alias.set(`${MF_SSR_DEV_RUNTIME_PLUGIN}$`, getCloudflareWorkerCompatFile('cloudflare-worker-mf-ssr-runtime-plugin.mjs'));
|
|
193
|
+
}
|
|
131
194
|
function getEffectBffEntry(normalizedConfig, appContext) {
|
|
132
195
|
if (!normalizedConfig.bff || 'hono' === normalizedConfig.bff.runtimeFramework) return;
|
|
133
196
|
const configuredEntry = normalizedConfig.bff.effect?.entry;
|
|
@@ -286,17 +349,10 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
286
349
|
htmlPlugin: false,
|
|
287
350
|
...useCloudflareModuleWorker ? {
|
|
288
351
|
bundlerChain: (chain)=>{
|
|
289
|
-
chain.
|
|
290
|
-
experiments: {
|
|
291
|
-
outputModule: true
|
|
292
|
-
},
|
|
293
|
-
externals: getCloudflareWorkerNodeExternals(),
|
|
294
|
-
externalsType: 'module-import'
|
|
295
|
-
});
|
|
352
|
+
applyCloudflareWorkerRspackConfig(chain, Object.keys(workerEntries));
|
|
296
353
|
chain.output.module(true).library({
|
|
297
354
|
type: 'module'
|
|
298
355
|
}).publicPath('/').chunkFormat('module').chunkLoading('import').workerChunkLoading('import');
|
|
299
|
-
chain.optimization.usedExports(false).providedExports(true).innerGraph(false).sideEffects(false);
|
|
300
356
|
for (const condition of [
|
|
301
357
|
'workerd',
|
|
302
358
|
'worker',
|
|
@@ -306,7 +362,7 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
306
362
|
'require',
|
|
307
363
|
'module'
|
|
308
364
|
])chain.resolve.conditionNames.add(condition);
|
|
309
|
-
chain
|
|
365
|
+
applyCloudflareWorkerMfRuntimeBoundary(chain);
|
|
310
366
|
if (tanstackRouterSsrServerFile) {
|
|
311
367
|
chain.resolve.alias.set('@tanstack/router-core/ssr/server$', tanstackRouterSsrServerFile);
|
|
312
368
|
chain.resolve.alias.set('@tanstack/router-core/ssr/server', tanstackRouterSsrServerFile);
|
|
@@ -347,9 +403,15 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
347
403
|
builderConfig: tempBuilderConfig
|
|
348
404
|
};
|
|
349
405
|
}
|
|
406
|
+
exports.applyCloudflareWorkerMfRuntimeBoundary = __webpack_exports__.applyCloudflareWorkerMfRuntimeBoundary;
|
|
407
|
+
exports.applyCloudflareWorkerRspackConfig = __webpack_exports__.applyCloudflareWorkerRspackConfig;
|
|
350
408
|
exports.getBuilderEnvironments = __webpack_exports__.getBuilderEnvironments;
|
|
409
|
+
exports.getCloudflareWorkerRspackConfig = __webpack_exports__.getCloudflareWorkerRspackConfig;
|
|
351
410
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
352
|
-
"
|
|
411
|
+
"applyCloudflareWorkerMfRuntimeBoundary",
|
|
412
|
+
"applyCloudflareWorkerRspackConfig",
|
|
413
|
+
"getBuilderEnvironments",
|
|
414
|
+
"getCloudflareWorkerRspackConfig"
|
|
353
415
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
354
416
|
Object.defineProperty(exports, '__esModule', {
|
|
355
417
|
value: true
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
bundleDocs: ()=>bundleDocs,
|
|
41
|
+
runBundleDocsCli: ()=>runBundleDocsCli
|
|
42
|
+
});
|
|
43
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
44
|
+
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
45
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
46
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
47
|
+
const DEFAULT_INDEX_FILE = 'llms.txt';
|
|
48
|
+
const DEFAULT_EXCLUDED_DIRS = [
|
|
49
|
+
'zh'
|
|
50
|
+
];
|
|
51
|
+
function bundleDocs({ source, target, indexFile = DEFAULT_INDEX_FILE, excludedDirs = DEFAULT_EXCLUDED_DIRS }) {
|
|
52
|
+
if (!external_node_fs_default().existsSync(source)) {
|
|
53
|
+
console.warn(`[bundle-docs] docs build output not found: ${source}`);
|
|
54
|
+
console.warn('[bundle-docs] skipping the bundled docs — build the docs site first if you need them');
|
|
55
|
+
return 0;
|
|
56
|
+
}
|
|
57
|
+
external_node_fs_default().rmSync(target, {
|
|
58
|
+
recursive: true,
|
|
59
|
+
force: true
|
|
60
|
+
});
|
|
61
|
+
const isBundled = (rel)=>rel === indexFile || rel.endsWith('.md') && !excludedDirs.some((dir)=>rel.startsWith(`${dir}${external_node_path_default().sep}`));
|
|
62
|
+
let count = 0;
|
|
63
|
+
for (const entry of external_node_fs_default().readdirSync(source, {
|
|
64
|
+
recursive: true,
|
|
65
|
+
withFileTypes: true
|
|
66
|
+
})){
|
|
67
|
+
if (!entry.isFile()) continue;
|
|
68
|
+
const from = external_node_path_default().join(entry.parentPath ?? entry.path, entry.name);
|
|
69
|
+
const rel = external_node_path_default().relative(source, from);
|
|
70
|
+
if (!isBundled(rel)) continue;
|
|
71
|
+
const to = external_node_path_default().join(target, rel);
|
|
72
|
+
external_node_fs_default().mkdirSync(external_node_path_default().dirname(to), {
|
|
73
|
+
recursive: true
|
|
74
|
+
});
|
|
75
|
+
external_node_fs_default().copyFileSync(from, to);
|
|
76
|
+
count++;
|
|
77
|
+
}
|
|
78
|
+
if (0 === count) throw new Error(`[bundle-docs] no files copied from ${source}`);
|
|
79
|
+
return count;
|
|
80
|
+
}
|
|
81
|
+
function parseArgs(argv) {
|
|
82
|
+
const options = {};
|
|
83
|
+
for(let i = 0; i < argv.length; i += 2){
|
|
84
|
+
const key = argv[i]?.replace(/^--/, '');
|
|
85
|
+
const value = argv[i + 1];
|
|
86
|
+
if (key && value) options[key] = value;
|
|
87
|
+
}
|
|
88
|
+
return options;
|
|
89
|
+
}
|
|
90
|
+
function runBundleDocsCli(pkgRoot) {
|
|
91
|
+
const args = parseArgs(process.argv.slice(2));
|
|
92
|
+
const source = args.source ? external_node_path_default().resolve(process.cwd(), args.source) : external_node_path_default().resolve(pkgRoot, '../../document/doc_build');
|
|
93
|
+
const target = args.target ? external_node_path_default().resolve(process.cwd(), args.target) : external_node_path_default().resolve(pkgRoot, 'docs');
|
|
94
|
+
try {
|
|
95
|
+
const count = bundleDocs({
|
|
96
|
+
source,
|
|
97
|
+
target,
|
|
98
|
+
indexFile: args.index
|
|
99
|
+
});
|
|
100
|
+
if (count > 0) console.log(`[bundle-docs] bundled ${count} doc files into docs`);
|
|
101
|
+
} catch (error) {
|
|
102
|
+
console.error(error.message);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.bundleDocs = __webpack_exports__.bundleDocs;
|
|
107
|
+
exports.runBundleDocsCli = __webpack_exports__.runBundleDocsCli;
|
|
108
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
109
|
+
"bundleDocs",
|
|
110
|
+
"runBundleDocsCli"
|
|
111
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
112
|
+
Object.defineProperty(exports, '__esModule', {
|
|
113
|
+
value: true
|
|
114
|
+
});
|
|
@@ -162,7 +162,7 @@ const verifyCloudflareOutput = async (options)=>{
|
|
|
162
162
|
path: publicPath
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
if (false !== options.importWorker && await pathExists(outputPlan.paths.workerEntry)) await (0, external_worker_bundles_js_namespaceObject.verifyWorkerImport)(issues, outputPlan.paths.workerEntry);
|
|
165
|
+
if (false !== options.importWorker && await pathExists(outputPlan.paths.workerEntry)) await (0, external_worker_bundles_js_namespaceObject.verifyWorkerImport)(issues, outputPlan.paths.workerEntry, manifest);
|
|
166
166
|
return {
|
|
167
167
|
ok: 0 === issues.length,
|
|
168
168
|
issues
|
|
@@ -49,7 +49,10 @@ var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObj
|
|
|
49
49
|
const external_node_path_namespaceObject = require("node:path");
|
|
50
50
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
51
51
|
const external_node_url_namespaceObject = require("node:url");
|
|
52
|
+
const external_node_util_namespaceObject = require("node:util");
|
|
52
53
|
const parser_namespaceObject = require("@babel/parser");
|
|
54
|
+
const traverse_namespaceObject = require("@babel/traverse");
|
|
55
|
+
var traverse_default = /*#__PURE__*/ __webpack_require__.n(traverse_namespaceObject);
|
|
53
56
|
const external_cloudflare_output_contract_js_namespaceObject = require("../cloudflare-output-contract.js");
|
|
54
57
|
const external_issues_js_namespaceObject = require("./issues.js");
|
|
55
58
|
const getReferencedRouteWorkers = (manifest)=>Array.isArray(manifest?.routeSpec?.routes) ? manifest.routeSpec.routes.map((route)=>'string' == typeof route?.worker && route.worker.length > 0 ? route.worker : void 0).filter((worker)=>'string' == typeof worker) : [];
|
|
@@ -93,6 +96,7 @@ const getNodeName = (node)=>{
|
|
|
93
96
|
if (!isAstNode(node)) return;
|
|
94
97
|
return 'Identifier' === node.type && 'string' == typeof node.name ? node.name : 'StringLiteral' === node.type && 'string' == typeof node.value ? node.value : void 0;
|
|
95
98
|
};
|
|
99
|
+
const getStringLiteralValue = (node)=>isAstNode(node) && 'StringLiteral' === node.type && 'string' == typeof node.value ? node.value : void 0;
|
|
96
100
|
const collectBindingNames = (node, names)=>{
|
|
97
101
|
if (!isAstNode(node)) return;
|
|
98
102
|
const name = getNodeName(node);
|
|
@@ -102,7 +106,11 @@ const collectBindingNames = (node, names)=>{
|
|
|
102
106
|
} else if ('ArrayPattern' === node.type && Array.isArray(node.elements)) for (const element of node.elements)collectBindingNames(element, names);
|
|
103
107
|
else if ('AssignmentPattern' === node.type || 'RestElement' === node.type) collectBindingNames('AssignmentPattern' === node.type ? node.left : node.argument, names);
|
|
104
108
|
};
|
|
105
|
-
const getMemberPropertyName = (node)=>
|
|
109
|
+
const getMemberPropertyName = (node)=>{
|
|
110
|
+
if ('MemberExpression' !== node.type) return;
|
|
111
|
+
return true === node.computed ? getStringLiteralValue(node.property) : getNodeName(node.property);
|
|
112
|
+
};
|
|
113
|
+
const isAmbientModuleRequire = (node, modulePath)=>isAstNode(node) && 'MemberExpression' === node.type && isAstNode(node.object) && 'Identifier' === node.object.type && 'module' === node.object.name && void 0 === modulePath.scope.getBinding('module') && 'require' === getMemberPropertyName(node);
|
|
106
114
|
const isModuleExports = (node)=>isAstNode(node) && 'MemberExpression' === node.type && isAstNode(node.object) && 'Identifier' === node.object.type && 'module' === node.object.name && 'exports' === getMemberPropertyName(node);
|
|
107
115
|
const collectCommonJsExports = (statement, exports1)=>{
|
|
108
116
|
if ('ExpressionStatement' !== statement.type || !isAstNode(statement.expression) || 'AssignmentExpression' !== statement.expression.type) return;
|
|
@@ -137,19 +145,31 @@ const collectEsmExports = (statement, exports1)=>{
|
|
|
137
145
|
}
|
|
138
146
|
}
|
|
139
147
|
};
|
|
140
|
-
const
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
148
|
+
const getStaticImport = (modulePath)=>{
|
|
149
|
+
const node = modulePath.node;
|
|
150
|
+
if (('ImportDeclaration' === node.type || 'ExportNamedDeclaration' === node.type || 'ExportAllDeclaration' === node.type) && isAstNode(node.source)) return getStringLiteralValue(node.source);
|
|
151
|
+
if ('ImportExpression' === node.type && isAstNode(node.source)) return getStringLiteralValue(node.source);
|
|
152
|
+
if ('CallExpression' === node.type && Array.isArray(node.arguments) && 1 === node.arguments.length && isAstNode(node.callee) && ('Identifier' === node.callee.type && 'require' === node.callee.name && void 0 === modulePath.scope.getBinding('require') || isAmbientModuleRequire(node.callee, modulePath) || 'Import' === node.callee.type)) return getStringLiteralValue(node.arguments[0]);
|
|
153
|
+
};
|
|
154
|
+
const isAmbientLoaderWrite = (modulePath)=>{
|
|
155
|
+
let targetPath = modulePath;
|
|
156
|
+
while(targetPath.parentPath){
|
|
157
|
+
const parentPath = targetPath.parentPath;
|
|
158
|
+
if (parentPath.isAssignmentExpression()) return 'left' === targetPath.key;
|
|
159
|
+
if (parentPath.isUpdateExpression()) return 'argument' === targetPath.key;
|
|
160
|
+
if (parentPath.isForInStatement() || parentPath.isForOfStatement()) return 'left' === targetPath.key;
|
|
161
|
+
if (parentPath.isObjectProperty()) {
|
|
162
|
+
if ('value' !== targetPath.key) return false;
|
|
163
|
+
targetPath = parentPath;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
if (parentPath.isObjectPattern() || parentPath.isArrayPattern() || parentPath.isRestElement() || parentPath.isAssignmentPattern()) {
|
|
167
|
+
targetPath = parentPath;
|
|
168
|
+
continue;
|
|
146
169
|
}
|
|
170
|
+
break;
|
|
147
171
|
}
|
|
148
|
-
|
|
149
|
-
const getStaticImport = (node)=>{
|
|
150
|
-
if (('ImportDeclaration' === node.type || 'ExportNamedDeclaration' === node.type || 'ExportAllDeclaration' === node.type) && isAstNode(node.source)) return getNodeName(node.source);
|
|
151
|
-
if ('ImportExpression' === node.type && isAstNode(node.source)) return getNodeName(node.source);
|
|
152
|
-
if ('CallExpression' === node.type && Array.isArray(node.arguments) && 1 === node.arguments.length && isAstNode(node.callee) && ('Identifier' === node.callee.type && 'require' === node.callee.name || 'Import' === node.callee.type)) return getNodeName(node.arguments[0]);
|
|
172
|
+
return false;
|
|
153
173
|
};
|
|
154
174
|
const analyzeWorkerModule = (source)=>{
|
|
155
175
|
const ast = (0, parser_namespaceObject.parse)(source, {
|
|
@@ -157,17 +177,49 @@ const analyzeWorkerModule = (source)=>{
|
|
|
157
177
|
});
|
|
158
178
|
const exports1 = new Set();
|
|
159
179
|
const imports = new Set();
|
|
180
|
+
let unsafeCommonJsLoaderUsage = false;
|
|
181
|
+
let unsafeDynamicImport = false;
|
|
160
182
|
for (const statement of ast.program.body){
|
|
161
183
|
collectEsmExports(statement, exports1);
|
|
162
184
|
collectCommonJsExports(statement, exports1);
|
|
163
185
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
186
|
+
traverse_default()(ast, {
|
|
187
|
+
enter (modulePath) {
|
|
188
|
+
const node = modulePath.node;
|
|
189
|
+
if (('ImportExpression' === node.type || 'CallExpression' === node.type && isAstNode(node.callee) && 'Import' === node.callee.type) && void 0 === getStaticImport(modulePath)) unsafeDynamicImport = true;
|
|
190
|
+
if (modulePath.isReferencedIdentifier({
|
|
191
|
+
name: 'require'
|
|
192
|
+
}) && void 0 === modulePath.scope.getBinding('require')) {
|
|
193
|
+
const parentPath = modulePath.parentPath;
|
|
194
|
+
const isStaticRequireCall = parentPath?.isCallExpression() && 'callee' === modulePath.key && void 0 !== getStaticImport(parentPath);
|
|
195
|
+
const isAvailabilityCheck = parentPath?.isUnaryExpression({
|
|
196
|
+
operator: 'typeof'
|
|
197
|
+
});
|
|
198
|
+
if (!isStaticRequireCall && !isAvailabilityCheck) unsafeCommonJsLoaderUsage = true;
|
|
199
|
+
}
|
|
200
|
+
if ('Identifier' === node.type && isAmbientLoaderWrite(modulePath) && ('require' === node.name || 'module' === node.name) && void 0 === modulePath.scope.getBinding(node.name)) unsafeCommonJsLoaderUsage = true;
|
|
201
|
+
if (modulePath.isReferencedIdentifier({
|
|
202
|
+
name: 'module'
|
|
203
|
+
}) && void 0 === modulePath.scope.getBinding('module')) {
|
|
204
|
+
const parentPath = modulePath.parentPath;
|
|
205
|
+
const isExportsAccess = null !== parentPath && isModuleExports(parentPath.node);
|
|
206
|
+
const isStaticModuleRequireCall = null !== parentPath && isAmbientModuleRequire(parentPath.node, parentPath) && parentPath.parentPath?.isCallExpression() === true && 'callee' === parentPath.key && void 0 !== getStaticImport(parentPath.parentPath);
|
|
207
|
+
if (!isExportsAccess && !isStaticModuleRequireCall) unsafeCommonJsLoaderUsage = true;
|
|
208
|
+
}
|
|
209
|
+
if (isAmbientModuleRequire(node, modulePath)) {
|
|
210
|
+
const parentPath = modulePath.parentPath;
|
|
211
|
+
const isStaticRequireCall = parentPath?.isCallExpression() && 'callee' === modulePath.key && void 0 !== getStaticImport(parentPath);
|
|
212
|
+
if (!isStaticRequireCall) unsafeCommonJsLoaderUsage = true;
|
|
213
|
+
}
|
|
214
|
+
const specifier = getStaticImport(modulePath);
|
|
215
|
+
if (void 0 !== specifier) imports.add(specifier);
|
|
216
|
+
}
|
|
167
217
|
});
|
|
168
218
|
return {
|
|
169
219
|
exports: exports1,
|
|
170
|
-
imports
|
|
220
|
+
imports,
|
|
221
|
+
unsafeCommonJsLoaderUsage,
|
|
222
|
+
unsafeDynamicImport
|
|
171
223
|
};
|
|
172
224
|
};
|
|
173
225
|
const getPackageName = (specifier)=>specifier.startsWith('@') ? specifier.split('/').slice(0, 2).join('/') : specifier.split('/')[0];
|
|
@@ -218,7 +270,25 @@ const verifyWorkerModuleClosure = async (issues, entryPath, entrySource, contrac
|
|
|
218
270
|
return;
|
|
219
271
|
}
|
|
220
272
|
if (isEntry) entryAnalysis = analysis;
|
|
273
|
+
if (analysis.unsafeCommonJsLoaderUsage) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
274
|
+
code: 'invalid-worker-bundle',
|
|
275
|
+
message: 'Cloudflare worker bundles must use exactly one string-literal specifier in ambient CommonJS loader calls and must not pass or alias the loader.',
|
|
276
|
+
path: modulePath
|
|
277
|
+
});
|
|
278
|
+
if (analysis.unsafeDynamicImport) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
279
|
+
code: 'invalid-worker-bundle',
|
|
280
|
+
message: 'Cloudflare worker bundles must not contain non-static dynamic module imports.',
|
|
281
|
+
path: modulePath
|
|
282
|
+
});
|
|
221
283
|
for (const specifier of analysis.imports){
|
|
284
|
+
if (0 === specifier.length) {
|
|
285
|
+
(0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
286
|
+
code: 'invalid-worker-bundle',
|
|
287
|
+
message: 'Cloudflare worker bundle module specifiers must not be empty.',
|
|
288
|
+
path: modulePath
|
|
289
|
+
});
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
222
292
|
if (!specifier.startsWith('.') && !external_node_path_default().isAbsolute(specifier)) {
|
|
223
293
|
if (CLOUDFLARE_WORKER_NODE_BUILTIN_SPECIFIERS.has(specifier)) continue;
|
|
224
294
|
if (specifier.startsWith('node:')) {
|
|
@@ -267,14 +337,20 @@ const verifyWorkerBundleReferences = async (issues, worker, source, contract)=>{
|
|
|
267
337
|
path: worker.path
|
|
268
338
|
});
|
|
269
339
|
};
|
|
270
|
-
const verifyWorkerImport = async (issues, entryPath)=>{
|
|
340
|
+
const verifyWorkerImport = async (issues, entryPath, expectedManifest)=>{
|
|
271
341
|
try {
|
|
272
|
-
const
|
|
342
|
+
const workerModule = await import(`${(0, external_node_url_namespaceObject.pathToFileURL)(entryPath).href}?t=${Date.now()}`);
|
|
343
|
+
const worker = workerModule.default;
|
|
273
344
|
if (!worker || 'function' != typeof worker.fetch) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
274
345
|
code: 'worker-import-failed',
|
|
275
346
|
message: 'Cloudflare server entry must default-export a Worker with fetch.',
|
|
276
347
|
path: entryPath
|
|
277
348
|
});
|
|
349
|
+
if (void 0 !== expectedManifest && !(0, external_node_util_namespaceObject.isDeepStrictEqual)(workerModule.modernWorkerManifest, expectedManifest)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
350
|
+
code: 'worker-import-failed',
|
|
351
|
+
message: 'Cloudflare server entry runtime manifest must exactly match modern-worker-manifest.json.',
|
|
352
|
+
path: entryPath
|
|
353
|
+
});
|
|
278
354
|
} catch (error) {
|
|
279
355
|
(0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
280
356
|
code: 'worker-import-failed',
|
package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const ASSETS_BINDING = 'ASSETS';
|
|
2
2
|
const MODERN_WORKER_MANIFEST = p_workerManifest;
|
|
3
|
+
export const modernWorkerManifest = MODERN_WORKER_MANIFEST;
|
|
3
4
|
const WORKER_MODULE_LOADERS = p_workerModuleLoaders;
|
|
4
5
|
const workerModulePromises = new Map();
|
|
5
6
|
const effectBffDispatcherPromises = new Map();
|
package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workerd cannot initialize Module Federation's Node-oriented SSR data-fetch
|
|
3
|
+
* runtime. Cloudflare workers do not load native MF remotes, so retain the
|
|
4
|
+
* runtime-plugin contract without installing its server data-fetch hooks.
|
|
5
|
+
*/
|
|
6
|
+
export const injectDataFetchFunctionPlugin = () => ({
|
|
7
|
+
name: '@module-federation/inject-data-fetch-function-plugin',
|
|
8
|
+
setup() {},
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export const mfSSRDevPlugin = () => ({
|
|
12
|
+
name: '@module-federation/modern-js-v3',
|
|
13
|
+
setup() {},
|
|
14
|
+
});
|