diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d322329639..3c3f502af6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -269,12 +269,21 @@ jobs: # run: | # cd ./tests # ./update-snapshot-ci.sh ./tests/db_dump + - name: "Store docker logs" + run: | + cd ./tests/sanity + mkdir logs + docker logs $(docker ps | grep transactor | cut -f 1 -d ' ') > logs/transactor.log + docker logs $(docker ps | grep account | cut -f 1 -d ' ') > logs/transactor.log + docker logs $(docker ps | grep front | cut -f 1 -d ' ') > logs/front.log - name: Upload test results if: always() uses: actions/upload-artifact@v3 with: name: playwright-results - path: ./tests/sanity/playwright-report/ + path: | + ./tests/sanity/playwright-report/ + ./tests/sanity/logs # - name: Upload DB snapshot # if: always() # uses: actions/upload-artifact@v3 diff --git a/common/config/rush/build-cache.json b/common/config/rush/build-cache.json index 4e26cde258..f6946f97db 100644 --- a/common/config/rush/build-cache.json +++ b/common/config/rush/build-cache.json @@ -10,7 +10,7 @@ * * See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature. */ - "buildCacheEnabled": false, + "buildCacheEnabled": true, /** * (Required) Choose where project build outputs will be cached. diff --git a/dev/prod/config/rig.json b/dev/prod/config/rig.json new file mode 100644 index 0000000000..06a2a2e17a --- /dev/null +++ b/dev/prod/config/rig.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/rig-package/rig.schema.json", + "rigPackageName": "@hcengineering/platform-rig" +} diff --git a/dev/prod/package.json b/dev/prod/package.json index f7933fedc4..8b00f8653c 100644 --- a/dev/prod/package.json +++ b/dev/prod/package.json @@ -17,6 +17,7 @@ "deploy": "cp -p public/* dist && aws s3 sync dist s3://anticrm-platform --delete --acl public-read" }, "devDependencies": { + "@hcengineering/platform-rig": "^0.6.0", "cross-env": "~7.0.3", "webpack-cli": "^5.0.1", "webpack": "^5.75.0", diff --git a/models/model-rig/profiles/default/config/rush-project.json b/models/model-rig/profiles/default/config/rush-project.json index 1bd09c71f6..168e233eec 100644 --- a/models/model-rig/profiles/default/config/rush-project.json +++ b/models/model-rig/profiles/default/config/rush-project.json @@ -1,11 +1,11 @@ { - "incrementalBuildIgnoredGlobs": ["temp/**"], - "disableBuildCacheForProject": false, - - "operationSettings": [ - { - "operationName": "build", - "outputFolderNames": ["lib", "dist"] - } - ] - } \ No newline at end of file + "incrementalBuildIgnoredGlobs": ["temp/**", "dist_cache/**", "lib/**", "dist/**"], + "disableBuildCacheForProject": false, + + "operationSettings": [ + { + "operationName": "build", + "outputFolderNames": ["dist", "lib", "dist_cache"] + } + ] +} \ No newline at end of file diff --git a/packages/platform-rig/profiles/default/config/rush-project.json b/packages/platform-rig/profiles/default/config/rush-project.json index c982724fb0..eca75cec88 100644 --- a/packages/platform-rig/profiles/default/config/rush-project.json +++ b/packages/platform-rig/profiles/default/config/rush-project.json @@ -1,11 +1,11 @@ { - "incrementalBuildIgnoredGlobs": ["temp/**", "dist_cache/**", "lib/**"], + "incrementalBuildIgnoredGlobs": ["temp/**", "dist_cache/**", "lib/**", "dist/**", "deploy/**"], "disableBuildCacheForProject": false, "operationSettings": [ { "operationName": "build", - "outputFolderNames": ["lib", "dist"] + "outputFolderNames": ["lib", "dist", "dist_cache"] } ] } \ No newline at end of file diff --git a/packages/platform-rig/profiles/ui/config/rush-project.json b/packages/platform-rig/profiles/ui/config/rush-project.json index efc668d07c..168e233eec 100644 --- a/packages/platform-rig/profiles/ui/config/rush-project.json +++ b/packages/platform-rig/profiles/ui/config/rush-project.json @@ -1,5 +1,5 @@ { - "incrementalBuildIgnoredGlobs": ["temp/**", "dist_cache/**", "lib/**"], + "incrementalBuildIgnoredGlobs": ["temp/**", "dist_cache/**", "lib/**", "dist/**"], "disableBuildCacheForProject": false, "operationSettings": [ diff --git a/server/elastic/src/backup.ts b/server/elastic/src/backup.ts index 329d62d0ac..1d0406d5cb 100644 --- a/server/elastic/src/backup.ts +++ b/server/elastic/src/backup.ts @@ -84,6 +84,9 @@ class ElasticDataAdapter implements DbAdapter { } resp = await this.client.search(q) if (resp.statusCode !== 200) { + if (resp.body?.error?.type === 'index_not_found_exception') { + return undefined + } console.error('failed elastic query', q, resp) throw new PlatformError(unknownStatus(`failed to elastic query ${JSON.stringify(resp)}`)) } diff --git a/tools/apm/apm.js b/tools/apm/apm.js index a255133758..c7e566793d 100644 --- a/tools/apm/apm.js +++ b/tools/apm/apm.js @@ -20,8 +20,8 @@ Expecting one of '${r.join("', '")}'`);let u=`${e}Help`;return this.on(u,l=>{let `&&++this.index,this.lineStart=this.index;else switch(a){case"n":p+=` `;break;case"r":p+="\r";break;case"t":p+=" ";break;case"u":if(this.source[this.index]==="{")++this.index,p+=this.scanUnicodeCodePointEscape();else{var x=this.index,E=this.scanHexEscape(a);E!==null?p+=E:(this.index=x,p+=a)}break;case"x":var C=this.scanHexEscape(a);C===null&&this.throwUnexpectedToken(l.Messages.InvalidHexEscapeSequence),p+=C;break;case"b":p+="\b";break;case"f":p+="\f";break;case"v":p+="\v";break;default:a==="0"?(u.Character.isDecimalDigit(this.source.charCodeAt(this.index))&&this.throwUnexpectedToken(l.Messages.TemplateOctalLiteral),p+="\0"):u.Character.isOctalDigit(a.charCodeAt(0))?this.throwUnexpectedToken(l.Messages.TemplateOctalLiteral):p+=a;break}else u.Character.isLineTerminator(a.charCodeAt(0))?(++this.lineNumber,a==="\r"&&this.source[this.index]===` `&&++this.index,this.lineStart=this.index,p+=` -`):p+=a}return d||this.throwUnexpectedToken(),t||this.curlyStack.pop(),{type:10,value:this.source.slice(c+1,this.index-n),cooked:p,head:t,tail:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},f.prototype.testRegExp=function(p,d){var c="\uFFFF",t=p,i=this;d.indexOf("u")>=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(n,a,x){var E=parseInt(a||x,16);return E>1114111&&i.throwUnexpectedToken(l.Messages.InvalidRegExp),E<=65535?String.fromCharCode(E):c}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c));try{RegExp(t)}catch{this.throwUnexpectedToken(l.Messages.InvalidRegExp)}try{return new RegExp(p,d)}catch{return null}},f.prototype.scanRegExpBody=function(){var p=this.source[this.index];r.assert(p==="/","Regular expression literal must start with a slash");for(var d=this.source[this.index++],c=!1,t=!1;!this.eof();)if(p=this.source[this.index++],d+=p,p==="\\")p=this.source[this.index++],u.Character.isLineTerminator(p.charCodeAt(0))&&this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),d+=p;else if(u.Character.isLineTerminator(p.charCodeAt(0)))this.throwUnexpectedToken(l.Messages.UnterminatedRegExp);else if(c)p==="]"&&(c=!1);else if(p==="/"){t=!0;break}else p==="["&&(c=!0);return t||this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),d.substr(1,d.length-2)},f.prototype.scanRegExpFlags=function(){for(var p="",d="";!this.eof();){var c=this.source[this.index];if(!u.Character.isIdentifierPart(c.charCodeAt(0)))break;if(++this.index,c==="\\"&&!this.eof())if(c=this.source[this.index],c==="u"){++this.index;var t=this.index,i=this.scanHexEscape("u");if(i!==null)for(d+=i,p+="\\u";t=55296&&p<57343&&u.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},f}();e.Scanner=m},function(h,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(h,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(h,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(10),u=s(12),l=s(13),o=function(){function m(){this.values=[],this.curly=this.paren=-1}return m.prototype.beforeFunctionExpression=function(f){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(f)>=0},m.prototype.isRegexStart=function(){var f=this.values[this.values.length-1],p=f!==null;switch(f){case"this":case"]":p=!1;break;case")":var d=this.values[this.paren-1];p=d==="if"||d==="while"||d==="for"||d==="with";break;case"}":if(p=!1,this.values[this.curly-3]==="function"){var c=this.values[this.curly-4];p=c?!this.beforeFunctionExpression(c):!1}else if(this.values[this.curly-4]==="function"){var c=this.values[this.curly-5];p=c?!this.beforeFunctionExpression(c):!0}break;default:break}return p},m.prototype.push=function(f){f.type===7||f.type===4?(f.value==="{"?this.curly=this.values.length:f.value==="("&&(this.paren=this.values.length),this.values.push(f.value)):this.values.push(null)},m}(),D=function(){function m(f,p){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=p?typeof p.tolerant=="boolean"&&p.tolerant:!1,this.scanner=new u.Scanner(f,this.errorHandler),this.scanner.trackComment=p?typeof p.comment=="boolean"&&p.comment:!1,this.trackRange=p?typeof p.range=="boolean"&&p.range:!1,this.trackLoc=p?typeof p.loc=="boolean"&&p.loc:!1,this.buffer=[],this.reader=new o}return m.prototype.errors=function(){return this.errorHandler.errors},m.prototype.getNextToken=function(){if(this.buffer.length===0){var f=this.scanner.scanComments();if(this.scanner.trackComment)for(var p=0;p{function ir(h){return Array.isArray?Array.isArray(h):me(h)==="[object Array]"}I.isArray=ir;function sr(h){return typeof h=="boolean"}I.isBoolean=sr;function rr(h){return h===null}I.isNull=rr;function nr(h){return h==null}I.isNullOrUndefined=nr;function ar(h){return typeof h=="number"}I.isNumber=ar;function or(h){return typeof h=="string"}I.isString=or;function ur(h){return typeof h=="symbol"}I.isSymbol=ur;function hr(h){return h===void 0}I.isUndefined=hr;function lr(h){return me(h)==="[object RegExp]"}I.isRegExp=lr;function cr(h){return typeof h=="object"&&h!==null}I.isObject=cr;function pr(h){return me(h)==="[object Date]"}I.isDate=pr;function fr(h){return me(h)==="[object Error]"||h instanceof Error}I.isError=fr;function mr(h){return typeof h=="function"}I.isFunction=mr;function dr(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h>"u"}I.isPrimitive=dr;I.isBuffer=require("buffer").Buffer.isBuffer;function me(h){return Object.prototype.toString.call(h)}});var Rt=_((Un,Xt)=>{var _t=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],F,It=h=>h<1e5?h<100?h<10?0:1:h<1e4?h<1e3?2:3:4:h<1e7?h<1e6?5:6:h<1e9?h<1e8?7:8:9;function Pt(h,e){if(h===e)return 0;if(~~h===h&&~~e===e){if(h===0||e===0)return h=0)return-1;if(h>=0)return 1;h=-h,e=-e}let u=It(h),l=It(e),o=0;return ul&&(e*=_t[u-l-1],h/=10,o=1),h===e?o:h=32;)e|=h&1,h>>=1;return h+e}function Ot(h,e,s,r){let u=e+1;if(u===s)return 1;if(r(h[u++],h[e])<0){for(;u=0;)u++;return u-e}function Mt(h,e,s){for(s--;e>>1;u(l,h[p])<0?m=p:D=p+1}let f=r-D;switch(f){case 3:h[D+3]=h[D+2],F[D+3]=F[D+2];case 2:h[D+2]=h[D+1],F[D+2]=F[D+1];case 1:h[D+1]=h[D],F[D+1]=F[D];break;default:for(;f>0;)h[D+f]=h[D+f-1],F[D+f]=F[D+f-1],f--}h[D]=l,F[D]=o}}function Ue(h,e,s,r,u,l){let o=0,D=0,m=1;if(l(h,e[s+u])>0){for(D=r-u;m0;)o=m,m=(m<<1)+1,m<=0&&(m=D);m>D&&(m=D),o+=u,m+=u}else{for(D=u+1;mD&&(m=D);let f=o;o=u-m,m=u-f}for(o++;o>>1);l(h,e[s+f])>0?o=f+1:m=f}return m}function ze(h,e,s,r,u,l){let o=0,D=0,m=1;if(l(h,e[s+u])<0){for(D=u+1;mD&&(m=D);let f=o;o=u-m,m=u-f}else{for(D=r-u;m=0;)o=m,m=(m<<1)+1,m<=0&&(m=D);m>D&&(m=D),o+=u,m+=u}for(o++;o>>1);l(h,e[s+f])<0?m=f:o=f+1}return m}var He=class{constructor(e,s){this.array=e,this.compare=s;let{length:r}=e;this.length=r,this.minGallop=7,this.tmpStorageLength=r<2*256?r>>>1:256,this.tmp=new Array(this.tmpStorageLength),this.tmpIndex=new Array(this.tmpStorageLength),this.stackLength=r<120?5:r<1542?10:r<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength),this.stackSize=0}pushRun(e,s){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=s,this.stackSize+=1}mergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;if(e>=1&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||e>=2&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]this.runLength[e+1])break;this.mergeAt(e)}}forceMergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;e>0&&this.runLength[e-1]=7||n>=7);if(a)break;t<0&&(t=0),t+=2}if(this.minGallop=t,t<1&&(this.minGallop=1),s===1){for(f=0;f=0;f--)o[i+f]=o[t+f],F[i+f]=F[t+f];o[c]=D[d],F[c]=m[d];return}let{minGallop:n}=this;for(;;){let a=0,x=0,E=!1;do if(l(D[d],o[p])<0){if(o[c]=o[p],F[c]=F[p],c--,p--,a++,x=0,--s===0){E=!0;break}}else if(o[c]=D[d],F[c]=m[d],c--,d--,x++,a=0,--u===1){E=!0;break}while((a|x)=0;f--)o[i+f]=o[t+f],F[i+f]=F[t+f];if(s===0){E=!0;break}}if(o[c]=D[d],F[c]=m[d],c--,d--,--u===1){E=!0;break}if(x=u-Ue(o[p],D,0,u,u-1,l),x!==0){for(c-=x,d-=x,u-=x,i=c+1,t=d+1,f=0;f=7||x>=7);if(E)break;n<0&&(n=0),n+=2}if(this.minGallop=n,n<1&&(this.minGallop=1),u===1){for(c-=s,p-=s,i=c+1,t=p+1,f=s-1;f>=0;f--)o[i+f]=o[t+f],F[i+f]=F[t+f];o[c]=D[d],F[c]=m[d]}else{if(u===0)throw new Error("mergeHigh preconditions were not respected");for(t=c-(u-1),f=0;ff&&(p=f),Lt(h,s,s+p,s+D,e),D=p}m.pushRun(s,D),m.mergeRuns(),o-=D,s+=D}while(o!==0);return m.forceMergeRuns(),F}Xt.exports={sort:Dr}});var Ut=_((zn,Jt)=>{"use strict";var Er=Object.prototype.hasOwnProperty;Jt.exports=(h,e)=>Er.call(h,e)});var ne=_((Hn,Qt)=>{var Ke=Ut(),{isObject:zt,isArray:gr,isString:vr,isNumber:Cr}=de(),$e="before",jt="after-prop",Vt="after-colon",Kt="after-value",$t="after",Gt="before-all",Wt="after-all",Ar="[",yr="]",Sr="{",Fr="}",wr=",",br="",kr="-",Ge=[$e,jt,Vt,Kt,$t],Br=[$e,Gt,Wt].map(Symbol.for),qt=":",Ht=void 0,re=(h,e)=>Symbol.for(h+qt+e),xe=(h,e,s)=>Object.defineProperty(h,e,{value:s,writable:!0,configurable:!0}),Ve=(h,e,s,r,u,l)=>{let o=re(u,r);if(!Ke(e,o))return;let D=s===r?o:re(u,s);xe(h,D,e[o]),l&&delete e[o]},Yt=(h,e,s,r,u)=>{Ge.forEach(l=>{Ve(h,e,s,r,l,u)})},Tr=(h,e,s)=>{e!==s&&Ge.forEach(r=>{let u=re(r,s);if(!Ke(h,u)){Ve(h,h,s,e,r,!0);return}let l=h[u];delete h[u],Ve(h,h,s,e,r,!0),xe(h,re(r,e),l)})},je=(h,e)=>{Br.forEach(s=>{let r=e[s];r&&xe(h,s,r)})},Nr=(h,e,s)=>(s.forEach(r=>{!vr(r)&&!Cr(r)||Ke(e,r)&&(h[r]=e[r],Yt(h,e,r,r))}),h);Qt.exports={SYMBOL_PREFIXES:Ge,PREFIX_BEFORE:$e,PREFIX_AFTER_PROP:jt,PREFIX_AFTER_COLON:Vt,PREFIX_AFTER_VALUE:Kt,PREFIX_AFTER:$t,PREFIX_BEFORE_ALL:Gt,PREFIX_AFTER_ALL:Wt,BRACKET_OPEN:Ar,BRACKET_CLOSE:yr,CURLY_BRACKET_OPEN:Sr,CURLY_BRACKET_CLOSE:Fr,COLON:qt,COMMA:wr,MINUS:kr,EMPTY:br,UNDEFINED:Ht,symbol:re,define:xe,copy_comments:Yt,swap_comments:Tr,assign_non_prop_comments:je,assign(h,e,s){if(!zt(h))throw new TypeError("Cannot convert undefined or null to object");if(!zt(e))return h;if(s===Ht)s=Object.keys(e),je(h,e);else if(gr(s))s.length===0&&je(h,e);else throw new TypeError("keys must be array or undefined");return Nr(h,e,s)}}});var We=_((jn,si)=>{var{isArray:_r}=de(),{sort:Ir}=Rt(),{SYMBOL_PREFIXES:Pr,UNDEFINED:Zt,symbol:Or,copy_comments:Mr,swap_comments:ii}=ne(),Lr=h=>{let{length:e}=h,s=0,r=e/2;for(;s{Mr(h,e,s+r,s,u)},Q=(h,e,s,r,u,l)=>{if(u>0){let D=r;for(;D-- >0;)ei(h,e,s+D,u,l);return}let o=0;for(;o{Pr.forEach(s=>{let r=Or(s,e);delete h[r]})},Xr=(h,e)=>{let s=e;for(;s in h;)s=h[s];return s},Z=class extends Array{splice(...e){let{length:s}=this,r=super.splice(...e),[u,l,...o]=e;u<0&&(u+=s),arguments.length===1?l=s-u:l=Math.min(s-u,l);let{length:D}=o,m=D-l,f=u+l,p=s-f;return Q(this,this,f,p,m,!0),r}slice(...e){let{length:s}=this,r=super.slice(...e);if(!r.length)return new Z;let[u,l]=e;return l===Zt?l=s:l<0&&(l+=s),u<0?u+=s:u===Zt&&(u=0),Q(r,this,u,l-u,-u),r}unshift(...e){let{length:s}=this,r=super.unshift(...e),{length:u}=e;return u>0&&Q(this,this,0,s,u,!0),r}shift(){let e=super.shift(),{length:s}=this;return ti(this,0),Q(this,this,1,s,-1,!0),e}reverse(){return super.reverse(),Lr(this),this}pop(){let e=super.pop();return ti(this,this.length),e}concat(...e){let{length:s}=this,r=super.concat(...e);return e.length&&(Q(r,this,0,this.length,0),e.forEach(u=>{let l=s;s+=_r(u)?u.length:1,u instanceof Z&&Q(r,u,0,u.length,l)})),r}sort(...e){let s=Ir(this,...e.slice(0,1)),r=Object.create(null);return s.forEach((u,l)=>{if(u===l)return;let o=Xr(r,u);o!==l&&(r[l]=o,ii(this,l,o))}),this}};si.exports={CommentArray:Z}});var vi=_((Vn,gi)=>{var Rr=Nt(),{CommentArray:Jr}=We(),{PREFIX_BEFORE:Ee,PREFIX_AFTER_PROP:Ur,PREFIX_AFTER_COLON:zr,PREFIX_AFTER_VALUE:oi,PREFIX_AFTER:Ye,PREFIX_BEFORE_ALL:Hr,PREFIX_AFTER_ALL:jr,BRACKET_OPEN:Vr,BRACKET_CLOSE:ri,CURLY_BRACKET_OPEN:Kr,CURLY_BRACKET_CLOSE:ni,COLON:ui,COMMA:hi,MINUS:ai,EMPTY:$r,UNDEFINED:Ce,define:Qe,assign_non_prop_comments:Gr}=ne(),li=h=>Rr.tokenize(h,{comment:!0,loc:!0}),Ze=[],K=null,z=null,et=[],$,ci=!1,pi=!1,ae=null,oe=null,P=null,fi,ge=null,mi=()=>{et.length=Ze.length=0,oe=null,$=Ce},Wr=()=>{mi(),ae.length=0,z=K=ae=oe=P=ge=null},tt=h=>Symbol.for($!==Ce?h+ui+$:h),it=(h,e)=>ge?ge(h,e):e,di=()=>{let h=new SyntaxError(`Unexpected token ${P.value.slice(0,1)}`);throw Object.assign(h,P.loc.start),h},xi=()=>{let h=new SyntaxError("Unexpected end of JSON input");throw Object.assign(h,oe?oe.loc.end:{line:1,column:0}),h},R=()=>{let h=ae[++fi];pi=P&&h&&P.loc.end.line===h.loc.start.line||!1,oe=P,P=h},qe=()=>(P||xi(),P.type==="Punctuator"?P.value:P.type),W=h=>qe()===h,De=h=>{W(h)||di()},st=h=>{Ze.push(K),K=h},rt=()=>{K=Ze.pop()},Di=()=>{if(!z)return;let h=[];for(let s of z)if(s.inline)h.push(s);else break;let{length:e}=h;e&&(e===z.length?z=null:z.splice(0,e),Qe(K,tt(Ye),h))},V=h=>{z&&(Qe(K,tt(h),z),z=null)},H=h=>{let e=[];for(;P&&(W("LineComment")||W("BlockComment"));){let s={...P,inline:pi};e.push(s),R()}if(!ci&&e.length){if(h){Qe(K,tt(h),e);return}z=e}},ve=(h,e)=>{e&&et.push($),$=h},Ei=()=>{$=et.pop()},qr=()=>{let h={};st(h),ve(Ce,!0);let e=!1,s;for(H();!W(ni)&&!(e&&(V(oi),De(hi),R(),H(),Di(),W(ni)));)e=!0,De("String"),s=JSON.parse(P.value),ve(s),V(Ee),R(),H(Ur),De(ui),R(),H(zr),h[s]=it(s,nt()),H();return e&&V(Ye),R(),$=void 0,e||V(Ee),rt(),Ei(),h},Yr=()=>{let h=new Jr;st(h),ve(Ce,!0);let e=!1,s=0;for(H();!W(ri)&&!(e&&(V(oi),De(hi),R(),H(),Di(),W(ri)));)e=!0,ve(s),V(Ee),h[s]=it(s,nt()),s++,H();return e&&V(Ye),R(),$=void 0,e||V(Ee),rt(),Ei(),h};function nt(){let h=qe();if(h===Kr)return R(),qr();if(h===Vr)return R(),Yr();let e=$r;h===ai&&(R(),h=qe(),e=ai);let s;switch(h){case"String":case"Boolean":case"Null":case"Numeric":return s=P.value,R(),JSON.parse(e+s);default:}}var Qr=h=>Object(h)===h,Zr=(h,e,s)=>{mi(),ae=li(h),ge=e,ci=s,ae.length||xi(),fi=-1,R(),st({}),H(Hr);let r=nt();return H(jr),P&&di(),!s&&r!==null&&(Qr(r)||(r=new Object(r)),Gr(r,K)),rt(),r=it("",r),Wr(),r};gi.exports={parse:Zr,tokenize:li}});var Ai=_((Kn,Ci)=>{"use strict";var j="",at;Ci.exports=en;function en(h,e){if(typeof h!="string")throw new TypeError("expected a string");if(e===1)return h;if(e===2)return h+h;var s=h.length*e;if(at!==h||typeof at>"u")at=h,j="";else if(j.length>=s)return j.substr(0,s);for(;s>j.length&&e>1;)e&1&&(j+=h),e>>=1,h+=h;return j+=h,j=j.substr(0,s),j}});var Ii=_(($n,_i)=>{var{isArray:ht,isObject:yi,isFunction:ut,isNumber:tn,isString:sn}=de(),rn=Ai(),{PREFIX_BEFORE_ALL:nn,PREFIX_BEFORE:Si,PREFIX_AFTER_PROP:an,PREFIX_AFTER_COLON:on,PREFIX_AFTER_VALUE:un,PREFIX_AFTER:lt,PREFIX_AFTER_ALL:hn,BRACKET_OPEN:ln,BRACKET_CLOSE:cn,CURLY_BRACKET_OPEN:pn,CURLY_BRACKET_CLOSE:fn,COLON:mn,COMMA:Fi,EMPTY:X,UNDEFINED:dn}=ne(),ot=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,ct=" ",q=` -`,wi="null",bi=h=>`${Si}:${h}`,xn=h=>`${an}:${h}`,Dn=h=>`${on}:${h}`,ki=h=>`${un}:${h}`,Bi=h=>`${lt}:${h}`,En={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},gn=h=>(ot.lastIndex=0,ot.test(h)?h.replace(ot,e=>{let s=En[e];return typeof s=="string"?s:e}):h),Ti=h=>`"${gn(h)}"`,vn=(h,e)=>e?`//${h}`:`/*${h}*/`,L=(h,e,s,r)=>{let u=h[Symbol.for(e)];if(!u||!u.length)return X;let l=!1,o=u.reduce((D,{inline:m,type:f,value:p})=>{let d=m?ct:q+s;return l=f==="LineComment",D+d+vn(p,l)},X);return r||l?o+q+s:o},ee=null,he=X,Cn=()=>{ee=null,he=X},ue=(h,e,s)=>h?e?h+e.trim()+q+s:h.trimRight()+q+s:e?e.trimRight()+q+s:X,Ni=(h,e,s)=>{let r=L(e,Si,s+he,!0);return ue(r,h,s)},An=(h,e)=>{let s=e+he,{length:r}=h,u=X,l=X;for(let o=0;o{if(!h)return"null";let s=e+he,r=X,u=X,l=!0,o=ht(ee)?ee:Object.keys(h),D=m=>{let f=pt(m,h,s);if(f===dn)return;l||(r+=Fi),l=!1;let p=ue(u,L(h,bi(m),s),s);r+=p||q+s,r+=Ti(m)+L(h,xn(m),s)+mn+L(h,Dn(m),s)+ct+f+L(h,ki(m),s),u=L(h,Bi(m),s)};return o.forEach(D),r+=ue(u,L(h,lt,s),s),pn+Ni(r,h,e)+fn};function pt(h,e,s){let r=e[h];switch(yi(r)&&ut(r.toJSON)&&(r=r.toJSON(h)),ut(ee)&&(r=ee.call(e,h,r)),typeof r){case"string":return Ti(r);case"number":return Number.isFinite(r)?String(r):wi;case"boolean":case"null":return String(r);case"object":return ht(r)?An(r,s):yn(r,s);default:}}var Sn=h=>sn(h)?h:tn(h)?rn(ct,h):X,{toString:Fn}=Object.prototype,wn=["[object Number]","[object String]","[object Boolean]"],bn=h=>{if(typeof h!="object")return!1;let e=Fn.call(h);return wn.includes(e)};_i.exports=(h,e,s)=>{let r=Sn(s);if(!r)return JSON.stringify(h,e);!ut(e)&&!ht(e)&&(e=null),ee=e,he=r;let u=bn(h)?JSON.stringify(h):pt("",{"":h},X);return Cn(),yi(h)?L(h,nn,X).trimLeft()+u+L(h,hn,X).trimRight():u}});var Oi=_((Gn,Pi)=>{var{parse:kn,tokenize:Bn}=vi(),Tn=Ii(),{CommentArray:Nn}=We(),{assign:_n}=ne();Pi.exports={parse:kn,stringify:Tn,tokenize:Bn,CommentArray:Nn,assign:_n}});var Ae=we(Tt()),Li=require("path");var le=we(Oi()),ce=require("fs/promises"),J=we(require("path"));async function Mi(h,e,s,r,u){let l=(0,le.parse)((await(0,ce.readFile)((0,J.join)(process.cwd(),s,"rush.json"))).toString()),o=(0,J.join)(e,"rush.json"),D=J.default.resolve(e).split(J.default.sep),m=[];for(let f of[(0,J.join)(s,"rush.json"),...h]){let p=J.default.dirname(J.default.resolve(f)).split(J.default.sep),d=J.default.join(...p.slice(D.length)),c=await(0,le.parse)((await(0,ce.readFile)(f)).toString()),t=c.projects;for(let[i,n]of Object.entries(c))l[i]=n;m.push(...t.map(i=>Dt(xt({},i),{projectFolder:(0,J.join)(d,i.projectFolder),shouldPublish:d==="."?i.shouldPublish:!1})))}l.projects=m,await(0,ce.writeFile)(o,(0,le.stringify)(l,void 0,2))}console.info("Anticrm Platform Manager");Ae.program.version("0.6.0");Ae.program.command("rush-sync ").description("Synchronized rush.js files with platform.").option("-e, --exclude ","List of exclude patterns to override excludes (comma separated)","").option("-i, --include ","List of include patterns to override excludes (comma separated)","").option("-s, --source ","Comma separated list of rush_source.json files","rush_source.json").action(async(h,e)=>{await Mi(e.source.split(",").map(s=>(0,Li.join)(process.cwd(),s.trim())),process.cwd(),h,e.include.split(","),e.exclude.split(","))});Ae.program.parse(process.argv); +`):p+=a}return d||this.throwUnexpectedToken(),t||this.curlyStack.pop(),{type:10,value:this.source.slice(c+1,this.index-n),cooked:p,head:t,tail:i,lineNumber:this.lineNumber,lineStart:this.lineStart,start:c,end:this.index}},f.prototype.testRegExp=function(p,d){var c="\uFFFF",t=p,i=this;d.indexOf("u")>=0&&(t=t.replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g,function(n,a,x){var E=parseInt(a||x,16);return E>1114111&&i.throwUnexpectedToken(l.Messages.InvalidRegExp),E<=65535?String.fromCharCode(E):c}).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c));try{RegExp(t)}catch{this.throwUnexpectedToken(l.Messages.InvalidRegExp)}try{return new RegExp(p,d)}catch{return null}},f.prototype.scanRegExpBody=function(){var p=this.source[this.index];r.assert(p==="/","Regular expression literal must start with a slash");for(var d=this.source[this.index++],c=!1,t=!1;!this.eof();)if(p=this.source[this.index++],d+=p,p==="\\")p=this.source[this.index++],u.Character.isLineTerminator(p.charCodeAt(0))&&this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),d+=p;else if(u.Character.isLineTerminator(p.charCodeAt(0)))this.throwUnexpectedToken(l.Messages.UnterminatedRegExp);else if(c)p==="]"&&(c=!1);else if(p==="/"){t=!0;break}else p==="["&&(c=!0);return t||this.throwUnexpectedToken(l.Messages.UnterminatedRegExp),d.substr(1,d.length-2)},f.prototype.scanRegExpFlags=function(){for(var p="",d="";!this.eof();){var c=this.source[this.index];if(!u.Character.isIdentifierPart(c.charCodeAt(0)))break;if(++this.index,c==="\\"&&!this.eof())if(c=this.source[this.index],c==="u"){++this.index;var t=this.index,i=this.scanHexEscape("u");if(i!==null)for(d+=i,p+="\\u";t=55296&&p<57343&&u.Character.isIdentifierStart(this.codePointAt(this.index))?this.scanIdentifier():this.scanPunctuator()},f}();e.Scanner=m},function(h,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.TokenName={},e.TokenName[1]="Boolean",e.TokenName[2]="",e.TokenName[3]="Identifier",e.TokenName[4]="Keyword",e.TokenName[5]="Null",e.TokenName[6]="Numeric",e.TokenName[7]="Punctuator",e.TokenName[8]="String",e.TokenName[9]="RegularExpression",e.TokenName[10]="Template"},function(h,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHTMLEntities={quot:'"',amp:"&",apos:"'",gt:">",nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",fnof:"\u0192",circ:"\u02C6",tilde:"\u02DC",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",bull:"\u2022",hellip:"\u2026",permil:"\u2030",prime:"\u2032",Prime:"\u2033",lsaquo:"\u2039",rsaquo:"\u203A",oline:"\u203E",frasl:"\u2044",euro:"\u20AC",image:"\u2111",weierp:"\u2118",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",lang:"\u27E8",rang:"\u27E9"}},function(h,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=s(10),u=s(12),l=s(13),o=function(){function m(){this.values=[],this.curly=this.paren=-1}return m.prototype.beforeFunctionExpression=function(f){return["(","{","[","in","typeof","instanceof","new","return","case","delete","throw","void","=","+=","-=","*=","**=","/=","%=","<<=",">>=",">>>=","&=","|=","^=",",","+","-","*","**","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","?",":","===","==",">=","<=","<",">","!=","!=="].indexOf(f)>=0},m.prototype.isRegexStart=function(){var f=this.values[this.values.length-1],p=f!==null;switch(f){case"this":case"]":p=!1;break;case")":var d=this.values[this.paren-1];p=d==="if"||d==="while"||d==="for"||d==="with";break;case"}":if(p=!1,this.values[this.curly-3]==="function"){var c=this.values[this.curly-4];p=c?!this.beforeFunctionExpression(c):!1}else if(this.values[this.curly-4]==="function"){var c=this.values[this.curly-5];p=c?!this.beforeFunctionExpression(c):!0}break;default:break}return p},m.prototype.push=function(f){f.type===7||f.type===4?(f.value==="{"?this.curly=this.values.length:f.value==="("&&(this.paren=this.values.length),this.values.push(f.value)):this.values.push(null)},m}(),D=function(){function m(f,p){this.errorHandler=new r.ErrorHandler,this.errorHandler.tolerant=p?typeof p.tolerant=="boolean"&&p.tolerant:!1,this.scanner=new u.Scanner(f,this.errorHandler),this.scanner.trackComment=p?typeof p.comment=="boolean"&&p.comment:!1,this.trackRange=p?typeof p.range=="boolean"&&p.range:!1,this.trackLoc=p?typeof p.loc=="boolean"&&p.loc:!1,this.buffer=[],this.reader=new o}return m.prototype.errors=function(){return this.errorHandler.errors},m.prototype.getNextToken=function(){if(this.buffer.length===0){var f=this.scanner.scanComments();if(this.scanner.trackComment)for(var p=0;p{function ir(h){return Array.isArray?Array.isArray(h):me(h)==="[object Array]"}I.isArray=ir;function sr(h){return typeof h=="boolean"}I.isBoolean=sr;function rr(h){return h===null}I.isNull=rr;function nr(h){return h==null}I.isNullOrUndefined=nr;function ar(h){return typeof h=="number"}I.isNumber=ar;function or(h){return typeof h=="string"}I.isString=or;function ur(h){return typeof h=="symbol"}I.isSymbol=ur;function hr(h){return h===void 0}I.isUndefined=hr;function lr(h){return me(h)==="[object RegExp]"}I.isRegExp=lr;function cr(h){return typeof h=="object"&&h!==null}I.isObject=cr;function pr(h){return me(h)==="[object Date]"}I.isDate=pr;function fr(h){return me(h)==="[object Error]"||h instanceof Error}I.isError=fr;function mr(h){return typeof h=="function"}I.isFunction=mr;function dr(h){return h===null||typeof h=="boolean"||typeof h=="number"||typeof h=="string"||typeof h=="symbol"||typeof h>"u"}I.isPrimitive=dr;I.isBuffer=require("buffer").Buffer.isBuffer;function me(h){return Object.prototype.toString.call(h)}});var Rt=_((zn,Xt)=>{var _t=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9],F,It=h=>h<1e5?h<100?h<10?0:1:h<1e4?h<1e3?2:3:4:h<1e7?h<1e6?5:6:h<1e9?h<1e8?7:8:9;function Pt(h,e){if(h===e)return 0;if(~~h===h&&~~e===e){if(h===0||e===0)return h=0)return-1;if(h>=0)return 1;h=-h,e=-e}let u=It(h),l=It(e),o=0;return ul&&(e*=_t[u-l-1],h/=10,o=1),h===e?o:h=32;)e|=h&1,h>>=1;return h+e}function Ot(h,e,s,r){let u=e+1;if(u===s)return 1;if(r(h[u++],h[e])<0){for(;u=0;)u++;return u-e}function Mt(h,e,s){for(s--;e>>1;u(l,h[p])<0?m=p:D=p+1}let f=r-D;switch(f){case 3:h[D+3]=h[D+2],F[D+3]=F[D+2];case 2:h[D+2]=h[D+1],F[D+2]=F[D+1];case 1:h[D+1]=h[D],F[D+1]=F[D];break;default:for(;f>0;)h[D+f]=h[D+f-1],F[D+f]=F[D+f-1],f--}h[D]=l,F[D]=o}}function Ue(h,e,s,r,u,l){let o=0,D=0,m=1;if(l(h,e[s+u])>0){for(D=r-u;m0;)o=m,m=(m<<1)+1,m<=0&&(m=D);m>D&&(m=D),o+=u,m+=u}else{for(D=u+1;mD&&(m=D);let f=o;o=u-m,m=u-f}for(o++;o>>1);l(h,e[s+f])>0?o=f+1:m=f}return m}function ze(h,e,s,r,u,l){let o=0,D=0,m=1;if(l(h,e[s+u])<0){for(D=u+1;mD&&(m=D);let f=o;o=u-m,m=u-f}else{for(D=r-u;m=0;)o=m,m=(m<<1)+1,m<=0&&(m=D);m>D&&(m=D),o+=u,m+=u}for(o++;o>>1);l(h,e[s+f])<0?m=f:o=f+1}return m}var He=class{constructor(e,s){this.array=e,this.compare=s;let{length:r}=e;this.length=r,this.minGallop=7,this.tmpStorageLength=r<2*256?r>>>1:256,this.tmp=new Array(this.tmpStorageLength),this.tmpIndex=new Array(this.tmpStorageLength),this.stackLength=r<120?5:r<1542?10:r<119151?19:40,this.runStart=new Array(this.stackLength),this.runLength=new Array(this.stackLength),this.stackSize=0}pushRun(e,s){this.runStart[this.stackSize]=e,this.runLength[this.stackSize]=s,this.stackSize+=1}mergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;if(e>=1&&this.runLength[e-1]<=this.runLength[e]+this.runLength[e+1]||e>=2&&this.runLength[e-2]<=this.runLength[e]+this.runLength[e-1])this.runLength[e-1]this.runLength[e+1])break;this.mergeAt(e)}}forceMergeRuns(){for(;this.stackSize>1;){let e=this.stackSize-2;e>0&&this.runLength[e-1]=7||n>=7);if(a)break;t<0&&(t=0),t+=2}if(this.minGallop=t,t<1&&(this.minGallop=1),s===1){for(f=0;f=0;f--)o[i+f]=o[t+f],F[i+f]=F[t+f];o[c]=D[d],F[c]=m[d];return}let{minGallop:n}=this;for(;;){let a=0,x=0,E=!1;do if(l(D[d],o[p])<0){if(o[c]=o[p],F[c]=F[p],c--,p--,a++,x=0,--s===0){E=!0;break}}else if(o[c]=D[d],F[c]=m[d],c--,d--,x++,a=0,--u===1){E=!0;break}while((a|x)=0;f--)o[i+f]=o[t+f],F[i+f]=F[t+f];if(s===0){E=!0;break}}if(o[c]=D[d],F[c]=m[d],c--,d--,--u===1){E=!0;break}if(x=u-Ue(o[p],D,0,u,u-1,l),x!==0){for(c-=x,d-=x,u-=x,i=c+1,t=d+1,f=0;f=7||x>=7);if(E)break;n<0&&(n=0),n+=2}if(this.minGallop=n,n<1&&(this.minGallop=1),u===1){for(c-=s,p-=s,i=c+1,t=p+1,f=s-1;f>=0;f--)o[i+f]=o[t+f],F[i+f]=F[t+f];o[c]=D[d],F[c]=m[d]}else{if(u===0)throw new Error("mergeHigh preconditions were not respected");for(t=c-(u-1),f=0;ff&&(p=f),Lt(h,s,s+p,s+D,e),D=p}m.pushRun(s,D),m.mergeRuns(),o-=D,s+=D}while(o!==0);return m.forceMergeRuns(),F}Xt.exports={sort:Dr}});var Ut=_((Hn,Jt)=>{"use strict";var Er=Object.prototype.hasOwnProperty;Jt.exports=(h,e)=>Er.call(h,e)});var ne=_((jn,Qt)=>{var Ke=Ut(),{isObject:zt,isArray:gr,isString:vr,isNumber:Cr}=de(),$e="before",jt="after-prop",Vt="after-colon",Kt="after-value",$t="after",Gt="before-all",Wt="after-all",Ar="[",yr="]",Sr="{",Fr="}",wr=",",br="",kr="-",Ge=[$e,jt,Vt,Kt,$t],Br=[$e,Gt,Wt].map(Symbol.for),qt=":",Ht=void 0,re=(h,e)=>Symbol.for(h+qt+e),xe=(h,e,s)=>Object.defineProperty(h,e,{value:s,writable:!0,configurable:!0}),Ve=(h,e,s,r,u,l)=>{let o=re(u,r);if(!Ke(e,o))return;let D=s===r?o:re(u,s);xe(h,D,e[o]),l&&delete e[o]},Yt=(h,e,s,r,u)=>{Ge.forEach(l=>{Ve(h,e,s,r,l,u)})},Tr=(h,e,s)=>{e!==s&&Ge.forEach(r=>{let u=re(r,s);if(!Ke(h,u)){Ve(h,h,s,e,r,!0);return}let l=h[u];delete h[u],Ve(h,h,s,e,r,!0),xe(h,re(r,e),l)})},je=(h,e)=>{Br.forEach(s=>{let r=e[s];r&&xe(h,s,r)})},Nr=(h,e,s)=>(s.forEach(r=>{!vr(r)&&!Cr(r)||Ke(e,r)&&(h[r]=e[r],Yt(h,e,r,r))}),h);Qt.exports={SYMBOL_PREFIXES:Ge,PREFIX_BEFORE:$e,PREFIX_AFTER_PROP:jt,PREFIX_AFTER_COLON:Vt,PREFIX_AFTER_VALUE:Kt,PREFIX_AFTER:$t,PREFIX_BEFORE_ALL:Gt,PREFIX_AFTER_ALL:Wt,BRACKET_OPEN:Ar,BRACKET_CLOSE:yr,CURLY_BRACKET_OPEN:Sr,CURLY_BRACKET_CLOSE:Fr,COLON:qt,COMMA:wr,MINUS:kr,EMPTY:br,UNDEFINED:Ht,symbol:re,define:xe,copy_comments:Yt,swap_comments:Tr,assign_non_prop_comments:je,assign(h,e,s){if(!zt(h))throw new TypeError("Cannot convert undefined or null to object");if(!zt(e))return h;if(s===Ht)s=Object.keys(e),je(h,e);else if(gr(s))s.length===0&&je(h,e);else throw new TypeError("keys must be array or undefined");return Nr(h,e,s)}}});var We=_((Vn,si)=>{var{isArray:_r}=de(),{sort:Ir}=Rt(),{SYMBOL_PREFIXES:Pr,UNDEFINED:Zt,symbol:Or,copy_comments:Mr,swap_comments:ii}=ne(),Lr=h=>{let{length:e}=h,s=0,r=e/2;for(;s{Mr(h,e,s+r,s,u)},Q=(h,e,s,r,u,l)=>{if(u>0){let D=r;for(;D-- >0;)ei(h,e,s+D,u,l);return}let o=0;for(;o{Pr.forEach(s=>{let r=Or(s,e);delete h[r]})},Xr=(h,e)=>{let s=e;for(;s in h;)s=h[s];return s},Z=class extends Array{splice(...e){let{length:s}=this,r=super.splice(...e),[u,l,...o]=e;u<0&&(u+=s),arguments.length===1?l=s-u:l=Math.min(s-u,l);let{length:D}=o,m=D-l,f=u+l,p=s-f;return Q(this,this,f,p,m,!0),r}slice(...e){let{length:s}=this,r=super.slice(...e);if(!r.length)return new Z;let[u,l]=e;return l===Zt?l=s:l<0&&(l+=s),u<0?u+=s:u===Zt&&(u=0),Q(r,this,u,l-u,-u),r}unshift(...e){let{length:s}=this,r=super.unshift(...e),{length:u}=e;return u>0&&Q(this,this,0,s,u,!0),r}shift(){let e=super.shift(),{length:s}=this;return ti(this,0),Q(this,this,1,s,-1,!0),e}reverse(){return super.reverse(),Lr(this),this}pop(){let e=super.pop();return ti(this,this.length),e}concat(...e){let{length:s}=this,r=super.concat(...e);return e.length&&(Q(r,this,0,this.length,0),e.forEach(u=>{let l=s;s+=_r(u)?u.length:1,u instanceof Z&&Q(r,u,0,u.length,l)})),r}sort(...e){let s=Ir(this,...e.slice(0,1)),r=Object.create(null);return s.forEach((u,l)=>{if(u===l)return;let o=Xr(r,u);o!==l&&(r[l]=o,ii(this,l,o))}),this}};si.exports={CommentArray:Z}});var vi=_((Kn,gi)=>{var Rr=Nt(),{CommentArray:Jr}=We(),{PREFIX_BEFORE:Ee,PREFIX_AFTER_PROP:Ur,PREFIX_AFTER_COLON:zr,PREFIX_AFTER_VALUE:oi,PREFIX_AFTER:Ye,PREFIX_BEFORE_ALL:Hr,PREFIX_AFTER_ALL:jr,BRACKET_OPEN:Vr,BRACKET_CLOSE:ri,CURLY_BRACKET_OPEN:Kr,CURLY_BRACKET_CLOSE:ni,COLON:ui,COMMA:hi,MINUS:ai,EMPTY:$r,UNDEFINED:Ce,define:Qe,assign_non_prop_comments:Gr}=ne(),li=h=>Rr.tokenize(h,{comment:!0,loc:!0}),Ze=[],K=null,z=null,et=[],$,ci=!1,pi=!1,ae=null,oe=null,P=null,fi,ge=null,mi=()=>{et.length=Ze.length=0,oe=null,$=Ce},Wr=()=>{mi(),ae.length=0,z=K=ae=oe=P=ge=null},tt=h=>Symbol.for($!==Ce?h+ui+$:h),it=(h,e)=>ge?ge(h,e):e,di=()=>{let h=new SyntaxError(`Unexpected token ${P.value.slice(0,1)}`);throw Object.assign(h,P.loc.start),h},xi=()=>{let h=new SyntaxError("Unexpected end of JSON input");throw Object.assign(h,oe?oe.loc.end:{line:1,column:0}),h},R=()=>{let h=ae[++fi];pi=P&&h&&P.loc.end.line===h.loc.start.line||!1,oe=P,P=h},qe=()=>(P||xi(),P.type==="Punctuator"?P.value:P.type),W=h=>qe()===h,De=h=>{W(h)||di()},st=h=>{Ze.push(K),K=h},rt=()=>{K=Ze.pop()},Di=()=>{if(!z)return;let h=[];for(let s of z)if(s.inline)h.push(s);else break;let{length:e}=h;e&&(e===z.length?z=null:z.splice(0,e),Qe(K,tt(Ye),h))},V=h=>{z&&(Qe(K,tt(h),z),z=null)},H=h=>{let e=[];for(;P&&(W("LineComment")||W("BlockComment"));){let s={...P,inline:pi};e.push(s),R()}if(!ci&&e.length){if(h){Qe(K,tt(h),e);return}z=e}},ve=(h,e)=>{e&&et.push($),$=h},Ei=()=>{$=et.pop()},qr=()=>{let h={};st(h),ve(Ce,!0);let e=!1,s;for(H();!W(ni)&&!(e&&(V(oi),De(hi),R(),H(),Di(),W(ni)));)e=!0,De("String"),s=JSON.parse(P.value),ve(s),V(Ee),R(),H(Ur),De(ui),R(),H(zr),h[s]=it(s,nt()),H();return e&&V(Ye),R(),$=void 0,e||V(Ee),rt(),Ei(),h},Yr=()=>{let h=new Jr;st(h),ve(Ce,!0);let e=!1,s=0;for(H();!W(ri)&&!(e&&(V(oi),De(hi),R(),H(),Di(),W(ri)));)e=!0,ve(s),V(Ee),h[s]=it(s,nt()),s++,H();return e&&V(Ye),R(),$=void 0,e||V(Ee),rt(),Ei(),h};function nt(){let h=qe();if(h===Kr)return R(),qr();if(h===Vr)return R(),Yr();let e=$r;h===ai&&(R(),h=qe(),e=ai);let s;switch(h){case"String":case"Boolean":case"Null":case"Numeric":return s=P.value,R(),JSON.parse(e+s);default:}}var Qr=h=>Object(h)===h,Zr=(h,e,s)=>{mi(),ae=li(h),ge=e,ci=s,ae.length||xi(),fi=-1,R(),st({}),H(Hr);let r=nt();return H(jr),P&&di(),!s&&r!==null&&(Qr(r)||(r=new Object(r)),Gr(r,K)),rt(),r=it("",r),Wr(),r};gi.exports={parse:Zr,tokenize:li}});var Ai=_(($n,Ci)=>{"use strict";var j="",at;Ci.exports=en;function en(h,e){if(typeof h!="string")throw new TypeError("expected a string");if(e===1)return h;if(e===2)return h+h;var s=h.length*e;if(at!==h||typeof at>"u")at=h,j="";else if(j.length>=s)return j.substr(0,s);for(;s>j.length&&e>1;)e&1&&(j+=h),e>>=1,h+=h;return j+=h,j=j.substr(0,s),j}});var Ii=_((Gn,_i)=>{var{isArray:ht,isObject:yi,isFunction:ut,isNumber:tn,isString:sn}=de(),rn=Ai(),{PREFIX_BEFORE_ALL:nn,PREFIX_BEFORE:Si,PREFIX_AFTER_PROP:an,PREFIX_AFTER_COLON:on,PREFIX_AFTER_VALUE:un,PREFIX_AFTER:lt,PREFIX_AFTER_ALL:hn,BRACKET_OPEN:ln,BRACKET_CLOSE:cn,CURLY_BRACKET_OPEN:pn,CURLY_BRACKET_CLOSE:fn,COLON:mn,COMMA:Fi,EMPTY:X,UNDEFINED:dn}=ne(),ot=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,ct=" ",q=` +`,wi="null",bi=h=>`${Si}:${h}`,xn=h=>`${an}:${h}`,Dn=h=>`${on}:${h}`,ki=h=>`${un}:${h}`,Bi=h=>`${lt}:${h}`,En={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},gn=h=>(ot.lastIndex=0,ot.test(h)?h.replace(ot,e=>{let s=En[e];return typeof s=="string"?s:e}):h),Ti=h=>`"${gn(h)}"`,vn=(h,e)=>e?`//${h}`:`/*${h}*/`,L=(h,e,s,r)=>{let u=h[Symbol.for(e)];if(!u||!u.length)return X;let l=!1,o=u.reduce((D,{inline:m,type:f,value:p})=>{let d=m?ct:q+s;return l=f==="LineComment",D+d+vn(p,l)},X);return r||l?o+q+s:o},ee=null,he=X,Cn=()=>{ee=null,he=X},ue=(h,e,s)=>h?e?h+e.trim()+q+s:h.trimRight()+q+s:e?e.trimRight()+q+s:X,Ni=(h,e,s)=>{let r=L(e,Si,s+he,!0);return ue(r,h,s)},An=(h,e)=>{let s=e+he,{length:r}=h,u=X,l=X;for(let o=0;o{if(!h)return"null";let s=e+he,r=X,u=X,l=!0,o=ht(ee)?ee:Object.keys(h),D=m=>{let f=pt(m,h,s);if(f===dn)return;l||(r+=Fi),l=!1;let p=ue(u,L(h,bi(m),s),s);r+=p||q+s,r+=Ti(m)+L(h,xn(m),s)+mn+L(h,Dn(m),s)+ct+f+L(h,ki(m),s),u=L(h,Bi(m),s)};return o.forEach(D),r+=ue(u,L(h,lt,s),s),pn+Ni(r,h,e)+fn};function pt(h,e,s){let r=e[h];switch(yi(r)&&ut(r.toJSON)&&(r=r.toJSON(h)),ut(ee)&&(r=ee.call(e,h,r)),typeof r){case"string":return Ti(r);case"number":return Number.isFinite(r)?String(r):wi;case"boolean":case"null":return String(r);case"object":return ht(r)?An(r,s):yn(r,s);default:}}var Sn=h=>sn(h)?h:tn(h)?rn(ct,h):X,{toString:Fn}=Object.prototype,wn=["[object Number]","[object String]","[object Boolean]"],bn=h=>{if(typeof h!="object")return!1;let e=Fn.call(h);return wn.includes(e)};_i.exports=(h,e,s)=>{let r=Sn(s);if(!r)return JSON.stringify(h,e);!ut(e)&&!ht(e)&&(e=null),ee=e,he=r;let u=bn(h)?JSON.stringify(h):pt("",{"":h},X);return Cn(),yi(h)?L(h,nn,X).trimLeft()+u+L(h,hn,X).trimRight():u}});var Oi=_((Wn,Pi)=>{var{parse:kn,tokenize:Bn}=vi(),Tn=Ii(),{CommentArray:Nn}=We(),{assign:_n}=ne();Pi.exports={parse:kn,stringify:Tn,tokenize:Bn,CommentArray:Nn,assign:_n}});var Ae=we(Tt()),Li=require("path");var le=we(Oi()),ce=require("fs/promises"),J=we(require("path"));async function Mi(h,e,s,r,u){let l=(0,le.parse)((await(0,ce.readFile)((0,J.join)(process.cwd(),s,"rush.json"))).toString()),o=(0,J.join)(e,"rush.json"),D=J.default.resolve(e).split(J.default.sep),m=[];for(let f of[(0,J.join)(s,"rush.json"),...h]){let p=J.default.dirname(J.default.resolve(f)).split(J.default.sep),d=J.default.join(...p.slice(D.length));console.log("processing",d);let c=await(0,le.parse)((await(0,ce.readFile)(f)).toString()),t=c.projects;for(let[i,n]of Object.entries(c))l[i]=n;m.push(...t.filter(i=>In(i,r,u)).map(i=>Dt(xt({},i),{projectFolder:(0,J.join)(d,i.projectFolder),shouldPublish:d==="."?i.shouldPublish:!1})))}l.projects=m,await(0,ce.writeFile)(o,(0,le.stringify)(l,void 0,2))}function In(h,e,s){let r=h.packageName;for(let u of e)if(r.includes(u))return console.log("Include",r,u),!0;for(let u of s)if(r.includes(u))return console.log("Exclude",r,u),!1;return console.log("Default",r),!0}console.info("Anticrm Platform Manager");Ae.program.version("0.6.0");Ae.program.command("rush-sync ").description("Synchronized rush.js files with platform.").option("-e, --exclude ","List of exclude patterns to override excludes (comma separated)","").option("-i, --include ","List of include patterns to override excludes (comma separated)","").option("-s, --source ","Comma separated list of rush_source.json files","rush_source.json").action(async(h,e)=>{await Mi(e.source.split(",").map(s=>(0,Li.join)(process.cwd(),s.trim())),process.cwd(),h,e.include.split(",").map(s=>s.trim()).filter(s=>s.length>0),e.exclude.split(",").map(s=>s.trim()).filter(s=>s.length>0))});Ae.program.parse(process.argv); /*! Bundled license information: repeat-string/index.js: diff --git a/tools/apm/src/index.ts b/tools/apm/src/index.ts index 3a4dc8bcda..682f517cd1 100644 --- a/tools/apm/src/index.ts +++ b/tools/apm/src/index.ts @@ -17,8 +17,14 @@ program cmd.source.split(',').map((it) => join(process.cwd(), it.trim())), process.cwd(), root, - cmd.include.split(','), - cmd.exclude.split(',') + cmd.include + .split(',') + .map((it) => it.trim()) + .filter((it) => it.length > 0), + cmd.exclude + .split(',') + .map((it) => it.trim()) + .filter((it) => it.length > 0) ) }) diff --git a/tools/apm/src/sync.ts b/tools/apm/src/sync.ts index 4c37a5facb..a4524cc090 100644 --- a/tools/apm/src/sync.ts +++ b/tools/apm/src/sync.ts @@ -28,21 +28,22 @@ export async function syncRushFiles ( for (const prj of [join(platformRoot, 'rush.json'), ...root]) { const sPath = path.dirname(path.resolve(prj)).split(path.sep) const diff = path.join(...sPath.slice(abs.length)) + console.log('processing', diff) const rushJsonSource = (await parse((await readFile(prj)).toString())) as CommentObject const sprojects = rushJsonSource.projects as unknown as CommentArray for (const [k, v] of Object.entries(rushJsonSource)) { platformJson[k] = v } - projects - .filter((it) => filterPackage(it, include, exclude)) - .push( - ...sprojects.map((it) => ({ + projects.push( + ...sprojects + .filter((it) => filterPackage(it, include, exclude)) + .map((it) => ({ ...it, projectFolder: join(diff, it.projectFolder), shouldPublish: diff === '.' ? it.shouldPublish : false })) - ) + ) } platformJson.projects = projects as unknown as CommentArray @@ -53,13 +54,16 @@ function filterPackage (it: RushPackage, include: string[], exclude: string[]): const pkgName = it.packageName for (const i of include) { if (pkgName.includes(i)) { + console.log('Include', pkgName, i) return true } } for (const i of exclude) { if (pkgName.includes(i)) { + console.log('Exclude', pkgName, i) return false } } + console.log('Default', pkgName) return true }