@bleedingdev/modern-js-app-tools 3.8.3-ultramodern.1 → 3.8.3-ultramodern.3
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
|
@@ -1,77 +1,57 @@
|
|
|
1
1
|
const fs = require('node:fs/promises');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
const { createProdServer } = require('@modern-js/prod-server');
|
|
4
|
-
|
|
5
4
|
p_genPluginImportsCode;
|
|
6
|
-
|
|
7
|
-
if (!process.env.NODE_ENV) {
|
|
8
|
-
process.env.NODE_ENV = 'production';
|
|
9
|
-
}
|
|
10
|
-
|
|
5
|
+
if (!process.env.NODE_ENV) process.env.NODE_ENV = 'production';
|
|
11
6
|
let requestHandler = null;
|
|
12
7
|
let handlerCreationPromise = null;
|
|
13
|
-
|
|
14
8
|
async function loadRoutes(routeFilepath) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return [];
|
|
25
|
-
}
|
|
9
|
+
try {
|
|
10
|
+
await fs.access(routeFilepath);
|
|
11
|
+
const content = await fs.readFile(routeFilepath, 'utf-8');
|
|
12
|
+
const routeSpec = JSON.parse(content);
|
|
13
|
+
return routeSpec.routes || [];
|
|
14
|
+
} catch (error) {
|
|
15
|
+
console.warn('route.json not found or invalid, continuing with empty routes.');
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
26
18
|
}
|
|
27
|
-
|
|
28
19
|
async function initServer() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const app = await createProdServer(prodServerOptions);
|
|
49
|
-
|
|
50
|
-
return app.getRequestListener();
|
|
20
|
+
const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
|
|
21
|
+
const routes = await loadRoutes(routeFilepath);
|
|
22
|
+
const dynamicProdOptions = p_dynamicProdOptions;
|
|
23
|
+
const prodServerOptions = {
|
|
24
|
+
pwd: __dirname,
|
|
25
|
+
routes,
|
|
26
|
+
disableCustomHook: true,
|
|
27
|
+
appContext: {
|
|
28
|
+
sharedDirectory: p_sharedDirectory,
|
|
29
|
+
apiDirectory: p_apiDirectory,
|
|
30
|
+
lambdaDirectory: p_lambdaDirectory,
|
|
31
|
+
bffRuntimeFramework: p_bffRuntimeFramework
|
|
32
|
+
},
|
|
33
|
+
plugins: p_plugins,
|
|
34
|
+
serverConfigPath: p_serverDirectory,
|
|
35
|
+
...dynamicProdOptions
|
|
36
|
+
};
|
|
37
|
+
const app = await createProdServer(prodServerOptions);
|
|
38
|
+
return app.getRequestListener();
|
|
51
39
|
}
|
|
52
|
-
|
|
53
40
|
async function createHandler() {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
41
|
+
if (!handlerCreationPromise) handlerCreationPromise = (async ()=>{
|
|
42
|
+
try {
|
|
43
|
+
requestHandler = await initServer();
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('Error creating server:', error);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
62
48
|
})();
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
return requestHandler;
|
|
49
|
+
await handlerCreationPromise;
|
|
50
|
+
return requestHandler;
|
|
66
51
|
}
|
|
67
|
-
|
|
68
52
|
createHandler();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
await createHandler();
|
|
73
|
-
}
|
|
74
|
-
return requestHandler(req, res);
|
|
53
|
+
const handler = async (req, res)=>{
|
|
54
|
+
if (!requestHandler) await createHandler();
|
|
55
|
+
return requestHandler(req, res);
|
|
75
56
|
};
|
|
76
|
-
|
|
77
57
|
module.exports = handler;
|
|
@@ -2,78 +2,57 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { createProdServer } from '@modern-js/prod-server';
|
|
5
|
-
|
|
6
5
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
|
|
8
6
|
p_genPluginImportsCode;
|
|
9
|
-
|
|
10
|
-
if (!process.env.NODE_ENV) {
|
|
11
|
-
process.env.NODE_ENV = 'production';
|
|
12
|
-
}
|
|
13
|
-
|
|
7
|
+
if (!process.env.NODE_ENV) process.env.NODE_ENV = 'production';
|
|
14
8
|
let requestHandler = null;
|
|
15
9
|
let handlerCreationPromise = null;
|
|
16
|
-
|
|
17
10
|
async function loadRoutes(routeFilepath) {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return [];
|
|
28
|
-
}
|
|
11
|
+
try {
|
|
12
|
+
await fs.access(routeFilepath);
|
|
13
|
+
const content = await fs.readFile(routeFilepath, 'utf-8');
|
|
14
|
+
const routeSpec = JSON.parse(content);
|
|
15
|
+
return routeSpec.routes || [];
|
|
16
|
+
} catch (error) {
|
|
17
|
+
console.warn('route.json not found or invalid, continuing with empty routes.');
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
29
20
|
}
|
|
30
|
-
|
|
31
21
|
async function initServer() {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
const app = await createProdServer(prodServerOptions);
|
|
51
|
-
|
|
52
|
-
return app.getRequestListener();
|
|
22
|
+
const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
|
|
23
|
+
const routes = await loadRoutes(routeFilepath);
|
|
24
|
+
const dynamicProdOptions = p_dynamicProdOptions;
|
|
25
|
+
const prodServerOptions = {
|
|
26
|
+
pwd: __dirname,
|
|
27
|
+
routes,
|
|
28
|
+
disableCustomHook: true,
|
|
29
|
+
appContext: {
|
|
30
|
+
sharedDirectory: p_sharedDirectory,
|
|
31
|
+
apiDirectory: p_apiDirectory,
|
|
32
|
+
lambdaDirectory: p_lambdaDirectory
|
|
33
|
+
},
|
|
34
|
+
plugins: p_plugins,
|
|
35
|
+
serverConfigPath: p_serverDirectory,
|
|
36
|
+
...dynamicProdOptions
|
|
37
|
+
};
|
|
38
|
+
const app = await createProdServer(prodServerOptions);
|
|
39
|
+
return app.getRequestListener();
|
|
53
40
|
}
|
|
54
|
-
|
|
55
41
|
async function createHandler() {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
42
|
+
if (!handlerCreationPromise) handlerCreationPromise = (async ()=>{
|
|
43
|
+
try {
|
|
44
|
+
requestHandler = await initServer();
|
|
45
|
+
} catch (error) {
|
|
46
|
+
console.error('Error creating server:', error);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
}
|
|
64
49
|
})();
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return requestHandler;
|
|
50
|
+
await handlerCreationPromise;
|
|
51
|
+
return requestHandler;
|
|
68
52
|
}
|
|
69
|
-
|
|
70
53
|
createHandler();
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
await createHandler();
|
|
75
|
-
}
|
|
76
|
-
return requestHandler(req, res);
|
|
54
|
+
const handler = async (req, res)=>{
|
|
55
|
+
if (!requestHandler) await createHandler();
|
|
56
|
+
return requestHandler(req, res);
|
|
77
57
|
};
|
|
78
|
-
|
|
79
58
|
export default handler;
|
|
@@ -1,53 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
import
|
|
3
|
-
import { emitFrameworkMicroVerticalReleaseEnvelope, emitNodeStagedReleaseEnvelope, verifyBuildOutputReleaseEnvelope, verifyNodeReleaseEnvelopeStaging } from "../ultramodern-release-envelope/framework-output.mjs";
|
|
2
|
+
import { createUltramodernReleaseEnvelopePlugin } from "@modern-js/app-tools-extensions/release-envelope/plugin";
|
|
4
3
|
import { resolveDeployTarget } from "./deploy/index.mjs";
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const config = api.getNormalizedConfig();
|
|
8
|
-
if ('modern-js' !== metaName && !config.deploy?.target && !process.env.MODERNJS_DEPLOY) return;
|
|
9
|
-
return resolveDeployTarget(config);
|
|
10
|
-
};
|
|
11
|
-
const ultramodernReleaseEnvelope = ()=>({
|
|
12
|
-
name: '@modern-js/ultramodern-release-envelope',
|
|
13
|
-
pre: [
|
|
14
|
-
'@modern-js/backend-federation-build',
|
|
15
|
-
'@modern-js/plugin-bff'
|
|
16
|
-
],
|
|
17
|
-
setup (api) {
|
|
18
|
-
const emitBuildEnvelope = async (target)=>{
|
|
19
|
-
const { apiOnly, distDirectory } = api.getAppContext();
|
|
20
|
-
await emitFrameworkMicroVerticalReleaseEnvelope({
|
|
21
|
-
apiOnly,
|
|
22
|
-
distDirectory,
|
|
23
|
-
target
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
api.onAfterBuild(async ()=>{
|
|
27
|
-
const configuredTarget = resolveDeployTarget(api.getNormalizedConfig());
|
|
28
|
-
if ('node' !== configuredTarget && 'cloudflare' !== configuredTarget) return;
|
|
29
|
-
await emitBuildEnvelope(configuredTarget);
|
|
30
|
-
});
|
|
31
|
-
api.onBeforeDeploy(async ()=>{
|
|
32
|
-
const configuredTarget = resolveActiveDeployTarget(api);
|
|
33
|
-
if ('node' !== configuredTarget) return;
|
|
34
|
-
await emitBuildEnvelope(configuredTarget);
|
|
35
|
-
const { distDirectory } = api.getAppContext();
|
|
36
|
-
await verifyBuildOutputReleaseEnvelope(distDirectory, configuredTarget);
|
|
37
|
-
});
|
|
38
|
-
api.onAfterDeploy(async ()=>{
|
|
39
|
-
const configuredTarget = resolveActiveDeployTarget(api);
|
|
40
|
-
if ('node' !== configuredTarget) return;
|
|
41
|
-
const { appDirectory, distDirectory } = api.getAppContext();
|
|
42
|
-
const outputDirectory = node_path.join(appDirectory, '.output');
|
|
43
|
-
const releaseEnvelope = await emitNodeStagedReleaseEnvelope({
|
|
44
|
-
distDirectory,
|
|
45
|
-
outputDirectory
|
|
46
|
-
});
|
|
47
|
-
if (releaseEnvelope) await verifyNodeReleaseEnvelopeStaging({
|
|
48
|
-
outputDirectory
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
}
|
|
4
|
+
const ultramodernReleaseEnvelope = ()=>createUltramodernReleaseEnvelopePlugin({
|
|
5
|
+
resolveDeployTarget: resolveDeployTarget
|
|
52
6
|
});
|
|
53
7
|
export default ultramodernReleaseEnvelope;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import node_fs from "node:fs";
|
|
3
3
|
import node_path from "node:path";
|
|
4
|
+
import { resolveUltramodernReleaseIdentity } from "@modern-js/app-tools-extensions/release-identity";
|
|
4
5
|
import { mergeConfig } from "@modern-js/plugin/cli";
|
|
5
6
|
import { rspack } from "@rsbuild/core";
|
|
6
|
-
import { resolveUltramodernReleaseIdentity } from "./ultramodern-release-identity.mjs";
|
|
7
7
|
const DEFAULT_OTLP_ENDPOINT = 'http://127.0.0.1:4318/v1/logs';
|
|
8
8
|
const DEFAULT_VICTORIA_METRICS_ENDPOINT = 'http://127.0.0.1:8428/api/v1/import/prometheus';
|
|
9
9
|
const resolveReactRouterPackageDir = (appDirectory)=>{
|
|
@@ -109,4 +109,5 @@ const presetUltramodern = (config, options = {})=>mergeConfig([
|
|
|
109
109
|
createPresetUltramodernConfig(options),
|
|
110
110
|
config
|
|
111
111
|
]);
|
|
112
|
+
export { default as ultramodernReleaseEnvelopePlugin } from "./plugins/ultramodernReleaseEnvelope.mjs";
|
|
112
113
|
export { createPresetUltramodernConfig, presetUltramodern };
|
|
@@ -8,25 +8,25 @@ import { loadInternalPlugins } from "../utils/loadPlugins.mjs";
|
|
|
8
8
|
async function createRunOptions({ cwd, initialLog, metaName = 'modern-js', version, internalPlugins, configFile }) {
|
|
9
9
|
const nodeVersion = process.versions.node;
|
|
10
10
|
const versionArr = nodeVersion.split('.').map(Number);
|
|
11
|
-
if (versionArr[0]
|
|
12
|
-
${chalk.bgRed.white.bold('
|
|
11
|
+
if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] < 7) throw new Error(`
|
|
12
|
+
${chalk.bgRed.white.bold(' UNSUPPORTED NODE.JS RUNTIME ')}
|
|
13
13
|
|
|
14
|
-
${chalk.red.bold(
|
|
15
|
-
${chalk.red('-
|
|
14
|
+
${chalk.red.bold(`UltraModern.js requires Node.js >=26.7.0; detected v${nodeVersion}.`)}
|
|
15
|
+
${chalk.red('- Legacy Node runtimes and TypeScript transpiler fallbacks are unsupported.')}
|
|
16
16
|
|
|
17
17
|
${chalk.yellow('▸ Detected Runtime:')} ${chalk.yellow.bold(`Node.js v${nodeVersion}`)}
|
|
18
|
-
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js
|
|
19
|
-
${chalk.green('▸
|
|
18
|
+
${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.7.0 or higher')}
|
|
19
|
+
${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.7.0')}
|
|
20
20
|
|
|
21
21
|
${chalk.cyan('Immediate Action Required:')}
|
|
22
22
|
${chalk.gray('├──')} ${chalk.yellow('Recommended Upgrade')}
|
|
23
|
-
${chalk.bold('
|
|
23
|
+
${chalk.bold('mise install && mise exec -- node --version')}
|
|
24
24
|
${chalk.gray('├──')} ${chalk.yellow('Manual Installation')}
|
|
25
|
-
${chalk.underline('https://nodejs.org/download/release/
|
|
25
|
+
${chalk.underline('https://nodejs.org/download/release/v26.7.0/')}
|
|
26
26
|
${chalk.gray('└──')} ${chalk.yellow('Environment Verification')}
|
|
27
27
|
${chalk.bold('node -v && npm -v')}
|
|
28
28
|
|
|
29
|
-
${chalk.hex('#AAAAAA').italic('[
|
|
29
|
+
${chalk.hex('#AAAAAA').italic('[Runtime Policy] Upgrade Node; UltraModern.js intentionally carries no legacy transpiler fallback.')}
|
|
30
30
|
`);
|
|
31
31
|
const command = process.argv[2];
|
|
32
32
|
const cliParams = minimist(process.argv.slice(2));
|
|
@@ -50,12 +50,16 @@ const createRuntimePaths = ({ alias, paths, absoluteBaseUrl })=>{
|
|
|
50
50
|
};
|
|
51
51
|
const resolveTsRuntimeRegisterMode = ()=>{
|
|
52
52
|
const hasNativeTypeScriptSupport = process.features?.typescript;
|
|
53
|
-
const
|
|
54
|
-
const supportsNativeTypeScript =
|
|
53
|
+
const nodeVersion = process.versions.node.split('.').map(Number);
|
|
54
|
+
const supportsNativeTypeScript = (nodeVersion[0] > 26 || 26 === nodeVersion[0] && nodeVersion[1] >= 7) && [
|
|
55
|
+
true,
|
|
56
|
+
'strip'
|
|
57
|
+
].includes(hasNativeTypeScriptSupport);
|
|
55
58
|
if (supportsNativeTypeScript) return 'node-loader';
|
|
56
59
|
return 'unsupported';
|
|
57
60
|
};
|
|
58
61
|
const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
|
|
62
|
+
if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.7.0 with native TypeScript support; detected v${process.versions.node}. Legacy TypeScript runtime transpilers are unsupported.`);
|
|
59
63
|
const tsconfigPath = resolveServerTsconfig(appDir, options.tsconfigPath);
|
|
60
64
|
const isTsProject = await fs.pathExists(tsconfigPath);
|
|
61
65
|
if (!isTsProject) return;
|
|
@@ -70,7 +74,6 @@ const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
|
|
|
70
74
|
paths,
|
|
71
75
|
absoluteBaseUrl
|
|
72
76
|
});
|
|
73
|
-
if ('unsupported' === registerMode) return;
|
|
74
77
|
if ('node-loader' === registerMode) {
|
|
75
78
|
const { registerPathsLoader } = await import("../esm/register-esm.mjs");
|
|
76
79
|
await registerPathsLoader({
|
|
@@ -1,34 +1,5 @@
|
|
|
1
|
-
import type { ModifyBundlerChainFn } from '@rsbuild/core';
|
|
2
1
|
import type { AppNormalizedConfig } from '../../types';
|
|
3
2
|
import type { AppToolsContext } from '../../types/plugin';
|
|
4
|
-
export declare function getCloudflareWorkerRspackConfig(workerEntryNames: Iterable<string>): {
|
|
5
|
-
readonly experiments: {
|
|
6
|
-
readonly outputModule: true;
|
|
7
|
-
};
|
|
8
|
-
readonly externals: {
|
|
9
|
-
[k: string]: string;
|
|
10
|
-
};
|
|
11
|
-
readonly externalsType: 'module-import';
|
|
12
|
-
readonly module: {
|
|
13
|
-
readonly parser: {
|
|
14
|
-
readonly javascript: {
|
|
15
|
-
readonly dynamicImportMode: 'eager';
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
readonly optimization: {
|
|
20
|
-
readonly runtimeChunk: {
|
|
21
|
-
readonly name: string;
|
|
22
|
-
};
|
|
23
|
-
readonly splitChunks: {
|
|
24
|
-
readonly chunks: 'all';
|
|
25
|
-
readonly minSize: 0;
|
|
26
|
-
readonly name: string;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
export declare function applyCloudflareWorkerRspackConfig(chain: Parameters<ModifyBundlerChainFn>[0], workerEntryNames: Iterable<string>): void;
|
|
31
|
-
export declare function applyCloudflareWorkerMfRuntimeBoundary(chain: Parameters<ModifyBundlerChainFn>[0]): void;
|
|
32
3
|
export declare function getBuilderEnvironments(normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, tempBuilderConfig: Omit<AppNormalizedConfig, 'plugins'>): {
|
|
33
4
|
environments: Record<string, import("@rsbuild/core").EnvironmentConfig>;
|
|
34
5
|
builderConfig: Omit<AppNormalizedConfig, "plugins">;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { type Rspack } from '@modern-js/builder';
|
|
1
2
|
import { type RsbuildPlugin } from '@rsbuild/core';
|
|
3
|
+
import type { AppNormalizedConfig } from '../../../types';
|
|
4
|
+
import type { AppToolsContext } from '../../../types/plugin';
|
|
2
5
|
import type { BuilderOptions } from '../types';
|
|
3
6
|
export declare const builderPluginAdapterSSR: (options: BuilderOptions) => RsbuildPlugin;
|
|
7
|
+
/**
|
|
8
|
+
* When a stream SSR project has lazy compilation enabled, return a
|
|
9
|
+
* `lazyCompilation` value whose `test` forces route components eager (so
|
|
10
|
+
* first-screen chunk/CSS injection works). Returns undefined when it does not
|
|
11
|
+
* apply (not stream SSR, RSC, lazy disabled, or no route components collected),
|
|
12
|
+
* so the caller leaves the config untouched.
|
|
13
|
+
*/
|
|
14
|
+
export declare function getSSRLazyCompilation(current: unknown, normalizedConfig: AppNormalizedConfig, appContext: AppToolsContext, eagerRouteComponentFilesByEntry: BuilderOptions['eagerRouteComponentFilesByEntry']): Rspack.LazyCompilationOptions | undefined;
|
|
@@ -6,7 +6,7 @@ type ModuleLike = {
|
|
|
6
6
|
type LazyCompilationTestFn = (m: ModuleLike) => boolean;
|
|
7
7
|
/** Matches Rspack's `LazyCompilationOptions['test']`. */
|
|
8
8
|
type LazyCompilationTest = RegExp | LazyCompilationTestFn | undefined;
|
|
9
|
-
type EagerRouteComponentInfo = {
|
|
9
|
+
export type EagerRouteComponentInfo = {
|
|
10
10
|
files: Set<string>;
|
|
11
11
|
/** Specifiers that could not be resolved, keyed by entry name. */
|
|
12
12
|
unresolvedByEntry: Map<string, string[]>;
|
|
@@ -15,8 +15,8 @@ type EagerRouteComponentInfo = {
|
|
|
15
15
|
* Aggregate the per-entry route component data (collected by the router plugin
|
|
16
16
|
* during route generation and threaded in as
|
|
17
17
|
* `BuilderOptions.eagerRouteComponentFilesByEntry`) into the flat shape
|
|
18
|
-
* {@link
|
|
19
|
-
*
|
|
18
|
+
* {@link planSSRLazyCompilation} expects: one Set of all route files plus the
|
|
19
|
+
* unresolved specifiers keyed by entry.
|
|
20
20
|
*/
|
|
21
21
|
export declare function aggregateEagerRouteComponentFiles(byEntry: EagerRouteComponentFilesByEntry | undefined): EagerRouteComponentInfo;
|
|
22
22
|
/**
|
|
@@ -25,8 +25,8 @@ export declare function aggregateEagerRouteComponentFiles(byEntry: EagerRouteCom
|
|
|
25
25
|
* render time), while delegating all other modules to the user's `test`
|
|
26
26
|
* (defaulting to lazy when the user did not provide one).
|
|
27
27
|
*/
|
|
28
|
-
export declare function
|
|
29
|
-
type SSRLazyPlan = {
|
|
28
|
+
export declare function buildSSRLazyCompilationTest(eagerRouteFiles: Set<string>, userTest?: LazyCompilationTest): LazyCompilationTestFn;
|
|
29
|
+
export type SSRLazyPlan = {
|
|
30
30
|
apply: false;
|
|
31
31
|
unresolvedByEntry?: Map<string, string[]>;
|
|
32
32
|
} | {
|
|
@@ -34,10 +34,10 @@ type SSRLazyPlan = {
|
|
|
34
34
|
lazyCompilation: Record<string, unknown>;
|
|
35
35
|
};
|
|
36
36
|
/**
|
|
37
|
-
* Decide whether to apply route-eager lazy compilation for
|
|
37
|
+
* Decide whether to apply the route-eager lazy compilation for an SSR project.
|
|
38
38
|
* Checks unresolved route components FIRST: if any exist we cannot guarantee
|
|
39
39
|
* they are eager, so we skip the optimization (and surface them so the caller
|
|
40
40
|
* can warn) rather than silently leaving a route lazy. `current` is the
|
|
41
41
|
* existing `dev.lazyCompilation` value (lazy must be enabled for this to apply).
|
|
42
42
|
*/
|
|
43
|
-
export declare function
|
|
43
|
+
export declare function planSSRLazyCompilation(current: unknown, info: EagerRouteComponentInfo): SSRLazyPlan;
|
|
@@ -6,4 +6,4 @@ export declare const getServerRoutes: (entrypoints: Entrypoint[], { appContext,
|
|
|
6
6
|
config: AppNormalizedConfig;
|
|
7
7
|
}) => ServerRoute[];
|
|
8
8
|
export declare const getProdServerRoutes: (distDirectory: string) => any;
|
|
9
|
-
export declare const getProdEntrypoints: (distDirectory: string, routes: ServerRoute[], mainEntryName?:
|
|
9
|
+
export declare const getProdEntrypoints: (distDirectory: string, routes: ServerRoute[], mainEntryName?: string) => Entrypoint[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { BackendFederationEntryIntegrity } from '@modern-js/server-runtime-extensions/backend-federation-security';
|
|
1
2
|
import { type BackendFederationApp } from './config';
|
|
2
3
|
export declare const createBackendRemoteEntrySource: (workspaceRoot: string, app: BackendFederationApp, effectApiPath: string, entryPath: string) => Promise<string>;
|
|
3
|
-
export declare const createBackendManifest: (workspaceRoot: string, distDirectory: string, app: BackendFederationApp) => {
|
|
4
|
+
export declare const createBackendManifest: (workspaceRoot: string, distDirectory: string, app: BackendFederationApp, entryIntegrity: BackendFederationEntryIntegrity) => {
|
|
4
5
|
schemaVersion: number;
|
|
5
6
|
id: string;
|
|
6
7
|
name: string;
|
|
@@ -28,6 +29,8 @@ export declare const createBackendManifest: (workspaceRoot: string, distDirector
|
|
|
28
29
|
ssrPublicPath: string;
|
|
29
30
|
};
|
|
30
31
|
entry: {
|
|
32
|
+
byteLength: number;
|
|
33
|
+
sha256: string;
|
|
31
34
|
file: string;
|
|
32
35
|
path: string;
|
|
33
36
|
type: string;
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { CloudflareOutputVerifierResult } from './issues';
|
|
3
|
-
export type { CloudflareDeliveryUnitIdentity } from './identity';
|
|
4
|
-
export type { CloudflareOutputVerifierIssue, CloudflareOutputVerifierIssueCode, CloudflareOutputVerifierResult, } from './issues';
|
|
5
|
-
export { type VerifyCloudflareOutputMutationPolicyOptions, verifyCloudflareOutputMutationPolicy, } from './mutation-policy';
|
|
6
|
-
export interface VerifyCloudflareOutputOptions {
|
|
7
|
-
outputDirectory: string;
|
|
8
|
-
importWorker?: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Topology-declared delivery-unit record (from the workspace compact config).
|
|
11
|
-
* When provided, the Cloudflare worker manifest must carry a matching
|
|
12
|
-
* `deliveryUnit` stamp so the deployed worker snapshot is proven to derive
|
|
13
|
-
* from the same delivery unit as the Node/API surfaces (ADR-0019 lane D).
|
|
14
|
-
*/
|
|
15
|
-
deliveryUnit?: CloudflareDeliveryUnitIdentity;
|
|
16
|
-
}
|
|
17
|
-
export declare const verifyCloudflareOutput: (options: VerifyCloudflareOutputOptions) => Promise<CloudflareOutputVerifierResult>;
|
|
18
|
-
export declare const assertCloudflareOutput: (options: VerifyCloudflareOutputOptions) => Promise<void>;
|
|
1
|
+
export * from '@modern-js/app-tools-extensions/cloudflare-output-verifier';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CloudflareWorkerArtifactConfig, CloudflareWorkerD1DatabaseConfig, CloudflareWorkerPublicAssetConfig, CloudflareWorkerSecurityConfig, CloudflareWorkerServiceBindingConfig, DeployTarget, JsonValue } from '
|
|
2
|
-
export type { CloudflareWorkerArtifactConfig, CloudflareWorkerD1DatabaseConfig, CloudflareWorkerPublicAssetConfig, CloudflareWorkerSecurityConfig, CloudflareWorkerSecurityCorsConfig, CloudflareWorkerSecurityCspConfig, CloudflareWorkerSecurityCspMode, CloudflareWorkerSecurityNoindexConfig, CloudflareWorkerServiceBindingConfig, CloudflareWorkerServiceBindingFragmentConfig, DeployTarget, JsonValue, } from '
|
|
1
|
+
import type { CloudflareWorkerArtifactConfig, CloudflareWorkerD1DatabaseConfig, CloudflareWorkerPublicAssetConfig, CloudflareWorkerSecurityConfig, CloudflareWorkerServiceBindingConfig, DeployTarget, JsonValue } from '@modern-js/app-tools-extensions/config';
|
|
2
|
+
export type { CloudflareWorkerArtifactConfig, CloudflareWorkerD1DatabaseConfig, CloudflareWorkerPublicAssetConfig, CloudflareWorkerSecurityConfig, CloudflareWorkerSecurityCorsConfig, CloudflareWorkerSecurityCspConfig, CloudflareWorkerSecurityCspMode, CloudflareWorkerSecurityNoindexConfig, CloudflareWorkerServiceBindingConfig, CloudflareWorkerServiceBindingFragmentConfig, DeployTarget, JsonValue, } from '@modern-js/app-tools-extensions/config';
|
|
3
3
|
export interface MicroFrontend {
|
|
4
4
|
/**
|
|
5
5
|
* Specifies whether to enable the HTML entry.
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ecosystem
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
UltraModern.js builds on a focused ecosystem of frameworks and tools. These projects provide the Effect, TanStack Router, build, documentation, and Module Federation foundations used by the fork.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
## The Cases
|
|
5
|
+
## Projects
|
|
8
6
|
|
|
9
7
|
|
|
10
8
|
[UltraModern.jsFramework
|
|
@@ -117,7 +117,7 @@ const response = await api.client.hello.ping({});
|
|
|
117
117
|
|
|
118
118
|
The `api.client.*` surface is materialized by the BFF loader for `@api/index` imports. Do not import `api/index` directly and expect `client` to run in server code, scripts, or tests; direct entry imports expose the server runtime definition, and `client` is only a typed placeholder there.
|
|
119
119
|
|
|
120
|
-
For UltraModern, Effect `HttpApi` plus Effect BFF is the single blessed authored HTTP path. Use `HttpApi` endpoints with `query`, `params`, `payload`, `success`, and declared errors such as `HttpApiSchema.status(...)`; implement them with `HttpApiBuilder.group(...).handle(...)` and `HttpApiBuilder.layer(...).pipe(Layer.provide(...))`, then default-export the entry as `defineEffectBff({ api, layer })`. See `packages/
|
|
120
|
+
For UltraModern, Effect `HttpApi` plus Effect BFF is the single blessed authored HTTP path. Use `HttpApi` endpoints with `query`, `params`, `payload`, `success`, and declared errors such as `HttpApiSchema.status(...)`; implement them with `HttpApiBuilder.group(...).handle(...)` and `HttpApiBuilder.layer(...).pipe(Layer.provide(...))`, then default-export the entry as `defineEffectBff({ api, layer })`. See `packages/server/bff-effect/tests/effect-edge-runtime.test.ts` for the live runtime shape.
|
|
121
121
|
|
|
122
122
|
Hono and `api/lambda/**` are internal compatibility only and feature-frozen.
|
|
123
123
|
|
|
@@ -260,11 +260,11 @@ Assuming the directory structure of the Monorepo repository is as follows:
|
|
|
260
260
|
First, you need to configure the **Root Directory** as `packages/app` on the Vercel platform:
|
|
261
261
|
|
|
262
262
|

|
|
263
|
-
Specify Node.js runtime as `
|
|
263
|
+
Specify Node.js runtime as `26.7.0` or newer:
|
|
264
264
|
|
|
265
265
|
```json title="package.json"
|
|
266
266
|
"engines": {
|
|
267
|
-
"node": "
|
|
267
|
+
"node": ">=26.7.0"
|
|
268
268
|
}
|
|
269
269
|
```
|
|
270
270
|
|