import { executeToolCommand } from './HCY4ASBG.js';
import { init_esm_shims, __name } from './4RNWLMHM.js';
import { writeFile } from 'node:fs/promises';
import { join } from 'node:path';
import * as z from 'zod';

// src/commands/aptos.ts
init_esm_shims();
var outputSchema = z.object({
  Result: z.array(z.string())
});
var saveModuleOrder = /* @__PURE__ */ __name(async (processOutput, directory) => {
  await writeFile(join(directory, "modules.json"), JSON.stringify(outputSchema.parse(processOutput.json()).Result.map((item) => `${item.split("::")[1]}.mv`), null, 2));
}, "saveModuleOrder");
var compile = /* @__PURE__ */ __name(async (args, options) => {
  const output = await executeToolCommand("aptos", [
    "move",
    "compile",
    ...args
  ], options);
  await saveModuleOrder(output, options.cwd);
}, "compile");

export { compile };
//# sourceMappingURL=SV3LGPR3.js.map
//# sourceMappingURL=SV3LGPR3.js.map