"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var relock_exports = {};
__export(relock_exports, {
  relock: () => relock
});
module.exports = __toCommonJS(relock_exports);
var import_promises = require("node:fs/promises");
var import_package = require("../util/package.js");
/**
 * @license
 * Copyright 2022-2026 Greg Lauckhart <greg@lauckhart.com>
 * SPDX-License-Identifier: Apache-2.0
 */
async function relock() {
  const workspace = import_package.Package.workspace;
  await (0, import_promises.rm)(workspace.resolve("package-lock.json"), { force: true });
  await (0, import_promises.rm)(workspace.resolve("node_modules"), { recursive: true, force: true });
  const workspaces = workspace.json.workspaces;
  if (Array.isArray(workspaces)) {
    for (const path of workspaces) {
      await (0, import_promises.rm)(workspace.resolve(path, "node_modules"), {
        recursive: true,
        force: true
      });
    }
  }
}
//# sourceMappingURL=relock.js.map
