@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.30 → 3.5.0-ultramodern.32
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/plugins/backend-federation/codegen.js +208 -0
- package/dist/cjs/plugins/backend-federation/config.js +217 -0
- package/dist/cjs/plugins/backend-federation/emit.js +139 -0
- package/dist/cjs/plugins/backendFederationBuild.js +4 -298
- package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +127 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +137 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +118 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +135 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +126 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +223 -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 +178 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +189 -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 +184 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/issues.js +54 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +83 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +158 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +137 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier.js +23 -363
- package/dist/cjs/plugins/deploy/platforms/cloudflare.js +2 -745
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +22 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +32 -0
- package/dist/esm/plugins/backend-federation/codegen.mjs +157 -0
- package/dist/esm/plugins/backend-federation/config.mjs +141 -0
- package/dist/esm/plugins/backend-federation/emit.mjs +88 -0
- package/dist/esm/plugins/backendFederationBuild.mjs +1 -296
- package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +64 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +33 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +67 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +97 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +78 -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 +118 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +135 -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 +129 -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 +45 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +97 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +68 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier.mjs +1 -347
- package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +1 -735
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +22 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +32 -0
- package/dist/esm-node/plugins/backend-federation/codegen.mjs +158 -0
- package/dist/esm-node/plugins/backend-federation/config.mjs +142 -0
- package/dist/esm-node/plugins/backend-federation/emit.mjs +89 -0
- package/dist/esm-node/plugins/backendFederationBuild.mjs +1 -296
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +65 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +34 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +68 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +98 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +79 -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 +119 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +136 -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 +130 -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 +46 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +98 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +69 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier.mjs +1 -347
- package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +1 -735
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +22 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +32 -0
- package/dist/types/plugins/backend-federation/codegen.d.ts +82 -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 -11
- package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +15 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +23 -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 +21 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/index.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +88 -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 +100 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +39 -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 +13 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +16 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier.d.ts +1 -32
- package/dist/types/plugins/deploy/platforms/cloudflare.d.ts +1 -2
- 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/package.json +11 -11
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -879
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -879
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -879
- /package/dist/types/plugins/deploy/platforms/templates/{cloudflare-entry.d.mts → cloudflare-entry.006-fetch-handler.d.mts} +0 -0
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
const MODERN_WORKER_MANIFEST = p_workerManifest;
|
|
2
|
+
p_workerModuleLoaders;
|
|
3
|
+
new Map();
|
|
4
|
+
new Map();
|
|
5
|
+
new Map();
|
|
6
|
+
const CORS_POLICY = MODERN_WORKER_MANIFEST.security?.cors || {};
|
|
7
|
+
CORS_POLICY.assets;
|
|
8
|
+
(CORS_POLICY.allowedOrigins || []).map((origin)=>String(origin).toLowerCase());
|
|
9
|
+
(CORS_POLICY.allowedMethods?.length ? CORS_POLICY.allowedMethods : [
|
|
10
|
+
'GET',
|
|
11
|
+
'HEAD',
|
|
12
|
+
'POST',
|
|
13
|
+
'PUT',
|
|
14
|
+
'PATCH',
|
|
15
|
+
'DELETE',
|
|
16
|
+
'OPTIONS'
|
|
17
|
+
]).join(', ');
|
|
18
|
+
(CORS_POLICY.allowedHeaders?.length ? CORS_POLICY.allowedHeaders : [
|
|
19
|
+
'*'
|
|
20
|
+
]).join(', ');
|
|
21
|
+
globalThis.__dirname ??= '/';
|
|
22
|
+
globalThis.__filename ??= '/index.js';
|
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs
ADDED
|
File without changes
|
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs
ADDED
|
File without changes
|
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs
ADDED
|
File without changes
|
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs
ADDED
|
File without changes
|
package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
async fetch (request, env, ctx) {
|
|
3
|
+
const corsPreflightResponse = await createCorsPreflightResponse(request, env);
|
|
4
|
+
if (corsPreflightResponse) return finalizeResponseForRequest(corsPreflightResponse, request);
|
|
5
|
+
const bffResponse = await dispatchBffRequest(request, env);
|
|
6
|
+
if (bffResponse) return finalizeResponseForRequest(withAppCorsHeaders(bffResponse, request), request);
|
|
7
|
+
const serviceBindingResponse = await dispatchServiceBindingRequest(request, env);
|
|
8
|
+
if (serviceBindingResponse) return finalizeResponseForRequest(withAppCorsHeaders(serviceBindingResponse, request), request);
|
|
9
|
+
const route = findRoute(request);
|
|
10
|
+
const { pathname } = new URL(request.url);
|
|
11
|
+
if (isAssetLikePathname(pathname) && !routeMatchesExactly(route, pathname)) {
|
|
12
|
+
const assetResponse = await fetchAsset(request, env);
|
|
13
|
+
if (assetResponse) return finalizeResponseForRequest(assetResponse, request);
|
|
14
|
+
return finalizeResponseForRequest(withAppCorsHeaders(new Response('Not found', {
|
|
15
|
+
status: 404
|
|
16
|
+
}), request), request);
|
|
17
|
+
}
|
|
18
|
+
const localeRedirectResponse = createLocaleRedirectResponseForRequest(route, request);
|
|
19
|
+
if (localeRedirectResponse) return finalizeResponseForRequest(withAppCorsHeaders(localeRedirectResponse, request), request);
|
|
20
|
+
if (route?.worker) {
|
|
21
|
+
const renderableRequest = createRenderableRequest(request);
|
|
22
|
+
return finalizeResponseForRequest(withAppCorsHeaders(await dispatchRouteWorker(route, renderableRequest, env, ctx), request), request);
|
|
23
|
+
}
|
|
24
|
+
const htmlResponse = await fetchRouteHtml(route, request, env);
|
|
25
|
+
if (htmlResponse) return finalizeResponseForRequest(htmlResponse, request);
|
|
26
|
+
const assetResponse = await fetchAsset(request, env);
|
|
27
|
+
if (assetResponse) return finalizeResponseForRequest(assetResponse, request);
|
|
28
|
+
return finalizeResponseForRequest(withAppCorsHeaders(new Response('Not found', {
|
|
29
|
+
status: 404
|
|
30
|
+
}), request), request);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { type BackendFederationApp } from './config';
|
|
2
|
+
export declare const createBackendRemoteEntrySource: (workspaceRoot: string, app: BackendFederationApp, effectApiPath: string, entryPath: string) => string;
|
|
3
|
+
export declare const createBackendManifest: (workspaceRoot: string, distDirectory: string, app: BackendFederationApp) => {
|
|
4
|
+
schemaVersion: number;
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
version: string | undefined;
|
|
8
|
+
buildVersion: string | undefined;
|
|
9
|
+
metaData: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
buildInfo: {
|
|
13
|
+
buildVersion: string | undefined;
|
|
14
|
+
buildName: string | undefined;
|
|
15
|
+
};
|
|
16
|
+
remoteEntry: {
|
|
17
|
+
name: string;
|
|
18
|
+
path: string;
|
|
19
|
+
type: string;
|
|
20
|
+
};
|
|
21
|
+
globalName: string;
|
|
22
|
+
publicPath: string;
|
|
23
|
+
ssrRemoteEntry: {
|
|
24
|
+
name: string;
|
|
25
|
+
path: string;
|
|
26
|
+
type: string;
|
|
27
|
+
};
|
|
28
|
+
ssrPublicPath: string;
|
|
29
|
+
};
|
|
30
|
+
entry: {
|
|
31
|
+
file: string;
|
|
32
|
+
path: string;
|
|
33
|
+
type: string;
|
|
34
|
+
url: string;
|
|
35
|
+
};
|
|
36
|
+
exposes: {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
path: string;
|
|
40
|
+
assets: {
|
|
41
|
+
js: {
|
|
42
|
+
async: never[];
|
|
43
|
+
sync: string[];
|
|
44
|
+
};
|
|
45
|
+
css: {
|
|
46
|
+
async: never[];
|
|
47
|
+
sync: never[];
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}[];
|
|
51
|
+
shared: never[];
|
|
52
|
+
backendFederation: {
|
|
53
|
+
role: string;
|
|
54
|
+
name: string;
|
|
55
|
+
runtimeFramework: string;
|
|
56
|
+
strictEffectApproach: boolean;
|
|
57
|
+
contractVersion: string;
|
|
58
|
+
nodeAdapterVersion: string;
|
|
59
|
+
remoteType: string;
|
|
60
|
+
expose: string;
|
|
61
|
+
manifestUrl: string;
|
|
62
|
+
containerEntry: string;
|
|
63
|
+
source: {
|
|
64
|
+
module: string;
|
|
65
|
+
};
|
|
66
|
+
readinessPath: string;
|
|
67
|
+
openapiPath: string;
|
|
68
|
+
deliveryUnit?: import("@modern-js/utils/universal").DeliveryUnitContractBlock | undefined;
|
|
69
|
+
versionBoundary: {
|
|
70
|
+
invariant: string;
|
|
71
|
+
packageName: string | undefined;
|
|
72
|
+
version: string | undefined;
|
|
73
|
+
buildVersion: string | undefined;
|
|
74
|
+
uiManifestUrl?: string | undefined;
|
|
75
|
+
deliveryUnit?: {
|
|
76
|
+
unitId: string;
|
|
77
|
+
buildMarker: string;
|
|
78
|
+
sourceRevision: string;
|
|
79
|
+
} | undefined;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
};
|
|
@@ -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>;
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
appId: string;
|
|
4
|
-
manifestPath: string;
|
|
5
|
-
containerPath: string;
|
|
6
|
-
remoteName: string;
|
|
7
|
-
remoteType: string;
|
|
8
|
-
};
|
|
9
|
-
export declare const emitBackendFederationArtifacts: (appDirectory: string, distDirectory: string) => Promise<BackendFederationArtifactResult | undefined>;
|
|
10
|
-
export default _default;
|
|
11
|
-
declare function _default(): CliPlugin<AppTools>;
|
|
1
|
+
export type { BackendFederationArtifactResult } from './backend-federation/emit';
|
|
2
|
+
export { default, emitBackendFederationArtifacts, } from './backend-federation/emit';
|
|
@@ -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,23 @@
|
|
|
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 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.";
|
|
19
|
+
export declare const DEFAULT_COMPATIBILITY_DATE = "2026-06-02";
|
|
20
|
+
export declare const COMPATIBILITY_DATE_PATTERN: RegExp;
|
|
21
|
+
export declare const REQUIRED_COMPATIBILITY_FLAGS: readonly ["nodejs_compat", "global_fetch_strictly_public"];
|
|
22
|
+
export declare const RESERVED_ARTIFACT_DESTINATION_FILES: Set<string>;
|
|
23
|
+
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,21 @@
|
|
|
1
|
+
import type { CloudflareAppContext } from './types';
|
|
2
|
+
export type WorkerI18nDetection = {
|
|
3
|
+
order: string[];
|
|
4
|
+
lookupQuerystring: string;
|
|
5
|
+
lookupCookie: string;
|
|
6
|
+
lookupHeader: string;
|
|
7
|
+
};
|
|
8
|
+
export 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;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import type { CloudflareWorkerSecurityConfig } from '../../../../types/config/deploy';
|
|
2
|
+
export declare const DEFAULT_SECURITY_HEADERS: {
|
|
3
|
+
readonly referrerPolicy: 'strict-origin-when-cross-origin';
|
|
4
|
+
readonly contentTypeOptions: 'nosniff';
|
|
5
|
+
readonly permissionsPolicy: 'camera=(), geolocation=(), microphone=(), payment=(), usb=()';
|
|
6
|
+
};
|
|
7
|
+
export declare const DEFAULT_CORS_ALLOWED_METHODS: string[];
|
|
8
|
+
export declare const DEFAULT_CSP_DIRECTIVES: Record<string, string[]>;
|
|
9
|
+
export declare const createContentSecurityPolicy: (config?: CloudflareWorkerSecurityConfig['contentSecurityPolicy']) => {
|
|
10
|
+
mode: "off";
|
|
11
|
+
directives: {};
|
|
12
|
+
reason: string | undefined;
|
|
13
|
+
} | {
|
|
14
|
+
mode: "enforce" | "report-only";
|
|
15
|
+
directives: {
|
|
16
|
+
[k: string]: string[];
|
|
17
|
+
};
|
|
18
|
+
reason: string | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare const createNoindexPolicy: (noindex: CloudflareWorkerSecurityConfig['noindex']) => {
|
|
21
|
+
workersDev: boolean;
|
|
22
|
+
localhost: boolean;
|
|
23
|
+
previewHostnames: never[];
|
|
24
|
+
reason?: undefined;
|
|
25
|
+
} | {
|
|
26
|
+
workersDev: boolean;
|
|
27
|
+
localhost: boolean;
|
|
28
|
+
previewHostnames: string[];
|
|
29
|
+
reason: string | undefined;
|
|
30
|
+
};
|
|
31
|
+
export declare const createCloudflareWorkerCorsPolicy: (cors: CloudflareWorkerSecurityConfig['cors']) => {
|
|
32
|
+
assets: boolean;
|
|
33
|
+
allowedOrigins: string[];
|
|
34
|
+
allowedMethods: string[];
|
|
35
|
+
allowedHeaders: string[];
|
|
36
|
+
reason: string | undefined;
|
|
37
|
+
};
|
|
38
|
+
export declare const createCloudflareWorkerSecurityPolicy: (modernConfig: Parameters<CreatePreset>[0]['modernConfig']) => {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
cors: {
|
|
41
|
+
assets: boolean;
|
|
42
|
+
allowedOrigins: string[];
|
|
43
|
+
allowedMethods: string[];
|
|
44
|
+
allowedHeaders: string[];
|
|
45
|
+
reason: string | undefined;
|
|
46
|
+
};
|
|
47
|
+
reason: any;
|
|
48
|
+
headers?: undefined;
|
|
49
|
+
contentSecurityPolicy?: undefined;
|
|
50
|
+
noindex?: undefined;
|
|
51
|
+
} | {
|
|
52
|
+
enabled: boolean;
|
|
53
|
+
headers: {
|
|
54
|
+
referrerPolicy: any;
|
|
55
|
+
contentTypeOptions: any;
|
|
56
|
+
permissionsPolicy: any;
|
|
57
|
+
};
|
|
58
|
+
contentSecurityPolicy: {
|
|
59
|
+
mode: "off";
|
|
60
|
+
directives: {};
|
|
61
|
+
reason: string | undefined;
|
|
62
|
+
} | {
|
|
63
|
+
mode: "enforce" | "report-only";
|
|
64
|
+
directives: {
|
|
65
|
+
[k: string]: string[];
|
|
66
|
+
};
|
|
67
|
+
reason: string | undefined;
|
|
68
|
+
};
|
|
69
|
+
noindex: {
|
|
70
|
+
workersDev: boolean;
|
|
71
|
+
localhost: boolean;
|
|
72
|
+
previewHostnames: never[];
|
|
73
|
+
reason?: undefined;
|
|
74
|
+
} | {
|
|
75
|
+
workersDev: boolean;
|
|
76
|
+
localhost: boolean;
|
|
77
|
+
previewHostnames: string[];
|
|
78
|
+
reason: string | undefined;
|
|
79
|
+
};
|
|
80
|
+
cors: {
|
|
81
|
+
assets: boolean;
|
|
82
|
+
allowedOrigins: string[];
|
|
83
|
+
allowedMethods: string[];
|
|
84
|
+
allowedHeaders: string[];
|
|
85
|
+
reason: string | undefined;
|
|
86
|
+
};
|
|
87
|
+
reason: any;
|
|
88
|
+
};
|
|
@@ -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,100 @@
|
|
|
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
|
+
deliveryUnit?: DeliveryUnitStamp | undefined;
|
|
82
|
+
i18n: {
|
|
83
|
+
entries: Record<string, import("./i18n-worker").WorkerI18nEntry>;
|
|
84
|
+
} | undefined;
|
|
85
|
+
bff: {
|
|
86
|
+
runtimeFramework: string;
|
|
87
|
+
prefix: string;
|
|
88
|
+
worker: string;
|
|
89
|
+
} | undefined;
|
|
90
|
+
serviceBindings?: {
|
|
91
|
+
binding: any;
|
|
92
|
+
service: any;
|
|
93
|
+
prefix: any;
|
|
94
|
+
interface: string;
|
|
95
|
+
}[] | undefined;
|
|
96
|
+
}>;
|
|
97
|
+
export declare const createWorkerModuleLoaders: (manifest: any) => string;
|
|
98
|
+
export declare const getPublicAssetExcludes: (appDirectory: string, modernConfig: CloudflareModernConfig) => string[];
|
|
99
|
+
export declare const shouldCopyToPublicAssets: (src: string, distDirectory: string, publicAssetExcludes: string[]) => boolean;
|
|
100
|
+
export declare const shouldCopyToWorkerBundle: (src: string, workerBundleDirectory: string) => boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
}[] | JsonValue | undefined;
|
|
8
|
+
export declare const createWorkerManifestServiceBindings: (serviceBindings: ReturnType<typeof createWorkerServiceBindings>) => {
|
|
9
|
+
binding: any;
|
|
10
|
+
service: any;
|
|
11
|
+
prefix: any;
|
|
12
|
+
interface: string;
|
|
13
|
+
}[] | undefined;
|
|
14
|
+
export declare const createWranglerConfig: (appDirectory: string, modernConfig: CloudflareModernConfig) => {
|
|
15
|
+
$schema: string;
|
|
16
|
+
name: string;
|
|
17
|
+
compatibility_date: string;
|
|
18
|
+
main: string;
|
|
19
|
+
compatibility_flags: JsonValue[];
|
|
20
|
+
assets: {
|
|
21
|
+
directory: string;
|
|
22
|
+
binding: string;
|
|
23
|
+
run_worker_first: boolean;
|
|
24
|
+
};
|
|
25
|
+
d1_databases?: {
|
|
26
|
+
binding: string;
|
|
27
|
+
database_name: string;
|
|
28
|
+
database_id: string;
|
|
29
|
+
migrations_dir?: string | undefined;
|
|
30
|
+
preview_database_id?: string | undefined;
|
|
31
|
+
remote?: boolean | undefined;
|
|
32
|
+
}[] | JsonValue | undefined;
|
|
33
|
+
services?: string | number | boolean | JsonValue[] | {
|
|
34
|
+
binding: string;
|
|
35
|
+
service: string;
|
|
36
|
+
}[] | {
|
|
37
|
+
[key: string]: JsonValue;
|
|
38
|
+
} | null | undefined;
|
|
39
|
+
};
|
|
@@ -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;
|