fxa/.yarn/plugins/@yarnpkg/plugin-relock.js

10 строки
2.4 KiB
JavaScript

/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-relock",
factory: function (require) {
var plugin=(()=>{var C=Object.create,f=Object.defineProperty;var L=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var P=Object.getPrototypeOf,v=Object.prototype.hasOwnProperty;var H=t=>f(t,"__esModule",{value:!0});var h=t=>{if(typeof require!="undefined")return require(t);throw new Error('Dynamic require of "'+t+'" is not supported')};var R=(t,s)=>{for(var r in s)f(t,r,{get:s[r],enumerable:!0})},W=(t,s,r)=>{if(s&&typeof s=="object"||typeof s=="function")for(let a of y(s))!v.call(t,a)&&a!=="default"&&f(t,a,{get:()=>s[a],enumerable:!(r=L(s,a))||r.enumerable});return t},l=t=>W(H(f(t!=null?C(P(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var b={};R(b,{default:()=>T});var k=l(h("@yarnpkg/cli")),o=l(h("@yarnpkg/core")),p=l(h("clipanion")),u=class extends p.Command{async execute(){let s=await o.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:a}=await o.Project.find(s,this.context.cwd);if(!a)throw new k.WorkspaceRequiredError(r.cwd,this.context.cwd);let d=await o.Cache.find(s);await r.resolveEverything({cache:d,report:new o.ThrowReport});try{let m=Array.from(new Set(o.miscUtils.sortMap(r.storedResolutions.values(),[c=>{let e=r.storedPackages.get(c);if(!e)throw new Error("Assertion failed: The locator should have been registered");return o.structUtils.stringifyLocator(e)}]))).filter(c=>{if(r.storedChecksums.has(c))return!1;let e=r.storedPackages.get(c);if(e.conditions||e.reference.includes("workspace:"))return!1;if(e.reference.startsWith("virtual")){let n=e.reference.slice(e.reference.indexOf("#")+1);e=o.structUtils.makeLocator(e,n)}return!r.storedChecksums.has(e.locatorHash)}),g=s.makeFetcher(),w=async(c,e,n)=>{let i=await g.fetch(c,{checksums:e,project:r,cache:d,fetcher:g,report:new o.ThrowReport});return i.checksum||n?i:(await new Promise(x=>setTimeout(x,500)),await w(c,e,!0))};for(let c of m){let e=r.storedPackages.get(c);if(e.reference.startsWith("virtual")){let i=e.reference.slice(e.reference.indexOf("#")+1);e=o.structUtils.makeLocator(e,i)}console.error("fetching",e.name);let n=await w(e,r.storedChecksums);n.checksum&&r.storedChecksums.set(e.locatorHash,n.checksum)}}catch(m){}await r.persistLockfile()}};u.paths=[["relock"]];var E={commands:[u]},T=E;return b;})();
return plugin;
}
};