@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.4 → 3.5.0-ultramodern.40
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/builder/generator/getBuilderEnvironments.js +1 -0
- package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +13 -4
- package/dist/cjs/builder/shared/lazyCompilation.js +2 -10
- package/dist/cjs/commands/index.js +0 -4
- package/dist/cjs/index.js +37 -66
- package/dist/cjs/plugins/backend-federation/codegen.js +209 -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 +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 +137 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +121 -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 +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 +178 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +189 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +91 -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 +184 -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 +83 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +149 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +131 -0
- 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/builder/generator/getBuilderEnvironments.mjs +1 -0
- package/dist/esm/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
- package/dist/esm/builder/shared/lazyCompilation.mjs +1 -3
- package/dist/esm/commands/index.mjs +0 -1
- package/dist/esm/index.mjs +3 -4
- package/dist/esm/plugins/analyze/getHtmlTemplate.mjs +2 -2
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +2 -2
- package/dist/esm/plugins/backend-federation/codegen.mjs +158 -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 -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 +33 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +70 -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-contract.mjs +17 -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 +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/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/builder/generator/getBuilderEnvironments.mjs +1 -0
- package/dist/esm-node/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +1 -3
- package/dist/esm-node/commands/index.mjs +0 -1
- package/dist/esm-node/index.mjs +3 -4
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.mjs +2 -2
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +2 -2
- package/dist/esm-node/plugins/backend-federation/codegen.mjs +159 -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 +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 +34 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +71 -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-contract.mjs +18 -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 +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/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/builder/generator/createCopyPattern.d.ts +7 -5
- package/dist/types/builder/shared/lazyCompilation.d.ts +2 -4
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types/index.d.ts +0 -2
- 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 +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 +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 +113 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +39 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +13 -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 +6 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +15 -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/types/config/cloudflareDeploy.d.ts +22 -0
- package/dist/types/types/config/deploy.d.ts +15 -2
- package/lib/types.d.ts +2 -3
- package/package.json +24 -18
- 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,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
const CLOUDFLARE_WORKER_ENTRY = 'server/index.mjs';
|
|
31
|
+
const CLOUDFLARE_WORKER_MANIFEST = 'server/modern-worker-manifest.json';
|
|
32
|
+
const CLOUDFLARE_WRANGLER_CONFIG_FILE = 'wrangler.json';
|
|
33
|
+
const CLOUDFLARE_OUTPUT_PACKAGE_FILE = 'package.json';
|
|
34
|
+
const CLOUDFLARE_WORKER_PACKAGE_FILE = 'worker/package.json';
|
|
35
|
+
const CLOUDFLARE_ASSETS_BINDING = 'ASSETS';
|
|
36
|
+
const CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY = 'public';
|
|
37
|
+
const CLOUDFLARE_WORKER_BUNDLE_DIRECTORY = 'worker';
|
|
38
|
+
const CLOUDFLARE_RUNTIME_TYPE = 'cloudflare-module-worker';
|
|
39
|
+
const CLOUDFLARE_OUTPUT_PACKAGE_TYPE = 'module';
|
|
40
|
+
const CLOUDFLARE_WORKER_PACKAGE_TYPE = 'commonjs';
|
|
41
|
+
const CLOUDFLARE_WORKER_BUNDLE_FORMAT = 'commonjs';
|
|
42
|
+
const CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS = [
|
|
43
|
+
'nodejs_compat',
|
|
44
|
+
'global_fetch_strictly_public'
|
|
45
|
+
];
|
|
46
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
47
|
+
CLOUDFLARE_ASSETS_BINDING: CLOUDFLARE_ASSETS_BINDING,
|
|
48
|
+
CLOUDFLARE_OUTPUT_PACKAGE_FILE: CLOUDFLARE_OUTPUT_PACKAGE_FILE,
|
|
49
|
+
CLOUDFLARE_OUTPUT_PACKAGE_TYPE: CLOUDFLARE_OUTPUT_PACKAGE_TYPE,
|
|
50
|
+
CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY: CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY,
|
|
51
|
+
CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS: CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS,
|
|
52
|
+
CLOUDFLARE_RUNTIME_TYPE: CLOUDFLARE_RUNTIME_TYPE,
|
|
53
|
+
CLOUDFLARE_WORKER_BUNDLE_DIRECTORY: CLOUDFLARE_WORKER_BUNDLE_DIRECTORY,
|
|
54
|
+
CLOUDFLARE_WORKER_BUNDLE_FORMAT: CLOUDFLARE_WORKER_BUNDLE_FORMAT,
|
|
55
|
+
CLOUDFLARE_WORKER_ENTRY: CLOUDFLARE_WORKER_ENTRY,
|
|
56
|
+
CLOUDFLARE_WORKER_MANIFEST: CLOUDFLARE_WORKER_MANIFEST,
|
|
57
|
+
CLOUDFLARE_WORKER_PACKAGE_FILE: CLOUDFLARE_WORKER_PACKAGE_FILE,
|
|
58
|
+
CLOUDFLARE_WORKER_PACKAGE_TYPE: CLOUDFLARE_WORKER_PACKAGE_TYPE,
|
|
59
|
+
CLOUDFLARE_WRANGLER_CONFIG_FILE: CLOUDFLARE_WRANGLER_CONFIG_FILE
|
|
60
|
+
});
|
|
61
|
+
exports.CLOUDFLARE_ASSETS_BINDING = __webpack_exports__.CLOUDFLARE_ASSETS_BINDING;
|
|
62
|
+
exports.CLOUDFLARE_OUTPUT_PACKAGE_FILE = __webpack_exports__.CLOUDFLARE_OUTPUT_PACKAGE_FILE;
|
|
63
|
+
exports.CLOUDFLARE_OUTPUT_PACKAGE_TYPE = __webpack_exports__.CLOUDFLARE_OUTPUT_PACKAGE_TYPE;
|
|
64
|
+
exports.CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY = __webpack_exports__.CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY;
|
|
65
|
+
exports.CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS = __webpack_exports__.CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS;
|
|
66
|
+
exports.CLOUDFLARE_RUNTIME_TYPE = __webpack_exports__.CLOUDFLARE_RUNTIME_TYPE;
|
|
67
|
+
exports.CLOUDFLARE_WORKER_BUNDLE_DIRECTORY = __webpack_exports__.CLOUDFLARE_WORKER_BUNDLE_DIRECTORY;
|
|
68
|
+
exports.CLOUDFLARE_WORKER_BUNDLE_FORMAT = __webpack_exports__.CLOUDFLARE_WORKER_BUNDLE_FORMAT;
|
|
69
|
+
exports.CLOUDFLARE_WORKER_ENTRY = __webpack_exports__.CLOUDFLARE_WORKER_ENTRY;
|
|
70
|
+
exports.CLOUDFLARE_WORKER_MANIFEST = __webpack_exports__.CLOUDFLARE_WORKER_MANIFEST;
|
|
71
|
+
exports.CLOUDFLARE_WORKER_PACKAGE_FILE = __webpack_exports__.CLOUDFLARE_WORKER_PACKAGE_FILE;
|
|
72
|
+
exports.CLOUDFLARE_WORKER_PACKAGE_TYPE = __webpack_exports__.CLOUDFLARE_WORKER_PACKAGE_TYPE;
|
|
73
|
+
exports.CLOUDFLARE_WRANGLER_CONFIG_FILE = __webpack_exports__.CLOUDFLARE_WRANGLER_CONFIG_FILE;
|
|
74
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
75
|
+
"CLOUDFLARE_ASSETS_BINDING",
|
|
76
|
+
"CLOUDFLARE_OUTPUT_PACKAGE_FILE",
|
|
77
|
+
"CLOUDFLARE_OUTPUT_PACKAGE_TYPE",
|
|
78
|
+
"CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY",
|
|
79
|
+
"CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS",
|
|
80
|
+
"CLOUDFLARE_RUNTIME_TYPE",
|
|
81
|
+
"CLOUDFLARE_WORKER_BUNDLE_DIRECTORY",
|
|
82
|
+
"CLOUDFLARE_WORKER_BUNDLE_FORMAT",
|
|
83
|
+
"CLOUDFLARE_WORKER_ENTRY",
|
|
84
|
+
"CLOUDFLARE_WORKER_MANIFEST",
|
|
85
|
+
"CLOUDFLARE_WORKER_PACKAGE_FILE",
|
|
86
|
+
"CLOUDFLARE_WORKER_PACKAGE_TYPE",
|
|
87
|
+
"CLOUDFLARE_WRANGLER_CONFIG_FILE"
|
|
88
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
89
|
+
Object.defineProperty(exports, '__esModule', {
|
|
90
|
+
value: true
|
|
91
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
createCloudflareOutputPlan: ()=>createCloudflareOutputPlan
|
|
41
|
+
});
|
|
42
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
43
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
44
|
+
const external_cloudflare_output_contract_js_namespaceObject = require("./cloudflare-output-contract.js");
|
|
45
|
+
const resolveOutput = (outputDirectory, relativePath)=>external_node_path_default().join(outputDirectory, relativePath);
|
|
46
|
+
function createCloudflareOutputPlan(outputDirectory) {
|
|
47
|
+
return {
|
|
48
|
+
outputDirectory,
|
|
49
|
+
requiredFiles: [
|
|
50
|
+
external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_ENTRY,
|
|
51
|
+
external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_MANIFEST,
|
|
52
|
+
external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WRANGLER_CONFIG_FILE,
|
|
53
|
+
external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_OUTPUT_PACKAGE_FILE
|
|
54
|
+
],
|
|
55
|
+
publicLeakDirectories: [
|
|
56
|
+
'server',
|
|
57
|
+
external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_BUNDLE_DIRECTORY
|
|
58
|
+
],
|
|
59
|
+
paths: {
|
|
60
|
+
workerEntry: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_ENTRY),
|
|
61
|
+
workerManifest: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_MANIFEST),
|
|
62
|
+
wranglerConfig: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WRANGLER_CONFIG_FILE),
|
|
63
|
+
outputPackage: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_OUTPUT_PACKAGE_FILE),
|
|
64
|
+
workerPackage: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_PACKAGE_FILE),
|
|
65
|
+
publicAssets: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY),
|
|
66
|
+
workerBundle: resolveOutput(outputDirectory, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_BUNDLE_DIRECTORY)
|
|
67
|
+
},
|
|
68
|
+
packages: {
|
|
69
|
+
output: {
|
|
70
|
+
type: external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_OUTPUT_PACKAGE_TYPE
|
|
71
|
+
},
|
|
72
|
+
worker: {
|
|
73
|
+
type: external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_PACKAGE_TYPE
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
wrangler: {
|
|
77
|
+
main: external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_ENTRY,
|
|
78
|
+
assets: {
|
|
79
|
+
binding: external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_ASSETS_BINDING,
|
|
80
|
+
directory: `./${external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY}`,
|
|
81
|
+
run_worker_first: true
|
|
82
|
+
},
|
|
83
|
+
requiredCompatibilityFlags: external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
exports.createCloudflareOutputPlan = __webpack_exports__.createCloudflareOutputPlan;
|
|
88
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
89
|
+
"createCloudflareOutputPlan"
|
|
90
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
91
|
+
Object.defineProperty(exports, '__esModule', {
|
|
92
|
+
value: true
|
|
93
|
+
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
verifyDeliveryUnitIdentity: ()=>verifyDeliveryUnitIdentity
|
|
32
|
+
});
|
|
33
|
+
const universal_namespaceObject = require("@modern-js/utils/universal");
|
|
34
|
+
const external_issues_js_namespaceObject = require("./issues.js");
|
|
35
|
+
const verifyDeliveryUnitIdentity = (issues, manifest, manifestPath, declared)=>{
|
|
36
|
+
const stamped = manifest?.deliveryUnit;
|
|
37
|
+
const hasStamp = Boolean(stamped) && 'object' == typeof stamped;
|
|
38
|
+
if (declared) {
|
|
39
|
+
if (!hasStamp) return void (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
40
|
+
code: 'missing-delivery-unit',
|
|
41
|
+
message: `Cloudflare worker manifest is missing the delivery-unit identity declared by the workspace topology (expected unitId ${declared.unitId}, buildMarker ${declared.buildMarker}).`,
|
|
42
|
+
path: manifestPath
|
|
43
|
+
});
|
|
44
|
+
for (const field of universal_namespaceObject.DELIVERY_UNIT_IDENTITY_FIELDS){
|
|
45
|
+
const stampedValue = (0, universal_namespaceObject.deliveryUnitIdentityFieldValue)(stamped, field);
|
|
46
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, stampedValue, declared[field], {
|
|
47
|
+
code: 'delivery-unit-drift',
|
|
48
|
+
message: `Cloudflare worker manifest deliveryUnit.${field} must match the topology delivery-unit record (expected ${declared[field]}, received ${stampedValue ?? 'undefined'}).`,
|
|
49
|
+
path: manifestPath
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
if (hasStamp && stamped.surfaces && 'object' == typeof stamped.surfaces) for (const surface of [
|
|
54
|
+
'ui',
|
|
55
|
+
'api'
|
|
56
|
+
]){
|
|
57
|
+
const marker = stamped.surfaces[surface];
|
|
58
|
+
if (!marker || 'object' != typeof marker) {
|
|
59
|
+
(0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
60
|
+
code: 'missing-delivery-unit',
|
|
61
|
+
message: `Cloudflare worker manifest is missing the ${surface} delivery-unit surface marker.`,
|
|
62
|
+
path: manifestPath
|
|
63
|
+
});
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
for (const field of universal_namespaceObject.DELIVERY_UNIT_IDENTITY_FIELDS){
|
|
67
|
+
const markerValue = (0, universal_namespaceObject.deliveryUnitIdentityFieldValue)(marker, field);
|
|
68
|
+
const stampedValue = (0, universal_namespaceObject.deliveryUnitIdentityFieldValue)(stamped, field);
|
|
69
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, markerValue, stampedValue, {
|
|
70
|
+
code: 'delivery-unit-drift',
|
|
71
|
+
message: `Cloudflare worker manifest ${surface} surface deliveryUnit.${field} must derive from one delivery-unit record (expected ${stampedValue ?? 'undefined'}, received ${markerValue ?? 'undefined'}).`,
|
|
72
|
+
path: manifestPath
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
exports.verifyDeliveryUnitIdentity = __webpack_exports__.verifyDeliveryUnitIdentity;
|
|
78
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
|
+
"verifyDeliveryUnitIdentity"
|
|
80
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
81
|
+
Object.defineProperty(exports, '__esModule', {
|
|
82
|
+
value: true
|
|
83
|
+
});
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
14
|
+
var define = (defs, kind)=>{
|
|
15
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
[kind]: defs[key]
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
define(getters, "get");
|
|
21
|
+
define(values, "value");
|
|
22
|
+
};
|
|
23
|
+
})();
|
|
24
|
+
(()=>{
|
|
25
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
26
|
+
})();
|
|
27
|
+
(()=>{
|
|
28
|
+
__webpack_require__.r = (exports1)=>{
|
|
29
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
30
|
+
value: 'Module'
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
33
|
+
value: true
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
})();
|
|
37
|
+
var __webpack_exports__ = {};
|
|
38
|
+
__webpack_require__.r(__webpack_exports__);
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
assertCloudflareOutput: ()=>assertCloudflareOutput,
|
|
41
|
+
verifyCloudflareOutput: ()=>verifyCloudflareOutput,
|
|
42
|
+
verifyCloudflareOutputMutationPolicy: ()=>external_mutation_policy_js_namespaceObject.verifyCloudflareOutputMutationPolicy
|
|
43
|
+
});
|
|
44
|
+
const promises_namespaceObject = require("node:fs/promises");
|
|
45
|
+
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
46
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
47
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
48
|
+
const external_cloudflare_output_plan_js_namespaceObject = require("../cloudflare-output-plan.js");
|
|
49
|
+
const external_identity_js_namespaceObject = require("./identity.js");
|
|
50
|
+
const external_issues_js_namespaceObject = require("./issues.js");
|
|
51
|
+
const external_manifest_js_namespaceObject = require("./manifest.js");
|
|
52
|
+
const external_worker_bundles_js_namespaceObject = require("./worker-bundles.js");
|
|
53
|
+
const external_mutation_policy_js_namespaceObject = require("./mutation-policy.js");
|
|
54
|
+
const pathExists = async (filePath)=>{
|
|
55
|
+
try {
|
|
56
|
+
await promises_default().access(filePath);
|
|
57
|
+
return true;
|
|
58
|
+
} catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const readJson = async (filePath)=>JSON.parse(await promises_default().readFile(filePath, 'utf-8'));
|
|
63
|
+
const verifyCloudflareOutput = async (options)=>{
|
|
64
|
+
const outputDirectory = external_node_path_default().resolve(options.outputDirectory);
|
|
65
|
+
const issues = [];
|
|
66
|
+
const outputPlan = (0, external_cloudflare_output_plan_js_namespaceObject.createCloudflareOutputPlan)(outputDirectory);
|
|
67
|
+
for (const relativePath of outputPlan.requiredFiles){
|
|
68
|
+
const filePath = external_node_path_default().join(outputDirectory, relativePath);
|
|
69
|
+
if (!await pathExists(filePath)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
70
|
+
code: 'missing-file',
|
|
71
|
+
message: `Cloudflare output is missing ${relativePath}.`,
|
|
72
|
+
path: filePath
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const manifestPath = outputPlan.paths.workerManifest;
|
|
76
|
+
const wranglerPath = outputPlan.paths.wranglerConfig;
|
|
77
|
+
const packagePath = outputPlan.paths.outputPackage;
|
|
78
|
+
const workerPackagePath = outputPlan.paths.workerPackage;
|
|
79
|
+
const manifest = await pathExists(manifestPath) ? await readJson(manifestPath) : void 0;
|
|
80
|
+
const wrangler = await pathExists(wranglerPath) ? await readJson(wranglerPath) : void 0;
|
|
81
|
+
const outputPackage = await pathExists(packagePath) ? await readJson(packagePath) : void 0;
|
|
82
|
+
const workerPackage = await pathExists(workerPackagePath) ? await readJson(workerPackagePath) : void 0;
|
|
83
|
+
if (manifest) {
|
|
84
|
+
(0, external_manifest_js_namespaceObject.verifyManifestShape)(issues, manifest, manifestPath);
|
|
85
|
+
(0, external_identity_js_namespaceObject.verifyDeliveryUnitIdentity)(issues, manifest, manifestPath, options.deliveryUnit);
|
|
86
|
+
const workerReferences = (0, external_worker_bundles_js_namespaceObject.getWorkerBundleReferences)(manifest);
|
|
87
|
+
if (workerReferences.length > 0 && !await pathExists(workerPackagePath)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
88
|
+
code: 'missing-file',
|
|
89
|
+
message: 'Cloudflare output is missing worker/package.json for referenced worker bundles.',
|
|
90
|
+
path: workerPackagePath
|
|
91
|
+
});
|
|
92
|
+
if (manifest.bff?.runtimeFramework === 'effect' && !(0, external_worker_bundles_js_namespaceObject.getEffectBffWorker)(manifest)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
93
|
+
code: 'missing-worker-bundle',
|
|
94
|
+
message: 'Cloudflare Effect BFF manifest points to a missing worker bundle.'
|
|
95
|
+
});
|
|
96
|
+
for (const workerReference of workerReferences){
|
|
97
|
+
const resolvedWorker = (0, external_worker_bundles_js_namespaceObject.resolveWorkerBundleReference)(issues, outputDirectory, workerReference, manifestPath);
|
|
98
|
+
if (!resolvedWorker) continue;
|
|
99
|
+
const workerExists = await pathExists(resolvedWorker.path);
|
|
100
|
+
if (!workerExists) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
101
|
+
code: 'missing-worker-bundle',
|
|
102
|
+
message: (0, external_worker_bundles_js_namespaceObject.missingWorkerBundleMessage)(workerReference),
|
|
103
|
+
path: resolvedWorker.path
|
|
104
|
+
});
|
|
105
|
+
if (workerExists) {
|
|
106
|
+
const workerSource = await promises_default().readFile(resolvedWorker.path, 'utf-8');
|
|
107
|
+
(0, external_worker_bundles_js_namespaceObject.verifyWorkerBundleReferences)(issues, resolvedWorker, workerSource);
|
|
108
|
+
if ('effect-bff' === resolvedWorker.kind && (workerSource.includes(';entityKind;') || workerSource.includes(';entityKind,entityKind;'))) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
109
|
+
code: 'invalid-worker-bundle',
|
|
110
|
+
message: 'Cloudflare Effect BFF worker bundle contains invalid Drizzle entityKind marker references.',
|
|
111
|
+
path: resolvedWorker.path
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
if (wrangler) {
|
|
117
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.main, outputPlan.wrangler.main, {
|
|
118
|
+
code: 'invalid-wrangler',
|
|
119
|
+
message: `wrangler.json main must be ${outputPlan.wrangler.main}.`,
|
|
120
|
+
path: wranglerPath
|
|
121
|
+
});
|
|
122
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.assets?.binding, outputPlan.wrangler.assets.binding, {
|
|
123
|
+
code: 'invalid-wrangler',
|
|
124
|
+
message: 'wrangler.json assets.binding must be ASSETS.',
|
|
125
|
+
path: wranglerPath
|
|
126
|
+
});
|
|
127
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.assets?.directory, outputPlan.wrangler.assets.directory, {
|
|
128
|
+
code: 'invalid-wrangler',
|
|
129
|
+
message: 'wrangler.json assets.directory must be ./public.',
|
|
130
|
+
path: wranglerPath
|
|
131
|
+
});
|
|
132
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.assets?.run_worker_first, outputPlan.wrangler.assets.run_worker_first, {
|
|
133
|
+
code: 'invalid-wrangler',
|
|
134
|
+
message: 'wrangler.json assets.run_worker_first must be true.',
|
|
135
|
+
path: wranglerPath
|
|
136
|
+
});
|
|
137
|
+
for (const flag of outputPlan.wrangler.requiredCompatibilityFlags)(0, external_issues_js_namespaceObject.assertFlag)(issues, wrangler.compatibility_flags, flag, {
|
|
138
|
+
code: 'invalid-wrangler',
|
|
139
|
+
message: `wrangler.json compatibility_flags must include ${flag}.`,
|
|
140
|
+
path: wranglerPath
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
if (outputPackage) (0, external_issues_js_namespaceObject.assertEqual)(issues, outputPackage.type, outputPlan.packages.output.type, {
|
|
144
|
+
code: 'invalid-package',
|
|
145
|
+
message: '.output/package.json must declare type module.',
|
|
146
|
+
path: packagePath
|
|
147
|
+
});
|
|
148
|
+
if (workerPackage) (0, external_issues_js_namespaceObject.assertEqual)(issues, workerPackage.type, outputPlan.packages.worker.type, {
|
|
149
|
+
code: 'invalid-package',
|
|
150
|
+
message: '.output/worker/package.json must declare type commonjs.',
|
|
151
|
+
path: workerPackagePath
|
|
152
|
+
});
|
|
153
|
+
for (const leakedPath of outputPlan.publicLeakDirectories){
|
|
154
|
+
const publicPath = external_node_path_default().join(outputPlan.paths.publicAssets, leakedPath);
|
|
155
|
+
if (await pathExists(publicPath)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
156
|
+
code: 'public-output-leak',
|
|
157
|
+
message: `Framework-owned ${leakedPath} output leaked into public assets.`,
|
|
158
|
+
path: publicPath
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (false !== options.importWorker && await pathExists(outputPlan.paths.workerEntry)) await (0, external_worker_bundles_js_namespaceObject.verifyWorkerImport)(issues, outputPlan.paths.workerEntry);
|
|
162
|
+
return {
|
|
163
|
+
ok: 0 === issues.length,
|
|
164
|
+
issues
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
const assertCloudflareOutput = async (options)=>{
|
|
168
|
+
const result = await verifyCloudflareOutput(options);
|
|
169
|
+
if (!result.ok) throw new Error([
|
|
170
|
+
'Cloudflare output verification failed:',
|
|
171
|
+
...result.issues.map((issue)=>`- ${issue.code}: ${issue.message}${issue.path ? ` (${issue.path})` : ''}`)
|
|
172
|
+
].join('\n'));
|
|
173
|
+
};
|
|
174
|
+
exports.assertCloudflareOutput = __webpack_exports__.assertCloudflareOutput;
|
|
175
|
+
exports.verifyCloudflareOutput = __webpack_exports__.verifyCloudflareOutput;
|
|
176
|
+
exports.verifyCloudflareOutputMutationPolicy = __webpack_exports__.verifyCloudflareOutputMutationPolicy;
|
|
177
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
178
|
+
"assertCloudflareOutput",
|
|
179
|
+
"verifyCloudflareOutput",
|
|
180
|
+
"verifyCloudflareOutputMutationPolicy"
|
|
181
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
182
|
+
Object.defineProperty(exports, '__esModule', {
|
|
183
|
+
value: true
|
|
184
|
+
});
|
package/dist/cjs/{baseline.js → plugins/deploy/platforms/cloudflare-output-verifier/issues.js}
RENAMED
|
@@ -27,18 +27,27 @@ var __webpack_require__ = {};
|
|
|
27
27
|
})();
|
|
28
28
|
var __webpack_exports__ = {};
|
|
29
29
|
__webpack_require__.r(__webpack_exports__);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
const addIssue = (issues, issue)=>{
|
|
31
|
+
issues.push(issue);
|
|
32
|
+
};
|
|
33
|
+
const assertEqual = (issues, actual, expected, issue)=>{
|
|
34
|
+
if (actual !== expected) addIssue(issues, issue);
|
|
35
|
+
};
|
|
36
|
+
const assertFlag = (issues, flags, flag, issue)=>{
|
|
37
|
+
if (!Array.isArray(flags) || !flags.includes(flag)) addIssue(issues, issue);
|
|
38
|
+
};
|
|
39
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
40
|
+
addIssue: addIssue,
|
|
41
|
+
assertEqual: assertEqual,
|
|
42
|
+
assertFlag: assertFlag
|
|
33
43
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
exports.createAppBaselineConfig = __webpack_exports__.createAppBaselineConfig;
|
|
38
|
-
exports.withAppBaseline = __webpack_exports__.withAppBaseline;
|
|
44
|
+
exports.addIssue = __webpack_exports__.addIssue;
|
|
45
|
+
exports.assertEqual = __webpack_exports__.assertEqual;
|
|
46
|
+
exports.assertFlag = __webpack_exports__.assertFlag;
|
|
39
47
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
40
|
-
"
|
|
41
|
-
"
|
|
48
|
+
"addIssue",
|
|
49
|
+
"assertEqual",
|
|
50
|
+
"assertFlag"
|
|
42
51
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
43
52
|
Object.defineProperty(exports, '__esModule', {
|
|
44
53
|
value: true
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
13
|
+
};
|
|
14
|
+
})();
|
|
15
|
+
(()=>{
|
|
16
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.r = (exports1)=>{
|
|
20
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
21
|
+
value: 'Module'
|
|
22
|
+
});
|
|
23
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
})();
|
|
28
|
+
var __webpack_exports__ = {};
|
|
29
|
+
__webpack_require__.r(__webpack_exports__);
|
|
30
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
31
|
+
verifyManifestShape: ()=>verifyManifestShape
|
|
32
|
+
});
|
|
33
|
+
const external_cloudflare_output_contract_js_namespaceObject = require("../cloudflare-output-contract.js");
|
|
34
|
+
const external_issues_js_namespaceObject = require("./issues.js");
|
|
35
|
+
const verifyManifestShape = (issues, manifest, manifestPath)=>{
|
|
36
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.runtime?.type, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_RUNTIME_TYPE, {
|
|
37
|
+
code: 'invalid-manifest',
|
|
38
|
+
message: 'Cloudflare output manifest runtime.type must be cloudflare-module-worker.',
|
|
39
|
+
path: manifestPath
|
|
40
|
+
});
|
|
41
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.runtime?.entry, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_ENTRY, {
|
|
42
|
+
code: 'invalid-manifest',
|
|
43
|
+
message: `Cloudflare output manifest runtime.entry must be ${external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_ENTRY}.`,
|
|
44
|
+
path: manifestPath
|
|
45
|
+
});
|
|
46
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.runtime?.fetchExport, true, {
|
|
47
|
+
code: 'invalid-manifest',
|
|
48
|
+
message: 'Cloudflare output manifest runtime.fetchExport must be true.',
|
|
49
|
+
path: manifestPath
|
|
50
|
+
});
|
|
51
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.runtime?.nodeListen, false, {
|
|
52
|
+
code: 'invalid-manifest',
|
|
53
|
+
message: 'Cloudflare output manifest runtime.nodeListen must be false.',
|
|
54
|
+
path: manifestPath
|
|
55
|
+
});
|
|
56
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.assets?.binding, external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_ASSETS_BINDING, {
|
|
57
|
+
code: 'invalid-manifest',
|
|
58
|
+
message: 'Cloudflare output manifest assets.binding must be ASSETS.',
|
|
59
|
+
path: manifestPath
|
|
60
|
+
});
|
|
61
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.assets?.directory, `./${external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY}`, {
|
|
62
|
+
code: 'invalid-manifest',
|
|
63
|
+
message: 'Cloudflare output manifest assets.directory must be ./public.',
|
|
64
|
+
path: manifestPath
|
|
65
|
+
});
|
|
66
|
+
(0, external_issues_js_namespaceObject.assertEqual)(issues, manifest.assets?.runWorkerFirst, true, {
|
|
67
|
+
code: 'invalid-manifest',
|
|
68
|
+
message: 'Cloudflare output manifest assets.runWorkerFirst must be true.',
|
|
69
|
+
path: manifestPath
|
|
70
|
+
});
|
|
71
|
+
if (!Array.isArray(manifest.routeSpec?.routes)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
72
|
+
code: 'invalid-manifest',
|
|
73
|
+
message: 'Cloudflare output manifest routeSpec.routes must be array.',
|
|
74
|
+
path: manifestPath
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
exports.verifyManifestShape = __webpack_exports__.verifyManifestShape;
|
|
78
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
79
|
+
"verifyManifestShape"
|
|
80
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
81
|
+
Object.defineProperty(exports, '__esModule', {
|
|
82
|
+
value: true
|
|
83
|
+
});
|