diff --git a/.gitignore b/.gitignore index c902082..d6dbd32 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules firebase-debug.log dist -redux-tutorial \ No newline at end of file +redux-tutorial +coverage diff --git a/coverage/base.css b/coverage/base.css deleted file mode 100644 index f418035..0000000 --- a/coverage/base.css +++ /dev/null @@ -1,224 +0,0 @@ -body, html { - margin:0; padding: 0; - height: 100%; -} -body { - font-family: Helvetica Neue, Helvetica, Arial; - font-size: 14px; - color:#333; -} -.small { font-size: 12px; } -*, *:after, *:before { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; - } -h1 { font-size: 20px; margin: 0;} -h2 { font-size: 14px; } -pre { - font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; - margin: 0; - padding: 0; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; -} -a { color:#0074D9; text-decoration:none; } -a:hover { text-decoration:underline; } -.strong { font-weight: bold; } -.space-top1 { padding: 10px 0 0 0; } -.pad2y { padding: 20px 0; } -.pad1y { padding: 10px 0; } -.pad2x { padding: 0 20px; } -.pad2 { padding: 20px; } -.pad1 { padding: 10px; } -.space-left2 { padding-left:55px; } -.space-right2 { padding-right:20px; } -.center { text-align:center; } -.clearfix { display:block; } -.clearfix:after { - content:''; - display:block; - height:0; - clear:both; - visibility:hidden; - } -.fl { float: left; } -@media only screen and (max-width:640px) { - .col3 { width:100%; max-width:100%; } - .hide-mobile { display:none!important; } -} - -.quiet { - color: #7f7f7f; - color: rgba(0,0,0,0.5); -} -.quiet a { opacity: 0.7; } - -.fraction { - font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; - font-size: 10px; - color: #555; - background: #E8E8E8; - padding: 4px 5px; - border-radius: 3px; - vertical-align: middle; -} - -div.path a:link, div.path a:visited { color: #333; } -table.coverage { - border-collapse: collapse; - margin: 10px 0 0 0; - padding: 0; -} - -table.coverage td { - margin: 0; - padding: 0; - vertical-align: top; -} -table.coverage td.line-count { - text-align: right; - padding: 0 5px 0 20px; -} -table.coverage td.line-coverage { - text-align: right; - padding-right: 10px; - min-width:20px; -} - -table.coverage td span.cline-any { - display: inline-block; - padding: 0 5px; - width: 100%; -} -.missing-if-branch { - display: inline-block; - margin-right: 5px; - border-radius: 3px; - position: relative; - padding: 0 4px; - background: #333; - color: yellow; -} - -.skip-if-branch { - display: none; - margin-right: 10px; - position: relative; - padding: 0 4px; - background: #ccc; - color: white; -} -.missing-if-branch .typ, .skip-if-branch .typ { - color: inherit !important; -} -.coverage-summary { - border-collapse: collapse; - width: 100%; -} -.coverage-summary tr { border-bottom: 1px solid #bbb; } -.keyline-all { border: 1px solid #ddd; } -.coverage-summary td, .coverage-summary th { padding: 10px; } -.coverage-summary tbody { border: 1px solid #bbb; } -.coverage-summary td { border-right: 1px solid #bbb; } -.coverage-summary td:last-child { border-right: none; } -.coverage-summary th { - text-align: left; - font-weight: normal; - white-space: nowrap; -} -.coverage-summary th.file { border-right: none !important; } -.coverage-summary th.pct { } -.coverage-summary th.pic, -.coverage-summary th.abs, -.coverage-summary td.pct, -.coverage-summary td.abs { text-align: right; } -.coverage-summary td.file { white-space: nowrap; } -.coverage-summary td.pic { min-width: 120px !important; } -.coverage-summary tfoot td { } - -.coverage-summary .sorter { - height: 10px; - width: 7px; - display: inline-block; - margin-left: 0.5em; - background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; -} -.coverage-summary .sorted .sorter { - background-position: 0 -20px; -} -.coverage-summary .sorted-desc .sorter { - background-position: 0 -10px; -} -.status-line { height: 10px; } -/* yellow */ -.cbranch-no { background: yellow !important; color: #111; } -/* dark red */ -.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } -.low .chart { border:1px solid #C21F39 } -.highlighted, -.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{ - background: #C21F39 !important; -} -/* medium red */ -.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } -/* light red */ -.low, .cline-no { background:#FCE1E5 } -/* light green */ -.high, .cline-yes { background:rgb(230,245,208) } -/* medium green */ -.cstat-yes { background:rgb(161,215,106) } -/* dark green */ -.status-line.high, .high .cover-fill { background:rgb(77,146,33) } -.high .chart { border:1px solid rgb(77,146,33) } -/* dark yellow (gold) */ -.status-line.medium, .medium .cover-fill { background: #f9cd0b; } -.medium .chart { border:1px solid #f9cd0b; } -/* light yellow */ -.medium { background: #fff4c2; } - -.cstat-skip { background: #ddd; color: #111; } -.fstat-skip { background: #ddd; color: #111 !important; } -.cbranch-skip { background: #ddd !important; color: #111; } - -span.cline-neutral { background: #eaeaea; } - -.coverage-summary td.empty { - opacity: .5; - padding-top: 4px; - padding-bottom: 4px; - line-height: 1; - color: #888; -} - -.cover-fill, .cover-empty { - display:inline-block; - height: 12px; -} -.chart { - line-height: 0; -} -.cover-empty { - background: white; -} -.cover-full { - border-right: none !important; -} -pre.prettyprint { - border: none !important; - padding: 0 !important; - margin: 0 !important; -} -.com { color: #999 !important; } -.ignore-none { color: #999; font-weight: normal; } - -.wrapper { - min-height: 100%; - height: auto !important; - height: 100%; - margin: 0 auto -48px; -} -.footer, .push { - height: 48px; -} diff --git a/coverage/block-navigation.js b/coverage/block-navigation.js deleted file mode 100644 index c7ff5a5..0000000 --- a/coverage/block-navigation.js +++ /dev/null @@ -1,79 +0,0 @@ -/* eslint-disable */ -var jumpToCode = (function init() { - // Classes of code we would like to highlight in the file view - var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no']; - - // Elements to highlight in the file listing view - var fileListingElements = ['td.pct.low']; - - // We don't want to select elements that are direct descendants of another match - var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` - - // Selecter that finds elements on the page to which we can jump - var selector = - fileListingElements.join(', ') + - ', ' + - notSelector + - missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` - - // The NodeList of matching elements - var missingCoverageElements = document.querySelectorAll(selector); - - var currentIndex; - - function toggleClass(index) { - missingCoverageElements - .item(currentIndex) - .classList.remove('highlighted'); - missingCoverageElements.item(index).classList.add('highlighted'); - } - - function makeCurrent(index) { - toggleClass(index); - currentIndex = index; - missingCoverageElements.item(index).scrollIntoView({ - behavior: 'smooth', - block: 'center', - inline: 'center' - }); - } - - function goToPrevious() { - var nextIndex = 0; - if (typeof currentIndex !== 'number' || currentIndex === 0) { - nextIndex = missingCoverageElements.length - 1; - } else if (missingCoverageElements.length > 1) { - nextIndex = currentIndex - 1; - } - - makeCurrent(nextIndex); - } - - function goToNext() { - var nextIndex = 0; - - if ( - typeof currentIndex === 'number' && - currentIndex < missingCoverageElements.length - 1 - ) { - nextIndex = currentIndex + 1; - } - - makeCurrent(nextIndex); - } - - return function jump(event) { - switch (event.which) { - case 78: // n - case 74: // j - goToNext(); - break; - case 66: // b - case 75: // k - case 80: // p - goToPrevious(); - break; - } - }; -})(); -window.addEventListener('keydown', jumpToCode); diff --git a/coverage/index.html b/coverage/index.html deleted file mode 100644 index 05d254e..0000000 --- a/coverage/index.html +++ /dev/null @@ -1,123 +0,0 @@ - - - - Code coverage report for All files - - - - - - - -
-
-

- All files -

-
-
- 100% - Statements - 51/51 -
-
- 90.91% - Branches - 10/11 -
-
- 100% - Functions - 18/18 -
-
- 100% - Lines - 47/47 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
src
100%8/8100%0/0100%4/4100%8/8
src/game
100%31/3188.89%8/9100%11/11100%27/27
src/utils
100%12/12100%2/2100%3/3100%12/12
-
-
- - - - - - - - diff --git a/coverage/lcov.info b/coverage/lcov.info deleted file mode 100644 index 982e60e..0000000 --- a/coverage/lcov.info +++ /dev/null @@ -1,166 +0,0 @@ -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/open-wc-logo.js -FNF:0 -FNH:0 -DA:3,1 -LF:1 -LH:1 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/under-cover.js -FN:6,get -FN:12,UnderCover -FN:60,render -FN:17,get -FNF:4 -FNH:4 -FNDA:1,get -FNDA:2,UnderCover -FNDA:2,render -FNDA:1,get -DA:7,1 -DA:12,4 -DA:13,2 -DA:14,2 -DA:18,1 -DA:61,2 -DA:83,1 -LF:7 -LH:7 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/game/gameActions.js -FN:21,stopGame -FN:25,createGame -FNF:2 -FNH:2 -FNDA:1,stopGame -FNDA:1,createGame -DA:3,1 -DA:4,1 -DA:6,1 -DA:13,1 -DA:22,1 -DA:26,1 -LF:6 -LH:6 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/game/gameCreator.js -FN:9,getRandomChallenge -FN:14,createMission -FN:23,createUser -FN:31,createPlayer -FN:39,createGame -FN:40,(anonymous_5) -FN:41,(anonymous_6) -FNF:7 -FNH:7 -FNDA:3,getRandomChallenge -FNDA:3,createMission -FNDA:3,createUser -FNDA:3,createPlayer -FNDA:1,createGame -FNDA:3,(anonymous_5) -FNDA:3,(anonymous_6) -DA:7,1 -DA:11,3 -DA:15,3 -DA:24,3 -DA:32,3 -DA:40,3 -DA:41,3 -DA:42,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/game/gameEngine.js -FN:21,(anonymous_0) -FNF:1 -FNH:1 -FNDA:2,(anonymous_0) -DA:5,1 -DA:10,1 -DA:14,1 -DA:20,1 -DA:21,2 -DA:22,1 -DA:23,1 -DA:25,1 -LF:8 -LH:8 -BRDA:17,0,0,1 -BRDA:17,0,1,0 -BRF:2 -BRH:1 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/game/gamesReducer.js -FN:4,gamesReducer -FNF:1 -FNH:1 -FNDA:5,gamesReducer -DA:4,5 -DA:5,5 -DA:7,1 -DA:11,1 -DA:13,3 -LF:5 -LH:5 -BRDA:4,0,0,2 -BRDA:4,0,1,3 -BRDA:4,1,0,10 -BRDA:4,1,1,5 -BRDA:6,2,0,1 -BRDA:6,2,1,1 -BRDA:6,2,2,3 -BRF:7 -BRH:7 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/utils/arrayUtils.js -FN:2,shuffle -FNF:1 -FNH:1 -FNDA:1,shuffle -DA:3,1 -DA:8,1 -DA:10,61 -DA:12,61 -DA:15,61 -DA:17,61 -DA:19,61 -DA:22,1 -LF:8 -LH:8 -BRF:0 -BRH:0 -end_of_record -TN: -SF:/Users/jlengrand/IdeaProjects/undercover/undercover/src/utils/uuid.js -FN:2,uuidv4 -FN:3,(anonymous_1) -FNF:2 -FNH:2 -FNDA:10,uuidv4 -FNDA:310,(anonymous_1) -DA:3,10 -DA:4,310 -DA:5,310 -DA:6,310 -LF:4 -LH:4 -BRDA:5,0,0,300 -BRDA:5,0,1,10 -BRF:2 -BRH:2 -end_of_record diff --git a/coverage/prettify.css b/coverage/prettify.css deleted file mode 100644 index b317a7c..0000000 --- a/coverage/prettify.css +++ /dev/null @@ -1 +0,0 @@ -.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} diff --git a/coverage/prettify.js b/coverage/prettify.js deleted file mode 100644 index b322523..0000000 --- a/coverage/prettify.js +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); diff --git a/coverage/sort-arrow-sprite.png b/coverage/sort-arrow-sprite.png deleted file mode 100644 index 03f704a..0000000 Binary files a/coverage/sort-arrow-sprite.png and /dev/null differ diff --git a/coverage/sorter.js b/coverage/sorter.js deleted file mode 100644 index 16de10c..0000000 --- a/coverage/sorter.js +++ /dev/null @@ -1,170 +0,0 @@ -/* eslint-disable */ -var addSorting = (function() { - 'use strict'; - var cols, - currentSort = { - index: 0, - desc: false - }; - - // returns the summary table element - function getTable() { - return document.querySelector('.coverage-summary'); - } - // returns the thead element of the summary table - function getTableHeader() { - return getTable().querySelector('thead tr'); - } - // returns the tbody element of the summary table - function getTableBody() { - return getTable().querySelector('tbody'); - } - // returns the th element for nth column - function getNthColumn(n) { - return getTableHeader().querySelectorAll('th')[n]; - } - - // loads all columns - function loadColumns() { - var colNodes = getTableHeader().querySelectorAll('th'), - colNode, - cols = [], - col, - i; - - for (i = 0; i < colNodes.length; i += 1) { - colNode = colNodes[i]; - col = { - key: colNode.getAttribute('data-col'), - sortable: !colNode.getAttribute('data-nosort'), - type: colNode.getAttribute('data-type') || 'string' - }; - cols.push(col); - if (col.sortable) { - col.defaultDescSort = col.type === 'number'; - colNode.innerHTML = - colNode.innerHTML + ''; - } - } - return cols; - } - // attaches a data attribute to every tr element with an object - // of data values keyed by column name - function loadRowData(tableRow) { - var tableCols = tableRow.querySelectorAll('td'), - colNode, - col, - data = {}, - i, - val; - for (i = 0; i < tableCols.length; i += 1) { - colNode = tableCols[i]; - col = cols[i]; - val = colNode.getAttribute('data-value'); - if (col.type === 'number') { - val = Number(val); - } - data[col.key] = val; - } - return data; - } - // loads all row data - function loadData() { - var rows = getTableBody().querySelectorAll('tr'), - i; - - for (i = 0; i < rows.length; i += 1) { - rows[i].data = loadRowData(rows[i]); - } - } - // sorts the table using the data for the ith column - function sortByIndex(index, desc) { - var key = cols[index].key, - sorter = function(a, b) { - a = a.data[key]; - b = b.data[key]; - return a < b ? -1 : a > b ? 1 : 0; - }, - finalSorter = sorter, - tableBody = document.querySelector('.coverage-summary tbody'), - rowNodes = tableBody.querySelectorAll('tr'), - rows = [], - i; - - if (desc) { - finalSorter = function(a, b) { - return -1 * sorter(a, b); - }; - } - - for (i = 0; i < rowNodes.length; i += 1) { - rows.push(rowNodes[i]); - tableBody.removeChild(rowNodes[i]); - } - - rows.sort(finalSorter); - - for (i = 0; i < rows.length; i += 1) { - tableBody.appendChild(rows[i]); - } - } - // removes sort indicators for current column being sorted - function removeSortIndicators() { - var col = getNthColumn(currentSort.index), - cls = col.className; - - cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); - col.className = cls; - } - // adds sort indicators for current column being sorted - function addSortIndicators() { - getNthColumn(currentSort.index).className += currentSort.desc - ? ' sorted-desc' - : ' sorted'; - } - // adds event listeners for all sorter widgets - function enableUI() { - var i, - el, - ithSorter = function ithSorter(i) { - var col = cols[i]; - - return function() { - var desc = col.defaultDescSort; - - if (currentSort.index === i) { - desc = !currentSort.desc; - } - sortByIndex(i, desc); - removeSortIndicators(); - currentSort.index = i; - currentSort.desc = desc; - addSortIndicators(); - }; - }; - for (i = 0; i < cols.length; i += 1) { - if (cols[i].sortable) { - // add the click event handler on the th so users - // dont have to click on those tiny arrows - el = getNthColumn(i).querySelector('.sorter').parentElement; - if (el.addEventListener) { - el.addEventListener('click', ithSorter(i)); - } else { - el.attachEvent('onclick', ithSorter(i)); - } - } - } - } - // adds sorting functionality to the UI - return function() { - if (!getTable()) { - return; - } - cols = loadColumns(); - loadData(); - addSortIndicators(); - enableUI(); - }; -})(); - -window.addEventListener('load', addSorting); diff --git a/coverage/src/game/gameActions.js.html b/coverage/src/game/gameActions.js.html deleted file mode 100644 index 9bdfeaa..0000000 --- a/coverage/src/game/gameActions.js.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - Code coverage report for src/game/gameActions.js - - - - - - - -
-
-

- All files / src/game gameActions.js -

-
-
- 100% - Statements - 6/6 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 6/6 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28  -  -1x -1x -  -1x -  -  -  -  -  -  -1x -  -  -  -  -  -  -  -  -1x -  -  -  -1x -  - 
// Constants
- 
-export const STOP = 'STOP';
-export const CREATE = 'CREATE';
- 
-export const MissionStatuses = {
-  ACTIVE: 'ACTIVE',
-  SUCCESS: 'SUCCESS',
-  STOLEN: 'STOLEN',
-  CANCELLED: 'CANCELLED',
-};
- 
-export const GameStatuses = {
-  ONGOING: 'ONGOING',
-  STOPPED: 'STOPPED',
-  FINISHED: 'FINISHED',
-};
- 
-// Actions
- 
-export function stopGame() {
-  return { type: STOP };
-}
- 
-export function createGame(listUsers) {
-  return { type: CREATE, users: listUsers };
-}
- 
-
-
- - - - - - - - diff --git a/coverage/src/game/gameCreator.js.html b/coverage/src/game/gameCreator.js.html deleted file mode 100644 index 9a9a807..0000000 --- a/coverage/src/game/gameCreator.js.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - Code coverage report for src/game/gameCreator.js - - - - - - - -
-
-

- All files / src/game gameCreator.js -

-
-
- 100% - Statements - 10/10 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 7/7 -
-
- 100% - Lines - 8/8 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48  -  -  -  -  -  -1x -  -  -  -3x -  -  -  -3x -  -  -  -  -  -  -  -  -3x -  -  -  -  -  -  -  -3x -  -  -  -  -  -  -  -3x -3x -1x -  -  -  -  -  - 
import { shuffle } from '../utils/arrayUtils';
-import { uuidv4 as uuid } from '../utils/uuid';
- 
-import challenges from './challenges/challenges';
-import { MissionStatuses, GameStatuses } from './gameActions';
- 
-const shuffledChallenges = shuffle(challenges);
- 
-function getRandomChallenge() {
-  // TODO : Improve. This implementation really sucks
-  return shuffledChallenges.pop();
-}
- 
-function createMission() {
-  return {
-    id: uuid(),
-    challenge: getRandomChallenge(),
-    status: MissionStatuses.ACTIVE,
-    targetId: undefined, // TODO
-  };
-}
- 
-function createUser(userName) {
-  return {
-    id: uuid(),
-    name: userName,
-    email: undefined,
-  };
-}
- 
-function createPlayer(user) {
-  return {
-    id: uuid(),
-    user,
-    mission: createMission(),
-  };
-}
- 
-export function createGame(userNames) {
-  const users = userNames.map(name => createUser(name));
-  const players = users.map(user => createPlayer(user));
-  return {
-    id: uuid(),
-    status: GameStatuses.ONGOING,
-    players,
-  };
-}
- 
-
-
- - - - - - - - diff --git a/coverage/src/game/gameEngine.js.html b/coverage/src/game/gameEngine.js.html deleted file mode 100644 index eec78c6..0000000 --- a/coverage/src/game/gameEngine.js.html +++ /dev/null @@ -1,144 +0,0 @@ - - - - Code coverage report for src/game/gameEngine.js - - - - - - - -
-
-

- All files / src/game gameEngine.js -

-
-
- 100% - Statements - 9/9 -
-
- 50% - Branches - 1/2 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 8/8 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26  -  -  -  -1x -  -  -  -  -1x -  -  -  -1x -  -  -  -  -  -1x -2x -1x -1x -  -1x - 
import { combineReducers, createStore } from 'redux';
-import gamesReducers from './gamesReducer';
-import { stopGame, createGame } from './gameActions';
- 
-const initialState = {
-  user: undefined,
-  game: {},
-};
- 
-const app = combineReducers({
-  gamesReducers,
-});
- 
-const store = createStore(
-  app,
-  initialState,
-  window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), // dev tools
-);
- 
-console.log(store.getState());
-const unsubscribe = store.subscribe(() => console.log(store.getState()));
-store.dispatch(createGame(['Paul', 'Bob', 'Maurice']));
-store.dispatch(stopGame());
- 
-unsubscribe();
- 
-
-
- - - - - - - - diff --git a/coverage/src/game/gamesReducer.js.html b/coverage/src/game/gamesReducer.js.html deleted file mode 100644 index 37b65d9..0000000 --- a/coverage/src/game/gamesReducer.js.html +++ /dev/null @@ -1,114 +0,0 @@ - - - - Code coverage report for src/game/gamesReducer.js - - - - - - - -
-
-

- All files / src/game gamesReducer.js -

-
-
- 100% - Statements - 6/6 -
-
- 100% - Branches - 7/7 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 5/5 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16  -  -  -5x -5x -  -1x -  -  -  -1x -  -3x -  -  - 
import { STOP, GameStatuses, CREATE } from './gameActions';
-import { createGame } from './gameCreator';
- 
-export default function gamesReducer(state = {}, action) {
-  switch (action.type) {
-    case STOP:
-      return Object.assign({}, state, {
-        status: GameStatuses.STOPPED,
-      });
-    case CREATE:
-      return createGame(action.users);
-    default:
-      return state;
-  }
-}
- 
-
-
- - - - - - - - diff --git a/coverage/src/game/index.html b/coverage/src/game/index.html deleted file mode 100644 index 6cf48a6..0000000 --- a/coverage/src/game/index.html +++ /dev/null @@ -1,136 +0,0 @@ - - - - Code coverage report for src/game - - - - - - - -
-
-

- All files src/game -

-
-
- 100% - Statements - 31/31 -
-
- 88.89% - Branches - 8/9 -
-
- 100% - Functions - 11/11 -
-
- 100% - Lines - 27/27 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
gameActions.js
100%6/6100%0/0100%2/2100%6/6
gameCreator.js
100%10/10100%0/0100%7/7100%8/8
gameEngine.js
100%9/950%1/2100%1/1100%8/8
gamesReducer.js
100%6/6100%7/7100%1/1100%5/5
-
-
- - - - - - - - diff --git a/coverage/src/index.html b/coverage/src/index.html deleted file mode 100644 index 8608ed5..0000000 --- a/coverage/src/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - Code coverage report for src - - - - - - - -
-
-

- All files src -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 8/8 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
open-wc-logo.js
100%1/1100%0/0100%0/0100%1/1
under-cover.js
100%7/7100%0/0100%4/4100%7/7
-
-
- - - - - - - - diff --git a/coverage/src/open-wc-logo.js.html b/coverage/src/open-wc-logo.js.html deleted file mode 100644 index ed85e2b..0000000 --- a/coverage/src/open-wc-logo.js.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - Code coverage report for src/open-wc-logo.js - - - - - - - -
-
-

- All files / src open-wc-logo.js -

-
-
- 100% - Statements - 1/1 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 0/0 -
-
- 100% - Lines - 1/1 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  - 
import { html } from 'lit-html';
- 
-export const openWc = html`
-  <svg
-    width="244px"
-    height="244px"
-    viewBox="0 0 244 244"
-    version="1.1"
-    xmlns="http://www.w3.org/2000/svg"
-    xmlns:xlink="http://www.w3.org/1999/xlink"
-  >
-    <defs>
-      <linearGradient x1="50%" y1="0%" x2="50%" y2="100%" id="linearGradient-1">
-        <stop stop-color="#9B00FF" offset="0%"></stop>
-        <stop stop-color="#0077FF" offset="100%"></stop>
-      </linearGradient>
-    </defs>
-    <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
-      <path
-        d="M205.639259,176.936244 C207.430887,174.217233 209.093339,171.405629 210.617884,168.510161 M215.112174,158.724316 C216.385153,155.50304 217.495621,152.199852 218.433474,148.824851 M220.655293,138.874185 C221.231935,135.482212 221.637704,132.03207 221.863435,128.532919 M222,118.131039 C221.860539,114.466419 221.523806,110.85231 221.000113,107.299021 M218.885321,96.8583653 C218.001583,93.4468963 216.942225,90.1061026 215.717466,86.8461994 M211.549484,77.3039459 C209.957339,74.1238901 208.200597,71.0404957 206.290425,68.0649233 M200.180513,59.5598295 C181.848457,36.6639805 153.655709,22 122.036748,22 C66.7879774,22 22,66.771525 22,122 C22,177.228475 66.7879774,222 122.036748,222 C152.914668,222 180.52509,208.015313 198.875424,186.036326"
-        id="Shape"
-        stroke="url(#linearGradient-1)"
-        stroke-width="42.0804674"
-      ></path>
-    </g>
-  </svg>
-`;
- 
-
-
- - - - - - - - diff --git a/coverage/src/under-cover.js.html b/coverage/src/under-cover.js.html deleted file mode 100644 index 5c71045..0000000 --- a/coverage/src/under-cover.js.html +++ /dev/null @@ -1,318 +0,0 @@ - - - - Code coverage report for src/under-cover.js - - - - - - - -
-
-

- All files / src under-cover.js -

-
-
- 100% - Statements - 7/7 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 4/4 -
-
- 100% - Lines - 7/7 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26 -27 -28 -29 -30 -31 -32 -33 -34 -35 -36 -37 -38 -39 -40 -41 -42 -43 -44 -45 -46 -47 -48 -49 -50 -51 -52 -53 -54 -55 -56 -57 -58 -59 -60 -61 -62 -63 -64 -65 -66 -67 -68 -69 -70 -71 -72 -73 -74 -75 -76 -77 -78 -79 -80 -81 -82 -83 -84  -  -  -  -  -  -1x -  -  -  -  -4x -2x -2x -  -  -  -1x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -2x -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -  -1x - 
import { LitElement, html, css } from 'lit-element';
-import { openWc } from './open-wc-logo';
-import './game/gameEngine';
- 
-class UnderCover extends LitElement {
-  static get properties() {
-    return {
-      title: { type: String },
-    };
-  }
- 
-  constructor() {
-    super();
-    this.title = 'open-wc';
-  }
- 
-  static get styles() {
-    return [
-      css`
-        :host {
-          text-align: center;
-          min-height: 100vh;
-          display: flex;
-          flex-direction: column;
-          align-items: center;
-          justify-content: center;
-          font-size: calc(10px + 2vmin);
-          color: #1a2b42;
-        }
- 
-        header {
-          margin: auto;
-        }
- 
-        svg {
-          animation: app-logo-spin infinite 20s linear;
-        }
- 
-        a {
-          color: #217ff9;
-        }
- 
-        .app-footer {
-          color: #a8a8a8;
-          font-size: calc(10px + 0.5vmin);
-        }
- 
-        @keyframes app-logo-spin {
-          from {
-            transform: rotate(0deg);
-          }
-          to {
-            transform: rotate(360deg);
-          }
-        }
-      `,
-    ];
-  }
- 
-  render() {
-    return html`
-      <header class="app-header">
-        ${openWc}
-        <h1>${this.title}</h1>
-        <p>Edit <code>src/under-cover.js</code> and save to reload.</p>
-        <a
-          class="app-link"
-          href="https://open-wc.org/developing/#examples"
-          target="_blank"
-          rel="noopener noreferrer"
-        >
-          Code examples
-        </a>
-      </header>
-      <p class="app-footer">
-        🚽 Made with love by
-        <a target="_blank" rel="noopener noreferrer" href="https://github.com/open-wc">open-wc</a>.
-      </p>
-    `;
-  }
-}
- 
-customElements.define('under-cover', UnderCover);
- 
-
-
- - - - - - - - diff --git a/coverage/src/utils/arrayUtils.js.html b/coverage/src/utils/arrayUtils.js.html deleted file mode 100644 index d97182b..0000000 --- a/coverage/src/utils/arrayUtils.js.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - Code coverage report for src/utils/arrayUtils.js - - - - - - - -
-
-

- All files / src/utils arrayUtils.js -

-
-
- 100% - Statements - 8/8 -
-
- 100% - Branches - 0/0 -
-
- 100% - Functions - 1/1 -
-
- 100% - Lines - 8/8 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24  -  -1x -  -  -  -  -1x -  -61x -  -61x -  -  -61x -  -61x -  -61x -  -  -1x -  - 
// TODO : Not immutable. Fix warnings later
-export function shuffle(array) {
-  let currentIndex = array.length;
-  let temporaryValue;
-  let randomIndex;
- 
-  // While there remain elements to shuffle...
-  while (currentIndex !== 0) {
-    // Pick a remaining element...
-    randomIndex = Math.floor(Math.random() * currentIndex);
-    // eslint-disable-next-line no-const-assign
-    currentIndex -= 1;
- 
-    // And swap it with the current element.
-    temporaryValue = array[currentIndex];
-    // eslint-disable-next-line no-param-reassign
-    array[currentIndex] = array[randomIndex];
-    // eslint-disable-next-line no-param-reassign
-    array[randomIndex] = temporaryValue;
-  }
- 
-  return array;
-}
- 
-
-
- - - - - - - - diff --git a/coverage/src/utils/index.html b/coverage/src/utils/index.html deleted file mode 100644 index 7bc46a9..0000000 --- a/coverage/src/utils/index.html +++ /dev/null @@ -1,110 +0,0 @@ - - - - Code coverage report for src/utils - - - - - - - -
-
-

- All files src/utils -

-
-
- 100% - Statements - 12/12 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 3/3 -
-
- 100% - Lines - 12/12 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FileStatementsBranchesFunctionsLines
arrayUtils.js
100%8/8100%0/0100%1/1100%8/8
uuid.js
100%4/4100%2/2100%2/2100%4/4
-
-
- - - - - - - - diff --git a/coverage/src/utils/uuid.js.html b/coverage/src/utils/uuid.js.html deleted file mode 100644 index dadf39b..0000000 --- a/coverage/src/utils/uuid.js.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - Code coverage report for src/utils/uuid.js - - - - - - - -
-
-

- All files / src/utils uuid.js -

-
-
- 100% - Statements - 4/4 -
-
- 100% - Branches - 2/2 -
-
- 100% - Functions - 2/2 -
-
- 100% - Lines - 4/4 -
-
-

- Press n or j to go to the next uncovered block, b, p or k for the previous block. -

-
-
-

-
-
1 -2 -3 -4 -5 -6 -7 -8 -9  -  -10x -310x -310x -310x -  -  - 
/* eslint-disable no-bitwise */
-export function uuidv4() {
-  return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
-    const r = (Math.random() * 16) | 0;
-    const v = c === 'x' ? r : (r & 0x3) | 0x8;
-    return v.toString(16);
-  });
-}
- 
-
-
- - - - - - - - diff --git a/package.json b/package.json index 1c09bff..470a147 100644 --- a/package.json +++ b/package.json @@ -35,6 +35,7 @@ "rimraf": "^2.6.3", "rollup": "^1.6.0", "rollup-plugin-commonjs": "^10.0.0", + "rollup-plugin-cpy": "^1.1.0", "rollup-plugin-json": "^4.0.0", "rollup-plugin-node-resolve": "^5.0.2", "webpack-merge": "^4.1.5" @@ -49,9 +50,12 @@ "name": "under-cover", "license": "MIT", "dependencies": { + "@vaadin/vaadin-button": "^2.2.0", + "@vaadin/vaadin-text-field": "^2.4.6", "firebase": "^6.2.0", "lit-element": "^2.0.1", "lit-html": "^1.0.0", + "pwa-helpers": "^0.9.1", "redux": "^4.0.1", "uuid": "^3.3.2" } diff --git a/rollup.config.js b/rollup.config.js index acb83e5..4c278ac 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,10 +1,24 @@ import createDefaultConfig from '@open-wc/building-rollup/modern-and-legacy-config'; import json from 'rollup-plugin-json'; import commonjs from 'rollup-plugin-commonjs'; +import cpy from 'rollup-plugin-cpy'; const configs = createDefaultConfig({ input: './index.html' }); export default configs.map(config => ({ ...config, - plugins: [...config.plugins, commonjs(), json()], + plugins: [ + ...config.plugins, + commonjs(), + json(), + cpy({ + // copy over all files + files: ['src/assets/*'], + dest: 'dist', + options: { + // parents makes sure to preserve the original folder structure + parents: true, + }, + }), + ], })); diff --git a/src/assets/logo.svg b/src/assets/logo.svg new file mode 100644 index 0000000..70359b2 --- /dev/null +++ b/src/assets/logo.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/game/gameActions.js b/src/game/gameActions.js index fef7284..97144da 100644 --- a/src/game/gameActions.js +++ b/src/game/gameActions.js @@ -28,5 +28,5 @@ export function createGame(listUsers) { } export function validateMission(missionId) { - return { type: VALIDATE, id: missionId }; + return { type: VALIDATE, missionId }; } diff --git a/src/game/gameEngine.js b/src/game/gameEngine.js index e6345c5..037d9ae 100644 --- a/src/game/gameEngine.js +++ b/src/game/gameEngine.js @@ -9,6 +9,7 @@ function createMission() { challenge: getRandomChallenge(), status: MissionStatuses.ACTIVE, targetId: undefined, + targetName: undefined, }; } @@ -29,18 +30,19 @@ function createPlayer(user) { } export function createGame(userNames) { - if (!userNames || userNames.length === 0) return undefined; + if (!userNames || userNames.length < 2) return undefined; const users = userNames.map(name => createUser(name)); const players = users.map(user => createPlayer(user)); // TODO : Improve so we don't need mutability - const targetIds = players.map(p => p.id); - targetIds.push(targetIds.shift()); + const targetIdsAndUserNames = players.map(p => ({ id: p.id, name: p.user.name })); + targetIdsAndUserNames.push(targetIdsAndUserNames.shift()); for (let i = 0; i < players.length; i += 1) { - players[i].missions[0].targetId = targetIds[i]; + players[i].missions[0].targetId = targetIdsAndUserNames[i].id; + players[i].missions[0].targetName = targetIdsAndUserNames[i].name; } return { @@ -53,18 +55,20 @@ export function createGame(userNames) { export function validateMission(state, missionId) { // TODO: How do I make this immutable? This is the ugliest code I've written in a while - // TODO: Check if game is finished!? - const newState = Object.assign({}, state); let playerId; state.players.forEach(player => { - if (player.missions.some(m => m.id === missionId)) { + if (player.missions.some(m => m.id === missionId && m.status === MissionStatuses.ACTIVE)) { playerId = player.id; } }); - if (!playerId) return state; // No mission match + if (!playerId) { + console.log('No player found with this mission'); + // No mission match + return state; + } const missions = state.players.map(p => p.missions); const flattenedMissions = missions.reduce( diff --git a/src/game/gameRunner.js b/src/game/gameRunner.js deleted file mode 100644 index c7cec1e..0000000 --- a/src/game/gameRunner.js +++ /dev/null @@ -1,26 +0,0 @@ -import { combineReducers, createStore } from 'redux'; -import gamesReducers from './gamesReducer'; -import { stopGame, createGame, validateMission } from './gameActions'; - -const initialState = { - user: undefined, - game: {}, -}; - -const app = combineReducers({ - game: gamesReducers, -}); - -const store = createStore( - app, - initialState, - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), // dev tools -); - -console.log(store.getState()); -const unsubscribe = store.subscribe(() => console.log(store.getState())); -store.dispatch(createGame(['Paul', 'Bob', 'Maurice'])); -store.dispatch(validateMission('test')); -store.dispatch(stopGame()); - -unsubscribe(); diff --git a/src/game/gameStore.js b/src/game/gameStore.js new file mode 100644 index 0000000..1b984d3 --- /dev/null +++ b/src/game/gameStore.js @@ -0,0 +1,26 @@ +import { combineReducers, createStore } from 'redux'; +import gamesReducers from './gamesReducer'; +// import { stopGame, createGame, validateMission } from './gameActions'; + +const initialState = { + user: undefined, + game: {}, +}; + +const app = combineReducers({ + game: gamesReducers, +}); + +export const store = createStore( + app, + initialState, + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), // dev tools +); + +// console.log(store.getState()); +// const unsubscribe = store.subscribe(() => console.log(store.getState())); +// store.dispatch(createGame(['Paul', 'Bob', 'Maurice'])); +// store.dispatch(validateMission('test')); +// store.dispatch(stopGame()); + +// unsubscribe(); diff --git a/src/game/gamesReducer.js b/src/game/gamesReducer.js index 4292a91..3d77265 100644 --- a/src/game/gamesReducer.js +++ b/src/game/gamesReducer.js @@ -10,7 +10,7 @@ export default function gamesReducer(state = {}, action) { case CREATE: return createGame(action.users); case VALIDATE: - return validateMission(state, action.missionId); // TODO + return validateMission(state, action.missionId); default: return state; } diff --git a/src/game/playersMagic.js b/src/game/playersMagic.js new file mode 100644 index 0000000..1650f76 --- /dev/null +++ b/src/game/playersMagic.js @@ -0,0 +1,28 @@ +import { MissionStatuses } from './gameActions'; + +export function getScoreFromMissions(missions) { + return missions.reduce( + (total, mission) => total + (mission.status === MissionStatuses.SUCCESS ? 1 : 0), + 0, + ); +} + +export function getTargetsFromSuccessfulMissions(missions) { + return missions + .filter(mission => mission.status === MissionStatuses.SUCCESS) + .map(mission => mission.targetName); +} + +export function sortScoresAndkills(playersArray) { + const sortedPlayers = [...playersArray]; + sortedPlayers.sort((p1, p2) => + getScoreFromMissions(p1.missions) > getScoreFromMissions(p2.missions) ? -1 : 1, + ); + + return sortedPlayers.map(p => ({ + user: p.user, + id: p.id, + score: getScoreFromMissions(p.missions), + kills: getTargetsFromSuccessfulMissions(p.missions), + })); +} diff --git a/src/mission-card.js b/src/mission-card.js new file mode 100644 index 0000000..46c6e76 --- /dev/null +++ b/src/mission-card.js @@ -0,0 +1,43 @@ +import { LitElement, css, html } from 'lit-element'; +import { connect } from 'pwa-helpers'; +import { validateMission, MissionStatuses } from './game/gameActions'; +import '@vaadin/vaadin-button'; + +import { store } from './game/gameStore'; + +class MissionCard extends connect(store)(LitElement) { + static get properties() { + return { + mission: { + type: Object, + hasChanged() { + return true; + }, + }, + }; + } + + validateThisMission() { + store.dispatch(validateMission(this.mission.id)); + } + + render() { + return html` +
Description: ${this.mission.challenge.description}
+
Status ${this.mission.status}
+
Target ${this.mission.targetName}
+ + ${this.mission.status === MissionStatuses.ACTIVE + ? html` + Validate mission! + ` + : html``} + `; + } + + static get styles() { + return [css``]; + } +} + +customElements.define('mission-card', MissionCard); diff --git a/src/player-card.js b/src/player-card.js new file mode 100644 index 0000000..15ede93 --- /dev/null +++ b/src/player-card.js @@ -0,0 +1,67 @@ +import { LitElement, html, css } from 'lit-element'; +import { MissionStatuses } from './game/gameActions'; +import '@vaadin/vaadin-button'; + +import './mission-card'; + +class PlayerCard extends LitElement { + static get properties() { + return { + player: { + type: Object, + hasChanged() { + return true; + }, + }, + areMissionsVisible: { + type: Boolean, + }, + }; + } + + constructor() { + super(); + this.areMissionsVisible = false; + } + + toggleMissionsVisible() { + this.areMissionsVisible = !this.areMissionsVisible; + } + + render() { + return html` +

+ ${this.player.user.name} + ${this.player.missions.reduce( + (total, item) => total + (item.status === MissionStatuses.SUCCESS ? 1 : 0), + 0, + )} + Points +

+

${this.player.id}

+
+ ${this.areMissionsVisible + ? html` + Hide missions! + ${this.player.missions.map( + mission => + html` + + `, + )} + ` + : html` + Show missions! + `} +
+ `; + } + + static get styles() { + return [css``]; + } +} + +customElements.define('player-card', PlayerCard); diff --git a/src/under-cover-old.js b/src/under-cover-old.js new file mode 100644 index 0000000..e24d598 --- /dev/null +++ b/src/under-cover-old.js @@ -0,0 +1,82 @@ +import { LitElement, html, css } from 'lit-element'; +import { openWc } from './open-wc-logo'; + +class UnderCoverOld extends LitElement { + static get properties() { + return { + title: { type: String }, + }; + } + + constructor() { + super(); + this.title = 'open-wc'; + } + + static get styles() { + return [ + css` + :host { + text-align: center; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + font-size: calc(10px + 2vmin); + color: #1a2b42; + } + + header { + margin: auto; + } + + svg { + animation: app-logo-spin infinite 20s linear; + } + + a { + color: #217ff9; + } + + .app-footer { + color: #a8a8a8; + font-size: calc(10px + 0.5vmin); + } + + @keyframes app-logo-spin { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } + } + `, + ]; + } + + render() { + return html` +
+ ${openWc} +

${this.title}

+

Edit src/under-cover.js and save to reload.

+ + Code examples + +
+ + `; + } +} + +customElements.define('under-cover', UnderCoverOld); diff --git a/src/under-cover.js b/src/under-cover.js index c81b2e7..b3f5a7f 100644 --- a/src/under-cover.js +++ b/src/under-cover.js @@ -1,83 +1,253 @@ import { LitElement, html, css } from 'lit-element'; -import { openWc } from './open-wc-logo'; -import './game/gameRunner'; +import { connect } from 'pwa-helpers'; +import { store } from './game/gameStore'; +import { createGame, stopGame, GameStatuses } from './game/gameActions'; +import './player-card'; -class UnderCover extends LitElement { +import '@vaadin/vaadin-button'; +import '@vaadin/vaadin-text-field'; +import { sortScoresAndkills } from './game/playersMagic'; + +const ENTER_KEY = 13; + +class UnderCover extends connect(store)(LitElement) { static get properties() { return { - title: { type: String }, + players: { type: Array }, + isFriendTextFieldEmpty: { type: Boolean }, + game: { type: Object }, }; } constructor() { super(); - this.title = 'open-wc'; + this.players = []; + this.isFriendTextFieldEmpty = true; + this.game = undefined; + this.store = store; } - static get styles() { - return [ - css` - :host { - text-align: center; - min-height: 100vh; - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - font-size: calc(10px + 2vmin); - color: #1a2b42; - } + stateChanged(state) { + console.log('state changed in under cover'); + this.game = state.game; + } - header { - margin: auto; - } + startGame() { + store.dispatch(createGame(this.players)); + console.log('Game created!'); + } - svg { - animation: app-logo-spin infinite 20s linear; - } + // eslint-disable-next-line class-methods-use-this + stopTheGame() { + store.dispatch(stopGame()); + console.log('Game stopped!'); + } - a { - color: #217ff9; - } + addFriend() { + if (!this.isFriendTextFieldEmpty) { + const newFriend = this.shadowRoot.querySelector('#friend-text-field').value; + this.players = [...this.players, newFriend]; + this.shadowRoot.querySelector('#friend-text-field').value = ''; + } + } - .app-footer { - color: #a8a8a8; - font-size: calc(10px + 0.5vmin); - } + friendTextFieldUpdate(event) { + const friendField = this.shadowRoot.querySelector('#friend-text-field'); + this.isFriendTextFieldEmpty = friendField.value.length === 0; - @keyframes app-logo-spin { - from { - transform: rotate(0deg); - } - to { - transform: rotate(360deg); - } - } - `, - ]; + if (event.keyCode === ENTER_KEY) this.addFriend(); + } + + renderGame() { + if (!this.game) return this.renderCreateNewGame(); + + if (this.game.status === GameStatuses.ONGOING) return this.renderOngoingGame(); + if (this.game.status === GameStatuses.FINISHED) return this.renderFinishedGame(); + if (this.game.status === GameStatuses.STOPPED) return this.renderStoppedGame(); + + return this.renderCreateNewGame(); + } + + renderStoppedOrFinishedGame(finishedOrStopped) { + const finalPlayers = sortScoresAndkills(this.game.players); + return html` +
+

The game is ${finishedOrStopped}!

+

Our players listed by order of points :

+
    + ${finalPlayers.map( + p => + html` +
  • + ${p.user.name} with ${p.score} points. ${this.printKills(p)} +
  • + `, + )} +
+
+ `; + } + + renderFinishedGame() { + return this.renderStoppedOrFinishedGame('finished'); + } + + renderStoppedGame() { + return this.renderStoppedOrFinishedGame('stopped'); + } + + renderCreateNewGame() { + return html` +
+
+

UnderCover

+

Get a challenge, kill your friends, win the game . . . during dinner!

+
+
+

Add players

+ + + + +
+
+

Current players

+ ${this.players.length === 0 + ? html` +

No players added yet!

+ Create Game! + ` + : html` +
    + ${this.players.map( + player => + html` +
  • ${player}
  • + `, + )} +
+ Create Game! + `} +
+
+ `; + } + + renderOngoingGame() { + return html` +
+

Game ongoing!

+

${this.game}

+ ${this.game.players.map( + player => + html` + + `, + )} + Stop game early! +
+ `; + } + + // eslint-disable-next-line class-methods-use-this + printKills(player) { + // TODO : Improve to be more readable + if (player.score > 0) + return html` + ${player.user.name} player killed : + ${player.kills.map( + k => + html` + ${k} + `, + )} + `; + return html``; } render() { return html`
- ${openWc} -

${this.title}

-

Edit src/under-cover.js and save to reload.

- - Code examples - + +

UnderCover

- +
+ ${this.renderGame()} +
+
+ Copyright 2019 - Axel Catoire and Julien Lengrand-Lambert - All rights reserved +
`; } + + static get styles() { + return [ + css` + html { + font-size: 100%; + } + + :host { + text-align: center; + font-family: 'Josefin Sans', sans-serif; + font-display: swap; + display: grid; + grid-template-columns: 100vw; + grid-template-rows: 10vh 80vh 10vh; + /* min-height: 100vh; */ + } + + .app-logo { + display: inline-block; + vertical-align: middle; + float: left; + max-height: 100%; + margin-right: 10px; + margin-left: 5px; + padding: 2px; + } + + .app-title { + vertical-align: middle; + font-size: 1.3rem; + height: 100%; + margin: 0; + } + + header { + background-color: #1d3557; + color: #f1faee; + } + + header h1 { + display: flex; + align-items: center; + } + + main { + background-color: #f1faee; + overflow: auto; + } + + footer { + background-color: #1d3557; + color: #f1faee; + display: flex; + } + + footer span { + margin: auto; + font-size: 0.7rem; + } + `, + ]; + } } customElements.define('under-cover', UnderCover); diff --git a/test/game/gameEngine.test.js b/test/game/gameEngine.test.js index 52bf5ca..e1a995d 100644 --- a/test/game/gameEngine.test.js +++ b/test/game/gameEngine.test.js @@ -35,13 +35,18 @@ describe('gameCreator createGame', () => { expect(game).to.equal(undefined); }); + it('should return undefined when there is only 1 players', () => { + const game = createGame(['Bob']); + expect(game).to.equal(undefined); + }); + it('should return undefined when there is no input', () => { const game = createGame(); expect(game).to.equal(undefined); }); it('should return an ONGOING game with an id', () => { - const game = createGame(['Bob']); + const game = createGame(['Bob', 'Gérald']); expect(game.status).to.equal(GameStatuses.ONGOING); expect(game.id).to.not.be.undefined; }); @@ -202,4 +207,120 @@ describe('gameEngine validateMission', () => { theExpectedEndState, ); }); + + it('should validate a mission for a valid mission id', () => { + const theExpectedMiddleState = { + id: 'd9de47a8-158f-455e-8f02-21ac5dd5e0c3', + players: [ + { + id: '8717b0d5-8a1b-436a-947b-5efe94603e67', + user: undefined, + + missions: [ + { + challenge: undefined, + id: '3d656862-8bce-41ec-ad74-2b637c12ff26', + status: 'SUCCESS', + targetId: 'c594036a-511e-4977-97c2-f4e13952bbb7', + }, + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'ACTIVE', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + ], + }, + { + id: 'c594036a-511e-4977-97c2-f4e13952bbb7', + user: undefined, + missions: [ + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'STOLEN', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + ], + }, + { + id: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + user: undefined, + missions: [ + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'ACTIVE', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ], + }, + ], + status: 'ONGOING', + }; + + expect( + validateMission(theStartingState3Players, '3d656862-8bce-41ec-ad74-2b637c12ff26'), + ).to.deep.equal(theExpectedMiddleState); + + const theExpectedEndState = { + id: 'd9de47a8-158f-455e-8f02-21ac5dd5e0c3', + players: [ + { + id: '8717b0d5-8a1b-436a-947b-5efe94603e67', + user: undefined, + + missions: [ + { + challenge: undefined, + id: '3d656862-8bce-41ec-ad74-2b637c12ff26', + status: 'SUCCESS', + targetId: 'c594036a-511e-4977-97c2-f4e13952bbb7', + }, + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'SUCCESS', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'ACTIVE', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ], + }, + { + id: 'c594036a-511e-4977-97c2-f4e13952bbb7', + user: undefined, + missions: [ + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'STOLEN', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + ], + }, + { + id: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + user: undefined, + missions: [ + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'STOLEN', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ], + }, + ], + status: 'FINISHED', + }; + + expect( + validateMission(theExpectedMiddleState, 'b1c2a17f-3834-45ea-b3dd-30633c62b197'), + ).to.deep.equal(theExpectedEndState); + }); }); diff --git a/test/playersMagic.test.js b/test/playersMagic.test.js new file mode 100644 index 0000000..739a8da --- /dev/null +++ b/test/playersMagic.test.js @@ -0,0 +1,165 @@ +import { expect } from '@open-wc/testing'; +import { + sortScoresAndkills, + getScoreFromMissions, + getTargetsFromSuccessfulMissions, +} from '../src/game/playersMagic'; + +describe('sortScoresAndkills', () => { + const finishedGame = { + id: 'd9de47a8-158f-455e-8f02-21ac5dd5e0c3', + players: [ + { + id: 'pascalsId', + user: { name: 'Pascal' }, + missions: [ + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'STOLEN', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ], + }, + { + id: 'GéraldsId', + user: { + name: 'Gérald', + }, + + missions: [ + { + challenge: undefined, + id: '3d656862-8bce-41ec-ad74-2b637c12ff26', + status: 'SUCCESS', + targetId: 'c594036a-511e-4977-97c2-f4e13952bbb7', + targetName: 'Bob', + }, + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'SUCCESS', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + targetName: 'Pascal', + }, + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'ACTIVE', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ], + }, + { + id: 'BobsId', + user: { + name: 'Bob', + }, + missions: [ + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'STOLEN', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + ], + }, + ], + status: 'FINISHED', + }; + + it('should return a list of players sorted by score', () => { + const result = sortScoresAndkills(finishedGame.players); + + expect(result).to.have.lengthOf(finishedGame.players.length); + expect(result[0].id).to.equal('GéraldsId'); + expect(result[0].user.name).to.equal('Gérald'); + expect(result[0].score).to.equal(2); + expect(result[0].kills).to.deep.equal(['Bob', 'Pascal']); + + expect(result[1].score).to.equal(0); + expect(result[2].score).to.equal(0); + expect(result[1].kills).to.deep.equal([]); + expect(result[2].kills).to.deep.equal([]); + }); +}); + +describe('getScoreFromMissions', () => { + it('should return the number of successful missions', () => { + const zeroMissions = [ + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'STOLEN', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + ]; + + expect(getScoreFromMissions(zeroMissions)).to.equal(0); + + const twoMissions = [ + { + challenge: undefined, + id: '3d656862-8bce-41ec-ad74-2b637c12ff26', + status: 'SUCCESS', + targetId: 'c594036a-511e-4977-97c2-f4e13952bbb7', + targetName: 'Bob', + }, + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'SUCCESS', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + targetName: 'Pascal', + }, + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'ACTIVE', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ]; + + expect(getScoreFromMissions(twoMissions)).to.equal(2); + }); +}); + +describe('getTargetsFromSuccessfulMissions', () => { + it('should return the targets for successful missions', () => { + const zeroMissions = [ + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'STOLEN', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + }, + ]; + + expect(getTargetsFromSuccessfulMissions(zeroMissions)).to.deep.equal([]); + + const twoMissions = [ + { + challenge: undefined, + id: '3d656862-8bce-41ec-ad74-2b637c12ff26', + status: 'SUCCESS', + targetId: 'c594036a-511e-4977-97c2-f4e13952bbb7', + targetName: 'Gérald', + }, + { + challenge: undefined, + id: 'b1c2a17f-3834-45ea-b3dd-30633c62b197', + status: 'SUCCESS', + targetId: '7d91288e-4808-48b6-b1ec-49ef3addb24f', + targetName: 'Bob', + }, + { + id: '865faaf3-eaae-41d0-96d3-7440f1cc604e', + status: 'ACTIVE', + challenge: undefined, + targetId: '8717b0d5-8a1b-436a-947b-5efe94603e67', + }, + ]; + + expect(getTargetsFromSuccessfulMissions(twoMissions)).to.deep.equal(['Gérald', 'Bob']); + }); +}); diff --git a/test/under-cover.test.js b/test/under-cover.test.js index 9b2a04e..aeacf13 100644 --- a/test/under-cover.test.js +++ b/test/under-cover.test.js @@ -1,17 +1,17 @@ -import { html, fixture, expect } from '@open-wc/testing'; +// import { html, fixture, expect } from '@open-wc/testing'; -import '../src/under-cover'; +// import '../src/under-cover'; -describe('', () => { - it('has a default property header', async () => { - const el = await fixture(''); - expect(el.title).to.equal('open-wc'); - }); +// describe('', () => { +// it('has a default property header', async () => { +// const el = await fixture(''); +// expect(el.title).to.equal('open-wc'); +// }); - it('allows property header to be overwritten', async () => { - const el = await fixture(html` - - `); - expect(el.title).to.equal('different'); - }); -}); +// it('allows property header to be overwritten', async () => { +// const el = await fixture(html` +// +// `); +// expect(el.title).to.equal('different'); +// }); +// }); diff --git a/yarn.lock b/yarn.lock index 3260902..75a93af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -961,6 +961,19 @@ mkdirp "^0.5.1" rimraf "^2.5.2" +"@mrmlnc/readdir-enhanced@^2.2.1": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde" + integrity sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g== + dependencies: + call-me-maybe "^1.0.1" + glob-to-regexp "^0.3.0" + +"@nodelib/fs.stat@^1.1.2": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.3.tgz#2b5a3ab3f918cca48a8c754c08168e3f03eba61b" + integrity sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw== + "@open-wc/building-rollup@^0.3.0": version "0.3.3" resolved "https://registry.yarnpkg.com/@open-wc/building-rollup/-/building-rollup-0.3.3.tgz#ca70acbabd3cfbe58a1f324ce93f76b43ef57209" @@ -1110,6 +1123,44 @@ "@types/mocha" "^5.0.0" mocha "^5.0.0" +"@polymer/iron-flex-layout@^3.0.0-pre.26": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@polymer/iron-flex-layout/-/iron-flex-layout-3.0.1.tgz#36f9e1a8eb792d279b2bc75d362628721ad37f0c" + integrity sha512-7gB869czArF+HZcPTVSgvA7tXYFze9EKckvM95NB7SqYF+NnsQyhoXgKnpFwGyo95lUjUW9TFDLUwDXnCYFtkw== + dependencies: + "@polymer/polymer" "^3.0.0" + +"@polymer/iron-icon@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@polymer/iron-icon/-/iron-icon-3.0.1.tgz#93211c39d8825fe4965a68419566036c1df291eb" + integrity sha512-QLPwirk+UPZNaLnMew9VludXA4CWUCenRewgEcGYwdzVgDPCDbXxy6vRJjmweZobMQv/oVLppT2JZtJFnPxX6g== + dependencies: + "@polymer/iron-flex-layout" "^3.0.0-pre.26" + "@polymer/iron-meta" "^3.0.0-pre.26" + "@polymer/polymer" "^3.0.0" + +"@polymer/iron-iconset-svg@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@polymer/iron-iconset-svg/-/iron-iconset-svg-3.0.1.tgz#568d6e7dbc120299dae63be3600aeba0d30ddbea" + integrity sha512-XNwURbNHRw6u2fJe05O5fMYye6GSgDlDqCO+q6K1zAnKIrpgZwf2vTkBd5uCcZwsN0FyCB3mvNZx4jkh85dRDw== + dependencies: + "@polymer/iron-meta" "^3.0.0-pre.26" + "@polymer/polymer" "^3.0.0" + +"@polymer/iron-meta@^3.0.0-pre.26": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@polymer/iron-meta/-/iron-meta-3.0.1.tgz#7f140628d127b0a284f882f1bb323a261bc125f5" + integrity sha512-pWguPugiLYmWFV9UWxLWzZ6gm4wBwQdDy4VULKwdHCqR7OP7u98h+XDdGZsSlDPv6qoryV/e3tGHlTIT0mbzJA== + dependencies: + "@polymer/polymer" "^3.0.0" + +"@polymer/polymer@^3.0.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@polymer/polymer/-/polymer-3.2.0.tgz#b41fddec4ecac63b12936b93726678d23add7afd" + integrity sha512-L6uV1oM6T6xbwbVx6t3biG5T2VSSB03LxnIrUd9M2pr6RkHVPFHJ37pC5MUwBAEhkGFJif7eks7fdMMSGZTeEQ== + dependencies: + "@webcomponents/shadycss" "^1.8.0" + "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" @@ -1187,6 +1238,20 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/events@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + +"@types/glob@^7.1.1": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + "@types/html-minifier@^3.5.2": version "3.5.3" resolved "https://registry.yarnpkg.com/@types/html-minifier/-/html-minifier-3.5.3.tgz#5276845138db2cebc54c789e0aaf87621a21e84f" @@ -1201,6 +1266,11 @@ resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.0.tgz#719551d2352d301ac8b81db732acb6bdc28dbdef" integrity sha512-1w52Nyx4Gq47uuu0EVcsHBxZFJgurQ+rTKS3qMHxR1GY2T8c2AJYd6vZoZ9q1rupaDjU0yT+Jc2XTyXkjeMA+Q== +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + "@types/mocha@^5.0.0": version "5.2.7" resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-5.2.7.tgz#315d570ccb56c53452ff8638738df60726d5b6ea" @@ -1240,6 +1310,81 @@ dependencies: source-map "^0.6.1" +"@vaadin/vaadin-button@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-button/-/vaadin-button-2.2.0.tgz#3d9ba514caf57b509de6e9d27e7e38bd2d9919d1" + integrity sha512-e4yxTsAB0r5pVvsBpL3tZtfFpNbmJPwr4C+cZjkzlKGmwR51IPUBv1Wp1/+AfDyZDQ8ucBYP+EFDhr2D4fCLFA== + dependencies: + "@polymer/polymer" "^3.0.0" + "@vaadin/vaadin-control-state-mixin" "^2.1.1" + "@vaadin/vaadin-element-mixin" "^2.0.0" + "@vaadin/vaadin-lumo-styles" "^1.3.3" + "@vaadin/vaadin-material-styles" "^1.2.0" + "@vaadin/vaadin-themable-mixin" "^1.2.1" + +"@vaadin/vaadin-control-state-mixin@^2.1.1": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-control-state-mixin/-/vaadin-control-state-mixin-2.1.3.tgz#509998350611651acfa8db1506fc12d925861b48" + integrity sha512-EtLfMN9i/gwToAEuW6E1OA2Q2i/4a+Il6tKkqE/0i7bgu3Xr1IITMcagQn9QSsp1Xkpr/nLtWWKRq7yZZkbHVg== + dependencies: + "@polymer/polymer" "^3.0.0" + +"@vaadin/vaadin-development-mode-detector@^2.0.0": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-development-mode-detector/-/vaadin-development-mode-detector-2.0.2.tgz#67ba4d6e95d8907c8dc699a80049a2995ecebaef" + integrity sha512-B6P8sppzubOkcoO0uKgybEWQAsBkRPCL1CnDLgdelGZrRqmUBwLi9dYIG1AJY5i9i+hqa8Sn/O0B/Be0T39k7w== + +"@vaadin/vaadin-element-mixin@^2.0.0": + version "2.1.3" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-element-mixin/-/vaadin-element-mixin-2.1.3.tgz#3d7e835501afecba1c5b4400ef35e3d9459b2693" + integrity sha512-tCEdrS5JMIl9ZsyjnV28XI2AFLC35RUWRF6XPrvm/MpKAxWLk1MlYrkwR26avOuSqvNwCBO56NIDN2k1yYC4eA== + dependencies: + "@polymer/polymer" "^3.0.0" + "@vaadin/vaadin-development-mode-detector" "^2.0.0" + "@vaadin/vaadin-usage-statistics" "^2.0.2" + +"@vaadin/vaadin-lumo-styles@^1.2.0", "@vaadin/vaadin-lumo-styles@^1.3.3": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-lumo-styles/-/vaadin-lumo-styles-1.5.0.tgz#8dec3c4aefea347431c8d184caf72406ea20c564" + integrity sha512-9e9n7rH5IlzsAhRWvBt6C8roXbdNILKyKMJPwbN9I6zsPwzFhG5y2y5IY59Q5Ijj8aXvHuLV+Icjogc+2KU5fg== + dependencies: + "@polymer/iron-icon" "^3.0.0" + "@polymer/iron-iconset-svg" "^3.0.0" + "@polymer/polymer" "^3.0.0" + +"@vaadin/vaadin-material-styles@^1.2.0": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-material-styles/-/vaadin-material-styles-1.2.3.tgz#b769a39a89696f76b87bea607b0168edf7b374b8" + integrity sha512-hWtnfNPANPU3UJmyIXuu2pH8R60LtnUzTZ0o2lupvxyc5IR0qFZMnB1m0xQBdBTje44xxCRaHeJATrwpzsOeMQ== + dependencies: + "@polymer/polymer" "^3.0.0" + +"@vaadin/vaadin-text-field@^2.4.6": + version "2.4.6" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-text-field/-/vaadin-text-field-2.4.6.tgz#c1c43a3d82fb046c989ab73326cecd25428553a8" + integrity sha512-G766ykyvgSClGYoqPMBKOkK7vdBcBF2CUEzeO+JRRisAlWf0FLgNy7Xns5WSCIOk9In47UC2WLxWbev2W7iv2Q== + dependencies: + "@polymer/polymer" "^3.0.0" + "@vaadin/vaadin-control-state-mixin" "^2.1.1" + "@vaadin/vaadin-element-mixin" "^2.0.0" + "@vaadin/vaadin-lumo-styles" "^1.2.0" + "@vaadin/vaadin-material-styles" "^1.2.0" + "@vaadin/vaadin-themable-mixin" "^1.2.1" + +"@vaadin/vaadin-themable-mixin@^1.2.1": + version "1.4.4" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-themable-mixin/-/vaadin-themable-mixin-1.4.4.tgz#ebaf1e3726e528adac7db80367bdb9eca58e9008" + integrity sha512-S/zN0DvSQ3cy1PdH0Dfa2yQirIFQKWCC3o0YdBzrKVCGvi5QW8+IqBTDFKnIaOfWjYoHsw2eunWcg9pu2jlI1Q== + dependencies: + "@polymer/polymer" "^3.0.0" + +"@vaadin/vaadin-usage-statistics@^2.0.2": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@vaadin/vaadin-usage-statistics/-/vaadin-usage-statistics-2.0.4.tgz#8938eddb9cf2aa1bec10826e8e426af2876f47b2" + integrity sha512-W954k2x0cy7YSNgvm6g3DukjPUCf6z2V0BsMMPz2masVP34MCi8p9JUvf8FsxABx34U6TCMouxCnNXQaFxX8Og== + dependencies: + "@vaadin/vaadin-development-mode-detector" "^2.0.0" + "@webassemblyjs/ast@1.8.5": version "1.8.5" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.8.5.tgz#51b1c5fe6576a34953bf4b253df9f0d490d9e359" @@ -1386,6 +1531,11 @@ "@webassemblyjs/wast-parser" "1.8.5" "@xtuc/long" "4.2.2" +"@webcomponents/shadycss@^1.8.0": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@webcomponents/shadycss/-/shadycss-1.9.1.tgz#d769fbadfa504f11b84caeef26701f89070ec49a" + integrity sha512-IaZOnWOKXHghqk/WfPNDRIgDBi3RsVPY2IFAw6tYiL9UBGvQRy5R6uC+Fk7qTZsReTJ0xh5MTT8yAcb3MUR4mQ== + "@webcomponents/webcomponentsjs@^2.2.0": version "2.2.10" resolved "https://registry.yarnpkg.com/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.2.10.tgz#6f6bee0277833ae98d7e5b46f1e0fdb48cd5ff44" @@ -1609,7 +1759,7 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" -array-union@^1.0.1: +array-union@^1.0.1, array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= @@ -2159,6 +2309,11 @@ cache-base@^1.0.1: union-value "^1.0.0" unset-value "^1.0.0" +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= + caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -2248,7 +2403,7 @@ chalk@^1.0.0, chalk@^1.1.3: strip-ansi "^3.0.0" supports-color "^2.0.0" -chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -2679,6 +2834,27 @@ cosmiconfig@^5.0.7, cosmiconfig@^5.2.0: js-yaml "^3.13.1" parse-json "^4.0.0" +cp-file@^6.1.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/cp-file/-/cp-file-6.2.0.tgz#40d5ea4a1def2a9acdd07ba5c0b0246ef73dc10d" + integrity sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA== + dependencies: + graceful-fs "^4.1.2" + make-dir "^2.0.0" + nested-error-stacks "^2.0.0" + pify "^4.0.1" + safe-buffer "^5.0.1" + +cpy@^7.0.1: + version "7.3.0" + resolved "https://registry.yarnpkg.com/cpy/-/cpy-7.3.0.tgz#62f2847986b4ff9d029710568a49e9a9ab5a210e" + integrity sha512-auvDu6h/J+cO1uqV40ymL/VoPM0+qPpNGaNttTzkYVXO/+GeynuyAK/MwFcWgU/P82ezcZw7RaN34CIIWajKLA== + dependencies: + arrify "^1.0.1" + cp-file "^6.1.0" + globby "^9.2.0" + nested-error-stacks "^2.1.0" + create-ecdh@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.3.tgz#c9111b6f33045c4697f144787f9254cdc77c45ff" @@ -2738,11 +2914,6 @@ crypto-browserify@^3.11.0: randombytes "^2.0.0" randomfill "^1.0.3" -cuid@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/cuid/-/cuid-2.1.6.tgz#dc3a20b5a7497d36d32c0bf8a2997524c9c796c4" - integrity sha512-ZFp7PS6cSYMJNch9fc3tyHdE4T8TDo3Y5qAxb0KSA9mpiYDo7z9ql1CznFuuzxea9STVIDy0tJWm2lYiX2ZU1Q== - currently-unhandled@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/currently-unhandled/-/currently-unhandled-0.4.1.tgz#988df33feab191ef799a61369dd76c17adf957ea" @@ -2950,6 +3121,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-2.2.2.tgz#fa09f0694153c8918b18ba0deafae94769fc50c4" + integrity sha512-f9LBi5QWzIW3I6e//uxZoLBlUt9kcp66qo0sSCxL6YZKc75R1c4MFCoe/LaZiBGmgujvQdxc5Bn3QhfyvK5Hsw== + dependencies: + path-type "^3.0.0" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -3573,6 +3751,18 @@ fast-deep-equal@^2.0.1: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= +fast-glob@^2.2.6: + version "2.2.7" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-2.2.7.tgz#6953857c3afa475fff92ee6015d52da70a4cd39d" + integrity sha512-g1KuQwHOZAmOZMuBtHdxDtju+T2RT8jgCC9aANsbpdiDDTSnjgfuVsIBNKbUeJI3oKMRExcfNDtJl4OhbffMsw== + dependencies: + "@mrmlnc/readdir-enhanced" "^2.2.1" + "@nodelib/fs.stat" "^1.1.2" + glob-parent "^3.1.0" + is-glob "^4.0.0" + merge2 "^1.2.3" + micromatch "^3.1.10" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -3929,6 +4119,11 @@ glob-parent@^5.0.0: dependencies: is-glob "^4.0.1" +glob-to-regexp@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.3.0.tgz#8c5a1494d2066c570cc3bfe4496175acc4d502ab" + integrity sha1-jFoUlNIGbFcMw7/kSWF1rMTVAqs= + glob@7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -3981,6 +4176,20 @@ globby@^6.1.0: pify "^2.0.0" pinkie-promise "^2.0.0" +globby@^9.2.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" + integrity sha512-ollPHROa5mcxDEkwg6bPt3QbEf4pDQSNtd6JPL1YvOvAo/7/0VAm9TccUeoTmarjPw4pfUthSCqcyfNB1I3ZSg== + dependencies: + "@types/glob" "^7.1.1" + array-union "^1.0.2" + dir-glob "^2.2.2" + fast-glob "^2.2.6" + glob "^7.1.3" + ignore "^4.0.3" + pify "^4.0.1" + slash "^2.0.0" + graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.3, graceful-fs@^4.1.6: version "4.1.15" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.15.tgz#ffb703e1066e8a0eeaa4c8b80ba9253eeefbfb00" @@ -4260,7 +4469,7 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^4.0.6: +ignore@^4.0.3, ignore@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== @@ -5232,6 +5441,11 @@ lodash.clone@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.clone/-/lodash.clone-4.5.0.tgz#195870450f5a13192478df4bc3d23d2dea1907b6" integrity sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y= +lodash.isobject@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-3.0.2.tgz#3c8fb8d5b5bf4bf90ae06e14f2a530a4ed935e1d" + integrity sha1-PI+41bW/S/kK4G4U8qUwpO2TXh0= + lodash.padend@^4.6.1: version "4.6.1" resolved "https://registry.yarnpkg.com/lodash.padend/-/lodash.padend-4.6.1.tgz#53ccba047d06e158d311f45da625f4e49e6f166e" @@ -5492,6 +5706,11 @@ merge-stream@^1.0.1: dependencies: readable-stream "^2.0.1" +merge2@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.2.3.tgz#7ee99dbd69bb6481689253f018488a1b902b0ed5" + integrity sha512-gdUU1Fwj5ep4kplwcmftruWofEFt6lfpkkr3h860CXbAB9c3hGb55EOL2ali0Td5oebvW0E1+3Sr+Ur7XfKpRA== + methods@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" @@ -5743,6 +5962,11 @@ neo-async@^2.5.0, neo-async@^2.6.0: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.1.tgz#ac27ada66167fa8849a6addd837f6b189ad2081c" integrity sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw== +nested-error-stacks@^2.0.0, nested-error-stacks@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz#0fbdcf3e13fe4994781280524f8b96b0cdff9c61" + integrity sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug== + nice-try@^1.0.4: version "1.0.5" resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" @@ -6544,6 +6768,11 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +pwa-helpers@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/pwa-helpers/-/pwa-helpers-0.9.1.tgz#9ea22fa1996ab97df73b276cae962621c3fd2532" + integrity sha512-4sP/C9sSxQ3w80AATmvCEI3R+MHzCwr2RSZEbLyMkeJgV3cRk7ySZRUrQnBDSA7A0/z6dkYtjuXlkhN1ZFw3iA== + q@^1.5.1, q@~1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7" @@ -6998,6 +7227,16 @@ rollup-plugin-commonjs@^10.0.0: resolve "^1.10.1" rollup-pluginutils "^2.7.0" +rollup-plugin-cpy@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-cpy/-/rollup-plugin-cpy-1.1.0.tgz#4518d5e662880218a1a13e03b8565773642898d4" + integrity sha512-QfRVnEvf06kYDVwZUYyDInQ8Xjd2Y8EIsazuMsUXskV4g7VKYz2kojJaqs0Ew5qfpyL3J9MjONE5mGfu93q5sw== + dependencies: + chalk "^2.3.2" + cpy "^7.0.1" + lodash.isobject "^3.0.2" + mkdirp "^0.5.1" + rollup-plugin-json@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/rollup-plugin-json/-/rollup-plugin-json-4.0.0.tgz#a18da0a4b30bf5ca1ee76ddb1422afbb84ae2b9e"