@socketsecurity/lib 2.2.1 → 2.3.0

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,15 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [2.3.0](https://github.com/SocketDev/socket-lib/releases/tag/v2.3.0) - 2025-10-28
9
+
10
+ ### Added
11
+
12
+ - **Binary utility wrapper functions**: Added `which()` and `whichSync()` wrapper functions to `bin` module
13
+ - Cross-platform binary lookup that respects PATH environment variable
14
+ - Synchronous and asynchronous variants for different use cases
15
+ - Integrates with existing binary resolution utilities
16
+
8
17
  ## [2.2.1](https://github.com/SocketDev/socket-lib/releases/tag/v2.2.1) - 2025-10-28
9
18
 
10
19
  ### Fixed
package/dist/bin.d.ts CHANGED
@@ -10,18 +10,41 @@ export declare function execBin(binPath: string, args?: string[], options?: impo
10
10
  stdout: string | Buffer<ArrayBufferLike>;
11
11
  stderr: string | Buffer<ArrayBufferLike>;
12
12
  }>;
13
+ /**
14
+ * Options for the which function.
15
+ */
16
+ export interface WhichOptions {
17
+ /** If true, return all matches instead of just the first one. */
18
+ all?: boolean | undefined;
19
+ /** If true, return null instead of throwing when no match is found. */
20
+ nothrow?: boolean | undefined;
21
+ /** Path to search in. */
22
+ path?: string | undefined;
23
+ /** Path separator character. */
24
+ pathExt?: string | undefined;
25
+ /** Environment variables to use. */
26
+ env?: Record<string, string | undefined> | undefined;
27
+ }
28
+ /**
29
+ * Find an executable in the system PATH asynchronously.
30
+ * Wrapper around the which package for lazy loading.
31
+ */
32
+ export declare function which(binName: string, options?: WhichOptions): Promise<string | string[] | undefined>;
33
+ /**
34
+ * Find an executable in the system PATH synchronously.
35
+ * Wrapper around the which package for lazy loading.
36
+ */
37
+ export declare function whichSync(binName: string, options?: WhichOptions): string | string[] | undefined;
13
38
  /**
14
39
  * Find and resolve a binary in the system PATH asynchronously.
15
- * @template {import('which').Options} T
16
40
  * @throws {Error} If the binary is not found and nothrow is false.
17
41
  */
18
- export declare function whichBin(binName: string, options?: import('which').Options): Promise<string | string[] | undefined>;
42
+ export declare function whichBin(binName: string, options?: WhichOptions): Promise<string | string[] | undefined>;
19
43
  /**
20
44
  * Find and resolve a binary in the system PATH synchronously.
21
- * @template {import('which').Options} T
22
45
  * @throws {Error} If the binary is not found and nothrow is false.
23
46
  */
24
- export declare function whichBinSync(binName: string, options?: import('which').Options): string | string[] | undefined;
47
+ export declare function whichBinSync(binName: string, options?: WhichOptions): string | string[] | undefined;
25
48
  /**
26
49
  * Check if a directory path contains any shadow bin patterns.
27
50
  */
package/dist/bin.js CHANGED
@@ -1,3 +1,3 @@
1
1
  /* Socket Lib - Built with esbuild */
2
- var _=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var k=(n,e)=>{for(var o in e)_(n,o,{get:e[o],enumerable:!0})},q=(n,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of F(e))!X.call(n,s)&&s!==o&&_(n,s,{get:()=>e[s],enumerable:!(c=J(e,s))||c.enumerable});return n};var M=n=>q(_({},"__esModule",{value:!0}),n);var T={};k(T,{execBin:()=>z,findRealBin:()=>w,findRealNpm:()=>W,findRealPnpm:()=>Y,findRealYarn:()=>H,isShadowBinPath:()=>B,resolveBinPathSync:()=>y,whichBin:()=>D,whichBinSync:()=>A});module.exports=M(T);var g=require("#env/home"),x=require("#env/windows"),E=require("#env/xdg"),S=require("#constants/platform"),N=require("./fs"),O=require("./objects"),d=require("./path"),R=require("./spawn");let j;function C(){return j===void 0&&(j=require("node:fs")),j}let I;function h(){return I===void 0&&(I=require("node:path")),I}let v;function P(){return v===void 0&&(v=require("./external/which")),v}async function z(n,e,o){const c=(0,d.isPath)(n)?y(n):await D(n);if(!c){const r=new Error(`Binary not found: ${n}`);throw r.code="ENOENT",r}const s=Array.isArray(c)?c[0]:c;return await(0,R.spawn)(s,e??[],{shell:S.WIN32,...o})}async function D(n,e){const o=P(),c={nothrow:!0,...e},s=await o?.(n,c);if(e?.all){const r=Array.isArray(s)?s:typeof s=="string"?[s]:void 0;return r?.length?r.map(p=>y(p)):r}if(s)return y(s)}function A(n,e){const o={nothrow:!0,...e},c=P()?.sync(n,o);if((0,O.getOwn)(e,"all")){const s=Array.isArray(c)?c:typeof c=="string"?[c]:void 0;return s?.length?s.map(r=>y(r)):s}if(c)return y(c)}function B(n){return n?n.replace(/\\/g,"/").includes("node_modules/.bin"):!1}function w(n,e=[]){const o=C(),c=h(),s=P();for(const p of e)if(o?.existsSync(p))return p;const r=s?.sync(n,{nothrow:!0});if(r){const p=c?.dirname(r);if(B(p)){const a=s?.sync(n,{all:!0,nothrow:!0})||[],m=Array.isArray(a)?a:typeof a=="string"?[a]:[];for(const l of m){const i=c?.dirname(l);if(!B(i))return l}}return r}}function W(){const n=C(),e=h(),o=e?.dirname(process.execPath),c=e?.join(o,"npm");if(n?.existsSync(c))return c;const r=w("npm",["/usr/local/bin/npm","/usr/bin/npm"]);if(r&&n?.existsSync(r))return r;const p=A("npm",{nothrow:!0});return p&&typeof p=="string"&&n?.existsSync(p)?p:"npm"}function Y(){const n=h(),e=S.WIN32?[n?.join((0,x.getAppdata)(),"npm","pnpm.cmd"),n?.join((0,x.getAppdata)(),"npm","pnpm"),n?.join((0,x.getLocalappdata)(),"pnpm","pnpm.cmd"),n?.join((0,x.getLocalappdata)(),"pnpm","pnpm"),"C:\\Program Files\\nodejs\\pnpm.cmd","C:\\Program Files\\nodejs\\pnpm"].filter(Boolean):["/usr/local/bin/pnpm","/usr/bin/pnpm",n?.join((0,E.getXdgDataHome)()||`${(0,g.getHome)()}/.local/share`,"pnpm/pnpm"),n?.join((0,g.getHome)(),".pnpm/pnpm")].filter(Boolean);return w("pnpm",e)??""}function H(){const n=h(),e=["/usr/local/bin/yarn","/usr/bin/yarn",n?.join((0,g.getHome)(),".yarn/bin/yarn"),n?.join((0,g.getHome)(),".config/yarn/global/node_modules/.bin/yarn")].filter(Boolean);return w("yarn",e)??""}function y(n){const e=C(),o=h();if(!o?.isAbsolute(n))try{const a=A(n);a&&(n=a)}catch{}if(n=(0,d.normalizePath)(n),n===".")return n;const c=o?.extname(n),s=c.toLowerCase(),r=o?.basename(n,c),p=r==="node"?-1:/(?<=\/)\.volta\//i.exec(n)?.index??-1;if(p!==-1){const a=n.slice(0,p),m=o?.join(a,"tools"),l=o?.join(m,"image"),i=o?.join(m,"user"),t=(0,N.readJsonSync)(o?.join(i,"platform.json"),{throws:!1}),u=t?.node?.runtime,L=t?.node?.npm;let f="";if(r==="npm"||r==="npx"){if(L){const $=`bin/${r}-cli.js`;f=o?.join(l,`npm/${L}/${$}`),u&&!e?.existsSync(f)&&(f=o?.join(l,`node/${u}/lib/node_modules/npm/${$}`),e?.existsSync(f)||(f=""))}}else{const $=o?.join(i,"bin"),b=(0,N.readJsonSync)(o?.join($,`${r}.json`),{throws:!1})?.package;b&&(f=o?.join(l,`packages/${b}/bin/${r}`),e?.existsSync(f)||(f=`${f}.cmd`,e?.existsSync(f)||(f="")))}if(f){try{return(0,d.normalizePath)(e?.realpathSync.native(f))}catch{}return f}}if(S.WIN32){const a=s===""||s===".cmd"||s===".exe"||s===".ps1",m=r==="npm"||r==="npx",l=r==="pnpm"||r==="yarn";if(a&&m){const t=o?.join(o?.dirname(n),`node_modules/npm/bin/${r}-cli.js`);if(e?.existsSync(t)){try{return e?.realpathSync.native(t)}catch{}return t}}let i="";if(a&&s!==".exe"&&e?.existsSync(n)){const t=e?.readFileSync(n,"utf8");m?s===".cmd"?i=r==="npm"?/(?<="NPM_CLI_JS=%~dp0\\).*(?=")/.exec(t)?.[0]||"":/(?<="NPX_CLI_JS=%~dp0\\).*(?=")/.exec(t)?.[0]||"":s===""?i=r==="npm"?/(?<=NPM_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(t)?.[0]||"":/(?<=NPX_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(t)?.[0]||"":s===".ps1"&&(i=r==="npm"?/(?<=\$NPM_CLI_JS="\$PSScriptRoot\/).*(?=")/.exec(t)?.[0]||"":/(?<=\$NPX_CLI_JS="\$PSScriptRoot\/).*(?=")/.exec(t)?.[0]||""):l?s===".cmd"?(i=/(?<=node\s+")%~dp0\\([^"]+)(?="\s+%\*)/.exec(t)?.[1]||"",i||(i=/(?<="%~dp0\\[^"]*node[^"]*"\s+")%~dp0\\([^"]+)(?="\s+%\*)/.exec(t)?.[1]||""),i||(i=/(?<="%dp0%\\).*(?=" %\*\r\n)/.exec(t)?.[0]||"")):s===""?(i=/(?<="\$basedir\/)\.tools\/pnpm\/[^"]+(?="\s+"\$@")/.exec(t)?.[0]||"",i||(i=/(?<=exec\s+node\s+"\$basedir\/)\.tools\/pnpm\/[^"]+(?="\s+"\$@")/.exec(t)?.[0]||""),i||(i=/(?<="\$basedir\/).*(?=" "\$@"\n)/.exec(t)?.[0]||"")):s===".ps1"&&(i=/(?<="\$basedir\/).*(?=" $args\n)/.exec(t)?.[0]||""):s===".cmd"?i=/(?<="%dp0%\\).*(?=" %\*\r\n)/.exec(t)?.[0]||"":s===""?i=/(?<="$basedir\/).*(?=" "\$@"\n)/.exec(t)?.[0]||"":s===".ps1"&&(i=/(?<="\$basedir\/).*(?=" $args\n)/.exec(t)?.[0]||""),i&&(n=(0,d.normalizePath)(o?.resolve(o?.dirname(n),i)))}}else{let a=s==="";const m=r==="pnpm"||r==="yarn",l=r==="npm"||r==="npx";if(m&&n.includes("/.bin/pnpm/bin/")){const i=n.indexOf("/.bin/pnpm");if(i!==-1){const t=n.slice(0,i+10);try{(e?.statSync(t)).isFile()&&(n=(0,d.normalizePath)(t),a=!o?.extname(n))}catch{}}}if(a&&(m||l)&&e?.existsSync(n)){const i=e?.readFileSync(n,"utf8");let t="";if(m){if(t=/(?<="\$basedir\/)\.tools\/[^"]+(?="\s+"\$@")/.exec(i)?.[0]||"",t||(t=/(?<="\$basedir\/)[^"]+(?="\s+"\$@")/.exec(i)?.[0]||""),!t){const u=/exec\s+node\s+"?\$basedir\/([^"]+)"?\s+"\$@"/.exec(i);u&&(t=u[1]||"")}t&&r==="pnpm"&&t.startsWith("pnpm/")&&(t=`../${t}`)}else l&&(t=r==="npm"?/(?<=NPM_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(i)?.[0]||"":/(?<=NPX_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(i)?.[0]||"");t&&(n=(0,d.normalizePath)(o?.resolve(o?.dirname(n),t)))}}try{const a=e?.realpathSync.native(n);return(0,d.normalizePath)(a)}catch{}return(0,d.normalizePath)(n)}0&&(module.exports={execBin,findRealBin,findRealNpm,findRealPnpm,findRealYarn,isShadowBinPath,resolveBinPathSync,whichBin,whichBinSync});
2
+ var j=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var F=Object.prototype.hasOwnProperty;var X=(n,e)=>{for(var i in e)j(n,i,{get:e[i],enumerable:!0})},k=(n,e,i,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of W(e))!F.call(n,s)&&s!==i&&j(n,s,{get:()=>e[s],enumerable:!(c=J(e,s))||c.enumerable});return n};var q=n=>k(j({},"__esModule",{value:!0}),n);var U={};X(U,{execBin:()=>M,findRealBin:()=>_,findRealNpm:()=>Y,findRealPnpm:()=>H,findRealYarn:()=>T,isShadowBinPath:()=>C,resolveBinPathSync:()=>g,which:()=>z,whichBin:()=>D,whichBinSync:()=>A,whichSync:()=>R});module.exports=q(U);var h=require("#env/home"),x=require("#env/windows"),O=require("#env/xdg"),$=require("#constants/platform"),B=require("./fs"),l=require("./path"),E=require("./spawn");let I;function P(){return I===void 0&&(I=require("node:fs")),I}let v;function y(){return v===void 0&&(v=require("node:path")),v}let N;function w(){return N===void 0&&(N=require("./external/which")),N}async function M(n,e,i){const c=(0,l.isPath)(n)?g(n):await D(n);if(!c){const r=new Error(`Binary not found: ${n}`);throw r.code="ENOENT",r}const s=Array.isArray(c)?c[0]:c;return await(0,E.spawn)(s,e??[],{shell:$.WIN32,...i})}async function z(n,e){return await w()(n,e)}function R(n,e){return w().sync(n,e)}async function D(n,e){const i=w(),c={nothrow:!0,...e},s=await i(n,c);if(c?.all){const r=Array.isArray(s)?s:typeof s=="string"?[s]:void 0;return r?.length?r.map(p=>g(p)):r}if(s)return g(s)}function A(n,e){const i={nothrow:!0,...e},c=R(n,i);if(i.all){const s=Array.isArray(c)?c:typeof c=="string"?[c]:void 0;return s?.length?s.map(r=>g(r)):s}if(c)return g(c)}function C(n){return n?n.replace(/\\/g,"/").includes("node_modules/.bin"):!1}function _(n,e=[]){const i=P(),c=y(),s=w();for(const p of e)if(i?.existsSync(p))return p;const r=s?.sync(n,{nothrow:!0});if(r){const p=c?.dirname(r);if(C(p)){const a=s?.sync(n,{all:!0,nothrow:!0})||[],d=Array.isArray(a)?a:typeof a=="string"?[a]:[];for(const m of d){const o=c?.dirname(m);if(!C(o))return m}}return r}}function Y(){const n=P(),e=y(),i=e?.dirname(process.execPath),c=e?.join(i,"npm");if(n?.existsSync(c))return c;const r=_("npm",["/usr/local/bin/npm","/usr/bin/npm"]);if(r&&n?.existsSync(r))return r;const p=A("npm",{nothrow:!0});return p&&typeof p=="string"&&n?.existsSync(p)?p:"npm"}function H(){const n=y(),e=$.WIN32?[n?.join((0,x.getAppdata)(),"npm","pnpm.cmd"),n?.join((0,x.getAppdata)(),"npm","pnpm"),n?.join((0,x.getLocalappdata)(),"pnpm","pnpm.cmd"),n?.join((0,x.getLocalappdata)(),"pnpm","pnpm"),"C:\\Program Files\\nodejs\\pnpm.cmd","C:\\Program Files\\nodejs\\pnpm"].filter(Boolean):["/usr/local/bin/pnpm","/usr/bin/pnpm",n?.join((0,O.getXdgDataHome)()||`${(0,h.getHome)()}/.local/share`,"pnpm/pnpm"),n?.join((0,h.getHome)(),".pnpm/pnpm")].filter(Boolean);return _("pnpm",e)??""}function T(){const n=y(),e=["/usr/local/bin/yarn","/usr/bin/yarn",n?.join((0,h.getHome)(),".yarn/bin/yarn"),n?.join((0,h.getHome)(),".config/yarn/global/node_modules/.bin/yarn")].filter(Boolean);return _("yarn",e)??""}function g(n){const e=P(),i=y();if(!i?.isAbsolute(n))try{const a=A(n);a&&(n=a)}catch{}if(n=(0,l.normalizePath)(n),n===".")return n;const c=i?.extname(n),s=c.toLowerCase(),r=i?.basename(n,c),p=r==="node"?-1:/(?<=\/)\.volta\//i.exec(n)?.index??-1;if(p!==-1){const a=n.slice(0,p),d=i?.join(a,"tools"),m=i?.join(d,"image"),o=i?.join(d,"user"),t=(0,B.readJsonSync)(i?.join(o,"platform.json"),{throws:!1}),u=t?.node?.runtime,L=t?.node?.npm;let f="";if(r==="npm"||r==="npx"){if(L){const S=`bin/${r}-cli.js`;f=i?.join(m,`npm/${L}/${S}`),u&&!e?.existsSync(f)&&(f=i?.join(m,`node/${u}/lib/node_modules/npm/${S}`),e?.existsSync(f)||(f=""))}}else{const S=i?.join(o,"bin"),b=(0,B.readJsonSync)(i?.join(S,`${r}.json`),{throws:!1})?.package;b&&(f=i?.join(m,`packages/${b}/bin/${r}`),e?.existsSync(f)||(f=`${f}.cmd`,e?.existsSync(f)||(f="")))}if(f){try{return(0,l.normalizePath)(e?.realpathSync.native(f))}catch{}return f}}if($.WIN32){const a=s===""||s===".cmd"||s===".exe"||s===".ps1",d=r==="npm"||r==="npx",m=r==="pnpm"||r==="yarn";if(a&&d){const t=i?.join(i?.dirname(n),`node_modules/npm/bin/${r}-cli.js`);if(e?.existsSync(t)){try{return e?.realpathSync.native(t)}catch{}return t}}let o="";if(a&&s!==".exe"&&e?.existsSync(n)){const t=e?.readFileSync(n,"utf8");d?s===".cmd"?o=r==="npm"?/(?<="NPM_CLI_JS=%~dp0\\).*(?=")/.exec(t)?.[0]||"":/(?<="NPX_CLI_JS=%~dp0\\).*(?=")/.exec(t)?.[0]||"":s===""?o=r==="npm"?/(?<=NPM_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(t)?.[0]||"":/(?<=NPX_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(t)?.[0]||"":s===".ps1"&&(o=r==="npm"?/(?<=\$NPM_CLI_JS="\$PSScriptRoot\/).*(?=")/.exec(t)?.[0]||"":/(?<=\$NPX_CLI_JS="\$PSScriptRoot\/).*(?=")/.exec(t)?.[0]||""):m?s===".cmd"?(o=/(?<=node\s+")%~dp0\\([^"]+)(?="\s+%\*)/.exec(t)?.[1]||"",o||(o=/(?<="%~dp0\\[^"]*node[^"]*"\s+")%~dp0\\([^"]+)(?="\s+%\*)/.exec(t)?.[1]||""),o||(o=/(?<="%dp0%\\).*(?=" %\*\r\n)/.exec(t)?.[0]||"")):s===""?(o=/(?<="\$basedir\/)\.tools\/pnpm\/[^"]+(?="\s+"\$@")/.exec(t)?.[0]||"",o||(o=/(?<=exec\s+node\s+"\$basedir\/)\.tools\/pnpm\/[^"]+(?="\s+"\$@")/.exec(t)?.[0]||""),o||(o=/(?<="\$basedir\/).*(?=" "\$@"\n)/.exec(t)?.[0]||"")):s===".ps1"&&(o=/(?<="\$basedir\/).*(?=" $args\n)/.exec(t)?.[0]||""):s===".cmd"?o=/(?<="%dp0%\\).*(?=" %\*\r\n)/.exec(t)?.[0]||"":s===""?o=/(?<="$basedir\/).*(?=" "\$@"\n)/.exec(t)?.[0]||"":s===".ps1"&&(o=/(?<="\$basedir\/).*(?=" $args\n)/.exec(t)?.[0]||""),o&&(n=(0,l.normalizePath)(i?.resolve(i?.dirname(n),o)))}}else{let a=s==="";const d=r==="pnpm"||r==="yarn",m=r==="npm"||r==="npx";if(d&&n.includes("/.bin/pnpm/bin/")){const o=n.indexOf("/.bin/pnpm");if(o!==-1){const t=n.slice(0,o+10);try{(e?.statSync(t)).isFile()&&(n=(0,l.normalizePath)(t),a=!i?.extname(n))}catch{}}}if(a&&(d||m)&&e?.existsSync(n)){const o=e?.readFileSync(n,"utf8");let t="";if(d){if(t=/(?<="\$basedir\/)\.tools\/[^"]+(?="\s+"\$@")/.exec(o)?.[0]||"",t||(t=/(?<="\$basedir\/)[^"]+(?="\s+"\$@")/.exec(o)?.[0]||""),!t){const u=/exec\s+node\s+"?\$basedir\/([^"]+)"?\s+"\$@"/.exec(o);u&&(t=u[1]||"")}t&&r==="pnpm"&&t.startsWith("pnpm/")&&(t=`../${t}`)}else m&&(t=r==="npm"?/(?<=NPM_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(o)?.[0]||"":/(?<=NPX_CLI_JS="\$CLI_BASEDIR\/).*(?=")/.exec(o)?.[0]||"");t&&(n=(0,l.normalizePath)(i?.resolve(i?.dirname(n),t)))}}try{const a=e?.realpathSync.native(n);return(0,l.normalizePath)(a)}catch{}return(0,l.normalizePath)(n)}0&&(module.exports={execBin,findRealBin,findRealNpm,findRealPnpm,findRealYarn,isShadowBinPath,resolveBinPathSync,which,whichBin,whichBinSync,whichSync});
3
3
  //# sourceMappingURL=bin.js.map
package/dist/bin.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/bin.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview Binary path resolution and execution utilities for package managers.\n * Provides cross-platform bin path lookup, command execution, and path normalization.\n */\n\nimport { getHome } from '#env/home'\nimport { getAppdata, getLocalappdata } from '#env/windows'\nimport { getXdgDataHome } from '#env/xdg'\n\nimport { WIN32 } from '#constants/platform'\nimport { readJsonSync } from './fs'\nimport { getOwn } from './objects'\nimport { isPath, normalizePath } from './path'\nimport { spawn } from './spawn'\n\nlet _fs: typeof import('node:fs') | undefined\n/**\n * Lazily load the fs module to avoid Webpack errors.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getFs() {\n if (_fs === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _fs = /*@__PURE__*/ require('node:fs')\n }\n return _fs!\n}\n\nlet _path: typeof import('node:path') | undefined\n/**\n * Lazily load the path module to avoid Webpack errors.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getPath() {\n if (_path === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _path = /*@__PURE__*/ require('node:path')\n }\n return _path!\n}\n\nlet _which: typeof import('which') | undefined\n/**\n * Lazily load the which module for finding executables.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getWhich() {\n if (_which === undefined) {\n _which = /*@__PURE__*/ require('./external/which')\n }\n return _which!\n}\n\n/**\n * Execute a binary with the given arguments.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport async function execBin(\n binPath: string,\n args?: string[],\n options?: import('./spawn').SpawnOptions,\n) {\n // Resolve the binary path.\n const resolvedPath = isPath(binPath)\n ? resolveBinPathSync(binPath)\n : await whichBin(binPath)\n\n if (!resolvedPath) {\n const error = new Error(`Binary not found: ${binPath}`) as Error & {\n code: string\n }\n error.code = 'ENOENT'\n throw error\n }\n\n // Execute the binary directly.\n const binCommand = Array.isArray(resolvedPath)\n ? resolvedPath[0]!\n : resolvedPath\n // On Windows, binaries are often .cmd files that require shell to execute.\n return await spawn(binCommand, args ?? [], {\n shell: WIN32,\n ...options,\n })\n}\n\n/**\n * Find and resolve a binary in the system PATH asynchronously.\n * @template {import('which').Options} T\n * @throws {Error} If the binary is not found and nothrow is false.\n */\nexport async function whichBin(\n binName: string,\n options?: import('which').Options,\n): Promise<string | string[] | undefined> {\n const which = getWhich()\n // Default to nothrow: true if not specified to return undefined instead of throwing\n const opts = { nothrow: true, ...options }\n // Depending on options `which` may throw if `binName` is not found.\n // With nothrow: true, it returns null when `binName` is not found.\n const result = await which?.(binName, opts)\n\n // When 'all: true' is specified, ensure we always return an array.\n if (options?.all) {\n const paths = Array.isArray(result)\n ? result\n : typeof result === 'string'\n ? [result]\n : undefined\n // If all is true and we have paths, resolve each one.\n return paths?.length ? paths.map(p => resolveBinPathSync(p)) : paths\n }\n\n // If result is undefined (binary not found), return undefined\n if (!result) {\n return undefined\n }\n\n return resolveBinPathSync(result)\n}\n\n/**\n * Find and resolve a binary in the system PATH synchronously.\n * @template {import('which').Options} T\n * @throws {Error} If the binary is not found and nothrow is false.\n */\nexport function whichBinSync(\n binName: string,\n options?: import('which').Options,\n): string | string[] | undefined {\n // Default to nothrow: true if not specified to return undefined instead of throwing\n const opts = { nothrow: true, ...options }\n // Depending on options `which` may throw if `binName` is not found.\n // With nothrow: true, it returns null when `binName` is not found.\n const result = getWhich()?.sync(binName, opts)\n\n // When 'all: true' is specified, ensure we always return an array.\n if (getOwn(options, 'all')) {\n const paths = Array.isArray(result)\n ? result\n : typeof result === 'string'\n ? [result]\n : undefined\n // If all is true and we have paths, resolve each one.\n return paths?.length ? paths.map(p => resolveBinPathSync(p)) : paths\n }\n\n // If result is undefined (binary not found), return undefined\n if (!result) {\n return undefined\n }\n\n return resolveBinPathSync(result)\n}\n\n/**\n * Check if a directory path contains any shadow bin patterns.\n */\nexport function isShadowBinPath(dirPath: string | undefined): boolean {\n if (!dirPath) {\n return false\n }\n // Check for node_modules/.bin pattern (Unix and Windows)\n const normalized = dirPath.replace(/\\\\/g, '/')\n return normalized.includes('node_modules/.bin')\n}\n\n/**\n * Find the real executable for a binary, bypassing shadow bins.\n */\nexport function findRealBin(\n binName: string,\n commonPaths: string[] = [],\n): string | undefined {\n const fs = getFs()\n const path = getPath()\n const which = getWhich()\n\n // Try common locations first.\n for (const binPath of commonPaths) {\n if (fs?.existsSync(binPath)) {\n return binPath\n }\n }\n\n // Fall back to which.sync if no direct path found.\n const binPath = which?.sync(binName, { nothrow: true })\n if (binPath) {\n const binDir = path?.dirname(binPath)\n\n if (isShadowBinPath(binDir)) {\n // This is likely a shadowed binary, try to find the real one.\n const allPaths = which?.sync(binName, { all: true, nothrow: true }) || []\n // Ensure allPaths is an array.\n const pathsArray = Array.isArray(allPaths)\n ? allPaths\n : typeof allPaths === 'string'\n ? [allPaths]\n : []\n\n for (const altPath of pathsArray) {\n const altDir = path?.dirname(altPath)\n if (!isShadowBinPath(altDir)) {\n return altPath\n }\n }\n }\n return binPath\n }\n // If all else fails, return undefined to indicate binary not found.\n return undefined\n}\n\n/**\n * Find the real npm executable, bypassing any aliases and shadow bins.\n */\nexport function findRealNpm(): string {\n const fs = getFs()\n const path = getPath()\n\n // Try to find npm in the same directory as the node executable.\n const nodeDir = path?.dirname(process.execPath)\n const npmInNodeDir = path?.join(nodeDir, 'npm')\n\n if (fs?.existsSync(npmInNodeDir)) {\n return npmInNodeDir\n }\n\n // Try common npm locations.\n const commonPaths = ['/usr/local/bin/npm', '/usr/bin/npm']\n const result = findRealBin('npm', commonPaths)\n\n // If we found a valid path, return it.\n if (result && fs?.existsSync(result)) {\n return result\n }\n\n // As a last resort, try to use whichBinSync to find npm.\n // This handles cases where npm is installed in non-standard locations.\n const npmPath = whichBinSync('npm', { nothrow: true })\n if (npmPath && typeof npmPath === 'string' && fs?.existsSync(npmPath)) {\n return npmPath\n }\n\n // Return the basic 'npm' and let the system resolve it.\n return 'npm'\n}\n\n/**\n * Find the real pnpm executable, bypassing any aliases and shadow bins.\n */\nexport function findRealPnpm(): string {\n const path = getPath()\n\n // Try common pnpm locations.\n const commonPaths = WIN32\n ? [\n // Windows common paths.\n path?.join(getAppdata() as string, 'npm', 'pnpm.cmd'),\n path?.join(getAppdata() as string, 'npm', 'pnpm'),\n path?.join(getLocalappdata() as string, 'pnpm', 'pnpm.cmd'),\n path?.join(getLocalappdata() as string, 'pnpm', 'pnpm'),\n 'C:\\\\Program Files\\\\nodejs\\\\pnpm.cmd',\n 'C:\\\\Program Files\\\\nodejs\\\\pnpm',\n ].filter(Boolean)\n : [\n // Unix common paths.\n '/usr/local/bin/pnpm',\n '/usr/bin/pnpm',\n path?.join(\n (getXdgDataHome() as string) || `${getHome() as string}/.local/share`,\n 'pnpm/pnpm',\n ),\n path?.join(getHome() as string, '.pnpm/pnpm'),\n ].filter(Boolean)\n\n return findRealBin('pnpm', commonPaths) ?? ''\n}\n\n/**\n * Find the real yarn executable, bypassing any aliases and shadow bins.\n */\nexport function findRealYarn(): string {\n const path = getPath()\n\n // Try common yarn locations.\n const commonPaths = [\n '/usr/local/bin/yarn',\n '/usr/bin/yarn',\n path?.join(getHome() as string, '.yarn/bin/yarn'),\n path?.join(\n getHome() as string,\n '.config/yarn/global/node_modules/.bin/yarn',\n ),\n ].filter(Boolean)\n\n return findRealBin('yarn', commonPaths) ?? ''\n}\n\n/*@__NO_SIDE_EFFECTS__*/\n/**\n * Resolve a binary path to its actual executable file.\n * Handles Windows .cmd wrappers and Unix shell scripts.\n */\nexport function resolveBinPathSync(binPath: string): string {\n const fs = getFs()\n const path = getPath()\n\n // If it's not an absolute path, try to find it in PATH first\n if (!path?.isAbsolute(binPath)) {\n try {\n const resolved = whichBinSync(binPath)\n if (resolved) {\n binPath = resolved as string\n }\n } catch {}\n }\n\n // Normalize the path once for consistent pattern matching.\n binPath = normalizePath(binPath)\n\n // Handle empty string that normalized to '.' (current directory)\n if (binPath === '.') {\n return binPath\n }\n\n const ext = path?.extname(binPath)\n const extLowered = ext.toLowerCase()\n const basename = path?.basename(binPath, ext)\n const voltaIndex =\n basename === 'node' ? -1 : (/(?<=\\/)\\.volta\\//i.exec(binPath)?.index ?? -1)\n if (voltaIndex !== -1) {\n const voltaPath = binPath.slice(0, voltaIndex)\n const voltaToolsPath = path?.join(voltaPath, 'tools')\n const voltaImagePath = path?.join(voltaToolsPath, 'image')\n const voltaUserPath = path?.join(voltaToolsPath, 'user')\n const voltaPlatform = readJsonSync(\n path?.join(voltaUserPath, 'platform.json'),\n { throws: false },\n ) as any\n const voltaNodeVersion = voltaPlatform?.node?.runtime\n const voltaNpmVersion = voltaPlatform?.node?.npm\n let voltaBinPath = ''\n if (basename === 'npm' || basename === 'npx') {\n if (voltaNpmVersion) {\n const relCliPath = `bin/${basename}-cli.js`\n voltaBinPath = path?.join(\n voltaImagePath,\n `npm/${voltaNpmVersion}/${relCliPath}`,\n )\n if (voltaNodeVersion && !fs?.existsSync(voltaBinPath)) {\n voltaBinPath = path?.join(\n voltaImagePath,\n `node/${voltaNodeVersion}/lib/node_modules/npm/${relCliPath}`,\n )\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = ''\n }\n }\n }\n } else {\n const voltaUserBinPath = path?.join(voltaUserPath, 'bin')\n const binInfo = readJsonSync(\n path?.join(voltaUserBinPath, `${basename}.json`),\n { throws: false },\n ) as any\n const binPackage = binInfo?.package\n if (binPackage) {\n voltaBinPath = path?.join(\n voltaImagePath,\n `packages/${binPackage}/bin/${basename}`,\n )\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = `${voltaBinPath}.cmd`\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = ''\n }\n }\n }\n }\n if (voltaBinPath) {\n try {\n return normalizePath(fs?.realpathSync.native(voltaBinPath))\n } catch {}\n return voltaBinPath\n }\n }\n if (WIN32) {\n const hasKnownExt =\n extLowered === '' ||\n extLowered === '.cmd' ||\n extLowered === '.exe' ||\n extLowered === '.ps1'\n const isNpmOrNpx = basename === 'npm' || basename === 'npx'\n const isPnpmOrYarn = basename === 'pnpm' || basename === 'yarn'\n if (hasKnownExt && isNpmOrNpx) {\n // The quick route assumes a bin path like: C:\\Program Files\\nodejs\\npm.cmd\n const quickPath = path?.join(\n path?.dirname(binPath),\n `node_modules/npm/bin/${basename}-cli.js`,\n )\n if (fs?.existsSync(quickPath)) {\n try {\n return fs?.realpathSync.native(quickPath)\n } catch {}\n return quickPath\n }\n }\n let relPath = ''\n if (\n hasKnownExt &&\n // Only parse shell scripts and batch files, not actual executables.\n // .exe files are already executables and don't need path resolution from wrapper scripts.\n extLowered !== '.exe' &&\n // Check if file exists before attempting to read it to avoid ENOENT errors.\n fs?.existsSync(binPath)\n ) {\n const source = fs?.readFileSync(binPath, 'utf8')\n if (isNpmOrNpx) {\n if (extLowered === '.cmd') {\n // \"npm.cmd\" and \"npx.cmd\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm.cmd\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx.cmd\n relPath =\n basename === 'npm'\n ? /(?<=\"NPM_CLI_JS=%~dp0\\\\).*(?=\")/.exec(source)?.[0] || ''\n : /(?<=\"NPX_CLI_JS=%~dp0\\\\).*(?=\")/.exec(source)?.[0] || ''\n } else if (extLowered === '') {\n // Extensionless \"npm\" and \"npx\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx\n relPath =\n basename === 'npm'\n ? /(?<=NPM_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] ||\n ''\n : /(?<=NPX_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] ||\n ''\n } else if (extLowered === '.ps1') {\n // \"npm.ps1\" and \"npx.ps1\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm.ps1\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx.ps1\n relPath =\n basename === 'npm'\n ? /(?<=\\$NPM_CLI_JS=\"\\$PSScriptRoot\\/).*(?=\")/.exec(\n source,\n )?.[0] || ''\n : /(?<=\\$NPX_CLI_JS=\"\\$PSScriptRoot\\/).*(?=\")/.exec(\n source,\n )?.[0] || ''\n }\n } else if (isPnpmOrYarn) {\n if (extLowered === '.cmd') {\n // pnpm.cmd and yarn.cmd can have different formats depending on installation method\n // Common formats include:\n // 1. Setup-pnpm action format: node \"%~dp0\\..\\pnpm\\bin\\pnpm.cjs\" %*\n // 2. npm install -g pnpm format: similar to cmd-shim\n // 3. Standalone installer format: various patterns\n\n // Try setup-pnpm/setup-yarn action format first\n relPath =\n /(?<=node\\s+\")%~dp0\\\\([^\"]+)(?=\"\\s+%\\*)/.exec(source)?.[1] || ''\n\n // Try alternative format: \"%~dp0\\node.exe\" \"%~dp0\\..\\package\\bin\\binary.js\" %*\n if (!relPath) {\n relPath =\n /(?<=\"%~dp0\\\\[^\"]*node[^\"]*\"\\s+\")%~dp0\\\\([^\"]+)(?=\"\\s+%\\*)/.exec(\n source,\n )?.[1] || ''\n }\n\n // Try cmd-shim format as fallback\n if (!relPath) {\n relPath = /(?<=\"%dp0%\\\\).*(?=\" %\\*\\r\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '') {\n // Extensionless pnpm/yarn - try common shebang formats\n // Handle pnpm installed via standalone installer or global install\n // Format: exec \"$basedir/node\" \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n // Note: may have multiple spaces between arguments\n relPath =\n /(?<=\"\\$basedir\\/)\\.tools\\/pnpm\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(\n source,\n )?.[0] || ''\n if (!relPath) {\n // Also try: exec node \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n relPath =\n /(?<=exec\\s+node\\s+\"\\$basedir\\/)\\.tools\\/pnpm\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(\n source,\n )?.[0] || ''\n }\n if (!relPath) {\n // Try standard cmd-shim format: exec node \"$basedir/../package/bin/binary.js\" \"$@\"\n relPath = /(?<=\"\\$basedir\\/).*(?=\" \"\\$@\"\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '.ps1') {\n // PowerShell format\n relPath = /(?<=\"\\$basedir\\/).*(?=\" $args\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '.cmd') {\n // \"bin.CMD\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L98:\n //\n // @ECHO off\n // GOTO start\n // :find_dp0\n // SET dp0=%~dp0\n // EXIT /b\n // :start\n // SETLOCAL\n // CALL :find_dp0\n //\n // IF EXIST \"%dp0%\\node.exe\" (\n // SET \"_prog=%dp0%\\node.exe\"\n // ) ELSE (\n // SET \"_prog=node\"\n // SET PATHEXT=%PATHEXT:;.JS;=;%\n // )\n //\n // endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & \"%_prog%\" \"%dp0%\\..\\<PACKAGE_NAME>\\path\\to\\bin.js\" %*\n relPath = /(?<=\"%dp0%\\\\).*(?=\" %\\*\\r\\n)/.exec(source)?.[0] || ''\n } else if (extLowered === '') {\n // Extensionless \"bin\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L138:\n //\n // #!/bin/sh\n // basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n //\n // case `uname` in\n // *CYGWIN*|*MINGW*|*MSYS*)\n // if command -v cygpath > /dev/null 2>&1; then\n // basedir=`cygpath -w \"$basedir\"`\n // fi\n // ;;\n // esac\n //\n // if [ -x \"$basedir/node\" ]; then\n // exec \"$basedir/node\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" \"$@\"\n // else\n // exec node \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" \"$@\"\n // fi\n relPath = /(?<=\"$basedir\\/).*(?=\" \"\\$@\"\\n)/.exec(source)?.[0] || ''\n } else if (extLowered === '.ps1') {\n // \"bin.PS1\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L192:\n //\n // #!/usr/bin/env pwsh\n // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n //\n // $exe=\"\"\n // if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n // # Fix case when both the Windows and Linux builds of Node\n // # are installed in the same directory\n // $exe=\".exe\"\n // }\n // $ret=0\n // if (Test-Path \"$basedir/node$exe\") {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"$basedir/node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // } else {\n // & \"$basedir/node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // } else {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // } else {\n // & \"node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // }\n // exit $ret\n relPath = /(?<=\"\\$basedir\\/).*(?=\" $args\\n)/.exec(source)?.[0] || ''\n }\n if (relPath) {\n binPath = normalizePath(path?.resolve(path?.dirname(binPath), relPath))\n }\n }\n } else {\n // Handle Unix shell scripts (non-Windows platforms)\n let hasNoExt = extLowered === ''\n const isPnpmOrYarn = basename === 'pnpm' || basename === 'yarn'\n const isNpmOrNpx = basename === 'npm' || basename === 'npx'\n\n // Handle special case where pnpm path in CI has extra segments.\n // In setup-pnpm GitHub Action, the path might be malformed like:\n // /home/user/setup-pnpm/node_modules/.bin/pnpm/bin/pnpm.cjs\n // This happens when the shell script contains a relative path that\n // when resolved, creates an invalid nested structure.\n if (isPnpmOrYarn && binPath.includes('/.bin/pnpm/bin/')) {\n // Extract the correct pnpm bin path.\n const binIndex = binPath.indexOf('/.bin/pnpm')\n if (binIndex !== -1) {\n // Get the base path up to /.bin/pnpm.\n const baseBinPath = binPath.slice(0, binIndex + '/.bin/pnpm'.length)\n // Check if the original shell script exists.\n try {\n const stats = fs?.statSync(baseBinPath)\n // Only use this path if it's a file (the shell script).\n if (stats.isFile()) {\n binPath = normalizePath(baseBinPath)\n // Recompute hasNoExt since we changed the path.\n hasNoExt = !path?.extname(binPath)\n }\n } catch {\n // If stat fails, continue with the original path.\n }\n }\n }\n\n if (\n hasNoExt &&\n (isPnpmOrYarn || isNpmOrNpx) &&\n // For extensionless files (Unix shell scripts), verify existence before reading.\n // This prevents ENOENT errors when the bin path doesn't exist.\n fs?.existsSync(binPath)\n ) {\n const source = fs?.readFileSync(binPath, 'utf8')\n let relPath = ''\n\n if (isPnpmOrYarn) {\n // Handle pnpm/yarn Unix shell scripts.\n // Format: exec \"$basedir/node\" \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n // or: exec node \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n relPath =\n /(?<=\"\\$basedir\\/)\\.tools\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(source)?.[0] || ''\n if (!relPath) {\n // Try standard cmd-shim format: exec node \"$basedir/../package/bin/binary.js\" \"$@\"\n // Example: exec node \"$basedir/../pnpm/bin/pnpm.cjs\" \"$@\"\n // ^^^^^^^^^^^^^^^^^^^^^ captures this part\n // This regex needs to be more careful to not match \"$@\" at the end.\n relPath =\n /(?<=\"\\$basedir\\/)[^\"]+(?=\"\\s+\"\\$@\")/.exec(source)?.[0] || ''\n }\n // Special case for setup-pnpm GitHub Action which may use a different format.\n // The setup-pnpm action creates a shell script that references ../pnpm/bin/pnpm.cjs\n if (!relPath) {\n // Try to match: exec node \"$basedir/../pnpm/bin/pnpm.cjs\" \"$@\"\n const match = /exec\\s+node\\s+\"?\\$basedir\\/([^\"]+)\"?\\s+\"\\$@\"/.exec(\n source,\n )\n if (match) {\n relPath = match[1] || ''\n }\n }\n // Check if the extracted path looks wrong (e.g., pnpm/bin/pnpm.cjs without ../).\n // This happens with setup-pnpm action when it creates a malformed shell script.\n if (relPath && basename === 'pnpm' && relPath.startsWith('pnpm/')) {\n // The path should be ../pnpm/... not pnpm/...\n // Prepend ../ to fix the relative path.\n relPath = `../${relPath}`\n }\n } else if (isNpmOrNpx) {\n // Handle npm/npx Unix shell scripts\n relPath =\n basename === 'npm'\n ? /(?<=NPM_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] || ''\n : /(?<=NPX_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] || ''\n }\n\n if (relPath) {\n // Resolve the relative path to handle .. segments properly.\n binPath = normalizePath(path?.resolve(path?.dirname(binPath), relPath))\n }\n }\n }\n try {\n const realPath = fs?.realpathSync.native(binPath)\n return normalizePath(realPath)\n } catch {}\n // Return normalized path even if realpath fails.\n return normalizePath(binPath)\n}\n"],
5
- "mappings": ";4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA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,IAGjB3B,GAAI,WAAWd,CAAO,EACtB,CACA,MAAM6C,EAAS/B,GAAI,aAAad,EAAS,MAAM,EAC/C,IAAI4C,EAAU,GAEd,GAAIF,EAAc,CAgBhB,GAZAE,EACE,+CAA+C,KAAKC,CAAM,IAAI,CAAC,GAAK,GACjED,IAKHA,EACE,sCAAsC,KAAKC,CAAM,IAAI,CAAC,GAAK,IAI3D,CAACD,EAAS,CAEZ,MAAMK,EAAQ,+CAA+C,KAC3DJ,CACF,EACII,IACFL,EAAUK,EAAM,CAAC,GAAK,GAE1B,CAGIL,GAAWjB,IAAa,QAAUiB,EAAQ,WAAW,OAAO,IAG9DA,EAAU,MAAMA,CAAO,GAE3B,MAAWH,IAETG,EACEjB,IAAa,MACT,0CAA0C,KAAKkB,CAAM,IAAI,CAAC,GAAK,GAC/D,0CAA0C,KAAKA,CAAM,IAAI,CAAC,GAAK,IAGnED,IAEF5C,KAAU,iBAAce,GAAM,QAAQA,GAAM,QAAQf,CAAO,EAAG4C,CAAO,CAAC,EAE1E,CACF,CACA,GAAI,CACF,MAAMM,EAAWpC,GAAI,aAAa,OAAOd,CAAO,EAChD,SAAO,iBAAckD,CAAQ,CAC/B,MAAQ,CAAC,CAET,SAAO,iBAAclD,CAAO,CAC9B",
6
- "names": ["bin_exports", "__export", "execBin", "findRealBin", "findRealNpm", "findRealPnpm", "findRealYarn", "isShadowBinPath", "resolveBinPathSync", "whichBin", "whichBinSync", "__toCommonJS", "import_home", "import_windows", "import_xdg", "import_platform", "import_fs", "import_objects", "import_path", "import_spawn", "_fs", "getFs", "_path", "getPath", "_which", "getWhich", "binPath", "args", "options", "resolvedPath", "error", "binCommand", "binName", "which", "opts", "result", "paths", "p", "dirPath", "commonPaths", "fs", "path", "binDir", "allPaths", "pathsArray", "altPath", "altDir", "nodeDir", "npmInNodeDir", "npmPath", "resolved", "ext", "extLowered", "basename", "voltaIndex", "voltaPath", "voltaToolsPath", "voltaImagePath", "voltaUserPath", "voltaPlatform", "voltaNodeVersion", "voltaNpmVersion", "voltaBinPath", "relCliPath", "voltaUserBinPath", "binPackage", "hasKnownExt", "isNpmOrNpx", "isPnpmOrYarn", "quickPath", "relPath", "source", "hasNoExt", "binIndex", "baseBinPath", "match", "realPath"]
4
+ "sourcesContent": ["/**\n * @fileoverview Binary path resolution and execution utilities for package managers.\n * Provides cross-platform bin path lookup, command execution, and path normalization.\n */\n\nimport { getHome } from '#env/home'\nimport { getAppdata, getLocalappdata } from '#env/windows'\nimport { getXdgDataHome } from '#env/xdg'\n\nimport { WIN32 } from '#constants/platform'\nimport { readJsonSync } from './fs'\nimport { isPath, normalizePath } from './path'\nimport { spawn } from './spawn'\n\nlet _fs: typeof import('node:fs') | undefined\n/**\n * Lazily load the fs module to avoid Webpack errors.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getFs() {\n if (_fs === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _fs = /*@__PURE__*/ require('node:fs')\n }\n return _fs!\n}\n\nlet _path: typeof import('node:path') | undefined\n/**\n * Lazily load the path module to avoid Webpack errors.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getPath() {\n if (_path === undefined) {\n // Use non-'node:' prefixed require to avoid Webpack errors.\n\n _path = /*@__PURE__*/ require('node:path')\n }\n return _path!\n}\n\nlet _which: typeof import('which') | undefined\n/**\n * Lazily load the which module for finding executables.\n */\n/*@__NO_SIDE_EFFECTS__*/\nfunction getWhich() {\n if (_which === undefined) {\n _which = /*@__PURE__*/ require('./external/which')\n }\n return _which!\n}\n\n/**\n * Execute a binary with the given arguments.\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport async function execBin(\n binPath: string,\n args?: string[],\n options?: import('./spawn').SpawnOptions,\n) {\n // Resolve the binary path.\n const resolvedPath = isPath(binPath)\n ? resolveBinPathSync(binPath)\n : await whichBin(binPath)\n\n if (!resolvedPath) {\n const error = new Error(`Binary not found: ${binPath}`) as Error & {\n code: string\n }\n error.code = 'ENOENT'\n throw error\n }\n\n // Execute the binary directly.\n const binCommand = Array.isArray(resolvedPath)\n ? resolvedPath[0]!\n : resolvedPath\n // On Windows, binaries are often .cmd files that require shell to execute.\n return await spawn(binCommand, args ?? [], {\n shell: WIN32,\n ...options,\n })\n}\n\n/**\n * Options for the which function.\n */\nexport interface WhichOptions {\n /** If true, return all matches instead of just the first one. */\n all?: boolean | undefined\n /** If true, return null instead of throwing when no match is found. */\n nothrow?: boolean | undefined\n /** Path to search in. */\n path?: string | undefined\n /** Path separator character. */\n pathExt?: string | undefined\n /** Environment variables to use. */\n env?: Record<string, string | undefined> | undefined\n}\n\n/**\n * Find an executable in the system PATH asynchronously.\n * Wrapper around the which package for lazy loading.\n */\nexport async function which(\n binName: string,\n options?: WhichOptions,\n): Promise<string | string[] | undefined> {\n return await getWhich()(binName, options)\n}\n\n/**\n * Find an executable in the system PATH synchronously.\n * Wrapper around the which package for lazy loading.\n */\nexport function whichSync(\n binName: string,\n options?: WhichOptions,\n): string | string[] | undefined {\n return getWhich().sync(binName, options)\n}\n\n/**\n * Find and resolve a binary in the system PATH asynchronously.\n * @throws {Error} If the binary is not found and nothrow is false.\n */\nexport async function whichBin(\n binName: string,\n options?: WhichOptions,\n): Promise<string | string[] | undefined> {\n const which = getWhich()\n // Default to nothrow: true if not specified to return undefined instead of throwing\n const opts = { nothrow: true, ...options }\n // Depending on options `which` may throw if `binName` is not found.\n // With nothrow: true, it returns null when `binName` is not found.\n const result = await which(binName, opts)\n\n // When 'all: true' is specified, ensure we always return an array.\n if (opts?.all) {\n const paths = Array.isArray(result)\n ? result\n : typeof result === 'string'\n ? [result]\n : undefined\n // If all is true and we have paths, resolve each one.\n return paths?.length ? paths.map(p => resolveBinPathSync(p)) : paths\n }\n\n // If result is undefined (binary not found), return undefined\n if (!result) {\n return undefined\n }\n\n return resolveBinPathSync(result)\n}\n\n/**\n * Find and resolve a binary in the system PATH synchronously.\n * @throws {Error} If the binary is not found and nothrow is false.\n */\nexport function whichBinSync(\n binName: string,\n options?: WhichOptions,\n): string | string[] | undefined {\n // Default to nothrow: true if not specified to return undefined instead of throwing\n const opts = { nothrow: true, ...options }\n // Depending on options `which` may throw if `binName` is not found.\n // With nothrow: true, it returns null when `binName` is not found.\n const result = whichSync(binName, opts)\n\n // When 'all: true' is specified, ensure we always return an array.\n if (opts.all) {\n const paths = Array.isArray(result)\n ? result\n : typeof result === 'string'\n ? [result]\n : undefined\n // If all is true and we have paths, resolve each one.\n return paths?.length ? paths.map(p => resolveBinPathSync(p)) : paths\n }\n\n // If result is undefined (binary not found), return undefined\n if (!result) {\n return undefined\n }\n\n return resolveBinPathSync(result as string)\n}\n\n/**\n * Check if a directory path contains any shadow bin patterns.\n */\nexport function isShadowBinPath(dirPath: string | undefined): boolean {\n if (!dirPath) {\n return false\n }\n // Check for node_modules/.bin pattern (Unix and Windows)\n const normalized = dirPath.replace(/\\\\/g, '/')\n return normalized.includes('node_modules/.bin')\n}\n\n/**\n * Find the real executable for a binary, bypassing shadow bins.\n */\nexport function findRealBin(\n binName: string,\n commonPaths: string[] = [],\n): string | undefined {\n const fs = getFs()\n const path = getPath()\n const which = getWhich()\n\n // Try common locations first.\n for (const binPath of commonPaths) {\n if (fs?.existsSync(binPath)) {\n return binPath\n }\n }\n\n // Fall back to which.sync if no direct path found.\n const binPath = which?.sync(binName, { nothrow: true })\n if (binPath) {\n const binDir = path?.dirname(binPath)\n\n if (isShadowBinPath(binDir)) {\n // This is likely a shadowed binary, try to find the real one.\n const allPaths = which?.sync(binName, { all: true, nothrow: true }) || []\n // Ensure allPaths is an array.\n const pathsArray = Array.isArray(allPaths)\n ? allPaths\n : typeof allPaths === 'string'\n ? [allPaths]\n : []\n\n for (const altPath of pathsArray) {\n const altDir = path?.dirname(altPath)\n if (!isShadowBinPath(altDir)) {\n return altPath\n }\n }\n }\n return binPath\n }\n // If all else fails, return undefined to indicate binary not found.\n return undefined\n}\n\n/**\n * Find the real npm executable, bypassing any aliases and shadow bins.\n */\nexport function findRealNpm(): string {\n const fs = getFs()\n const path = getPath()\n\n // Try to find npm in the same directory as the node executable.\n const nodeDir = path?.dirname(process.execPath)\n const npmInNodeDir = path?.join(nodeDir, 'npm')\n\n if (fs?.existsSync(npmInNodeDir)) {\n return npmInNodeDir\n }\n\n // Try common npm locations.\n const commonPaths = ['/usr/local/bin/npm', '/usr/bin/npm']\n const result = findRealBin('npm', commonPaths)\n\n // If we found a valid path, return it.\n if (result && fs?.existsSync(result)) {\n return result\n }\n\n // As a last resort, try to use whichBinSync to find npm.\n // This handles cases where npm is installed in non-standard locations.\n const npmPath = whichBinSync('npm', { nothrow: true })\n if (npmPath && typeof npmPath === 'string' && fs?.existsSync(npmPath)) {\n return npmPath\n }\n\n // Return the basic 'npm' and let the system resolve it.\n return 'npm'\n}\n\n/**\n * Find the real pnpm executable, bypassing any aliases and shadow bins.\n */\nexport function findRealPnpm(): string {\n const path = getPath()\n\n // Try common pnpm locations.\n const commonPaths = WIN32\n ? [\n // Windows common paths.\n path?.join(getAppdata() as string, 'npm', 'pnpm.cmd'),\n path?.join(getAppdata() as string, 'npm', 'pnpm'),\n path?.join(getLocalappdata() as string, 'pnpm', 'pnpm.cmd'),\n path?.join(getLocalappdata() as string, 'pnpm', 'pnpm'),\n 'C:\\\\Program Files\\\\nodejs\\\\pnpm.cmd',\n 'C:\\\\Program Files\\\\nodejs\\\\pnpm',\n ].filter(Boolean)\n : [\n // Unix common paths.\n '/usr/local/bin/pnpm',\n '/usr/bin/pnpm',\n path?.join(\n (getXdgDataHome() as string) || `${getHome() as string}/.local/share`,\n 'pnpm/pnpm',\n ),\n path?.join(getHome() as string, '.pnpm/pnpm'),\n ].filter(Boolean)\n\n return findRealBin('pnpm', commonPaths) ?? ''\n}\n\n/**\n * Find the real yarn executable, bypassing any aliases and shadow bins.\n */\nexport function findRealYarn(): string {\n const path = getPath()\n\n // Try common yarn locations.\n const commonPaths = [\n '/usr/local/bin/yarn',\n '/usr/bin/yarn',\n path?.join(getHome() as string, '.yarn/bin/yarn'),\n path?.join(\n getHome() as string,\n '.config/yarn/global/node_modules/.bin/yarn',\n ),\n ].filter(Boolean)\n\n return findRealBin('yarn', commonPaths) ?? ''\n}\n\n/*@__NO_SIDE_EFFECTS__*/\n/**\n * Resolve a binary path to its actual executable file.\n * Handles Windows .cmd wrappers and Unix shell scripts.\n */\nexport function resolveBinPathSync(binPath: string): string {\n const fs = getFs()\n const path = getPath()\n\n // If it's not an absolute path, try to find it in PATH first\n if (!path?.isAbsolute(binPath)) {\n try {\n const resolved = whichBinSync(binPath)\n if (resolved) {\n binPath = resolved as string\n }\n } catch {}\n }\n\n // Normalize the path once for consistent pattern matching.\n binPath = normalizePath(binPath)\n\n // Handle empty string that normalized to '.' (current directory)\n if (binPath === '.') {\n return binPath\n }\n\n const ext = path?.extname(binPath)\n const extLowered = ext.toLowerCase()\n const basename = path?.basename(binPath, ext)\n const voltaIndex =\n basename === 'node' ? -1 : (/(?<=\\/)\\.volta\\//i.exec(binPath)?.index ?? -1)\n if (voltaIndex !== -1) {\n const voltaPath = binPath.slice(0, voltaIndex)\n const voltaToolsPath = path?.join(voltaPath, 'tools')\n const voltaImagePath = path?.join(voltaToolsPath, 'image')\n const voltaUserPath = path?.join(voltaToolsPath, 'user')\n const voltaPlatform = readJsonSync(\n path?.join(voltaUserPath, 'platform.json'),\n { throws: false },\n ) as any\n const voltaNodeVersion = voltaPlatform?.node?.runtime\n const voltaNpmVersion = voltaPlatform?.node?.npm\n let voltaBinPath = ''\n if (basename === 'npm' || basename === 'npx') {\n if (voltaNpmVersion) {\n const relCliPath = `bin/${basename}-cli.js`\n voltaBinPath = path?.join(\n voltaImagePath,\n `npm/${voltaNpmVersion}/${relCliPath}`,\n )\n if (voltaNodeVersion && !fs?.existsSync(voltaBinPath)) {\n voltaBinPath = path?.join(\n voltaImagePath,\n `node/${voltaNodeVersion}/lib/node_modules/npm/${relCliPath}`,\n )\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = ''\n }\n }\n }\n } else {\n const voltaUserBinPath = path?.join(voltaUserPath, 'bin')\n const binInfo = readJsonSync(\n path?.join(voltaUserBinPath, `${basename}.json`),\n { throws: false },\n ) as any\n const binPackage = binInfo?.package\n if (binPackage) {\n voltaBinPath = path?.join(\n voltaImagePath,\n `packages/${binPackage}/bin/${basename}`,\n )\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = `${voltaBinPath}.cmd`\n if (!fs?.existsSync(voltaBinPath)) {\n voltaBinPath = ''\n }\n }\n }\n }\n if (voltaBinPath) {\n try {\n return normalizePath(fs?.realpathSync.native(voltaBinPath))\n } catch {}\n return voltaBinPath\n }\n }\n if (WIN32) {\n const hasKnownExt =\n extLowered === '' ||\n extLowered === '.cmd' ||\n extLowered === '.exe' ||\n extLowered === '.ps1'\n const isNpmOrNpx = basename === 'npm' || basename === 'npx'\n const isPnpmOrYarn = basename === 'pnpm' || basename === 'yarn'\n if (hasKnownExt && isNpmOrNpx) {\n // The quick route assumes a bin path like: C:\\Program Files\\nodejs\\npm.cmd\n const quickPath = path?.join(\n path?.dirname(binPath),\n `node_modules/npm/bin/${basename}-cli.js`,\n )\n if (fs?.existsSync(quickPath)) {\n try {\n return fs?.realpathSync.native(quickPath)\n } catch {}\n return quickPath\n }\n }\n let relPath = ''\n if (\n hasKnownExt &&\n // Only parse shell scripts and batch files, not actual executables.\n // .exe files are already executables and don't need path resolution from wrapper scripts.\n extLowered !== '.exe' &&\n // Check if file exists before attempting to read it to avoid ENOENT errors.\n fs?.existsSync(binPath)\n ) {\n const source = fs?.readFileSync(binPath, 'utf8')\n if (isNpmOrNpx) {\n if (extLowered === '.cmd') {\n // \"npm.cmd\" and \"npx.cmd\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm.cmd\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx.cmd\n relPath =\n basename === 'npm'\n ? /(?<=\"NPM_CLI_JS=%~dp0\\\\).*(?=\")/.exec(source)?.[0] || ''\n : /(?<=\"NPX_CLI_JS=%~dp0\\\\).*(?=\")/.exec(source)?.[0] || ''\n } else if (extLowered === '') {\n // Extensionless \"npm\" and \"npx\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx\n relPath =\n basename === 'npm'\n ? /(?<=NPM_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] ||\n ''\n : /(?<=NPX_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] ||\n ''\n } else if (extLowered === '.ps1') {\n // \"npm.ps1\" and \"npx.ps1\" defined by\n // https://github.com/npm/cli/blob/v11.4.2/bin/npm.ps1\n // https://github.com/npm/cli/blob/v11.4.2/bin/npx.ps1\n relPath =\n basename === 'npm'\n ? /(?<=\\$NPM_CLI_JS=\"\\$PSScriptRoot\\/).*(?=\")/.exec(\n source,\n )?.[0] || ''\n : /(?<=\\$NPX_CLI_JS=\"\\$PSScriptRoot\\/).*(?=\")/.exec(\n source,\n )?.[0] || ''\n }\n } else if (isPnpmOrYarn) {\n if (extLowered === '.cmd') {\n // pnpm.cmd and yarn.cmd can have different formats depending on installation method\n // Common formats include:\n // 1. Setup-pnpm action format: node \"%~dp0\\..\\pnpm\\bin\\pnpm.cjs\" %*\n // 2. npm install -g pnpm format: similar to cmd-shim\n // 3. Standalone installer format: various patterns\n\n // Try setup-pnpm/setup-yarn action format first\n relPath =\n /(?<=node\\s+\")%~dp0\\\\([^\"]+)(?=\"\\s+%\\*)/.exec(source)?.[1] || ''\n\n // Try alternative format: \"%~dp0\\node.exe\" \"%~dp0\\..\\package\\bin\\binary.js\" %*\n if (!relPath) {\n relPath =\n /(?<=\"%~dp0\\\\[^\"]*node[^\"]*\"\\s+\")%~dp0\\\\([^\"]+)(?=\"\\s+%\\*)/.exec(\n source,\n )?.[1] || ''\n }\n\n // Try cmd-shim format as fallback\n if (!relPath) {\n relPath = /(?<=\"%dp0%\\\\).*(?=\" %\\*\\r\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '') {\n // Extensionless pnpm/yarn - try common shebang formats\n // Handle pnpm installed via standalone installer or global install\n // Format: exec \"$basedir/node\" \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n // Note: may have multiple spaces between arguments\n relPath =\n /(?<=\"\\$basedir\\/)\\.tools\\/pnpm\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(\n source,\n )?.[0] || ''\n if (!relPath) {\n // Also try: exec node \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n relPath =\n /(?<=exec\\s+node\\s+\"\\$basedir\\/)\\.tools\\/pnpm\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(\n source,\n )?.[0] || ''\n }\n if (!relPath) {\n // Try standard cmd-shim format: exec node \"$basedir/../package/bin/binary.js\" \"$@\"\n relPath = /(?<=\"\\$basedir\\/).*(?=\" \"\\$@\"\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '.ps1') {\n // PowerShell format\n relPath = /(?<=\"\\$basedir\\/).*(?=\" $args\\n)/.exec(source)?.[0] || ''\n }\n } else if (extLowered === '.cmd') {\n // \"bin.CMD\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L98:\n //\n // @ECHO off\n // GOTO start\n // :find_dp0\n // SET dp0=%~dp0\n // EXIT /b\n // :start\n // SETLOCAL\n // CALL :find_dp0\n //\n // IF EXIST \"%dp0%\\node.exe\" (\n // SET \"_prog=%dp0%\\node.exe\"\n // ) ELSE (\n // SET \"_prog=node\"\n // SET PATHEXT=%PATHEXT:;.JS;=;%\n // )\n //\n // endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & \"%_prog%\" \"%dp0%\\..\\<PACKAGE_NAME>\\path\\to\\bin.js\" %*\n relPath = /(?<=\"%dp0%\\\\).*(?=\" %\\*\\r\\n)/.exec(source)?.[0] || ''\n } else if (extLowered === '') {\n // Extensionless \"bin\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L138:\n //\n // #!/bin/sh\n // basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n //\n // case `uname` in\n // *CYGWIN*|*MINGW*|*MSYS*)\n // if command -v cygpath > /dev/null 2>&1; then\n // basedir=`cygpath -w \"$basedir\"`\n // fi\n // ;;\n // esac\n //\n // if [ -x \"$basedir/node\" ]; then\n // exec \"$basedir/node\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" \"$@\"\n // else\n // exec node \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" \"$@\"\n // fi\n relPath = /(?<=\"$basedir\\/).*(?=\" \"\\$@\"\\n)/.exec(source)?.[0] || ''\n } else if (extLowered === '.ps1') {\n // \"bin.PS1\" generated by\n // https://github.com/npm/cmd-shim/blob/v7.0.0/lib/index.js#L192:\n //\n // #!/usr/bin/env pwsh\n // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n //\n // $exe=\"\"\n // if ($PSVersionTable.PSVersion -lt \"6.0\" -or $IsWindows) {\n // # Fix case when both the Windows and Linux builds of Node\n // # are installed in the same directory\n // $exe=\".exe\"\n // }\n // $ret=0\n // if (Test-Path \"$basedir/node$exe\") {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"$basedir/node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // } else {\n // & \"$basedir/node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // } else {\n // # Support pipeline input\n // if ($MyInvocation.ExpectingInput) {\n // $input | & \"node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // } else {\n // & \"node$exe\" \"$basedir/../<PACKAGE_NAME>/path/to/bin.js\" $args\n // }\n // $ret=$LASTEXITCODE\n // }\n // exit $ret\n relPath = /(?<=\"\\$basedir\\/).*(?=\" $args\\n)/.exec(source)?.[0] || ''\n }\n if (relPath) {\n binPath = normalizePath(path?.resolve(path?.dirname(binPath), relPath))\n }\n }\n } else {\n // Handle Unix shell scripts (non-Windows platforms)\n let hasNoExt = extLowered === ''\n const isPnpmOrYarn = basename === 'pnpm' || basename === 'yarn'\n const isNpmOrNpx = basename === 'npm' || basename === 'npx'\n\n // Handle special case where pnpm path in CI has extra segments.\n // In setup-pnpm GitHub Action, the path might be malformed like:\n // /home/user/setup-pnpm/node_modules/.bin/pnpm/bin/pnpm.cjs\n // This happens when the shell script contains a relative path that\n // when resolved, creates an invalid nested structure.\n if (isPnpmOrYarn && binPath.includes('/.bin/pnpm/bin/')) {\n // Extract the correct pnpm bin path.\n const binIndex = binPath.indexOf('/.bin/pnpm')\n if (binIndex !== -1) {\n // Get the base path up to /.bin/pnpm.\n const baseBinPath = binPath.slice(0, binIndex + '/.bin/pnpm'.length)\n // Check if the original shell script exists.\n try {\n const stats = fs?.statSync(baseBinPath)\n // Only use this path if it's a file (the shell script).\n if (stats.isFile()) {\n binPath = normalizePath(baseBinPath)\n // Recompute hasNoExt since we changed the path.\n hasNoExt = !path?.extname(binPath)\n }\n } catch {\n // If stat fails, continue with the original path.\n }\n }\n }\n\n if (\n hasNoExt &&\n (isPnpmOrYarn || isNpmOrNpx) &&\n // For extensionless files (Unix shell scripts), verify existence before reading.\n // This prevents ENOENT errors when the bin path doesn't exist.\n fs?.existsSync(binPath)\n ) {\n const source = fs?.readFileSync(binPath, 'utf8')\n let relPath = ''\n\n if (isPnpmOrYarn) {\n // Handle pnpm/yarn Unix shell scripts.\n // Format: exec \"$basedir/node\" \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n // or: exec node \"$basedir/.tools/pnpm/VERSION/...\" \"$@\"\n relPath =\n /(?<=\"\\$basedir\\/)\\.tools\\/[^\"]+(?=\"\\s+\"\\$@\")/.exec(source)?.[0] || ''\n if (!relPath) {\n // Try standard cmd-shim format: exec node \"$basedir/../package/bin/binary.js\" \"$@\"\n // Example: exec node \"$basedir/../pnpm/bin/pnpm.cjs\" \"$@\"\n // ^^^^^^^^^^^^^^^^^^^^^ captures this part\n // This regex needs to be more careful to not match \"$@\" at the end.\n relPath =\n /(?<=\"\\$basedir\\/)[^\"]+(?=\"\\s+\"\\$@\")/.exec(source)?.[0] || ''\n }\n // Special case for setup-pnpm GitHub Action which may use a different format.\n // The setup-pnpm action creates a shell script that references ../pnpm/bin/pnpm.cjs\n if (!relPath) {\n // Try to match: exec node \"$basedir/../pnpm/bin/pnpm.cjs\" \"$@\"\n const match = /exec\\s+node\\s+\"?\\$basedir\\/([^\"]+)\"?\\s+\"\\$@\"/.exec(\n source,\n )\n if (match) {\n relPath = match[1] || ''\n }\n }\n // Check if the extracted path looks wrong (e.g., pnpm/bin/pnpm.cjs without ../).\n // This happens with setup-pnpm action when it creates a malformed shell script.\n if (relPath && basename === 'pnpm' && relPath.startsWith('pnpm/')) {\n // The path should be ../pnpm/... not pnpm/...\n // Prepend ../ to fix the relative path.\n relPath = `../${relPath}`\n }\n } else if (isNpmOrNpx) {\n // Handle npm/npx Unix shell scripts\n relPath =\n basename === 'npm'\n ? /(?<=NPM_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] || ''\n : /(?<=NPX_CLI_JS=\"\\$CLI_BASEDIR\\/).*(?=\")/.exec(source)?.[0] || ''\n }\n\n if (relPath) {\n // Resolve the relative path to handle .. segments properly.\n binPath = normalizePath(path?.resolve(path?.dirname(binPath), relPath))\n }\n }\n }\n try {\n const realPath = fs?.realpathSync.native(binPath)\n return normalizePath(realPath)\n } catch {}\n // Return normalized path even if realpath fails.\n return normalizePath(binPath)\n}\n"],
5
+ "mappings": ";4ZAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,gBAAAC,EAAA,gBAAAC,EAAA,iBAAAC,EAAA,iBAAAC,EAAA,oBAAAC,EAAA,uBAAAC,EAAA,UAAAC,EAAA,aAAAC,EAAA,iBAAAC,EAAA,cAAAC,IAAA,eAAAC,EAAAb,GAKA,IAAAc,EAAwB,qB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AAWb,CAAO,EACtB,CACA,MAAM4C,EAAS/B,GAAI,aAAab,EAAS,MAAM,EAC/C,IAAI2C,EAAU,GAEd,GAAIF,EAAc,CAgBhB,GAZAE,EACE,+CAA+C,KAAKC,CAAM,IAAI,CAAC,GAAK,GACjED,IAKHA,EACE,sCAAsC,KAAKC,CAAM,IAAI,CAAC,GAAK,IAI3D,CAACD,EAAS,CAEZ,MAAMK,EAAQ,+CAA+C,KAC3DJ,CACF,EACII,IACFL,EAAUK,EAAM,CAAC,GAAK,GAE1B,CAGIL,GAAWjB,IAAa,QAAUiB,EAAQ,WAAW,OAAO,IAG9DA,EAAU,MAAMA,CAAO,GAE3B,MAAWH,IAETG,EACEjB,IAAa,MACT,0CAA0C,KAAKkB,CAAM,IAAI,CAAC,GAAK,GAC/D,0CAA0C,KAAKA,CAAM,IAAI,CAAC,GAAK,IAGnED,IAEF3C,KAAU,iBAAcc,GAAM,QAAQA,GAAM,QAAQd,CAAO,EAAG2C,CAAO,CAAC,EAE1E,CACF,CACA,GAAI,CACF,MAAMM,EAAWpC,GAAI,aAAa,OAAOb,CAAO,EAChD,SAAO,iBAAciD,CAAQ,CAC/B,MAAQ,CAAC,CAET,SAAO,iBAAcjD,CAAO,CAC9B",
6
+ "names": ["bin_exports", "__export", "execBin", "findRealBin", "findRealNpm", "findRealPnpm", "findRealYarn", "isShadowBinPath", "resolveBinPathSync", "which", "whichBin", "whichBinSync", "whichSync", "__toCommonJS", "import_home", "import_windows", "import_xdg", "import_platform", "import_fs", "import_path", "import_spawn", "_fs", "getFs", "_path", "getPath", "_which", "getWhich", "binPath", "args", "options", "resolvedPath", "error", "binCommand", "binName", "opts", "result", "paths", "p", "dirPath", "commonPaths", "fs", "path", "binDir", "allPaths", "pathsArray", "altPath", "altDir", "nodeDir", "npmInNodeDir", "npmPath", "resolved", "ext", "extLowered", "basename", "voltaIndex", "voltaPath", "voltaToolsPath", "voltaImagePath", "voltaUserPath", "voltaPlatform", "voltaNodeVersion", "voltaNpmVersion", "voltaBinPath", "relCliPath", "voltaUserBinPath", "binPackage", "hasKnownExt", "isNpmOrNpx", "isPnpmOrYarn", "quickPath", "relPath", "source", "hasNoExt", "binIndex", "baseBinPath", "match", "realPath"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/lib",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "license": "MIT",
5
5
  "description": "Core utilities and infrastructure for Socket.dev security tools",
6
6
  "keywords": [