feat: configure workspace environment runtimes

This commit is contained in:
2026-07-20 09:22:26 +05:30
parent 3888453e0d
commit b3e5e5b999
58 changed files with 183 additions and 103 deletions
+15 -1
View File
@@ -65,6 +65,11 @@ Usage:
Profiles: pass --profile=<name> to dev/build/db (or set WRNEXUS_PROFILE) to load
that profile's .env cascade and config overrides. e.g. wrnexus dev --profile=uat
Workspace environments: configure protocol, rootDomain, port, hostname, runtime
(development|production), hmr, build, migrate, and profile in wrnexus.workspace.ts.
CLI overrides: --port, --host, --build/--no-build, --migrate/--no-migrate,
--profile, and --prepare-only.
Update options: --dry-run previews changes; --no-verify skips post-update check/build.
`);
}
@@ -210,7 +215,16 @@ async function main(): Promise<void> {
if (!knownEnvironments.has(command)) throw new Error("unknown-environment-command");
const environmentArgs = rest.filter((arg) => arg !== workspaceRoot);
environmentArgs.push(`--environment=${command}`);
if (command === "development") {
const environmentConfig = workspace.environments?.[command];
const runtime =
environmentConfig?.runtime ?? (command === "development" ? "development" : "production");
if (runtime === "development") {
if (environmentArgs.includes("--prepare-only")) {
console.log(
`\n ✓ Workspace environment "${command}" uses the development runtime (HMR ${environmentConfig?.hmr === false ? "disabled" : "enabled"}).\n`,
);
break;
}
await runGateway(workspaceRoot, environmentArgs);
} else {
await runProduction(workspaceRoot, environmentArgs);