@bleedingdev/modern-js-app-tools 3.8.2-ultramodern.9 → 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 +15 -8
- package/dist/cjs/run/index.js +9 -9
- package/dist/cjs/utils/env.js +1 -1
- 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 +8 -5
- package/dist/esm/run/index.mjs +9 -9
- package/dist/esm/utils/env.mjs +1 -1
- 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 +8 -5
- package/dist/esm-node/run/index.mjs +9 -9
- package/dist/esm-node/utils/env.mjs +1 -1
- 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 +23 -2
- package/dist/types/types/config/deploy.d.ts +2 -2
- package/docs/community/showcase.md +3 -5
- package/docs/configure/app/bff/effect.md +7 -7
- 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 +10 -9
- package/docs/guides/get-started/tech-stack.md +1 -1
- package/docs/guides/get-started/ultramodern.md +123 -38
- 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 +16 -28
- 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,134 +1,2 @@
|
|
|
1
1
|
import "node:module";
|
|
2
|
-
|
|
3
|
-
import node_path from "node:path";
|
|
4
|
-
import { createCloudflareOutputPlan } from "../cloudflare-output-plan.mjs";
|
|
5
|
-
import { verifyDeliveryUnitIdentity } from "./identity.mjs";
|
|
6
|
-
import { addIssue, assertEqual, assertFlag } from "./issues.mjs";
|
|
7
|
-
import { verifyManifestShape } from "./manifest.mjs";
|
|
8
|
-
import { getEffectBffWorker, getWorkerBundleReferences, missingWorkerBundleMessage, resolveWorkerBundleReference, verifyWorkerBundleReferences, verifyWorkerImport } from "./worker-bundles.mjs";
|
|
9
|
-
const pathExists = async (filePath)=>{
|
|
10
|
-
try {
|
|
11
|
-
await promises.access(filePath);
|
|
12
|
-
return true;
|
|
13
|
-
} catch {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
};
|
|
17
|
-
const readJson = async (filePath)=>JSON.parse(await promises.readFile(filePath, 'utf-8'));
|
|
18
|
-
const verifyCloudflareOutput = async (options)=>{
|
|
19
|
-
const outputDirectory = node_path.resolve(options.outputDirectory);
|
|
20
|
-
const issues = [];
|
|
21
|
-
const outputPlan = createCloudflareOutputPlan(outputDirectory);
|
|
22
|
-
for (const relativePath of outputPlan.requiredFiles){
|
|
23
|
-
const filePath = node_path.join(outputDirectory, relativePath);
|
|
24
|
-
if (!await pathExists(filePath)) addIssue(issues, {
|
|
25
|
-
code: 'missing-file',
|
|
26
|
-
message: `Cloudflare output is missing ${relativePath}.`,
|
|
27
|
-
path: filePath
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
const manifestPath = outputPlan.paths.workerManifest;
|
|
31
|
-
const wranglerPath = outputPlan.paths.wranglerConfig;
|
|
32
|
-
const packagePath = outputPlan.paths.outputPackage;
|
|
33
|
-
const workerPackagePath = outputPlan.paths.workerPackage;
|
|
34
|
-
const manifest = await pathExists(manifestPath) ? await readJson(manifestPath) : void 0;
|
|
35
|
-
const wrangler = await pathExists(wranglerPath) ? await readJson(wranglerPath) : void 0;
|
|
36
|
-
const outputPackage = await pathExists(packagePath) ? await readJson(packagePath) : void 0;
|
|
37
|
-
const workerPackage = await pathExists(workerPackagePath) ? await readJson(workerPackagePath) : void 0;
|
|
38
|
-
if (manifest) {
|
|
39
|
-
verifyManifestShape(issues, manifest, manifestPath);
|
|
40
|
-
verifyDeliveryUnitIdentity(issues, manifest, manifestPath, options.deliveryUnit);
|
|
41
|
-
const workerReferences = getWorkerBundleReferences(manifest);
|
|
42
|
-
const providedWorkerPackages = new Set(workerPackage?.dependencies && 'object' == typeof workerPackage.dependencies ? Object.keys(workerPackage.dependencies) : []);
|
|
43
|
-
if (workerReferences.length > 0 && !await pathExists(workerPackagePath)) addIssue(issues, {
|
|
44
|
-
code: 'missing-file',
|
|
45
|
-
message: 'Cloudflare output is missing worker/package.json for referenced worker bundles.',
|
|
46
|
-
path: workerPackagePath
|
|
47
|
-
});
|
|
48
|
-
if (manifest.bff?.runtimeFramework === 'effect' && !getEffectBffWorker(manifest)) addIssue(issues, {
|
|
49
|
-
code: 'missing-worker-bundle',
|
|
50
|
-
message: 'Cloudflare Effect BFF manifest points to a missing worker bundle.'
|
|
51
|
-
});
|
|
52
|
-
for (const workerReference of workerReferences){
|
|
53
|
-
const resolvedWorker = resolveWorkerBundleReference(issues, outputDirectory, workerReference, manifestPath);
|
|
54
|
-
if (!resolvedWorker) continue;
|
|
55
|
-
const workerExists = await pathExists(resolvedWorker.path);
|
|
56
|
-
if (!workerExists) addIssue(issues, {
|
|
57
|
-
code: 'missing-worker-bundle',
|
|
58
|
-
message: missingWorkerBundleMessage(workerReference),
|
|
59
|
-
path: resolvedWorker.path
|
|
60
|
-
});
|
|
61
|
-
if (workerExists) {
|
|
62
|
-
const workerSource = await promises.readFile(resolvedWorker.path, 'utf-8');
|
|
63
|
-
await verifyWorkerBundleReferences(issues, resolvedWorker, workerSource, {
|
|
64
|
-
providedPackages: providedWorkerPackages,
|
|
65
|
-
workerRoot: outputPlan.paths.workerBundle
|
|
66
|
-
});
|
|
67
|
-
if ('effect-bff' === resolvedWorker.kind && (workerSource.includes(';entityKind;') || workerSource.includes(';entityKind,entityKind;'))) addIssue(issues, {
|
|
68
|
-
code: 'invalid-worker-bundle',
|
|
69
|
-
message: 'Cloudflare Effect BFF worker bundle contains invalid Drizzle entityKind marker references.',
|
|
70
|
-
path: resolvedWorker.path
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
if (wrangler) {
|
|
76
|
-
assertEqual(issues, wrangler.main, outputPlan.wrangler.main, {
|
|
77
|
-
code: 'invalid-wrangler',
|
|
78
|
-
message: `wrangler.json main must be ${outputPlan.wrangler.main}.`,
|
|
79
|
-
path: wranglerPath
|
|
80
|
-
});
|
|
81
|
-
assertEqual(issues, wrangler.assets?.binding, outputPlan.wrangler.assets.binding, {
|
|
82
|
-
code: 'invalid-wrangler',
|
|
83
|
-
message: 'wrangler.json assets.binding must be ASSETS.',
|
|
84
|
-
path: wranglerPath
|
|
85
|
-
});
|
|
86
|
-
assertEqual(issues, wrangler.assets?.directory, outputPlan.wrangler.assets.directory, {
|
|
87
|
-
code: 'invalid-wrangler',
|
|
88
|
-
message: 'wrangler.json assets.directory must be ./public.',
|
|
89
|
-
path: wranglerPath
|
|
90
|
-
});
|
|
91
|
-
assertEqual(issues, wrangler.assets?.run_worker_first, outputPlan.wrangler.assets.run_worker_first, {
|
|
92
|
-
code: 'invalid-wrangler',
|
|
93
|
-
message: 'wrangler.json assets.run_worker_first must be true.',
|
|
94
|
-
path: wranglerPath
|
|
95
|
-
});
|
|
96
|
-
for (const flag of outputPlan.wrangler.requiredCompatibilityFlags)assertFlag(issues, wrangler.compatibility_flags, flag, {
|
|
97
|
-
code: 'invalid-wrangler',
|
|
98
|
-
message: `wrangler.json compatibility_flags must include ${flag}.`,
|
|
99
|
-
path: wranglerPath
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
if (outputPackage) assertEqual(issues, outputPackage.type, outputPlan.packages.output.type, {
|
|
103
|
-
code: 'invalid-package',
|
|
104
|
-
message: '.output/package.json must declare type module.',
|
|
105
|
-
path: packagePath
|
|
106
|
-
});
|
|
107
|
-
if (workerPackage) assertEqual(issues, workerPackage.type, outputPlan.packages.worker.type, {
|
|
108
|
-
code: 'invalid-package',
|
|
109
|
-
message: '.output/worker/package.json must declare type commonjs.',
|
|
110
|
-
path: workerPackagePath
|
|
111
|
-
});
|
|
112
|
-
for (const leakedPath of outputPlan.publicLeakDirectories){
|
|
113
|
-
const publicPath = node_path.join(outputPlan.paths.publicAssets, leakedPath);
|
|
114
|
-
if (await pathExists(publicPath)) addIssue(issues, {
|
|
115
|
-
code: 'public-output-leak',
|
|
116
|
-
message: `Framework-owned ${leakedPath} output leaked into public assets.`,
|
|
117
|
-
path: publicPath
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
if (false !== options.importWorker && await pathExists(outputPlan.paths.workerEntry)) await verifyWorkerImport(issues, outputPlan.paths.workerEntry, manifest);
|
|
121
|
-
return {
|
|
122
|
-
ok: 0 === issues.length,
|
|
123
|
-
issues
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
const assertCloudflareOutput = async (options)=>{
|
|
127
|
-
const result = await verifyCloudflareOutput(options);
|
|
128
|
-
if (!result.ok) throw new Error([
|
|
129
|
-
'Cloudflare output verification failed:',
|
|
130
|
-
...result.issues.map((issue)=>`- ${issue.code}: ${issue.message}${issue.path ? ` (${issue.path})` : ''}`)
|
|
131
|
-
].join('\n'));
|
|
132
|
-
};
|
|
133
|
-
export { verifyCloudflareOutputMutationPolicy } from "./mutation-policy.mjs";
|
|
134
|
-
export { assertCloudflareOutput, verifyCloudflareOutput };
|
|
2
|
+
export * from "@modern-js/app-tools-extensions/cloudflare-output-verifier";
|
|
@@ -1,78 +1,57 @@
|
|
|
1
1
|
const fs = require('node:fs/promises');
|
|
2
2
|
const path = require('node:path');
|
|
3
3
|
const { createNetlifyFunction } = require('@modern-js/prod-server/netlify');
|
|
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
|
-
|
|
49
|
-
const requestHandler = await createNetlifyFunction(prodServerOptions);
|
|
50
|
-
|
|
51
|
-
return requestHandler;
|
|
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 requestHandler = await createNetlifyFunction(prodServerOptions);
|
|
38
|
+
return requestHandler;
|
|
52
39
|
}
|
|
53
|
-
|
|
54
40
|
async function createHandler() {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
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
|
+
}
|
|
63
48
|
})();
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return requestHandler;
|
|
49
|
+
await handlerCreationPromise;
|
|
50
|
+
return requestHandler;
|
|
67
51
|
}
|
|
68
|
-
|
|
69
52
|
createHandler();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
await createHandler();
|
|
74
|
-
}
|
|
75
|
-
return requestHandler(request, context);
|
|
53
|
+
const handler = async (request, context)=>{
|
|
54
|
+
if (!requestHandler) await createHandler();
|
|
55
|
+
return requestHandler(request, context);
|
|
76
56
|
};
|
|
77
|
-
|
|
78
57
|
module.exports.default = handler;
|
|
@@ -2,80 +2,58 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import { createNetlifyFunction } from '@modern-js/prod-server/netlify';
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
const requestHandler = await createNetlifyFunction(prodServerOptions);
|
|
53
|
-
|
|
54
|
-
return requestHandler;
|
|
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
|
+
bffRuntimeFramework: p_bffRuntimeFramework
|
|
34
|
+
},
|
|
35
|
+
plugins: p_plugins,
|
|
36
|
+
serverConfigPath: p_serverDirectory,
|
|
37
|
+
...dynamicProdOptions
|
|
38
|
+
};
|
|
39
|
+
const requestHandler = await createNetlifyFunction(prodServerOptions);
|
|
40
|
+
return requestHandler;
|
|
55
41
|
}
|
|
56
|
-
|
|
57
42
|
async function createHandler() {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
43
|
+
if (!handlerCreationPromise) handlerCreationPromise = (async ()=>{
|
|
44
|
+
try {
|
|
45
|
+
requestHandler = await initServer();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
console.error('Error creating server:', error);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
}
|
|
66
50
|
})();
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return requestHandler;
|
|
51
|
+
await handlerCreationPromise;
|
|
52
|
+
return requestHandler;
|
|
70
53
|
}
|
|
71
|
-
|
|
72
54
|
createHandler();
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
await createHandler();
|
|
77
|
-
}
|
|
78
|
-
return requestHandler(request, context);
|
|
55
|
+
const handler = async (request, context)=>{
|
|
56
|
+
if (!requestHandler) await createHandler();
|
|
57
|
+
return requestHandler(request, context);
|
|
79
58
|
};
|
|
80
|
-
|
|
81
59
|
export default handler;
|
|
@@ -1,61 +1,44 @@
|
|
|
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
|
async function loadRoutes(routeFilepath) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
7
|
+
try {
|
|
8
|
+
await fs.access(routeFilepath);
|
|
9
|
+
const content = await fs.readFile(routeFilepath, 'utf-8');
|
|
10
|
+
const routeSpec = JSON.parse(content);
|
|
11
|
+
return routeSpec.routes || [];
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.warn('route.json not found or invalid, continuing with empty routes.');
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
23
16
|
}
|
|
24
|
-
|
|
25
17
|
async function main() {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
{
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
},
|
|
52
|
-
() => {
|
|
53
|
-
console.log(
|
|
54
|
-
`\x1b[32mServer is listening on http://[::]:${port}`,
|
|
55
|
-
'\x1b[0m',
|
|
56
|
-
);
|
|
57
|
-
},
|
|
58
|
-
);
|
|
18
|
+
const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
|
|
19
|
+
const routes = await loadRoutes(routeFilepath);
|
|
20
|
+
const dynamicProdOptions = p_dynamicProdOptions;
|
|
21
|
+
const prodServerOptions = {
|
|
22
|
+
pwd: __dirname,
|
|
23
|
+
routes,
|
|
24
|
+
disableCustomHook: true,
|
|
25
|
+
appContext: {
|
|
26
|
+
sharedDirectory: p_sharedDirectory,
|
|
27
|
+
apiDirectory: p_apiDirectory,
|
|
28
|
+
lambdaDirectory: p_lambdaDirectory,
|
|
29
|
+
bffRuntimeFramework: p_bffRuntimeFramework
|
|
30
|
+
},
|
|
31
|
+
plugins: p_plugins,
|
|
32
|
+
serverConfigPath: p_serverDirectory,
|
|
33
|
+
...dynamicProdOptions
|
|
34
|
+
};
|
|
35
|
+
const app = await createProdServer(prodServerOptions);
|
|
36
|
+
const port = process.env.PORT || 8080;
|
|
37
|
+
app.listen({
|
|
38
|
+
host: '::',
|
|
39
|
+
port
|
|
40
|
+
}, ()=>{
|
|
41
|
+
console.log(`\x1b[32mServer is listening on http://[::]:${port}`, '\x1b[0m');
|
|
42
|
+
});
|
|
59
43
|
}
|
|
60
|
-
|
|
61
44
|
main();
|
|
@@ -2,63 +2,45 @@ 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
|
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 main() {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
},
|
|
55
|
-
() => {
|
|
56
|
-
console.log(
|
|
57
|
-
`\x1b[32mServer is listening on http://[::]:${port}`,
|
|
58
|
-
'\x1b[0m',
|
|
59
|
-
);
|
|
60
|
-
},
|
|
61
|
-
);
|
|
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
|
+
const port = process.env.PORT || 8080;
|
|
39
|
+
app.listen({
|
|
40
|
+
host: '::',
|
|
41
|
+
port
|
|
42
|
+
}, ()=>{
|
|
43
|
+
console.log(`\x1b[32mServer is listening on http://[::]:${port}`, '\x1b[0m');
|
|
44
|
+
});
|
|
62
45
|
}
|
|
63
|
-
|
|
64
46
|
main();
|