@vxrn/utils 1.12.3 → 1.12.5-1774027068540

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,7 +27,7 @@ __export(detectPackageManager_exports, {
27
27
  module.exports = __toCommonJS(detectPackageManager_exports);
28
28
  var import_fs = require("fs"),
29
29
  import_path = require("path"),
30
- import_exec = require("./exec.native.js");
30
+ import_exec = require("./exec");
31
31
  async function pathExists(p) {
32
32
  try {
33
33
  return await import_fs.promises.access(p), !0;
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","detectPackageManager_exports","__export","detectPackageManager","module","exports","import_fs","require","import_path","import_exec","pathExists","p","promises","access","hasGlobal","pm","command","process","platform","res","exec","length","getFromLockfile","cwd","arguments","yarn","npm","pnpm","bun","Promise","all","resolve","getFromPackage","json","JSON","parse","readFile","packageManager","startsWith","foundSome","obj","Object","keys","some","k","fromLockfile"],"sources":["../../src/detectPackageManager.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,4BAAA;AAAAC,QAAA,CAAAD,4BAAA;EAAAE,oBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAA+B,CAAAK,4BAC/B;AAKA,IAAAK,SAAA,GAAeC,OAAA,KAAW,CAAW;EAAAC,WAAA,GAAAD,OAAA;EAAAE,WAAA,GAAAF,OAAA;AACnC,eAAIG,WAAAC,CAAA;EACF;IAEF,OAAQ,MAAAL,SAAA,CAAAM,QAAA,CAAAC,MAAA,CAAAF,CAAA;EACN;IACF;EACF;AAEA;AACE,eAAIG,UAAAC,EAAA;EACF;IAEA,IAAAC,OAAQ,GADIC,OAAA,CAAAC,QAAA,KAAK,OACJ,YAAAH,EAAA,cAAAA,EA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C,UAAA;MACxB,OAAO;QAGHV,GAAA;QACFH,IAAA;QACFE,IAAO;QAGHD;MACJ;IACA;EAAgB;AACA;AACD,IAChBa,SAAA,YAAAA,CAAAC,GAAA;IAED,OAAOC,MAAA,CAAAC,IAAA,CAAAF,GAAA,EAAAG,IAAA,WAAAC,CAAA;MACL,SAAAJ,GAAA,CAAAI,CAAA;IAAA,EACA;EAAA;EAAAzC,oBACA,kBAAAA,CAAA;IAAA,IACA;QAAAoB;MAAA,IAAAC,SAAA,CAAAH,MAAA,QAAAG,SAAA,iBAAAA,SAAA;MAAAqB,YAAA,SAAAvB,eAAA,CAAAC,GAAA;IACF,IAAAgB,SAAA,CAAAM,YAAA,GACF,OAAAA,YAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","detectPackageManager_exports","detectPackageManager","module","exports","import_fs","require","import_path","import_exec","pathExists","p","promises","access","hasGlobal","pm","command","process","platform","res","exec","length","getFromLockfile","cwd","arguments","yarn","npm","pnpm","bun","Promise","resolve","getFromPackage","json","JSON","parse","readFile","packageManager","startsWith","foundSome","obj","keys","some","k","fromLockfile","fromPackageJson"],"sources":["detectPackageManager.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar detectPackageManager_exports = {};\n__export(detectPackageManager_exports, {\n detectPackageManager: () => detectPackageManager\n});\nmodule.exports = __toCommonJS(detectPackageManager_exports);\nvar import_fs = require(\"fs\"), import_path = require(\"path\"), import_exec = require(\"./exec\");\nasync function pathExists(p) {\n try {\n return await import_fs.promises.access(p), !0;\n } catch {\n return !1;\n }\n}\nasync function hasGlobal(pm) {\n try {\n var command = process.platform === \"win32\" ? `where ${pm}` : `which ${pm}`, res = (0, import_exec.exec)(command);\n return !!res.length;\n } catch {\n return !1;\n }\n}\nasync function getFromLockfile() {\n var cwd = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \".\", [yarn, npm, pnpm, bun] = await Promise.all([\n pathExists((0, import_path.resolve)(cwd, \"yarn.lock\")),\n pathExists((0, import_path.resolve)(cwd, \"package-lock.json\")),\n pathExists((0, import_path.resolve)(cwd, \"pnpm-lock.yaml\")),\n pathExists((0, import_path.resolve)(cwd, \"bun.lockb\"))\n ]);\n return {\n bun,\n yarn,\n pnpm,\n npm\n };\n}\nasync function getFromPackage() {\n var cwd = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : \".\";\n if (await pathExists((0, import_path.resolve)(cwd, \"package.json\"))) {\n var json = JSON.parse(await import_fs.promises.readFile((0, import_path.resolve)(cwd, \"package.json\"), \"utf-8\"));\n if (json.packageManager) {\n var yarn = !!json.packageManager.startsWith(\"yarn\"), pnpm = !!json.packageManager.startsWith(\"pnpm\"), bun = !!json.packageManager.startsWith(\"bun\"), npm = !!json.packageManager.startsWith(\"npm\");\n return {\n bun,\n yarn,\n pnpm,\n npm\n };\n }\n }\n}\nvar foundSome = function(obj) {\n return Object.keys(obj).some(function(k) {\n return !!obj[k];\n });\n}, detectPackageManager = async function() {\n var { cwd } = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, fromLockfile = await getFromLockfile(cwd);\n if (foundSome(fromLockfile))\n return fromLockfile;\n var fromPackageJson = await getFromPackage(cwd);\n if (fromPackageJson && foundSome(fromPackageJson))\n return fromPackageJson;\n var [npm, yarn, pnpm, bun] = await Promise.all([\n hasGlobal(\"npm\"),\n hasGlobal(\"yarn\"),\n hasGlobal(\"pnpm\"),\n hasGlobal(\"bun\")\n ]);\n return {\n bun,\n yarn,\n pnpm,\n npm\n };\n};\n//# sourceMappingURL=detectPackageManager.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;IAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;MAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;MAAEE,UAAU,EAAE,CAAC;IAAE,CAAC,CAAC;EAC/D,CAAC;EAAEC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;IAC3C,IAAIF,IAAI,IAAI,OAAOA,IAAI,IAAI,QAAQ,IAAI,OAAOA,IAAI,IAAI,UAAU,EAC9D,KAAK,IAAIG,GAAG,IAAIhB,iBAAiB,CAACa,IAAI,CAAC,EACrC,CAACX,YAAY,CAACe,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,IAAInB,SAAS,CAACiB,EAAE,EAAEI,GAAG,EAAE;MAAEP,GAAG,EAAEA,CAAA,KAAMI,IAAI,CAACG,GAAG,CAAC;MAAEN,UAAU,EAAE,EAAEK,IAAI,GAAGjB,gBAAgB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,CAAC,CACjB,CAAC;IACF,OAAO;MACLc,GAAG;MACHH,IAAI;MACJE,IAAI;MACJD;IACF,CAAC;EACH,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","exec_exports","__export","exec","execPromise","execPromiseQuiet","module","exports","import_child_process","require","cmd","options","_execSync","execSync","toString","Promise","resolve","reject","command","args","split","child","spawn","stdio","quiet","shell","process","env","DEBUG","_child_stdout","_child_stderr","stdout","pipe","stderr","on","code"],"sources":["../../src/exec.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,YAAA;AAAAC,QAAA,CAAAD,YAAA;EAAAE,IAAA,EAAAA,CAAA,KAAAA,IAAA;EAAAC,WAAA,EAAAA,CAAA,KAAAA,WAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAX,YAAA,CAAAK,YAAmD;AAG5C,IAAAO,oBAA2B,GAAAC,OAAA,CACzB;EAAAN,IAAA,YAAAA,CAAAO,GAAS,EAAAC,OAAK,EAAO;IAU1B,IAAAC,SAAO;IAE4B,OACjC,EAAOA,SAAS,OAAAJ,oBAAiB,CAAAK,QAAA,EAAAH,GAAA,EAAAC,OAAA,eAAAC,SAAA,uBAAAA,SAAA,CAAAE,QAAA;EAAA;EAAAV,WAC1B,YAAAA,CAAAM,GAAA,EAAAC,OAAA;IAAA,OACJ,IAAAI,OAAA,WAAAC,OAAA,EAAAC,MAAA;MACJ,KAAAC,OAAA,KAAAC,IAAA,IAAAT,GAAA,CAAAU,KAAA;QAAAC,KAAA,OAAAb,oBAAA,CAAAc,KAAA,EAAAJ,OAAA,EAAAC,IAAA;UAEII,KAAA,EAASZ,OAAA,EAASa,KAAA,GAAQ,MAAI,YACjC;UAKIC,KAAA,EAAS;UAOf,GAAAd;QACE;MACD,KAAAA,OAAA,EAAAa,KAAA,IAAAE,OAAA,CAAAC,GAAA,CAAAC,KAAA;QAIQ,IAAAC,aAAmB,EAC9BC,aACA;QAKK,CAAAD,aAAA,GAAAR,KAAA,CAAAU,MAAA,cAAAF,aAAA,eAAAA,aAAA,CAAAG,IAAA,CAAAN,OAAA,CAAAK,MAAA,IAAAD,aAAA,GAAAT,KAAA,CAAAY,MAAA,cAAAH,aAAA,eAAAA,aAAA,CAAAE,IAAA,CAAAN,OAAA,CAAAO,MAAA;MACH;MACDZ,KAAA,CAAAa,EAAA,oBAAAC,IAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","exec_exports","exec","execPromise","execPromiseQuiet","module","exports","import_child_process","require","cmd","options","_execSync","execSync","toString","Promise","resolve","reject","command","args","split","child","spawn","stdio","quiet","shell","process","env","DEBUG","_child_stdout","_child_stderr","stdout","pipe","stderr","on","code","Error","error"],"sources":["exec.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar exec_exports = {};\n__export(exec_exports, {\n exec: () => exec,\n execPromise: () => execPromise,\n execPromiseQuiet: () => execPromiseQuiet\n});\nmodule.exports = __toCommonJS(exec_exports);\nvar import_child_process = require(\"child_process\"), exec = function(cmd, options) {\n var _execSync;\n return ((_execSync = (0, import_child_process.execSync)(cmd, options)) === null || _execSync === void 0 ? void 0 : _execSync.toString()) || \"\";\n}, execPromise = function(cmd, options) {\n return new Promise(function(resolve, reject) {\n var [command, ...args] = cmd.split(\" \"), child = (0, import_child_process.spawn)(command, args, {\n stdio: options?.quiet ? \"pipe\" : \"inherit\",\n shell: !0,\n ...options\n });\n if (!options?.quiet || process.env.DEBUG) {\n var _child_stdout, _child_stderr;\n (_child_stdout = child.stdout) === null || _child_stdout === void 0 || _child_stdout.pipe(process.stdout), (_child_stderr = child.stderr) === null || _child_stderr === void 0 || _child_stderr.pipe(process.stderr);\n }\n child.on(\"close\", function(code) {\n code !== 0 ? reject(new Error(`Command failed with exit code ${code}: ${cmd}`)) : resolve();\n }), child.on(\"error\", function(error) {\n reject(error);\n });\n });\n}, execPromiseQuiet = function(cmd, options) {\n return execPromise(cmd, {\n ...options,\n quiet: !0\n });\n};\n//# sourceMappingURL=exec.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;IAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;MAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;MAAEE,UAAU,EAAE,CAAC;IAAE,CAAC,CAAC;EAC/D,CAAC;EAAEC,WAAW,GAAGA,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CAACoB,KAAK,CAAC;MACf,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC;EAAEhC,gBAAgB,GAAG,SAAAA,CAASK,GAAG,EAAEC,OAAO,EAAE;IAC3C,OAAOP,WAAW,CAACM,GAAG,EAAE;MACtB,GAAGC,OAAO;MACVa,KAAK,EAAE,CAAC;IACV,CAAC,CAAC;EACJ,CAAC","ignoreList":[]}
@@ -19,7 +19,7 @@ var index_exports = {};
19
19
  module.exports = __toCommonJS(index_exports);
20
20
  __reExport(index_exports, require("@vxrn/debug"), module.exports);
21
21
  __reExport(index_exports, require("@vxrn/resolve"), module.exports);
22
- __reExport(index_exports, require("./detectPackageManager.native.js"), module.exports);
23
- __reExport(index_exports, require("./exec.native.js"), module.exports);
24
- __reExport(index_exports, require("./mustReplace.native.js"), module.exports);
22
+ __reExport(index_exports, require("./detectPackageManager"), module.exports);
23
+ __reExport(index_exports, require("./exec"), module.exports);
24
+ __reExport(index_exports, require("./mustReplace"), module.exports);
25
25
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","index_exports","module","exports","__reExport","require"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,aAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAP,YAAc,CAAAK,aAAA;AACdG,UAAA,CAAAH,aAAA,EAAcI,OAAA,iBAAAH,MADd,CAAAC,OAAA;AAEAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,mBAAAH,MAAA,CAAAC,OAFd;AAGAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,mCAHd,GAAAH,MAAA,CAAAC,OAAA;AAIAC,UAAA,CAAAH,aAAA,EAAcI,OAAA,sBAAAH,MAAA,CAJdC,OAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__copyProps","to","from","except","desc","key","call","get","enumerable","__reExport","target","mod","secondTarget","__toCommonJS","value","index_exports","module","exports","require"],"sources":["index.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n}, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, \"default\"), secondTarget && __copyProps(secondTarget, mod, \"default\"));\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar index_exports = {};\nmodule.exports = __toCommonJS(index_exports);\n__reExport(index_exports, require(\"@vxrn/debug\"), module.exports);\n__reExport(index_exports, require(\"@vxrn/resolve\"), module.exports);\n__reExport(index_exports, require(\"./detectPackageManager\"), module.exports);\n__reExport(index_exports, require(\"./exec\"), module.exports);\n__reExport(index_exports, require(\"./mustReplace\"), module.exports);\n//# sourceMappingURL=index.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;IAC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,CAAC,QAAQ,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC;AAC5DR,UAAU,CAACM,aAAa,EAAEG,OAAO,CAAC,eAAe,CAAC,EAAEF,MAAM,CAACC,OAAO,CAAC","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","mustReplace_exports","__export","mustReplace","module","exports","import_fs","require","import_os","import_path","_instanceof","left","right","Symbol","hasInstance","source","replacements","sourceOut","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","iterator","_step","next","done","find","replace","optional","found","RegExp","test","includes","tmpPath","join","tmpdir","Math","random"],"sources":["../../src/mustReplace.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,mBAAA;AAAAC,QAAA,CAAAD,mBAAA;EAAAE,WAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAT,YAA8B,CAAAK,mBAC9B;AAGO,IAAAK,SAAS,GAAAC,OACd,MACA;EAAAC,SAAA,GAKAD,OAAA;EAAAE,WAAA,GAAAF,OAAA;AACA,SAAIG,WAAYA,CAAAC,IAAA,EAAAC,KAAA;EAChB,OAAAA,KAAW,IAAE,IAAM,WAASC,MAAS,MAAK,IAAAD,KAAA,CAAAC,MAAc,CAAAC,WAAA,MAAAF,KAAA,CAAAC,MAAA,CAAAC,WAAA,EAAAH,IAAA,IAAAA,IAAA,YAAAC,KAAA;AACtD;AAII,SAAAT,WAAMA,CAAAY,MAAU,EAAAC,YAAA;EAChB,IAAAC,SAAA,GAAAF,MAAA;IAAAG,yBAAc,IAAS;IAAAC,iBAAkB,GACnC,EAAI;IAAAC,cAAA;EAAA;IAC+E,KACzF,IAAAC,SAAA,GAAAL,YAAA,CAAAH,MAAA,CAAAS,QAAA,KAAAC,KAAA,IAAAL,yBAAA,IAAAK,KAAA,GAAAF,SAAA,CAAAG,IAAA,IAAAC,IAAA,GAAAP,yBAAA;MACF;QAAAQ,IAAA;QAAAC,OAAA;QAAAC;MAAA,IAAAL,KAAA,CAAAvB,KAAA;MAIF,KAAA4B,QAAY;QACd,IAAAC,KAAA,GAAAnB,WAAA,CAAAgB,IAAA,EAAAI,MAAA,IAAAJ,IAAA,CAAAK,IAAA,CAAAd,SAAA,IAAAA,SAAA,CAAAe,QAAA,CAAAN,IAAA;QACA,IAAO,CAAAG,KAAA;UACT,IAAAI,OAAA,OAAAxB,WAAA,CAAAyB,IAAA,MAAA1B,SAAA,CAAA2B,MAAA,sBAAAC,IAAA,CAAAC,MAAA","ignoreList":[]}
1
+ {"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","mustReplace_exports","mustReplace","module","exports","import_fs","require","import_os","import_path","_instanceof","left","right","Symbol","hasInstance","source","replacements","sourceOut","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","iterator","_step","next","done","find","replace","optional","found","RegExp","test","includes","tmpPath","join","tmpdir","Math","random","writeFileSync","Error","err","return"],"sources":["mustReplace.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: !0 });\n}, __copyProps = (to, from, except, desc) => {\n if (from && typeof from == \"object\" || typeof from == \"function\")\n for (let key of __getOwnPropNames(from))\n !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: !0 }), mod);\nvar mustReplace_exports = {};\n__export(mustReplace_exports, {\n mustReplace: () => mustReplace\n});\nmodule.exports = __toCommonJS(mustReplace_exports);\nvar import_fs = require(\"fs\"), import_os = require(\"os\"), import_path = require(\"path\");\nfunction _instanceof(left, right) {\n return right != null && typeof Symbol < \"u\" && right[Symbol.hasInstance] ? !!right[Symbol.hasInstance](left) : left instanceof right;\n}\nfunction mustReplace(source, replacements) {\n var sourceOut = source, _iteratorNormalCompletion = !0, _didIteratorError = !1, _iteratorError = void 0;\n try {\n for (var _iterator = replacements[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = !0) {\n var { find, replace, optional } = _step.value;\n if (!optional) {\n var found = _instanceof(find, RegExp) ? find.test(sourceOut) : sourceOut.includes(find);\n if (!found) {\n var tmpPath = (0, import_path.join)((0, import_os.tmpdir)(), `replace-error-${Math.random()}`);\n throw (0, import_fs.writeFileSync)(tmpPath, sourceOut, \"utf-8\"), new Error(`Substring or pattern \"${find}\" not found in the string, replacing in source: ${tmpPath}.`);\n }\n }\n sourceOut = sourceOut.replace(find, replace);\n }\n } catch (err) {\n _didIteratorError = !0, _iteratorError = err;\n } finally {\n try {\n !_iteratorNormalCompletion && _iterator.return != null && _iterator.return();\n } finally {\n if (_didIteratorError)\n throw _iteratorError;\n }\n }\n return sourceOut;\n}\n//# sourceMappingURL=mustReplace.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;IAC9B,KAAK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,SAAS,EAAE,OAAO,CAAC,EAAE,IAAIsB,KAAK,CAAC,yBAAyBb,IAAI,mDAAmDO,OAAO,GAAG,CAAC;QACxK;MACF;MACAhB,SAAS,GAAGA,SAAS,CAACU,OAAO,CAACD,IAAI,EAAEC,OAAO,CAAC;IAC9C;EACF,CAAC,CAAC,OAAOa,GAAG,EAAE;IACZrB,iBAAiB,GAAG,CAAC,CAAC,EAAEC,cAAc,GAAGoB,GAAG;EAC9C,CAAC,SAAS;IACR,IAAI;MACF,CAACtB,yBAAyB,IAAIG,SAAS,CAACoB,MAAM,IAAI,IAAI,IAAIpB,SAAS,CAACoB,MAAM,CAAC,CAAC;IAC9E,CAAC,SAAS;MACR,IAAItB,iBAAiB,EACnB,MAAMC,cAAc;IACxB;EACF;EACA,OAAOH,SAAS;AAClB","ignoreList":[]}
package/dist/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export * from "@vxrn/debug";
2
2
  export * from "@vxrn/resolve";
3
- export * from "./detectPackageManager";
4
- export * from "./exec";
5
- export * from "./mustReplace";
3
+ export * from "./detectPackageManager.mjs";
4
+ export * from "./exec.mjs";
5
+ export * from "./mustReplace.mjs";
6
6
  //# sourceMappingURL=index.js.map
@@ -1,6 +1 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": "AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;",
5
- "names": []
6
- }
1
+ {"version":3,"names":[],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vxrn/utils",
3
- "version": "1.12.3",
3
+ "version": "1.12.5-1774027068540",
4
4
  "sideEffects": false,
5
5
  "type": "module",
6
6
  "types": "./types/index.d.ts",
@@ -33,11 +33,11 @@
33
33
  "typecheck": "tsc --noEmit"
34
34
  },
35
35
  "dependencies": {
36
- "@vxrn/debug": "1.12.3",
37
- "@vxrn/resolve": "1.12.3"
36
+ "@vxrn/debug": "1.12.5-1774027068540",
37
+ "@vxrn/resolve": "1.12.5-1774027068540"
38
38
  },
39
39
  "devDependencies": {
40
- "@tamagui/build": "2.0.0-rc.22"
40
+ "@tamagui/build": "2.0.0-rc.28"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public"
@@ -1,74 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var detectPackageManager_exports = {};
16
- __export(detectPackageManager_exports, {
17
- detectPackageManager: () => detectPackageManager
18
- });
19
- module.exports = __toCommonJS(detectPackageManager_exports);
20
- var import_node_fs = require("node:fs"), import_node_path = require("node:path"), import_exec = require("./exec");
21
- async function pathExists(p) {
22
- try {
23
- return await import_node_fs.promises.access(p), !0;
24
- } catch {
25
- return !1;
26
- }
27
- }
28
- async function hasGlobal(pm) {
29
- try {
30
- const command = process.platform === "win32" ? `where ${pm}` : `which ${pm}`;
31
- return !!(0, import_exec.exec)(command).length;
32
- } catch {
33
- return !1;
34
- }
35
- }
36
- async function getFromLockfile(cwd = ".") {
37
- const [yarn, npm, pnpm, bun] = await Promise.all([
38
- pathExists((0, import_node_path.resolve)(cwd, "yarn.lock")),
39
- pathExists((0, import_node_path.resolve)(cwd, "package-lock.json")),
40
- pathExists((0, import_node_path.resolve)(cwd, "pnpm-lock.yaml")),
41
- pathExists((0, import_node_path.resolve)(cwd, "bun.lockb"))
42
- ]);
43
- return { bun, yarn, pnpm, npm };
44
- }
45
- async function getFromPackage(cwd = ".") {
46
- if (await pathExists((0, import_node_path.resolve)(cwd, "package.json"))) {
47
- const json = JSON.parse(await import_node_fs.promises.readFile((0, import_node_path.resolve)(cwd, "package.json"), "utf-8"));
48
- if (json.packageManager) {
49
- const yarn = !!json.packageManager.startsWith("yarn"), pnpm = !!json.packageManager.startsWith("pnpm"), bun = !!json.packageManager.startsWith("bun"), npm = !!json.packageManager.startsWith("npm");
50
- return { bun, yarn, pnpm, npm };
51
- }
52
- }
53
- }
54
- const foundSome = (obj) => Object.keys(obj).some((k) => !!obj[k]), detectPackageManager = async ({ cwd } = {}) => {
55
- const fromLockfile = await getFromLockfile(cwd);
56
- if (foundSome(fromLockfile))
57
- return fromLockfile;
58
- const fromPackageJson = await getFromPackage(cwd);
59
- if (fromPackageJson && foundSome(fromPackageJson))
60
- return fromPackageJson;
61
- const [npm, yarn, pnpm, bun] = await Promise.all([
62
- hasGlobal("npm"),
63
- hasGlobal("yarn"),
64
- hasGlobal("pnpm"),
65
- hasGlobal("bun")
66
- ]);
67
- return {
68
- bun,
69
- yarn,
70
- pnpm,
71
- npm
72
- };
73
- };
74
- //# sourceMappingURL=detectPackageManager.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/detectPackageManager.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA+B,oBAC/B,mBAAwB,sBACxB,cAAqB;AAIrB,eAAe,WAAW,GAAW;AACnC,MAAI;AACF,iBAAM,eAAAA,SAAG,OAAO,CAAC,GACV;AAAA,EACT,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAEA,eAAe,UAAU,IAA0C;AACjE,MAAI;AACF,UAAM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eAAe,GAAG;AAChD,MAAI,mBAAmB,UAAU,eAAe;AAC9C,WAAO;AAGT,QAAM,CAAC,KAAK,MAAM,MAAM,GAAG,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC/C,UAAU,KAAK;AAAA,IACf,UAAU,MAAM;AAAA,IAChB,UAAU,MAAM;AAAA,IAChB,UAAU,KAAK;AAAA,EACjB,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
5
- "names": ["fs"]
6
- }
package/dist/cjs/exec.js DELETED
@@ -1,38 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var exec_exports = {};
16
- __export(exec_exports, {
17
- exec: () => exec,
18
- execPromise: () => execPromise,
19
- execPromiseQuiet: () => execPromiseQuiet
20
- });
21
- module.exports = __toCommonJS(exec_exports);
22
- var import_node_child_process = require("node:child_process");
23
- const exec = (cmd, options) => (0, import_node_child_process.execSync)(cmd, options)?.toString() || "", execPromise = (cmd, options) => new Promise((resolve, reject) => {
24
- const [command, ...args] = cmd.split(" "), child = (0, import_node_child_process.spawn)(command, args, {
25
- stdio: options?.quiet ? "pipe" : "inherit",
26
- shell: !0,
27
- ...options
28
- });
29
- (!options?.quiet || process.env.DEBUG) && (child.stdout?.pipe(process.stdout), child.stderr?.pipe(process.stderr)), child.on("close", (code) => {
30
- code !== 0 ? reject(new Error(`Command failed with exit code ${code}: ${cmd}`)) : resolve();
31
- }), child.on("error", (error) => {
32
- reject(error);
33
- });
34
- }), execPromiseQuiet = (cmd, options) => execPromise(cmd, {
35
- ...options,
36
- quiet: !0
37
- });
38
- //# sourceMappingURL=exec.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/exec.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gCAAmD;AAG5C,MAAM,OAAO,CAAC,KAAa,gBACzB,oCAAS,KAAK,OAAO,GAAG,SAAS,KAAK,IAGlC,cAAc,CACzB,KACA,YAIO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI,IAAI,MAAM,GAAG,GAElC,YAAQ,iCAAM,SAAS,MAAM;AAAA,IACjC,OAAO,SAAS,QAAQ,SAAS;AAAA,IACjC,OAAO;AAAA,IACP,GAAG;AAAA,EACL,CAAC;AAED,GAAI,CAAC,SAAS,SAAS,QAAQ,IAAI,WACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,GACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,IAGnC,MAAM,GAAG,SAAS,CAAC,SAAS;AAC1B,IAAI,SAAS,IACX,OAAO,IAAI,MAAM,iCAAiC,IAAI,KAAK,GAAG,EAAE,CAAC,IAEjE,QAAQ;AAAA,EAEZ,CAAC,GAED,MAAM,GAAG,SAAS,CAAC,UAAU;AAC3B,WAAO,KAAK;AAAA,EACd,CAAC;AACH,CAAC,GAGU,mBAAmB,CAC9B,KACA,YAIO,YAAY,KAAK;AAAA,EACtB,GAAG;AAAA,EACH,OAAO;AACT,CAAC;",
5
- "names": []
6
- }
package/dist/cjs/index.js DELETED
@@ -1,19 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __copyProps = (to, from, except, desc) => {
6
- if (from && typeof from == "object" || typeof from == "function")
7
- for (let key of __getOwnPropNames(from))
8
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
9
- return to;
10
- }, __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
11
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
12
- var index_exports = {};
13
- module.exports = __toCommonJS(index_exports);
14
- __reExport(index_exports, require("@vxrn/debug"), module.exports);
15
- __reExport(index_exports, require("@vxrn/resolve"), module.exports);
16
- __reExport(index_exports, require("./detectPackageManager"), module.exports);
17
- __reExport(index_exports, require("./exec"), module.exports);
18
- __reExport(index_exports, require("./mustReplace"), module.exports);
19
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/index.ts"],
4
- "mappings": ";;;;;;;;;;;AAAA;AAAA;AAAA,0BAAc,wBAAd;AACA,0BAAc,0BADd;AAEA,0BAAc,mCAFd;AAGA,0BAAc,mBAHd;AAIA,0BAAc,0BAJd;",
5
- "names": []
6
- }
@@ -1,34 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: !0 });
8
- }, __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from == "object" || typeof from == "function")
10
- for (let key of __getOwnPropNames(from))
11
- !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
12
- return to;
13
- };
14
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
15
- var mustReplace_exports = {};
16
- __export(mustReplace_exports, {
17
- mustReplace: () => mustReplace
18
- });
19
- module.exports = __toCommonJS(mustReplace_exports);
20
- var import_node_fs = require("node:fs"), import_node_os = require("node:os"), import_node_path = require("node:path");
21
- function mustReplace(source, replacements) {
22
- let sourceOut = source;
23
- for (const { find, replace, optional } of replacements) {
24
- if (!optional && !(find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find))) {
25
- const tmpPath = (0, import_node_path.join)((0, import_node_os.tmpdir)(), `replace-error-${Math.random()}`);
26
- throw (0, import_node_fs.writeFileSync)(tmpPath, sourceOut, "utf-8"), new Error(
27
- `Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`
28
- );
29
- }
30
- sourceOut = sourceOut.replace(find, replace);
31
- }
32
- return sourceOut;
33
- }
34
- //# sourceMappingURL=mustReplace.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/mustReplace.ts"],
4
- "mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8B,oBAC9B,iBAAuB,oBACvB,mBAAqB;AAEd,SAAS,YACd,QACA,cAKA;AACA,MAAI,YAAY;AAChB,aAAW,EAAE,MAAM,SAAS,SAAS,KAAK,cAAc;AACtD,QAAI,CAAC,YAGC,EADF,gBAAgB,SAAS,KAAK,KAAK,SAAS,IAAI,UAAU,SAAS,IAAI,IAC7D;AACV,YAAM,cAAU,2BAAK,uBAAO,GAAG,iBAAiB,KAAK,OAAO,CAAC,EAAE;AAC/D,8CAAc,SAAS,WAAW,OAAO,GACnC,IAAI;AAAA,QACR,yBAAyB,IAAI,mDAAmD,OAAO;AAAA,MACzF;AAAA,IACF;AAIF,gBAAY,UAAU,QAAQ,MAAM,OAAO;AAAA,EAC7C;AACA,SAAO;AACT;",
5
- "names": []
6
- }
@@ -1,60 +0,0 @@
1
- import { promises as fs } from "node:fs";
2
- import { resolve } from "node:path";
3
- import { exec } from "./exec";
4
- async function pathExists(p) {
5
- try {
6
- return await fs.access(p), !0;
7
- } catch {
8
- return !1;
9
- }
10
- }
11
- async function hasGlobal(pm) {
12
- try {
13
- const command = process.platform === "win32" ? `where ${pm}` : `which ${pm}`;
14
- return !!exec(command).length;
15
- } catch {
16
- return !1;
17
- }
18
- }
19
- async function getFromLockfile(cwd = ".") {
20
- const [yarn, npm, pnpm, bun] = await Promise.all([
21
- pathExists(resolve(cwd, "yarn.lock")),
22
- pathExists(resolve(cwd, "package-lock.json")),
23
- pathExists(resolve(cwd, "pnpm-lock.yaml")),
24
- pathExists(resolve(cwd, "bun.lockb"))
25
- ]);
26
- return { bun, yarn, pnpm, npm };
27
- }
28
- async function getFromPackage(cwd = ".") {
29
- if (await pathExists(resolve(cwd, "package.json"))) {
30
- const json = JSON.parse(await fs.readFile(resolve(cwd, "package.json"), "utf-8"));
31
- if (json.packageManager) {
32
- const yarn = !!json.packageManager.startsWith("yarn"), pnpm = !!json.packageManager.startsWith("pnpm"), bun = !!json.packageManager.startsWith("bun"), npm = !!json.packageManager.startsWith("npm");
33
- return { bun, yarn, pnpm, npm };
34
- }
35
- }
36
- }
37
- const foundSome = (obj) => Object.keys(obj).some((k) => !!obj[k]), detectPackageManager = async ({ cwd } = {}) => {
38
- const fromLockfile = await getFromLockfile(cwd);
39
- if (foundSome(fromLockfile))
40
- return fromLockfile;
41
- const fromPackageJson = await getFromPackage(cwd);
42
- if (fromPackageJson && foundSome(fromPackageJson))
43
- return fromPackageJson;
44
- const [npm, yarn, pnpm, bun] = await Promise.all([
45
- hasGlobal("npm"),
46
- hasGlobal("yarn"),
47
- hasGlobal("pnpm"),
48
- hasGlobal("bun")
49
- ]);
50
- return {
51
- bun,
52
- yarn,
53
- pnpm,
54
- npm
55
- };
56
- };
57
- export {
58
- detectPackageManager
59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,aAAO,EAAE,KAAK,MAAM,MAAM,IAAI;AAAA,IAChC;AAAA,EACF;AACF;AAEA,MAAM,YAAY,CAAC,QAAgB,OAAO,KAAK,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,GAE3D,uBAAuB,OAAO,EAAE,IAAI,IAAsB,CAAC,MAAM;AAC5E,QAAM,eAAe,MAAM,gBAAgB,GAAG;AAC9C,MAAI,UAAU,YAAY;AACxB,WAAO;AAGT,QAAM,kBAAkB,MAAM,eAAe,GAAG;AAChD,MAAI,mBAAmB,UAAU,eAAe;AAC9C,WAAO;AAGT,QAAM,CAAC,KAAK,MAAM,MAAM,GAAG,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC/C,UAAU,KAAK;AAAA,IACf,UAAU,MAAM;AAAA,IAChB,UAAU,MAAM;AAAA,IAChB,UAAU,KAAK;AAAA,EACjB,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
5
- "names": []
6
- }
package/dist/esm/exec.js DELETED
@@ -1,22 +0,0 @@
1
- import { execSync, spawn } from "node:child_process";
2
- const exec = (cmd, options) => execSync(cmd, options)?.toString() || "", execPromise = (cmd, options) => new Promise((resolve, reject) => {
3
- const [command, ...args] = cmd.split(" "), child = spawn(command, args, {
4
- stdio: options?.quiet ? "pipe" : "inherit",
5
- shell: !0,
6
- ...options
7
- });
8
- (!options?.quiet || process.env.DEBUG) && (child.stdout?.pipe(process.stdout), child.stderr?.pipe(process.stderr)), child.on("close", (code) => {
9
- code !== 0 ? reject(new Error(`Command failed with exit code ${code}: ${cmd}`)) : resolve();
10
- }), child.on("error", (error) => {
11
- reject(error);
12
- });
13
- }), execPromiseQuiet = (cmd, options) => execPromise(cmd, {
14
- ...options,
15
- quiet: !0
16
- });
17
- export {
18
- exec,
19
- execPromise,
20
- execPromiseQuiet
21
- };
22
- //# sourceMappingURL=exec.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/exec.ts"],
4
- "mappings": "AAAA,SAAS,UAA6B,aAAa;AAG5C,MAAM,OAAO,CAAC,KAAa,YACzB,SAAS,KAAK,OAAO,GAAG,SAAS,KAAK,IAGlC,cAAc,CACzB,KACA,YAIO,IAAI,QAAc,CAAC,SAAS,WAAW;AAC5C,QAAM,CAAC,SAAS,GAAG,IAAI,IAAI,IAAI,MAAM,GAAG,GAElC,QAAQ,MAAM,SAAS,MAAM;AAAA,IACjC,OAAO,SAAS,QAAQ,SAAS;AAAA,IACjC,OAAO;AAAA,IACP,GAAG;AAAA,EACL,CAAC;AAED,GAAI,CAAC,SAAS,SAAS,QAAQ,IAAI,WACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,GACjC,MAAM,QAAQ,KAAK,QAAQ,MAAM,IAGnC,MAAM,GAAG,SAAS,CAAC,SAAS;AAC1B,IAAI,SAAS,IACX,OAAO,IAAI,MAAM,iCAAiC,IAAI,KAAK,GAAG,EAAE,CAAC,IAEjE,QAAQ;AAAA,EAEZ,CAAC,GAED,MAAM,GAAG,SAAS,CAAC,UAAU;AAC3B,WAAO,KAAK;AAAA,EACd,CAAC;AACH,CAAC,GAGU,mBAAmB,CAC9B,KACA,YAIO,YAAY,KAAK;AAAA,EACtB,GAAG;AAAA,EACH,OAAO;AACT,CAAC;",
5
- "names": []
6
- }
@@ -1,20 +0,0 @@
1
- import { writeFileSync } from "node:fs";
2
- import { tmpdir } from "node:os";
3
- import { join } from "node:path";
4
- function mustReplace(source, replacements) {
5
- let sourceOut = source;
6
- for (const { find, replace, optional } of replacements) {
7
- if (!optional && !(find instanceof RegExp ? find.test(sourceOut) : sourceOut.includes(find))) {
8
- const tmpPath = join(tmpdir(), `replace-error-${Math.random()}`);
9
- throw writeFileSync(tmpPath, sourceOut, "utf-8"), new Error(
10
- `Substring or pattern "${find}" not found in the string, replacing in source: ${tmpPath}.`
11
- );
12
- }
13
- sourceOut = sourceOut.replace(find, replace);
14
- }
15
- return sourceOut;
16
- }
17
- export {
18
- mustReplace
19
- };
20
- //# sourceMappingURL=mustReplace.js.map
@@ -1,6 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/mustReplace.ts"],
4
- "mappings": "AAAA,SAAS,qBAAqB;AAC9B,SAAS,cAAc;AACvB,SAAS,YAAY;AAEd,SAAS,YACd,QACA,cAKA;AACA,MAAI,YAAY;AAChB,aAAW,EAAE,MAAM,SAAS,SAAS,KAAK,cAAc;AACtD,QAAI,CAAC,YAGC,EADF,gBAAgB,SAAS,KAAK,KAAK,SAAS,IAAI,UAAU,SAAS,IAAI,IAC7D;AACV,YAAM,UAAU,KAAK,OAAO,GAAG,iBAAiB,KAAK,OAAO,CAAC,EAAE;AAC/D,0BAAc,SAAS,WAAW,OAAO,GACnC,IAAI;AAAA,QACR,yBAAyB,IAAI,mDAAmD,OAAO;AAAA,MACzF;AAAA,IACF;AAIF,gBAAY,UAAU,QAAQ,MAAM,OAAO;AAAA,EAC7C;AACA,SAAO;AACT;",
5
- "names": []
6
- }