monocart-reporter 2.9.13 → 2.9.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,7 +14,13 @@ ${d}`),i?r.reset(d):d}function Cu(s,e,t,i={}){if(!hn){hn=!0;let n="Passing lineN
14
14
  `)}displayWidth(e){return Io(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t==="[command]"?this.styleSubcommandText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleCommandText(t)).join(" ")}styleCommandDescription(e){return this.styleDescriptionText(e)}styleOptionDescription(e){return this.styleDescriptionText(e)}styleSubcommandDescription(e){return this.styleDescriptionText(e)}styleArgumentDescription(e){return this.styleDescriptionText(e)}styleDescriptionText(e){return e}styleOptionTerm(e){return this.styleOptionText(e)}styleSubcommandTerm(e){return e.split(" ").map(t=>t==="[options]"?this.styleOptionText(t):t[0]==="["||t[0]==="<"?this.styleArgumentText(t):this.styleSubcommandText(t)).join(" ")}styleArgumentTerm(e){return this.styleArgumentText(e)}styleOptionText(e){return e}styleArgumentText(e){return e}styleSubcommandText(e){return e}styleCommandText(e){return e}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,t,i,r){let o=" ".repeat(2);if(!i)return o+e;let h=e.padEnd(t+e.length-r.displayWidth(e)),a=2,l=(this.helpWidth??80)-t-a-2,c;return l<this.minWidthToWrap||r.preformatted(i)?c=i:c=r.boxWrap(i,l).replace(/\n/g,`
15
15
  `+" ".repeat(t+a)),o+h+" ".repeat(a)+c.replace(/\n/g,`
16
16
  ${o}`)}boxWrap(e,t){if(t<this.minWidthToWrap)return e;let i=e.split(/\r\n|\n/),r=/[\s]*[^\s]+/g,n=[];return i.forEach(o=>{let h=o.match(r);if(h===null){n.push("");return}let a=[h.shift()],u=this.displayWidth(a[0]);h.forEach(l=>{let c=this.displayWidth(l);if(u+c<=t){a.push(l),u+=c;return}n.push(a.join(""));let d=l.trimStart();a=[d],u=this.displayWidth(d)}),n.push(a.join(""))}),n.join(`
17
- `)}};function Io(s){let e=/\x1b\[\d*(;\d*)*m/g;return s.replace(e,"")}ks.Help=Rs;ks.stripColor=Io});var Bs=O(Us=>{var{InvalidArgumentError:oc}=It(),Ps=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=ac(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new oc(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Do(this.name().replace(/^no-/,"")):Do(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ms=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){let i=t.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,n=r!==void 0?r:!1;return t.negate===(n===e)}};function Do(s){return s.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ac(s){let e,t,i=/^-[^-]$/,r=/^--[^-]/,n=s.split(/[ |,]+/).concat("guard");if(i.test(n[0])&&(e=n.shift()),r.test(n[0])&&(t=n.shift()),/^-[^-][^-]/.test(n[0]))throw new Error(`invalid Option flags, short option is dash and single character: '${s}'`);if(e&&i.test(n[0]))throw new Error(`invalid Option flags, more than one short flag: '${s}'`);if(t&&r.test(n[0]))throw new Error(`invalid Option flags, more than one long flag: '${s}'`);if(!(e||t)||n[0].startsWith("-"))throw new Error(`invalid Option flags: '${s}'`);return{shortFlag:e,longFlag:t}}Us.Option=Ps;Us.DualOptions=Ms});var Ro=O(No=>{function hc(s,e){if(Math.abs(s.length-e.length)>3)return Math.max(s.length,e.length);let t=[];for(let i=0;i<=s.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=s.length;r++){let n=1;s[r-1]===e[i-1]?n=0:n=1,t[r][i]=Math.min(t[r-1][i]+1,t[r][i-1]+1,t[r-1][i-1]+n),r>1&&i>1&&s[r-1]===e[i-2]&&s[r-2]===e[i-1]&&(t[r][i]=Math.min(t[r][i],t[r-2][i-2]+1))}return t[s.length][e.length]}function uc(s,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=s.startsWith("--");t&&(s=s.slice(2),e=e.map(o=>o.slice(2)));let i=[],r=3,n=.4;return e.forEach(o=>{if(o.length<=1)return;let h=hc(s,o),a=Math.max(s.length,o.length);(a-h)/a>n&&(h<r?(r=h,i=[o]):h===r&&i.push(o))}),i.sort((o,h)=>o.localeCompare(h)),t&&(i=i.map(o=>`--${o}`)),i.length>1?`
17
+ `)}};function Io(s){let e=/\x1b\[\d*(;\d*)*m/g;return s.replace(e,"")}ks.Help=Rs;ks.stripColor=Io});var Bs=O(Us=>{var{InvalidArgumentError:oc}=It(),Ps=class{constructor(e,t){this.flags=e,this.description=t||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=ac(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let t=e;return typeof e=="string"&&(t={[e]:!0}),this.implied=Object.assign(this.implied||{},t),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new oc(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return this.negate?Do(this.name().replace(/^no-/,"")):Do(this.name())}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},Ms=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(t=>{t.negate?this.negativeOptions.set(t.attributeName(),t):this.positiveOptions.set(t.attributeName(),t)}),this.negativeOptions.forEach((t,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,t){let i=t.attributeName();if(!this.dualOptions.has(i))return!0;let r=this.negativeOptions.get(i).presetArg,n=r!==void 0?r:!1;return t.negate===(n===e)}};function Do(s){return s.split("-").reduce((e,t)=>e+t[0].toUpperCase()+t.slice(1))}function ac(s){let e,t,i=/^-[^-]$/,r=/^--[^-]/,n=s.split(/[ |,]+/).concat("guard");if(i.test(n[0])&&(e=n.shift()),r.test(n[0])&&(t=n.shift()),!e&&i.test(n[0])&&(e=n.shift()),!e&&r.test(n[0])&&(e=t,t=n.shift()),n[0].startsWith("-")){let o=n[0],h=`option creation failed due to '${o}' in option flags '${s}'`;throw/^-[^-][^-]/.test(o)?new Error(`${h}
18
+ - a short flag is a single dash and a single character
19
+ - either use a single dash and a single character (for a short flag)
20
+ - or use a double dash for a long option (and can have two, like '--ws, --workspace')`):i.test(o)?new Error(`${h}
21
+ - too many short flags`):r.test(o)?new Error(`${h}
22
+ - too many long flags`):new Error(`${h}
23
+ - unrecognised flag format`)}if(e===void 0&&t===void 0)throw new Error(`option creation failed due to no flags found in '${s}'.`);return{shortFlag:e,longFlag:t}}Us.Option=Ps;Us.DualOptions=Ms});var Ro=O(No=>{function hc(s,e){if(Math.abs(s.length-e.length)>3)return Math.max(s.length,e.length);let t=[];for(let i=0;i<=s.length;i++)t[i]=[i];for(let i=0;i<=e.length;i++)t[0][i]=i;for(let i=1;i<=e.length;i++)for(let r=1;r<=s.length;r++){let n=1;s[r-1]===e[i-1]?n=0:n=1,t[r][i]=Math.min(t[r-1][i]+1,t[r][i-1]+1,t[r-1][i-1]+n),r>1&&i>1&&s[r-1]===e[i-2]&&s[r-2]===e[i-1]&&(t[r][i]=Math.min(t[r][i],t[r-2][i-2]+1))}return t[s.length][e.length]}function uc(s,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let t=s.startsWith("--");t&&(s=s.slice(2),e=e.map(o=>o.slice(2)));let i=[],r=3,n=.4;return e.forEach(o=>{if(o.length<=1)return;let h=hc(s,o),a=Math.max(s.length,o.length);(a-h)/a>n&&(h<r?(r=h,i=[o]):h===r&&i.push(o))}),i.sort((o,h)=>o.localeCompare(h)),t&&(i=i.map(o=>`--${o}`)),i.length>1?`
18
24
  (Did you mean one of ${i.join(", ")}?)`:i.length===1?`
19
25
  (Did you mean ${i[0]}?)`:""}No.suggestSimilar=uc});var Mo=O(Hs=>{var lc=require("node:events").EventEmitter,Ws=require("node:child_process"),Oe=require("node:path"),mi=require("node:fs"),I=require("node:process"),{Argument:cc,humanReadableArgName:fc}=pi(),{CommanderError:$s}=It(),{Help:dc,stripColor:pc}=Fs(),{Option:ko,DualOptions:mc}=Bs(),{suggestSimilar:Fo}=Ro(),zs=class s extends lc{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!1,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._savedState=null,this._outputConfiguration={writeOut:t=>I.stdout.write(t),writeErr:t=>I.stderr.write(t),outputError:(t,i)=>i(t),getOutHelpWidth:()=>I.stdout.isTTY?I.stdout.columns:void 0,getErrHelpWidth:()=>I.stderr.isTTY?I.stderr.columns:void 0,getOutHasColors:()=>{var t,i;return js()??(I.stdout.isTTY&&((i=(t=I.stdout).hasColors)==null?void 0:i.call(t)))},getErrHasColors:()=>{var t,i;return js()??(I.stderr.isTTY&&((i=(t=I.stderr).hasColors)==null?void 0:i.call(t)))},stripColor:t=>pc(t)},this._hidden=!1,this._helpOption=void 0,this._addImplicitHelpCommand=void 0,this._helpCommand=void 0,this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._helpOption=e._helpOption,this._helpCommand=e._helpCommand,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let t=this;t;t=t.parent)e.push(t);return e}command(e,t,i){let r=t,n=i;typeof r=="object"&&r!==null&&(n=r,r=null),n=n||{};let[,o,h]=e.match(/([^ ]+) *(.*)/),a=this.createCommand(o);return r&&(a.description(r),a._executableHandler=!0),n.isDefault&&(this._defaultCommandName=a._name),a._hidden=!!(n.noHelp||n.hidden),a._executableFile=n.executableFile||null,h&&a.arguments(h),this._registerCommand(a),a.parent=this,a.copyInheritedSettings(this),r?this:a}createCommand(e){return new s(e)}createHelp(){return Object.assign(new dc,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,t){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
20
26
  - specify the name in Command constructor or using .name()`);return t=t||{},t.isDefault&&(this._defaultCommandName=e._name),(t.noHelp||t.hidden)&&(e._hidden=!0),this._registerCommand(e),e.parent=this,e._checkForBrokenPassThrough(),this}createArgument(e,t){return new cc(e,t)}argument(e,t,i,r){let n=this.createArgument(e,t);return typeof i=="function"?n.default(r).argParser(i):n.default(i),this.addArgument(n),this}arguments(e){return e.trim().split(/ +/).forEach(t=>{this.argument(t)}),this}addArgument(e){let t=this.registeredArguments.slice(-1)[0];if(t&&t.variadic)throw new Error(`only the last argument can be variadic '${t.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}helpCommand(e,t){if(typeof e=="boolean")return this._addImplicitHelpCommand=e,this;e=e??"help [command]";let[,i,r]=e.match(/([^ ]+) *(.*)/),n=t??"display help for command",o=this.createCommand(i);return o.helpOption(!1),r&&o.arguments(r),n&&o.description(n),this._addImplicitHelpCommand=!0,this._helpCommand=o,this}addHelpCommand(e,t){return typeof e!="object"?(this.helpCommand(e,t),this):(this._addImplicitHelpCommand=!0,this._helpCommand=e,this)}_getHelpCommand(){return this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"))?(this._helpCommand===void 0&&this.helpCommand(void 0,void 0),this._helpCommand):null}hook(e,t){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monocart-reporter",
3
- "version": "2.9.13",
3
+ "version": "2.9.14",
4
4
  "description": "A playwright test reporter. Shows suites/cases/steps with tree style, markdown annotations, custom columns/formatters/data collection visitors, console logs, style tags, send email.",
5
5
  "main": "lib/index.js",
6
6
  "bin": {
@@ -47,28 +47,28 @@
47
47
  "koa": "^2.15.3",
48
48
  "koa-static-resolver": "^1.0.6",
49
49
  "lz-utils": "^2.1.0",
50
- "monocart-coverage-reports": "^2.11.5",
50
+ "monocart-coverage-reports": "^2.12.1",
51
51
  "monocart-locator": "^1.0.2",
52
- "nodemailer": "^6.9.16"
52
+ "nodemailer": "^6.10.0"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@babel/code-frame": "^7.26.2",
56
- "@playwright/test": "^1.49.1",
56
+ "@playwright/test": "^1.50.1",
57
57
  "ansi-to-html": "^0.7.2",
58
58
  "async-tick": "^1.0.0",
59
59
  "autolinker": "^4.1.0",
60
60
  "axios": "^1.7.9",
61
- "commander": "^13.0.0",
61
+ "commander": "^13.1.0",
62
62
  "dotenv": "^16.4.7",
63
- "eslint": "^9.17.0",
63
+ "eslint": "^9.20.0",
64
64
  "eslint-config-plus": "^2.0.2",
65
65
  "eslint-plugin-html": "^8.1.2",
66
66
  "eslint-plugin-vue": "^9.32.0",
67
67
  "file-saver": "^2.0.5",
68
68
  "find-up": "^7.0.0",
69
69
  "github-markdown-css": "^5.8.1",
70
- "glob": "^11.0.0",
71
- "marked": "^15.0.6",
70
+ "glob": "^11.0.1",
71
+ "marked": "^15.0.7",
72
72
  "mermaid": "^11.4.1",
73
73
  "mitt": "^3.0.1",
74
74
  "monocart-code-viewer": "^1.1.4",
@@ -78,7 +78,7 @@
78
78
  "open": "8.4.2",
79
79
  "sanitize-filename": "^1.6.3",
80
80
  "stack-utils": "^2.0.6",
81
- "stylelint": "^16.12.0",
81
+ "stylelint": "^16.14.1",
82
82
  "stylelint-config-plus": "^1.1.3",
83
83
  "supports-color": "^10.0.0",
84
84
  "turbogrid": "^3.2.0",