'use strict';

var yaml = require('yaml');
var config = require('./config-OeQcmdz6.cjs.js');
var configLoader = require('@backstage/config-loader');
require('@backstage/config');
require('./index-CCLafGQH.cjs.js');
require('commander');
require('chalk');
require('fs-extra');
require('semver');
require('@backstage/cli-common');
require('@backstage/errors');
require('@manypkg/get-packages');
require('@backstage/cli-node');

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-_RJzkqy4.cjs.js.map
