@lunora/cli
Version:
The Lunora CLI: init, dev, deploy, codegen, run, reset, and migrate commands
34 lines (31 loc) • 1.03 kB
JavaScript
import { p as parseApiSpec } from '../packem_shared/api-spec-Bx0iKbxA.mjs';
import { d as defineHandler } from '../packem_shared/command-lYnl4QyF.mjs';
import { runDeployCommand } from './runDeployCommand.mjs';
const DEFAULT_OUT_DIR = ".lunora/build";
const runBuildCommand = async (options) => {
const outDirectory = options.outDir ?? DEFAULT_OUT_DIR;
const result = await runDeployCommand({
apiSpec: options.apiSpec,
cwd: options.cwd,
dryRun: true,
format: options.format,
logger: options.logger,
outDir: outDirectory,
spawner: options.spawner
});
if (result.code === 0) {
options.logger.success(`build complete — bundle written to ${outDirectory}`);
}
return result;
};
const execute = defineHandler(async ({ cwd, logger, options }) => {
const result = await runBuildCommand({
apiSpec: parseApiSpec(options.apiSpec),
cwd,
format: options.format,
logger,
outDir: options.outDir
});
return { code: result.code };
});
export { execute, runBuildCommand };