'use strict';

var fs = require('fs-extra');
var createDistWorkspace = require('./createDistWorkspace-ce6d5dae.cjs.js');
require('chalk');
require('path');
require('os');
require('tar');
require('lodash/partition');
require('./index-09611511.cjs.js');
require('commander');
require('semver');
require('@backstage/cli-common');
require('@backstage/errors');
require('./run-a95417b1.cjs.js');
require('child_process');
require('util');
require('./PackageGraph-5fbc300a.cjs.js');
require('@manypkg/get-packages');
require('./packager-d3af52d3.cjs.js');
require('rollup');
require('@rollup/plugin-commonjs');
require('@rollup/plugin-node-resolve');
require('rollup-plugin-postcss');
require('rollup-plugin-esbuild');
require('@svgr/rollup');
require('rollup-plugin-dts');
require('@rollup/plugin-json');
require('@rollup/plugin-yaml');
require('rollup-pluginutils');
require('./svgrTemplate-550efce6.cjs.js');
require('./parallel-8286d3fa.cjs.js');
require('worker_threads');
require('./packageRoles-898652fe.cjs.js');
require('zod');
require('npm-packlist');

function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }

var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);

var buildWorkspace = async (dir, packages) => {
  if (!await fs__default["default"].pathExists(dir)) {
    throw new Error(`Target workspace directory doesn't exist, '${dir}'`);
  }
  await createDistWorkspace.createDistWorkspace(packages, {
    targetDir: dir
  });
};

exports["default"] = buildWorkspace;
//# sourceMappingURL=buildWorkspace-d529b150.cjs.js.map
