ymal: compose repeated node lane templates

This commit is contained in:
root
2026-07-08 06:34:23 +02:00
parent 0cea74367a
commit d083e88bb9
13 changed files with 1232 additions and 1585 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { existsSync, readFileSync } from "node:fs";
import { join } from "node:path";
import { repoRoot } from "./config";
import { materializeYamlComposition } from "./yaml-composition";
export const transHostProxyConfigPath = "config/platform-infra/host-proxy.yaml";
@@ -19,7 +20,7 @@ export interface TransHostProxyEnvRule {
export function readTransHostProxyEnvRule(targetId: string): TransHostProxyEnvRule | null {
const absolutePath = join(repoRoot, transHostProxyConfigPath);
if (!existsSync(absolutePath)) return null;
const root = record(Bun.YAML.parse(readFileSync(absolutePath, "utf8")), transHostProxyConfigPath);
const root = record(materializeYamlComposition(Bun.YAML.parse(readFileSync(absolutePath, "utf8")) as unknown, { label: transHostProxyConfigPath }).value, transHostProxyConfigPath);
if (root.kind !== "platform-infra-host-proxy") throw new Error(`${transHostProxyConfigPath}.kind must be platform-infra-host-proxy`);
const targets = record(root.targets, `${transHostProxyConfigPath}.targets`);
const targetRaw = targets[targetId];