@topogram/cli 0.3.68 → 0.3.69
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/package.json
CHANGED
|
@@ -396,7 +396,7 @@ function renderEnvironmentServerDevScript(plan, component = plan.runtimes.apis[0
|
|
|
396
396
|
const guardPortsScript = options.componentScript ? '"$ROOT_DIR/scripts/guard-ports.mjs"' : '"$SCRIPT_DIR/guard-ports.mjs"';
|
|
397
397
|
const serverPortExpression = runtimePortExpression(plan, plan.runtimes.apis, component, "SERVER_PORT");
|
|
398
398
|
return renderEnvAwareShellScript([
|
|
399
|
-
`node ${guardPortsScript} api`,
|
|
399
|
+
`node ${guardPortsScript} api ${component.id}`,
|
|
400
400
|
"",
|
|
401
401
|
...apiDatabaseExportLines(component),
|
|
402
402
|
`export PORT="${serverPortExpression}"`,
|
|
@@ -417,7 +417,7 @@ function renderEnvironmentWebDevScript(plan, component = plan.runtimes.webs[0],
|
|
|
417
417
|
const guardPortsScript = options.componentScript ? '"$ROOT_DIR/scripts/guard-ports.mjs"' : '"$SCRIPT_DIR/guard-ports.mjs"';
|
|
418
418
|
const webPortExpression = runtimePortExpression(plan, plan.runtimes.webs, component, "WEB_PORT");
|
|
419
419
|
return renderEnvAwareShellScript([
|
|
420
|
-
`node ${guardPortsScript} web`,
|
|
420
|
+
`node ${guardPortsScript} web ${component.id}`,
|
|
421
421
|
"",
|
|
422
422
|
...(apiRuntime ? [`export PUBLIC_TOPOGRAM_API_BASE_URL="\${PUBLIC_TOPOGRAM_API_BASE_URL:-http://localhost:\${${apiRuntime.id.toUpperCase()}_PORT:-\${SERVER_PORT:-${apiRuntime.port}}}}"`] : []),
|
|
423
423
|
`export TOPOGRAM_CORS_ORIGINS="\${TOPOGRAM_CORS_ORIGINS:-http://localhost:${webPortExpression},http://127.0.0.1:${webPortExpression}}"`,
|
|
@@ -478,6 +478,7 @@ function renderEnvironmentGuardPortsScript(plan) {
|
|
|
478
478
|
import net from "node:net";
|
|
479
479
|
|
|
480
480
|
const role = process.argv[2] || "stack";
|
|
481
|
+
const targetId = process.argv[3] || "";
|
|
481
482
|
const ports = ${JSON.stringify(ports, null, 2)};
|
|
482
483
|
const expectedService = ${JSON.stringify(plan.runtimeReference.serviceName || "")};
|
|
483
484
|
|
|
@@ -533,6 +534,9 @@ for (const entry of ports) {
|
|
|
533
534
|
if (role !== "stack" && role !== entry.type) {
|
|
534
535
|
continue;
|
|
535
536
|
}
|
|
537
|
+
if (targetId && entry.id !== targetId) {
|
|
538
|
+
continue;
|
|
539
|
+
}
|
|
536
540
|
const port = effectivePort(entry);
|
|
537
541
|
if (await portInUse(port)) {
|
|
538
542
|
if (entry.type === "api") {
|