UNPKG

@backstage/cli

Version:

CLI for developing Backstage plugins and apps

38 lines (33 loc) 1.01 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var yaml = require('yaml'); var config = require('../lib/config.cjs.js'); var configLoader = require('@backstage/config-loader'); var schema = async (opts) => { const { schema } = await config.loadCliConfig({ args: [], fromPackage: opts.package, mockEnv: true }); let configSchema; if (opts.merge) { configSchema = configLoader.mergeConfigSchemas( schema.serialize().schemas.map( (_) => _.value ) ); configSchema.title = "Application Configuration Schema"; configSchema.description = "This is the schema describing the structure of the app-config.yaml configuration file."; } else { configSchema = schema.serialize(); } if (opts.format === "json") { process.stdout.write(`${JSON.stringify(configSchema, null, 2)} `); } else { process.stdout.write(`${yaml.stringify(configSchema)} `); } }; exports.default = schema; //# sourceMappingURL=schema.cjs.js.map