+var plugin=(()=>{var a=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var y=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(n,t)=>(typeof require<"u"?require:n)[t]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var g=(e,n)=>{for(var t in n)a(e,t,{get:n[t],enumerable:!0})},m=(e,n,t,d)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of c(n))!f.call(e,i)&&i!==t&&a(e,i,{get:()=>n[i],enumerable:!(d=p(n,i))||d.enumerable});return e};var b=e=>m(a({},"__esModule",{value:!0}),e);var h={};g(h,{default:()=>P});var s=y("@yarnpkg/shell"),r=["always","dependabot-only","never"],w={configuration:{dedupePluginMode:{type:"string",default:"always",description:"When to deduplicate packages. `always` deduplicates all packages after any install command. `dependabot-only` deduplicates only packages that are updated by Dependabot via GitHub Actions. `never` disables auto-deduplication.",choices:r}},hooks:{afterAllInstalled:async(e,n)=>{if(["immutable"].some(l=>n[l]))return;let d=k();if(["dedupe","dlx","link","unlink"].includes(d))return;let o=e.configuration.get("dedupePluginMode");if(!M(o))throw new Error(`Invalid dedupePluginMode: ${o}. Must be one of: ${r.join(", ")}`);if(o!=="never"){if(o==="always"){await u();return}if(o==="dependabot-only"){process.env.DEPENDABOT==="true"&&await u();return}}}}};async function u(){await(0,s.execute)("yarn dedupe --check")&&await(0,s.execute)("yarn dedupe")}function M(e){return typeof e=="string"&&r.includes(e)}function k(){let e=process.argv,n=e.findIndex((t,d)=>d>0&&(t.includes("yarn")||t.endsWith(".js")));return e.slice(n+1).find(t=>!t.startsWith("-"))??"install"}var P=w;return b(h);})();
0 commit comments