@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.6 → 3.5.0-ultramodern.75
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/modern.js +0 -0
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +13 -16
- package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +13 -4
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +14 -11
- package/dist/cjs/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.js +72 -0
- package/dist/cjs/builder/shared/bundlerPlugins/RouterPlugin.js +28 -11
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +13 -6
- package/dist/cjs/builder/shared/lazyCompilation.js +2 -10
- package/dist/cjs/commands/index.js +0 -4
- package/dist/cjs/config/build-environment.js +268 -0
- package/dist/cjs/config/index.js +11 -4
- package/dist/cjs/config/public.js +46 -0
- package/dist/cjs/index.js +39 -62
- package/dist/cjs/plugins/analyze/getServerRoutes.js +19 -0
- package/dist/cjs/plugins/analyze/index.js +20 -12
- package/dist/cjs/plugins/backend-federation/codegen.js +255 -0
- package/dist/cjs/plugins/backend-federation/config.js +204 -0
- package/dist/cjs/plugins/backend-federation/emit.js +148 -0
- package/dist/cjs/plugins/backendFederationBuild.js +53 -0
- package/dist/cjs/plugins/deploy/index.js +4 -4
- package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +127 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +141 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +139 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +135 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +150 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +205 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/types.js +18 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/utils.js +66 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/worker-manifest.js +208 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +204 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +108 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-plan.js +93 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/identity.js +83 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +188 -0
- package/dist/cjs/{baseline.js → plugins/deploy/platforms/cloudflare-output-verifier/issues.js} +19 -10
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +89 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +151 -0
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +302 -0
- package/dist/cjs/plugins/deploy/platforms/node.js +20 -2
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +250 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +191 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +514 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +1012 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +363 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +93 -0
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +8 -4
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +251 -155
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +78 -39
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.cjs +62 -41
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.mjs +63 -41
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +52 -35
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +53 -35
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.cjs +61 -41
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.mjs +61 -40
- package/dist/cjs/plugins/deploy/utils/npmAliases.js +226 -0
- package/dist/cjs/plugins/ultramodernReleaseEnvelope.js +100 -0
- package/dist/cjs/presetUltramodern.js +33 -2
- package/dist/cjs/ultramodern-release-envelope/canonical.js +68 -0
- package/dist/cjs/ultramodern-release-envelope/framework-output.js +597 -0
- package/dist/cjs/ultramodern-release-envelope/index.js +399 -0
- package/dist/cjs/ultramodern-release-envelope/types.js +51 -0
- package/dist/cjs/ultramodern-release-identity.js +110 -0
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +12 -15
- package/dist/esm/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +15 -12
- package/dist/esm/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +30 -0
- package/dist/esm/builder/shared/bundlerPlugins/RouterPlugin.mjs +24 -10
- package/dist/esm/builder/shared/bundlerPlugins/index.mjs +1 -0
- package/dist/esm/builder/shared/lazyCompilation.mjs +1 -3
- package/dist/esm/commands/index.mjs +0 -1
- package/dist/esm/config/build-environment.mjs +224 -0
- package/dist/esm/config/index.mjs +1 -0
- package/dist/esm/config/public.mjs +1 -0
- package/dist/esm/index.mjs +5 -4
- package/dist/esm/plugins/analyze/getHtmlTemplate.mjs +2 -2
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +17 -1
- package/dist/esm/plugins/analyze/index.mjs +20 -12
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +2 -2
- package/dist/esm/plugins/backend-federation/codegen.mjs +204 -0
- package/dist/esm/plugins/backend-federation/config.mjs +128 -0
- package/dist/esm/plugins/backend-federation/emit.mjs +97 -0
- package/dist/esm/plugins/backendFederationBuild.mjs +1 -0
- package/dist/esm/plugins/deploy/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +64 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +34 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +88 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +97 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +102 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/security-policies.mjs +167 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/types.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/utils.mjs +12 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +148 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +150 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-contract.mjs +31 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-plan.mjs +45 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +45 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +133 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +10 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +51 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +99 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +238 -0
- package/dist/esm/plugins/deploy/platforms/node.mjs +20 -2
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +250 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +191 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +514 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +1012 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +363 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +93 -0
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +8 -4
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +251 -155
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +78 -39
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +62 -41
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.mjs +63 -41
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +52 -35
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +53 -35
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.cjs +61 -41
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.mjs +61 -40
- package/dist/esm/plugins/deploy/utils/npmAliases.mjs +174 -0
- package/dist/esm/plugins/ultramodernReleaseEnvelope.mjs +52 -0
- package/dist/esm/presetUltramodern.mjs +33 -2
- package/dist/esm/ultramodern-release-envelope/canonical.mjs +21 -0
- package/dist/esm/ultramodern-release-envelope/framework-output.mjs +524 -0
- package/dist/esm/ultramodern-release-envelope/index.mjs +335 -0
- package/dist/esm/ultramodern-release-envelope/types.mjs +7 -0
- package/dist/esm/ultramodern-release-identity.mjs +66 -0
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +12 -15
- package/dist/esm-node/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +15 -12
- package/dist/esm-node/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +31 -0
- package/dist/esm-node/builder/shared/bundlerPlugins/RouterPlugin.mjs +24 -10
- package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +1 -0
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +1 -3
- package/dist/esm-node/commands/index.mjs +0 -1
- package/dist/esm-node/config/build-environment.mjs +225 -0
- package/dist/esm-node/config/index.mjs +1 -0
- package/dist/esm-node/config/public.mjs +2 -0
- package/dist/esm-node/index.mjs +5 -4
- package/dist/esm-node/plugins/analyze/getHtmlTemplate.mjs +2 -2
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +17 -1
- package/dist/esm-node/plugins/analyze/index.mjs +20 -12
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +2 -2
- package/dist/esm-node/plugins/backend-federation/codegen.mjs +205 -0
- package/dist/esm-node/plugins/backend-federation/config.mjs +129 -0
- package/dist/esm-node/plugins/backend-federation/emit.mjs +98 -0
- package/dist/esm-node/plugins/backendFederationBuild.mjs +2 -0
- package/dist/esm-node/plugins/deploy/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +65 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +35 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +89 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +98 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +103 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/security-policies.mjs +168 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/types.mjs +1 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/utils.mjs +13 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +149 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +151 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-contract.mjs +32 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-plan.mjs +46 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +46 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +134 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +11 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +52 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +100 -0
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +239 -0
- package/dist/esm-node/plugins/deploy/platforms/node.mjs +20 -2
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +250 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +191 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +514 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +1012 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +363 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +93 -0
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +8 -4
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +251 -155
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +78 -39
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +62 -41
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.mjs +63 -41
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +52 -35
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +53 -35
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.cjs +61 -41
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.mjs +61 -40
- package/dist/esm-node/plugins/deploy/utils/npmAliases.mjs +175 -0
- package/dist/esm-node/plugins/ultramodernReleaseEnvelope.mjs +53 -0
- package/dist/esm-node/presetUltramodern.mjs +33 -2
- package/dist/esm-node/ultramodern-release-envelope/canonical.mjs +22 -0
- package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +525 -0
- package/dist/esm-node/ultramodern-release-envelope/index.mjs +336 -0
- package/dist/esm-node/ultramodern-release-envelope/types.mjs +8 -0
- package/dist/esm-node/ultramodern-release-identity.mjs +67 -0
- package/dist/types/builder/generator/createCopyPattern.d.ts +7 -5
- package/dist/types/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.d.ts +6 -0
- package/dist/types/builder/shared/bundlerPlugins/RouterPlugin.d.ts +1 -0
- package/dist/types/builder/shared/bundlerPlugins/index.d.ts +1 -0
- package/dist/types/builder/shared/lazyCompilation.d.ts +2 -4
- package/dist/types/commands/index.d.ts +0 -1
- package/dist/types/config/build-environment.d.ts +22 -0
- package/dist/types/config/index.d.ts +1 -0
- package/dist/types/config/public.d.ts +2 -0
- package/dist/types/index.d.ts +0 -2
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +1 -0
- package/dist/types/plugins/backend-federation/codegen.d.ts +83 -0
- package/dist/types/plugins/backend-federation/config.d.ts +103 -0
- package/dist/types/plugins/backend-federation/emit.d.ts +13 -0
- package/dist/types/plugins/backendFederationBuild.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +15 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +24 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/delivery-unit.d.ts +23 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/i18n-worker.d.ts +22 -0
- package/dist/types/plugins/deploy/platforms/{cloudflare.d.ts → cloudflare/index.d.ts} +1 -1
- package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +51 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/types.d.ts +5 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/utils.d.ts +6 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/worker-manifest.d.ts +122 -0
- package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +46 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +14 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-plan.d.ts +34 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/identity.d.ts +4 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/index.d.ts +18 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/issues.d.ts +14 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/manifest.d.ts +2 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.d.ts +14 -0
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +20 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts +1 -0
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts +1 -0
- package/dist/types/plugins/deploy/utils/npmAliases.d.ts +14 -0
- package/dist/types/plugins/ultramodernReleaseEnvelope.d.ts +3 -0
- package/dist/types/presetUltramodern.d.ts +10 -0
- package/dist/types/run/index.d.ts +1 -1
- package/dist/types/types/config/cloudflareDeploy.d.ts +41 -0
- package/dist/types/types/config/deploy.d.ts +15 -2
- package/dist/types/ultramodern-release-envelope/canonical.d.ts +5 -0
- package/dist/types/ultramodern-release-envelope/framework-output.d.ts +31 -0
- package/dist/types/ultramodern-release-envelope/index.d.ts +6 -0
- package/dist/types/ultramodern-release-envelope/types.d.ts +62 -0
- package/dist/types/ultramodern-release-identity.d.ts +16 -0
- package/lib/types.d.ts +2 -3
- package/package.json +38 -23
- package/rslib.config.mts +11 -12
- package/dist/cjs/commands/runtime.js +0 -196
- package/dist/cjs/plugins/deploy/platforms/cloudflare.js +0 -540
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
- package/dist/cjs/ultramodern/designSystem.js +0 -123
- package/dist/esm/baseline.mjs +0 -4
- package/dist/esm/commands/runtime.mjs +0 -146
- package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +0 -492
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
- package/dist/esm/ultramodern/designSystem.mjs +0 -73
- package/dist/esm-node/baseline.mjs +0 -5
- package/dist/esm-node/commands/runtime.mjs +0 -147
- package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +0 -493
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
- package/dist/esm-node/ultramodern/designSystem.mjs +0 -74
- package/dist/types/baseline.d.ts +0 -16
- package/dist/types/commands/runtime.d.ts +0 -12
- package/dist/types/ultramodern/designSystem.d.ts +0 -54
- /package/dist/types/plugins/deploy/platforms/templates/{cloudflare-entry.d.mts → cloudflare-entry.006-fetch-handler.d.mts} +0 -0
|
@@ -0,0 +1,399 @@
|
|
|
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
|
+
MICROVERTICAL_RELEASE_ENVELOPE_KIND: ()=>external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND,
|
|
41
|
+
MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION: ()=>external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
|
|
42
|
+
MICROVERTICAL_RELEASE_TARGETS: ()=>external_types_js_namespaceObject.MICROVERTICAL_RELEASE_TARGETS,
|
|
43
|
+
canonicalSerializeMicroVerticalReleaseEnvelope: ()=>external_canonical_js_namespaceObject.canonicalSerializeMicroVerticalReleaseEnvelope,
|
|
44
|
+
createMicroVerticalReleaseEnvelope: ()=>createMicroVerticalReleaseEnvelope,
|
|
45
|
+
verifyMicroVerticalReleaseEnvelope: ()=>verifyMicroVerticalReleaseEnvelope
|
|
46
|
+
});
|
|
47
|
+
const external_node_crypto_namespaceObject = require("node:crypto");
|
|
48
|
+
const promises_namespaceObject = require("node:fs/promises");
|
|
49
|
+
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
50
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
51
|
+
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
52
|
+
const external_canonical_js_namespaceObject = require("./canonical.js");
|
|
53
|
+
const external_types_js_namespaceObject = require("./types.js");
|
|
54
|
+
const SHA256_PATTERN = /^[a-f0-9]{64}$/u;
|
|
55
|
+
const SOURCE_REVISION_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
|
|
56
|
+
const TARGETS = new Set(external_types_js_namespaceObject.MICROVERTICAL_RELEASE_TARGETS);
|
|
57
|
+
const isRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
|
|
58
|
+
const assertRecord = (value, location)=>{
|
|
59
|
+
if (!isRecord(value)) throw new Error(`${location} must be an object.`);
|
|
60
|
+
return value;
|
|
61
|
+
};
|
|
62
|
+
const assertExactKeys = (value, expected, location)=>{
|
|
63
|
+
const expectedKeys = new Set(expected);
|
|
64
|
+
for (const key of Object.keys(value))if (!expectedKeys.has(key)) throw new Error(`${location} contains unknown field "${key}".`);
|
|
65
|
+
for (const key of expected)if (!(key in value)) throw new Error(`${location}.${key} is required.`);
|
|
66
|
+
};
|
|
67
|
+
const assertNonEmptyString = (value, location)=>{
|
|
68
|
+
if ('string' != typeof value || 0 === value.trim().length) throw new Error(`${location} must be a non-empty string.`);
|
|
69
|
+
if (value !== value.trim()) throw new Error(`${location} must not contain surrounding whitespace.`);
|
|
70
|
+
return value;
|
|
71
|
+
};
|
|
72
|
+
const assertTarget = (value, location = 'target')=>{
|
|
73
|
+
const target = assertNonEmptyString(value, location);
|
|
74
|
+
if (!TARGETS.has(target)) throw new Error(`${location} must be one of: ${external_types_js_namespaceObject.MICROVERTICAL_RELEASE_TARGETS.join(', ')}.`);
|
|
75
|
+
return target;
|
|
76
|
+
};
|
|
77
|
+
const assertReleaseIdentity = (value, location = 'identity')=>{
|
|
78
|
+
const identity = assertRecord(value, location);
|
|
79
|
+
assertExactKeys(identity, [
|
|
80
|
+
'unitId',
|
|
81
|
+
'buildMarker',
|
|
82
|
+
'sourceRevision',
|
|
83
|
+
'releaseVersion'
|
|
84
|
+
], location);
|
|
85
|
+
const sourceRevision = assertNonEmptyString(identity.sourceRevision, `${location}.sourceRevision`);
|
|
86
|
+
if (!SOURCE_REVISION_PATTERN.test(sourceRevision)) throw new Error(`${location}.sourceRevision must be an exact lowercase 40- or 64-character Git object ID; "${sourceRevision}" is not promotable.`);
|
|
87
|
+
return {
|
|
88
|
+
unitId: assertNonEmptyString(identity.unitId, `${location}.unitId`),
|
|
89
|
+
buildMarker: assertNonEmptyString(identity.buildMarker, `${location}.buildMarker`),
|
|
90
|
+
sourceRevision,
|
|
91
|
+
releaseVersion: assertNonEmptyString(identity.releaseVersion, `${location}.releaseVersion`)
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
const assertNormalizedLogicalPath = (value, location)=>{
|
|
95
|
+
const logicalPath = assertNonEmptyString(value, location);
|
|
96
|
+
if (logicalPath.includes('\\') || external_node_path_default().posix.isAbsolute(logicalPath) || external_node_path_default().posix.normalize(logicalPath) !== logicalPath || '.' === logicalPath || logicalPath.split('/').some((segment)=>'..' === segment || '.' === segment)) throw new Error(`${location} must be a normalized relative POSIX path.`);
|
|
97
|
+
return logicalPath;
|
|
98
|
+
};
|
|
99
|
+
const isPathInside = (root, candidate)=>{
|
|
100
|
+
const relative = external_node_path_default().relative(root, candidate);
|
|
101
|
+
return '' === relative || !relative.startsWith(`..${external_node_path_default().sep}`) && '..' !== relative && !external_node_path_default().isAbsolute(relative);
|
|
102
|
+
};
|
|
103
|
+
const assertArtifactInput = (value, location)=>{
|
|
104
|
+
const artifact = assertRecord(value, location);
|
|
105
|
+
assertExactKeys(artifact, [
|
|
106
|
+
'logicalPath',
|
|
107
|
+
'runtime'
|
|
108
|
+
], location);
|
|
109
|
+
return {
|
|
110
|
+
logicalPath: assertNormalizedLogicalPath(artifact.logicalPath, `${location}.logicalPath`),
|
|
111
|
+
runtime: assertNonEmptyString(artifact.runtime, `${location}.runtime`)
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
const readFinalArtifact = async (artifactRoot, input, resolvedLogicalPath = input.logicalPath)=>{
|
|
115
|
+
const artifactInput = {
|
|
116
|
+
logicalPath: input.logicalPath,
|
|
117
|
+
runtime: input.runtime
|
|
118
|
+
};
|
|
119
|
+
const logicalPath = assertNormalizedLogicalPath(resolvedLogicalPath, `staged path for ${input.logicalPath}`);
|
|
120
|
+
const resolvedRoot = external_node_path_default().resolve(artifactRoot);
|
|
121
|
+
const logicalSegments = logicalPath.split('/');
|
|
122
|
+
const lexicalPath = external_node_path_default().resolve(resolvedRoot, ...logicalSegments);
|
|
123
|
+
if (!isPathInside(resolvedRoot, lexicalPath)) throw new Error(`Artifact logicalPath "${logicalPath}" resolves outside artifactRoot.`);
|
|
124
|
+
const realRoot = await promises_default().realpath(resolvedRoot);
|
|
125
|
+
for(let index = 0; index < logicalSegments.length - 1; index++){
|
|
126
|
+
const linkLogicalPath = logicalSegments.slice(0, index + 1).join('/');
|
|
127
|
+
const candidate = external_node_path_default().join(resolvedRoot, ...logicalSegments.slice(0, index + 1));
|
|
128
|
+
let candidateStat;
|
|
129
|
+
try {
|
|
130
|
+
candidateStat = await promises_default().lstat(candidate);
|
|
131
|
+
} catch {
|
|
132
|
+
throw new Error(`Artifact "${logicalPath}" does not exist.`);
|
|
133
|
+
}
|
|
134
|
+
if (candidateStat.isSymbolicLink()) throw new Error(`Artifact "${logicalPath}" traverses symbolic-link ancestor "${linkLogicalPath}"; bind the symbolic link itself.`);
|
|
135
|
+
}
|
|
136
|
+
let lexicalStat;
|
|
137
|
+
try {
|
|
138
|
+
lexicalStat = await promises_default().lstat(lexicalPath);
|
|
139
|
+
} catch {
|
|
140
|
+
throw new Error(`Artifact "${logicalPath}" does not exist.`);
|
|
141
|
+
}
|
|
142
|
+
if (lexicalStat.isSymbolicLink()) {
|
|
143
|
+
let realTarget;
|
|
144
|
+
try {
|
|
145
|
+
realTarget = await promises_default().realpath(lexicalPath);
|
|
146
|
+
} catch {
|
|
147
|
+
throw new Error(`Artifact symbolic link "${logicalPath}" cannot be resolved.`);
|
|
148
|
+
}
|
|
149
|
+
if (!isPathInside(realRoot, realTarget)) throw new Error(`Artifact logicalPath "${logicalPath}" resolves outside artifactRoot.`);
|
|
150
|
+
const targetStat = await promises_default().stat(realTarget);
|
|
151
|
+
const targetKind = targetStat.isFile() ? 'file' : targetStat.isDirectory() ? 'directory' : void 0;
|
|
152
|
+
if (!targetKind) throw new Error(`Artifact symbolic link "${logicalPath}" must resolve to a file or directory.`);
|
|
153
|
+
const targetLogicalPath = external_node_path_default().relative(realRoot, realTarget).split(external_node_path_default().sep).join('/');
|
|
154
|
+
if ('release' === targetLogicalPath || targetLogicalPath.startsWith('release/')) throw new Error(`Artifact symbolic link "${logicalPath}" targets private release metadata.`);
|
|
155
|
+
if ('directory' === targetKind && isPathInside(realTarget, await promises_default().realpath(external_node_path_default().dirname(lexicalPath)))) throw new Error(`Artifact symbolic link "${logicalPath}" targets an ancestor directory.`);
|
|
156
|
+
return {
|
|
157
|
+
...artifactInput,
|
|
158
|
+
kind: 'symbolic-link',
|
|
159
|
+
linkTarget: await promises_default().readlink(lexicalPath),
|
|
160
|
+
targetKind,
|
|
161
|
+
targetLogicalPath
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
if (!lexicalStat.isFile()) throw new Error(`Artifact "${logicalPath}" must be a file or symlink.`);
|
|
165
|
+
const realPath = await promises_default().realpath(lexicalPath);
|
|
166
|
+
if (!isPathInside(realRoot, realPath)) throw new Error(`Artifact logicalPath "${logicalPath}" resolves outside artifactRoot.`);
|
|
167
|
+
const bytes = await promises_default().readFile(realPath);
|
|
168
|
+
return {
|
|
169
|
+
...artifactInput,
|
|
170
|
+
kind: 'file',
|
|
171
|
+
byteLength: bytes.byteLength,
|
|
172
|
+
sha256: (0, external_node_crypto_namespaceObject.createHash)('sha256').update(bytes).digest('hex')
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
const assertReleaseArtifact = (value, location)=>{
|
|
176
|
+
const artifact = assertRecord(value, location);
|
|
177
|
+
const kind = assertNonEmptyString(artifact.kind, `${location}.kind`);
|
|
178
|
+
const input = {
|
|
179
|
+
logicalPath: artifact.logicalPath,
|
|
180
|
+
runtime: artifact.runtime
|
|
181
|
+
};
|
|
182
|
+
if ('file' === kind) {
|
|
183
|
+
assertExactKeys(artifact, [
|
|
184
|
+
'kind',
|
|
185
|
+
'logicalPath',
|
|
186
|
+
'runtime',
|
|
187
|
+
'byteLength',
|
|
188
|
+
'sha256'
|
|
189
|
+
], location);
|
|
190
|
+
const byteLength = artifact.byteLength;
|
|
191
|
+
if ('number' != typeof byteLength || !Number.isSafeInteger(byteLength) || byteLength < 0) throw new Error(`${location}.byteLength must be a non-negative integer.`);
|
|
192
|
+
const sha256 = assertNonEmptyString(artifact.sha256, `${location}.sha256`);
|
|
193
|
+
if (!SHA256_PATTERN.test(sha256)) throw new Error(`${location}.sha256 must be a lowercase SHA-256 digest.`);
|
|
194
|
+
return {
|
|
195
|
+
...assertArtifactInput(input, location),
|
|
196
|
+
kind,
|
|
197
|
+
byteLength,
|
|
198
|
+
sha256
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
if ('symbolic-link' === kind) {
|
|
202
|
+
assertExactKeys(artifact, [
|
|
203
|
+
'kind',
|
|
204
|
+
'logicalPath',
|
|
205
|
+
'runtime',
|
|
206
|
+
'linkTarget',
|
|
207
|
+
'targetKind',
|
|
208
|
+
'targetLogicalPath'
|
|
209
|
+
], location);
|
|
210
|
+
const targetKind = assertNonEmptyString(artifact.targetKind, `${location}.targetKind`);
|
|
211
|
+
if ('directory' !== targetKind && 'file' !== targetKind) throw new Error(`${location}.targetKind must be "directory" or "file".`);
|
|
212
|
+
return {
|
|
213
|
+
...assertArtifactInput(input, location),
|
|
214
|
+
kind,
|
|
215
|
+
linkTarget: assertNonEmptyString(artifact.linkTarget, `${location}.linkTarget`),
|
|
216
|
+
targetKind,
|
|
217
|
+
targetLogicalPath: assertNormalizedLogicalPath(artifact.targetLogicalPath, `${location}.targetLogicalPath`)
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
throw new Error(`${location}.kind must be "file" or "symbolic-link".`);
|
|
221
|
+
};
|
|
222
|
+
const assertUniqueSortedArtifacts = (artifacts, location)=>{
|
|
223
|
+
const paths = artifacts.map((artifact)=>artifact.logicalPath);
|
|
224
|
+
const unique = new Set(paths);
|
|
225
|
+
if (unique.size !== paths.length) {
|
|
226
|
+
const duplicate = paths.find((logicalPath, index)=>paths.indexOf(logicalPath) !== index);
|
|
227
|
+
throw new Error(`Duplicate artifact logicalPath "${duplicate}".`);
|
|
228
|
+
}
|
|
229
|
+
const sorted = [
|
|
230
|
+
...paths
|
|
231
|
+
].sort((left, right)=>left.localeCompare(right));
|
|
232
|
+
if (paths.some((logicalPath, index)=>logicalPath !== sorted[index])) throw new Error(`${location} must be sorted by logicalPath.`);
|
|
233
|
+
};
|
|
234
|
+
const assertSurfacePaths = (value, location)=>{
|
|
235
|
+
if (!Array.isArray(value) || 0 === value.length) throw new Error(`${location} must contain at least one artifact path.`);
|
|
236
|
+
const paths = value.map((item, index)=>assertNormalizedLogicalPath(item, `${location}[${index}]`));
|
|
237
|
+
const sorted = [
|
|
238
|
+
...paths
|
|
239
|
+
].sort((left, right)=>left.localeCompare(right));
|
|
240
|
+
if (paths.some((logicalPath, index)=>logicalPath !== sorted[index])) throw new Error(`${location} must be sorted by logicalPath.`);
|
|
241
|
+
if (new Set(paths).size !== paths.length) throw new Error(`${location} must not contain duplicate artifact paths.`);
|
|
242
|
+
return paths;
|
|
243
|
+
};
|
|
244
|
+
const assertSurfaces = (value)=>{
|
|
245
|
+
const surfaces = assertRecord(value, 'surfaces');
|
|
246
|
+
assertExactKeys(surfaces, [
|
|
247
|
+
'uiClient',
|
|
248
|
+
'ssr',
|
|
249
|
+
'apiBackend',
|
|
250
|
+
'backendFederation'
|
|
251
|
+
], 'surfaces');
|
|
252
|
+
const backendFederation = assertRecord(surfaces.backendFederation, 'surfaces.backendFederation');
|
|
253
|
+
assertExactKeys(backendFederation, [
|
|
254
|
+
'manifest',
|
|
255
|
+
'container'
|
|
256
|
+
], 'surfaces.backendFederation');
|
|
257
|
+
return {
|
|
258
|
+
uiClient: assertSurfacePaths(surfaces.uiClient, 'surfaces.uiClient'),
|
|
259
|
+
ssr: assertSurfacePaths(surfaces.ssr, 'surfaces.ssr'),
|
|
260
|
+
apiBackend: assertSurfacePaths(surfaces.apiBackend, 'surfaces.apiBackend'),
|
|
261
|
+
backendFederation: {
|
|
262
|
+
manifest: assertNormalizedLogicalPath(backendFederation.manifest, 'surfaces.backendFederation.manifest'),
|
|
263
|
+
container: assertNormalizedLogicalPath(backendFederation.container, 'surfaces.backendFederation.container')
|
|
264
|
+
}
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
const assertSurfaceReferences = (artifacts, surfaces)=>{
|
|
268
|
+
const artifactPaths = new Set(artifacts.map((artifact)=>artifact.logicalPath));
|
|
269
|
+
for (const [surface, paths] of Object.entries({
|
|
270
|
+
uiClient: surfaces.uiClient,
|
|
271
|
+
ssr: surfaces.ssr,
|
|
272
|
+
apiBackend: surfaces.apiBackend,
|
|
273
|
+
'backendFederation.manifest': [
|
|
274
|
+
surfaces.backendFederation.manifest
|
|
275
|
+
],
|
|
276
|
+
'backendFederation.container': [
|
|
277
|
+
surfaces.backendFederation.container
|
|
278
|
+
]
|
|
279
|
+
}))for (const logicalPath of paths)if (!artifactPaths.has(logicalPath)) throw new Error(`surfaces.${surface} references unbound artifact "${logicalPath}".`);
|
|
280
|
+
};
|
|
281
|
+
const assertTargetSurfaceContract = (target, artifacts, surfaces)=>{
|
|
282
|
+
const byPath = new Map(artifacts.map((artifact)=>[
|
|
283
|
+
artifact.logicalPath,
|
|
284
|
+
artifact
|
|
285
|
+
]));
|
|
286
|
+
const assertRuntime = (paths, expected, surface)=>{
|
|
287
|
+
for (const logicalPath of paths){
|
|
288
|
+
const artifact = byPath.get(logicalPath);
|
|
289
|
+
if (artifact?.runtime !== expected) throw new Error(`${target} ${surface} artifact "${logicalPath}" must use runtime "${expected}"; received "${String(artifact?.runtime)}".`);
|
|
290
|
+
if ('kind' in artifact && 'file' !== artifact.kind) throw new Error(`${target} ${surface} artifact "${logicalPath}" must be a file.`);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
assertRuntime(surfaces.uiClient, 'browser', 'UI/client');
|
|
294
|
+
assertRuntime(surfaces.ssr, 'node' === target ? 'nodejs' : 'workerd', 'SSR');
|
|
295
|
+
assertRuntime(surfaces.apiBackend, 'node' === target ? 'nodejs' : 'workerd-effect', 'API/backend');
|
|
296
|
+
assertRuntime([
|
|
297
|
+
surfaces.backendFederation.manifest
|
|
298
|
+
], 'module-federation-manifest', 'backend federation manifest');
|
|
299
|
+
assertRuntime([
|
|
300
|
+
surfaces.backendFederation.container
|
|
301
|
+
], 'node' === target ? 'nodejs' : 'commonjs-module', 'backend federation container');
|
|
302
|
+
};
|
|
303
|
+
const deepFreeze = (value)=>{
|
|
304
|
+
if (null !== value && 'object' == typeof value && !Object.isFrozen(value)) {
|
|
305
|
+
Object.freeze(value);
|
|
306
|
+
for (const child of Object.values(value))deepFreeze(child);
|
|
307
|
+
}
|
|
308
|
+
return value;
|
|
309
|
+
};
|
|
310
|
+
const assertEnvelope = (value)=>{
|
|
311
|
+
const envelope = assertRecord(value, 'envelope');
|
|
312
|
+
assertExactKeys(envelope, [
|
|
313
|
+
'schemaVersion',
|
|
314
|
+
'kind',
|
|
315
|
+
'target',
|
|
316
|
+
'identity',
|
|
317
|
+
'artifacts',
|
|
318
|
+
'surfaces',
|
|
319
|
+
'envelopeDigest'
|
|
320
|
+
], 'envelope');
|
|
321
|
+
if (envelope.schemaVersion !== external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION) throw new Error(`envelope.schemaVersion must be ${external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION}.`);
|
|
322
|
+
if (envelope.kind !== external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND) throw new Error(`envelope.kind must be "${external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND}".`);
|
|
323
|
+
if (!Array.isArray(envelope.artifacts) || 0 === envelope.artifacts.length) throw new Error('envelope.artifacts must contain at least one artifact.');
|
|
324
|
+
const artifacts = envelope.artifacts.map((artifact, index)=>assertReleaseArtifact(artifact, `envelope.artifacts[${index}]`));
|
|
325
|
+
assertUniqueSortedArtifacts(artifacts, 'envelope.artifacts');
|
|
326
|
+
const target = assertTarget(envelope.target, 'envelope.target');
|
|
327
|
+
const surfaces = assertSurfaces(envelope.surfaces);
|
|
328
|
+
assertSurfaceReferences(artifacts, surfaces);
|
|
329
|
+
assertTargetSurfaceContract(target, artifacts, surfaces);
|
|
330
|
+
const parsed = {
|
|
331
|
+
schemaVersion: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
|
|
332
|
+
kind: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND,
|
|
333
|
+
target,
|
|
334
|
+
identity: assertReleaseIdentity(envelope.identity, 'envelope.identity'),
|
|
335
|
+
artifacts,
|
|
336
|
+
surfaces,
|
|
337
|
+
envelopeDigest: assertNonEmptyString(envelope.envelopeDigest, 'envelope.envelopeDigest')
|
|
338
|
+
};
|
|
339
|
+
if (!SHA256_PATTERN.test(parsed.envelopeDigest)) throw new Error('envelope.envelopeDigest must be a lowercase SHA-256 digest.');
|
|
340
|
+
const expectedDigest = (0, external_canonical_js_namespaceObject.digestMicroVerticalReleaseEnvelopePayload)((0, external_canonical_js_namespaceObject.releaseEnvelopePayload)(parsed));
|
|
341
|
+
if (parsed.envelopeDigest !== expectedDigest) throw new Error('envelope.envelopeDigest does not match canonical payload.');
|
|
342
|
+
return parsed;
|
|
343
|
+
};
|
|
344
|
+
const createMicroVerticalReleaseEnvelope = async (input)=>{
|
|
345
|
+
const artifactRoot = await promises_default().realpath(external_node_path_default().resolve(input.artifactRoot));
|
|
346
|
+
const target = assertTarget(input.target);
|
|
347
|
+
const identity = assertReleaseIdentity(input.identity);
|
|
348
|
+
if (!Array.isArray(input.artifacts) || 0 === input.artifacts.length) throw new Error('artifacts must contain at least one artifact.');
|
|
349
|
+
const inputs = input.artifacts.map((artifact, index)=>assertArtifactInput(artifact, `artifacts[${index}]`));
|
|
350
|
+
const sortedInputs = [
|
|
351
|
+
...inputs
|
|
352
|
+
].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath));
|
|
353
|
+
assertUniqueSortedArtifacts(sortedInputs, 'artifacts');
|
|
354
|
+
const surfaces = assertSurfaces(input.surfaces);
|
|
355
|
+
assertSurfaceReferences(sortedInputs, surfaces);
|
|
356
|
+
assertTargetSurfaceContract(target, sortedInputs, surfaces);
|
|
357
|
+
const artifacts = await Promise.all(sortedInputs.map((artifact)=>readFinalArtifact(artifactRoot, artifact)));
|
|
358
|
+
assertTargetSurfaceContract(target, artifacts, surfaces);
|
|
359
|
+
const payload = {
|
|
360
|
+
schemaVersion: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
|
|
361
|
+
kind: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND,
|
|
362
|
+
target,
|
|
363
|
+
identity,
|
|
364
|
+
artifacts,
|
|
365
|
+
surfaces
|
|
366
|
+
};
|
|
367
|
+
return deepFreeze({
|
|
368
|
+
...payload,
|
|
369
|
+
envelopeDigest: (0, external_canonical_js_namespaceObject.digestMicroVerticalReleaseEnvelopePayload)(payload)
|
|
370
|
+
});
|
|
371
|
+
};
|
|
372
|
+
const verifyMicroVerticalReleaseEnvelope = async (value, options)=>{
|
|
373
|
+
const envelope = assertEnvelope(value);
|
|
374
|
+
if (void 0 !== options.expectedTarget && envelope.target !== options.expectedTarget) throw new Error(`envelope.target must be "${options.expectedTarget}" for this staging target; received "${envelope.target}".`);
|
|
375
|
+
const artifactRoot = await promises_default().realpath(external_node_path_default().resolve(options.artifactRoot));
|
|
376
|
+
for (const artifact of envelope.artifacts){
|
|
377
|
+
const finalArtifact = await readFinalArtifact(artifactRoot, artifact, options.logicalPathForArtifact?.(artifact) ?? artifact.logicalPath);
|
|
378
|
+
const matches = finalArtifact.kind === artifact.kind && ('file' === artifact.kind && 'file' === finalArtifact.kind ? finalArtifact.byteLength === artifact.byteLength && finalArtifact.sha256 === artifact.sha256 : 'symbolic-link' === artifact.kind && 'symbolic-link' === finalArtifact.kind && finalArtifact.linkTarget === artifact.linkTarget && finalArtifact.targetKind === artifact.targetKind && finalArtifact.targetLogicalPath === artifact.targetLogicalPath);
|
|
379
|
+
if (!matches) throw new Error('file' === artifact.kind && 'file' === finalArtifact.kind ? `Artifact "${artifact.logicalPath}" digest does not match final artifact bytes.` : `Artifact "${artifact.logicalPath}" does not match its final filesystem binding.`);
|
|
380
|
+
}
|
|
381
|
+
return deepFreeze(envelope);
|
|
382
|
+
};
|
|
383
|
+
exports.MICROVERTICAL_RELEASE_ENVELOPE_KIND = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_KIND;
|
|
384
|
+
exports.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION;
|
|
385
|
+
exports.MICROVERTICAL_RELEASE_TARGETS = __webpack_exports__.MICROVERTICAL_RELEASE_TARGETS;
|
|
386
|
+
exports.canonicalSerializeMicroVerticalReleaseEnvelope = __webpack_exports__.canonicalSerializeMicroVerticalReleaseEnvelope;
|
|
387
|
+
exports.createMicroVerticalReleaseEnvelope = __webpack_exports__.createMicroVerticalReleaseEnvelope;
|
|
388
|
+
exports.verifyMicroVerticalReleaseEnvelope = __webpack_exports__.verifyMicroVerticalReleaseEnvelope;
|
|
389
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
390
|
+
"MICROVERTICAL_RELEASE_ENVELOPE_KIND",
|
|
391
|
+
"MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION",
|
|
392
|
+
"MICROVERTICAL_RELEASE_TARGETS",
|
|
393
|
+
"canonicalSerializeMicroVerticalReleaseEnvelope",
|
|
394
|
+
"createMicroVerticalReleaseEnvelope",
|
|
395
|
+
"verifyMicroVerticalReleaseEnvelope"
|
|
396
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
397
|
+
Object.defineProperty(exports, '__esModule', {
|
|
398
|
+
value: true
|
|
399
|
+
});
|
|
@@ -0,0 +1,51 @@
|
|
|
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 MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION = 3;
|
|
31
|
+
const MICROVERTICAL_RELEASE_ENVELOPE_KIND = 'ultramodern-target-microvertical-release-envelope';
|
|
32
|
+
const MICROVERTICAL_RELEASE_TARGETS = [
|
|
33
|
+
'node',
|
|
34
|
+
'cloudflare'
|
|
35
|
+
];
|
|
36
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
37
|
+
MICROVERTICAL_RELEASE_ENVELOPE_KIND: MICROVERTICAL_RELEASE_ENVELOPE_KIND,
|
|
38
|
+
MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION: MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
|
|
39
|
+
MICROVERTICAL_RELEASE_TARGETS: MICROVERTICAL_RELEASE_TARGETS
|
|
40
|
+
});
|
|
41
|
+
exports.MICROVERTICAL_RELEASE_ENVELOPE_KIND = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_KIND;
|
|
42
|
+
exports.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION;
|
|
43
|
+
exports.MICROVERTICAL_RELEASE_TARGETS = __webpack_exports__.MICROVERTICAL_RELEASE_TARGETS;
|
|
44
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
45
|
+
"MICROVERTICAL_RELEASE_ENVELOPE_KIND",
|
|
46
|
+
"MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION",
|
|
47
|
+
"MICROVERTICAL_RELEASE_TARGETS"
|
|
48
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
49
|
+
Object.defineProperty(exports, '__esModule', {
|
|
50
|
+
value: true
|
|
51
|
+
});
|
|
@@ -0,0 +1,110 @@
|
|
|
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
|
+
createUltramodernReleaseBuildMarker: ()=>createUltramodernReleaseBuildMarker,
|
|
32
|
+
resolveUltramodernReleaseIdentity: ()=>resolveUltramodernReleaseIdentity,
|
|
33
|
+
resolveUltramodernSourceRevision: ()=>resolveUltramodernSourceRevision
|
|
34
|
+
});
|
|
35
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
36
|
+
const external_node_crypto_namespaceObject = require("node:crypto");
|
|
37
|
+
const BUILD_MARKER_NAMESPACE = 'ultramodern-delivery-unit-release-build-marker:v1';
|
|
38
|
+
const PROMOTABLE_SOURCE_REVISION_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
|
|
39
|
+
const gitOutput = (workspaceRoot, args)=>{
|
|
40
|
+
try {
|
|
41
|
+
return (0, external_node_child_process_namespaceObject.execFileSync)('git', [
|
|
42
|
+
'-C',
|
|
43
|
+
workspaceRoot,
|
|
44
|
+
...args
|
|
45
|
+
], {
|
|
46
|
+
encoding: 'utf8',
|
|
47
|
+
stdio: [
|
|
48
|
+
'ignore',
|
|
49
|
+
'pipe',
|
|
50
|
+
'ignore'
|
|
51
|
+
]
|
|
52
|
+
}).trim();
|
|
53
|
+
} catch {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const createUltramodernReleaseBuildMarker = ({ generationBuildMarker, sourceRevision, unitId })=>(0, external_node_crypto_namespaceObject.createHash)('sha256').update(`${BUILD_MARKER_NAMESPACE}:${unitId}:${generationBuildMarker}:${sourceRevision}`).digest('hex').slice(0, 16);
|
|
58
|
+
const resolveUltramodernSourceRevision = (workspaceRoot = process.cwd(), configuredSourceRevision)=>{
|
|
59
|
+
const configuredArgumentValue = configuredSourceRevision?.trim();
|
|
60
|
+
const configuredEnvironmentValue = process.env.ULTRAMODERN_SOURCE_REVISION?.trim();
|
|
61
|
+
const configuredArgument = configuredArgumentValue && 'workspace' !== configuredArgumentValue ? configuredArgumentValue : void 0;
|
|
62
|
+
const configuredEnvironment = configuredEnvironmentValue && 'workspace' !== configuredEnvironmentValue ? configuredEnvironmentValue : void 0;
|
|
63
|
+
if (configuredArgument && configuredEnvironment && configuredArgument !== configuredEnvironment) throw new Error(`Configured source revision ${configuredArgument} does not match environment source revision ${configuredEnvironment}.`);
|
|
64
|
+
const configured = configuredArgument ?? configuredEnvironment;
|
|
65
|
+
const gitRoot = gitOutput(workspaceRoot, [
|
|
66
|
+
'rev-parse',
|
|
67
|
+
'--show-toplevel'
|
|
68
|
+
]);
|
|
69
|
+
if (!gitRoot) {
|
|
70
|
+
if (!configured) return 'workspace';
|
|
71
|
+
if (!PROMOTABLE_SOURCE_REVISION_PATTERN.test(configured)) throw new Error(`Configured source revision ${configured} must be an exact lowercase 40- or 64-character Git object ID.`);
|
|
72
|
+
return configured;
|
|
73
|
+
}
|
|
74
|
+
const revision = gitOutput(gitRoot, [
|
|
75
|
+
'rev-parse',
|
|
76
|
+
'HEAD'
|
|
77
|
+
]);
|
|
78
|
+
const status = gitOutput(gitRoot, [
|
|
79
|
+
'status',
|
|
80
|
+
'--porcelain=v1',
|
|
81
|
+
'--untracked-files=all'
|
|
82
|
+
]);
|
|
83
|
+
if (!revision || void 0 === status || status.length > 0) return 'workspace';
|
|
84
|
+
if (!PROMOTABLE_SOURCE_REVISION_PATTERN.test(revision)) return 'workspace';
|
|
85
|
+
if (configured && configured !== revision) throw new Error(`Configured source revision ${configured} does not match clean Git HEAD ${revision}.`);
|
|
86
|
+
return revision;
|
|
87
|
+
};
|
|
88
|
+
const resolveUltramodernReleaseIdentity = ({ generationBuildMarker, sourceRevision: configuredSourceRevision, unitId, workspaceRoot })=>{
|
|
89
|
+
const explicitSourceRevision = configuredSourceRevision?.trim();
|
|
90
|
+
const sourceRevision = resolveUltramodernSourceRevision(workspaceRoot, explicitSourceRevision);
|
|
91
|
+
return {
|
|
92
|
+
buildMarker: 'workspace' === sourceRevision ? generationBuildMarker : createUltramodernReleaseBuildMarker({
|
|
93
|
+
generationBuildMarker,
|
|
94
|
+
sourceRevision,
|
|
95
|
+
unitId
|
|
96
|
+
}),
|
|
97
|
+
sourceRevision
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
exports.createUltramodernReleaseBuildMarker = __webpack_exports__.createUltramodernReleaseBuildMarker;
|
|
101
|
+
exports.resolveUltramodernReleaseIdentity = __webpack_exports__.resolveUltramodernReleaseIdentity;
|
|
102
|
+
exports.resolveUltramodernSourceRevision = __webpack_exports__.resolveUltramodernSourceRevision;
|
|
103
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
104
|
+
"createUltramodernReleaseBuildMarker",
|
|
105
|
+
"resolveUltramodernReleaseIdentity",
|
|
106
|
+
"resolveUltramodernSourceRevision"
|
|
107
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
108
|
+
Object.defineProperty(exports, '__esModule', {
|
|
109
|
+
value: true
|
|
110
|
+
});
|
|
@@ -2,6 +2,7 @@ import node_fs from "node:fs";
|
|
|
2
2
|
import node_path from "node:path";
|
|
3
3
|
import { SERVICE_WORKER_ENVIRONMENT_NAME } from "@modern-js/builder";
|
|
4
4
|
import { isProd, isSSR, isServiceWorker, isUseRsc, isUseSSRBundle } from "@modern-js/utils";
|
|
5
|
+
import { CLOUDFLARE_WORKER_NODE_BUILTINS } from "../../plugins/deploy/platforms/cloudflare-output-contract.mjs";
|
|
5
6
|
const BFF_EFFECT_WORKER_ENTRY_NAME = '__modern_bff_effect';
|
|
6
7
|
const BFF_EFFECT_WORKER_RUNTIME_QUERY = 'modern-bff-runtime';
|
|
7
8
|
const JS_OR_TS_EXTS = [
|
|
@@ -14,20 +15,6 @@ const JS_OR_TS_EXTS = [
|
|
|
14
15
|
'.cjs',
|
|
15
16
|
'.cts'
|
|
16
17
|
];
|
|
17
|
-
const CLOUDFLARE_WORKER_NODE_BUILTINS = [
|
|
18
|
-
'async_hooks',
|
|
19
|
-
'buffer',
|
|
20
|
-
'crypto',
|
|
21
|
-
'events',
|
|
22
|
-
'fs/promises',
|
|
23
|
-
'module',
|
|
24
|
-
'path',
|
|
25
|
-
'process',
|
|
26
|
-
'stream',
|
|
27
|
-
'string_decoder',
|
|
28
|
-
'url',
|
|
29
|
-
'util'
|
|
30
|
-
];
|
|
31
18
|
const CLOUDFLARE_WORKER_COMPAT_TEMPLATE_DIR = node_path.resolve(__dirname, '../../plugins/deploy/platforms/templates');
|
|
32
19
|
function findExistingFile(candidates) {
|
|
33
20
|
return candidates.find((candidate)=>node_fs.existsSync(candidate));
|
|
@@ -258,7 +245,17 @@ function getBuilderEnvironments(normalizedConfig, appContext, tempBuilderConfig)
|
|
|
258
245
|
});
|
|
259
246
|
chain.output.module(true).library({
|
|
260
247
|
type: 'module'
|
|
261
|
-
}).chunkFormat('module').chunkLoading('import').workerChunkLoading('import');
|
|
248
|
+
}).publicPath('/').chunkFormat('module').chunkLoading('import').workerChunkLoading('import');
|
|
249
|
+
chain.optimization.usedExports(false).providedExports(true).innerGraph(false).sideEffects(false);
|
|
250
|
+
for (const condition of [
|
|
251
|
+
'workerd',
|
|
252
|
+
'worker',
|
|
253
|
+
'webpack',
|
|
254
|
+
isProd() ? 'production' : 'development',
|
|
255
|
+
'import',
|
|
256
|
+
'require',
|
|
257
|
+
'module'
|
|
258
|
+
])chain.resolve.conditionNames.add(condition);
|
|
262
259
|
chain.plugins.delete('plugin-module-federation');
|
|
263
260
|
if (tanstackRouterSsrServerFile) {
|
|
264
261
|
chain.resolve.alias.set('@tanstack/router-core/ssr/server$', tanstackRouterSsrServerFile);
|
|
@@ -30,10 +30,19 @@ const mergeCompressionOptions = (base, next)=>{
|
|
|
30
30
|
...base,
|
|
31
31
|
...next
|
|
32
32
|
};
|
|
33
|
-
if (base.compressionOptions || next.compressionOptions)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
if (base.compressionOptions || next.compressionOptions) {
|
|
34
|
+
const baseCompressionOptions = base.compressionOptions;
|
|
35
|
+
const nextCompressionOptions = next.compressionOptions;
|
|
36
|
+
const mergedCompressionOptions = {
|
|
37
|
+
...baseCompressionOptions,
|
|
38
|
+
...nextCompressionOptions
|
|
39
|
+
};
|
|
40
|
+
if (baseCompressionOptions?.params || nextCompressionOptions?.params) mergedCompressionOptions.params = {
|
|
41
|
+
...baseCompressionOptions?.params,
|
|
42
|
+
...nextCompressionOptions?.params
|
|
43
|
+
};
|
|
44
|
+
merged.compressionOptions = mergedCompressionOptions;
|
|
45
|
+
}
|
|
37
46
|
return merged;
|
|
38
47
|
};
|
|
39
48
|
const resolveCodecOptions = (codecConfig, createDefaultOptions)=>{
|