@yarnpkg/cli-dist 3.6.0-git.20230603.hash-45f6ecc9 → 3.6.0-git.20230603.hash-9645df4d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/yarn.js +1 -1
  2. package/package.json +1 -1
package/bin/yarn.js CHANGED
@@ -858,7 +858,7 @@ ${e.map(r=>`
858
858
  `,end:t=>`section_end:${Math.floor(Date.now()/1e3)}:${t.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,DIe=new Date,R0t=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,Q0t=t=>t,E3=Q0t({patrick:{date:[17,3],chars:["\u{1F340}","\u{1F331}"],size:40},simba:{date:[19,7],chars:["\u{1F981}","\u{1F334}"],size:40},jack:{date:[31,10],chars:["\u{1F383}","\u{1F987}"],size:40},hogsfather:{date:[31,12],chars:["\u{1F389}","\u{1F384}"],size:40},default:{chars:["=","-"],size:80}}),F0t=R0t&&Object.keys(E3).find(t=>{let e=E3[t];return!(e.date&&(e.date[0]!==DIe.getDate()||e.date[1]!==DIe.getMonth()+1))})||"default";function PIe(t,{configuration:e,json:r}){if(!e.get("enableMessageNames"))return"";let a=vd(t===null?0:t);return!r&&t===null?di(e,a,"grey"):a}function Pz(t,{configuration:e,json:r}){let s=PIe(t,{configuration:e,json:r});if(!s||t===null||t===0)return s;let a=Vr[t],n=`https://yarnpkg.com/advanced/error-codes#${s}---${a}`.toLowerCase();return fk(e,s,n)}var wt=class extends jc{constructor({configuration:r,stdout:s,json:a=!1,includePrefix:n=!0,includeFooter:c=!0,includeLogs:f=!a,includeInfos:A=f,includeWarnings:p=f,forgettableBufferSize:d=T0t,forgettableNames:y=new Set}){super();this.uncommitted=new Set;this.cacheHitCount=0;this.cacheMissCount=0;this.lastCacheMiss=null;this.warningCount=0;this.errors=[];this.startTime=Date.now();this.indent=0;this.progress=new Map;this.progressTime=0;this.progressFrame=0;this.progressTimeout=null;this.progressStyle=null;this.progressMaxScaledSize=null;this.forgettableLines=[];if(UF(this,{configuration:r}),this.configuration=r,this.forgettableBufferSize=d,this.forgettableNames=new Set([...y,...P0t]),this.includePrefix=n,this.includeFooter=c,this.includeInfos=A,this.includeWarnings=p,this.json=a,this.stdout=s,r.get("enableProgressBars")&&!a&&s.isTTY&&s.columns>22){let v=r.get("progressBarStyle")||F0t;if(!Object.prototype.hasOwnProperty.call(E3,v))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=E3[v];let x=12,g=Math.max(0,Math.min(s.columns-x,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*g/80)}}static async start(r,s){let a=new this(r),n=process.emitWarning;process.emitWarning=(c,f)=>{if(typeof c!="string"){let p=c;c=p.message,f=f!=null?f:p.name}let A=typeof f<"u"?`${f}: ${c}`:c;a.reportWarning(0,A)};try{await s(a)}catch(c){a.reportExceptionOnce(c)}finally{await a.finalize(),process.emitWarning=n}return a}hasErrors(){return this.errors.length>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(r){this.cacheHitCount+=1}reportCacheMiss(r,s){this.lastCacheMiss=r,this.cacheMissCount+=1,typeof s<"u"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo(13,s)}startSectionSync({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r==null||r()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return n()}catch(A){throw this.reportExceptionOnce(A),A}finally{let A=Date.now();this.uncommitted.delete(c),c.committed&&(s==null||s(A-f))}}async startSectionPromise({reportHeader:r,reportFooter:s,skipIfEmpty:a},n){let c={committed:!1,action:()=>{r==null||r()}};a?this.uncommitted.add(c):(c.action(),c.committed=!0);let f=Date.now();try{return await n()}catch(A){throw this.reportExceptionOnce(A),A}finally{let A=Date.now();this.uncommitted.delete(c),c.committed&&(s==null||s(A-f))}}startTimerImpl(r,s,a){return{cb:typeof s=="function"?s:a,reportHeader:()=>{this.reportInfo(null,`\u250C ${r}`),this.indent+=1,y3!==null&&!this.json&&this.includeInfos&&this.stdout.write(y3.start(r))},reportFooter:f=>{if(this.indent-=1,y3!==null&&!this.json&&this.includeInfos){this.stdout.write(y3.end(r));for(let[A,p]of this.errors)this.reportErrorImpl(A,p)}this.configuration.get("enableTimers")&&f>200?this.reportInfo(null,`\u2514 Completed in ${di(this.configuration,f,un.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:(typeof s=="function"?{}:s).skipIfEmpty}}startTimerSync(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionSync(c,n)}async startTimerPromise(r,s,a){let{cb:n,...c}=this.startTimerImpl(r,s,a);return this.startSectionPromise(c,n)}async startCacheReport(r){let s=this.configuration.get("preferAggregateCacheInfo")?{cacheHitCount:this.cacheHitCount,cacheMissCount:this.cacheMissCount}:null;try{return await r()}catch(a){throw this.reportExceptionOnce(a),a}finally{s!==null&&this.reportCacheChanges(s)}}reportSeparator(){this.indent===0?this.writeLineWithForgettableReset(""):this.reportInfo(null,"")}reportInfo(r,s){if(!this.includeInfos)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"",c=`${this.formatPrefix(n,"blueBright")}${s}`;if(this.json)this.reportJson({type:"info",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s});else if(this.forgettableNames.has(r))if(this.forgettableLines.push(c),this.forgettableLines.length>this.forgettableBufferSize){for(;this.forgettableLines.length>this.forgettableBufferSize;)this.forgettableLines.shift();this.writeLines(this.forgettableLines,{truncate:!0})}else this.writeLine(c,{truncate:!0});else this.writeLineWithForgettableReset(c)}reportWarning(r,s){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"warning",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLineWithForgettableReset(`${this.formatPrefix(n,"yellowBright")}${s}`)}reportError(r,s){this.errors.push([r,s]),this.reportErrorImpl(r,s)}reportErrorImpl(r,s){this.commit();let a=this.formatNameWithHyperlink(r),n=a?`${a}: `:"";this.json?this.reportJson({type:"error",name:r,displayName:this.formatName(r),indent:this.formatIndent(),data:s}):this.writeLineWithForgettableReset(`${this.formatPrefix(n,"redBright")}${s}`,{truncate:!1})}reportProgress(r){if(this.progressStyle===null)return{...Promise.resolve(),stop:()=>{}};if(r.hasProgress&&r.hasTitle)throw new Error("Unimplemented: Progress bars can't have both progress and titles.");let s=!1,a=Promise.resolve().then(async()=>{let c={progress:r.hasProgress?0:void 0,title:r.hasTitle?"":void 0};this.progress.set(r,{definition:c,lastScaledSize:r.hasProgress?-1:void 0,lastTitle:void 0}),this.refreshProgress({delta:-1});for await(let{progress:f,title:A}of r)s||c.progress===f&&c.title===A||(c.progress=f,c.title=A,this.refreshProgress());n()}),n=()=>{s||(s=!0,this.progress.delete(r),this.refreshProgress({delta:1}))};return{...a,stop:n}}reportJson(r){this.json&&this.writeLineWithForgettableReset(`${JSON.stringify(r)}`)}async finalize(){if(!this.includeFooter)return;let r="";this.errors.length>0?r="Failed with errors":this.warningCount>0?r="Done with warnings":r="Done";let s=di(this.configuration,Date.now()-this.startTime,un.DURATION),a=this.configuration.get("enableTimers")?`${r} in ${s}`:r;this.errors.length>0?this.reportError(0,a):this.warningCount>0?this.reportWarning(0,a):this.reportInfo(0,a)}writeLine(r,{truncate:s}={}){this.clearProgress({clear:!0}),this.stdout.write(`${this.truncate(r,{truncate:s})}
859
859
  `),this.writeProgress()}writeLineWithForgettableReset(r,{truncate:s}={}){this.forgettableLines=[],this.writeLine(r,{truncate:s})}writeLines(r,{truncate:s}={}){this.clearProgress({delta:r.length});for(let a of r)this.stdout.write(`${this.truncate(a,{truncate:s})}
860
860
  `);this.writeProgress()}reportCacheChanges({cacheHitCount:r,cacheMissCount:s}){let a=this.cacheHitCount-r,n=this.cacheMissCount-s;if(a===0&&n===0)return;let c="";this.cacheHitCount>1?c+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?c+=" - one package was already cached":c+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?c+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(c+=`, one had to be fetched (${bs(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?c+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(c+=` - one package had to be fetched (${bs(this.configuration,this.lastCacheMiss)})`),this.reportInfo(13,c)}commit(){let r=this.uncommitted;this.uncommitted=new Set;for(let s of r)s.committed=!0,s.action()}clearProgress({delta:r=0,clear:s=!1}){this.progressStyle!==null&&this.progress.size+r>0&&(this.stdout.write(`\x1B[${this.progress.size+r}A`),(r>0||s)&&this.stdout.write("\x1B[0J"))}writeProgress(){if(this.progressStyle===null||(this.progressTimeout!==null&&clearTimeout(this.progressTimeout),this.progressTimeout=null,this.progress.size===0))return;let r=Date.now();r-this.progressTime>SIe&&(this.progressFrame=(this.progressFrame+1)%xIe.length,this.progressTime=r);let s=xIe[this.progressFrame];for(let a of this.progress.values()){let n="";if(typeof a.lastScaledSize<"u"){let p=this.progressStyle.chars[0].repeat(a.lastScaledSize),d=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-a.lastScaledSize);n=` ${p}${d}`}let c=this.formatName(null),f=c?`${c}: `:"",A=a.definition.title?` ${a.definition.title}`:"";this.stdout.write(`${di(this.configuration,"\u27A4","blueBright")} ${f}${s}${n}${A}
861
- `)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},SIe)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,A=c.lastScaledSize;c.lastScaledSize=f;let p=c.lastTitle;if(c.lastTitle=c.definition.title,f!==A||(n=p!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>"u"&&(s=this.configuration.get("preferTruncatedLines")),s&&(r=(0,kIe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return PIe(r,{configuration:this.configuration,json:this.json})}formatPrefix(r,s){return this.includePrefix?`${di(this.configuration,"\u27A4",s)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return Pz(r,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var xs="3.6.0-git.20230603.hash-45f6ecc9";var QIe=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(QIe||{});async function BC(t,e,r,s=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${s.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await Ce.writeFilePromise(ee.format({dir:t,name:e,ext:".cmd"}),a)}await Ce.writeFilePromise(ee.join(t,e),`#!/bin/sh
861
+ `)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},SIe)}refreshProgress({delta:r=0,force:s=!1}={}){let a=!1,n=!1;if(s||this.progress.size===0)a=!0;else for(let c of this.progress.values()){let f=typeof c.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*c.definition.progress):void 0,A=c.lastScaledSize;c.lastScaledSize=f;let p=c.lastTitle;if(c.lastTitle=c.definition.title,f!==A||(n=p!==c.definition.title)){a=!0;break}}a&&(this.clearProgress({delta:r,clear:n}),this.writeProgress())}truncate(r,{truncate:s}={}){return this.progressStyle===null&&(s=!1),typeof s>"u"&&(s=this.configuration.get("preferTruncatedLines")),s&&(r=(0,kIe.default)(r,0,this.stdout.columns-1)),r}formatName(r){return PIe(r,{configuration:this.configuration,json:this.json})}formatPrefix(r,s){return this.includePrefix?`${di(this.configuration,"\u27A4",s)} ${r}${this.formatIndent()}`:""}formatNameWithHyperlink(r){return Pz(r,{configuration:this.configuration,json:this.json})}formatIndent(){return"\u2502 ".repeat(this.indent)}};var xs="3.6.0-git.20230603.hash-9645df4d";var QIe=(a=>(a.Yarn1="Yarn Classic",a.Yarn2="Yarn",a.Npm="npm",a.Pnpm="pnpm",a))(QIe||{});async function BC(t,e,r,s=[]){if(process.platform==="win32"){let a=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${s.map(n=>`"${n.replace('"','""')}"`).join(" ")} %*`;await Ce.writeFilePromise(ee.format({dir:t,name:e,ext:".cmd"}),a)}await Ce.writeFilePromise(ee.join(t,e),`#!/bin/sh
862
862
  exec "${r}" ${s.map(a=>`'${a.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@"
863
863
  `,{mode:493})}async function FIe(t){let e=await _r.tryFind(t);if(e!=null&&e.packageManager){let s=pK(e.packageManager);if(s!=null&&s.name){let a=`found ${JSON.stringify({packageManager:e.packageManager})} in manifest`,[n]=s.reference.split(".");switch(s.name){case"yarn":return{packageManagerField:!0,packageManager:Number(n)===1?"Yarn Classic":"Yarn",reason:a};case"npm":return{packageManagerField:!0,packageManager:"npm",reason:a};case"pnpm":return{packageManagerField:!0,packageManager:"pnpm",reason:a}}}}let r;try{r=await Ce.readFilePromise(ee.join(t,Fi.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:"Yarn",reason:'"__metadata" key found in yarn.lock'}:{packageManager:"Yarn Classic",reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:Ce.existsSync(ee.join(t,"package-lock.json"))?{packageManager:"npm",reason:`found npm's "package-lock.json" lockfile`}:Ce.existsSync(ee.join(t,"pnpm-lock.yaml"))?{packageManager:"pnpm",reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}async function EN({project:t,locator:e,binFolder:r,ignoreCorepack:s,lifecycleScript:a}){var p,d;let n={};for(let[y,v]of Object.entries(process.env))typeof v<"u"&&(n[y.toLowerCase()!=="path"?y:"PATH"]=v);let c=Qe.fromPortablePath(r);n.BERRY_BIN_FOLDER=Qe.fromPortablePath(c);let f=process.env.COREPACK_ROOT&&!s?Qe.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([BC(r,"node",process.execPath),...xs!==null?[BC(r,"run",process.execPath,[f,"run"]),BC(r,"yarn",process.execPath,[f]),BC(r,"yarnpkg",process.execPath,[f]),BC(r,"node-gyp",process.execPath,[f,"run","--top-level","node-gyp"])]:[]]),t&&(n.INIT_CWD=Qe.fromPortablePath(t.configuration.startingCwd),n.PROJECT_CWD=Qe.fromPortablePath(t.cwd)),n.PATH=n.PATH?`${c}${Qe.delimiter}${n.PATH}`:`${c}`,n.npm_execpath=`${c}${Qe.sep}yarn`,n.npm_node_execpath=`${c}${Qe.sep}node`,e){if(!t)throw new Error("Assertion failed: Missing project");let y=t.tryWorkspaceByLocator(e),v=y?(p=y.manifest.version)!=null?p:"":(d=t.storedPackages.get(e.locatorHash).version)!=null?d:"";n.npm_package_name=_o(e),n.npm_package_version=v;let x;if(y)x=y.cwd;else{let g=t.storedPackages.get(e.locatorHash);if(!g)throw new Error(`Package for ${bs(t.configuration,e)} not found in the project`);let Q=t.configuration.getLinkers(),O={project:t,report:new wt({stdout:new Kw.PassThrough,configuration:t.configuration})},M=Q.find(j=>j.supportsPackage(g,O));if(!M)throw new Error(`The package ${bs(t.configuration,g)} isn't supported by any of the available linkers`);x=await M.findPackageLocation(g,O)}n.npm_package_json=Qe.fromPortablePath(ee.join(x,Fi.manifest))}let A=xs!==null?`yarn/${xs}`:`yarn/${uk("@yarnpkg/core").version}-core`;return n.npm_config_user_agent=`${A} npm/? node/${process.version} ${process.platform} ${process.arch}`,a&&(n.npm_lifecycle_event=a),t&&await t.configuration.triggerHook(y=>y.setupScriptEnvironment,t,n,async(y,v,x)=>await BC(r,dl(y),v,x)),n}var N0t=2,L0t=(0,RIe.default)(N0t);async function O0t(t,e,{configuration:r,report:s,workspace:a=null,locator:n=null}){await L0t(async()=>{await Ce.mktempPromise(async c=>{let f=ee.join(c,"pack.log"),A=null,{stdout:p,stderr:d}=r.getSubprocessStreams(f,{prefix:Qe.fromPortablePath(t),report:s}),y=n&&gm(n)?WF(n):n,v=y?Rd(y):"an external project";p.write(`Packing ${v} from sources
864
864
  `);let x=await FIe(t),g;x!==null?(p.write(`Using ${x.packageManager} for bootstrap. Reason: ${x.reason}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yarnpkg/cli-dist",
3
- "version": "3.6.0-git.20230603.hash-45f6ecc9",
3
+ "version": "3.6.0-git.20230603.hash-9645df4d",
4
4
  "bin": {
5
5
  "yarn": "bin/yarn.js",
6
6
  "yarnpkg": "bin/yarn.js"