@bleedingdev/modern-js-app-tools 3.8.3-ultramodern.1 → 3.8.3-ultramodern.2
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-bundle-docs.js +11 -0
- package/bin/modern.js +11 -0
- package/dist/cjs/builder/generator/getBuilderEnvironments.js +13 -241
- package/dist/cjs/builder/generator/index.js +0 -1
- package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +37 -9
- package/dist/cjs/builder/shared/builderPlugins/index.js +6 -13
- package/dist/cjs/builder/shared/bundlerPlugins/index.js +6 -13
- package/dist/cjs/builder/shared/lazyCompilation.js +9 -9
- package/dist/cjs/bundleDocs.js +1 -1
- package/dist/cjs/index.js +59 -60
- package/dist/cjs/plugins/analyze/getServerRoutes.js +1 -1
- package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +1 -9
- package/dist/cjs/plugins/backend-federation/codegen.js +2 -1
- package/dist/cjs/plugins/backend-federation/config.js +2 -2
- package/dist/cjs/plugins/backend-federation/emit.js +6 -4
- package/dist/cjs/plugins/deploy/index.js +4 -4
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +23 -149
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
- package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
- package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
- package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
- package/dist/cjs/plugins/ultramodernReleaseEnvelope.js +3 -59
- package/dist/cjs/presetUltramodern.js +9 -4
- package/dist/cjs/run/index.js +9 -9
- package/dist/cjs/utils/register.js +6 -3
- package/dist/esm/builder/generator/getBuilderEnvironments.mjs +12 -231
- package/dist/esm/builder/generator/index.mjs +1 -2
- package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +34 -9
- package/dist/esm/builder/shared/builderPlugins/index.mjs +0 -1
- package/dist/esm/builder/shared/bundlerPlugins/index.mjs +0 -1
- package/dist/esm/builder/shared/lazyCompilation.mjs +4 -4
- package/dist/esm/bundleDocs.mjs +1 -1
- package/dist/esm/index.mjs +3 -3
- package/dist/esm/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +1 -9
- package/dist/esm/plugins/backend-federation/codegen.mjs +2 -1
- package/dist/esm/plugins/backend-federation/config.mjs +1 -1
- package/dist/esm/plugins/backend-federation/emit.mjs +5 -3
- package/dist/esm/plugins/deploy/index.mjs +1 -1
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -133
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
- package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
- package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
- package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
- package/dist/esm/plugins/ultramodernReleaseEnvelope.mjs +3 -49
- package/dist/esm/presetUltramodern.mjs +2 -1
- package/dist/esm/run/index.mjs +9 -9
- package/dist/esm/utils/register.mjs +6 -3
- package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +12 -234
- package/dist/esm-node/builder/generator/index.mjs +1 -2
- package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +34 -9
- package/dist/esm-node/builder/shared/builderPlugins/index.mjs +0 -1
- package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +0 -1
- package/dist/esm-node/builder/shared/lazyCompilation.mjs +4 -4
- package/dist/esm-node/bundleDocs.mjs +1 -1
- package/dist/esm-node/index.mjs +3 -3
- package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +1 -1
- package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +1 -9
- package/dist/esm-node/plugins/backend-federation/codegen.mjs +2 -1
- package/dist/esm-node/plugins/backend-federation/config.mjs +1 -1
- package/dist/esm-node/plugins/backend-federation/emit.mjs +5 -3
- package/dist/esm-node/plugins/deploy/index.mjs +1 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -133
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
- package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
- package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
- package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
- package/dist/esm-node/plugins/ultramodernReleaseEnvelope.mjs +3 -49
- package/dist/esm-node/presetUltramodern.mjs +2 -1
- package/dist/esm-node/run/index.mjs +9 -9
- package/dist/esm-node/utils/register.mjs +6 -3
- package/dist/types/builder/generator/getBuilderEnvironments.d.ts +0 -29
- package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +11 -0
- package/dist/types/builder/shared/builderPlugins/index.d.ts +0 -1
- package/dist/types/builder/shared/bundlerPlugins/index.d.ts +0 -1
- package/dist/types/builder/shared/lazyCompilation.d.ts +7 -7
- package/dist/types/plugins/analyze/getServerRoutes.d.ts +1 -1
- package/dist/types/plugins/backend-federation/codegen.d.ts +4 -1
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/index.d.ts +1 -18
- package/dist/types/presetUltramodern.d.ts +1 -0
- package/dist/types/types/config/deploy.d.ts +2 -2
- package/docs/community/showcase.md +3 -5
- package/docs/guides/advanced-features/bff/frameworks.md +1 -1
- package/docs/guides/basic-features/deploy.md +2 -2
- package/docs/guides/get-started/quick-start.md +9 -8
- package/docs/guides/get-started/tech-stack.md +1 -1
- package/docs/guides/get-started/ultramodern.md +18 -18
- package/docs/guides/troubleshooting/cli.md +1 -1
- package/docs/llms.txt +2 -2
- package/docs/tutorials/examples/csr-auth.md +1 -1
- package/package.json +15 -27
- package/rslib.config.mts +4 -7
- package/dist/cjs/builder/shared/builderPlugins/adapterLazyCompilation.js +0 -74
- package/dist/cjs/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.js +0 -72
- package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +0 -127
- package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +0 -141
- package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +0 -139
- package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +0 -135
- package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +0 -150
- package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +0 -205
- package/dist/cjs/plugins/deploy/platforms/cloudflare/types.js +0 -18
- package/dist/cjs/plugins/deploy/platforms/cloudflare/utils.js +0 -66
- package/dist/cjs/plugins/deploy/platforms/cloudflare/worker-manifest.js +0 -208
- package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +0 -204
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +0 -108
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-plan.js +0 -93
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/identity.js +0 -83
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/issues.js +0 -54
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +0 -89
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +0 -151
- package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +0 -378
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/cjs/types/config/cloudflareDeploy.js +0 -18
- package/dist/cjs/ultramodern-release-envelope/canonical.js +0 -68
- package/dist/cjs/ultramodern-release-envelope/framework-output.js +0 -649
- package/dist/cjs/ultramodern-release-envelope/index.js +0 -399
- package/dist/cjs/ultramodern-release-envelope/types.js +0 -51
- package/dist/cjs/ultramodern-release-identity.js +0 -110
- package/dist/esm/builder/shared/builderPlugins/adapterLazyCompilation.mjs +0 -36
- package/dist/esm/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +0 -30
- package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +0 -64
- package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +0 -34
- package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +0 -88
- package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +0 -97
- package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +0 -102
- package/dist/esm/plugins/deploy/platforms/cloudflare/security-policies.mjs +0 -167
- package/dist/esm/plugins/deploy/platforms/cloudflare/types.mjs +0 -0
- package/dist/esm/plugins/deploy/platforms/cloudflare/utils.mjs +0 -12
- package/dist/esm/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +0 -148
- package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +0 -150
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-contract.mjs +0 -31
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-plan.mjs +0 -45
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +0 -45
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +0 -10
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +0 -51
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +0 -99
- package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +0 -313
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/esm/types/config/cloudflareDeploy.mjs +0 -0
- package/dist/esm/ultramodern-release-envelope/canonical.mjs +0 -21
- package/dist/esm/ultramodern-release-envelope/framework-output.mjs +0 -573
- package/dist/esm/ultramodern-release-envelope/index.mjs +0 -335
- package/dist/esm/ultramodern-release-envelope/types.mjs +0 -7
- package/dist/esm/ultramodern-release-identity.mjs +0 -66
- package/dist/esm-node/builder/shared/builderPlugins/adapterLazyCompilation.mjs +0 -37
- package/dist/esm-node/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +0 -31
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +0 -65
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +0 -35
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +0 -89
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +0 -98
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +0 -103
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/security-policies.mjs +0 -168
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/types.mjs +0 -1
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/utils.mjs +0 -13
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +0 -149
- package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +0 -151
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-contract.mjs +0 -32
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-plan.mjs +0 -46
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +0 -46
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +0 -11
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +0 -52
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +0 -100
- package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +0 -314
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
- package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
- package/dist/esm-node/types/config/cloudflareDeploy.mjs +0 -1
- package/dist/esm-node/ultramodern-release-envelope/canonical.mjs +0 -22
- package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +0 -574
- package/dist/esm-node/ultramodern-release-envelope/index.mjs +0 -336
- package/dist/esm-node/ultramodern-release-envelope/types.mjs +0 -8
- package/dist/esm-node/ultramodern-release-identity.mjs +0 -67
- package/dist/types/builder/shared/builderPlugins/adapterLazyCompilation.d.ts +0 -3
- package/dist/types/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.d.ts +0 -6
- package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +0 -15
- package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +0 -24
- package/dist/types/plugins/deploy/platforms/cloudflare/delivery-unit.d.ts +0 -23
- package/dist/types/plugins/deploy/platforms/cloudflare/i18n-worker.d.ts +0 -22
- package/dist/types/plugins/deploy/platforms/cloudflare/index.d.ts +0 -2
- package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +0 -51
- package/dist/types/plugins/deploy/platforms/cloudflare/types.d.ts +0 -5
- package/dist/types/plugins/deploy/platforms/cloudflare/utils.d.ts +0 -6
- package/dist/types/plugins/deploy/platforms/cloudflare/worker-manifest.d.ts +0 -122
- package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +0 -46
- package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +0 -14
- package/dist/types/plugins/deploy/platforms/cloudflare-output-plan.d.ts +0 -34
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/identity.d.ts +0 -4
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/issues.d.ts +0 -14
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/manifest.d.ts +0 -2
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.d.ts +0 -14
- package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +0 -20
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts +0 -1
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.d.mts +0 -4
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.d.mts +0 -5
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.d.mts +0 -48
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +0 -13
- package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-path.d.mts +0 -21
- package/dist/types/types/config/cloudflareDeploy.d.ts +0 -161
- package/dist/types/ultramodern-release-envelope/canonical.d.ts +0 -5
- package/dist/types/ultramodern-release-envelope/framework-output.d.ts +0 -32
- package/dist/types/ultramodern-release-envelope/index.d.ts +0 -6
- package/dist/types/ultramodern-release-envelope/types.d.ts +0 -62
- package/dist/types/ultramodern-release-identity.d.ts +0 -16
package/dist/cjs/index.js
CHANGED
|
@@ -45,9 +45,6 @@ var __webpack_modules__ = {
|
|
|
45
45
|
"./plugins/serverRuntime" (module) {
|
|
46
46
|
module.exports = require("./plugins/serverRuntime.js");
|
|
47
47
|
},
|
|
48
|
-
"./plugins/ultramodernReleaseEnvelope" (module) {
|
|
49
|
-
module.exports = require("./plugins/ultramodernReleaseEnvelope.js");
|
|
50
|
-
},
|
|
51
48
|
"./presetUltramodern" (module) {
|
|
52
49
|
module.exports = require("./presetUltramodern.js");
|
|
53
50
|
},
|
|
@@ -69,6 +66,9 @@ var __webpack_modules__ = {
|
|
|
69
66
|
"./utils/restart" (module) {
|
|
70
67
|
module.exports = require("./utils/restart.js");
|
|
71
68
|
},
|
|
69
|
+
"@modern-js/app-tools-extensions/cloudflare-builder" (module) {
|
|
70
|
+
module.exports = require("@modern-js/app-tools-extensions/cloudflare-builder");
|
|
71
|
+
},
|
|
72
72
|
"@modern-js/builder" (module) {
|
|
73
73
|
module.exports = require("@modern-js/builder");
|
|
74
74
|
},
|
|
@@ -135,30 +135,29 @@ function __webpack_require__(moduleId) {
|
|
|
135
135
|
var __webpack_exports__ = {};
|
|
136
136
|
(()=>{
|
|
137
137
|
__webpack_require__.r(__webpack_exports__);
|
|
138
|
-
var
|
|
139
|
-
var
|
|
140
|
-
var
|
|
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
|
-
var
|
|
155
|
-
var
|
|
156
|
-
var
|
|
157
|
-
var
|
|
158
|
-
var
|
|
159
|
-
var
|
|
160
|
-
var
|
|
161
|
-
var _plugins_ultramodernReleaseEnvelope__rspack_import_15_default = /*#__PURE__*/ __webpack_require__.n(_plugins_ultramodernReleaseEnvelope__rspack_import_15);
|
|
138
|
+
var _modern_js_app_tools_extensions_cloudflare_builder__rspack_import_0 = __webpack_require__("@modern-js/app-tools-extensions/cloudflare-builder");
|
|
139
|
+
var _modern_js_builder__rspack_import_1 = __webpack_require__("@modern-js/builder");
|
|
140
|
+
var _modern_js_i18n_utils_language_detector__rspack_import_2 = __webpack_require__("@modern-js/i18n-utils/language-detector");
|
|
141
|
+
var _modern_js_plugin__rspack_import_3 = __webpack_require__("@modern-js/plugin");
|
|
142
|
+
var _modern_js_utils__rspack_import_4 = __webpack_require__("@modern-js/utils");
|
|
143
|
+
var path__rspack_import_5 = __webpack_require__("path");
|
|
144
|
+
var path__rspack_import_5_default = /*#__PURE__*/ __webpack_require__.n(path__rspack_import_5);
|
|
145
|
+
var _commands__rspack_import_6 = __webpack_require__("./commands");
|
|
146
|
+
var _compat__rspack_import_7 = __webpack_require__("./compat");
|
|
147
|
+
var _constants__rspack_import_8 = __webpack_require__("./constants");
|
|
148
|
+
var _locale__rspack_import_9 = __webpack_require__("./locale");
|
|
149
|
+
var _plugins_analyze__rspack_import_10 = __webpack_require__("./plugins/analyze");
|
|
150
|
+
var _plugins_analyze__rspack_import_10_default = /*#__PURE__*/ __webpack_require__.n(_plugins_analyze__rspack_import_10);
|
|
151
|
+
var _plugins_backendFederationBuild__rspack_import_11 = __webpack_require__("./plugins/backendFederationBuild");
|
|
152
|
+
var _plugins_backendFederationBuild__rspack_import_11_default = /*#__PURE__*/ __webpack_require__.n(_plugins_backendFederationBuild__rspack_import_11);
|
|
153
|
+
var _plugins_deploy__rspack_import_12 = __webpack_require__("./plugins/deploy");
|
|
154
|
+
var _plugins_deploy__rspack_import_12_default = /*#__PURE__*/ __webpack_require__.n(_plugins_deploy__rspack_import_12);
|
|
155
|
+
var _plugins_initialize__rspack_import_13 = __webpack_require__("./plugins/initialize");
|
|
156
|
+
var _plugins_initialize__rspack_import_13_default = /*#__PURE__*/ __webpack_require__.n(_plugins_initialize__rspack_import_13);
|
|
157
|
+
var _plugins_serverBuild__rspack_import_14 = __webpack_require__("./plugins/serverBuild");
|
|
158
|
+
var _plugins_serverBuild__rspack_import_14_default = /*#__PURE__*/ __webpack_require__.n(_plugins_serverBuild__rspack_import_14);
|
|
159
|
+
var _plugins_serverRuntime__rspack_import_15 = __webpack_require__("./plugins/serverRuntime");
|
|
160
|
+
var _plugins_serverRuntime__rspack_import_15_default = /*#__PURE__*/ __webpack_require__.n(_plugins_serverRuntime__rspack_import_15);
|
|
162
161
|
var _utils_generateWatchFiles__rspack_import_16 = __webpack_require__("./utils/generateWatchFiles");
|
|
163
162
|
var _utils_initAppContext__rspack_import_17 = __webpack_require__("./utils/initAppContext");
|
|
164
163
|
var _utils_restart__rspack_import_18 = __webpack_require__("./utils/restart");
|
|
@@ -223,14 +222,14 @@ var __webpack_exports__ = {};
|
|
|
223
222
|
const appTools = ()=>({
|
|
224
223
|
name: '@modern-js/app-tools',
|
|
225
224
|
usePlugins: [
|
|
226
|
-
|
|
227
|
-
(0,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
225
|
+
_plugins_serverRuntime__rspack_import_15_default()(),
|
|
226
|
+
(0, _compat__rspack_import_7.compatPlugin)(),
|
|
227
|
+
_plugins_initialize__rspack_import_13_default()(),
|
|
228
|
+
_plugins_analyze__rspack_import_10_default()(),
|
|
229
|
+
_plugins_serverBuild__rspack_import_14_default()(),
|
|
230
|
+
_plugins_backendFederationBuild__rspack_import_11_default()(),
|
|
231
|
+
_plugins_deploy__rspack_import_12_default()(),
|
|
232
|
+
(0, _modern_js_app_tools_extensions_cloudflare_builder__rspack_import_0.createCloudflareBuilderPlugin)()
|
|
234
233
|
],
|
|
235
234
|
post: [
|
|
236
235
|
'@modern-js/plugin-initialize',
|
|
@@ -241,48 +240,48 @@ var __webpack_exports__ = {};
|
|
|
241
240
|
'@modern-js/plugin-polyfill'
|
|
242
241
|
],
|
|
243
242
|
registryHooks: {
|
|
244
|
-
onAfterPrepare: (0,
|
|
245
|
-
deploy: (0,
|
|
246
|
-
checkEntryPoint: (0,
|
|
247
|
-
modifyEntrypoints: (0,
|
|
248
|
-
modifyBuilderEnvironments: (0,
|
|
249
|
-
modifyFileSystemRoutes: (0,
|
|
250
|
-
generateEntryCode: (0,
|
|
251
|
-
onBeforeGenerateRoutes: (0,
|
|
252
|
-
onBeforePrintInstructions: (0,
|
|
243
|
+
onAfterPrepare: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
244
|
+
deploy: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
245
|
+
checkEntryPoint: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
246
|
+
modifyEntrypoints: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
247
|
+
modifyBuilderEnvironments: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
248
|
+
modifyFileSystemRoutes: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
249
|
+
generateEntryCode: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
250
|
+
onBeforeGenerateRoutes: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)(),
|
|
251
|
+
onBeforePrintInstructions: (0, _modern_js_plugin__rspack_import_3.createAsyncHook)()
|
|
253
252
|
},
|
|
254
253
|
setup: (api)=>{
|
|
255
254
|
const context = api.getAppContext();
|
|
256
255
|
const userConfig = api.getConfig();
|
|
257
|
-
const locale = (0,
|
|
258
|
-
|
|
256
|
+
const locale = (0, _modern_js_i18n_utils_language_detector__rspack_import_2.getLocaleLanguage)();
|
|
257
|
+
_locale__rspack_import_9.i18n.changeLanguage({
|
|
259
258
|
locale
|
|
260
259
|
});
|
|
261
260
|
api.updateAppContext((0, _utils_initAppContext__rspack_import_17.initAppContext)({
|
|
262
261
|
metaName: context.metaName,
|
|
263
262
|
appDirectory: context.appDirectory,
|
|
264
|
-
runtimeConfigFile:
|
|
263
|
+
runtimeConfigFile: _constants__rspack_import_8.DEFAULT_RUNTIME_CONFIG_FILE,
|
|
265
264
|
options: {
|
|
266
265
|
bffRuntimeFramework: userConfig.bff?.runtimeFramework
|
|
267
266
|
},
|
|
268
267
|
tempDir: userConfig.output?.tempDir
|
|
269
268
|
}));
|
|
270
269
|
api.addCommand(async ({ program })=>{
|
|
271
|
-
await (0,
|
|
272
|
-
await (0,
|
|
273
|
-
(0,
|
|
274
|
-
(0,
|
|
275
|
-
(0,
|
|
276
|
-
(0,
|
|
277
|
-
(0,
|
|
270
|
+
await (0, _commands__rspack_import_6.devCommand)(program, api);
|
|
271
|
+
await (0, _commands__rspack_import_6.buildCommand)(program, api);
|
|
272
|
+
(0, _commands__rspack_import_6.serverCommand)(program, api);
|
|
273
|
+
(0, _commands__rspack_import_6.deployCommand)(program, api);
|
|
274
|
+
(0, _commands__rspack_import_6.inspectCommand)(program, api);
|
|
275
|
+
(0, _commands__rspack_import_6.infoCommand)(program, api);
|
|
276
|
+
(0, _modern_js_utils__rspack_import_4.deprecatedCommands)(program);
|
|
278
277
|
});
|
|
279
278
|
api.onPrepare(async ()=>{
|
|
280
|
-
const command = (0,
|
|
279
|
+
const command = (0, _modern_js_utils__rspack_import_4.getCommand)();
|
|
281
280
|
if ('deploy' === command) {
|
|
282
281
|
const isSkipBuild = [
|
|
283
282
|
'-s',
|
|
284
283
|
'--skip-build'
|
|
285
|
-
].some((tag)=>(0,
|
|
284
|
+
].some((tag)=>(0, _modern_js_utils__rspack_import_4.getArgv)().includes(tag));
|
|
286
285
|
if (isSkipBuild) return;
|
|
287
286
|
}
|
|
288
287
|
const { command: contextCommand } = api.getAppContext();
|
|
@@ -300,7 +299,7 @@ var __webpack_exports__ = {};
|
|
|
300
299
|
const resolvedConfig = api.getNormalizedConfig();
|
|
301
300
|
if (resolvedConfig.output.cleanDistPath) {
|
|
302
301
|
const appContext = api.getAppContext();
|
|
303
|
-
await (0,
|
|
302
|
+
await (0, _modern_js_utils__rspack_import_4.emptyDir)(appContext.distDirectory);
|
|
304
303
|
}
|
|
305
304
|
}
|
|
306
305
|
});
|
|
@@ -308,7 +307,7 @@ var __webpack_exports__ = {};
|
|
|
308
307
|
const appContext = api.getAppContext();
|
|
309
308
|
const config = api.getNormalizedConfig();
|
|
310
309
|
const files = await (0, _utils_generateWatchFiles__rspack_import_16.generateWatchFiles)(appContext, config.source.configDir);
|
|
311
|
-
const watchFiles = (0,
|
|
310
|
+
const watchFiles = (0, _modern_js_builder__rspack_import_1.castArray)(config.dev.watchFiles);
|
|
312
311
|
watchFiles.forEach(({ type, paths })=>{
|
|
313
312
|
if ('reload-server' === type) files.push(...Array.isArray(paths) ? paths : [
|
|
314
313
|
paths
|
|
@@ -319,7 +318,7 @@ var __webpack_exports__ = {};
|
|
|
319
318
|
api.onFileChanged(async (e)=>{
|
|
320
319
|
const { filename, eventType, isPrivate } = e;
|
|
321
320
|
const { appDirectory, apiDirectory } = api.getAppContext();
|
|
322
|
-
const relativeApiPath =
|
|
321
|
+
const relativeApiPath = path__rspack_import_5_default().relative(appDirectory, apiDirectory);
|
|
323
322
|
const isApiProject = filename.startsWith(`${relativeApiPath}/`);
|
|
324
323
|
if (!isPrivate && ('change' === eventType || 'unlink' === eventType) && !isApiProject) {
|
|
325
324
|
const { closeServer } = await import("./utils/createServer.js");
|
|
@@ -328,7 +327,7 @@ var __webpack_exports__ = {};
|
|
|
328
327
|
}
|
|
329
328
|
});
|
|
330
329
|
api.onBeforeRestart(()=>{
|
|
331
|
-
(0,
|
|
330
|
+
(0, _modern_js_utils__rspack_import_4.cleanRequireCache)([
|
|
332
331
|
require.resolve('./plugins/analyze')
|
|
333
332
|
]);
|
|
334
333
|
});
|
|
@@ -171,7 +171,7 @@ const getProdServerRoutes = (distDirectory)=>{
|
|
|
171
171
|
throw new Error(`Failed to read routes from ${routeJSON}, please check if the file exists.`);
|
|
172
172
|
}
|
|
173
173
|
};
|
|
174
|
-
const getProdEntrypoints = (distDirectory, routes, mainEntryName = MAIN_ENTRY_NAME)=>{
|
|
174
|
+
const getProdEntrypoints = (distDirectory, routes, mainEntryName = utils_namespaceObject.MAIN_ENTRY_NAME)=>{
|
|
175
175
|
const byEntryName = new Map();
|
|
176
176
|
for (const route of routes){
|
|
177
177
|
if (!route.entryName || byEntryName.has(route.entryName)) continue;
|
|
@@ -53,23 +53,15 @@ const isDefaultExportFunction = (file)=>{
|
|
|
53
53
|
plugins: [
|
|
54
54
|
'jsx',
|
|
55
55
|
"typescript",
|
|
56
|
-
'classProperties',
|
|
57
|
-
'dynamicImport',
|
|
58
56
|
'exportDefaultFrom',
|
|
59
|
-
'exportNamespaceFrom',
|
|
60
57
|
'decorators-legacy',
|
|
61
58
|
'functionBind',
|
|
62
|
-
'classPrivateMethods',
|
|
63
59
|
[
|
|
64
60
|
'pipelineOperator',
|
|
65
61
|
{
|
|
66
62
|
proposal: 'fsharp'
|
|
67
63
|
}
|
|
68
|
-
]
|
|
69
|
-
'optionalChaining',
|
|
70
|
-
'optionalCatchBinding',
|
|
71
|
-
'objectRestSpread',
|
|
72
|
-
'numericSeparator'
|
|
64
|
+
]
|
|
73
65
|
]
|
|
74
66
|
});
|
|
75
67
|
let isExportFunction = false;
|
|
@@ -141,7 +141,7 @@ module.exports = { __modernjsBackendFederation, get, init };
|
|
|
141
141
|
if (!output) throw new Error('[backend-federation-build] CommonJS backend federation container emitted no output.');
|
|
142
142
|
return output.text;
|
|
143
143
|
};
|
|
144
|
-
const createBackendManifest = (workspaceRoot, distDirectory, app)=>{
|
|
144
|
+
const createBackendManifest = (workspaceRoot, distDirectory, app, entryIntegrity)=>{
|
|
145
145
|
const sourceModule = `${app.directory}/api/effect-api.ts`;
|
|
146
146
|
const publicPath = createPublicPath(app.containerEntry, app.port);
|
|
147
147
|
const manifest = {
|
|
@@ -172,6 +172,7 @@ const createBackendManifest = (workspaceRoot, distDirectory, app)=>{
|
|
|
172
172
|
ssrPublicPath: publicPath
|
|
173
173
|
},
|
|
174
174
|
entry: {
|
|
175
|
+
...entryIntegrity,
|
|
175
176
|
file: universal_namespaceObject.BACKEND_FEDERATION_REMOTE_ENTRY_FILE,
|
|
176
177
|
path: (0, external_config_js_namespaceObject.normalizeRelativePath)(external_node_path_default().relative(workspaceRoot, external_node_path_default().join(distDirectory, universal_namespaceObject.BACKEND_FEDERATION_REMOTE_ENTRY_FILE))),
|
|
177
178
|
type: app.remoteType,
|
|
@@ -53,8 +53,8 @@ const promises_namespaceObject = require("node:fs/promises");
|
|
|
53
53
|
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
54
54
|
const external_node_path_namespaceObject = require("node:path");
|
|
55
55
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
56
|
+
const release_identity_namespaceObject = require("@modern-js/app-tools-extensions/release-identity");
|
|
56
57
|
const universal_namespaceObject = require("@modern-js/utils/universal");
|
|
57
|
-
const external_ultramodern_release_identity_js_namespaceObject = require("../../ultramodern-release-identity.js");
|
|
58
58
|
const COMPACT_CONFIG_PATH = '.modernjs/ultramodern.json';
|
|
59
59
|
const normalizeRelativePath = (value)=>value.replace(/\\/gu, '/').replace(/^\.\/+/u, '');
|
|
60
60
|
const isRecord = (value)=>'object' == typeof value && null !== value;
|
|
@@ -109,7 +109,7 @@ const findWorkspaceRoot = (appDirectory)=>{
|
|
|
109
109
|
current = parent;
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
|
-
const resolveWorkspaceSourceRevision = async (workspaceRoot)=>(0,
|
|
112
|
+
const resolveWorkspaceSourceRevision = async (workspaceRoot)=>(0, release_identity_namespaceObject.resolveUltramodernSourceRevision)(workspaceRoot);
|
|
113
113
|
const createStampedDeliveryUnit = (input)=>{
|
|
114
114
|
if (!input.unitId || !input.buildMarker || !input.packageName || !input.version) return;
|
|
115
115
|
const record = {
|
|
@@ -45,8 +45,9 @@ const promises_namespaceObject = require("node:fs/promises");
|
|
|
45
45
|
var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
|
|
46
46
|
const external_node_path_namespaceObject = require("node:path");
|
|
47
47
|
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
48
|
+
const release_identity_namespaceObject = require("@modern-js/app-tools-extensions/release-identity");
|
|
49
|
+
const node_namespaceObject = require("@modern-js/server-runtime-extensions/backend-federation-security/node");
|
|
48
50
|
const universal_namespaceObject = require("@modern-js/utils/universal");
|
|
49
|
-
const external_ultramodern_release_identity_js_namespaceObject = require("../../ultramodern-release-identity.js");
|
|
50
51
|
const external_codegen_js_namespaceObject = require("./codegen.js");
|
|
51
52
|
const external_config_js_namespaceObject = require("./config.js");
|
|
52
53
|
const emitBackendFederationArtifacts = async (appDirectory, distDirectory)=>{
|
|
@@ -80,7 +81,7 @@ const emitBackendFederationArtifacts = async (appDirectory, distDirectory)=>{
|
|
|
80
81
|
const unitId = compactDeliveryUnit?.unitId ?? buildIdentity.unitId;
|
|
81
82
|
const generationBuildMarker = compactDeliveryUnit?.buildMarker ?? buildIdentity.buildVersion;
|
|
82
83
|
const sourceRevision = await (0, external_config_js_namespaceObject.resolveWorkspaceSourceRevision)(workspaceRoot);
|
|
83
|
-
const buildVersion = generationBuildMarker && unitId ? (0,
|
|
84
|
+
const buildVersion = generationBuildMarker && unitId ? (0, release_identity_namespaceObject.resolveUltramodernReleaseIdentity)({
|
|
84
85
|
generationBuildMarker,
|
|
85
86
|
unitId,
|
|
86
87
|
workspaceRoot
|
|
@@ -111,11 +112,12 @@ const emitBackendFederationArtifacts = async (appDirectory, distDirectory)=>{
|
|
|
111
112
|
const manifestPath = external_node_path_default().join(distDirectory, universal_namespaceObject.BACKEND_FEDERATION_MANIFEST_FILE);
|
|
112
113
|
const entryPath = external_node_path_default().join(distDirectory, universal_namespaceObject.BACKEND_FEDERATION_REMOTE_ENTRY_FILE);
|
|
113
114
|
const deliveryUnitArtifactPath = stampedBuildArtifact ? external_node_path_default().join(distDirectory, universal_namespaceObject.ULTRAMODERN_BUILD_ARTIFACT_FILE) : void 0;
|
|
115
|
+
const entrySource = await (0, external_codegen_js_namespaceObject.createBackendRemoteEntrySource)(workspaceRoot, resolvedApp, effectApiPath, entryPath);
|
|
114
116
|
await promises_default().mkdir(distDirectory, {
|
|
115
117
|
recursive: true
|
|
116
118
|
});
|
|
117
|
-
await promises_default().writeFile(entryPath,
|
|
118
|
-
await promises_default().writeFile(manifestPath, `${JSON.stringify((0, external_codegen_js_namespaceObject.createBackendManifest)(workspaceRoot, distDirectory, resolvedApp), null, 2)}\n`);
|
|
119
|
+
await promises_default().writeFile(entryPath, entrySource);
|
|
120
|
+
await promises_default().writeFile(manifestPath, `${JSON.stringify((0, external_codegen_js_namespaceObject.createBackendManifest)(workspaceRoot, distDirectory, resolvedApp, (0, node_namespaceObject.createBackendFederationEntryIntegrity)(entrySource)), null, 2)}\n`);
|
|
119
121
|
if (stampedBuildArtifact && deliveryUnitArtifactPath) await promises_default().writeFile(deliveryUnitArtifactPath, `${JSON.stringify(stampedBuildArtifact, null, 2)}\n`);
|
|
120
122
|
return {
|
|
121
123
|
appId: resolvedApp.id,
|
|
@@ -32,19 +32,19 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
32
32
|
getSupportedDeployTargets: ()=>getSupportedDeployTargets,
|
|
33
33
|
resolveDeployTarget: ()=>resolveDeployTarget
|
|
34
34
|
});
|
|
35
|
+
const cloudflare_namespaceObject = require("@modern-js/app-tools-extensions/cloudflare");
|
|
35
36
|
const external_std_env_namespaceObject = require("std-env");
|
|
36
|
-
const index_js_namespaceObject = require("./platforms/cloudflare/index.js");
|
|
37
37
|
const gh_pages_js_namespaceObject = require("./platforms/gh-pages.js");
|
|
38
38
|
const netlify_js_namespaceObject = require("./platforms/netlify.js");
|
|
39
39
|
const node_js_namespaceObject = require("./platforms/node.js");
|
|
40
40
|
const vercel_js_namespaceObject = require("./platforms/vercel.js");
|
|
41
|
-
const
|
|
41
|
+
const index_js_namespaceObject = require("./utils/index.js");
|
|
42
42
|
const deployPresets = {
|
|
43
43
|
node: node_js_namespaceObject.createNodePreset,
|
|
44
44
|
vercel: vercel_js_namespaceObject.createVercelPreset,
|
|
45
45
|
netlify: netlify_js_namespaceObject.createNetlifyPreset,
|
|
46
46
|
ghPages: gh_pages_js_namespaceObject.createGhPagesPreset,
|
|
47
|
-
cloudflare:
|
|
47
|
+
cloudflare: cloudflare_namespaceObject.createCloudflarePreset
|
|
48
48
|
};
|
|
49
49
|
const getSupportedDeployTargets = ()=>Object.keys(deployPresets);
|
|
50
50
|
const isDeployTarget = (target)=>Object.prototype.hasOwnProperty.call(deployPresets, target);
|
|
@@ -59,7 +59,7 @@ const normalizeDetectedProvider = (value)=>value ? providerDeployTargets[value]
|
|
|
59
59
|
const resolveDeployTarget = (modernConfig, envDeployTarget = process.env.MODERNJS_DEPLOY, detectedProvider = external_std_env_namespaceObject.provider)=>modernConfig.deploy?.target || envDeployTarget || normalizeDetectedProvider(detectedProvider) || 'node';
|
|
60
60
|
async function getDeployPreset(appContext, modernConfig, deployTarget, api) {
|
|
61
61
|
const { appDirectory, distDirectory, metaName } = appContext;
|
|
62
|
-
const { useSSR, useAPI, useWebServer } = (0,
|
|
62
|
+
const { useSSR, useAPI, useWebServer } = (0, index_js_namespaceObject.getProjectUsage)(appDirectory, distDirectory, metaName);
|
|
63
63
|
const needModernServer = useSSR || useAPI || useWebServer;
|
|
64
64
|
if (!isDeployTarget(deployTarget)) throw new Error(`Unknown deploy target: '${deployTarget}'. deploy.target or MODERNJS_DEPLOY should be one of: ${getSupportedDeployTargets().join(', ')}.`);
|
|
65
65
|
const createPreset = deployPresets[deployTarget];
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var __webpack_modules__ = {
|
|
3
|
+
"@modern-js/app-tools-extensions/cloudflare-output-verifier" (module) {
|
|
4
|
+
module.exports = require("@modern-js/app-tools-extensions/cloudflare-output-verifier");
|
|
5
|
+
}
|
|
6
|
+
};
|
|
7
|
+
var __webpack_module_cache__ = {};
|
|
8
|
+
function __webpack_require__(moduleId) {
|
|
9
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
10
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
11
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
12
|
+
exports: {}
|
|
13
|
+
};
|
|
14
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
15
|
+
return module.exports;
|
|
16
|
+
}
|
|
3
17
|
(()=>{
|
|
4
18
|
__webpack_require__.n = (module)=>{
|
|
5
19
|
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
@@ -35,154 +49,14 @@ var __webpack_require__ = {};
|
|
|
35
49
|
};
|
|
36
50
|
})();
|
|
37
51
|
var __webpack_exports__ = {};
|
|
38
|
-
|
|
39
|
-
__webpack_require__.
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
const external_node_path_namespaceObject = require("node:path");
|
|
47
|
-
var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
|
|
48
|
-
const external_cloudflare_output_plan_js_namespaceObject = require("../cloudflare-output-plan.js");
|
|
49
|
-
const external_identity_js_namespaceObject = require("./identity.js");
|
|
50
|
-
const external_issues_js_namespaceObject = require("./issues.js");
|
|
51
|
-
const external_manifest_js_namespaceObject = require("./manifest.js");
|
|
52
|
-
const external_worker_bundles_js_namespaceObject = require("./worker-bundles.js");
|
|
53
|
-
const external_mutation_policy_js_namespaceObject = require("./mutation-policy.js");
|
|
54
|
-
const pathExists = async (filePath)=>{
|
|
55
|
-
try {
|
|
56
|
-
await promises_default().access(filePath);
|
|
57
|
-
return true;
|
|
58
|
-
} catch {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
const readJson = async (filePath)=>JSON.parse(await promises_default().readFile(filePath, 'utf-8'));
|
|
63
|
-
const verifyCloudflareOutput = async (options)=>{
|
|
64
|
-
const outputDirectory = external_node_path_default().resolve(options.outputDirectory);
|
|
65
|
-
const issues = [];
|
|
66
|
-
const outputPlan = (0, external_cloudflare_output_plan_js_namespaceObject.createCloudflareOutputPlan)(outputDirectory);
|
|
67
|
-
for (const relativePath of outputPlan.requiredFiles){
|
|
68
|
-
const filePath = external_node_path_default().join(outputDirectory, relativePath);
|
|
69
|
-
if (!await pathExists(filePath)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
70
|
-
code: 'missing-file',
|
|
71
|
-
message: `Cloudflare output is missing ${relativePath}.`,
|
|
72
|
-
path: filePath
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
const manifestPath = outputPlan.paths.workerManifest;
|
|
76
|
-
const wranglerPath = outputPlan.paths.wranglerConfig;
|
|
77
|
-
const packagePath = outputPlan.paths.outputPackage;
|
|
78
|
-
const workerPackagePath = outputPlan.paths.workerPackage;
|
|
79
|
-
const manifest = await pathExists(manifestPath) ? await readJson(manifestPath) : void 0;
|
|
80
|
-
const wrangler = await pathExists(wranglerPath) ? await readJson(wranglerPath) : void 0;
|
|
81
|
-
const outputPackage = await pathExists(packagePath) ? await readJson(packagePath) : void 0;
|
|
82
|
-
const workerPackage = await pathExists(workerPackagePath) ? await readJson(workerPackagePath) : void 0;
|
|
83
|
-
if (manifest) {
|
|
84
|
-
(0, external_manifest_js_namespaceObject.verifyManifestShape)(issues, manifest, manifestPath);
|
|
85
|
-
(0, external_identity_js_namespaceObject.verifyDeliveryUnitIdentity)(issues, manifest, manifestPath, options.deliveryUnit);
|
|
86
|
-
const workerReferences = (0, external_worker_bundles_js_namespaceObject.getWorkerBundleReferences)(manifest);
|
|
87
|
-
const providedWorkerPackages = new Set(workerPackage?.dependencies && 'object' == typeof workerPackage.dependencies ? Object.keys(workerPackage.dependencies) : []);
|
|
88
|
-
if (workerReferences.length > 0 && !await pathExists(workerPackagePath)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
89
|
-
code: 'missing-file',
|
|
90
|
-
message: 'Cloudflare output is missing worker/package.json for referenced worker bundles.',
|
|
91
|
-
path: workerPackagePath
|
|
92
|
-
});
|
|
93
|
-
if (manifest.bff?.runtimeFramework === 'effect' && !(0, external_worker_bundles_js_namespaceObject.getEffectBffWorker)(manifest)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
94
|
-
code: 'missing-worker-bundle',
|
|
95
|
-
message: 'Cloudflare Effect BFF manifest points to a missing worker bundle.'
|
|
96
|
-
});
|
|
97
|
-
for (const workerReference of workerReferences){
|
|
98
|
-
const resolvedWorker = (0, external_worker_bundles_js_namespaceObject.resolveWorkerBundleReference)(issues, outputDirectory, workerReference, manifestPath);
|
|
99
|
-
if (!resolvedWorker) continue;
|
|
100
|
-
const workerExists = await pathExists(resolvedWorker.path);
|
|
101
|
-
if (!workerExists) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
102
|
-
code: 'missing-worker-bundle',
|
|
103
|
-
message: (0, external_worker_bundles_js_namespaceObject.missingWorkerBundleMessage)(workerReference),
|
|
104
|
-
path: resolvedWorker.path
|
|
105
|
-
});
|
|
106
|
-
if (workerExists) {
|
|
107
|
-
const workerSource = await promises_default().readFile(resolvedWorker.path, 'utf-8');
|
|
108
|
-
await (0, external_worker_bundles_js_namespaceObject.verifyWorkerBundleReferences)(issues, resolvedWorker, workerSource, {
|
|
109
|
-
providedPackages: providedWorkerPackages,
|
|
110
|
-
workerRoot: outputPlan.paths.workerBundle
|
|
111
|
-
});
|
|
112
|
-
if ('effect-bff' === resolvedWorker.kind && (workerSource.includes(';entityKind;') || workerSource.includes(';entityKind,entityKind;'))) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
113
|
-
code: 'invalid-worker-bundle',
|
|
114
|
-
message: 'Cloudflare Effect BFF worker bundle contains invalid Drizzle entityKind marker references.',
|
|
115
|
-
path: resolvedWorker.path
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (wrangler) {
|
|
121
|
-
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.main, outputPlan.wrangler.main, {
|
|
122
|
-
code: 'invalid-wrangler',
|
|
123
|
-
message: `wrangler.json main must be ${outputPlan.wrangler.main}.`,
|
|
124
|
-
path: wranglerPath
|
|
125
|
-
});
|
|
126
|
-
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.assets?.binding, outputPlan.wrangler.assets.binding, {
|
|
127
|
-
code: 'invalid-wrangler',
|
|
128
|
-
message: 'wrangler.json assets.binding must be ASSETS.',
|
|
129
|
-
path: wranglerPath
|
|
130
|
-
});
|
|
131
|
-
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.assets?.directory, outputPlan.wrangler.assets.directory, {
|
|
132
|
-
code: 'invalid-wrangler',
|
|
133
|
-
message: 'wrangler.json assets.directory must be ./public.',
|
|
134
|
-
path: wranglerPath
|
|
135
|
-
});
|
|
136
|
-
(0, external_issues_js_namespaceObject.assertEqual)(issues, wrangler.assets?.run_worker_first, outputPlan.wrangler.assets.run_worker_first, {
|
|
137
|
-
code: 'invalid-wrangler',
|
|
138
|
-
message: 'wrangler.json assets.run_worker_first must be true.',
|
|
139
|
-
path: wranglerPath
|
|
140
|
-
});
|
|
141
|
-
for (const flag of outputPlan.wrangler.requiredCompatibilityFlags)(0, external_issues_js_namespaceObject.assertFlag)(issues, wrangler.compatibility_flags, flag, {
|
|
142
|
-
code: 'invalid-wrangler',
|
|
143
|
-
message: `wrangler.json compatibility_flags must include ${flag}.`,
|
|
144
|
-
path: wranglerPath
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
if (outputPackage) (0, external_issues_js_namespaceObject.assertEqual)(issues, outputPackage.type, outputPlan.packages.output.type, {
|
|
148
|
-
code: 'invalid-package',
|
|
149
|
-
message: '.output/package.json must declare type module.',
|
|
150
|
-
path: packagePath
|
|
151
|
-
});
|
|
152
|
-
if (workerPackage) (0, external_issues_js_namespaceObject.assertEqual)(issues, workerPackage.type, outputPlan.packages.worker.type, {
|
|
153
|
-
code: 'invalid-package',
|
|
154
|
-
message: '.output/worker/package.json must declare type commonjs.',
|
|
155
|
-
path: workerPackagePath
|
|
156
|
-
});
|
|
157
|
-
for (const leakedPath of outputPlan.publicLeakDirectories){
|
|
158
|
-
const publicPath = external_node_path_default().join(outputPlan.paths.publicAssets, leakedPath);
|
|
159
|
-
if (await pathExists(publicPath)) (0, external_issues_js_namespaceObject.addIssue)(issues, {
|
|
160
|
-
code: 'public-output-leak',
|
|
161
|
-
message: `Framework-owned ${leakedPath} output leaked into public assets.`,
|
|
162
|
-
path: publicPath
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
if (false !== options.importWorker && await pathExists(outputPlan.paths.workerEntry)) await (0, external_worker_bundles_js_namespaceObject.verifyWorkerImport)(issues, outputPlan.paths.workerEntry, manifest);
|
|
166
|
-
return {
|
|
167
|
-
ok: 0 === issues.length,
|
|
168
|
-
issues
|
|
169
|
-
};
|
|
170
|
-
};
|
|
171
|
-
const assertCloudflareOutput = async (options)=>{
|
|
172
|
-
const result = await verifyCloudflareOutput(options);
|
|
173
|
-
if (!result.ok) throw new Error([
|
|
174
|
-
'Cloudflare output verification failed:',
|
|
175
|
-
...result.issues.map((issue)=>`- ${issue.code}: ${issue.message}${issue.path ? ` (${issue.path})` : ''}`)
|
|
176
|
-
].join('\n'));
|
|
177
|
-
};
|
|
178
|
-
exports.assertCloudflareOutput = __webpack_exports__.assertCloudflareOutput;
|
|
179
|
-
exports.verifyCloudflareOutput = __webpack_exports__.verifyCloudflareOutput;
|
|
180
|
-
exports.verifyCloudflareOutputMutationPolicy = __webpack_exports__.verifyCloudflareOutputMutationPolicy;
|
|
181
|
-
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
182
|
-
"assertCloudflareOutput",
|
|
183
|
-
"verifyCloudflareOutput",
|
|
184
|
-
"verifyCloudflareOutputMutationPolicy"
|
|
185
|
-
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
52
|
+
(()=>{
|
|
53
|
+
__webpack_require__.r(__webpack_exports__);
|
|
54
|
+
var _modern_js_app_tools_extensions_cloudflare_output_verifier__rspack_import_0 = __webpack_require__("@modern-js/app-tools-extensions/cloudflare-output-verifier");
|
|
55
|
+
var __rspack_reexport = {};
|
|
56
|
+
for(const __rspack_import_key in _modern_js_app_tools_extensions_cloudflare_output_verifier__rspack_import_0)if ("default" !== __rspack_import_key) __rspack_reexport[__rspack_import_key] = ()=>_modern_js_app_tools_extensions_cloudflare_output_verifier__rspack_import_0[__rspack_import_key];
|
|
57
|
+
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
58
|
+
})();
|
|
59
|
+
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
186
60
|
Object.defineProperty(exports, '__esModule', {
|
|
187
61
|
value: true
|
|
188
62
|
});
|