var h=Object.defineProperty;var f=(r,n)=>h(r,"name",{value:n,configurable:!0});import{M as m,l as k,B as v}from"./readFileSync-DseCu8sg-DEq4Fn3a.js";import{s as M}from"../packem_chunks/config.js";import{whichBin as b}from"#native";var $=Object.defineProperty,g=f((r,n)=>$(r,"name",{value:n,configurable:!0}),"p");const j=g(r=>{for(const n of[".nvmrc",".node-version"]){const i=m(r,n);if(k(i))try{return v(i).trim().replace(/^v/,"")}catch{}}},"readNodeVersionFile"),l=g((r,n)=>{const i=r.split(/[.\-+]/).map(s=>Number.parseInt(s,10)||0),o=n.split(/[.\-+]/).map(s=>Number.parseInt(s,10)||0),e=Math.max(i.length,o.length);for(let s=0;s<e;s++){const t=i[s]??0,a=o[s]??0;if(t!==a)return t-a}return 0},"compareVersions"),y=g((r,n)=>{const i=n.trim();if(i===""||i==="*")return!0;const o=i.split(/\s+/).filter(Boolean);for(const e of o)if(e.startsWith(">=")){if(l(r,e.slice(2).trim())<0)return!1}else if(e.startsWith("<=")){if(l(r,e.slice(2).trim())>0)return!1}else if(e.startsWith(">")){if(l(r,e.slice(1).trim())<=0)return!1}else if(e.startsWith("<")){if(l(r,e.slice(1).trim())>=0)return!1}else if(/^\d/.test(e)){const s=r.split("."),t=e.split(".");for(const[a,c]of t.entries())if(c!==s[a])return!1}return!0},"satisfiesRange"),V=g(r=>{const n=[],i=m(r,"package.json");let o;try{o=M(i)}catch{return n}const e=process.versions.node;if(o.engines?.node){const t=o.engines.node;y(e,t)||n.push({actual:e,expected:t,kind:"node",message:`package.json engines.node requires ${t}, but the current Node.js is ${e}.`,severity:"error"})}const s=j(r);if(s){const[t,a]=s.split("."),[c,p]=e.split(".");(t!==c||a!==void 0&&a!==p)&&n.push({actual:e,expected:s,kind:"node",message:`.nvmrc pins Node ${s} but the current Node.js is ${e}. Run \`nvm use\` or switch runtimes.`,severity:"warning"})}if(o.packageManager){const[t,a]=o.packageManager.split("@"),c=(process.env.npm_config_user_agent??"").split(" ")[0]??"",[p,u]=c.split("/"),d=t==="aube"&&b("aube")!==null;p&&t&&p!==t?n.push({actual:p,expected:t,kind:"packageManager",message:`package.json packageManager pins ${o.packageManager} but the current invocation is ${c}. Install the correct package manager.`,severity:d?"warning":"error"}):u&&a&&u!==a&&n.push({actual:u,expected:a,kind:"packageManager",message:`package.json packageManager pins ${t}@${a} but the current invocation uses ${t}@${u}.`,severity:"warning"})}return n},"checkRuntimeVersions");export{V as c};
