You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
48 KiB
34 lines
48 KiB
3 years ago
|
/* eslint-disable */
|
||
|
//prettier-ignore
|
||
|
module.exports = {
|
||
|
name: "@yarnpkg/plugin-outdated",
|
||
|
factory: function (require) {
|
||
|
var plugin=(()=>{var _r=Object.create,ye=Object.defineProperty,xr=Object.defineProperties,br=Object.getOwnPropertyDescriptor,Sr=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertyNames,tt=Object.getOwnPropertySymbols,Hr=Object.getPrototypeOf,rt=Object.prototype.hasOwnProperty,wr=Object.prototype.propertyIsEnumerable;var nt=(e,t,r)=>t in e?ye(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w=(e,t)=>{for(var r in t||(t={}))rt.call(t,r)&&nt(e,r,t[r]);if(tt)for(var r of tt(t))wr.call(t,r)&&nt(e,r,t[r]);return e},B=(e,t)=>xr(e,Sr(t)),Tr=e=>ye(e,"__esModule",{value:!0});var W=e=>{if(typeof require!="undefined")return require(e);throw new Error('Dynamic require of "'+e+'" is not supported')};var G=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),$r=(e,t)=>{for(var r in t)ye(e,r,{get:t[r],enumerable:!0})},Lr=(e,t,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of vr(t))!rt.call(e,n)&&n!=="default"&&ye(e,n,{get:()=>t[n],enumerable:!(r=br(t,n))||r.enumerable});return e},J=e=>Lr(Tr(ye(e!=null?_r(Hr(e)):{},"default",e&&e.__esModule&&"default"in e?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e);var He=G(Y=>{"use strict";Y.isInteger=e=>typeof e=="number"?Number.isInteger(e):typeof e=="string"&&e.trim()!==""?Number.isInteger(Number(e)):!1;Y.find=(e,t)=>e.nodes.find(r=>r.type===t);Y.exceedsLimit=(e,t,r=1,n)=>n===!1||!Y.isInteger(e)||!Y.isInteger(t)?!1:(Number(t)-Number(e))/Number(r)>=n;Y.escapeNode=(e,t=0,r)=>{let n=e.nodes[t];!n||(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0)};Y.encloseBrace=e=>e.type!=="brace"?!1:e.commas>>0+e.ranges>>0==0?(e.invalid=!0,!0):!1;Y.isInvalidBrace=e=>e.type!=="brace"?!1:e.invalid===!0||e.dollar?!0:e.commas>>0+e.ranges>>0==0||e.open!==!0||e.close!==!0?(e.invalid=!0,!0):!1;Y.isOpenOrClose=e=>e.type==="open"||e.type==="close"?!0:e.open===!0||e.close===!0;Y.reduce=e=>e.reduce((t,r)=>(r.type==="text"&&t.push(r.value),r.type==="range"&&(r.type="text"),t),[]);Y.flatten=(...e)=>{let t=[],r=n=>{for(let s=0;s<n.length;s++){let a=n[s];Array.isArray(a)?r(a,t):a!==void 0&&t.push(a)}return t};return r(e),t}});var we=G((es,at)=>{"use strict";var st=He();at.exports=(e,t={})=>{let r=(n,s={})=>{let a=t.escapeInvalid&&st.isInvalidBrace(s),i=n.invalid===!0&&t.escapeInvalid===!0,o="";if(n.value)return(a||i)&&st.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let h of n.nodes)o+=r(h);return o};return r(e)}});var ot=G((ts,it)=>{"use strict";it.exports=function(e){return typeof e=="number"?e-e==0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1}});var yt=G((rs,dt)=>{"use strict";var ut=ot(),ce=(e,t,r)=>{if(ut(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(ut(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n=w({relaxZeros:!0},r);typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),a=String(n.shorthand),i=String(n.capture),o=String(n.wrap),h=e+":"+t+"="+s+a+i+o;if(ce.cache.hasOwnProperty(h))return ce.cache[h].result;let d=Math.min(e,t),f=Math.max(e,t);if(Math.abs(d-f)===1){let A=e+"|"+t;return n.capture?`(${A})`:n.wrap===!1?A:`(?:${A})`}let R=gt(e)||gt(t),p={min:e,max:t,a:d,b:f},v=[],m=[];if(R&&(p.isPadded=R,p.maxLen=String(p.max).length),d<0){let A=f<0?Math.abs(f):1;m=ct(A,Math.abs(d),p,n),d=p.a=0}return f>=0&&(v=ct(d,f,p,n)),p.negatives=m,p.positives=v,p.result=Or(m,v,n),n.capture===!0?p.result=`(${p.result})`:n.wrap!==!1&&v.length+m.length>1&&(p.result=`(?:${p.result})`),ce.cache[h]=p,p.result};function Or(e,t,r){let n=Ie(e,t,"-",!1,r)||[],s=Ie(t,e,"",!1,r)||[],a=Ie(e,t,"-?",!0,r)||[];return n.concat(a).concat(s).join("|")}function kr(e,t){let r=1,n=1,s=pt(e,r),a=new Set([t]);for(;e<=s&&s<=t;)a.add(s),r+=1,s=pt(e,r);for(s=ft(t+1,n)-1;e<s&&s<=t;)a.add(s),n+=1,s=ft(t+1,n)-1;return a=[...a],a.sort(Dr),a}function Nr(e,t,r){if(e===t)return{pattern:e,count:[],digits:0};let n=Ir(e,t),s=n.
|
||
|
`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"}});var Pt=G((os,Dt)=>{"use strict";var Vr=we(),{MAX_LENGTH:kt,CHAR_BACKSLASH:Be,CHAR_BACKTICK:Yr,CHAR_COMMA:Jr,CHAR_DOT:en,CHAR_LEFT_PARENTHESES:tn,CHAR_RIGHT_PARENTHESES:rn,CHAR_LEFT_CURLY_BRACE:nn,CHAR_RIGHT_CURLY_BRACE:sn,CHAR_LEFT_SQUARE_BRACKET:Nt,CHAR_RIGHT_SQUARE_BRACKET:It,CHAR_DOUBLE_QUOTE:an,CHAR_SINGLE_QUOTE:on,CHAR_NO_BREAK_SPACE:un,CHAR_ZERO_WIDTH_NOBREAK_SPACE:cn}=Ot(),ln=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");let r=t||{},n=typeof r.maxLength=="number"?Math.min(kt,r.maxLength):kt;if(e.length>n)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${n})`);let s={type:"root",input:e,nodes:[]},a=[s],i=s,o=s,h=0,d=e.length,f=0,R=0,p,v={},m=()=>e[f++],A=E=>{if(E.type==="text"&&o.type==="dot"&&(o.type="text"),o&&o.type==="text"&&E.type==="text"){o.value+=E.value;return}return i.nodes.push(E),E.parent=i,E.prev=o,o=E,E};for(A({type:"bos"});f<d;)if(i=a[a.length-1],p=m(),!(p===cn||p===un)){if(p===Be){A({type:"text",value:(t.keepEscaping?p:"")+m()});continue}if(p===It){A({type:"text",value:"\\"+p});continue}if(p===Nt){h++;let E=!0,b;for(;f<d&&(b=m());){if(p+=b,b===Nt){h++;continue}if(b===Be){p+=m();continue}if(b===It&&(h--,h===0))break}A({type:"text",value:p});continue}if(p===tn){i=A({type:"paren",nodes:[]}),a.push(i),A({type:"text",value:p});continue}if(p===rn){if(i.type!=="paren"){A({type:"text",value:p});continue}i=a.pop(),A({type:"text",value:p}),i=a[a.length-1];continue}if(p===an||p===on||p===Yr){let E=p,b;for(t.keepQuotes!==!0&&(p="");f<d&&(b=m());){if(b===Be){p+=b+m();continue}if(b===E){t.keepQuotes===!0&&(p+=b);break}p+=b}A({type:"text",value:p});continue}if(p===nn){R++;let E=o.value&&o.value.slice(-1)==="$"||i.dollar===!0;i=A({type:"brace",open:!0,close:!1,dollar:E,depth:R,commas:0,ranges:0,nodes:[]}),a.push(i),A({type:"open",value:p});continue}if(p===sn){if(i.type!=="brace"){A({type:"text",value:p});continue}let E="close";i=a.pop(),i.close=!0,A({type:E,value:p}),R--,i=a[a.length-1];continue}if(p===Jr&&R>0){if(i.ranges>0){i.ranges=0;let E=i.nodes.shift();i.nodes=[E,{type:"text",value:Vr(i)}]}A({type:"comma",value:p}),i.commas++;continue}if(p===en&&R>0&&i.commas===0){let E=i.nodes;if(R===0||E.length===0){A({type:"text",value:p});continue}if(o.type==="dot"){if(i.range=[],o.value+=p,o.type="range",i.nodes.length!==3&&i.nodes.length!==5){i.invalid=!0,i.ranges=0,o.type="text";continue}i.ranges++,i.args=[];continue}if(o.type==="range"){E.pop();let b=E[E.length-1];b.value+=o.value+p,o=b,i.ranges--;continue}A({type:"dot",value:p});continue}A({type:"text",value:p})}do if(i=a.pop(),i.type!=="root"){i.nodes.forEach(k=>{k.nodes||(k.type==="open"&&(k.isOpen=!0),k.type==="close"&&(k.isClose=!0),k.nodes||(k.type="text"),k.invalid=!0)});let E=a[a.length-1],b=E.nodes.indexOf(i);E.nodes.splice(b,1,...i.nodes)}while(a.length>0);return A({type:"eos"}),s};Dt.exports=ln});var Ut=G((us,Bt)=>{"use strict";var Mt=we(),pn=Ht(),fn=$t(),hn=Pt(),z=(e,t={})=>{let r=[];if(Array.isArray(e))for(let n of e){let s=z.create(n,t);Array.isArray(s)?r.push(...s):r.push(s)}else r=[].concat(z.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(r=[...new Set(r)]),r};z.parse=(e,t={})=>hn(e,t);z.stringify=(e,t={})=>typeof e=="string"?Mt(z.parse(e,t),t):Mt(e,t);z.compile=(e,t={})=>(typeof e=="string"&&(e=z.parse(e,t)),pn(e,t));z.expand=(e,t={})=>{typeof e=="string"&&(e=z.parse(e,t));let r=fn(e,t);return t.noempty===!0&&(r=r.filter(Boolean)),t.nodupes===!0&&(r=[...new Set(r)]),r};z.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?z.compile(e,t):z.expand(e,t);Bt.exports=z});var Ae=G((cs,qt)=>{"use strict";var gn=W("path"),ne="\\\\/",Gt=`[^${ne}]`,ae="\\.",dn="\\+",yn="\\?",$e="\\/",Rn="(?=.)",Ft="[^/]",Ue=`(?:${$e}|$)`,jt=`(?:^|${$e})`,Ge=`${ae}{1,2}${Ue}`,An=`(?!${ae})`,mn=`(?!
|
||
|
`);return}return(await P.StreamReport.start({configuration:r,stdout:this.context.stdout},async d=>{await this.checkOutdatedDependencies(r,n,o,a,d)})).exitCode()}async checkOutdatedDependencies(t,r,n,s,a){let i=null;await a.startTimerPromise("Checking for outdated dependencies",async()=>{let o=n.length,h=P.StreamReport.progressViaCounter(o);a.reportProgress(h),i=await this.getOutdatedDependencies(r,s,n,h)}),a.reportSeparator(),i.length?(new Ve(a,t,i,{range:this.includeRange,url:this.includeURL,workspace:this.includeWorkspace(r)}).print(),a.reportSeparator(),this.printOutdatedCount(a,i.length)):this.printUpToDate(t,a)}async loadProject(){let t=await P.Configuration.find(this.context.cwd,this.context.plugins),[r,{project:n,workspace:s}]=await Promise.all([P.Cache.find(t),P.Project.find(t,this.context.cwd)]);if(await n.restoreInstallState(),!s)throw new ke.WorkspaceRequiredError(n.cwd,this.context.cwd);return{cache:r,configuration:t,project:n,workspace:s}}getWorkspaces(t){let r=this.workspace;return r?r[0]==="."?t.workspaces.filter(n=>n.cwd===this.context.cwd):t.workspaces.filter(n=>{let s=[...r,...r.map(a=>mr.default.join(this.context.cwd,a))];return Je.default.some([this.getWorkspaceName(n),n.cwd],s)}):t.workspaces}includeWorkspace(t){return t.workspaces.length>1}get dependencyTypes(){return this.type?[this.type]:Ye}getDependencies(t,r){let n=[];for(let a of r){let{anchoredLocator:i,project:o}=a,h=o.storedPackages.get(i.locatorHash);h||this.throw(t,i);for(let d of this.dependencyTypes)for(let f of a.manifest[d].values()){let{range:R}=f;if(R.includes(":")&&!/(npm|patch):/.test(R))continue;let p=h.dependencies.get(f.identHash);p||this.throw(t,f);let v=o.storedResolutions.get(p.descriptorHash);v||this.throw(t,p);let m=o.storedPackages.get(v);m||this.throw(t,p),n.push({dependencyType:d,descriptor:f,name:P.structUtils.stringifyIdent(f),pkg:m,workspace:a})}}if(!this.patterns.length)return n;let s=n.filter(({name:a})=>Je.default.isMatch(a,this.patterns));if(!s.length)throw new V.UsageError(`Pattern ${P.formatUtils.prettyList(t,this.patterns,P.FormatType.CODE)} doesn't match any packages referenced by any workspace`);return s}throw(t,r){let n=P.structUtils.prettyIdent(t,r);throw new Error(`Package for ${n} not found in the project`)}getSeverity(t,r){let n=et.default.coerce(t),s=et.default.coerce(r);return n.major===0||s.major>n.major?"major":s.minor>n.minor?"minor":"patch"}async getOutdatedDependencies(t,r,n,s){let a=n.map(async({dependencyType:i,descriptor:o,name:h,pkg:d,workspace:f})=>{if(f.project.tryWorkspaceByLocator(d))return;let{latest:R,range:p,url:v}=await r.fetch({descriptor:o,includeRange:this.includeRange,includeURL:this.includeURL,pkg:d});if(s==null||s.tick(),dr(d.version,R))return{current:d.version,latest:R,name:h,range:p,severity:{latest:this.getSeverity(d.version,R),range:p?this.getSeverity(d.version,p):void 0},type:i,url:v,workspace:this.includeWorkspace(t)?this.getWorkspaceName(f):void 0}});return(await Promise.all(a)).filter(hr).filter(i=>{var o,h;return(h=(o=this.severity)==null?void 0:o.includes(i.severity.latest))!=null?h:!0}).sort((i,o)=>i.name.localeCompare(o.name))}getWorkspaceName(t){return t.manifest.name?P.structUtils.stringifyIdent(t.manifest.name):t.computeCandidateName()}printOutdatedCount(t,r){let n=[P.MessageName.UNNAMED,r===1?"1 dependency is out of date":`${r} dependencies are out of date`];this.check?t.reportError(...n):t.reportWarning(...n)}printUpToDate(t,r){let n="\u2728 All your dependencies are up to date!";r.reportInfo(P.MessageName.UNNAMED,P.formatUtils.pretty(t,n,"green"))}};_e.paths=[["outdated"]],_e.usage=V.Command.Usage({description:"view outdated dependencies",details:`
|
||
|
This command finds outdated dependencies in a project and prints the result in a table or JSON format.
|
||
|
|
||
|
This command accepts glob patterns as arguments to filter the output. Make sure to escape the patterns, to prevent your own shell from trying to expand them.
|
||
|
`,examples:[["View outdated dependencies","yarn outdated"],["View outdated dependencies with the `@babel` scope","yarn outdated '@babel/*'"],["Filter results to only include devDependencies","yarn outdated --type devDependencies"],["Filter results to only include major version updates","yarn outdated --severity major"]]});var zn={commands:[_e]},Zn=zn;return Vn;})();
|
||
|
/*!
|
||
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
||
|
* Licensed under the MIT License.
|
||
|
*/
|
||
|
/*!
|
||
|
* is-number <https://github.com/jonschlinkert/is-number>
|
||
|
*
|
||
|
* Copyright (c) 2014-present, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
/*!
|
||
|
* to-regex-range <https://github.com/micromatch/to-regex-range>
|
||
|
*
|
||
|
* Copyright (c) 2015-present, Jon Schlinkert.
|
||
|
* Released under the MIT License.
|
||
|
*/
|
||
|
return plugin;
|
||
|
}
|
||
|
};
|