@bleedingdev/modern-js-app-tools-extensions 3.9.0-ultramodern.2 → 3.9.0-ultramodern.21
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/dist/cjs/backend-federation-build/codegen.js +267 -0
- package/dist/cjs/backend-federation-build/config.js +239 -0
- package/dist/cjs/backend-federation-build/emit.js +154 -0
- package/dist/cjs/backend-federation-build/index.js +53 -0
- package/dist/cjs/build-config/build-environment.js +129 -0
- package/dist/cjs/build-config/precompress/plugin.js +124 -0
- package/dist/cjs/build-config/precompress/types.js +18 -0
- package/dist/cjs/build-config/public.js +43 -0
- package/dist/cjs/build-config/remote-address.js +58 -0
- package/dist/cjs/cloudflare/artifacts.js +8 -19
- package/dist/cjs/cloudflare/constants.js +1 -1
- package/dist/cjs/cloudflare/delivery-unit.js +23 -42
- package/dist/cjs/cloudflare/index.js +10 -2
- package/dist/cjs/cloudflare/worker-manifest.js +13 -4
- package/dist/cjs/cloudflare/wrangler-config.js +35 -7
- package/dist/cjs/cloudflare-builder.js +252 -75
- package/dist/cjs/cloudflare-output-contract.js +69 -3
- package/dist/cjs/cloudflare-output-verifier/identity.js +29 -27
- package/dist/cjs/cloudflare-output-verifier/index.js +10 -0
- package/dist/cjs/cloudflare-output-verifier/manifest.js +46 -0
- package/dist/cjs/cloudflare-output-verifier/mutation-policy.js +7 -1
- package/dist/cjs/cloudflare-output-verifier/worker-bundles.js +14 -6
- package/dist/cjs/config.js +34 -1
- package/dist/cjs/deploy-output/npmAliases.js +251 -0
- package/dist/cjs/deploy-output/plugin.js +97 -0
- package/dist/cjs/deploy-output/public-assets.js +146 -0
- package/dist/cjs/deploy-output/target.js +104 -0
- package/dist/cjs/deploy-output/trace-files.js +90 -0
- package/dist/cjs/native-type-checker.js +193 -0
- package/dist/cjs/policy-defaults.js +101 -0
- package/dist/cjs/release-envelope/framework-output.js +153 -79
- package/dist/cjs/release-envelope/index.js +10 -4
- package/dist/cjs/release-envelope/plugin.js +18 -13
- package/dist/cjs/release-identity.js +5 -6
- package/dist/cjs/runtime-package-resolution.js +118 -0
- package/dist/cjs/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -3
- package/dist/cjs/templates/cloudflare-entry.002-assets-routes.mjs +1 -1
- package/dist/cjs/templates/cloudflare-entry.004-rendering-css.mjs +5 -1
- package/dist/cjs/templates/cloudflare-entry.005-worker-dispatch.mjs +98 -10
- package/dist/cjs/templates/cloudflare-entry.006-fetch-handler.mjs +9 -2
- package/dist/cjs/templates/cloudflare-worker-route-data.mjs +1069 -0
- package/dist/esm/backend-federation-build/codegen.mjs +216 -0
- package/dist/esm/backend-federation-build/config.mjs +163 -0
- package/dist/esm/backend-federation-build/emit.mjs +103 -0
- package/dist/esm/backend-federation-build/index.mjs +1 -0
- package/dist/esm/build-config/build-environment.mjs +88 -0
- package/dist/esm/build-config/precompress/plugin.mjs +76 -0
- package/dist/esm/build-config/precompress/types.mjs +0 -0
- package/dist/esm/build-config/public.mjs +1 -0
- package/dist/esm/build-config/remote-address.mjs +20 -0
- package/dist/esm/cloudflare/artifacts.mjs +8 -19
- package/dist/esm/cloudflare/constants.mjs +1 -1
- package/dist/esm/cloudflare/delivery-unit.mjs +17 -36
- package/dist/esm/cloudflare/index.mjs +10 -2
- package/dist/esm/cloudflare/worker-manifest.mjs +13 -4
- package/dist/esm/cloudflare/wrangler-config.mjs +35 -7
- package/dist/esm/cloudflare-builder.mjs +246 -75
- package/dist/esm/cloudflare-output-contract.mjs +59 -2
- package/dist/esm/cloudflare-output-verifier/identity.mjs +27 -25
- package/dist/esm/cloudflare-output-verifier/index.mjs +10 -0
- package/dist/esm/cloudflare-output-verifier/manifest.mjs +46 -0
- package/dist/esm/cloudflare-output-verifier/mutation-policy.mjs +7 -1
- package/dist/esm/cloudflare-output-verifier/worker-bundles.mjs +15 -7
- package/dist/esm/config.mjs +3 -0
- package/dist/esm/deploy-output/npmAliases.mjs +199 -0
- package/dist/esm/deploy-output/plugin.mjs +46 -0
- package/dist/esm/deploy-output/public-assets.mjs +82 -0
- package/dist/esm/deploy-output/target.mjs +57 -0
- package/dist/esm/deploy-output/trace-files.mjs +38 -0
- package/dist/esm/native-type-checker.mjs +142 -0
- package/dist/esm/policy-defaults.mjs +45 -0
- package/dist/esm/release-envelope/framework-output.mjs +130 -56
- package/dist/esm/release-envelope/index.mjs +10 -4
- package/dist/esm/release-envelope/plugin.mjs +18 -13
- package/dist/esm/release-identity.mjs +5 -6
- package/dist/esm/runtime-package-resolution.mjs +60 -0
- package/dist/esm/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -3
- package/dist/esm/templates/cloudflare-entry.002-assets-routes.mjs +1 -1
- package/dist/esm/templates/cloudflare-entry.004-rendering-css.mjs +5 -1
- package/dist/esm/templates/cloudflare-entry.005-worker-dispatch.mjs +98 -10
- package/dist/esm/templates/cloudflare-entry.006-fetch-handler.mjs +9 -2
- package/dist/esm/templates/cloudflare-worker-route-data.mjs +1069 -0
- package/dist/esm-node/backend-federation-build/codegen.mjs +217 -0
- package/dist/esm-node/backend-federation-build/config.mjs +164 -0
- package/dist/esm-node/backend-federation-build/emit.mjs +104 -0
- package/dist/esm-node/backend-federation-build/index.mjs +2 -0
- package/dist/esm-node/build-config/build-environment.mjs +89 -0
- package/dist/esm-node/build-config/precompress/plugin.mjs +77 -0
- package/dist/esm-node/build-config/precompress/types.mjs +1 -0
- package/dist/esm-node/build-config/public.mjs +2 -0
- package/dist/esm-node/build-config/remote-address.mjs +21 -0
- package/dist/esm-node/cloudflare/artifacts.mjs +8 -19
- package/dist/esm-node/cloudflare/constants.mjs +1 -1
- package/dist/esm-node/cloudflare/delivery-unit.mjs +17 -36
- package/dist/esm-node/cloudflare/index.mjs +10 -2
- package/dist/esm-node/cloudflare/worker-manifest.mjs +13 -4
- package/dist/esm-node/cloudflare/wrangler-config.mjs +35 -7
- package/dist/esm-node/cloudflare-builder.mjs +246 -75
- package/dist/esm-node/cloudflare-output-contract.mjs +59 -2
- package/dist/esm-node/cloudflare-output-verifier/identity.mjs +27 -25
- package/dist/esm-node/cloudflare-output-verifier/index.mjs +10 -0
- package/dist/esm-node/cloudflare-output-verifier/manifest.mjs +46 -0
- package/dist/esm-node/cloudflare-output-verifier/mutation-policy.mjs +7 -1
- package/dist/esm-node/cloudflare-output-verifier/worker-bundles.mjs +15 -7
- package/dist/esm-node/config.mjs +3 -0
- package/dist/esm-node/deploy-output/npmAliases.mjs +200 -0
- package/dist/esm-node/deploy-output/plugin.mjs +49 -0
- package/dist/esm-node/deploy-output/public-assets.mjs +83 -0
- package/dist/esm-node/deploy-output/target.mjs +58 -0
- package/dist/esm-node/deploy-output/trace-files.mjs +39 -0
- package/dist/esm-node/native-type-checker.mjs +143 -0
- package/dist/esm-node/policy-defaults.mjs +46 -0
- package/dist/esm-node/release-envelope/framework-output.mjs +130 -56
- package/dist/esm-node/release-envelope/index.mjs +10 -4
- package/dist/esm-node/release-envelope/plugin.mjs +18 -13
- package/dist/esm-node/release-identity.mjs +5 -6
- package/dist/esm-node/runtime-package-resolution.mjs +61 -0
- package/dist/esm-node/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -3
- package/dist/esm-node/templates/cloudflare-entry.002-assets-routes.mjs +1 -1
- package/dist/esm-node/templates/cloudflare-entry.004-rendering-css.mjs +5 -1
- package/dist/esm-node/templates/cloudflare-entry.005-worker-dispatch.mjs +98 -10
- package/dist/esm-node/templates/cloudflare-entry.006-fetch-handler.mjs +9 -2
- package/dist/esm-node/templates/cloudflare-worker-route-data.mjs +1069 -0
- package/dist/types/backend-federation-build/codegen.d.ts +116 -0
- package/dist/types/backend-federation-build/config.d.ts +121 -0
- package/dist/types/backend-federation-build/emit.d.ts +21 -0
- package/dist/types/backend-federation-build/index.d.ts +2 -0
- package/dist/types/build-config/build-environment.d.ts +14 -0
- package/dist/types/build-config/precompress/plugin.d.ts +4 -0
- package/dist/types/build-config/precompress/types.d.ts +19 -0
- package/dist/types/build-config/public.d.ts +2 -0
- package/dist/types/build-config/remote-address.d.ts +3 -0
- package/dist/types/cloudflare/artifacts.d.ts +7 -6
- package/dist/types/cloudflare/constants.d.ts +1 -1
- package/dist/types/cloudflare/delivery-unit.d.ts +3 -3
- package/dist/types/cloudflare/worker-manifest.d.ts +2 -2
- package/dist/types/cloudflare/wrangler-config.d.ts +6 -0
- package/dist/types/cloudflare-builder.d.ts +49 -9
- package/dist/types/cloudflare-output-contract.d.ts +4 -1
- package/dist/types/cloudflare-output-verifier/identity.d.ts +1 -1
- package/dist/types/cloudflare-output-verifier/worker-bundles.d.ts +2 -2
- package/dist/types/config.d.ts +29 -1
- package/dist/types/deploy-output/npmAliases.d.ts +14 -0
- package/dist/types/deploy-output/plugin.d.ts +35 -0
- package/dist/types/deploy-output/public-assets.d.ts +51 -0
- package/dist/types/deploy-output/target.d.ts +29 -0
- package/dist/types/deploy-output/trace-files.d.ts +17 -0
- package/dist/types/native-type-checker.d.ts +15 -0
- package/dist/types/policy-defaults.d.ts +46 -0
- package/dist/types/precompress/LICENSE +20 -0
- package/dist/types/precompress/index.d.ts +76 -0
- package/dist/types/release-envelope/framework-output.d.ts +8 -3
- package/dist/types/release-envelope/plugin.d.ts +7 -7
- package/dist/types/runtime-package-resolution.d.ts +28 -0
- package/dist/types/templates/cloudflare-worker-route-data.d.mts +14 -0
- package/package.json +97 -15
- package/src/backend-federation-build/codegen.ts +254 -0
- package/src/backend-federation-build/config.ts +492 -0
- package/src/backend-federation-build/emit.ts +213 -0
- package/src/backend-federation-build/index.ts +2 -0
- package/src/build-config/build-environment.ts +160 -0
- package/src/build-config/precompress/plugin.ts +140 -0
- package/src/build-config/precompress/types.ts +26 -0
- package/src/build-config/public.ts +5 -0
- package/src/build-config/remote-address.ts +33 -0
- package/src/cloudflare/artifacts.ts +22 -43
- package/src/cloudflare/constants.ts +1 -1
- package/src/cloudflare/delivery-unit.ts +42 -53
- package/src/cloudflare/index.ts +24 -11
- package/src/cloudflare/worker-manifest.ts +20 -3
- package/src/cloudflare/wrangler-config.ts +86 -10
- package/src/cloudflare-builder.ts +475 -151
- package/src/cloudflare-output-contract.ts +70 -0
- package/src/cloudflare-output-verifier/identity.ts +5 -1
- package/src/cloudflare-output-verifier/index.ts +20 -0
- package/src/cloudflare-output-verifier/manifest.ts +77 -0
- package/src/cloudflare-output-verifier/mutation-policy.ts +11 -1
- package/src/cloudflare-output-verifier/worker-bundles.ts +32 -14
- package/src/config.ts +34 -6
- package/src/deploy-output/npmAliases.ts +382 -0
- package/src/deploy-output/plugin.ts +86 -0
- package/src/deploy-output/public-assets.ts +224 -0
- package/src/deploy-output/target.ts +106 -0
- package/src/deploy-output/trace-files.ts +67 -0
- package/src/native-type-checker.ts +183 -0
- package/src/policy-defaults.ts +127 -0
- package/src/release-envelope/framework-output.ts +346 -94
- package/src/release-envelope/index.ts +26 -5
- package/src/release-envelope/plugin.ts +43 -40
- package/src/release-identity.ts +13 -2
- package/src/runtime-package-resolution.ts +115 -0
- package/src/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -3
- package/src/templates/cloudflare-entry.002-assets-routes.mjs +1 -1
- package/src/templates/cloudflare-entry.004-rendering-css.mjs +5 -1
- package/src/templates/cloudflare-entry.005-worker-dispatch.mjs +98 -10
- package/src/templates/cloudflare-entry.006-fetch-handler.mjs +9 -2
- package/src/templates/cloudflare-worker-route-data.mjs +1069 -0
- package/dist/cjs/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/cjs/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/cjs/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/cjs/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/esm/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/esm/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/esm/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/esm/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/esm-node/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/esm-node/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/esm-node/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/esm-node/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/types/templates/cloudflare-worker-fs-promises.d.mts +0 -5
- package/dist/types/templates/cloudflare-worker-loadable-server.d.mts +0 -48
- package/dist/types/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +0 -13
- package/dist/types/templates/cloudflare-worker-path.d.mts +0 -21
- package/src/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/src/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/src/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/src/templates/cloudflare-worker-path.mjs +0 -98
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { BackendFederationEntryIntegrity } from '@modern-js/server-runtime-extensions/backend-federation-security';
|
|
2
|
+
import { type BackendFederationApp } from './config.js';
|
|
3
|
+
export declare const createBackendRemoteEntrySource: (workspaceRoot: string, app: BackendFederationApp, effectApiPath: string, entryPath: string) => Promise<string>;
|
|
4
|
+
export declare const createBackendManifest: (workspaceRoot: string, distDirectory: string, app: BackendFederationApp, entryIntegrity: BackendFederationEntryIntegrity) => {
|
|
5
|
+
schemaVersion: number;
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
version: string | undefined;
|
|
9
|
+
buildVersion: string | undefined;
|
|
10
|
+
metaData: {
|
|
11
|
+
name: string;
|
|
12
|
+
type: string;
|
|
13
|
+
buildInfo: {
|
|
14
|
+
buildVersion: string | undefined;
|
|
15
|
+
buildName: string | undefined;
|
|
16
|
+
};
|
|
17
|
+
remoteEntry: {
|
|
18
|
+
name: string;
|
|
19
|
+
path: string;
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
globalName: string;
|
|
23
|
+
publicPath: string;
|
|
24
|
+
ssrRemoteEntry: {
|
|
25
|
+
name: string;
|
|
26
|
+
path: string;
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
ssrPublicPath: string;
|
|
30
|
+
};
|
|
31
|
+
entry: {
|
|
32
|
+
byteLength: number;
|
|
33
|
+
sha256: string;
|
|
34
|
+
file: string;
|
|
35
|
+
path: string;
|
|
36
|
+
type: string;
|
|
37
|
+
url: string;
|
|
38
|
+
};
|
|
39
|
+
exposes: {
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
path: string;
|
|
43
|
+
assets: {
|
|
44
|
+
js: {
|
|
45
|
+
async: never[];
|
|
46
|
+
sync: string[];
|
|
47
|
+
};
|
|
48
|
+
css: {
|
|
49
|
+
async: never[];
|
|
50
|
+
sync: never[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}[];
|
|
54
|
+
shared: never[];
|
|
55
|
+
backendFederation: {
|
|
56
|
+
role: string;
|
|
57
|
+
appId: string;
|
|
58
|
+
name: string;
|
|
59
|
+
runtimeFramework: string;
|
|
60
|
+
strictEffectApproach: boolean;
|
|
61
|
+
contractVersion: string;
|
|
62
|
+
nodeAdapterVersion: string;
|
|
63
|
+
remoteType: string;
|
|
64
|
+
expose: string;
|
|
65
|
+
manifestUrl: string;
|
|
66
|
+
containerEntry: string;
|
|
67
|
+
source: {
|
|
68
|
+
module: string;
|
|
69
|
+
};
|
|
70
|
+
rpcPath: string | undefined;
|
|
71
|
+
rpcSerialization: string;
|
|
72
|
+
deliveryUnit?: import("@modern-js/backend-federation-contracts").DeliveryUnitContractBlock | undefined;
|
|
73
|
+
versionBoundary: {
|
|
74
|
+
invariant: string;
|
|
75
|
+
packageName: string | undefined;
|
|
76
|
+
version: string | undefined;
|
|
77
|
+
buildVersion: string | undefined;
|
|
78
|
+
uiManifestUrl?: string | undefined;
|
|
79
|
+
deliveryUnit?: {
|
|
80
|
+
unitId: string;
|
|
81
|
+
buildMarker: string;
|
|
82
|
+
sourceRevision: string;
|
|
83
|
+
} | undefined;
|
|
84
|
+
};
|
|
85
|
+
} | {
|
|
86
|
+
role: string;
|
|
87
|
+
appId: string;
|
|
88
|
+
name: string;
|
|
89
|
+
runtimeFramework: string;
|
|
90
|
+
strictEffectApproach: boolean;
|
|
91
|
+
contractVersion: string;
|
|
92
|
+
nodeAdapterVersion: string;
|
|
93
|
+
remoteType: string;
|
|
94
|
+
expose: string;
|
|
95
|
+
manifestUrl: string;
|
|
96
|
+
containerEntry: string;
|
|
97
|
+
source: {
|
|
98
|
+
module: string;
|
|
99
|
+
};
|
|
100
|
+
readinessPath: string;
|
|
101
|
+
openapiPath: string;
|
|
102
|
+
deliveryUnit?: import("@modern-js/backend-federation-contracts").DeliveryUnitContractBlock | undefined;
|
|
103
|
+
versionBoundary: {
|
|
104
|
+
invariant: string;
|
|
105
|
+
packageName: string | undefined;
|
|
106
|
+
version: string | undefined;
|
|
107
|
+
buildVersion: string | undefined;
|
|
108
|
+
uiManifestUrl?: string | undefined;
|
|
109
|
+
deliveryUnit?: {
|
|
110
|
+
unitId: string;
|
|
111
|
+
buildMarker: string;
|
|
112
|
+
sourceRevision: string;
|
|
113
|
+
} | undefined;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { type DeliveryUnitContractBlock, type UltramodernBuildArtifact } from '@modern-js/backend-federation-contracts';
|
|
2
|
+
export declare const REFERENCE_TOPOLOGY_PATH = "topology/reference-topology.json";
|
|
3
|
+
export declare const DEVELOPMENT_OVERLAY_PATH = "topology/local-overlays/development.json";
|
|
4
|
+
export type TopologyApp = {
|
|
5
|
+
id?: unknown;
|
|
6
|
+
domain?: unknown;
|
|
7
|
+
kind?: unknown;
|
|
8
|
+
path?: unknown;
|
|
9
|
+
package?: unknown;
|
|
10
|
+
portEnv?: unknown;
|
|
11
|
+
cloudflare?: {
|
|
12
|
+
publicUrlEnv?: unknown;
|
|
13
|
+
};
|
|
14
|
+
api?: {
|
|
15
|
+
bff?: {
|
|
16
|
+
prefix?: unknown;
|
|
17
|
+
};
|
|
18
|
+
protocol?: unknown;
|
|
19
|
+
rpcPath?: unknown;
|
|
20
|
+
rpcSerialization?: unknown;
|
|
21
|
+
stem?: unknown;
|
|
22
|
+
};
|
|
23
|
+
moduleFederation?: {
|
|
24
|
+
name?: unknown;
|
|
25
|
+
manifestUrl?: unknown;
|
|
26
|
+
};
|
|
27
|
+
backendFederation?: {
|
|
28
|
+
name?: unknown;
|
|
29
|
+
versionBoundary?: {
|
|
30
|
+
ui?: {
|
|
31
|
+
manifestUrl?: unknown;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
executionSurfaces?: {
|
|
35
|
+
node?: {
|
|
36
|
+
remoteName?: unknown;
|
|
37
|
+
manifestUrl?: unknown;
|
|
38
|
+
containerEntry?: unknown;
|
|
39
|
+
remoteType?: unknown;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
deliveryUnit?: {
|
|
44
|
+
unitId?: unknown;
|
|
45
|
+
buildMarker?: unknown;
|
|
46
|
+
sourceRevision?: unknown;
|
|
47
|
+
packageName?: unknown;
|
|
48
|
+
version?: unknown;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
export type DevelopmentOverlay = {
|
|
52
|
+
ports?: Record<string, unknown>;
|
|
53
|
+
manifests?: Record<string, unknown>;
|
|
54
|
+
serverExecution?: Record<string, {
|
|
55
|
+
node?: {
|
|
56
|
+
remoteName?: unknown;
|
|
57
|
+
manifestUrl?: unknown;
|
|
58
|
+
containerEntry?: unknown;
|
|
59
|
+
remoteType?: unknown;
|
|
60
|
+
};
|
|
61
|
+
}>;
|
|
62
|
+
};
|
|
63
|
+
export type ReferenceTopology = {
|
|
64
|
+
shell?: TopologyApp;
|
|
65
|
+
shells?: TopologyApp[];
|
|
66
|
+
verticals?: TopologyApp[];
|
|
67
|
+
};
|
|
68
|
+
export type BackendFederationApp = {
|
|
69
|
+
id: string;
|
|
70
|
+
directory: string;
|
|
71
|
+
packageName?: string;
|
|
72
|
+
version?: string;
|
|
73
|
+
buildVersion?: string;
|
|
74
|
+
unitId?: string;
|
|
75
|
+
sourceRevision?: string;
|
|
76
|
+
deliveryUnit?: DeliveryUnitContractBlock;
|
|
77
|
+
port: number;
|
|
78
|
+
apiPrefix: string;
|
|
79
|
+
apiProtocol: 'rest' | 'rpc';
|
|
80
|
+
rpcPath?: string;
|
|
81
|
+
apiStem: string;
|
|
82
|
+
backendName: string;
|
|
83
|
+
manifestUrl: string;
|
|
84
|
+
containerEntry: string;
|
|
85
|
+
remoteType: string;
|
|
86
|
+
uiManifestUrl?: string;
|
|
87
|
+
topologyDeliveryUnit?: {
|
|
88
|
+
unitId?: string;
|
|
89
|
+
buildMarker?: string;
|
|
90
|
+
sourceRevision?: string;
|
|
91
|
+
packageName?: string;
|
|
92
|
+
version?: string;
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
export type BackendFederationBuildIdentity = {
|
|
96
|
+
appId?: string;
|
|
97
|
+
packageName?: string;
|
|
98
|
+
version?: string;
|
|
99
|
+
buildVersion?: string;
|
|
100
|
+
unitId?: string;
|
|
101
|
+
sourceRevision?: string;
|
|
102
|
+
artifact?: UltramodernBuildArtifact;
|
|
103
|
+
};
|
|
104
|
+
export declare const normalizeRelativePath: (value: string) => string;
|
|
105
|
+
export declare const buildArtifactPathFor: (appDirectory: string) => string;
|
|
106
|
+
export declare const readBuildIdentity: (appDirectory: string) => Promise<BackendFederationBuildIdentity>;
|
|
107
|
+
export declare const findWorkspaceRoot: (appDirectory: string) => string | undefined;
|
|
108
|
+
export declare const resolveWorkspaceSourceRevision: (workspaceRoot: string) => Promise<string>;
|
|
109
|
+
export declare const createStampedDeliveryUnit: (input: {
|
|
110
|
+
appId: string;
|
|
111
|
+
unitId?: string;
|
|
112
|
+
buildMarker?: string;
|
|
113
|
+
packageName?: string;
|
|
114
|
+
version?: string;
|
|
115
|
+
sourceRevision: string;
|
|
116
|
+
}) => DeliveryUnitContractBlock | undefined;
|
|
117
|
+
export declare const createAppFromTopology: (workspaceRoot: string, appDirectory: string, topologyApp: TopologyApp, overlay: DevelopmentOverlay, packageManifest: {
|
|
118
|
+
name?: unknown;
|
|
119
|
+
version?: unknown;
|
|
120
|
+
}) => BackendFederationApp | undefined;
|
|
121
|
+
export declare const findBackendFederationApp: (workspaceRoot: string, appDirectory: string) => Promise<BackendFederationApp>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type { BackendFederationBuildIdentity } from './config.js';
|
|
2
|
+
export type BackendFederationArtifactResult = {
|
|
3
|
+
appId: string;
|
|
4
|
+
manifestPath: string;
|
|
5
|
+
containerPath: string;
|
|
6
|
+
deliveryUnitArtifactPath?: string;
|
|
7
|
+
remoteName: string;
|
|
8
|
+
remoteType: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const emitBackendFederationArtifacts: (appDirectory: string, distDirectory: string) => Promise<BackendFederationArtifactResult | undefined>;
|
|
11
|
+
export default _default;
|
|
12
|
+
declare function _default(): {
|
|
13
|
+
name: string;
|
|
14
|
+
setup(api: {
|
|
15
|
+
getAppContext(): {
|
|
16
|
+
appDirectory: string;
|
|
17
|
+
distDirectory: string;
|
|
18
|
+
};
|
|
19
|
+
onAfterBuild(handler: () => Promise<void>): void;
|
|
20
|
+
}): void;
|
|
21
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { URL } from 'node:url';
|
|
2
|
+
/**
|
|
3
|
+
* Reads an environment variable while keeping generated build configs free of
|
|
4
|
+
* direct process access.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getBuildConfigEnvironment(name: string): string | undefined;
|
|
7
|
+
export type ResolveEffectTsgoCompilerOptions = {
|
|
8
|
+
/** Module URL or absolute filename used to resolve the consumer's compiler. */
|
|
9
|
+
from: string | URL;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the Effect TS-Go executable used by Module Federation DTS builds.
|
|
13
|
+
*/
|
|
14
|
+
export declare function resolveEffectTsgoCompiler(options: ResolveEffectTsgoCompilerOptions): string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { RsbuildPlugin } from '@rsbuild/core';
|
|
2
|
+
import type { PrecompressConfig } from './types.js';
|
|
3
|
+
export type { PrecompressCodecOptions, PrecompressConfig } from './types.js';
|
|
4
|
+
export declare const builderPluginAdapterPrecompress: (precompress: boolean | PrecompressConfig | undefined) => RsbuildPlugin;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CompressionPluginOptions } from '../../precompress/index.js';
|
|
2
|
+
export type PrecompressCodecOptions = boolean | Partial<CompressionPluginOptions>;
|
|
3
|
+
export interface PrecompressConfig {
|
|
4
|
+
/**
|
|
5
|
+
* Configure gzip precompression options.
|
|
6
|
+
* `true` means using default options.
|
|
7
|
+
* `false` means disabling gzip precompression.
|
|
8
|
+
* @default true
|
|
9
|
+
*/
|
|
10
|
+
gzip?: PrecompressCodecOptions;
|
|
11
|
+
/**
|
|
12
|
+
* Configure brotli precompression options.
|
|
13
|
+
* `true` means using default options.
|
|
14
|
+
* `false` means disabling brotli precompression.
|
|
15
|
+
* @default true
|
|
16
|
+
*/
|
|
17
|
+
brotli?: PrecompressCodecOptions;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -4,12 +4,13 @@ export declare const getCloudflareArtifacts: (modernConfig: CloudflareModernConf
|
|
|
4
4
|
to: string;
|
|
5
5
|
index: number;
|
|
6
6
|
}[];
|
|
7
|
-
export declare const getCloudflarePublicAssets: (modernConfig: CloudflareModernConfig) =>
|
|
8
|
-
from: string;
|
|
9
|
-
to: string;
|
|
10
|
-
index: number;
|
|
11
|
-
}[];
|
|
7
|
+
export declare const getCloudflarePublicAssets: (modernConfig: CloudflareModernConfig) => import("../deploy-output/public-assets.js").DeclaredPublicAsset[];
|
|
12
8
|
export declare const copyCloudflareArtifacts: (appDirectory: string, outputDirectory: string, artifacts: ReturnType<typeof getCloudflareArtifacts>) => Promise<void>;
|
|
13
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Stage `deploy.worker.publicAssets` into Worker Static Assets.
|
|
11
|
+
*
|
|
12
|
+
* @returns the staged files relative to the Cloudflare output root.
|
|
13
|
+
*/
|
|
14
|
+
export declare const copyCloudflarePublicAssets: (appDirectory: string, outputDirectory: string, publicAssets: ReturnType<typeof getCloudflarePublicAssets>) => Promise<string[]>;
|
|
14
15
|
export declare const copyCloudflareD1Migrations: (appDirectory: string, outputDirectory: string, modernConfig: CloudflareModernConfig) => Promise<void>;
|
|
15
16
|
export declare const readRouteSpec: (outputDirectory: string) => Promise<any>;
|
|
@@ -16,7 +16,7 @@ export declare const SERVER_OUTPUT_DIRECTORY = "server";
|
|
|
16
16
|
export declare const DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES: readonly ['api', 'shared'];
|
|
17
17
|
export declare const BFF_EFFECT_WORKER_ENTRY = "worker/__modern_bff_effect.js";
|
|
18
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/
|
|
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/bff-effect/effect-edge instead of lambda/Hono server helpers.";
|
|
20
20
|
export declare const DEFAULT_COMPATIBILITY_DATE = "2026-06-02";
|
|
21
21
|
export declare const COMPATIBILITY_DATE_PATTERN: RegExp;
|
|
22
22
|
export declare const REQUIRED_COMPATIBILITY_FLAGS: readonly ["nodejs_compat", "global_fetch_strictly_public"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DeliveryUnitIdentity } from '@modern-js/
|
|
1
|
+
import { type DeliveryUnitIdentity } from '@modern-js/backend-federation-contracts';
|
|
2
2
|
export type DeliveryUnitStamp = DeliveryUnitIdentity & {
|
|
3
3
|
surfaces: {
|
|
4
4
|
ui?: DeliveryUnitIdentity & {
|
|
@@ -11,13 +11,13 @@ export type DeliveryUnitStamp = DeliveryUnitIdentity & {
|
|
|
11
11
|
};
|
|
12
12
|
/**
|
|
13
13
|
* Resolve the delivery-unit record declared for this app by the workspace
|
|
14
|
-
*
|
|
14
|
+
* reference topology. This is the topology source
|
|
15
15
|
* of truth the Cloudflare worker snapshot is verified against.
|
|
16
16
|
*/
|
|
17
17
|
export declare const resolveTopologyDeliveryUnit: (appDirectory: string) => Promise<DeliveryUnitStamp | undefined>;
|
|
18
18
|
/**
|
|
19
19
|
* Resolve the delivery-unit identity actually bundled into the worker by
|
|
20
|
-
*
|
|
20
|
+
* reading the generated `shared/ultramodern-build.json` artifact. This is the
|
|
21
21
|
* worker snapshot / declared surface source that gets stamped into the manifest.
|
|
22
22
|
*/
|
|
23
23
|
export declare const resolveWorkerDeliveryUnitStamp: (appDirectory: string) => Promise<DeliveryUnitStamp | undefined>;
|
|
@@ -108,8 +108,8 @@ export declare const createWorkerManifest: (outputDirectory: string, modernConfi
|
|
|
108
108
|
prefix: string;
|
|
109
109
|
worker: string;
|
|
110
110
|
effect: {
|
|
111
|
-
openapi?: import("@modern-js/server-
|
|
112
|
-
dataPlatform?: import("@modern-js/server-
|
|
111
|
+
openapi?: import("@modern-js/runtime-extensions/server-config").BffEffectOpenApiUserConfig | undefined;
|
|
112
|
+
dataPlatform?: import("@modern-js/runtime-extensions/server-config").BffEffectDataPlatformUserConfig | undefined;
|
|
113
113
|
crossProjectPolicy: {
|
|
114
114
|
allowedNamespaces?: string[];
|
|
115
115
|
verifyProducerIdentity?: (headers: Record<string, unknown>) => string | undefined;
|
|
@@ -34,6 +34,12 @@ export declare const createWranglerConfig: (appDirectory: string, modernConfig:
|
|
|
34
34
|
binding: string;
|
|
35
35
|
run_worker_first: boolean;
|
|
36
36
|
};
|
|
37
|
+
env?: {
|
|
38
|
+
[k: string]: {
|
|
39
|
+
compatibility_date?: string | undefined;
|
|
40
|
+
compatibility_flags?: JsonValue[] | undefined;
|
|
41
|
+
};
|
|
42
|
+
} | undefined;
|
|
37
43
|
d1_databases?: {
|
|
38
44
|
binding: string;
|
|
39
45
|
database_name: string;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import type { BffUserConfig } from '@modern-js/server-core';
|
|
2
|
-
import type { EnvironmentConfig, ModifyBundlerChainFn } from '@rsbuild/core';
|
|
2
|
+
import type { EnvironmentConfig, ModifyBundlerChainFn, Rspack } from '@rsbuild/core';
|
|
3
|
+
import type { ResolvedDeployTarget } from './deploy-output/target.js';
|
|
3
4
|
export interface CloudflareBuilderNormalizedConfig {
|
|
4
5
|
bff?: BffUserConfig;
|
|
5
|
-
deploy?: {
|
|
6
|
-
target?: string;
|
|
7
|
-
};
|
|
8
6
|
}
|
|
9
7
|
export interface CloudflareBuilderAppContext {
|
|
8
|
+
apiOnly?: boolean;
|
|
9
|
+
deployTarget?: ResolvedDeployTarget;
|
|
10
10
|
apiDirectory: string;
|
|
11
11
|
appDirectory: string;
|
|
12
|
+
entrypoints?: ReadonlyArray<{
|
|
13
|
+
entryName: string;
|
|
14
|
+
}>;
|
|
15
|
+
internalDirectory?: string;
|
|
12
16
|
}
|
|
13
17
|
export interface CloudflareBuilderEnvironmentsOptions {
|
|
14
18
|
appContext: CloudflareBuilderAppContext;
|
|
15
19
|
environments: Record<string, EnvironmentConfig>;
|
|
16
20
|
normalizedConfig: CloudflareBuilderNormalizedConfig;
|
|
17
|
-
resolveDeployProvider?: ResolveCloudflareDeployProvider;
|
|
18
21
|
}
|
|
19
|
-
export type ResolveCloudflareDeployProvider = () => string | undefined;
|
|
20
22
|
export interface CloudflareWorkerRspackConfig {
|
|
21
23
|
externals: Record<string, string>;
|
|
22
24
|
externalsType: 'module-import';
|
|
@@ -51,9 +53,47 @@ export interface CloudflareBuilderPlugin {
|
|
|
51
53
|
name: string;
|
|
52
54
|
setup(api: CloudflareBuilderPluginApi): void;
|
|
53
55
|
}
|
|
56
|
+
type AliasField = string | readonly string[];
|
|
57
|
+
/**
|
|
58
|
+
* Leaves an absent optional dependency missing at runtime, exactly as Node
|
|
59
|
+
* does, instead of failing the worker build. It applies only when the
|
|
60
|
+
* importing package itself declares the request as an optional peer
|
|
61
|
+
* (`peerDependenciesMeta.<name>.optional`) or an `optionalDependencies`
|
|
62
|
+
* entry, the package is not found in any `resolve.modules` directory, and
|
|
63
|
+
* neither the app (`resolve.alias`, `resolve.fallback`, `externals`) nor the
|
|
64
|
+
* importing package (an enabled `resolve.aliasFields` entry such as
|
|
65
|
+
* `browser`) redirects the request. The import
|
|
66
|
+
* then rejects with "Cannot find module" so the library's own fallback
|
|
67
|
+
* handles it (for example `@redis/client` guards `import('@node-rs/xxhash')`).
|
|
68
|
+
*/
|
|
69
|
+
export declare const createAbsentOptionalDependencyFilter: (isRedirected?: (request: string) => boolean, moduleDirectories?: readonly string[], aliasFields?: readonly AliasField[]) => (request: string, context: string) => boolean;
|
|
70
|
+
type AliasOption = Record<string, unknown> | {
|
|
71
|
+
name: string;
|
|
72
|
+
onlyModule?: boolean;
|
|
73
|
+
}[] | false | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* Reads the final resolved `resolve.alias`, `resolve.fallback` and
|
|
76
|
+
* `externals` so an app's own
|
|
77
|
+
* replacement for an optional package still wins over the absent-module
|
|
78
|
+
* fallback (the fallback runs before resolution).
|
|
79
|
+
*/
|
|
80
|
+
export declare const createRequestRedirectMatcher: (options: {
|
|
81
|
+
externals?: unknown;
|
|
82
|
+
resolve?: {
|
|
83
|
+
alias?: AliasOption;
|
|
84
|
+
fallback?: AliasOption;
|
|
85
|
+
};
|
|
86
|
+
}) => (request: string) => boolean;
|
|
87
|
+
type FunctionExternal = (data: Rspack.ExternalItemFunctionData, callback: (error?: Error | null, result?: unknown) => void) => unknown;
|
|
88
|
+
/**
|
|
89
|
+
* Reports whether any function external claims the request. A function that
|
|
90
|
+
* throws is treated as claiming it, so the request goes through ordinary
|
|
91
|
+
* external processing and surfaces that error instead of being ignored.
|
|
92
|
+
*/
|
|
93
|
+
export declare const claimsByFunctionExternal: (externals: readonly FunctionExternal[], data: Rspack.ExternalItemFunctionData) => Promise<boolean>;
|
|
54
94
|
export declare function getCloudflareWorkerRspackConfig(workerEntryNames: Iterable<string>): CloudflareWorkerRspackConfig;
|
|
55
95
|
export declare function applyCloudflareWorkerRspackConfig(chain: Parameters<ModifyBundlerChainFn>[0], workerEntryNames: Iterable<string>): void;
|
|
56
|
-
export declare function
|
|
57
|
-
export declare function getCloudflareBuilderEnvironments({ appContext, environments, normalizedConfig, resolveDeployProvider, }: CloudflareBuilderEnvironmentsOptions): Record<string, EnvironmentConfig>;
|
|
96
|
+
export declare function getCloudflareBuilderEnvironments({ appContext, environments, normalizedConfig, }: CloudflareBuilderEnvironmentsOptions): Record<string, EnvironmentConfig>;
|
|
58
97
|
export declare function applyCloudflareBuilderEnvironments(options: CloudflareBuilderEnvironmentsOptions): CloudflareBuilderEnvironmentsResult;
|
|
59
|
-
export declare const createCloudflareBuilderPlugin: (
|
|
98
|
+
export declare const createCloudflareBuilderPlugin: () => CloudflareBuilderPlugin;
|
|
99
|
+
export {};
|
|
@@ -10,5 +10,8 @@ export declare const CLOUDFLARE_RUNTIME_TYPE = "cloudflare-module-worker";
|
|
|
10
10
|
export declare const CLOUDFLARE_OUTPUT_PACKAGE_TYPE = "module";
|
|
11
11
|
export declare const CLOUDFLARE_WORKER_PACKAGE_TYPE = "commonjs";
|
|
12
12
|
export declare const CLOUDFLARE_WORKER_BUNDLE_FORMAT = "commonjs";
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const CLOUDFLARE_ROUTE_DATA_HANDLER_EXPORT = "handleRouteDataRequest";
|
|
14
|
+
export declare const getCloudflareWorkerRouteDataEntryName: (entryName: string) => string;
|
|
15
|
+
export declare const CLOUDFLARE_WORKER_NODE_BUILTINS: readonly ['_http_agent', '_http_client', '_http_common', '_http_incoming', '_http_outgoing', '_http_server', '_tls_common', '_tls_wrap', 'assert', 'assert/strict', 'async_hooks', 'buffer', 'child_process', 'cluster', 'console', 'constants', 'crypto', 'dgram', 'diagnostics_channel', 'dns', 'dns/promises', 'domain', 'events', 'fs', 'fs/promises', 'http', 'http2', 'https', 'inspector', 'inspector/promises', 'module', 'net', 'os', 'path', 'path/posix', 'path/win32', 'perf_hooks', 'process', 'punycode', 'querystring', 'readline', 'readline/promises', 'repl', 'sqlite', 'stream', 'stream/consumers', 'stream/promises', 'stream/web', 'string_decoder', 'sys', 'test', 'timers', 'timers/promises', 'tls', 'trace_events', 'tty', 'url', 'util', 'util/types', 'v8', 'vm', 'wasi', 'worker_threads', 'zlib'];
|
|
16
|
+
export declare const CLOUDFLARE_WORKER_PLATFORM_MODULES: readonly ['cloudflare:sockets'];
|
|
14
17
|
export declare const CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS: readonly ['nodejs_compat', 'global_fetch_strictly_public'];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type DeliveryUnitIdentity } from '@modern-js/
|
|
1
|
+
import { type DeliveryUnitIdentity } from '@modern-js/backend-federation-contracts';
|
|
2
2
|
import type { CloudflareOutputVerifierIssue, JsonObject } from './issues.js';
|
|
3
3
|
export type CloudflareDeliveryUnitIdentity = DeliveryUnitIdentity & {
|
|
4
4
|
surfaces?: Partial<Record<'api' | 'ui', DeliveryUnitIdentity & {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CloudflareOutputVerifierIssue, JsonObject } from './issues.js';
|
|
2
2
|
interface WorkerBundleReference {
|
|
3
3
|
dispatcherExport?: string;
|
|
4
|
-
kind: 'effect-bff' | 'route';
|
|
4
|
+
kind: 'effect-bff' | 'route' | 'route-data';
|
|
5
5
|
reference: string;
|
|
6
6
|
}
|
|
7
7
|
interface ResolvedWorkerBundleReference extends WorkerBundleReference {
|
|
@@ -10,7 +10,7 @@ interface ResolvedWorkerBundleReference extends WorkerBundleReference {
|
|
|
10
10
|
export declare const getEffectBffWorker: (manifest: JsonObject) => any;
|
|
11
11
|
export declare const getWorkerBundleReferences: (manifest: JsonObject) => WorkerBundleReference[];
|
|
12
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.";
|
|
13
|
+
export declare const missingWorkerBundleMessage: (reference: WorkerBundleReference) => "Cloudflare Effect BFF manifest points to a missing worker bundle." | "Cloudflare route data worker manifest points to a missing worker bundle." | "Cloudflare route worker manifest points to a missing worker bundle.";
|
|
14
14
|
interface WorkerBundleVerificationContract {
|
|
15
15
|
providedPackages: ReadonlySet<string>;
|
|
16
16
|
workerRoot: string;
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export type { ResolveEffectTsgoCompilerOptions } from './build-config/public.js';
|
|
2
|
+
export { getBuildConfigEnvironment, resolveEffectTsgoCompiler, } from './build-config/public.js';
|
|
3
|
+
export { createRemoteManifestUrl } from './build-config/remote-address.js';
|
|
4
|
+
export type { DeployTarget } from './deploy-output/target.js';
|
|
5
|
+
export { resolveDeployTarget } from './deploy-output/target.js';
|
|
2
6
|
export type CloudflareWorkerSecurityCspMode = 'enforce' | 'report-only' | 'off';
|
|
3
7
|
export type JsonValue = string | number | boolean | null | JsonValue[] | {
|
|
4
8
|
[key: string]: JsonValue;
|
|
@@ -25,6 +29,17 @@ export interface CloudflareWorkerPublicAssetConfig {
|
|
|
25
29
|
*/
|
|
26
30
|
to: string;
|
|
27
31
|
}
|
|
32
|
+
export interface NodePublicAssetConfig {
|
|
33
|
+
/**
|
|
34
|
+
* Source file or directory, relative to the app root, to copy into the
|
|
35
|
+
* Node deploy output's public directory.
|
|
36
|
+
*/
|
|
37
|
+
from: string;
|
|
38
|
+
/**
|
|
39
|
+
* Destination path relative to `.output/public`.
|
|
40
|
+
*/
|
|
41
|
+
to: string;
|
|
42
|
+
}
|
|
28
43
|
export interface CloudflareWorkerD1DatabaseConfig {
|
|
29
44
|
/**
|
|
30
45
|
* Worker binding name, for example `DB`.
|
|
@@ -173,3 +188,16 @@ export interface CloudflareDeployConfig {
|
|
|
173
188
|
publicAssetExcludes?: string[];
|
|
174
189
|
};
|
|
175
190
|
}
|
|
191
|
+
export interface NodeDeployConfig {
|
|
192
|
+
node?: {
|
|
193
|
+
/**
|
|
194
|
+
* Additional app-root files or directories to stage under
|
|
195
|
+
* `.output/public` when `modern deploy` targets Node, the counterpart of
|
|
196
|
+
* `deploy.worker.publicAssets`. The Node server does not route these
|
|
197
|
+
* files; serve them from the app, for example from an API handler.
|
|
198
|
+
* Release envelopes record them as declared public assets, so API-only
|
|
199
|
+
* units may ship them.
|
|
200
|
+
*/
|
|
201
|
+
publicAssets?: NodePublicAssetConfig[];
|
|
202
|
+
};
|
|
203
|
+
}
|
|
@@ -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>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { NodePublicAssetConfig } from '../config.js';
|
|
2
|
+
import { type ResolvedDeployTarget } from './target.js';
|
|
3
|
+
export interface DeployOutputAppContext {
|
|
4
|
+
appDirectory: string;
|
|
5
|
+
metaName: string;
|
|
6
|
+
deployTarget?: ResolvedDeployTarget;
|
|
7
|
+
}
|
|
8
|
+
export interface DeployOutputPluginApi {
|
|
9
|
+
getAppContext(): DeployOutputAppContext;
|
|
10
|
+
onAfterDeploy(handler: () => Promise<void>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const createDeployOutputAliasesPlugin: () => {
|
|
13
|
+
name: string;
|
|
14
|
+
setup(api: DeployOutputPluginApi): void;
|
|
15
|
+
};
|
|
16
|
+
export interface DeployOutputPublicAssetsConfig {
|
|
17
|
+
deploy?: {
|
|
18
|
+
node?: {
|
|
19
|
+
publicAssets?: NodePublicAssetConfig[];
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface DeployOutputPublicAssetsPluginApi {
|
|
24
|
+
getAppContext(): DeployOutputAppContext;
|
|
25
|
+
getNormalizedConfig(): DeployOutputPublicAssetsConfig;
|
|
26
|
+
onAfterDeploy(handler: () => Promise<void>): void;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Stage `deploy.node.publicAssets` into the Node deploy output. Cloudflare
|
|
30
|
+
* stages `deploy.worker.publicAssets` inside its deploy preset.
|
|
31
|
+
*/
|
|
32
|
+
export declare const createDeployOutputPublicAssetsPlugin: () => {
|
|
33
|
+
name: string;
|
|
34
|
+
setup(api: DeployOutputPublicAssetsPluginApi): void;
|
|
35
|
+
};
|