From 555473d9c070ef85cdb4d106805cf7283a05ee62 Mon Sep 17 00:00:00 2001 From: Nikita Elfimov Date: Fri, 15 Dec 2023 16:24:59 +0300 Subject: [PATCH] fix: watch mode --- yarn/cli/bundles/yarn.js | 4 ++-- yarn/plugin-test/src/test-integration.command.ts | 2 +- yarn/plugin-test/src/test-unit.command.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/yarn/cli/bundles/yarn.js b/yarn/cli/bundles/yarn.js index fbaf67706..db446e67e 100644 --- a/yarn/cli/bundles/yarn.js +++ b/yarn/cli/bundles/yarn.js @@ -170,7 +170,7 @@ Please report this to https://github.com/szmarczak/http2-wrapper/`);v(_)}return} `,end:e=>`section_end:${Math.floor(Date.now()/1e3)}:${e.toLowerCase().replace(/\W+/g,"_")}\r\x1B[0K`}:null,U0t=new Date,WUr=["iTerm.app","Apple_Terminal","WarpTerminal","vscode"].includes(process.env.TERM_PROGRAM)||!!process.env.WT_SESSION,YUr=e=>e,ufe=YUr({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}}),VUr=WUr&&Object.keys(ufe).find(e=>{let t=ufe[e];return!(t.date&&(t.date[0]!==U0t.getDate()||t.date[1]!==U0t.getMonth()+1))})||"default";function P_e(e,{configuration:t,json:r}){if(!t.get("enableMessageNames"))return"";let n=e===null?0:e,o=(0,zD.stringifyMessageName)(n);return!r&&e===null?eB.pretty(t,o,"grey"):o}TT.formatName=P_e;function q0t(e,{configuration:t,json:r}){let n=P_e(e,{configuration:t,json:r});if(!n||e===null||e===zD.MessageName.UNNAMED)return n;let o=zD.MessageName[e],a=`https://yarnpkg.com/advanced/error-codes#${n}---${o}`.toLowerCase();return eB.applyHyperlink(t,n,a)}TT.formatNameWithHyperlink=q0t;var k_e=class extends HUr.Report{static async start(t,r){let n=new this(t),o=process.emitWarning;process.emitWarning=(a,u)=>{if(typeof a!="string"){let d=a;a=d.message,u=u??d.name}let l=typeof u<"u"?`${u}: ${a}`:a;n.reportWarning(zD.MessageName.UNNAMED,l)};try{await r(n)}catch(a){n.reportExceptionOnce(a)}finally{await n.finalize(),process.emitWarning=o}return n}constructor({configuration:t,stdout:r,json:n=!1,includeNames:o=!0,includePrefix:a=!0,includeFooter:u=!0,includeLogs:l=!n,includeInfos:d=l,includeWarnings:A=l,forgettableBufferSize:m=zUr,forgettableNames:I=new Set}){if(super(),this.uncommitted=new Set,this.cacheHitCount=0,this.cacheMissCount=0,this.lastCacheMiss=null,this.warningCount=0,this.errorCount=0,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=[],eB.addLogFilterSupport(this,{configuration:t}),this.configuration=t,this.forgettableBufferSize=m,this.forgettableNames=new Set([...I,...JUr]),this.includeNames=o,this.includePrefix=a,this.includeFooter=u,this.includeInfos=d,this.includeWarnings=A,this.json=n,this.stdout=r,t.get("enableProgressBars")&&!n&&r.isTTY&&r.columns>22){let b=t.get("progressBarStyle")||VUr;if(!Object.prototype.hasOwnProperty.call(ufe,b))throw new Error("Assertion failed: Invalid progress bar style");this.progressStyle=ufe[b];let S=12,v=Math.max(0,Math.min(r.columns-S,80));this.progressMaxScaledSize=Math.floor(this.progressStyle.size*v/80)}}hasErrors(){return this.errorCount>0}exitCode(){return this.hasErrors()?1:0}reportCacheHit(t){this.cacheHitCount+=1}reportCacheMiss(t,r){this.lastCacheMiss=t,this.cacheMissCount+=1,typeof r<"u"&&!this.configuration.get("preferAggregateCacheInfo")&&this.reportInfo(zD.MessageName.FETCH_NOT_CACHED,r)}startSectionSync({reportHeader:t,reportFooter:r,skipIfEmpty:n},o){let a={committed:!1,action:()=>{t==null||t()}};n?this.uncommitted.add(a):(a.action(),a.committed=!0);let u=Date.now();try{return o()}catch(l){throw this.reportExceptionOnce(l),l}finally{let l=Date.now();this.uncommitted.delete(a),a.committed&&(r==null||r(l-u))}}async startSectionPromise({reportHeader:t,reportFooter:r,skipIfEmpty:n},o){let a={committed:!1,action:()=>{t==null||t()}};n?this.uncommitted.add(a):(a.action(),a.committed=!0);let u=Date.now();try{return await o()}catch(l){throw this.reportExceptionOnce(l),l}finally{let l=Date.now();this.uncommitted.delete(a),a.committed&&(r==null||r(l-u))}}startTimerImpl(t,r,n){return{cb:typeof r=="function"?r:n,reportHeader:()=>{this.reportInfo(null,`\u250C ${t}`),this.indent+=1,sfe!==null&&!this.json&&this.includeInfos&&this.stdout.write(sfe.start(t))},reportFooter:u=>{this.indent-=1,sfe!==null&&!this.json&&this.includeInfos&&this.stdout.write(sfe.end(t)),this.configuration.get("enableTimers")&&u>200?this.reportInfo(null,`\u2514 Completed in ${eB.pretty(this.configuration,u,eB.Type.DURATION)}`):this.reportInfo(null,"\u2514 Completed")},skipIfEmpty:(typeof r=="function"?{}:r).skipIfEmpty}}startTimerSync(t,r,n){let{cb:o,...a}=this.startTimerImpl(t,r,n);return this.startSectionSync(a,o)}async startTimerPromise(t,r,n){let{cb:o,...a}=this.startTimerImpl(t,r,n);return this.startSectionPromise(a,o)}async startCacheReport(t){let r=this.configuration.get("preferAggregateCacheInfo")?{cacheHitCount:this.cacheHitCount,cacheMissCount:this.cacheMissCount}:null;try{return await t()}catch(n){throw this.reportExceptionOnce(n),n}finally{r!==null&&this.reportCacheChanges(r)}}reportSeparator(){this.indent===0?this.writeLineWithForgettableReset(""):this.reportInfo(null,"")}reportInfo(t,r){if(!this.includeInfos)return;this.commit();let n=this.formatNameWithHyperlink(t),o=n?`${n}: `:"",a=`${this.formatPrefix(o,"blueBright")}${r}`;if(this.json)this.reportJson({type:"info",name:t,displayName:this.formatName(t),indent:this.formatIndent(),data:r});else if(this.forgettableNames.has(t))if(this.forgettableLines.push(a),this.forgettableLines.length>this.forgettableBufferSize){for(;this.forgettableLines.length>this.forgettableBufferSize;)this.forgettableLines.shift();this.writeLines(this.forgettableLines,{truncate:!0})}else this.writeLine(a,{truncate:!0});else this.writeLineWithForgettableReset(a)}reportWarning(t,r){if(this.warningCount+=1,!this.includeWarnings)return;this.commit();let n=this.formatNameWithHyperlink(t),o=n?`${n}: `:"";this.json?this.reportJson({type:"warning",name:t,displayName:this.formatName(t),indent:this.formatIndent(),data:r}):this.writeLineWithForgettableReset(`${this.formatPrefix(o,"yellowBright")}${r}`)}reportError(t,r){this.errorCount+=1,this.commit();let n=this.formatNameWithHyperlink(t),o=n?`${n}: `:"";this.json?this.reportJson({type:"error",name:t,displayName:this.formatName(t),indent:this.formatIndent(),data:r}):this.writeLineWithForgettableReset(`${this.formatPrefix(o,"redBright")}${r}`,{truncate:!1})}reportProgress(t){if(this.progressStyle===null)return{...Promise.resolve(),stop:()=>{}};if(t.hasProgress&&t.hasTitle)throw new Error("Unimplemented: Progress bars can't have both progress and titles.");let r=!1,n=Promise.resolve().then(async()=>{let a={progress:t.hasProgress?0:void 0,title:t.hasTitle?"":void 0};this.progress.set(t,{definition:a,lastScaledSize:t.hasProgress?-1:void 0,lastTitle:void 0}),this.refreshProgress({delta:-1});for await(let{progress:u,title:l}of t)r||a.progress===u&&a.title===l||(a.progress=u,a.title=l,this.refreshProgress());o()}),o=()=>{r||(r=!0,this.progress.delete(t),this.refreshProgress({delta:1}))};return{...n,stop:o}}reportJson(t){this.json&&this.writeLineWithForgettableReset(`${JSON.stringify(t)}`)}async finalize(){if(!this.includeFooter)return;let t="";this.errorCount>0?t="Failed with errors":this.warningCount>0?t="Done with warnings":t="Done";let r=eB.pretty(this.configuration,Date.now()-this.startTime,eB.Type.DURATION),n=this.configuration.get("enableTimers")?`${t} in ${r}`:t;this.errorCount>0?this.reportError(zD.MessageName.UNNAMED,n):this.warningCount>0?this.reportWarning(zD.MessageName.UNNAMED,n):this.reportInfo(zD.MessageName.UNNAMED,n)}writeLine(t,{truncate:r}={}){this.clearProgress({clear:!0}),this.stdout.write(`${this.truncate(t,{truncate:r})} `),this.writeProgress()}writeLineWithForgettableReset(t,{truncate:r}={}){this.forgettableLines=[],this.writeLine(t,{truncate:r})}writeLines(t,{truncate:r}={}){this.clearProgress({delta:t.length});for(let n of t)this.stdout.write(`${this.truncate(n,{truncate:r})} `);this.writeProgress()}reportCacheChanges({cacheHitCount:t,cacheMissCount:r}){let n=this.cacheHitCount-t,o=this.cacheMissCount-r;if(n===0&&o===0)return;let a="";this.cacheHitCount>1?a+=`${this.cacheHitCount} packages were already cached`:this.cacheHitCount===1?a+=" - one package was already cached":a+="No packages were cached",this.cacheHitCount>0?this.cacheMissCount>1?a+=`, ${this.cacheMissCount} had to be fetched`:this.cacheMissCount===1&&(a+=`, one had to be fetched (${R0t.prettyLocator(this.configuration,this.lastCacheMiss)})`):this.cacheMissCount>1?a+=` - ${this.cacheMissCount} packages had to be fetched`:this.cacheMissCount===1&&(a+=` - one package had to be fetched (${R0t.prettyLocator(this.configuration,this.lastCacheMiss)})`),this.reportInfo(zD.MessageName.FETCH_NOT_CACHED,a)}commit(){let t=this.uncommitted;this.uncommitted=new Set;for(let r of t)r.committed=!0,r.action()}clearProgress({delta:t=0,clear:r=!1}){this.progressStyle!==null&&this.progress.size+t>0&&(this.stdout.write(`\x1B[${this.progress.size+t}A`),(t>0||r)&&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 t=Date.now();t-this.progressTime>M0t&&(this.progressFrame=(this.progressFrame+1)%L0t.length,this.progressTime=t);let r=L0t[this.progressFrame];for(let n of this.progress.values()){let o="";if(typeof n.lastScaledSize<"u"){let d=this.progressStyle.chars[0].repeat(n.lastScaledSize),A=this.progressStyle.chars[1].repeat(this.progressMaxScaledSize-n.lastScaledSize);o=` ${d}${A}`}let a=this.formatName(null),u=a?`${a}: `:"",l=n.definition.title?` ${n.definition.title}`:"";this.stdout.write(`${eB.pretty(this.configuration,"\u27A4","blueBright")} ${u}${r}${o}${l} -`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},M0t)}refreshProgress({delta:t=0,force:r=!1}={}){let n=!1,o=!1;if(r||this.progress.size===0)n=!0;else for(let a of this.progress.values()){let u=typeof a.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*a.definition.progress):void 0,l=a.lastScaledSize;a.lastScaledSize=u;let d=a.lastTitle;if(a.lastTitle=a.definition.title,u!==l||(o=d!==a.definition.title)){n=!0;break}}n&&(this.clearProgress({delta:t,clear:o}),this.writeProgress())}truncate(t,{truncate:r}={}){return this.progressStyle===null&&(r=!1),typeof r>"u"&&(r=this.configuration.get("preferTruncatedLines")),r&&(t=(0,GUr.default)(t,0,this.stdout.columns-1)),t}formatName(t){return this.includeNames?P_e(t,{configuration:this.configuration,json:this.json}):""}formatPrefix(t,r){return this.includePrefix?`${eB.pretty(this.configuration,"\u27A4",r)} ${t}${this.formatIndent()}`:""}formatNameWithHyperlink(t){return this.includeNames?q0t(t,{configuration:this.configuration,json:this.json}):""}formatIndent(){return"\u2502 ".repeat(this.indent)}};TT.StreamReport=k_e});var N_e=ee(ffe=>{"use strict";Object.defineProperty(ffe,"__esModule",{value:!0});ffe.YarnVersion=void 0;ffe.YarnVersion="0.0.1-git.20231215.hash-6b831fb9"});var L_e=ee(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.executeWorkspaceAccessibleBinary=Np.executePackageAccessibleBinary=Np.getWorkspaceAccessibleBinaries=Np.getPackageAccessibleBinaries=Np.maybeExecuteWorkspaceLifecycleScript=Np.executeWorkspaceLifecycleScript=Np.hasWorkspaceScript=Np.executeWorkspaceScript=Np.executePackageShellcode=Np.executePackageScript=Np.hasPackageScript=Np.prepareExternalProject=Np.makeScriptEnv=Np.detectPackageManager=Np.PackageManager=void 0;var x9=io(),_T=up(),nl=up(),j0t=zO(),G0t=l_e(),KUr=x9.__importDefault(ife()),XUr=x9.__importDefault(YP()),lL=mr("stream"),O_e=JR(),Q_e=N2(),H0t=TI(),dfe=lfe(),F_e=N_e(),OI=x9.__importStar(jle()),l4=x9.__importStar(BI()),b9=x9.__importStar(uC()),ZUr=x9.__importStar(yT()),Km=x9.__importStar(k1()),R2;(function(e){e.Yarn1="Yarn Classic",e.Yarn2="Yarn",e.Npm="npm",e.Pnpm="pnpm"})(R2=Np.PackageManager||(Np.PackageManager={}));async function tB(e,t,r,n=[]){if(process.platform==="win32"){let o=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${n.map(a=>`"${a.replace('"','""')}"`).join(" ")} %*`;await nl.xfs.writeFilePromise(nl.ppath.format({dir:e,name:t,ext:".cmd"}),o)}await nl.xfs.writeFilePromise(nl.ppath.join(e,t),`#!/bin/sh +`)}this.progressTimeout=setTimeout(()=>{this.refreshProgress({force:!0})},M0t)}refreshProgress({delta:t=0,force:r=!1}={}){let n=!1,o=!1;if(r||this.progress.size===0)n=!0;else for(let a of this.progress.values()){let u=typeof a.definition.progress<"u"?Math.trunc(this.progressMaxScaledSize*a.definition.progress):void 0,l=a.lastScaledSize;a.lastScaledSize=u;let d=a.lastTitle;if(a.lastTitle=a.definition.title,u!==l||(o=d!==a.definition.title)){n=!0;break}}n&&(this.clearProgress({delta:t,clear:o}),this.writeProgress())}truncate(t,{truncate:r}={}){return this.progressStyle===null&&(r=!1),typeof r>"u"&&(r=this.configuration.get("preferTruncatedLines")),r&&(t=(0,GUr.default)(t,0,this.stdout.columns-1)),t}formatName(t){return this.includeNames?P_e(t,{configuration:this.configuration,json:this.json}):""}formatPrefix(t,r){return this.includePrefix?`${eB.pretty(this.configuration,"\u27A4",r)} ${t}${this.formatIndent()}`:""}formatNameWithHyperlink(t){return this.includeNames?q0t(t,{configuration:this.configuration,json:this.json}):""}formatIndent(){return"\u2502 ".repeat(this.indent)}};TT.StreamReport=k_e});var N_e=ee(ffe=>{"use strict";Object.defineProperty(ffe,"__esModule",{value:!0});ffe.YarnVersion=void 0;ffe.YarnVersion="0.0.1-git.20231215.hash-500837d1"});var L_e=ee(Np=>{"use strict";Object.defineProperty(Np,"__esModule",{value:!0});Np.executeWorkspaceAccessibleBinary=Np.executePackageAccessibleBinary=Np.getWorkspaceAccessibleBinaries=Np.getPackageAccessibleBinaries=Np.maybeExecuteWorkspaceLifecycleScript=Np.executeWorkspaceLifecycleScript=Np.hasWorkspaceScript=Np.executeWorkspaceScript=Np.executePackageShellcode=Np.executePackageScript=Np.hasPackageScript=Np.prepareExternalProject=Np.makeScriptEnv=Np.detectPackageManager=Np.PackageManager=void 0;var x9=io(),_T=up(),nl=up(),j0t=zO(),G0t=l_e(),KUr=x9.__importDefault(ife()),XUr=x9.__importDefault(YP()),lL=mr("stream"),O_e=JR(),Q_e=N2(),H0t=TI(),dfe=lfe(),F_e=N_e(),OI=x9.__importStar(jle()),l4=x9.__importStar(BI()),b9=x9.__importStar(uC()),ZUr=x9.__importStar(yT()),Km=x9.__importStar(k1()),R2;(function(e){e.Yarn1="Yarn Classic",e.Yarn2="Yarn",e.Npm="npm",e.Pnpm="pnpm"})(R2=Np.PackageManager||(Np.PackageManager={}));async function tB(e,t,r,n=[]){if(process.platform==="win32"){let o=`@goto #_undefined_# 2>NUL || @title %COMSPEC% & @setlocal & @"${r}" ${n.map(a=>`"${a.replace('"','""')}"`).join(" ")} %*`;await nl.xfs.writeFilePromise(nl.ppath.format({dir:e,name:t,ext:".cmd"}),o)}await nl.xfs.writeFilePromise(nl.ppath.join(e,t),`#!/bin/sh exec "${r}" ${n.map(o=>`'${o.replace(/'/g,`'"'"'`)}'`).join(" ")} "$@" `,{mode:493})}async function J0t(e){let t=await O_e.Manifest.tryFind(e);if(t!=null&&t.packageManager){let n=Km.tryParseLocator(t.packageManager);if(n!=null&&n.name){let o=`found ${JSON.stringify({packageManager:t.packageManager})} in manifest`,[a]=n.reference.split(".");switch(n.name){case"yarn":return{packageManagerField:!0,packageManager:Number(a)===1?R2.Yarn1:R2.Yarn2,reason:o};case"npm":return{packageManagerField:!0,packageManager:R2.Npm,reason:o};case"pnpm":return{packageManagerField:!0,packageManager:R2.Pnpm,reason:o}}}}let r;try{r=await nl.xfs.readFilePromise(nl.ppath.join(e,_T.Filename.lockfile),"utf8")}catch{}return r!==void 0?r.match(/^__metadata:$/m)?{packageManager:R2.Yarn2,reason:'"__metadata" key found in yarn.lock'}:{packageManager:R2.Yarn1,reason:'"__metadata" key not found in yarn.lock, must be a Yarn classic lockfile'}:nl.xfs.existsSync(nl.ppath.join(e,"package-lock.json"))?{packageManager:R2.Npm,reason:`found npm's "package-lock.json" lockfile`}:nl.xfs.existsSync(nl.ppath.join(e,"pnpm-lock.yaml"))?{packageManager:R2.Pnpm,reason:`found pnpm's "pnpm-lock.yaml" lockfile`}:null}Np.detectPackageManager=J0t;async function xY({project:e,locator:t,binFolder:r,ignoreCorepack:n,lifecycleScript:o}){var a,u;let l={};for(let[I,b]of Object.entries(process.env))typeof b<"u"&&(l[I.toLowerCase()!=="path"?I:"PATH"]=b);let d=nl.npath.fromPortablePath(r);l.BERRY_BIN_FOLDER=nl.npath.fromPortablePath(d);let A=process.env.COREPACK_ROOT&&!n?nl.npath.join(process.env.COREPACK_ROOT,"dist/yarn.js"):process.argv[1];if(await Promise.all([tB(r,"node",process.execPath),...F_e.YarnVersion!==null?[tB(r,"run",process.execPath,[A,"run"]),tB(r,"yarn",process.execPath,[A]),tB(r,"yarnpkg",process.execPath,[A]),tB(r,"node-gyp",process.execPath,[A,"run","--top-level","node-gyp"])]:[]]),e&&(l.INIT_CWD=nl.npath.cwd(),l.PROJECT_CWD=nl.npath.fromPortablePath(e.cwd)),l.PATH=l.PATH?`${d}${nl.npath.delimiter}${l.PATH}`:`${d}`,l.npm_execpath=`${d}${nl.npath.sep}yarn`,l.npm_node_execpath=`${d}${nl.npath.sep}node`,t){if(!e)throw new Error("Assertion failed: Missing project");let I=e.tryWorkspaceByLocator(t),b=I?(a=I.manifest.version)!==null&&a!==void 0?a:"":(u=e.storedPackages.get(t.locatorHash).version)!==null&&u!==void 0?u:"";l.npm_package_name=Km.stringifyIdent(t),l.npm_package_version=b;let S;if(I)S=I.cwd;else{let v=e.storedPackages.get(t.locatorHash);if(!v)throw new Error(`Package for ${Km.prettyLocator(e.configuration,t)} not found in the project`);let _=e.configuration.getLinkers(),T={project:e,report:new dfe.StreamReport({stdout:new lL.PassThrough,configuration:e.configuration})},L=_.find(P=>P.supportsPackage(v,T));if(!L)throw new Error(`The package ${Km.prettyLocator(e.configuration,v)} isn't supported by any of the available linkers`);S=await L.findPackageLocation(v,T)}l.npm_package_json=nl.npath.fromPortablePath(nl.ppath.join(S,_T.Filename.manifest))}let m=F_e.YarnVersion!==null?`yarn/${F_e.YarnVersion}`:`yarn/${b9.dynamicRequire("@yarnpkg/core").version}-core`;return l.npm_config_user_agent=`${m} npm/? node/${process.version} ${process.platform} ${process.arch}`,o&&(l.npm_lifecycle_event=o),e&&await e.configuration.triggerHook(I=>I.setupScriptEnvironment,e,l,async(I,b,S)=>await tB(r,(0,nl.toFilename)(I),b,S)),l}Np.makeScriptEnv=xY;var $Ur=2,eqr=(0,XUr.default)($Ur);async function tqr(e,t,{configuration:r,report:n,workspace:o=null,locator:a=null}){await eqr(async()=>{await nl.xfs.mktempPromise(async u=>{let l=nl.ppath.join(u,"pack.log"),d=null,{stdout:A,stderr:m}=r.getSubprocessStreams(l,{prefix:nl.npath.fromPortablePath(e),report:n}),I=a&&Km.isVirtualLocator(a)?Km.devirtualizeLocator(a):a,b=I?Km.stringifyLocator(I):"an external project";A.write(`Packing ${b} from sources `);let S=await J0t(e),v;S!==null?(A.write(`Using ${S.packageManager} for bootstrap. Reason: ${S.reason} @@ -1652,7 +1652,7 @@ ${v[1]} `)}};P$.paths=[["commit","message"]];var otr=$r(Ps()),str=$r(atr());Gs();var CXn={"*.{yml,yaml,json,graphql,md}":"yarn format","*.{js,jsx,ts,tsx}":["yarn format","yarn lint"],"*.{ts,tsx}":["yarn typecheck"],"*.{tsx,ts}":["yarn test unit --bail --find-related-tests"]},Nee=class extends otr.BaseCommand{constructor(){super(...arguments);this.args=Cl.Rest({required:0})}async execute(){try{return await(0,str.default)({config:CXn,debug:!1})?0:1}catch{return 1}}};Nee.paths=[["commit","staged"]];var utr={commands:[P$,pZ,Nee]};var iJe={};Yd(iJe,{FormatCommand:()=>Rj,default:()=>Ptr});var btr=$r(Ps()),xtr=$r(Rn()),Btr=$r(Rn()),Ttr=$r(Rn()),_tr=$r(Rn()),ktr=$r(Ho());Gs();var U7=$r(Ho()),R2e=$r(Vy()),Itr=$r(Vy());var Etr=$r(tJe()),n6=$r(Ho()),Qee=$r(Vy()),Q2e=$r(Vy()),Ctr=$r(Vy()),rJe=$r(Ho());var ytr=$r(mr("fs")),vtr=e=>{if(e.sourceMap)return e.sourceMap.payload.sourcesContent[0];if(e.file)try{return ytr.default.readFileSync(e.file,"utf-8")}catch{}return null};var O2e=({children:e})=>{var n,o,a;let t=(0,rJe.useMemo)(()=>(0,Etr.parse)(e),[e]),r=(0,rJe.useMemo)(()=>t!=null&&t.topFrame?vtr(t.topFrame):null,[t]);return t?n6.default.createElement(Q2e.Box,{flexDirection:"column",flexGrow:1},r&&((n=t==null?void 0:t.topFrame)==null?void 0:n.line)&&n6.default.createElement(Q2e.Box,null,n6.default.createElement(NM,{line:(o=t==null?void 0:t.topFrame)==null?void 0:o.line,column:(a=t==null?void 0:t.topFrame)==null?void 0:a.column},r)),t.frames.map((u,l)=>n6.default.createElement(Q2e.Box,{key:`${u.file}-${u.line}-${u.column}-${l}`,justifyContent:"flex-end"},n6.default.createElement(Qee.Text,null,u.function),n6.default.createElement(Ctr.Spacer,null),n6.default.createElement(Qee.Text,{color:"gray"},u.file),u.line&&n6.default.createElement(Qee.Text,{color:"gray"},":",u.line),u.column&&n6.default.createElement(Qee.Text,{color:"gray"},":",u.column)))):null};var GXn=({children:e})=>e?U7.default.createElement(R2e.Box,{marginBottom:1},U7.default.createElement(Itr.Text,{color:"red",bold:!0},e)):null,Ew=({error:e})=>U7.default.createElement(R2e.Box,{flexDirection:"column"},U7.default.createElement(GXn,null,e.message),e.stack&&U7.default.createElement(R2e.Box,null,U7.default.createElement(O2e,null,e.stack)));var Str=$r(Dtr()),L2e=class{constructor(t){this.cwd=t}async run(t){return j1.run((0,Str.getContent)(),{cwd:this.cwd,files:t})}};var Rj=class extends btr.BaseCommand{constructor(){super(...arguments);this.files=Cl.Rest({required:0})}async execute(){let r=await Ttr.Configuration.find(this.context.cwd,this.context.plugins),{project:n}=await _tr.Project.find(r,this.context.cwd);return(await xtr.StreamReport.start({stdout:this.context.stdout,configuration:r},async a=>{await a.startTimerPromise("Format",async()=>{let u=new tm(this.context.stdout,r);u.start();try{await new L2e(n.cwd).run(this.files),u.end()}catch(l){u.end(),Qg(ktr.default.createElement(Ew,{error:l}),process.stdout.columns-12).split(` `).forEach(d=>{a.reportError(Btr.MessageName.UNNAMED,d)})}})})).exitCode()}};Rj.paths=[["format"]];var Ptr={commands:[Rj]};var sJe={};Yd(sJe,{LintCommand:()=>Lj,default:()=>Rtr});var Ntr=$r(Ps()),Ftr=$r(Rn()),Qtr=$r(Rn()),aJe=$r(Rn()),Otr=$r(Rn()),oJe=$r(Ho());Gs();var Lj=class extends Ntr.BaseCommand{constructor(){super(...arguments);this.files=Cl.Rest({required:0})}async execute(){let r=await Qtr.Configuration.find(this.context.cwd,this.context.plugins),{project:n}=await Otr.Project.find(r,this.context.cwd);return(await Ftr.StreamReport.start({stdout:this.context.stdout,configuration:r},async a=>{await a.startTimerPromise("Lint",async()=>{let u=new tm(this.context.stdout,r);u.start();try{let l=await new QM(n.cwd).run(this.files);u.end(),l.filter(d=>d.messages.length>0).forEach(d=>{Qg(oJe.default.createElement(KAe,{...d})).split(` `).forEach(m=>a.reportError(aJe.MessageName.UNNAMED,m))})}catch(l){u.end(),Qg(oJe.default.createElement(Ew,{error:l}),process.stdout.columns-12).split(` -`).forEach(d=>{a.reportError(aJe.MessageName.UNNAMED,d)})}})})).exitCode()}};Lj.paths=[["lint"]];var Rtr={commands:[Lj]};var uJe={};Yd(uJe,{TestIntegrationCommand:()=>Mj,TestUnitCommand:()=>Uj,default:()=>ztr});var Ltr=$r(Ps()),Mtr=$r(Rn()),Utr=$r(Rn()),qtr=$r(Rn());Gs();var Mj=class extends Ltr.BaseCommand{constructor(){super(...arguments);this.bail=Cl.Boolean("-b,--bail",!1);this.updateSnapshot=Cl.Boolean("-u,--update-shapshot",!1);this.findRelatedTests=Cl.Boolean("--find-related-tests",!1);this.watchMode=Cl.Boolean("--watch",!1);this.watchAllMode=Cl.Boolean("--watchAll",!1);this.files=Cl.Rest({required:0})}async execute(){let r=await Utr.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:o}=await qtr.Project.find(r,this.context.cwd),a=[];if(o){let l=this.context.cwd.replace(n.cwd,"");a.push(l.startsWith("/")?l.substr(1):l)}return(await Mtr.StreamReport.start({stdout:this.context.stdout,configuration:r},async()=>{await new R4(n.cwd).run("integration",{findRelatedTests:this.findRelatedTests,updateSnapshot:this.updateSnapshot,bail:this.bail,watch:this.watchMode,watchAll:this.watchAllMode},a.concat(this.files))})).exitCode()}};Mj.paths=[["test","integration"]];var jtr=$r(Ps()),Gtr=$r(Rn()),Htr=$r(Rn()),Jtr=$r(Rn());Gs();var Uj=class extends jtr.BaseCommand{constructor(){super(...arguments);this.bail=Cl.Boolean("-b,--bail",!1);this.updateSnapshot=Cl.Boolean("-u,--update-shapshot",!1);this.findRelatedTests=Cl.Boolean("--find-related-tests",!1);this.watchMode=Cl.Boolean("--watch",!1);this.watchAllMode=Cl.Boolean("--watchAll",!1);this.files=Cl.Rest({required:0})}async execute(){let r=await Htr.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:o}=await Jtr.Project.find(r,this.context.cwd),a=[];if(o){let l=this.context.cwd.replace(n.cwd,"");a.push(l.startsWith("/")?l.slice(1):l)}return(await Gtr.StreamReport.start({stdout:this.context.stdout,configuration:r},async()=>{await new R4(n.cwd).run("unit",{findRelatedTests:this.findRelatedTests,updateSnapshot:this.updateSnapshot,bail:this.bail,watch:this.watchMode,watchAll:this.watchAllMode},a.concat(this.files))})).exitCode()}};Uj.paths=[["test","unit"]];var ztr={commands:[Mj,Uj]};var mze={};Yd(mze,{ImagePackCommand:()=>rG,default:()=>kar});var Car=mr("fs/promises"),Iar=$r(Ps()),war=$r(Rn()),Dar=$r(Rn()),Sar=$r(Rn()),bar=$r(hJe()),gze=$r(Rn()),hze=$r(ks()),xar=$r(ks()),Bar=$r(ks()),Tar=$r(Mnr());Gs();var _ar=mr("path");var nEe={};Yd(nEe,{getContext:()=>Hnr,getPullRequestId:()=>M$n,getPullRequestNumber:()=>jnr,getPullRequestSha:()=>qnr,getRevision:()=>Gnr,getTag:()=>Jnr});var rEe=$r(oU()),Unr=$r(Rn()),qnr=()=>{var t,r;let e=rEe.context.payload;return process.env.GITHUB_PULL_REQUST_HEAD_SHA||e.after||((r=(t=e.pull_request)==null?void 0:t.head)==null?void 0:r.sha)||process.env.GITHUB_SHA},M$n=()=>{var t;return(t=rEe.context.payload.pull_request)==null?void 0:t.id},jnr=()=>{var t;let e=rEe.context.payload;return String((t=e.pull_request)==null?void 0:t.number)},Gnr=async()=>{if(process.env.GITHUB_EVENT_PATH&&process.env.GITHUB_TOKEN)return qnr();let{stdout:e}=await Unr.execUtils.execvp("git",["log","-1",'--format="%H"'],{cwd:process.cwd(),strict:!0}),[t]=e.split(` +`).forEach(d=>{a.reportError(aJe.MessageName.UNNAMED,d)})}})})).exitCode()}};Lj.paths=[["lint"]];var Rtr={commands:[Lj]};var uJe={};Yd(uJe,{TestIntegrationCommand:()=>Mj,TestUnitCommand:()=>Uj,default:()=>ztr});var Ltr=$r(Ps()),Mtr=$r(Rn()),Utr=$r(Rn()),qtr=$r(Rn());Gs();var Mj=class extends Ltr.BaseCommand{constructor(){super(...arguments);this.bail=Cl.Boolean("-b,--bail",!1);this.updateSnapshot=Cl.Boolean("-u,--update-shapshot",!1);this.findRelatedTests=Cl.Boolean("--find-related-tests",!1);this.watchMode=Cl.Boolean("--watch",!1);this.watchAllMode=Cl.Boolean("--watchAll");this.files=Cl.Rest({required:0})}async execute(){let r=await Utr.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:o}=await qtr.Project.find(r,this.context.cwd),a=[];if(o){let l=this.context.cwd.replace(n.cwd,"");a.push(l.startsWith("/")?l.substr(1):l)}return(await Mtr.StreamReport.start({stdout:this.context.stdout,configuration:r},async()=>{await new R4(n.cwd).run("integration",{findRelatedTests:this.findRelatedTests,updateSnapshot:this.updateSnapshot,bail:this.bail,watch:this.watchMode,watchAll:this.watchAllMode},a.concat(this.files))})).exitCode()}};Mj.paths=[["test","integration"]];var jtr=$r(Ps()),Gtr=$r(Rn()),Htr=$r(Rn()),Jtr=$r(Rn());Gs();var Uj=class extends jtr.BaseCommand{constructor(){super(...arguments);this.bail=Cl.Boolean("-b,--bail",!1);this.updateSnapshot=Cl.Boolean("-u,--update-shapshot",!1);this.findRelatedTests=Cl.Boolean("--find-related-tests",!1);this.watchMode=Cl.Boolean("--watch",!1);this.watchAllMode=Cl.Boolean("--watchAll");this.files=Cl.Rest({required:0})}async execute(){let r=await Htr.Configuration.find(this.context.cwd,this.context.plugins),{project:n,workspace:o}=await Jtr.Project.find(r,this.context.cwd),a=[];if(o){let l=this.context.cwd.replace(n.cwd,"");a.push(l.startsWith("/")?l.slice(1):l)}return(await Gtr.StreamReport.start({stdout:this.context.stdout,configuration:r},async()=>{await new R4(n.cwd).run("unit",{findRelatedTests:this.findRelatedTests,updateSnapshot:this.updateSnapshot,bail:this.bail,watch:this.watchMode,watchAll:this.watchAllMode},a.concat(this.files))})).exitCode()}};Uj.paths=[["test","unit"]];var ztr={commands:[Mj,Uj]};var mze={};Yd(mze,{ImagePackCommand:()=>rG,default:()=>kar});var Car=mr("fs/promises"),Iar=$r(Ps()),war=$r(Rn()),Dar=$r(Rn()),Sar=$r(Rn()),bar=$r(hJe()),gze=$r(Rn()),hze=$r(ks()),xar=$r(ks()),Bar=$r(ks()),Tar=$r(Mnr());Gs();var _ar=mr("path");var nEe={};Yd(nEe,{getContext:()=>Hnr,getPullRequestId:()=>M$n,getPullRequestNumber:()=>jnr,getPullRequestSha:()=>qnr,getRevision:()=>Gnr,getTag:()=>Jnr});var rEe=$r(oU()),Unr=$r(Rn()),qnr=()=>{var t,r;let e=rEe.context.payload;return process.env.GITHUB_PULL_REQUST_HEAD_SHA||e.after||((r=(t=e.pull_request)==null?void 0:t.head)==null?void 0:r.sha)||process.env.GITHUB_SHA},M$n=()=>{var t;return(t=rEe.context.payload.pull_request)==null?void 0:t.id},jnr=()=>{var t;let e=rEe.context.payload;return String((t=e.pull_request)==null?void 0:t.number)},Gnr=async()=>{if(process.env.GITHUB_EVENT_PATH&&process.env.GITHUB_TOKEN)return qnr();let{stdout:e}=await Unr.execUtils.execvp("git",["log","-1",'--format="%H"'],{cwd:process.cwd(),strict:!0}),[t]=e.split(` `);return t.replace(/"/g,"")},Hnr=async()=>process.env.GITHUB_EVENT_PATH&&process.env.GITHUB_TOKEN?jnr():"local",Jnr=async e=>{let t=await Gnr(),r=t.substr(0,7);return e==="hash-timestamp"?`${r}-${Date.now()}`:e==="ctx-hash-timestamp"?`${await Hnr()}-${r}-${Date.now()}`:t};var U$n=$r(hJe());var Sei=$r(J7());var Xee=$r(ks()),D3=$r(ks()),tze=$r(ks());var xir=async(e,t,r)=>{let n=D3.ppath.join((0,tze.toFilename)(".yarn"),(0,tze.toFilename)("plugins"));await Xee.xfs.existsPromise(D3.ppath.join(e.cwd,n))&&(r.reportInfo(null,n),await Xee.xfs.copyPromise(D3.ppath.join(t,n),D3.ppath.join(e.cwd,n),{overwrite:!0}))};var Bir=async(e,t,r)=>{let n=e.configuration.get("rcFilename");r.reportInfo(null,n),await Xee.xfs.copyPromise(D3.ppath.join(t,n),D3.ppath.join(e.cwd,n),{overwrite:!0})},Tir=async(e,t,r)=>{let n=e.configuration.get("yarnPath"),o=D3.ppath.relative(e.cwd,n),a=D3.ppath.join(t,o);r.reportInfo(null,o),await Xee.xfs.copyPromise(a,n,{overwrite:!0})};var EEe={};Yd(EEe,{generateLockfile:()=>Ear,pack:()=>Kei,parseSpec:()=>Vei});var far=$r(Rn()),dar=$r(Rn()),par=$r(Rn()),Aar=$r(ks()),Aze=$r(Rn()),gar=$r(Rn()),har=$r(ks()),vEe=$r(ks()),rte=$r(ks()),mar=$r(ks()),yar=$r(J7());var _ir=$r(Rn()),kir=$r(Rn()),Pir=$r(ks()),Nir=$r(ks()),Fir=$r(ks()),rze=$r(Rn()),nze=$r(ks()),Qir=$r(ks()),Xj=class extends _ir.Cache{constructor(r,{configuration:n,nodeLinker:o,parentCache:a}){super(r,{configuration:n});this.parentMirror=new Map;this.workspaceMutexes=new Map;this.nodeLinker=o,this.parentCache=a}static async find(r,n){let o=r.get("nodeLinker"),a=new Xj(r.get("cacheFolder"),{configuration:r,nodeLinker:o,parentCache:n});return await a.setup(),a}getLocatorMirrorPath(r){return this.parentMirror.get(rze.structUtils.slugifyLocator(r))??null}async setup(){await super.setup();let r=await Qir.xfs.readdirPromise(this.parentCache.cwd,{withFileTypes:!0});for(let n of r){let o;n.isDirectory()||!(o=n.name.match(/^(.*)-[a-f\d]+\.zip$/i))||this.parentMirror.set(o[1],nze.ppath.join(this.parentCache.cwd,n.name))}}async fetchPackageFromCache(r,n,{loader:o}){let a=new Nir.NodeFS,u=async()=>{let l=nze.ppath.resolve(this.cwd,"../workspaces",rze.structUtils.stringifyIdent(r)),A=(async()=>{if(!await a.existsPromise(l)){let I=await o();await a.copyPromise(l,Fir.PortablePath.root,{baseFs:I}),I.discardAndClose()}return l})();this.workspaceMutexes.set(r.locatorHash,A);try{return await A}finally{this.workspaceMutexes.delete(r.locatorHash)}};if(r.reference.startsWith(kir.WorkspaceResolver.protocol)){for(let d;d=this.workspaceMutexes.get(r.locatorHash);)await d;let l=await u();return[new Pir.JailFS(l,{baseFs:a}),()=>{},null]}else return await super.fetchPackageFromCache(r,n,{loader:o})}};var oar=$r(Rn()),sar=$r(Rn());var uar=$r(Rn()),dze=$r(ks()),z7=$r(ks()),pze=$r(J7()),Yei=$r(rar());var fze=$r(Rn()),nar=$r(Rn()),iar=$r(ks());var yEe=class extends nar.WorkspaceFetcher{constructor(r){super();this.originalProject=r}getLocalPath(r,n){return super.getLocalPath(r,this.rewriteOpts(r,n))}async fetch(r,n){if(r.reference.slice(fze.WorkspaceResolver.protocol.length)===".")return await super.fetch(r,n);let o=n.checksums.get(r.locatorHash)||null,[a,u]=await n.cache.fetchPackageFromCache(r,o,{loader:()=>this.packWorkspace(r)});return{packageFs:a,releaseFs:u,localPath:this.getLocalPath(r,n),prefixPath:iar.PortablePath.dot}}async packWorkspace(r){let n=this.originalProject.getWorkspaceByLocator(r);return await aar(n,{compressionLevel:this.originalProject.configuration.get("compressionLevel"),stripComponents:1})}rewriteOpts(r,n){return r.reference.slice(fze.WorkspaceResolver.protocol.length)==="."?n:{...n,project:this.originalProject}}};var car=e=>{let t=[];for(let r of e.configuration.plugins.values())for(let n of r.fetchers||[])t.push(new n);return new sar.MultiFetcher([new oar.VirtualFetcher,new yEe(e),...t])};var lar=async e=>{let t=await z7.xfs.mktempPromise(),r=await pze.packUtils.genPackStream(e),n=dze.ppath.join(t,"package.tgz"),o=z7.xfs.createWriteStream(n);return r.pipe(o),await new Promise(a=>{o.on("finish",a)}),z7.xfs.readFilePromise(n)},aar=async(e,t)=>await z7.xfs.mktempPromise(async r=>{let n=await pze.packUtils.genPackStream(e),o=dze.ppath.join(r,"package.tgz"),a=z7.xfs.createWriteStream(o);n.pipe(a),await new Promise(l=>{a.on("finish",l)});let u=await z7.xfs.readFilePromise(o);return await uar.tgzUtils.convertToZip(u,t)});var Ear=async(e,t,r)=>{let n=(0,har.toFilename)(e.configuration.get("lockfileFilename")),o=rte.ppath.join(t,n);r.reportInfo(null,n),await vEe.xfs.mkdirpPromise(rte.ppath.dirname(o)),await vEe.xfs.writeFilePromise(o,e.generateLockfile())};function Vei(e){let{params:t,selector:r}=Aze.structUtils.parseRange(e),n=mar.npath.toPortablePath(r);return{parentLocator:t&&typeof t.locator=="string"?Aze.structUtils.parseLocator(t.locator):null,path:n}}var Kei=async(e,t,r,n,o)=>{let a=await par.Cache.find(e,{immutable:!0});await t.restoreInstallState(),await yar.packUtils.prepareForPack(r,{report:n},async()=>{r.manifest.devDependencies.clear();let u=new Aar.CwdFS(o);u.mkdirSync(".yarn"),u.mkdirSync(".yarn/cache");let l=await lar(r);await gar.tgzUtils.extractArchiveTo(l,u,{stripComponents:1});let d=far.Configuration.create(o,o,e.plugins);d.values.set("bstatePath",rte.ppath.join(o,"build-state.yml")),d.values.set("globalFolder",e.get("globalFolder")),d.values.set("packageExtensions",e.get("packageExtensions")),await d.refreshPackageExtensions();let{project:A,workspace:m}=await dar.Project.find(d,o);m.manifest.dependencies=r.manifest.dependencies,m.manifest.peerDependencies=r.manifest.peerDependencies,m.manifest.resolutions=t.topLevelWorkspace.manifest.resolutions,m.manifest.dependenciesMeta=t.topLevelWorkspace.manifest.dependenciesMeta,m.manifest.devDependencies.clear(),await A.install({cache:await Xj.find(d,a),fetcher:car(t),report:n,persistProject:!1}),await n.startTimerPromise("Copy RC files",async()=>{await Bir(t,o,n)}),await n.startTimerPromise("Copy plugins",async()=>{await xir(t,o,n)}),await n.startTimerPromise("Copy Yarn releases",async()=>{await Tir(t,o,n)}),await Ear(A,o,n),await vEe.xfs.writeJsonPromise(rte.ppath.join(o,"package.json"),{...m.manifest.exportTo({}),devDependencies:{}})})};var Xei=async e=>{let t={project:{id:e,name:e,version:"0.0.1"},build:{exclude:[".git",".yarn/unplugged"]}},r=xar.ppath.join(await hze.xfs.mktempPromise(),(0,Bar.toFilename)("project.toml"));return await hze.xfs.writeFilePromise(r,(0,bar.stringify)(t)),r},rG=class extends Iar.BaseCommand{constructor(){super(...arguments);this.registry=Cl.String("-r,--registry",{required:!0});this.tagPolicy=Cl.String("-t,--tag-policy");this.publish=Cl.Boolean("-p,--publish",!1)}async execute(){let r=await war.Configuration.find(this.context.cwd,this.context.plugins),{project:n}=await Dar.Project.find(r,this.context.cwd),o=n.getWorkspaceByFilePath(this.context.cwd);return(await Sar.StreamReport.start({configuration:r,stdout:this.context.stdout},async u=>{if(this.isWorkspaceAllowedForBundle(o)){let l=Tar.default.directory();u.reportInfo(null,`Package workspace ${o.manifest.raw.name} to ${l}`),await EEe.pack(r,n,o,u,l);let d=o.manifest.raw.name.replace("@","").replace(/\//g,"-"),A=`${this.registry}${d}`,m=await(0,Car.readFile)((0,_ar.join)(this.context.cwd,"package.json"),"utf-8"),{packConfiguration:I={}}=JSON.parse(m),b=await nEe.getTag(this.tagPolicy||"revision"),S=await Xei(d),v=I.buildpackVersion||"0.0.4",_=I.builderTag||"buster-18.13",T=["build","--trust-builder",`${A}:${b}`,"--verbose","--buildpack",`atlantislab/buildpack-yarn-workspace:${v}`,"--builder",`atlantislab/builder-base:${_}`,"--descriptor",S,"--tag",`${A}:latest`];this.publish&&T.push("--publish"),await gze.execUtils.pipevp("pack",T,{cwd:l,env:process.env,stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr,end:gze.execUtils.EndStrategy.ErrorCode})}else u.reportInfo(null,`Workspace ${o.manifest.raw.name} not allowed for package.`)})).exitCode()}isWorkspaceAllowedForBundle(r){let{scripts:n,name:o}=r.manifest,a=n.get("build");return["actl service build","actl renderer build","build-storybook","next build","builder build library","app service build","app renderer build","service build","renderer build"].some(l=>a==null?void 0:a.includes(l))&&Boolean(o)}};rG.paths=[["image","pack"]];var kar={commands:[rG]};var Dze={};Yd(Dze,{default:()=>vor});var aor=$r(Ps()),oor=$r(Rn()),sor=$r(Rn()),SEe=$r(Rn()),uor=$r(Rn()),cor=$r(ks()),bEe=$r(ks());var lor=$r(Ho()),dor=$r(uMe());var W7=$r(Ho()),IEe=$r(Zf()),Har=$r(Zf());var qar=$r(tJe()),s6=$r(Ho()),nte=$r(Zf()),CEe=$r(Zf()),jar=$r(Zf()),yze=$r(Ho());var Oar=$r(Ho()),Rar=$r(Zf());var Nar=$r(VV()),Far=$r(VAe()),{level:Zei}=(0,Far.supportsColor)({isTTY:!0}),Par=Zei>=1,Qar=(e,t,r)=>(0,Nar.codeFrameColumns)(e,{start:{column:r,line:t}},{highlightCode:Par,forceColor:Par});var Lar=({children:e,line:t,column:r})=>Oar.default.createElement(Rar.Text,null,Qar(e,t,r));var Mar=$r(mr("fs")),Uar=e=>{if(e.sourceMap)return e.sourceMap.payload.sourcesContent[0];if(e.file)try{return Mar.default.readFileSync(e.file,"utf-8")}catch{}return null};var Gar=({children:e})=>{var n,o,a;let t=(0,yze.useMemo)(()=>(0,qar.parse)(e),[e]),r=(0,yze.useMemo)(()=>t!=null&&t.topFrame?Uar(t.topFrame):null,[t]);return t?s6.default.createElement(CEe.Box,{flexDirection:"column",flexGrow:1},r&&((n=t==null?void 0:t.topFrame)==null?void 0:n.line)&&s6.default.createElement(CEe.Box,null,s6.default.createElement(Lar,{line:(o=t==null?void 0:t.topFrame)==null?void 0:o.line,column:(a=t==null?void 0:t.topFrame)==null?void 0:a.column},r)),t.frames.map((u,l)=>s6.default.createElement(CEe.Box,{key:`${u.file}-${u.line}-${u.column}-${l}`,justifyContent:"flex-end"},s6.default.createElement(nte.Text,null,u.function),s6.default.createElement(jar.Spacer,null),s6.default.createElement(nte.Text,{color:"gray"},u.file),u.line&&s6.default.createElement(nte.Text,{color:"gray"},":",u.line),u.column&&s6.default.createElement(nte.Text,{color:"gray"},":",u.column)))):null};var $ei=({children:e})=>e?W7.default.createElement(IEe.Box,{marginBottom:1},W7.default.createElement(Har.Text,{color:"red",bold:!0},e)):null,wEe=({error:e})=>W7.default.createElement(IEe.Box,{flexDirection:"column"},W7.default.createElement($ei,null,e.message),e.stack&&W7.default.createElement(IEe.Box,null,W7.default.createElement(Gar,null,e.stack)));var DEe=$r(Ho()),Jar=$r(gq()),vze=$r(Zf()),zar=$r(Zf()),War=({isSelected:e=!1})=>DEe.default.createElement(zar.Box,{marginRight:1},e?DEe.default.createElement(vze.Text,{color:"cyanBright"},Jar.default.pointer):DEe.default.createElement(vze.Text,null," "));var eti=$r(Ho()),tti=$r(Zf()),rti=$r(Zf());var nti=$r(Ho());var Eze=$r(Ho()),Yar=$r(Zf()),Var=$r(Ho()),Kar=$r(Ho()),iti=({value:e,useSubmit:t})=>{let{stdin:r}=(0,Yar.useStdin)();return t(e),(0,Var.useEffect)(()=>{r==null||r.emit("keypress","",{name:"return"})},[r]),null},Xar=e=>({useSubmit:r})=>{let[n,o]=(0,Kar.useState)();return n?Eze.default.createElement(iti,{value:n,useSubmit:r}):Eze.default.createElement(e,{onSubmit:o})};var Zar=$r(n0e()),nG=$r(Ho()),Cze=$r(Zf()),$ar=$r(Zf()),eor=$r(Ho()),tor=$r(Ho());var ati=({onSubmit:e,...t})=>((0,eor.useEffect)(()=>{e(t)},[t,e]),null),ror=({onSubmit:e})=>{let[t,r]=(0,tor.useState)();return t?nG.default.createElement(ati,{type:t,onSubmit:e}):nG.default.createElement(Cze.Box,{flexDirection:"column"},nG.default.createElement(Cze.Box,{marginRight:1},nG.default.createElement($ar.Text,{bold:!0,color:"cyanBright"},"Type of project:")),nG.default.createElement(Zar.default,{items:[{label:"Project",value:"project"},{label:"Libraries",value:"libraries"}],onSelect:n=>r(n.value),indicatorComponent:War}))};var wze=$r(ior()),iG=class{constructor(t,r=!1,n=!1){this.cwd=t;this.force=r;this.dryRun=n}generate(t,r={}){return j1.run((0,wze.getContent)(),{type:"generate",cwd:this.cwd,force:this.force,dryRun:this.dryRun,schematicName:t,options:r})}migrate(t,r,n={}){return j1.run((0,wze.getContent)(),{type:"migrate",cwd:this.cwd,force:this.force,dryRun:this.dryRun,migrationVersion:r,schematicName:t,options:n})}};var ite=class extends aor.BaseCommand{async requestOptions(){let t=(0,dor.forceStdinTty)(),r=await Ime(Xar(ror),{},{stdin:this.context.stdin,stdout:this.context.stdout,stderr:this.context.stderr});return t&&process.stdin.destroy(),r}async execute(){let t=await oor.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:n}=await sor.Project.find(t,this.context.cwd),o=await this.requestOptions();if(!o)return 1;let a=new iG(r.cwd);return(await uor.StreamReport.start({stdout:this.context.stdout,configuration:t},async l=>{await l.startTimerPromise("Init Project",async()=>{let d=new tm(this.context.stdout,t);d.start();try{let A=await a.generate("project",o);d.end(),A.forEach(m=>{let I=m.path.startsWith("/")?m.path.substr(1):m.path;m.kind==="error"?l.reportError(SEe.MessageName.UNNAMED,`${I}: ${m.description}`):l.reportInfo(SEe.MessageName.UNNAMED,`${I}: ${m.kind}`)}),await cor.xfs.writeJsonPromise(bEe.npath.toPortablePath(bEe.npath.join(bEe.npath.fromPortablePath(n.cwd),"package.json")),{...n.manifest.raw,tools:{schematic:{collection:"@atls/schematics",schematic:"project",type:o.type,migration:String(Date.now())}}})}catch(A){d.end(),Qg(lor.default.createElement(wEe,{error:A}),process.stdout.columns-12).split(` `).forEach(m=>{l.reportError(SEe.MessageName.UNNAMED,m)})}})})).exitCode()}};ite.paths=[["generate","project"]];var por=$r(Ps()),Aor=$r(Rn()),gor=$r(Rn()),xEe=$r(Rn()),hor=$r(Rn()),mor=$r(ks()),BEe=$r(ks()),yor=$r(Ho());var ate=class extends por.BaseCommand{async execute(){let t=await Aor.Configuration.find(this.context.cwd,this.context.plugins),{project:r,workspace:n}=await gor.Project.find(t,this.context.cwd),o=new iG(r.cwd);return(await hor.StreamReport.start({stdout:this.context.stdout,configuration:t},async u=>{await u.startTimerPromise("Run Migrations",async()=>{var d,A,m,I;let l=new tm(this.context.stdout,t);l.start();try{let b=await o.migrate("project",((I=(m=(A=(d=n==null?void 0:n.manifest)==null?void 0:d.raw)==null?void 0:A.tools)==null?void 0:m.schematic)==null?void 0:I.migration)||"0");l.end(),b.forEach(S=>{let v=S.path.startsWith("/")?S.path.substr(1):S.path;S.kind==="error"?u.reportError(xEe.MessageName.UNNAMED,`${v}: ${S.description}`):u.reportInfo(xEe.MessageName.UNNAMED,`${v}: ${S.kind}`)}),await mor.xfs.writeJsonPromise(BEe.npath.toPortablePath(BEe.npath.join(BEe.npath.fromPortablePath(n.cwd),"package.json")),{...n.manifest.raw,tools:{...n.manifest.raw.tools,schematic:{...n.manifest.raw.tools.schematic,migration:String(Date.now())}}})}catch(b){l.end(),Qg(yor.default.createElement(wEe,{error:b}),process.stdout.columns-12).split(` `).forEach(S=>{u.reportError(xEe.MessageName.UNNAMED,S)})}})})).exitCode()}};ate.paths=[["migration","up"]];var oti=(e,t)=>{t.publishConfig&&t.publishConfig.schematics&&(t.schematics=t.publishConfig.schematics)},vor={commands:[ite,ate],hooks:[oti]};var xze={};Yd(xze,{TypeCheckCommand:()=>aG,default:()=>Dor});var Eor=$r(Ps()),Cor=$r(Rn()),Ior=$r(Rn()),wor=$r(Rn()),Sze=$r(Rn()),bze=$r(Ho());Gs();var aG=class extends Eor.BaseCommand{constructor(){super(...arguments);this.args=Cl.Rest({required:0})}async execute(){let r=await Cor.Configuration.find(this.context.cwd,this.context.plugins),{project:n}=await Ior.Project.find(r,this.context.cwd);return(await wor.StreamReport.start({stdout:this.context.stdout,configuration:r},async a=>{await a.startTimerPromise("Typecheck",async()=>{let u=new tm(this.context.stdout,r);u.start();try{let d=await new S_(n.cwd).check(this.args.length>0?this.args:n.topLevelWorkspace.manifest.workspaceDefinitions.map(A=>A.pattern));u.end(),d.forEach(A=>{Qg(bze.default.createElement(gU,{...A})).split(` diff --git a/yarn/plugin-test/src/test-integration.command.ts b/yarn/plugin-test/src/test-integration.command.ts index 2ec0ae986..da3d43817 100644 --- a/yarn/plugin-test/src/test-integration.command.ts +++ b/yarn/plugin-test/src/test-integration.command.ts @@ -18,7 +18,7 @@ class TestIntegrationCommand extends BaseCommand { watchMode = Option.Boolean('--watch', false) - watchAllMode = Option.Boolean('--watchAll', false) + watchAllMode = Option.Boolean('--watchAll') files: Array = Option.Rest({ required: 0 }) diff --git a/yarn/plugin-test/src/test-unit.command.ts b/yarn/plugin-test/src/test-unit.command.ts index 645540c8a..9812b99f8 100644 --- a/yarn/plugin-test/src/test-unit.command.ts +++ b/yarn/plugin-test/src/test-unit.command.ts @@ -18,7 +18,7 @@ class TestUnitCommand extends BaseCommand { watchMode = Option.Boolean('--watch', false) - watchAllMode = Option.Boolean('--watchAll', false) + watchAllMode = Option.Boolean('--watchAll') files: Array = Option.Rest({ required: 0 })