mirror of https://github.com/grafana/grafana.git
50 lines
42 KiB
JavaScript
50 lines
42 KiB
JavaScript
/* eslint-disable */
|
|
//prettier-ignore
|
|
module.exports = {
|
|
name: "@yarnpkg/plugin-licenses",
|
|
factory: function (require) {
|
|
"use strict";var plugin=(()=>{var ct=Object.create;var re=Object.defineProperty;var lt=Object.getOwnPropertyDescriptor;var ht=Object.getOwnPropertyNames;var dt=Object.getPrototypeOf,ft=Object.prototype.hasOwnProperty;var $=(i=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(i,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):i)(function(i){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+i+'" is not supported')});var te=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),oe=(i,e)=>{for(var t in e)re(i,t,{get:e[t],enumerable:!0})},Ee=(i,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of ht(e))!ft.call(i,n)&&n!==t&&re(i,n,{get:()=>e[n],enumerable:!(s=lt(e,n))||s.enumerable});return i};var pt=(i,e,t)=>(t=i!=null?ct(dt(i)):{},Ee(e||!i||!i.__esModule?re(t,"default",{value:i,enumerable:!0}):t,i)),ut=i=>Ee(re({},"__esModule",{value:!0}),i);var Ie=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)};var C=(i,e,t)=>(Ie(i,e,"read from private field"),t?t.call(i):e.get(i)),ae=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)};var x=(i,e,t)=>(Ie(i,e,"access private method"),t);var je=te((Yt,We)=>{var ie=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,mt=typeof AbortController=="function",ce=mt?AbortController:class{constructor(){this.signal=new Ce}abort(e=new Error("This operation was aborted")){this.signal.reason=this.signal.reason||e,this.signal.aborted=!0,this.signal.dispatchEvent({type:"abort",target:this.signal})}},gt=typeof AbortSignal=="function",wt=typeof ce.AbortSignal=="function",Ce=gt?AbortSignal:wt?ce.AbortController:class{constructor(){this.reason=void 0,this.aborted=!1,this._listeners=[]}dispatchEvent(e){e.type==="abort"&&(this.aborted=!0,this.onabort(e),this._listeners.forEach(t=>t(e),this))}onabort(){}addEventListener(e,t){e==="abort"&&this._listeners.push(t)}removeEventListener(e,t){e==="abort"&&(this._listeners=this._listeners.filter(s=>s!==t))}},ke=new Set,ye=(i,e)=>{let t=`LRU_CACHE_OPTION_${i}`;le(t)&&ve(t,`${i} option`,`options.${e}`,z)},be=(i,e)=>{let t=`LRU_CACHE_METHOD_${i}`;if(le(t)){let{prototype:s}=z,{get:n}=Object.getOwnPropertyDescriptor(s,i);ve(t,`${i} method`,`cache.${e}()`,n)}},yt=(i,e)=>{let t=`LRU_CACHE_PROPERTY_${i}`;if(le(t)){let{prototype:s}=z,{get:n}=Object.getOwnPropertyDescriptor(s,i);ve(t,`${i} property`,`cache.${e}`,n)}},Me=(...i)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...i):console.error(...i)},le=i=>!ke.has(i),ve=(i,e,t,s)=>{ke.add(i);let n=`The ${e} is deprecated. Please use ${t} instead.`;Me(n,"DeprecationWarning",i,s)},M=i=>i&&i===Math.floor(i)&&i>0&&isFinite(i),Ue=i=>M(i)?i<=Math.pow(2,8)?Uint8Array:i<=Math.pow(2,16)?Uint16Array:i<=Math.pow(2,32)?Uint32Array:i<=Number.MAX_SAFE_INTEGER?V:null:null,V=class extends Array{constructor(e){super(e),this.fill(0)}},$e=class{constructor(e){if(e===0)return[];let t=Ue(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},z=class{constructor(e={}){let{max:t=0,ttl:s,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:f,dispose:c,disposeAfter:l,noDisposeOnSet:g,noUpdateTTL:h,maxSize:p=0,maxEntrySize:y=0,sizeCalculation:d,fetchMethod:u,fetchContext:P,noDeleteOnFetchRejection:F,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:D,ignoreFetchAbort:E}=e,{length:I,maxAge:R,stale:ee}=e instanceof z?{}:e;if(t!==0&&!M(t))throw new TypeError("max option must be a nonnegative integer");let ge=t?Ue(t):Array;if(!ge)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=p,this.maxEntrySize=y||this.maxSize,this.sizeCalculation=d||I,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.fetchMethod=u||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=P,!this.fetchMethod&&P!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new ge(t),this.prev=new ge(t),this.head=0,this.tail=0,this.free=new $e(t),this.initialFill=1,this.size=0,typeof c=="function"&&(this.dispose=c),typeof l=="function"?(this.disposeAfter=l,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!g,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!F,this.allowStaleOnFetchRejection=!!b,this.allowStaleOnFetchAbort=!!D,this.ignoreFetchAbort=!!E,this.maxEntrySize!==0){if(this.maxSize!==0&&!M(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!M(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!f||!!ee,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=M(n)||n===0?n:1,this.ttlAutopurge=!!r,this.ttl=s||R||0,this.ttl){if(!M(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){let we="LRU_CACHE_UNBOUNDED";le(we)&&(ke.add(we),Me("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",we,z))}ee&&ye("stale","allowStale"),R&&ye("maxAge","ttl"),I&&ye("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new V(this.max),this.starts=new V(this.max),this.setItemTTL=(s,n,r=ie.now())=>{if(this.starts[s]=n!==0?r:0,this.ttls[s]=n,n!==0&&this.ttlAutopurge){let o=setTimeout(()=>{this.isStale(s)&&this.delete(this.keyList[s])},n+1);o.unref&&o.unref()}},this.updateItemAge=s=>{this.starts[s]=this.ttls[s]!==0?ie.now():0},this.statusTTL=(s,n)=>{s&&(s.ttl=this.ttls[n],s.start=this.starts[n],s.now=e||t(),s.remainingTTL=s.now+s.ttl-s.start)};let e=0,t=()=>{let s=ie.now();if(this.ttlResolution>0){e=s;let n=setTimeout(()=>e=0,this.ttlResolution);n.unref&&n.unref()}return s};this.getRemainingTTL=s=>{let n=this.keyMap.get(s);return n===void 0?0:this.ttls[n]===0||this.starts[n]===0?1/0:this.starts[n]+this.ttls[n]-(e||t())},this.isStale=s=>this.ttls[s]!==0&&this.starts[s]!==0&&(e||t())-this.starts[s]>this.ttls[s]}updateItemAge(e){}statusTTL(e,t){}setItemTTL(e,t,s){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new V(this.max),this.removeItemSize=e=>{this.calculatedSize-=this.sizes[e],this.sizes[e]=0},this.requireSize=(e,t,s,n)=>{if(this.isBackgroundFetch(t))return 0;if(!M(s))if(n){if(typeof n!="function")throw new TypeError("sizeCalculation must be a function");if(s=n(t,e),!M(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.addItemSize=(e,t,s)=>{if(this.sizes[e]=t,this.maxSize){let n=this.maxSize-this.sizes[e];for(;this.calculatedSize>n;)this.evict(!0)}this.calculatedSize+=this.sizes[e],s&&(s.entrySize=t,s.totalCalculatedSize=this.calculatedSize)}}removeItemSize(e){}addItemSize(e,t){}requireSize(e,t,s,n){if(s||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.tail;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.head));)t=this.prev[t]}*rindexes({allowStale:e=this.allowStale}={}){if(this.size)for(let t=this.head;!(!this.isValidIndex(t)||((e||!this.isStale(t))&&(yield t),t===this.tail));)t=this.next[t]}isValidIndex(e){return e!==void 0&&this.keyMap.get(this.keyList[e])===e}*entries(){for(let e of this.indexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*rentries(){for(let e of this.rindexes())this.valList[e]!==void 0&&this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield[this.keyList[e],this.valList[e]])}*keys(){for(let e of this.indexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*rkeys(){for(let e of this.rindexes())this.keyList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.keyList[e])}*values(){for(let e of this.indexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}*rvalues(){for(let e of this.rindexes())this.valList[e]!==void 0&&!this.isBackgroundFetch(this.valList[e])&&(yield this.valList[e])}[Symbol.iterator](){return this.entries()}find(e,t){for(let s of this.indexes()){let n=this.valList[s],r=this.isBackgroundFetch(n)?n.__staleWhileFetching:n;if(r!==void 0&&e(r,this.keyList[s],this))return this.get(this.keyList[s],t)}}forEach(e,t=this){for(let s of this.indexes()){let n=this.valList[s],r=this.isBackgroundFetch(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(t,r,this.keyList[s],this)}}rforEach(e,t=this){for(let s of this.rindexes()){let n=this.valList[s],r=this.isBackgroundFetch(n)?n.__staleWhileFetching:n;r!==void 0&&e.call(t,r,this.keyList[s],this)}}get prune(){return be("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(let t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){let e=[];for(let t of this.indexes({allowStale:!0})){let s=this.keyList[t],n=this.valList[t],r=this.isBackgroundFetch(n)?n.__staleWhileFetching:n;if(r===void 0)continue;let o={value:r};if(this.ttls){o.ttl=this.ttls[t];let a=ie.now()-this.starts[t];o.start=Math.floor(Date.now()-a)}this.sizes&&(o.size=this.sizes[t]),e.unshift([s,o])}return e}load(e){this.clear();for(let[t,s]of e){if(s.start){let n=Date.now()-s.start;s.start=ie.now()-n}this.set(t,s.value,s)}}dispose(e,t,s){}set(e,t,{ttl:s=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,size:o=0,sizeCalculation:a=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,status:c}={}){if(o=this.requireSize(e,t,o,a),this.maxEntrySize&&o>this.maxEntrySize)return c&&(c.set="miss",c.maxEntrySizeExceeded=!0),this.delete(e),this;let l=this.size===0?void 0:this.keyMap.get(e);if(l===void 0)l=this.newIndex(),this.keyList[l]=e,this.valList[l]=t,this.keyMap.set(e,l),this.next[this.tail]=l,this.prev[l]=this.tail,this.tail=l,this.size++,this.addItemSize(l,o,c),c&&(c.set="add"),f=!1;else{this.moveToTail(l);let g=this.valList[l];if(t!==g){if(this.isBackgroundFetch(g)?g.__abortController.abort(new Error("replaced")):r||(this.dispose(g,e,"set"),this.disposeAfter&&this.disposed.push([g,e,"set"])),this.removeItemSize(l),this.valList[l]=t,this.addItemSize(l,o,c),c){c.set="replace";let h=g&&this.isBackgroundFetch(g)?g.__staleWhileFetching:g;h!==void 0&&(c.oldValue=h)}}else c&&(c.set="update")}if(s!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),f||this.setItemTTL(l,s,n),this.statusTTL(c,l),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){let e=this.valList[this.head];return this.evict(!0),e}}evict(e){let t=this.head,s=this.keyList[t],n=this.valList[t];return this.isBackgroundFetch(n)?n.__abortController.abort(new Error("evicted")):(this.dispose(n,s,"evict"),this.disposeAfter&&this.disposed.push([n,s,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(s),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas,status:s}={}){let n=this.keyMap.get(e);if(n!==void 0)if(this.isStale(n))s&&(s.has="stale",this.statusTTL(s,n));else return t&&this.updateItemAge(n),s&&(s.has="hit"),this.statusTTL(s,n),!0;else s&&(s.has="miss");return!1}peek(e,{allowStale:t=this.allowStale}={}){let s=this.keyMap.get(e);if(s!==void 0&&(t||!this.isStale(s))){let n=this.valList[s];return this.isBackgroundFetch(n)?n.__staleWhileFetching:n}}backgroundFetch(e,t,s,n){let r=t===void 0?void 0:this.valList[t];if(this.isBackgroundFetch(r))return r;let o=new ce;s.signal&&s.signal.addEventListener("abort",()=>o.abort(s.signal.reason));let a={signal:o.signal,options:s,context:n},f=(p,y=!1)=>{let{aborted:d}=o.signal,u=s.ignoreFetchAbort&&p!==void 0;return s.status&&(d&&!y?(s.status.fetchAborted=!0,s.status.fetchError=o.signal.reason,u&&(s.status.fetchAbortIgnored=!0)):s.status.fetchResolved=!0),d&&!u&&!y?l(o.signal.reason):(this.valList[t]===h&&(p===void 0?h.__staleWhileFetching?this.valList[t]=h.__staleWhileFetching:this.delete(e):(s.status&&(s.status.fetchUpdated=!0),this.set(e,p,a.options))),p)},c=p=>(s.status&&(s.status.fetchRejected=!0,s.status.fetchError=p),l(p)),l=p=>{let{aborted:y}=o.signal,d=y&&s.allowStaleOnFetchAbort,u=d||s.allowStaleOnFetchRejection,P=u||s.noDeleteOnFetchRejection;if(this.valList[t]===h&&(!P||h.__staleWhileFetching===void 0?this.delete(e):d||(this.valList[t]=h.__staleWhileFetching)),u)return s.status&&h.__staleWhileFetching!==void 0&&(s.status.returnedStale=!0),h.__staleWhileFetching;if(h.__returned===h)throw p},g=(p,y)=>{this.fetchMethod(e,r,a).then(d=>p(d),y),o.signal.addEventListener("abort",()=>{(!s.ignoreFetchAbort||s.allowStaleOnFetchAbort)&&(p(),s.allowStaleOnFetchAbort&&(p=d=>f(d,!0)))})};s.status&&(s.status.fetchDispatched=!0);let h=new Promise(g).then(f,c);return h.__abortController=o,h.__staleWhileFetching=r,h.__returned=null,t===void 0?(this.set(e,h,{...a.options,status:void 0}),t=this.keyMap.get(e)):this.valList[t]=h,h}isBackgroundFetch(e){return e&&typeof e=="object"&&typeof e.then=="function"&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(e,"__returned")&&(e.__returned===e||e.__returned===null)}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:f=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:g=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,fetchContext:y=this.fetchContext,forceRefresh:d=!1,status:u,signal:P}={}){if(!this.fetchMethod)return u&&(u.fetch="get"),this.get(e,{allowStale:t,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:u});let F={allowStale:t,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:o,size:a,sizeCalculation:f,noUpdateTTL:c,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:g,allowStaleOnFetchAbort:p,ignoreFetchAbort:h,status:u,signal:P},k=this.keyMap.get(e);if(k===void 0){u&&(u.fetch="miss");let b=this.backgroundFetch(e,k,F,y);return b.__returned=b}else{let b=this.valList[k];if(this.isBackgroundFetch(b)){let ee=t&&b.__staleWhileFetching!==void 0;return u&&(u.fetch="inflight",ee&&(u.returnedStale=!0)),ee?b.__staleWhileFetching:b.__returned=b}let D=this.isStale(k);if(!d&&!D)return u&&(u.fetch="hit"),this.moveToTail(k),s&&this.updateItemAge(k),this.statusTTL(u,k),b;let E=this.backgroundFetch(e,k,F,y),I=E.__staleWhileFetching!==void 0,R=I&&t;return u&&(u.fetch=I&&D?"stale":"refresh",R&&D&&(u.returnedStale=!0)),R?E.__staleWhileFetching:E.__returned=E}}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}={}){let o=this.keyMap.get(e);if(o!==void 0){let a=this.valList[o],f=this.isBackgroundFetch(a);return this.statusTTL(r,o),this.isStale(o)?(r&&(r.get="stale"),f?(r&&(r.returnedStale=t&&a.__staleWhileFetching!==void 0),t?a.__staleWhileFetching:void 0):(n||this.delete(e),r&&(r.returnedStale=t),t?a:void 0)):(r&&(r.get="hit"),f?a.__staleWhileFetching:(this.moveToTail(o),s&&this.updateItemAge(o),a))}else r&&(r.get="miss")}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return be("del","delete"),this.delete}delete(e){let t=!1;if(this.size!==0){let s=this.keyMap.get(e);if(s!==void 0)if(t=!0,this.size===1)this.clear();else{this.removeItemSize(s);let n=this.valList[s];this.isBackgroundFetch(n)?n.__abortController.abort(new Error("deleted")):(this.dispose(n,e,"delete"),this.disposeAfter&&this.disposed.push([n,e,"delete"])),this.keyMap.delete(e),this.keyList[s]=null,this.valList[s]=null,s===this.tail?this.tail=this.prev[s]:s===this.head?this.head=this.next[s]:(this.next[this.prev[s]]=this.next[s],this.prev[this.next[s]]=this.prev[s]),this.size--,this.free.push(s)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(let e of this.rindexes({allowStale:!0})){let t=this.valList[e];if(this.isBackgroundFetch(t))t.__abortController.abort(new Error("deleted"));else{let s=this.keyList[e];this.dispose(t,s,"delete"),this.disposeAfter&&this.disposed.push([t,s,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return be("reset","clear"),this.clear}get length(){return yt("length","size"),this.size}static get AbortController(){return ce}static get AbortSignal(){return Ce}};We.exports=z});var Ne=te((Gt,Re)=>{"use strict";var m=(...i)=>i.every(e=>e)?i.join(""):"",v=i=>i?encodeURIComponent(i):"",De=i=>i.toLowerCase().replace(/^\W+|\/|\W+$/g,"").replace(/\W+/g,"-"),bt={sshtemplate:({domain:i,user:e,project:t,committish:s})=>`git@${i}:${e}/${t}.git${m("#",s)}`,sshurltemplate:({domain:i,user:e,project:t,committish:s})=>`git+ssh://git@${i}/${e}/${t}.git${m("#",s)}`,edittemplate:({domain:i,user:e,project:t,committish:s,editpath:n,path:r})=>`https://${i}/${e}/${t}${m("/",n,"/",v(s||"HEAD"),"/",r)}`,browsetemplate:({domain:i,user:e,project:t,committish:s,treepath:n})=>`https://${i}/${e}/${t}${m("/",n,"/",v(s))}`,browsetreetemplate:({domain:i,user:e,project:t,committish:s,treepath:n,path:r,fragment:o,hashformat:a})=>`https://${i}/${e}/${t}/${n}/${v(s||"HEAD")}/${r}${m("#",a(o||""))}`,browseblobtemplate:({domain:i,user:e,project:t,committish:s,blobpath:n,path:r,fragment:o,hashformat:a})=>`https://${i}/${e}/${t}/${n}/${v(s||"HEAD")}/${r}${m("#",a(o||""))}`,docstemplate:({domain:i,user:e,project:t,treepath:s,committish:n})=>`https://${i}/${e}/${t}${m("/",s,"/",v(n))}#readme`,httpstemplate:({auth:i,domain:e,user:t,project:s,committish:n})=>`git+https://${m(i,"@")}${e}/${t}/${s}.git${m("#",n)}`,filetemplate:({domain:i,user:e,project:t,committish:s,path:n})=>`https://${i}/${e}/${t}/raw/${v(s||"HEAD")}/${n}`,shortcuttemplate:({type:i,user:e,project:t,committish:s})=>`${i}:${e}/${t}${m("#",s)}`,pathtemplate:({user:i,project:e,committish:t})=>`${i}/${e}${m("#",t)}`,bugstemplate:({domain:i,user:e,project:t})=>`https://${i}/${e}/${t}/issues`,hashformat:De},U={};U.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:i,user:e,project:t,committish:s,path:n})=>`https://${m(i,"@")}raw.githubusercontent.com/${e}/${t}/${v(s||"HEAD")}/${n}`,gittemplate:({auth:i,domain:e,user:t,project:s,committish:n})=>`git://${m(i,"@")}${e}/${t}/${s}.git${m("#",n)}`,tarballtemplate:({domain:i,user:e,project:t,committish:s})=>`https://codeload.${i}/${e}/${t}/tar.gz/${v(s||"HEAD")}`,extract:i=>{let[,e,t,s,n]=i.pathname.split("/",5);if(!(s&&s!=="tree")&&(s||(n=i.hash.slice(1)),t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:n}}};U.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:i,user:e,project:t,committish:s,treepath:n,path:r,editpath:o})=>`https://${i}/${e}/${t}${m("/",n,"/",v(s||"HEAD"),"/",r,o)}`,tarballtemplate:({domain:i,user:e,project:t,committish:s})=>`https://${i}/${e}/${t}/get/${v(s||"HEAD")}.tar.gz`,extract:i=>{let[,e,t,s]=i.pathname.split("/",4);if(!["get"].includes(s)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}}};U.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",httpstemplate:({auth:i,domain:e,user:t,project:s,committish:n})=>`git+https://${m(i,"@")}${e}/${t}/${s}.git${m("#",n)}`,tarballtemplate:({domain:i,user:e,project:t,committish:s})=>`https://${i}/${e}/${t}/repository/archive.tar.gz?ref=${v(s||"HEAD")}`,extract:i=>{let e=i.pathname.slice(1);if(e.includes("/-/")||e.includes("/archive.tar.gz"))return;let t=e.split("/"),s=t.pop();s.endsWith(".git")&&(s=s.slice(0,-4));let n=t.join("/");if(!(!n||!s))return{user:n,project:s,committish:i.hash.slice(1)}}};U.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:i,project:e,committish:t})=>`git@${i}:${e}.git${m("#",t)}`,sshurltemplate:({domain:i,project:e,committish:t})=>`git+ssh://git@${i}/${e}.git${m("#",t)}`,edittemplate:({domain:i,user:e,project:t,committish:s,editpath:n})=>`https://${i}/${e}/${t}${m("/",v(s))}/${n}`,browsetemplate:({domain:i,project:e,committish:t})=>`https://${i}/${e}${m("/",v(t))}`,browsetreetemplate:({domain:i,project:e,committish:t,path:s,hashformat:n})=>`https://${i}/${e}${m("/",v(t))}${m("#",n(s))}`,browseblobtemplate:({domain:i,project:e,committish:t,path:s,hashformat:n})=>`https://${i}/${e}${m("/",v(t))}${m("#",n(s))}`,docstemplate:({domain:i,project:e,committish:t})=>`https://${i}/${e}${m("/",v(t))}`,httpstemplate:({domain:i,project:e,committish:t})=>`git+https://${i}/${e}.git${m("#",t)}`,filetemplate:({user:i,project:e,committish:t,path:s})=>`https://gist.githubusercontent.com/${i}/${e}/raw${m("/",v(t))}/${s}`,shortcuttemplate:({type:i,project:e,committish:t})=>`${i}:${e}${m("#",t)}`,pathtemplate:({project:i,committish:e})=>`${i}${m("#",e)}`,bugstemplate:({domain:i,project:e})=>`https://${i}/${e}`,gittemplate:({domain:i,project:e,committish:t})=>`git://${i}/${e}.git${m("#",t)}`,tarballtemplate:({project:i,committish:e})=>`https://codeload.github.com/gist/${i}/tar.gz/${v(e||"HEAD")}`,extract:i=>{let[,e,t,s]=i.pathname.split("/",4);if(s!=="raw"){if(!t){if(!e)return;t=e,e=null}return t.endsWith(".git")&&(t=t.slice(0,-4)),{user:e,project:t,committish:i.hash.slice(1)}}},hashformat:function(i){return i&&"file-"+De(i)}};U.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:i,user:e,project:t,committish:s,path:n})=>`https://${i}/${e}/${t}/blob/${v(s)||"HEAD"}/${n}`,httpstemplate:({domain:i,user:e,project:t,committish:s})=>`https://${i}/${e}/${t}.git${m("#",s)}`,tarballtemplate:({domain:i,user:e,project:t,committish:s})=>`https://${i}/${e}/${t}/archive/${v(s)||"HEAD"}.tar.gz`,bugstemplate:({user:i,project:e})=>`https://todo.sr.ht/${i}/${e}`,extract:i=>{let[,e,t,s]=i.pathname.split("/",4);if(!["archive"].includes(s)&&(t&&t.endsWith(".git")&&(t=t.slice(0,-4)),!(!e||!t)))return{user:e,project:t,committish:i.hash.slice(1)}}};for(let[i,e]of Object.entries(U))U[i]=Object.assign({},bt,e);Re.exports=U});var xe=te((Jt,Be)=>{var $t=$("url"),Se=(i,e,t)=>{let s=i.indexOf(t);return i.lastIndexOf(e,s>-1?s:1/0)},He=i=>{try{return new $t.URL(i)}catch{}},kt=(i,e)=>{let t=i.indexOf(":"),s=i.slice(0,t+1);if(Object.prototype.hasOwnProperty.call(e,s))return i;let n=i.indexOf("@");return n>-1?n>t?`git+ssh://${i}`:i:i.indexOf("//")===t+1?i:`${i.slice(0,t+1)}//${i.slice(t+1)}`},vt=i=>{let e=Se(i,"@","#"),t=Se(i,":","#");return t>e&&(i=i.slice(0,t)+"/"+i.slice(t+1)),Se(i,":","#")===-1&&i.indexOf("//")===-1&&(i=`git+ssh://${i}`),i};Be.exports=(i,e)=>{let t=e?kt(i,e):i;return He(t)||He(vt(t))}});var qe=te((Kt,Ve)=>{"use strict";var St=xe(),xt=i=>{let e=i.indexOf("#"),t=i.indexOf("/"),s=i.indexOf("/",t+1),n=i.indexOf(":"),r=/\s/.exec(i),o=i.indexOf("@"),a=!r||e>-1&&r.index>e,f=o===-1||e>-1&&o>e,c=n===-1||e>-1&&n>e,l=s===-1||e>-1&&s>e,g=t>0,h=e>-1?i[e-1]!=="/":!i.endsWith("/"),p=!i.startsWith(".");return a&&g&&h&&p&&f&&c&&l};Ve.exports=(i,e,{gitHosts:t,protocols:s})=>{if(!i)return;let n=xt(i)?`github:${i}`:i,r=St(n,s);if(!r)return;let o=t.byShortcut[r.protocol],a=t.byDomain[r.hostname.startsWith("www.")?r.hostname.slice(4):r.hostname],f=o||a;if(!f)return;let c=t[o||a],l=null;s[r.protocol]?.auth&&(r.username||r.password)&&(l=`${r.username}${r.password?":"+r.password:""}`);let g=null,h=null,p=null,y=null;try{if(o){let d=r.pathname.startsWith("/")?r.pathname.slice(1):r.pathname,u=d.indexOf("@");u>-1&&(d=d.slice(u+1));let P=d.lastIndexOf("/");P>-1?(h=decodeURIComponent(d.slice(0,P)),h||(h=null),p=decodeURIComponent(d.slice(P+1))):p=decodeURIComponent(d),p.endsWith(".git")&&(p=p.slice(0,-4)),r.hash&&(g=decodeURIComponent(r.hash.slice(1))),y="shortcut"}else{if(!c.protocols.includes(r.protocol))return;let d=c.extract(r);if(!d)return;h=d.user&&decodeURIComponent(d.user),p=decodeURIComponent(d.project),g=decodeURIComponent(d.committish),y=s[r.protocol]?.name||r.protocol.slice(0,-1)}}catch(d){if(d instanceof URIError)return;throw d}return[f,h,l,p,g,y,e]}});var Ge=te((Xt,Ye)=>{"use strict";var Lt=je(),Pt=Ne(),Tt=qe(),At=xe(),Le=new Lt({max:1e3}),W,se,S,L,_=class{constructor(e,t,s,n,r,o,a={}){ae(this,S);Object.assign(this,C(_,W)[e],{type:e,user:t,auth:s,project:n,committish:r,default:o,opts:a})}static addHost(e,t){C(_,W)[e]=t,C(_,W).byDomain[t.domain]=e,C(_,W).byShortcut[`${e}:`]=e,C(_,se)[`${e}:`]={name:e}}static fromUrl(e,t){if(typeof e!="string")return;let s=e+JSON.stringify(t||{});if(!Le.has(s)){let n=Tt(e,t,{gitHosts:C(_,W),protocols:C(_,se)});Le.set(s,n?new _(...n):void 0)}return Le.get(s)}static parseUrl(e){return At(e)}hash(){return this.committish?`#${this.committish}`:""}ssh(e){return x(this,S,L).call(this,this.sshtemplate,e)}sshurl(e){return x(this,S,L).call(this,this.sshurltemplate,e)}browse(e,...t){return typeof e!="string"?x(this,S,L).call(this,this.browsetemplate,e):typeof t[0]!="string"?x(this,S,L).call(this,this.browsetreetemplate,{...t[0],path:e}):x(this,S,L).call(this,this.browsetreetemplate,{...t[1],fragment:t[0],path:e})}browseFile(e,...t){return typeof t[0]!="string"?x(this,S,L).call(this,this.browseblobtemplate,{...t[0],path:e}):x(this,S,L).call(this,this.browseblobtemplate,{...t[1],fragment:t[0],path:e})}docs(e){return x(this,S,L).call(this,this.docstemplate,e)}bugs(e){return x(this,S,L).call(this,this.bugstemplate,e)}https(e){return x(this,S,L).call(this,this.httpstemplate,e)}git(e){return x(this,S,L).call(this,this.gittemplate,e)}shortcut(e){return x(this,S,L).call(this,this.shortcuttemplate,e)}path(e){return x(this,S,L).call(this,this.pathtemplate,e)}tarball(e){return x(this,S,L).call(this,this.tarballtemplate,{...e,noCommittish:!1})}file(e,t){return x(this,S,L).call(this,this.filetemplate,{...t,path:e})}edit(e,t){return x(this,S,L).call(this,this.edittemplate,{...t,path:e})}getDefaultRepresentation(){return this.default}toString(e){return this.default&&typeof this[this.default]=="function"?this[this.default](e):this.sshurl(e)}},q=_;W=new WeakMap,se=new WeakMap,S=new WeakSet,L=function(e,t){if(typeof e!="function")return null;let s={...this,...this.opts,...t};s.path||(s.path=""),s.path.startsWith("/")&&(s.path=s.path.slice(1)),s.noCommittish&&(s.committish=null);let n=e(s);return s.noGitPlus&&n.startsWith("git+")?n.slice(4):n},ae(q,W,{byShortcut:{},byDomain:{}}),ae(q,se,{"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}});for(let[i,e]of Object.entries(Pt))q.addHost(i,e);Ye.exports=q});var Nt={};oe(Nt,{default:()=>Rt});var rt=$("@yarnpkg/cli"),K=$("@yarnpkg/core"),O=$("clipanion");var w=$("@yarnpkg/core"),T=$("@yarnpkg/fslib"),et=pt(Ge());var Ae={};oe(Ae,{getFs:()=>zt,getPackagePath:()=>Ft});var Je=$("@yarnpkg/plugin-pnp"),he=$("@yarnpkg/core"),Ke=$("@yarnpkg/fslib"),de=$("@yarnpkg/libzip");var Y=()=>({os:[process.platform],cpu:[process.arch],libc:[]});var Ft=async(i,e)=>{if(_t(i),!he.structUtils.isPackageCompatible(e,Y()))return null;let t=he.structUtils.convertPackageToLocator(e),s={name:he.structUtils.stringifyIdent(t),reference:t.reference},n=Pe.getPackageInformation(s);if(!n)return null;let{packageLocation:r}=n;return r},Pe,_t=i=>{Pe||(Pe=module.require((0,Je.getPnpPath)(i).cjs))},zt=()=>(Ot(),Te),Te,Ot=()=>{Te||(Te=new Ke.VirtualFS({baseFs:new de.ZipOpenFS({libzip:(0,de.getLibzipSync)(),readOnlyArchives:!0})}))};var Fe={};oe(Fe,{_getYarnStateAliases:()=>Ze,getFs:()=>Ct,getPackagePath:()=>Et});var N=$("@yarnpkg/core"),Xe=$("@yarnpkg/parsers"),j=$("@yarnpkg/fslib");var Et=async(i,e)=>{if(await It(i),!N.structUtils.isPackageCompatible(e,Y()))return null;let t=N.structUtils.convertPackageToLocator(e),s=N.structUtils.stringifyLocator(t),n=fe[s]||Qe[s];if(!n)return null;let r=n.locations[0];return r?j.ppath.join(i.cwd,r):i.cwd},fe,Qe,It=async i=>{if(!fe){let e=j.ppath.join(i.configuration.projectCwd,j.Filename.nodeModules,".yarn-state.yml");fe=(0,Xe.parseSyml)(await j.xfs.readFilePromise(e,"utf8")),Qe=Ze(fe)}},Ct=()=>j.xfs,Ze=i=>Object.entries(i).reduce((e,[t,s])=>{if(!s.aliases)return e;let n=N.structUtils.parseLocator(t);for(let r of s.aliases){let o=N.structUtils.makeLocator(n,r),a=N.structUtils.stringifyLocator(o);e[a]=s}return e},{});var _e={};oe(_e,{getFs:()=>Ut,getPackagePath:()=>Mt});var ne=$("@yarnpkg/core"),H=$("@yarnpkg/fslib");var Mt=async(i,e)=>{if(!ne.structUtils.isPackageCompatible(e,Y()))return null;let t=ne.structUtils.convertPackageToLocator(e),s=ne.structUtils.slugifyLocator(t),n=ne.structUtils.stringifyIdent(t),r=i.tryWorkspaceByLocator(t);return r?r.cwd:H.ppath.join(i.configuration.projectCwd,H.Filename.nodeModules,".store",s,H.Filename.nodeModules,n)},Ut=()=>H.xfs;var ze=i=>{switch(i){case"pnp":return Ae;case"node-modules":return Fe;case"pnpm":return _e;default:throw new Error("Unsupported linker")}};var ki=T.npath.basename(__dirname)==="@yarnpkg"?T.ppath.join(T.npath.toPortablePath(__dirname),"../.."):T.ppath.join(T.npath.toPortablePath(__dirname),".."),ue=async(i,e,t,s,n)=>{let r={},o={children:r},a=await tt(i,t,s),f=ze(i.configuration.get("nodeLinker")),c=f.getFs();for(let[l,g]of a.entries()){let h=await f.getPackagePath(i,g);if(h===null)continue;let p=JSON.parse(await c.readFilePromise(T.ppath.join(h,T.Filename.manifest),"utf8")),{license:y,url:d,vendorName:u,vendorUrl:P}=jt(p);r[y]||(r[y]={value:w.formatUtils.tuple(w.formatUtils.Type.NO_HINT,y),children:{}});let F=w.structUtils.convertPackageToLocator(g),k=w.formatUtils.tuple(w.formatUtils.Type.DEPENDENT,{locator:F,descriptor:l}),b=n?{}:{...d?{url:{value:w.formatUtils.tuple(w.formatUtils.Type.NO_HINT,Oe("URL",d,e))}}:{},...u?{vendorName:{value:w.formatUtils.tuple(w.formatUtils.Type.NO_HINT,Oe("VendorName",u,e))}}:{},...P?{vendorUrl:{value:w.formatUtils.tuple(w.formatUtils.Type.NO_HINT,Oe("VendorUrl",P,e))}}:{}},D={value:k,children:b},E=w.structUtils.stringifyLocator(F),I=r[y];if(I){let R=I.children;R[E]=D}}return o},tt=async(i,e,t)=>{let s=new Map,n;if(e){if(t){for(let f of i.workspaces)f.manifest.devDependencies.clear();let a=await w.Cache.find(i.configuration);await i.resolveEverything({report:new w.ThrowReport,cache:a})}n=i.storedDescriptors.values()}else n=i.workspaces.flatMap(a=>{let f=[a.anchoredDescriptor];for(let[c,l]of a.anchoredPackage.dependencies.entries())t&&a.manifest.devDependencies.has(c)||f.push(l);return f});let r=w.miscUtils.sortMap(n,[a=>w.structUtils.stringifyIdent(a),a=>w.structUtils.isVirtualDescriptor(a)?"0":"1",a=>a.range]),o=new Set;for(let a of r.values()){let f=i.storedResolutions.get(a.descriptorHash);if(!f)continue;let c=i.storedPackages.get(f);if(!c)continue;let{descriptorHash:l}=w.structUtils.isVirtualDescriptor(a)?w.structUtils.devirtualizeDescriptor(a):a;o.has(l)||(o.add(l),s.set(a,c))}return s},G=async(i,e,t,s)=>{if(!e.length)return;let n=new Set(e.map(o=>i.getWorkspaceByIdent(w.structUtils.parseIdent(o))));if(t)for(let o of n)for(let a of s?["dependencies"]:w.Manifest.hardDependencies)for(let f of o.manifest.getForScope(a).values()){let c=i.tryWorkspaceByDescriptor(f);c!==null&&n.add(c)}for(let o of i.workspaces)n.has(o)||(o.manifest.installConfig=o.manifest.installConfig||{},o.manifest.installConfig.selfReferences=!1,o.manifest.dependencies.clear(),o.manifest.devDependencies.clear(),o.manifest.peerDependencies.clear());i.workspaces=[...n];let r=await w.Cache.find(i.configuration);await i.resolveEverything({report:new w.ThrowReport,cache:r})};function Wt(i){let e={},t=i.match(/^([^(<]+)/);if(t){let r=t[0].trim();r&&(e.name=r)}let s=i.match(/<([^>]+)>/);s&&(e.email=s[1]);let n=i.match(/\(([^)]+)\)/);return n&&(e.url=n[1]),e}var jt=i=>{let{license:e,licenses:t,repository:s,homepage:n,author:r}=i,o=typeof r=="string"?Wt(r):r;return{license:(()=>{if(e)return pe(e);if(t){if(!Array.isArray(t))return pe(t);if(t.length===1)return pe(t[0]);if(t.length>1)return`(${t.map(pe).join(" OR ")})`}return it})(),url:st(s)||n,vendorName:o?.name,vendorUrl:n||o?.url}},it="UNKNOWN",pe=i=>(typeof i!="string"?i.type:i)||it,st=i=>{let e=typeof i=="string"?i:i?.url;if(!e)return e;let t=et.fromUrl(e);return!t||t.getDefaultRepresentation()!=="shortcut"?e:t.https()},Oe=(i,e,t)=>t?e:`${i}: ${e}`,nt=async(i,e,t)=>{let s=await tt(i,e,t),n=ze(i.configuration.get("nodeLinker")),r=n.getFs(),o=new Map;for(let f of s.values()){let c=await n.getPackagePath(i,f);if(c===null)continue;let l=JSON.parse(await r.readFilePromise(T.ppath.join(c,T.Filename.manifest),"utf8")),h=(await r.readdirPromise(c,{withFileTypes:!0})).filter(k=>k.isFile()).map(({name:k})=>k),p=h.find(k=>{let b=k.toLowerCase();return b==="license"||b.startsWith("license.")||b==="unlicense"||b.startsWith("unlicense.")});if(!p)continue;let y=await r.readFilePromise(T.ppath.join(c,p),"utf8"),d=h.find(k=>{let b=k.toLowerCase();return b==="notice"||b.startsWith("notice.")}),u;d&&(u=await r.readFilePromise(T.ppath.join(c,d),"utf8"));let P=u?`${y}
|
|
|
|
NOTICE
|
|
|
|
${u}`:y,F=o.get(P);F?F.set(l.name,l):o.set(P,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.
|
|
|
|
`;for(let[f,c]of o.entries()){a+=`-----
|
|
|
|
`;let l=[],g=[];for(let{name:p,repository:y}of c.values()){l.push(p);let d=st(y);d&&g.push(c.size===1?d:`${d} (${p})`)}let h=[];h.push(`The following software may be included in this product: ${l.join(", ")}.`),g.length>0&&h.push(`A copy of the source code may be downloaded from ${g.join(", ")}.`),h.push("This software contains the following license and notice below:"),a+=`${h.join(" ")}
|
|
|
|
`,a+=`${f.trim()}
|
|
|
|
`}return a};var J=class extends O.Command{constructor(){super(...arguments);this.recursive=O.Option.Boolean("-R,--recursive",!1,{description:"Include transitive dependencies (dependencies of direct dependencies)"});this.production=O.Option.Boolean("--production",!1,{description:"Exclude development dependencies"});this.json=O.Option.Boolean("--json",!1,{description:"Format output as JSON"});this.excludeMetadata=O.Option.Boolean("--exclude-metadata",!1,{description:"Exclude dependency metadata from output"});this.focus=O.Option.Array("--focus",[],{description:"Focus on one or more workspaces"})}async execute(){let t=await K.Configuration.find(this.context.cwd,this.context.plugins),{project:s,workspace:n}=await K.Project.find(t,this.context.cwd);if(!n)throw new rt.WorkspaceRequiredError(s.cwd,this.context.cwd);await s.restoreInstallState(),await G(s,this.focus,this.recursive,this.production);let r=await ue(s,this.json,this.recursive,this.production,this.excludeMetadata);K.treeUtils.emitTree(r,{configuration:t,stdout:this.context.stdout,json:this.json,separators:1})}};J.paths=[["licenses","list"]],J.usage=O.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.
|
|
|
|
If \`--focus\` is passed, the listing will only include dependencies of the specified workspaces.
|
|
`,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"],["List all licenses for specified workspaces only","$0 licenses list --focus <workspace-a> --focus <workspace-b>"]]});var ot=$("@yarnpkg/cli"),me=$("@yarnpkg/core"),B=$("clipanion");var X=class extends B.Command{constructor(){super(...arguments);this.recursive=B.Option.Boolean("-R,--recursive",!1,{description:"Include transitive dependencies (dependencies of direct dependencies)"});this.production=B.Option.Boolean("--production",!1,{description:"Exclude development dependencies"});this.focus=B.Option.Array("--focus",[],{description:"Focus on one or more workspaces"})}async execute(){let t=await me.Configuration.find(this.context.cwd,this.context.plugins),{project:s,workspace:n}=await me.Project.find(t,this.context.cwd);if(!n)throw new ot.WorkspaceRequiredError(s.cwd,this.context.cwd);await s.restoreInstallState(),await G(s,this.focus,this.recursive,this.production);let r=await nt(s,this.recursive,this.production);this.context.stdout.write(r)}};X.paths=[["licenses","generate-disclaimer"]],X.usage=B.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.
|
|
|
|
If \`--focus\` is passed, the disclaimer will only include dependencies of the specified workspaces.
|
|
`,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 generate-disclaimer --production"],["Include licenses for specified workspaces only","$0 licenses generate-disclaimer --focus <workspace-a> --focus <workspace-b>"]]});var at=$("@yarnpkg/cli"),Z=$("@yarnpkg/core"),A=$("clipanion");var Q=class extends A.Command{constructor(){super(...arguments);this.recursive=A.Option.Boolean("-R,--recursive",!1,{description:"Include transitive dependencies (dependencies of direct dependencies)"});this.production=A.Option.Boolean("--production",!1,{description:"Exclude development dependencies"});this.json=A.Option.Boolean("--json",!1,{description:"Format output as JSON"});this.excludeMetadata=A.Option.Boolean("--exclude-metadata",!1,{description:"Exclude dependency metadata from output"});this.focus=A.Option.Array("--focus",[],{description:"Focus on one or more workspaces"});this.allowedLicenses=A.Option.Array("--allowed",[],{description:"List of allowed licenses"});this.blockedLicenses=A.Option.Array("--blocked",[],{description:"List of blocked licenses"})}async execute(){if(this.allowedLicenses.length===0==(this.blockedLicenses.length===0))throw new A.UsageError("You must provide at least one of --allowed or --blocked, but not both");let t=await Z.Configuration.find(this.context.cwd,this.context.plugins),{project:s,workspace:n}=await Z.Project.find(t,this.context.cwd);if(!n)throw new at.WorkspaceRequiredError(s.cwd,this.context.cwd);await s.restoreInstallState(),await G(s,this.focus,this.recursive,this.production);let r=await ue(s,this.json,this.recursive,this.production,this.excludeMetadata),o=[];for(let[a,f]of Object.entries(r.children)){if(!f)continue;let c=this.allowedLicenses.length===0||this.allowedLicenses.includes(a),l=this.blockedLicenses.length!==0&&this.blockedLicenses.includes(a);(!c||l)&&o.push(f)}return Z.treeUtils.emitTree({children:o},{configuration:t,stdout:this.context.stdout,json:this.json,separators:1}),o.length>0?1:0}};Q.paths=[["licenses","audit"]],Q.usage=A.Command.Usage({description:"audits the licenses for all packages in the project",details:`
|
|
This command audits and prints the license information for packages in the project that violate the rules set. By default, only direct dependencies are audited.
|
|
|
|
If \`-R,--recursive\` is set, the auditing will include transitive dependencies (dependencies of direct dependencies).
|
|
|
|
If \`--production\` is set, the auditing will exclude development dependencies.
|
|
|
|
If \`--focus\` is passed, the auditing will only include dependencies of the specified workspaces.
|
|
|
|
If \`--allowed\` is passed, the auditing will accept dependencies with the specified allowed licenses.
|
|
|
|
If \`--blocked\` is passed, the auditing will reject dependencies with the specified blocked licenses.
|
|
`,examples:[["Audit all licenses of direct dependencies","$0 licenses audit --blocked GPL-3.0"],["Audit all licenses of direct and transitive dependencies","$0 licenses audit --blocked GPL-3.0 --recursive"],["Audit all licenses of production dependencies only","$0 licenses audit --blocked GPL-3.0 --production"],["Audit all licenses for specified workspaces only","$0 licenses audit --blocked GPL-3.0 --focus <workspace-a> --focus <workspace-b>"]]});var Dt={commands:[J,X,Q]},Rt=Dt;return ut(Nt);})();
|
|
return plugin;
|
|
}
|
|
};
|