From b375e3c659d2ad17fcae89834e3fa993389a6d87 Mon Sep 17 00:00:00 2001 From: Matt Hill Date: Tue, 28 Mar 2023 08:38:57 -0600 Subject: [PATCH] ugh --- lib/config/builder/value.ts | 1 + lib/config/config-types.ts | 1 + scripts/oldSpecToBuilder.ts | 7 ++++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/config/builder/value.ts b/lib/config/builder/value.ts index 7f442be..cca028b 100644 --- a/lib/config/builder/value.ts +++ b/lib/config/builder/value.ts @@ -145,6 +145,7 @@ export class Value extends IBuilder { name: string; description: string | null; warning: string | null; + selectKey: string; variants: Variants<{ [key: string]: { name: string; spec: InputSpec } }>; nullable: boolean; default: string | null; diff --git a/lib/config/config-types.ts b/lib/config/config-types.ts index 5dfbb62..ce4df9c 100644 --- a/lib/config/config-types.ts +++ b/lib/config/config-types.ts @@ -66,6 +66,7 @@ export interface ValueSpecBoolean extends WithStandalone { export interface ValueSpecUnion extends WithStandalone { type: "union"; + selectKey: string; nullable: boolean; variants: Record; } diff --git a/scripts/oldSpecToBuilder.ts b/scripts/oldSpecToBuilder.ts index 093e772..b6f1398 100644 --- a/scripts/oldSpecToBuilder.ts +++ b/scripts/oldSpecToBuilder.ts @@ -136,13 +136,14 @@ export default async function makeFileContent( case "union": { const variants = newConst( value.name + "_variants", - convertVariants(value.variants, value["variant-names"] || {}) + convertVariants(value.variants, value.tag["variant-names"] || {}) ); return `Value.union({ name: ${JSON.stringify(value.name || null)}, - description: ${JSON.stringify(value.description || null)}, - warning: ${JSON.stringify(value.warning || null)}, + description: ${JSON.stringify(value.tag.description || null)}, + warning: ${JSON.stringify(value.tag.warning || null)}, + selectKey: ${JSON.stringify(value.tag.id || null)}, nullable: false, default: ${JSON.stringify(value.default || null)}, variants: ${variants},