@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.6 → 3.5.0-ultramodern.75
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.js +0 -0
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +13 -16
- package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +13 -4
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +14 -11
- package/dist/cjs/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.js +72 -0
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +28 -11
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +13 -6
- package/dist/cjs/builder/shared/lazyCompilation.js +2 -10
- package/dist/cjs/commands/index.js +0 -4
- package/dist/cjs/config/build-environment.js +268 -0
- package/dist/cjs/config/index.js +11 -4
- package/dist/cjs/config/public.js +46 -0
- package/dist/cjs/index.js +39 -62
- package/dist/cjs/plugins/analyze/getServerRoutes.js +19 -0
- package/dist/cjs/plugins/analyze/index.js +20 -12
- package/dist/cjs/plugins/backend-federation/codegen.js +255 -0
- package/dist/cjs/plugins/backend-federation/config.js +204 -0
- package/dist/cjs/plugins/backend-federation/emit.js +148 -0
- package/dist/cjs/plugins/backendFederationBuild.js +53 -0
- package/dist/cjs/plugins/deploy/index.js +4 -4
- package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +127 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +141 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +139 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +135 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +150 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +205 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/types.js +18 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/utils.js +66 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/worker-manifest.js +208 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +204 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +108 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-plan.js +93 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/identity.js +83 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +188 -0
- package/dist/cjs/{baseline.js → plugins/deploy/platforms/cloudflare-output-verifier/issues.js} +19 -10
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +89 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +151 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +302 -0
- package/dist/cjs/plugins/deploy/platforms/node.js +20 -2
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +250 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +191 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +514 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +1012 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +363 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +93 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +8 -4
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +251 -155
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +78 -39
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.cjs +62 -41
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.mjs +63 -41
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +52 -35
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +53 -35
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.cjs +61 -41
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.mjs +61 -40
- package/dist/cjs/plugins/deploy/utils/npmAliases.js +226 -0
- package/dist/cjs/plugins/ultramodernReleaseEnvelope.js +100 -0
- package/dist/cjs/presetUltramodern.js +33 -2
- package/dist/cjs/ultramodern-release-envelope/canonical.js +68 -0
- package/dist/cjs/ultramodern-release-envelope/framework-output.js +597 -0
- package/dist/cjs/ultramodern-release-envelope/index.js +399 -0
- package/dist/cjs/ultramodern-release-envelope/types.js +51 -0
- package/dist/cjs/ultramodern-release-identity.js +110 -0
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +12 -15
- package/dist/esm/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +15 -12
- package/dist/esm/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +30 -0
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.mjs +24 -10
- package/dist/esm/builder/shared/bundlerPlugins/index.mjs +1 -0
- package/dist/esm/builder/shared/lazyCompilation.mjs +1 -3
- package/dist/esm/commands/index.mjs +0 -1
- package/dist/esm/config/build-environment.mjs +224 -0
- package/dist/esm/config/index.mjs +1 -0
- package/dist/esm/config/public.mjs +1 -0
- package/dist/esm/index.mjs +5 -4
- package/dist/esm/plugins/analyze/getHtmlTemplate.mjs +2 -2
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +17 -1
- package/dist/esm/plugins/analyze/index.mjs +20 -12
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +2 -2
- package/dist/esm/plugins/backend-federation/codegen.mjs +204 -0
- package/dist/esm/plugins/backend-federation/config.mjs +128 -0
- package/dist/esm/plugins/backend-federation/emit.mjs +97 -0
- package/dist/esm/plugins/backendFederationBuild.mjs +1 -0
- package/dist/esm/plugins/deploy/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +64 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +34 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +88 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +97 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +102 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/security-policies.mjs +167 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/types.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/utils.mjs +12 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +148 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +150 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-contract.mjs +31 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-plan.mjs +45 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +45 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +133 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +10 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +51 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +99 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +238 -0
- package/dist/esm/plugins/deploy/platforms/node.mjs +20 -2
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +250 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +191 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +514 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +1012 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +363 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +93 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +8 -4
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +251 -155
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +78 -39
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +62 -41
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.mjs +63 -41
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +52 -35
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +53 -35
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.cjs +61 -41
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.mjs +61 -40
- package/dist/esm/plugins/deploy/utils/npmAliases.mjs +174 -0
- package/dist/esm/plugins/ultramodernReleaseEnvelope.mjs +52 -0
- package/dist/esm/presetUltramodern.mjs +33 -2
- package/dist/esm/ultramodern-release-envelope/canonical.mjs +21 -0
- package/dist/esm/ultramodern-release-envelope/framework-output.mjs +524 -0
- package/dist/esm/ultramodern-release-envelope/index.mjs +335 -0
- package/dist/esm/ultramodern-release-envelope/types.mjs +7 -0
- package/dist/esm/ultramodern-release-identity.mjs +66 -0
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +12 -15
- package/dist/esm-node/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +15 -12
- package/dist/esm-node/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +31 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.mjs +24 -10
- package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +1 -0
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +1 -3
- package/dist/esm-node/commands/index.mjs +0 -1
- package/dist/esm-node/config/build-environment.mjs +225 -0
- package/dist/esm-node/config/index.mjs +1 -0
- package/dist/esm-node/config/public.mjs +2 -0
- package/dist/esm-node/index.mjs +5 -4
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.mjs +2 -2
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +17 -1
- package/dist/esm-node/plugins/analyze/index.mjs +20 -12
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +2 -2
- package/dist/esm-node/plugins/backend-federation/codegen.mjs +205 -0
- package/dist/esm-node/plugins/backend-federation/config.mjs +129 -0
- package/dist/esm-node/plugins/backend-federation/emit.mjs +98 -0
- package/dist/esm-node/plugins/backendFederationBuild.mjs +2 -0
- package/dist/esm-node/plugins/deploy/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +65 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +35 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +89 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +98 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +103 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/security-policies.mjs +168 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/types.mjs +1 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/utils.mjs +13 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +149 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +151 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-contract.mjs +32 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-plan.mjs +46 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +46 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +134 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +11 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +52 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +100 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +239 -0
- package/dist/esm-node/plugins/deploy/platforms/node.mjs +20 -2
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +250 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +191 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +514 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +1012 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +363 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +93 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +8 -4
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +251 -155
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +78 -39
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +62 -41
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.mjs +63 -41
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +52 -35
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +53 -35
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.cjs +61 -41
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.mjs +61 -40
- package/dist/esm-node/plugins/deploy/utils/npmAliases.mjs +175 -0
- package/dist/esm-node/plugins/ultramodernReleaseEnvelope.mjs +53 -0
- package/dist/esm-node/presetUltramodern.mjs +33 -2
- package/dist/esm-node/ultramodern-release-envelope/canonical.mjs +22 -0
- package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +525 -0
- package/dist/esm-node/ultramodern-release-envelope/index.mjs +336 -0
- package/dist/esm-node/ultramodern-release-envelope/types.mjs +8 -0
- package/dist/esm-node/ultramodern-release-identity.mjs +67 -0
- package/dist/types/builder/generator/createCopyPattern.d.ts +7 -5
- package/dist/types/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.d.ts +6 -0
- package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +1 -0
- package/dist/types/builder/shared/bundlerPlugins/index.d.ts +1 -0
- package/dist/types/builder/shared/lazyCompilation.d.ts +2 -4
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types/config/build-environment.d.ts +22 -0
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/config/public.d.ts +2 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +1 -0
- package/dist/types/plugins/backend-federation/codegen.d.ts +83 -0
- package/dist/types/plugins/backend-federation/config.d.ts +103 -0
- package/dist/types/plugins/backend-federation/emit.d.ts +13 -0
- package/dist/types/plugins/backendFederationBuild.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +15 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +24 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/delivery-unit.d.ts +23 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/i18n-worker.d.ts +22 -0
- package/dist/types/plugins/deploy/platforms/{cloudflare.d.ts → cloudflare/index.d.ts} +1 -1
- package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +51 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/types.d.ts +5 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/utils.d.ts +6 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/worker-manifest.d.ts +122 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +46 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +14 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-plan.d.ts +34 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/identity.d.ts +4 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/index.d.ts +18 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/issues.d.ts +14 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/manifest.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.d.ts +14 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +20 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts +1 -0
- package/dist/types/plugins/deploy/utils/npmAliases.d.ts +14 -0
- package/dist/types/plugins/ultramodernReleaseEnvelope.d.ts +3 -0
- package/dist/types/presetUltramodern.d.ts +10 -0
- package/dist/types/run/index.d.ts +1 -1
- package/dist/types/types/config/cloudflareDeploy.d.ts +41 -0
- package/dist/types/types/config/deploy.d.ts +15 -2
- package/dist/types/ultramodern-release-envelope/canonical.d.ts +5 -0
- package/dist/types/ultramodern-release-envelope/framework-output.d.ts +31 -0
- package/dist/types/ultramodern-release-envelope/index.d.ts +6 -0
- package/dist/types/ultramodern-release-envelope/types.d.ts +62 -0
- package/dist/types/ultramodern-release-identity.d.ts +16 -0
- package/lib/types.d.ts +2 -3
- package/package.json +38 -23
- package/rslib.config.mts +11 -12
- package/dist/cjs/commands/runtime.js +0 -196
- package/dist/cjs/plugins/deploy/platforms/cloudflare.js +0 -540
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
- package/dist/cjs/ultramodern/designSystem.js +0 -123
- package/dist/esm/baseline.mjs +0 -4
- package/dist/esm/commands/runtime.mjs +0 -146
- package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +0 -492
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
- package/dist/esm/ultramodern/designSystem.mjs +0 -73
- package/dist/esm-node/baseline.mjs +0 -5
- package/dist/esm-node/commands/runtime.mjs +0 -147
- package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +0 -493
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
- package/dist/esm-node/ultramodern/designSystem.mjs +0 -74
- package/dist/types/baseline.d.ts +0 -16
- package/dist/types/commands/runtime.d.ts +0 -12
- package/dist/types/ultramodern/designSystem.d.ts +0 -54
- /package/dist/types/plugins/deploy/platforms/templates/{cloudflare-entry.d.mts → cloudflare-entry.006-fetch-handler.d.mts} +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type DeliveryUnitContractBlock, type UltramodernBuildArtifact } from '@modern-js/utils/universal';
|
|
2
|
+
export declare const COMPACT_CONFIG_PATH = ".modernjs/ultramodern.json";
|
|
3
|
+
export type CompactApp = {
|
|
4
|
+
id?: unknown;
|
|
5
|
+
kind?: unknown;
|
|
6
|
+
path?: unknown;
|
|
7
|
+
package?: unknown;
|
|
8
|
+
port?: unknown;
|
|
9
|
+
api?: {
|
|
10
|
+
prefix?: unknown;
|
|
11
|
+
stem?: unknown;
|
|
12
|
+
};
|
|
13
|
+
moduleFederation?: {
|
|
14
|
+
name?: unknown;
|
|
15
|
+
manifestUrl?: unknown;
|
|
16
|
+
};
|
|
17
|
+
backendFederation?: {
|
|
18
|
+
name?: unknown;
|
|
19
|
+
versionBoundary?: {
|
|
20
|
+
ui?: {
|
|
21
|
+
manifestUrl?: unknown;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
executionSurfaces?: {
|
|
25
|
+
node?: {
|
|
26
|
+
remoteName?: unknown;
|
|
27
|
+
manifestUrl?: unknown;
|
|
28
|
+
containerEntry?: unknown;
|
|
29
|
+
remoteType?: unknown;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
deliveryUnit?: {
|
|
34
|
+
unitId?: unknown;
|
|
35
|
+
buildMarker?: unknown;
|
|
36
|
+
sourceRevision?: unknown;
|
|
37
|
+
packageName?: unknown;
|
|
38
|
+
version?: unknown;
|
|
39
|
+
};
|
|
40
|
+
serverExecution?: {
|
|
41
|
+
node?: {
|
|
42
|
+
remoteName?: unknown;
|
|
43
|
+
manifestUrl?: unknown;
|
|
44
|
+
containerEntry?: unknown;
|
|
45
|
+
remoteType?: unknown;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export type CompactConfig = {
|
|
50
|
+
topology?: {
|
|
51
|
+
apps?: CompactApp[];
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export type BackendFederationApp = {
|
|
55
|
+
id: string;
|
|
56
|
+
directory: string;
|
|
57
|
+
packageName?: string;
|
|
58
|
+
version?: string;
|
|
59
|
+
buildVersion?: string;
|
|
60
|
+
unitId?: string;
|
|
61
|
+
sourceRevision?: string;
|
|
62
|
+
deliveryUnit?: DeliveryUnitContractBlock;
|
|
63
|
+
port: number;
|
|
64
|
+
apiPrefix: string;
|
|
65
|
+
apiStem: string;
|
|
66
|
+
backendName: string;
|
|
67
|
+
manifestUrl: string;
|
|
68
|
+
containerEntry: string;
|
|
69
|
+
remoteType: string;
|
|
70
|
+
uiManifestUrl?: string;
|
|
71
|
+
compactDeliveryUnit?: {
|
|
72
|
+
unitId?: string;
|
|
73
|
+
buildMarker?: string;
|
|
74
|
+
sourceRevision?: string;
|
|
75
|
+
packageName?: string;
|
|
76
|
+
version?: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export type BackendFederationBuildIdentity = {
|
|
80
|
+
appId?: string;
|
|
81
|
+
packageName?: string;
|
|
82
|
+
version?: string;
|
|
83
|
+
buildVersion?: string;
|
|
84
|
+
unitId?: string;
|
|
85
|
+
sourceRevision?: string;
|
|
86
|
+
artifact?: UltramodernBuildArtifact;
|
|
87
|
+
};
|
|
88
|
+
export declare const normalizeRelativePath: (value: string) => string;
|
|
89
|
+
export declare const buildArtifactPathFor: (appDirectory: string) => string;
|
|
90
|
+
export declare const buildModulePathFor: (appDirectory: string) => string;
|
|
91
|
+
export declare const readBuildIdentity: (appDirectory: string) => Promise<BackendFederationBuildIdentity>;
|
|
92
|
+
export declare const findWorkspaceRoot: (appDirectory: string) => string | undefined;
|
|
93
|
+
export declare const resolveWorkspaceSourceRevision: (workspaceRoot: string) => Promise<string>;
|
|
94
|
+
export declare const createStampedDeliveryUnit: (input: {
|
|
95
|
+
appId: string;
|
|
96
|
+
unitId?: string;
|
|
97
|
+
buildMarker?: string;
|
|
98
|
+
packageName?: string;
|
|
99
|
+
version?: string;
|
|
100
|
+
sourceRevision: string;
|
|
101
|
+
}) => DeliveryUnitContractBlock | undefined;
|
|
102
|
+
export declare const createAppFromCompactMetadata: (workspaceRoot: string, appDirectory: string, compactApp: CompactApp) => BackendFederationApp | undefined;
|
|
103
|
+
export declare const findBackendFederationApp: (workspaceRoot: string, appDirectory: string) => Promise<BackendFederationApp | undefined>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AppTools, CliPlugin } from '../../types';
|
|
2
|
+
export type { BackendFederationBuildIdentity } from './config';
|
|
3
|
+
export type BackendFederationArtifactResult = {
|
|
4
|
+
appId: string;
|
|
5
|
+
manifestPath: string;
|
|
6
|
+
containerPath: string;
|
|
7
|
+
deliveryUnitArtifactPath?: string;
|
|
8
|
+
remoteName: string;
|
|
9
|
+
remoteType: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const emitBackendFederationArtifacts: (appDirectory: string, distDirectory: string) => Promise<BackendFederationArtifactResult | undefined>;
|
|
12
|
+
export default _default;
|
|
13
|
+
declare function _default(): CliPlugin<AppTools>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CloudflareModernConfig } from './types';
|
|
2
|
+
export declare const getCloudflareArtifacts: (modernConfig: CloudflareModernConfig) => {
|
|
3
|
+
from: string;
|
|
4
|
+
to: string;
|
|
5
|
+
index: number;
|
|
6
|
+
}[];
|
|
7
|
+
export declare const getCloudflarePublicAssets: (modernConfig: CloudflareModernConfig) => {
|
|
8
|
+
from: string;
|
|
9
|
+
to: string;
|
|
10
|
+
index: number;
|
|
11
|
+
}[];
|
|
12
|
+
export declare const copyCloudflareArtifacts: (appDirectory: string, outputDirectory: string, artifacts: ReturnType<typeof getCloudflareArtifacts>) => Promise<void>;
|
|
13
|
+
export declare const copyCloudflarePublicAssets: (appDirectory: string, publicDirectory: string, publicAssets: ReturnType<typeof getCloudflarePublicAssets>) => Promise<void>;
|
|
14
|
+
export declare const copyCloudflareD1Migrations: (appDirectory: string, outputDirectory: string, modernConfig: CloudflareModernConfig) => Promise<void>;
|
|
15
|
+
export declare const readRouteSpec: (outputDirectory: string) => Promise<any>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CLOUDFLARE_RUNTIME_TYPE, CLOUDFLARE_WORKER_BUNDLE_FORMAT } from '../cloudflare-output-contract';
|
|
2
|
+
export { CLOUDFLARE_RUNTIME_TYPE, CLOUDFLARE_WORKER_BUNDLE_FORMAT };
|
|
3
|
+
export declare const WORKER_ENTRY = "server/index.mjs";
|
|
4
|
+
export declare const WORKER_MANIFEST = "server/modern-worker-manifest.json";
|
|
5
|
+
export declare const WRANGLER_CONFIG_FILE = "wrangler.json";
|
|
6
|
+
export declare const OUTPUT_PACKAGE_FILE = "package.json";
|
|
7
|
+
export declare const ASSETS_BINDING = "ASSETS";
|
|
8
|
+
export declare const ROUTE_SPEC_FILE = "route.json";
|
|
9
|
+
export declare const ROUTE_SPEC_OUTPUT = "server/route.json";
|
|
10
|
+
export declare const LOADABLE_STATS_FILE = "loadable-stats.json";
|
|
11
|
+
export declare const ROUTE_MANIFEST_FILE = "routes-manifest.json";
|
|
12
|
+
export declare const PUBLIC_ASSETS_DIRECTORY = "public";
|
|
13
|
+
export declare const WORKER_BUNDLE_DIRECTORY = "worker";
|
|
14
|
+
export declare const SERVER_BUNDLE_DIRECTORY = "bundles";
|
|
15
|
+
export declare const SERVER_OUTPUT_DIRECTORY = "server";
|
|
16
|
+
export declare const DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES: readonly ['api', 'shared'];
|
|
17
|
+
export declare const BFF_EFFECT_WORKER_ENTRY = "worker/__modern_bff_effect.js";
|
|
18
|
+
export declare const BFF_EFFECT_WORKER_DISPATCHER_EXPORT = "__modern_create_effect_bff_dispatcher";
|
|
19
|
+
export declare const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = "Ensure the Effect API entry exists at api/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/plugin-bff/effect-edge instead of lambda/Hono server helpers.";
|
|
20
|
+
export declare const DEFAULT_COMPATIBILITY_DATE = "2026-06-02";
|
|
21
|
+
export declare const COMPATIBILITY_DATE_PATTERN: RegExp;
|
|
22
|
+
export declare const REQUIRED_COMPATIBILITY_FLAGS: readonly ["nodejs_compat", "global_fetch_strictly_public"];
|
|
23
|
+
export declare const RESERVED_ARTIFACT_DESTINATION_FILES: Set<string>;
|
|
24
|
+
export declare const RESERVED_ARTIFACT_DESTINATION_DIRECTORIES: Set<string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DeliveryUnitIdentity } from '@modern-js/utils/universal';
|
|
2
|
+
export type DeliveryUnitStamp = DeliveryUnitIdentity & {
|
|
3
|
+
surfaces: {
|
|
4
|
+
ui: DeliveryUnitIdentity & {
|
|
5
|
+
surface: 'ui';
|
|
6
|
+
};
|
|
7
|
+
api: DeliveryUnitIdentity & {
|
|
8
|
+
surface: 'api';
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Resolve the delivery-unit record declared for this app by the workspace
|
|
14
|
+
* compact config (`.modernjs/ultramodern.json`). This is the topology source
|
|
15
|
+
* of truth the Cloudflare worker snapshot is verified against.
|
|
16
|
+
*/
|
|
17
|
+
export declare const resolveTopologyDeliveryUnit: (appDirectory: string) => Promise<DeliveryUnitIdentity | undefined>;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve the delivery-unit identity actually bundled into the worker by
|
|
20
|
+
* parsing the generated `shared/ultramodern-build.ts` module. This is the
|
|
21
|
+
* worker snapshot / UI+API surface source that gets stamped into the manifest.
|
|
22
|
+
*/
|
|
23
|
+
export declare const resolveWorkerDeliveryUnitStamp: (appDirectory: string) => Promise<DeliveryUnitStamp | undefined>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CloudflareAppContext } from './types';
|
|
2
|
+
type WorkerI18nDetection = {
|
|
3
|
+
order: string[];
|
|
4
|
+
lookupQuerystring: string;
|
|
5
|
+
lookupCookie: string;
|
|
6
|
+
lookupHeader: string;
|
|
7
|
+
};
|
|
8
|
+
type WorkerI18nEntry = {
|
|
9
|
+
i18nextDetector: boolean;
|
|
10
|
+
languages: string[];
|
|
11
|
+
fallbackLanguage: string;
|
|
12
|
+
detection: WorkerI18nDetection;
|
|
13
|
+
ignoreRedirectRoutes: string[];
|
|
14
|
+
staticRoutePrefixes: string[];
|
|
15
|
+
localisedUrls?: Record<string, Record<string, string>>;
|
|
16
|
+
};
|
|
17
|
+
export declare const createI18nWorkerManifest: (routeSpec: {
|
|
18
|
+
routes: Array<Record<string, unknown>>;
|
|
19
|
+
}, appContext: CloudflareAppContext) => {
|
|
20
|
+
entries: Record<string, WorkerI18nEntry>;
|
|
21
|
+
} | undefined;
|
|
22
|
+
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CreatePreset } from '
|
|
1
|
+
import type { CreatePreset } from '../platform';
|
|
2
2
|
export declare const createCloudflarePreset: CreatePreset;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export declare const createCloudflareWorkerSecurityPolicy: (modernConfig: Parameters<CreatePreset>[0]['modernConfig']) => {
|
|
2
|
+
enabled: boolean;
|
|
3
|
+
cors: {
|
|
4
|
+
assets: boolean;
|
|
5
|
+
allowedOrigins: string[];
|
|
6
|
+
allowedMethods: string[];
|
|
7
|
+
allowedHeaders: string[];
|
|
8
|
+
reason: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
reason: any;
|
|
11
|
+
headers?: undefined;
|
|
12
|
+
contentSecurityPolicy?: undefined;
|
|
13
|
+
noindex?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
enabled: boolean;
|
|
16
|
+
headers: {
|
|
17
|
+
referrerPolicy: any;
|
|
18
|
+
contentTypeOptions: any;
|
|
19
|
+
permissionsPolicy: any;
|
|
20
|
+
};
|
|
21
|
+
contentSecurityPolicy: {
|
|
22
|
+
mode: "off";
|
|
23
|
+
directives: {};
|
|
24
|
+
reason: string | undefined;
|
|
25
|
+
} | {
|
|
26
|
+
mode: "enforce" | "report-only";
|
|
27
|
+
directives: {
|
|
28
|
+
[k: string]: string[];
|
|
29
|
+
};
|
|
30
|
+
reason: string | undefined;
|
|
31
|
+
};
|
|
32
|
+
noindex: {
|
|
33
|
+
workersDev: boolean;
|
|
34
|
+
localhost: boolean;
|
|
35
|
+
previewHostnames: never[];
|
|
36
|
+
reason?: undefined;
|
|
37
|
+
} | {
|
|
38
|
+
workersDev: boolean;
|
|
39
|
+
localhost: boolean;
|
|
40
|
+
previewHostnames: string[];
|
|
41
|
+
reason: string | undefined;
|
|
42
|
+
};
|
|
43
|
+
cors: {
|
|
44
|
+
assets: boolean;
|
|
45
|
+
allowedOrigins: string[];
|
|
46
|
+
allowedMethods: string[];
|
|
47
|
+
allowedHeaders: string[];
|
|
48
|
+
reason: string | undefined;
|
|
49
|
+
};
|
|
50
|
+
reason: any;
|
|
51
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CreatePreset } from '../platform';
|
|
2
|
+
type CloudflarePresetOptions = Parameters<CreatePreset>[0];
|
|
3
|
+
export type CloudflareAppContext = CloudflarePresetOptions['appContext'];
|
|
4
|
+
export type CloudflareModernConfig = CloudflarePresetOptions['modernConfig'];
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { JsonValue } from '../../../../types/config/deploy';
|
|
2
|
+
export declare const isRecord: (value: unknown) => value is Record<string, unknown>;
|
|
3
|
+
export declare const normalizeRelativePath: (value: unknown, label: string, scope?: string, options?: {
|
|
4
|
+
allowRoot?: boolean;
|
|
5
|
+
}) => string;
|
|
6
|
+
export declare const isJsonRecord: (value: unknown) => value is Record<string, JsonValue>;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import type { DeliveryUnitStamp } from './delivery-unit';
|
|
2
|
+
import type { CloudflareAppContext, CloudflareModernConfig } from './types';
|
|
3
|
+
export declare const createWorkerManifest: (outputDirectory: string, modernConfig: CloudflareModernConfig, appContext: CloudflareAppContext, deliveryUnitStamp: DeliveryUnitStamp | undefined) => Promise<{
|
|
4
|
+
version: number;
|
|
5
|
+
runtime: {
|
|
6
|
+
type: string;
|
|
7
|
+
entry: string;
|
|
8
|
+
fetchExport: boolean;
|
|
9
|
+
nodeListen: boolean;
|
|
10
|
+
};
|
|
11
|
+
assets: {
|
|
12
|
+
binding: string;
|
|
13
|
+
directory: string;
|
|
14
|
+
runWorkerFirst: boolean;
|
|
15
|
+
};
|
|
16
|
+
routeSpec: {
|
|
17
|
+
file: string;
|
|
18
|
+
routes: any[];
|
|
19
|
+
};
|
|
20
|
+
workerBundles: {
|
|
21
|
+
directory: string;
|
|
22
|
+
format: string;
|
|
23
|
+
importableFromModuleWorker: boolean;
|
|
24
|
+
requestHandlerExport: string;
|
|
25
|
+
};
|
|
26
|
+
resources: {
|
|
27
|
+
loadableStats: string;
|
|
28
|
+
routeManifest: string;
|
|
29
|
+
};
|
|
30
|
+
security: {
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
cors: {
|
|
33
|
+
assets: boolean;
|
|
34
|
+
allowedOrigins: string[];
|
|
35
|
+
allowedMethods: string[];
|
|
36
|
+
allowedHeaders: string[];
|
|
37
|
+
reason: string | undefined;
|
|
38
|
+
};
|
|
39
|
+
reason: any;
|
|
40
|
+
headers?: undefined;
|
|
41
|
+
contentSecurityPolicy?: undefined;
|
|
42
|
+
noindex?: undefined;
|
|
43
|
+
} | {
|
|
44
|
+
enabled: boolean;
|
|
45
|
+
headers: {
|
|
46
|
+
referrerPolicy: any;
|
|
47
|
+
contentTypeOptions: any;
|
|
48
|
+
permissionsPolicy: any;
|
|
49
|
+
};
|
|
50
|
+
contentSecurityPolicy: {
|
|
51
|
+
mode: "off";
|
|
52
|
+
directives: {};
|
|
53
|
+
reason: string | undefined;
|
|
54
|
+
} | {
|
|
55
|
+
mode: "enforce" | "report-only";
|
|
56
|
+
directives: {
|
|
57
|
+
[k: string]: string[];
|
|
58
|
+
};
|
|
59
|
+
reason: string | undefined;
|
|
60
|
+
};
|
|
61
|
+
noindex: {
|
|
62
|
+
workersDev: boolean;
|
|
63
|
+
localhost: boolean;
|
|
64
|
+
previewHostnames: never[];
|
|
65
|
+
reason?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
workersDev: boolean;
|
|
68
|
+
localhost: boolean;
|
|
69
|
+
previewHostnames: string[];
|
|
70
|
+
reason: string | undefined;
|
|
71
|
+
};
|
|
72
|
+
cors: {
|
|
73
|
+
assets: boolean;
|
|
74
|
+
allowedOrigins: string[];
|
|
75
|
+
allowedMethods: string[];
|
|
76
|
+
allowedHeaders: string[];
|
|
77
|
+
reason: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
reason: any;
|
|
80
|
+
};
|
|
81
|
+
moduleFederation?: {
|
|
82
|
+
name: string;
|
|
83
|
+
exposes: {
|
|
84
|
+
path: string;
|
|
85
|
+
css: string[];
|
|
86
|
+
}[];
|
|
87
|
+
} | undefined;
|
|
88
|
+
deliveryUnit?: DeliveryUnitStamp | undefined;
|
|
89
|
+
i18n: {
|
|
90
|
+
entries: Record<string, {
|
|
91
|
+
i18nextDetector: boolean;
|
|
92
|
+
languages: string[];
|
|
93
|
+
fallbackLanguage: string;
|
|
94
|
+
detection: {
|
|
95
|
+
order: string[];
|
|
96
|
+
lookupQuerystring: string;
|
|
97
|
+
lookupCookie: string;
|
|
98
|
+
lookupHeader: string;
|
|
99
|
+
};
|
|
100
|
+
ignoreRedirectRoutes: string[];
|
|
101
|
+
staticRoutePrefixes: string[];
|
|
102
|
+
localisedUrls?: Record<string, Record<string, string>>;
|
|
103
|
+
}>;
|
|
104
|
+
} | undefined;
|
|
105
|
+
bff: {
|
|
106
|
+
dispatcherExport: string;
|
|
107
|
+
runtimeFramework: string;
|
|
108
|
+
prefix: string;
|
|
109
|
+
worker: string;
|
|
110
|
+
} | undefined;
|
|
111
|
+
serviceBindings?: {
|
|
112
|
+
binding: any;
|
|
113
|
+
service: any;
|
|
114
|
+
interface: string;
|
|
115
|
+
prefix?: any;
|
|
116
|
+
fragments?: any;
|
|
117
|
+
}[] | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
export declare const createWorkerModuleLoaders: (manifest: any) => string;
|
|
120
|
+
export declare const getPublicAssetExcludes: (appDirectory: string, modernConfig: CloudflareModernConfig) => string[];
|
|
121
|
+
export declare const shouldCopyToPublicAssets: (src: string, distDirectory: string, publicAssetExcludes: string[]) => boolean;
|
|
122
|
+
export declare const shouldCopyToWorkerBundle: (src: string, workerBundleDirectory: string) => boolean;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { JsonValue } from '../../../../types/config/deploy';
|
|
2
|
+
import type { CloudflareModernConfig } from './types';
|
|
3
|
+
export declare const createWorkerServiceBindings: (modernConfig: CloudflareModernConfig, configuredWranglerServices: JsonValue | undefined) => {
|
|
4
|
+
binding: string;
|
|
5
|
+
service: string;
|
|
6
|
+
prefix?: string | undefined;
|
|
7
|
+
fragments?: {
|
|
8
|
+
remote: string;
|
|
9
|
+
expose: string;
|
|
10
|
+
boundaryId: string;
|
|
11
|
+
path: string;
|
|
12
|
+
}[] | undefined;
|
|
13
|
+
}[] | JsonValue | undefined;
|
|
14
|
+
export declare const createWorkerManifestServiceBindings: (serviceBindings: ReturnType<typeof createWorkerServiceBindings>) => {
|
|
15
|
+
binding: any;
|
|
16
|
+
service: any;
|
|
17
|
+
interface: string;
|
|
18
|
+
prefix?: any;
|
|
19
|
+
fragments?: any;
|
|
20
|
+
}[] | undefined;
|
|
21
|
+
export declare const createWranglerConfig: (appDirectory: string, modernConfig: CloudflareModernConfig) => {
|
|
22
|
+
$schema: string;
|
|
23
|
+
name: string;
|
|
24
|
+
compatibility_date: string;
|
|
25
|
+
main: string;
|
|
26
|
+
compatibility_flags: JsonValue[];
|
|
27
|
+
assets: {
|
|
28
|
+
directory: string;
|
|
29
|
+
binding: string;
|
|
30
|
+
run_worker_first: boolean;
|
|
31
|
+
};
|
|
32
|
+
d1_databases?: {
|
|
33
|
+
binding: string;
|
|
34
|
+
database_name: string;
|
|
35
|
+
database_id: string;
|
|
36
|
+
migrations_dir?: string | undefined;
|
|
37
|
+
preview_database_id?: string | undefined;
|
|
38
|
+
remote?: boolean | undefined;
|
|
39
|
+
}[] | JsonValue | undefined;
|
|
40
|
+
services?: string | number | boolean | JsonValue[] | {
|
|
41
|
+
binding: string;
|
|
42
|
+
service: string;
|
|
43
|
+
}[] | {
|
|
44
|
+
[key: string]: JsonValue;
|
|
45
|
+
} | null | undefined;
|
|
46
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CLOUDFLARE_WORKER_ENTRY = "server/index.mjs";
|
|
2
|
+
export declare const CLOUDFLARE_WORKER_MANIFEST = "server/modern-worker-manifest.json";
|
|
3
|
+
export declare const CLOUDFLARE_WRANGLER_CONFIG_FILE = "wrangler.json";
|
|
4
|
+
export declare const CLOUDFLARE_OUTPUT_PACKAGE_FILE = "package.json";
|
|
5
|
+
export declare const CLOUDFLARE_WORKER_PACKAGE_FILE = "worker/package.json";
|
|
6
|
+
export declare const CLOUDFLARE_ASSETS_BINDING = "ASSETS";
|
|
7
|
+
export declare const CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY = "public";
|
|
8
|
+
export declare const CLOUDFLARE_WORKER_BUNDLE_DIRECTORY = "worker";
|
|
9
|
+
export declare const CLOUDFLARE_RUNTIME_TYPE = "cloudflare-module-worker";
|
|
10
|
+
export declare const CLOUDFLARE_OUTPUT_PACKAGE_TYPE = "module";
|
|
11
|
+
export declare const CLOUDFLARE_WORKER_PACKAGE_TYPE = "commonjs";
|
|
12
|
+
export declare const CLOUDFLARE_WORKER_BUNDLE_FORMAT = "commonjs";
|
|
13
|
+
export declare const CLOUDFLARE_WORKER_NODE_BUILTINS: readonly ['async_hooks', 'buffer', 'crypto', 'events', 'fs/promises', 'module', 'path', 'process', 'stream', 'string_decoder', 'url', 'util'];
|
|
14
|
+
export declare const CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS: readonly ['nodejs_compat', 'global_fetch_strictly_public'];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CLOUDFLARE_ASSETS_BINDING, CLOUDFLARE_OUTPUT_PACKAGE_TYPE, CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY, CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS, CLOUDFLARE_WORKER_ENTRY, CLOUDFLARE_WORKER_PACKAGE_TYPE } from './cloudflare-output-contract';
|
|
2
|
+
type CloudflareOutputPlan = {
|
|
3
|
+
outputDirectory: string;
|
|
4
|
+
requiredFiles: string[];
|
|
5
|
+
publicLeakDirectories: string[];
|
|
6
|
+
paths: {
|
|
7
|
+
workerEntry: string;
|
|
8
|
+
workerManifest: string;
|
|
9
|
+
wranglerConfig: string;
|
|
10
|
+
outputPackage: string;
|
|
11
|
+
workerPackage: string;
|
|
12
|
+
publicAssets: string;
|
|
13
|
+
workerBundle: string;
|
|
14
|
+
};
|
|
15
|
+
packages: {
|
|
16
|
+
output: {
|
|
17
|
+
type: typeof CLOUDFLARE_OUTPUT_PACKAGE_TYPE;
|
|
18
|
+
};
|
|
19
|
+
worker: {
|
|
20
|
+
type: typeof CLOUDFLARE_WORKER_PACKAGE_TYPE;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
wrangler: {
|
|
24
|
+
main: typeof CLOUDFLARE_WORKER_ENTRY;
|
|
25
|
+
assets: {
|
|
26
|
+
binding: typeof CLOUDFLARE_ASSETS_BINDING;
|
|
27
|
+
directory: `./${typeof CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY}`;
|
|
28
|
+
run_worker_first: true;
|
|
29
|
+
};
|
|
30
|
+
requiredCompatibilityFlags: typeof CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export declare function createCloudflareOutputPlan(outputDirectory: string): CloudflareOutputPlan;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type DeliveryUnitIdentity } from '@modern-js/utils/universal';
|
|
2
|
+
import type { CloudflareOutputVerifierIssue, JsonObject } from './issues';
|
|
3
|
+
export type CloudflareDeliveryUnitIdentity = DeliveryUnitIdentity;
|
|
4
|
+
export declare const verifyDeliveryUnitIdentity: (issues: CloudflareOutputVerifierIssue[], manifest: JsonObject, manifestPath: string, declared: CloudflareDeliveryUnitIdentity | undefined) => void;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CloudflareDeliveryUnitIdentity } from './identity';
|
|
2
|
+
import type { CloudflareOutputVerifierResult } from './issues';
|
|
3
|
+
export type { CloudflareDeliveryUnitIdentity } from './identity';
|
|
4
|
+
export type { CloudflareOutputVerifierIssue, CloudflareOutputVerifierIssueCode, CloudflareOutputVerifierResult, } from './issues';
|
|
5
|
+
export { type VerifyCloudflareOutputMutationPolicyOptions, verifyCloudflareOutputMutationPolicy, } from './mutation-policy';
|
|
6
|
+
export interface VerifyCloudflareOutputOptions {
|
|
7
|
+
outputDirectory: string;
|
|
8
|
+
importWorker?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Topology-declared delivery-unit record (from the workspace compact config).
|
|
11
|
+
* When provided, the Cloudflare worker manifest must carry a matching
|
|
12
|
+
* `deliveryUnit` stamp so the deployed worker snapshot is proven to derive
|
|
13
|
+
* from the same delivery unit as the Node/API surfaces (ADR-0019 lane D).
|
|
14
|
+
*/
|
|
15
|
+
deliveryUnit?: CloudflareDeliveryUnitIdentity;
|
|
16
|
+
}
|
|
17
|
+
export declare const verifyCloudflareOutput: (options: VerifyCloudflareOutputOptions) => Promise<CloudflareOutputVerifierResult>;
|
|
18
|
+
export declare const assertCloudflareOutput: (options: VerifyCloudflareOutputOptions) => Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type CloudflareOutputVerifierIssueCode = 'missing-file' | 'invalid-manifest' | 'invalid-wrangler' | 'invalid-package' | 'public-output-leak' | 'missing-worker-bundle' | 'invalid-worker-bundle' | 'worker-import-failed' | 'delivery-unit-drift' | 'missing-delivery-unit' | 'forbidden-mutation-pattern';
|
|
2
|
+
export interface CloudflareOutputVerifierIssue {
|
|
3
|
+
code: CloudflareOutputVerifierIssueCode;
|
|
4
|
+
message: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface CloudflareOutputVerifierResult {
|
|
8
|
+
ok: boolean;
|
|
9
|
+
issues: CloudflareOutputVerifierIssue[];
|
|
10
|
+
}
|
|
11
|
+
export type JsonObject = Record<string, any>;
|
|
12
|
+
export declare const addIssue: (issues: CloudflareOutputVerifierIssue[], issue: CloudflareOutputVerifierIssue) => void;
|
|
13
|
+
export declare const assertEqual: (issues: CloudflareOutputVerifierIssue[], actual: unknown, expected: unknown, issue: CloudflareOutputVerifierIssue) => void;
|
|
14
|
+
export declare const assertFlag: (issues: CloudflareOutputVerifierIssue[], flags: unknown, flag: string, issue: CloudflareOutputVerifierIssue) => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CloudflareOutputVerifierResult } from './issues';
|
|
2
|
+
export interface VerifyCloudflareOutputMutationPolicyOptions {
|
|
3
|
+
scanRoots: string[];
|
|
4
|
+
/**
|
|
5
|
+
* Absolute paths of framework-generated proof artifacts (e.g. the immutable
|
|
6
|
+
* workspace validation contract) that record generated-output path literals
|
|
7
|
+
* as contract data and never rewrite build output. These are exempt from the
|
|
8
|
+
* app-script mutation scan; every app-author script under the scan roots is
|
|
9
|
+
* still checked.
|
|
10
|
+
*/
|
|
11
|
+
excludePaths?: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const walkFiles: (root: string) => Promise<string[]>;
|
|
14
|
+
export declare const verifyCloudflareOutputMutationPolicy: (options: VerifyCloudflareOutputMutationPolicyOptions) => Promise<CloudflareOutputVerifierResult>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CloudflareOutputVerifierIssue, JsonObject } from './issues';
|
|
2
|
+
interface WorkerBundleReference {
|
|
3
|
+
dispatcherExport?: string;
|
|
4
|
+
kind: 'effect-bff' | 'route';
|
|
5
|
+
reference: string;
|
|
6
|
+
}
|
|
7
|
+
interface ResolvedWorkerBundleReference extends WorkerBundleReference {
|
|
8
|
+
path: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const getEffectBffWorker: (manifest: JsonObject) => any;
|
|
11
|
+
export declare const getWorkerBundleReferences: (manifest: JsonObject) => WorkerBundleReference[];
|
|
12
|
+
export declare const resolveWorkerBundleReference: (issues: CloudflareOutputVerifierIssue[], outputDirectory: string, reference: WorkerBundleReference, manifestPath: string) => ResolvedWorkerBundleReference | null;
|
|
13
|
+
export declare const missingWorkerBundleMessage: (reference: WorkerBundleReference) => "Cloudflare Effect BFF manifest points to a missing worker bundle." | "Cloudflare route worker manifest points to a missing worker bundle.";
|
|
14
|
+
interface WorkerBundleVerificationContract {
|
|
15
|
+
providedPackages: ReadonlySet<string>;
|
|
16
|
+
workerRoot: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const verifyWorkerBundleReferences: (issues: CloudflareOutputVerifierIssue[], worker: ResolvedWorkerBundleReference, source: string, contract: WorkerBundleVerificationContract) => Promise<void>;
|
|
19
|
+
export declare const verifyWorkerImport: (issues: CloudflareOutputVerifierIssue[], entryPath: string) => Promise<void>;
|
|
20
|
+
export {};
|
package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type NpmAlias = {
|
|
2
|
+
aliasName: string;
|
|
3
|
+
targetName: string;
|
|
4
|
+
targetVersion: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function readPackageIdentity(entryPath: string): Promise<{
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function preserveNpmAliases({ appDirectory, outputDirectory, implicitAliases, }: {
|
|
11
|
+
appDirectory: string;
|
|
12
|
+
outputDirectory: string;
|
|
13
|
+
implicitAliases?: NpmAlias[];
|
|
14
|
+
}): Promise<void>;
|
|
@@ -5,6 +5,16 @@ export interface PresetUltramodernOptions {
|
|
|
5
5
|
* @default "app"
|
|
6
6
|
*/
|
|
7
7
|
appId?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Generation-time identity root for a generated delivery unit. When set, the
|
|
10
|
+
* preset derives one build identity from the immutable source revision and
|
|
11
|
+
* injects it into every browser, SSR, API, and backend bundle.
|
|
12
|
+
*/
|
|
13
|
+
deliveryUnit?: {
|
|
14
|
+
buildMarker: string;
|
|
15
|
+
unitId: string;
|
|
16
|
+
version: string;
|
|
17
|
+
};
|
|
8
18
|
/**
|
|
9
19
|
* Enable BFF requestId contract by default.
|
|
10
20
|
* @default true
|
|
@@ -12,7 +12,7 @@ export interface RunOptions {
|
|
|
12
12
|
export declare function createRunOptions({ cwd, initialLog, metaName, version, internalPlugins, configFile, }: RunOptions): Promise<{
|
|
13
13
|
cwd: string | undefined;
|
|
14
14
|
initialLog: string;
|
|
15
|
-
configFile:
|
|
15
|
+
configFile: any;
|
|
16
16
|
metaName: string;
|
|
17
17
|
internalPlugins: import("@modern-js/plugin").Plugin[];
|
|
18
18
|
handleSetupResult: typeof handleSetupResult;
|