cli(config:schema): cleanups.

Signed-off-by: Andreas Stenius <git@astekk.se>
This commit is contained in:
Andreas Stenius
2021-02-24 09:27:54 +01:00
parent 4548ed4e91
commit fb30fc103b
5 changed files with 46 additions and 64 deletions
+8 -4
View File
@@ -29,13 +29,17 @@ export default async (cmd: Command) => {
mockEnv: true,
});
const { schema: data } = mergeConfigSchemas(
schema.serialize().schemas as ConfigSchemaPackageEntry[],
const merged = mergeConfigSchemas(
schema.serialize().schemas.map(_ => _.value),
);
merged.title = 'Application Configuration Schema';
merged.description =
'This is the schema describing the structure of the app-config.yaml configuration file.';
if (cmd.format === 'json') {
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
process.stdout.write(`${JSON.stringify(merged, null, 2)}\n`);
} else {
process.stdout.write(`${stringifyYaml(data)}\n`);
process.stdout.write(`${stringifyYaml(merged)}\n`);
}
};