ymal: compose repeated node lane templates
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user