'use strict';

var BRSAP7LG_cjs = require('./BRSAP7LG.cjs');
var U7VZULNU_cjs = require('./U7VZULNU.cjs');
var promises = require('fs/promises');
var path = require('path');
var z = require('zod');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var z__namespace = /*#__PURE__*/_interopNamespace(z);

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

exports.compile = compile;
//# sourceMappingURL=VPSZX4TV.cjs.map
//# sourceMappingURL=VPSZX4TV.cjs.map