From 10c9e79370fcc6c6e7d9b8c5ff5a5cac15da71bf Mon Sep 17 00:00:00 2001 From: Manas Jayanth <3097018+ManasJayanth@users.noreply.github.com> Date: Thu, 6 Feb 2025 15:15:27 +0530 Subject: [PATCH] Fix lock file path --- dist/index.js | 33 ++++++++++++++++++++------------- index.ts | 2 +- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/dist/index.js b/dist/index.js index 1b0be2e..e271c55 100644 --- a/dist/index.js +++ b/dist/index.js @@ -113066,14 +113066,6 @@ ZipStream.prototype.finalize = function() { */ -/***/ }), - -/***/ 41901: -/***/ ((module) => { - -module.exports = eval("require")("./esy.lock/index.json"); - - /***/ }), /***/ 22877: @@ -113098,6 +113090,21 @@ module.exports = eval("require")("supports-color"); module.exports = eval("require")("util/types"); +/***/ }), + +/***/ 25387: +/***/ ((module) => { + +function webpackEmptyContext(req) { + var e = new Error("Cannot find module '" + req + "'"); + e.code = 'MODULE_NOT_FOUND'; + throw e; +} +webpackEmptyContext.keys = () => ([]); +webpackEmptyContext.resolve = webpackEmptyContext; +webpackEmptyContext.id = 25387; +module.exports = webpackEmptyContext; + /***/ }), /***/ 39491: @@ -139584,8 +139591,8 @@ function getLatestEsyNPMInfo(alternativeEsyNPMPackage) { else { const { validForOldPackages, validForNewPackages, errors = [], } = lib_default()(alternativeEsyNPMPackage); if (!validForNewPackages || !validForOldPackages) { - throw new Error(`Invalid alternative NPM package name provided: ${alternativeEsyNPMPackage} -Errors: + throw new Error(`Invalid alternative NPM package name provided: ${alternativeEsyNPMPackage} +Errors: ${errors.join("\n")}`); } esyPackage = `${alternativeEsyNPMPackage}@${setupEsyVersion}`; @@ -139846,7 +139853,7 @@ function bundleNPMArtifacts() { const version = exec("git describe --tags --always"); function getCompilerVersion(sandbox = "esy") { console.log(`Looking up ${sandbox}.lock/index.json for compiler version`); - const ocamlPackages = Object.keys((__nccwpck_require__(41901).node)).filter((k) => k.startsWith("ocaml@")); + const ocamlPackages = Object.keys(__nccwpck_require__(25387)(external_path_.join(workingDirectory, `${sandbox}.lock`, "index.json")).node).filter((k) => k.startsWith("ocaml@")); if (ocamlPackages.length === 0) { throw new Error("Couldn't figure ocaml compiler version from lock file because no ocaml-like packages were found"); } @@ -139903,8 +139910,8 @@ function bundleNPMArtifacts() { console.log("Copying postinstall.js from", releasePostInstallJS); external_fs_.copyFileSync(releasePostInstallJS, external_path_.join(releaseFolder, "postinstall.js")); console.log("Creating placeholder files"); - const placeholderFile = `:; echo "You need to have postinstall enabled"; exit $? -@ECHO OFF + const placeholderFile = `:; echo "You need to have postinstall enabled"; exit $? +@ECHO OFF ECHO You need to have postinstall enabled`; external_fs_.mkdirSync(external_path_.join(releaseFolder, "bin")); Object.keys(bins).forEach((name) => { diff --git a/index.ts b/index.ts index d00b4dc..405441d 100644 --- a/index.ts +++ b/index.ts @@ -414,7 +414,7 @@ async function bundleNPMArtifacts() { function getCompilerVersion(sandbox = "esy") { console.log(`Looking up ${sandbox}.lock/index.json for compiler version`); const ocamlPackages = Object.keys( - require("./esy.lock/index.json").node + require(path.join(workingDirectory, `${sandbox}.lock`, "index.json")).node ).filter((k) => k.startsWith("ocaml@")); if (ocamlPackages.length === 0) {