@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.5 → 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,268 @@
|
|
|
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
|
+
getBuildConfigEnvironment: ()=>getBuildConfigEnvironment,
|
|
32
|
+
resolveEffectTsgoCompiler: ()=>resolveEffectTsgoCompiler,
|
|
33
|
+
withBuildConfigEnvironment: ()=>withBuildConfigEnvironment
|
|
34
|
+
});
|
|
35
|
+
const external_node_child_process_namespaceObject = require("node:child_process");
|
|
36
|
+
const external_node_crypto_namespaceObject = require("node:crypto");
|
|
37
|
+
const external_node_fs_namespaceObject = require("node:fs");
|
|
38
|
+
const external_node_module_namespaceObject = require("node:module");
|
|
39
|
+
const external_node_os_namespaceObject = require("node:os");
|
|
40
|
+
const external_node_path_namespaceObject = require("node:path");
|
|
41
|
+
const EFFECT_TSGO_PACKAGE = '@effect/tsgo';
|
|
42
|
+
const EFFECT_TSGO_BIN = 'effect-tsgo';
|
|
43
|
+
const EFFECT_TSGO_RESOLUTION_ERROR = 'Unable to resolve the Effect TS-Go compiler. Install "@effect/tsgo" and a native TypeScript backend for this build config, or set EFFECT_TSGO_BIN.';
|
|
44
|
+
const executableEffectTsgoCompilers = new Map();
|
|
45
|
+
const BUILD_CONFIG_ENVIRONMENT_PLUGIN = 'ModernJsBuildConfigEnvironmentLeasePlugin';
|
|
46
|
+
const ENVIRONMENT_LEASE_REGISTRY_KEY = Symbol.for('@modern-js/app-tools/build-config-environment-lease-registry/v1');
|
|
47
|
+
const ENVIRONMENT_LEASE_REGISTRY_BRAND = Symbol.for('@modern-js/app-tools/build-config-environment-lease-registry-brand/v1');
|
|
48
|
+
const LIFECYCLE_HOOK_NAMES = [
|
|
49
|
+
'run',
|
|
50
|
+
'watchRun',
|
|
51
|
+
'afterDone',
|
|
52
|
+
'failed',
|
|
53
|
+
'shutdown',
|
|
54
|
+
'watchClose'
|
|
55
|
+
];
|
|
56
|
+
function restoreEnvironment(name, value) {
|
|
57
|
+
if (void 0 === value) delete process.env[name];
|
|
58
|
+
else process.env[name] = value;
|
|
59
|
+
}
|
|
60
|
+
function createEnvironmentLeaseRegistry() {
|
|
61
|
+
const environmentLeases = new Map();
|
|
62
|
+
return Object.freeze({
|
|
63
|
+
acquire (name, value) {
|
|
64
|
+
let lease = environmentLeases.get(name);
|
|
65
|
+
if (lease) {
|
|
66
|
+
if (lease.value !== value) throw new Error(`Build config environment "${name}" already has an active lease for a different value.`);
|
|
67
|
+
if (process.env[name] !== lease.value) throw new Error(`Build config environment lease for "${name}" lost ownership before another lease was acquired.`);
|
|
68
|
+
} else {
|
|
69
|
+
lease = {
|
|
70
|
+
originalValue: process.env[name],
|
|
71
|
+
owners: new Set(),
|
|
72
|
+
value
|
|
73
|
+
};
|
|
74
|
+
process.env[name] = value;
|
|
75
|
+
environmentLeases.set(name, lease);
|
|
76
|
+
}
|
|
77
|
+
const owner = Symbol(name);
|
|
78
|
+
lease.owners.add(owner);
|
|
79
|
+
let released = false;
|
|
80
|
+
return ()=>{
|
|
81
|
+
if (released) return;
|
|
82
|
+
if (environmentLeases.get(name) !== lease || !lease.owners.has(owner)) throw new Error(`Build config environment lease for "${name}" cannot be restored because its ownership record was lost.`);
|
|
83
|
+
released = true;
|
|
84
|
+
const lostOwnership = process.env[name] !== lease.value;
|
|
85
|
+
lease.owners.delete(owner);
|
|
86
|
+
if (0 === lease.owners.size) {
|
|
87
|
+
environmentLeases.delete(name);
|
|
88
|
+
restoreEnvironment(name, lease.originalValue);
|
|
89
|
+
} else if (lostOwnership) process.env[name] = lease.value;
|
|
90
|
+
if (lostOwnership) throw new Error(`Build config environment lease for "${name}" lost ownership before restoration.`);
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
brand: ENVIRONMENT_LEASE_REGISTRY_BRAND
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
function getEnvironmentLeaseRegistry() {
|
|
97
|
+
const descriptor = Object.getOwnPropertyDescriptor(process, ENVIRONMENT_LEASE_REGISTRY_KEY);
|
|
98
|
+
if (descriptor) {
|
|
99
|
+
const registry = descriptor.value;
|
|
100
|
+
if (descriptor.configurable || descriptor.enumerable || descriptor.writable || registry?.brand !== ENVIRONMENT_LEASE_REGISTRY_BRAND || 'function' != typeof registry.acquire) throw new Error('The process-global build config environment lease registry is occupied by an incompatible value.');
|
|
101
|
+
return registry;
|
|
102
|
+
}
|
|
103
|
+
const registry = createEnvironmentLeaseRegistry();
|
|
104
|
+
Object.defineProperty(process, ENVIRONMENT_LEASE_REGISTRY_KEY, {
|
|
105
|
+
configurable: false,
|
|
106
|
+
enumerable: false,
|
|
107
|
+
value: registry,
|
|
108
|
+
writable: false
|
|
109
|
+
});
|
|
110
|
+
return registry;
|
|
111
|
+
}
|
|
112
|
+
function acquireEnvironmentLease(name, value) {
|
|
113
|
+
return getEnvironmentLeaseRegistry().acquire(name, value);
|
|
114
|
+
}
|
|
115
|
+
function releaseAfterFailure(release, originalError) {
|
|
116
|
+
try {
|
|
117
|
+
release();
|
|
118
|
+
} catch (restorationError) {
|
|
119
|
+
throw new AggregateError([
|
|
120
|
+
originalError,
|
|
121
|
+
restorationError
|
|
122
|
+
], 'Build config environment setup and restoration both failed.');
|
|
123
|
+
}
|
|
124
|
+
throw originalError;
|
|
125
|
+
}
|
|
126
|
+
class BuildConfigEnvironmentLeasePlugin {
|
|
127
|
+
apply(compiler) {
|
|
128
|
+
const hooks = compiler.hooks;
|
|
129
|
+
try {
|
|
130
|
+
const lifecycleHooks = {};
|
|
131
|
+
for (const hookName of LIFECYCLE_HOOK_NAMES){
|
|
132
|
+
const hook = hooks[hookName];
|
|
133
|
+
if (!hook || 'function' != typeof hook.tap) throw new Error(`Rspack does not expose the "${hookName}" lifecycle hook required to restore build config environment leases.`);
|
|
134
|
+
lifecycleHooks[hookName] = hook;
|
|
135
|
+
}
|
|
136
|
+
let mode = 'pending';
|
|
137
|
+
const modeTap = {
|
|
138
|
+
name: BUILD_CONFIG_ENVIRONMENT_PLUGIN,
|
|
139
|
+
stage: Number.MIN_SAFE_INTEGER
|
|
140
|
+
};
|
|
141
|
+
const releaseTap = {
|
|
142
|
+
name: BUILD_CONFIG_ENVIRONMENT_PLUGIN,
|
|
143
|
+
stage: Number.MAX_SAFE_INTEGER
|
|
144
|
+
};
|
|
145
|
+
const releaseAfterOneShot = ()=>{
|
|
146
|
+
if ('watch' !== mode && true !== compiler.watchMode) this.release();
|
|
147
|
+
};
|
|
148
|
+
lifecycleHooks.run.tap(modeTap, ()=>{
|
|
149
|
+
mode = 'run';
|
|
150
|
+
});
|
|
151
|
+
lifecycleHooks.watchRun.tap(modeTap, ()=>{
|
|
152
|
+
mode = 'watch';
|
|
153
|
+
});
|
|
154
|
+
lifecycleHooks.afterDone.tap(releaseTap, releaseAfterOneShot);
|
|
155
|
+
lifecycleHooks.failed.tap(releaseTap, releaseAfterOneShot);
|
|
156
|
+
lifecycleHooks.shutdown.tap(releaseTap, this.release);
|
|
157
|
+
lifecycleHooks.watchClose.tap(releaseTap, this.release);
|
|
158
|
+
} catch (error) {
|
|
159
|
+
releaseAfterFailure(this.release, error);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
constructor(release){
|
|
163
|
+
this.release = release;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function resolveEffectTsgoCli(from) {
|
|
167
|
+
const projectRequire = (0, external_node_module_namespaceObject.createRequire)(from);
|
|
168
|
+
const packageJsonPath = projectRequire.resolve(`${EFFECT_TSGO_PACKAGE}/package.json`);
|
|
169
|
+
const packageJson = JSON.parse((0, external_node_fs_namespaceObject.readFileSync)(packageJsonPath, 'utf-8'));
|
|
170
|
+
const bin = 'string' == typeof packageJson.bin ? packageJson.bin : packageJson.bin?.[EFFECT_TSGO_BIN];
|
|
171
|
+
if (!bin) throw new Error(EFFECT_TSGO_RESOLUTION_ERROR);
|
|
172
|
+
return (0, external_node_path_namespaceObject.resolve)((0, external_node_path_namespaceObject.dirname)(packageJsonPath), bin);
|
|
173
|
+
}
|
|
174
|
+
function resolveExecutableEffectTsgoCompiler(compilerPath) {
|
|
175
|
+
if ('win32' === process.platform) return compilerPath;
|
|
176
|
+
const sourcePath = (0, external_node_fs_namespaceObject.realpathSync)(compilerPath);
|
|
177
|
+
const source = (0, external_node_fs_namespaceObject.lstatSync)(sourcePath);
|
|
178
|
+
if (!source.isFile()) throw new Error(EFFECT_TSGO_RESOLUTION_ERROR);
|
|
179
|
+
try {
|
|
180
|
+
(0, external_node_fs_namespaceObject.accessSync)(sourcePath, external_node_fs_namespaceObject.constants.X_OK);
|
|
181
|
+
return compilerPath;
|
|
182
|
+
} catch {}
|
|
183
|
+
const cachedCompiler = executableEffectTsgoCompilers.get(sourcePath);
|
|
184
|
+
if (cachedCompiler) try {
|
|
185
|
+
(0, external_node_fs_namespaceObject.accessSync)(cachedCompiler, external_node_fs_namespaceObject.constants.X_OK);
|
|
186
|
+
return cachedCompiler;
|
|
187
|
+
} catch {
|
|
188
|
+
executableEffectTsgoCompilers.delete(sourcePath);
|
|
189
|
+
}
|
|
190
|
+
const compilerBytes = (0, external_node_fs_namespaceObject.readFileSync)(sourcePath);
|
|
191
|
+
const compilerDigest = (0, external_node_crypto_namespaceObject.createHash)('sha256').update(compilerBytes).digest('hex');
|
|
192
|
+
const compilerDirectory = (0, external_node_path_namespaceObject.join)((0, external_node_os_namespaceObject.tmpdir)(), 'modern-js', 'effect-tsgo', compilerDigest);
|
|
193
|
+
(0, external_node_fs_namespaceObject.mkdirSync)(compilerDirectory, {
|
|
194
|
+
recursive: true,
|
|
195
|
+
mode: 448
|
|
196
|
+
});
|
|
197
|
+
const executableCompiler = (0, external_node_path_namespaceObject.join)(compilerDirectory, (0, external_node_path_namespaceObject.basename)(sourcePath));
|
|
198
|
+
try {
|
|
199
|
+
(0, external_node_fs_namespaceObject.accessSync)(executableCompiler, external_node_fs_namespaceObject.constants.X_OK);
|
|
200
|
+
} catch {
|
|
201
|
+
const temporaryCompiler = (0, external_node_path_namespaceObject.join)(compilerDirectory, `.${(0, external_node_path_namespaceObject.basename)(sourcePath)}.${process.pid}.tmp`);
|
|
202
|
+
(0, external_node_fs_namespaceObject.rmSync)(temporaryCompiler, {
|
|
203
|
+
force: true
|
|
204
|
+
});
|
|
205
|
+
try {
|
|
206
|
+
(0, external_node_fs_namespaceObject.writeFileSync)(temporaryCompiler, compilerBytes, {
|
|
207
|
+
flag: 'wx',
|
|
208
|
+
mode: 448
|
|
209
|
+
});
|
|
210
|
+
(0, external_node_fs_namespaceObject.chmodSync)(temporaryCompiler, 448);
|
|
211
|
+
(0, external_node_fs_namespaceObject.renameSync)(temporaryCompiler, executableCompiler);
|
|
212
|
+
} finally{
|
|
213
|
+
(0, external_node_fs_namespaceObject.rmSync)(temporaryCompiler, {
|
|
214
|
+
force: true
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
(0, external_node_fs_namespaceObject.accessSync)(executableCompiler, external_node_fs_namespaceObject.constants.X_OK);
|
|
219
|
+
executableEffectTsgoCompilers.set(sourcePath, executableCompiler);
|
|
220
|
+
return executableCompiler;
|
|
221
|
+
}
|
|
222
|
+
function getBuildConfigEnvironment(name) {
|
|
223
|
+
return process.env[name];
|
|
224
|
+
}
|
|
225
|
+
function withBuildConfigEnvironment(name, value, setup) {
|
|
226
|
+
return async (config, ...args)=>{
|
|
227
|
+
const release = acquireEnvironmentLease(name, value);
|
|
228
|
+
try {
|
|
229
|
+
const configured = await setup(config, ...args) ?? config;
|
|
230
|
+
configured.plugins = [
|
|
231
|
+
...configured.plugins ?? [],
|
|
232
|
+
new BuildConfigEnvironmentLeasePlugin(release)
|
|
233
|
+
];
|
|
234
|
+
return configured;
|
|
235
|
+
} catch (error) {
|
|
236
|
+
releaseAfterFailure(release, error);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
function resolveEffectTsgoCompiler(options) {
|
|
241
|
+
const configuredCompiler = getBuildConfigEnvironment('EFFECT_TSGO_BIN')?.trim();
|
|
242
|
+
if (configuredCompiler) try {
|
|
243
|
+
return resolveExecutableEffectTsgoCompiler(configuredCompiler);
|
|
244
|
+
} catch {
|
|
245
|
+
throw new Error(EFFECT_TSGO_RESOLUTION_ERROR);
|
|
246
|
+
}
|
|
247
|
+
try {
|
|
248
|
+
const compiler = (0, external_node_child_process_namespaceObject.execFileSync)(process.execPath, [
|
|
249
|
+
resolveEffectTsgoCli(options.from),
|
|
250
|
+
'get-exe-path'
|
|
251
|
+
], {
|
|
252
|
+
encoding: 'utf-8'
|
|
253
|
+
}).trim();
|
|
254
|
+
if (compiler) return resolveExecutableEffectTsgoCompiler(compiler);
|
|
255
|
+
} catch {}
|
|
256
|
+
throw new Error(EFFECT_TSGO_RESOLUTION_ERROR);
|
|
257
|
+
}
|
|
258
|
+
exports.getBuildConfigEnvironment = __webpack_exports__.getBuildConfigEnvironment;
|
|
259
|
+
exports.resolveEffectTsgoCompiler = __webpack_exports__.resolveEffectTsgoCompiler;
|
|
260
|
+
exports.withBuildConfigEnvironment = __webpack_exports__.withBuildConfigEnvironment;
|
|
261
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
262
|
+
"getBuildConfigEnvironment",
|
|
263
|
+
"resolveEffectTsgoCompiler",
|
|
264
|
+
"withBuildConfigEnvironment"
|
|
265
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
266
|
+
Object.defineProperty(exports, '__esModule', {
|
|
267
|
+
value: true
|
|
268
|
+
});
|
package/dist/cjs/config/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
+
"./build-environment" (module) {
|
|
4
|
+
module.exports = require("./build-environment.js");
|
|
5
|
+
},
|
|
3
6
|
"./default" (module) {
|
|
4
7
|
module.exports = require("./default.js");
|
|
5
8
|
},
|
|
@@ -54,13 +57,17 @@ function __webpack_require__(moduleId) {
|
|
|
54
57
|
var __webpack_exports__ = {};
|
|
55
58
|
(()=>{
|
|
56
59
|
__webpack_require__.r(__webpack_exports__);
|
|
57
|
-
var
|
|
60
|
+
var _build_environment__rspack_import_0 = __webpack_require__("./build-environment");
|
|
61
|
+
var __rspack_reexport = {};
|
|
62
|
+
for(const __rspack_import_key in _build_environment__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_build_environment__rspack_import_0[__rspack_import_key];
|
|
63
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
64
|
+
var _default__rspack_import_1 = __webpack_require__("./default");
|
|
58
65
|
var __rspack_reexport = {};
|
|
59
|
-
for(const __rspack_import_key in
|
|
66
|
+
for(const __rspack_import_key in _default__rspack_import_1)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_default__rspack_import_1[__rspack_import_key];
|
|
60
67
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
61
|
-
var
|
|
68
|
+
var _initialize__rspack_import_2 = __webpack_require__("./initialize");
|
|
62
69
|
var __rspack_reexport = {};
|
|
63
|
-
for(const __rspack_import_key in
|
|
70
|
+
for(const __rspack_import_key in _initialize__rspack_import_2)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_initialize__rspack_import_2[__rspack_import_key];
|
|
64
71
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
65
72
|
})();
|
|
66
73
|
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
getBuildConfigEnvironment: ()=>external_build_environment_js_namespaceObject.getBuildConfigEnvironment,
|
|
32
|
+
resolveEffectTsgoCompiler: ()=>external_build_environment_js_namespaceObject.resolveEffectTsgoCompiler,
|
|
33
|
+
withBuildConfigEnvironment: ()=>external_build_environment_js_namespaceObject.withBuildConfigEnvironment
|
|
34
|
+
});
|
|
35
|
+
const external_build_environment_js_namespaceObject = require("./build-environment.js");
|
|
36
|
+
exports.getBuildConfigEnvironment = __webpack_exports__.getBuildConfigEnvironment;
|
|
37
|
+
exports.resolveEffectTsgoCompiler = __webpack_exports__.resolveEffectTsgoCompiler;
|
|
38
|
+
exports.withBuildConfigEnvironment = __webpack_exports__.withBuildConfigEnvironment;
|
|
39
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
40
|
+
"getBuildConfigEnvironment",
|
|
41
|
+
"resolveEffectTsgoCompiler",
|
|
42
|
+
"withBuildConfigEnvironment"
|
|
43
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
44
|
+
Object.defineProperty(exports, '__esModule', {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
package/dist/cjs/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
-
"./baseline" (module) {
|
|
4
|
-
module.exports = require("./baseline.js");
|
|
5
|
-
},
|
|
6
3
|
"./commands/dev" (module) {
|
|
7
4
|
module.exports = require("./commands/dev.js");
|
|
8
5
|
},
|
|
@@ -27,6 +24,9 @@ var __webpack_modules__ = {
|
|
|
27
24
|
"./plugins/analyze" (module) {
|
|
28
25
|
module.exports = require("./plugins/analyze/index.js");
|
|
29
26
|
},
|
|
27
|
+
"./plugins/backendFederationBuild" (module) {
|
|
28
|
+
module.exports = require("./plugins/backendFederationBuild.js");
|
|
29
|
+
},
|
|
30
30
|
"./plugins/deploy" (module) {
|
|
31
31
|
module.exports = require("./plugins/deploy/index.js");
|
|
32
32
|
},
|
|
@@ -39,6 +39,9 @@ var __webpack_modules__ = {
|
|
|
39
39
|
"./plugins/serverRuntime" (module) {
|
|
40
40
|
module.exports = require("./plugins/serverRuntime.js");
|
|
41
41
|
},
|
|
42
|
+
"./plugins/ultramodernReleaseEnvelope" (module) {
|
|
43
|
+
module.exports = require("./plugins/ultramodernReleaseEnvelope.js");
|
|
44
|
+
},
|
|
42
45
|
"./presetUltramodern" (module) {
|
|
43
46
|
module.exports = require("./presetUltramodern.js");
|
|
44
47
|
},
|
|
@@ -48,9 +51,6 @@ var __webpack_modules__ = {
|
|
|
48
51
|
"./types?6efa" (module) {
|
|
49
52
|
module.exports = require("./types/index.js");
|
|
50
53
|
},
|
|
51
|
-
"./ultramodern/designSystem" (module) {
|
|
52
|
-
module.exports = require("./ultramodern/designSystem.js");
|
|
53
|
-
},
|
|
54
54
|
"./utils/generateWatchFiles" (module) {
|
|
55
55
|
module.exports = require("./utils/generateWatchFiles.js");
|
|
56
56
|
},
|
|
@@ -138,48 +138,24 @@ var __webpack_exports__ = {};
|
|
|
138
138
|
var _locale__rspack_import_8 = __webpack_require__("./locale");
|
|
139
139
|
var _plugins_analyze__rspack_import_9 = __webpack_require__("./plugins/analyze");
|
|
140
140
|
var _plugins_analyze__rspack_import_9_default = /*#__PURE__*/ __webpack_require__.n(_plugins_analyze__rspack_import_9);
|
|
141
|
-
var
|
|
142
|
-
var
|
|
143
|
-
var
|
|
144
|
-
var
|
|
145
|
-
var
|
|
146
|
-
var
|
|
147
|
-
var
|
|
148
|
-
var
|
|
149
|
-
var
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
var
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
"mergeConfig",
|
|
158
|
-
"appTools",
|
|
159
|
-
"default",
|
|
160
|
-
"serve",
|
|
161
|
-
"generateWatchFiles",
|
|
162
|
-
"initAppContext",
|
|
163
|
-
"defineConfig"
|
|
164
|
-
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_baseline__rspack_import_17[__rspack_import_key];
|
|
165
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
166
|
-
var _defineConfig__rspack_import_18 = __webpack_require__("./defineConfig");
|
|
167
|
-
var __rspack_reexport = {};
|
|
168
|
-
for(const __rspack_import_key in _defineConfig__rspack_import_18)if ([
|
|
169
|
-
"dev",
|
|
170
|
-
"resolveModernRsbuildConfig",
|
|
171
|
-
"mergeConfig",
|
|
172
|
-
"appTools",
|
|
173
|
-
"default",
|
|
174
|
-
"serve",
|
|
175
|
-
"generateWatchFiles",
|
|
176
|
-
"initAppContext",
|
|
177
|
-
"defineConfig"
|
|
178
|
-
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_defineConfig__rspack_import_18[__rspack_import_key];
|
|
179
|
-
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
180
|
-
var _presetUltramodern__rspack_import_19 = __webpack_require__("./presetUltramodern");
|
|
141
|
+
var _plugins_backendFederationBuild__rspack_import_10 = __webpack_require__("./plugins/backendFederationBuild");
|
|
142
|
+
var _plugins_backendFederationBuild__rspack_import_10_default = /*#__PURE__*/ __webpack_require__.n(_plugins_backendFederationBuild__rspack_import_10);
|
|
143
|
+
var _plugins_deploy__rspack_import_11 = __webpack_require__("./plugins/deploy");
|
|
144
|
+
var _plugins_deploy__rspack_import_11_default = /*#__PURE__*/ __webpack_require__.n(_plugins_deploy__rspack_import_11);
|
|
145
|
+
var _plugins_initialize__rspack_import_12 = __webpack_require__("./plugins/initialize");
|
|
146
|
+
var _plugins_initialize__rspack_import_12_default = /*#__PURE__*/ __webpack_require__.n(_plugins_initialize__rspack_import_12);
|
|
147
|
+
var _plugins_serverBuild__rspack_import_13 = __webpack_require__("./plugins/serverBuild");
|
|
148
|
+
var _plugins_serverBuild__rspack_import_13_default = /*#__PURE__*/ __webpack_require__.n(_plugins_serverBuild__rspack_import_13);
|
|
149
|
+
var _plugins_serverRuntime__rspack_import_14 = __webpack_require__("./plugins/serverRuntime");
|
|
150
|
+
var _plugins_serverRuntime__rspack_import_14_default = /*#__PURE__*/ __webpack_require__.n(_plugins_serverRuntime__rspack_import_14);
|
|
151
|
+
var _plugins_ultramodernReleaseEnvelope__rspack_import_15 = __webpack_require__("./plugins/ultramodernReleaseEnvelope");
|
|
152
|
+
var _plugins_ultramodernReleaseEnvelope__rspack_import_15_default = /*#__PURE__*/ __webpack_require__.n(_plugins_ultramodernReleaseEnvelope__rspack_import_15);
|
|
153
|
+
var _utils_generateWatchFiles__rspack_import_16 = __webpack_require__("./utils/generateWatchFiles");
|
|
154
|
+
var _utils_initAppContext__rspack_import_17 = __webpack_require__("./utils/initAppContext");
|
|
155
|
+
var _utils_restart__rspack_import_18 = __webpack_require__("./utils/restart");
|
|
156
|
+
var _defineConfig__rspack_import_19 = __webpack_require__("./defineConfig");
|
|
181
157
|
var __rspack_reexport = {};
|
|
182
|
-
for(const __rspack_import_key in
|
|
158
|
+
for(const __rspack_import_key in _defineConfig__rspack_import_19)if ([
|
|
183
159
|
"dev",
|
|
184
160
|
"resolveModernRsbuildConfig",
|
|
185
161
|
"mergeConfig",
|
|
@@ -189,11 +165,11 @@ var __webpack_exports__ = {};
|
|
|
189
165
|
"generateWatchFiles",
|
|
190
166
|
"initAppContext",
|
|
191
167
|
"defineConfig"
|
|
192
|
-
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>
|
|
168
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_defineConfig__rspack_import_19[__rspack_import_key];
|
|
193
169
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
194
|
-
var
|
|
170
|
+
var _presetUltramodern__rspack_import_20 = __webpack_require__("./presetUltramodern");
|
|
195
171
|
var __rspack_reexport = {};
|
|
196
|
-
for(const __rspack_import_key in
|
|
172
|
+
for(const __rspack_import_key in _presetUltramodern__rspack_import_20)if ([
|
|
197
173
|
"dev",
|
|
198
174
|
"resolveModernRsbuildConfig",
|
|
199
175
|
"mergeConfig",
|
|
@@ -203,7 +179,7 @@ var __webpack_exports__ = {};
|
|
|
203
179
|
"generateWatchFiles",
|
|
204
180
|
"initAppContext",
|
|
205
181
|
"defineConfig"
|
|
206
|
-
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>
|
|
182
|
+
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_presetUltramodern__rspack_import_20[__rspack_import_key];
|
|
207
183
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
208
184
|
var _commands_dev__rspack_import_21 = __webpack_require__("./commands/dev");
|
|
209
185
|
var _commands_serve__rspack_import_22 = __webpack_require__("./commands/serve");
|
|
@@ -226,12 +202,14 @@ var __webpack_exports__ = {};
|
|
|
226
202
|
const appTools = ()=>({
|
|
227
203
|
name: '@modern-js/app-tools',
|
|
228
204
|
usePlugins: [
|
|
229
|
-
|
|
205
|
+
_plugins_serverRuntime__rspack_import_14_default()(),
|
|
230
206
|
(0, _compat__rspack_import_6.compatPlugin)(),
|
|
231
|
-
|
|
207
|
+
_plugins_initialize__rspack_import_12_default()(),
|
|
232
208
|
_plugins_analyze__rspack_import_9_default()(),
|
|
233
|
-
|
|
234
|
-
|
|
209
|
+
_plugins_serverBuild__rspack_import_13_default()(),
|
|
210
|
+
_plugins_backendFederationBuild__rspack_import_10_default()(),
|
|
211
|
+
_plugins_ultramodernReleaseEnvelope__rspack_import_15_default()(),
|
|
212
|
+
_plugins_deploy__rspack_import_11_default()()
|
|
235
213
|
],
|
|
236
214
|
post: [
|
|
237
215
|
'@modern-js/plugin-initialize',
|
|
@@ -259,7 +237,7 @@ var __webpack_exports__ = {};
|
|
|
259
237
|
_locale__rspack_import_8.i18n.changeLanguage({
|
|
260
238
|
locale
|
|
261
239
|
});
|
|
262
|
-
api.updateAppContext((0,
|
|
240
|
+
api.updateAppContext((0, _utils_initAppContext__rspack_import_17.initAppContext)({
|
|
263
241
|
metaName: context.metaName,
|
|
264
242
|
appDirectory: context.appDirectory,
|
|
265
243
|
runtimeConfigFile: _constants__rspack_import_7.DEFAULT_RUNTIME_CONFIG_FILE,
|
|
@@ -275,7 +253,6 @@ var __webpack_exports__ = {};
|
|
|
275
253
|
(0, _commands__rspack_import_5.deployCommand)(program, api);
|
|
276
254
|
(0, _commands__rspack_import_5.inspectCommand)(program, api);
|
|
277
255
|
(0, _commands__rspack_import_5.infoCommand)(program, api);
|
|
278
|
-
await (0, _commands__rspack_import_5.runtimeCommand)(program, api);
|
|
279
256
|
(0, _modern_js_utils__rspack_import_3.deprecatedCommands)(program);
|
|
280
257
|
});
|
|
281
258
|
api.onPrepare(async ()=>{
|
|
@@ -298,7 +275,7 @@ var __webpack_exports__ = {};
|
|
|
298
275
|
api.addWatchFiles(async ()=>{
|
|
299
276
|
const appContext = api.getAppContext();
|
|
300
277
|
const config = api.getNormalizedConfig();
|
|
301
|
-
const files = await (0,
|
|
278
|
+
const files = await (0, _utils_generateWatchFiles__rspack_import_16.generateWatchFiles)(appContext, config.source.configDir);
|
|
302
279
|
const watchFiles = (0, _modern_js_builder__rspack_import_0.castArray)(config.dev.watchFiles);
|
|
303
280
|
watchFiles.forEach(({ type, paths })=>{
|
|
304
281
|
if ('reload-server' === type) files.push(...Array.isArray(paths) ? paths : [
|
|
@@ -315,7 +292,7 @@ var __webpack_exports__ = {};
|
|
|
315
292
|
if (!isPrivate && ('change' === eventType || 'unlink' === eventType) && !isApiProject) {
|
|
316
293
|
const { closeServer } = await import("./utils/createServer.js");
|
|
317
294
|
await closeServer();
|
|
318
|
-
await (0,
|
|
295
|
+
await (0, _utils_restart__rspack_import_18.restart)(api.getHooks(), filename);
|
|
319
296
|
}
|
|
320
297
|
});
|
|
321
298
|
api.onBeforeRestart(()=>{
|
|
@@ -327,10 +304,10 @@ var __webpack_exports__ = {};
|
|
|
327
304
|
});
|
|
328
305
|
const __rspack_default_export = appTools;
|
|
329
306
|
__webpack_require__.d(__webpack_exports__, {
|
|
330
|
-
defineConfig: ()=>
|
|
307
|
+
defineConfig: ()=>_defineConfig__rspack_import_19.defineConfig,
|
|
331
308
|
dev: ()=>_commands_dev__rspack_import_21.dev,
|
|
332
|
-
generateWatchFiles: ()=>
|
|
333
|
-
initAppContext: ()=>
|
|
309
|
+
generateWatchFiles: ()=>_utils_generateWatchFiles__rspack_import_16.generateWatchFiles,
|
|
310
|
+
initAppContext: ()=>_utils_initAppContext__rspack_import_17.initAppContext,
|
|
334
311
|
mergeConfig: ()=>_modern_js_plugin_cli__rspack_import_25.mergeConfig,
|
|
335
312
|
resolveModernRsbuildConfig: ()=>_rsbuild__rspack_import_23.resolveModernRsbuildConfig,
|
|
336
313
|
serve: ()=>_commands_serve__rspack_import_22.serve
|
|
@@ -37,6 +37,7 @@ var __webpack_require__ = {};
|
|
|
37
37
|
var __webpack_exports__ = {};
|
|
38
38
|
__webpack_require__.r(__webpack_exports__);
|
|
39
39
|
__webpack_require__.d(__webpack_exports__, {
|
|
40
|
+
getProdEntrypoints: ()=>getProdEntrypoints,
|
|
40
41
|
getProdServerRoutes: ()=>getProdServerRoutes,
|
|
41
42
|
getServerRoutes: ()=>getServerRoutes
|
|
42
43
|
});
|
|
@@ -170,9 +171,27 @@ const getProdServerRoutes = (distDirectory)=>{
|
|
|
170
171
|
throw new Error(`Failed to read routes from ${routeJSON}, please check if the file exists.`);
|
|
171
172
|
}
|
|
172
173
|
};
|
|
174
|
+
const getProdEntrypoints = (distDirectory, routes, mainEntryName = MAIN_ENTRY_NAME)=>{
|
|
175
|
+
const byEntryName = new Map();
|
|
176
|
+
for (const route of routes){
|
|
177
|
+
if (!route.entryName || byEntryName.has(route.entryName)) continue;
|
|
178
|
+
const builtEntry = route.bundle || route.entryPath;
|
|
179
|
+
byEntryName.set(route.entryName, {
|
|
180
|
+
entryName: route.entryName,
|
|
181
|
+
entry: external_path_default().resolve(distDirectory, builtEntry),
|
|
182
|
+
isAutoMount: true,
|
|
183
|
+
isMainEntry: route.entryName === mainEntryName
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return [
|
|
187
|
+
...byEntryName.values()
|
|
188
|
+
];
|
|
189
|
+
};
|
|
190
|
+
exports.getProdEntrypoints = __webpack_exports__.getProdEntrypoints;
|
|
173
191
|
exports.getProdServerRoutes = __webpack_exports__.getProdServerRoutes;
|
|
174
192
|
exports.getServerRoutes = __webpack_exports__.getServerRoutes;
|
|
175
193
|
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
194
|
+
"getProdEntrypoints",
|
|
176
195
|
"getProdServerRoutes",
|
|
177
196
|
"getServerRoutes"
|
|
178
197
|
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
@@ -58,7 +58,7 @@ const analyze = ()=>({
|
|
|
58
58
|
if ((0, external_utils_js_namespaceObject.checkIsBuildCommands)()) utils_namespaceObject.fs.emptydirSync(appContext.internalDirectory);
|
|
59
59
|
} catch {}
|
|
60
60
|
const apiOnly = await (0, utils_namespaceObject.isApiOnly)(appContext.appDirectory, resolvedConfig.source?.entriesDir, appContext.apiDirectory);
|
|
61
|
-
const [{ getProdServerRoutes }] = await Promise.all([
|
|
61
|
+
const [{ getProdEntrypoints, getProdServerRoutes }] = await Promise.all([
|
|
62
62
|
import("./getServerRoutes.js")
|
|
63
63
|
]);
|
|
64
64
|
if (apiOnly) {
|
|
@@ -77,6 +77,17 @@ const analyze = ()=>({
|
|
|
77
77
|
});
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
+
if ((0, external_utils_js_namespaceObject.checkIsServeCommand)()) {
|
|
81
|
+
const routes = getProdServerRoutes(appContext.distDirectory);
|
|
82
|
+
const entrypoints = getProdEntrypoints(appContext.distDirectory, routes, resolvedConfig.source.mainEntryName);
|
|
83
|
+
api.updateAppContext({
|
|
84
|
+
apiOnly,
|
|
85
|
+
checkedEntries: entrypoints.map((entrypoint)=>entrypoint.entryName),
|
|
86
|
+
entrypoints,
|
|
87
|
+
serverRoutes: routes
|
|
88
|
+
});
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
80
91
|
const [{ getBundleEntry }, { getServerRoutes }, { getHtmlTemplate }] = await Promise.all([
|
|
81
92
|
import("./getBundleEntry.js"),
|
|
82
93
|
import("./getServerRoutes.js"),
|
|
@@ -87,17 +98,14 @@ const analyze = ()=>({
|
|
|
87
98
|
});
|
|
88
99
|
debug("entrypoints: %o", entrypoints);
|
|
89
100
|
const routes = [];
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
});
|
|
99
|
-
routes.push(...modifiedRoutes);
|
|
100
|
-
}
|
|
101
|
+
const initialRoutes = getServerRoutes(entrypoints, {
|
|
102
|
+
appContext,
|
|
103
|
+
config: resolvedConfig
|
|
104
|
+
});
|
|
105
|
+
const { routes: modifiedRoutes } = await hooks.modifyServerRoutes.call({
|
|
106
|
+
routes: initialRoutes
|
|
107
|
+
});
|
|
108
|
+
routes.push(...modifiedRoutes);
|
|
101
109
|
debug("server routes: %o", routes);
|
|
102
110
|
appContext = {
|
|
103
111
|
...api.getAppContext(),
|