You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lossless-cut/.yarn/plugins/@yarnpkg/plugin-licenses.cjs

34 lines
37 KiB
JavaScript

/* eslint-disable */
//prettier-ignore
module.exports = {
name: "@yarnpkg/plugin-licenses",
factory: function (require) {
3 years ago
"use strict";var plugin=(()=>{var se=Object.create;var et=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var re=Object.getOwnPropertyNames;var oe=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var x=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(t,e)=>(typeof require<"u"?require:t)[e]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var X=(i,t)=>()=>(t||i((t={exports:{}}).exports,t),t.exports),it=(i,t)=>{for(var e in t)et(i,e,{get:t[e],enumerable:!0})},At=(i,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of re(t))!ae.call(i,n)&&n!==e&&et(i,n,{get:()=>t[n],enumerable:!(s=ne(t,n))||s.enumerable});return i};var le=(i,t,e)=>(e=i!=null?se(oe(i)):{},At(t||!i||!i.__esModule?et(e,"default",{value:i,enumerable:!0}):e,i)),ce=i=>At(et({},"__esModule",{value:!0}),i);var Ft=(i,t,e)=>{if(!t.has(i))throw TypeError("Cannot "+e)};var E=(i,t,e)=>(Ft(i,t,"read from private field"),e?e.call(i):t.get(i)),st=(i,t,e)=>{if(t.has(i))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(i):t.set(i,e)};var P=(i,t,e)=>(Ft(i,t,"access private method"),e);var It=X((Ne,Et)=>{var Q=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,he=typeof AbortController=="function",nt=he?AbortController:class{constructor(){this.signal=new _t}abort(t=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||t,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},de=typeof AbortSignal=="function",fe=typeof nt.AbortSignal=="function",_t=de?AbortSignal:fe?nt.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(t){t.type==="abort"&&(this.aborted=!0,this.onabort(t),this._listeners.forEach(e=>e(t),this))}onabort(){}addEventListener(t,e){t==="abort"&&this._listeners.push(e)}removeEventListener(t,e){t==="abort"&&(this._listeners=this._listeners.filter(s=>s!==e))}},gt=new Set,pt=(i,t)=>{let e=`LRU_CACHE_OPTION_${i}`;rt(e)&&yt(e,`${i} option`,`options.${t}`,_)},ut=(i,t)=>{let e=`LRU_CACHE_METHOD_${i}`;if(rt(e)){let{prototype:s}=_,{get:n}=Object.getOwnPropertyDescriptor(s,i);yt(e,`${i} method`,`cache.${t}()`,n)}},pe=(i,t)=>{let e=`LRU_CACHE_PROPERTY_${i}`;if(rt(e)){let{prototype:s}=_,{get:n}=Object.getOwnPropertyDescriptor(s,i);yt(e,`${i} property`,`cache.${t}`,n)}},zt=(...i)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...i):console.error(...i)},rt=i=>!gt.has(i),yt=(i,t,e,s)=>{gt.add(i);let n=`The ${t} is deprecated. Please use ${e} instead.`;zt(n,"DeprecationWarning",i,s)},I=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Ot=i=>I(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?H:null:null,H=class extends Array{constructor(t){super(t),this.fill(0)}},mt=class{constructor(t){if(t===0)return[];let e=Ot(t);this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}},_=class{constructor(t={}){let{max:e=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:u,dispose:h,disposeAfter:l,noDisposeOnSet:g,noUpdateTTL:c,maxSize:f=0,maxEntrySize:y=0,sizeCalculation:d,fetchMethod:p,fetchContext:k,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:$,allowStaleOnFetchRejection:w,allowStaleOnFetchAbort:D,ignoreFetchAbort:z}=t,{length:O,maxAge:j,stale:K}=t instanceof _?{}:t;if(e!==0&&!I(e))throw new TypeError("max option must be a nonnegative integer");let dt=e?Ot(e):Array;if(!dt)throw new Error("invalid max value: "+e);if(this.max=e,this.maxSize=f,this.maxEntrySize=y||this.maxSize,this.sizeCalculation=d||O,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMet
NOTICE
3 years ago
${p}`:y,A=o.get(k);A?A.set(l.name,l):o.set(k,new Map([[l.name,l]]))}let a=`THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED IN PORTIONS OF THE ${String(i.topLevelWorkspace.manifest.raw.name).toUpperCase().replace(/-/g," ")} PRODUCT.
3 years ago
`;for(let[u,h]of o.entries()){a+=`-----
3 years ago
`;let l=[],g=[];for(let{name:f,repository:y}of h.values()){l.push(f);let d=Zt(y);d&&g.push(h.size===1?d:`${d} (${f})`)}let c=[];c.push(`The following software may be included in this product: ${l.join(", ")}.`),g.length>0&&c.push(`A copy of the source code may be downloaded from ${g.join(", ")}.`),c.push("This software contains the following license and notice below:"),a+=`${c.join(" ")}
3 years ago
`,a+=`${u.trim()}
3 years ago
`}return a};var q=class extends W.Command{constructor(){super(...arguments);this.recursive=W.Option.Boolean("-R,--recursive",!1,{description:"Include transitive dependencies (dependencies of direct dependencies)"});this.production=W.Option.Boolean("--production",!1,{description:"Exclude development dependencies"});this.json=W.Option.Boolean("--json",!1,{description:"Format output as JSON"});this.excludeMetadata=W.Option.Boolean("--exclude-metadata",!1,{description:"Exclude dependency metadata from output"})}async execute(){let e=await Y.Configuration.find(this.context.cwd,this.context.plugins),{project:s,workspace:n}=await Y.Project.find(e,this.context.cwd);if(!n)throw new ee.WorkspaceRequiredError(s.cwd,this.context.cwd);await s.restoreInstallState();let r=await Kt(s,this.json,this.recursive,this.production,this.excludeMetadata);Y.treeUtils.emitTree(r,{configuration:e,stdout:this.context.stdout,json:this.json,separators:1})}};q.paths=[["licenses","list"]],q.usage=W.Command.Usage({description:"display the licenses for all packages in the project",details:`
This command prints the license information for packages in the project. By default, only direct dependencies are listed.
If \`-R,--recursive\` is set, the listing will include transitive dependencies (dependencies of direct dependencies).
If \`--production\` is set, the listing will exclude development dependencies.
3 years ago
`,examples:[["List all licenses of direct dependencies","$0 licenses list"],["List all licenses of direct and transitive dependencies","$0 licenses list --recursive"],["List all licenses of production dependencies only","$0 licenses list --production"]]});var ie=x("@yarnpkg/cli"),ht=x("@yarnpkg/core"),J=x("clipanion");var G=class extends J.Command{constructor(){super(...arguments);this.recursive=J.Option.Boolean("-R,--recursive",!1,{description:"Include transitive dependencies (dependencies of direct dependencies)"});this.production=J.Option.Boolean("--production",!1,{description:"Exclude development dependencies"})}async execute(){let e=await ht.Configuration.find(this.context.cwd,this.context.plugins),{project:s,workspace:n}=await ht.Project.find(e,this.context.cwd);if(!n)throw new ie.WorkspaceRequiredError(s.cwd,this.context.cwd);await s.restoreInstallState();let r=await te(s,this.recursive,this.production);this.context.stdout.write(r)}};G.paths=[["licenses","generate-disclaimer"]],G.usage=J.Command.Usage({description:"display the license disclaimer including all packages in the project",details:`
This command prints the license disclaimer for packages in the project. By default, only direct dependencies are listed.
If \`-R,--recursive\` is set, the disclaimer will include transitive dependencies (dependencies of direct dependencies).
If \`--production\` is set, the disclaimer will exclude development dependencies.
3 years ago
`,examples:[["Include licenses of direct dependencies","$0 licenses generate-disclaimer"],["Include licenses of direct and transitive dependencies","$0 licenses generate-disclaimer --recursive"],["Include licenses of production dependencies only","$0 licenses list --production"]]});var Ce={commands:[q,G]},Me=Ce;return ce(Ue);})();
return plugin;
}
};