From c540fc19c069a1c85fad86c8519b149d09165d37 Mon Sep 17 00:00:00 2001 From: Theo Ephraim Date: Mon, 25 Nov 2024 15:49:43 -0800 Subject: [PATCH] fix for dmno resolve --format=json --- .changeset/calm-gifts-laugh.md | 5 +++++ packages/core/src/cli/commands/resolve.command.ts | 13 ++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 .changeset/calm-gifts-laugh.md diff --git a/.changeset/calm-gifts-laugh.md b/.changeset/calm-gifts-laugh.md new file mode 100644 index 00000000..3ec1f052 --- /dev/null +++ b/.changeset/calm-gifts-laugh.md @@ -0,0 +1,5 @@ +--- +"dmno": patch +--- + +fix dmno resolve --format=json diff --git a/packages/core/src/cli/commands/resolve.command.ts b/packages/core/src/cli/commands/resolve.command.ts index f0ed5623..8d2e5483 100644 --- a/packages/core/src/cli/commands/resolve.command.ts +++ b/packages/core/src/cli/commands/resolve.command.ts @@ -60,14 +60,13 @@ program.action(async (opts: { checkForSchemaErrors(workspace); checkForConfigErrors(service, { showAll: opts?.showAll }); - async function getExposedConfigValues() { - const injectedJson = await ctx.dmnoServer.makeRequest('getInjectedJson', service.serviceName); - let exposedConfig = service.configNodes; + function getExposedConfigValues() { const values = {} as Record; - for (const itemKey in injectedJson) { - if (itemKey.startsWith('$')) continue; - if (injectedJson[itemKey].value && opts.public) continue; - values[itemKey] = injectedJson[itemKey].value; + for (const itemKey in service.configNodes) { + const item = service.configNodes[itemKey]; + // --public option skips anything sensitive + if (item.isSensitive && opts.public) continue; + values[itemKey] = item.resolvedValue; } return values; }