factoriomod-debug 2.0.12 → 2.0.13
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.
- package/CHANGELOG.md +5 -0
- package/dist/{chunk-OF4WOBLZ.js → chunk-S7WJEOJD.js} +23 -23
- package/dist/fmtk-cli.js +1 -1
- package/dist/fmtk-vscode.js +9 -9
- package/package.json +19 -1
package/dist/fmtk-cli.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import {createRequire} from 'module'
|
|
4
4
|
const require = createRequire(import.meta.url)
|
|
5
5
|
|
|
6
|
-
import{A as mf,B as gf,C as Io,D as ft,E as ka,F as qy,G as vr,H as Ta,J as Ny,K as My,M as By,O as jy,P as Uy,a as B,b as II,c as x,d as Oy,e as ct,f as LI,g as Iy,h as Ly,i as Py,j as Ao,k as He,l as Nt,m as xr,n as Oo,o as Ae,p as Cy,q as yn,t as PI,u as Sa,v as oe,w as Ea,x as Cn,y as mi,z as Fy}from"./chunk-
|
|
6
|
+
import{A as mf,B as gf,C as Io,D as ft,E as ka,F as qy,G as vr,H as Ta,J as Ny,K as My,M as By,O as jy,P as Uy,a as B,b as II,c as x,d as Oy,e as ct,f as LI,g as Iy,h as Ly,i as Py,j as Ao,k as He,l as Nt,m as xr,n as Oo,o as Ae,p as Cy,q as yn,t as PI,u as Sa,v as oe,w as Ea,x as Cn,y as mi,z as Fy}from"./chunk-S7WJEOJD.js";var Lo=x(bf=>{"use strict";var Da=class extends Error{constructor(e,n,r){super(r),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=n,this.exitCode=e,this.nestedError=void 0}},yf=class extends Da{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};bf.CommanderError=Da;bf.InvalidArgumentError=yf});var Ra=x(_f=>{"use strict";var{InvalidArgumentError:CI}=Lo(),wf=class{constructor(e,n){switch(this.description=n||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.endsWith("...")&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_collectValue(e,n){return n===this.defaultValue||!Array.isArray(n)?[e]:(n.push(e),n)}default(e,n){return this.defaultValue=e,this.defaultValueDescription=n,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(n,r)=>{if(!this.argChoices.includes(n))throw new CI(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._collectValue(n,r):n},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function FI(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}_f.Argument=wf;_f.humanReadableArgName=FI});var Sf=x(vf=>{"use strict";var{humanReadableArgName:qI}=Ra(),xf=class{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(e){this.helpWidth=this.helpWidth??e.helpWidth??80}visibleCommands(e){let n=e.commands.filter(i=>!i._hidden),r=e._getHelpCommand();return r&&!r._hidden&&n.push(r),this.sortSubcommands&&n.sort((i,o)=>i.name().localeCompare(o.name())),n}compareOptions(e,n){let r=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");return r(e).localeCompare(r(n))}visibleOptions(e){let n=e.options.filter(i=>!i.hidden),r=e._getHelpOption();if(r&&!r.hidden){let i=r.short&&e._findOption(r.short),o=r.long&&e._findOption(r.long);!i&&!o?n.push(r):r.long&&!o?n.push(e.createOption(r.long,r.description)):r.short&&!i&&n.push(e.createOption(r.short,r.description))}return this.sortOptions&&n.sort(this.compareOptions),n}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let n=[];for(let r=e.parent;r;r=r.parent){let i=r.options.filter(o=>!o.hidden);n.push(...i)}return this.sortOptions&&n.sort(this.compareOptions),n}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(n=>{n.description=n.description||e._argsDescription[n.name()]||""}),e.registeredArguments.find(n=>n.description)?e.registeredArguments:[]}subcommandTerm(e){let n=e.registeredArguments.map(r=>qI(r)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(n?" "+n:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,n){return n.visibleCommands(e).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleSubcommandTerm(n.subcommandTerm(i)))),0)}longestOptionTermLength(e,n){return n.visibleOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestGlobalOptionTermLength(e,n){return n.visibleGlobalOptions(e).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleOptionTerm(n.optionTerm(i)))),0)}longestArgumentTermLength(e,n){return n.visibleArguments(e).reduce((r,i)=>Math.max(r,this.displayWidth(n.styleArgumentTerm(n.argumentTerm(i)))),0)}commandUsage(e){let n=e._name;e._aliases[0]&&(n=n+"|"+e._aliases[0]);let r="";for(let i=e.parent;i;i=i.parent)r=i.name()+" "+r;return r+n+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&n.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&n.push(`env: ${e.envVar}`),n.length>0){let r=`(${n.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}argumentDescription(e){let n=[];if(e.argChoices&&n.push(`choices: ${e.argChoices.map(r=>JSON.stringify(r)).join(", ")}`),e.defaultValue!==void 0&&n.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),n.length>0){let r=`(${n.join(", ")})`;return e.description?`${e.description} ${r}`:r}return e.description}formatItemList(e,n,r){return n.length===0?[]:[r.styleTitle(e),...n,""]}groupItems(e,n,r){let i=new Map;return e.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[])}),n.forEach(o=>{let s=r(o);i.has(s)||i.set(s,[]),i.get(s).push(o)}),i}formatHelp(e,n){let r=n.padWidth(e,n),i=n.helpWidth??80;function o(f,h){return n.formatItem(f,r,h,n)}let s=[`${n.styleTitle("Usage:")} ${n.styleUsage(n.commandUsage(e))}`,""],a=n.commandDescription(e);a.length>0&&(s=s.concat([n.boxWrap(n.styleCommandDescription(a),i),""]));let l=n.visibleArguments(e).map(f=>o(n.styleArgumentTerm(n.argumentTerm(f)),n.styleArgumentDescription(n.argumentDescription(f))));if(s=s.concat(this.formatItemList("Arguments:",l,n)),this.groupItems(e.options,n.visibleOptions(e),f=>f.helpGroupHeading??"Options:").forEach((f,h)=>{let p=f.map(b=>o(n.styleOptionTerm(n.optionTerm(b)),n.styleOptionDescription(n.optionDescription(b))));s=s.concat(this.formatItemList(h,p,n))}),n.showGlobalOptions){let f=n.visibleGlobalOptions(e).map(h=>o(n.styleOptionTerm(n.optionTerm(h)),n.styleOptionDescription(n.optionDescription(h))));s=s.concat(this.formatItemList("Global Options:",f,n))}return this.groupItems(e.commands,n.visibleCommands(e),f=>f.helpGroup()||"Commands:").forEach((f,h)=>{let p=f.map(b=>o(n.styleSubcommandTerm(n.subcommandTerm(b)),n.styleSubcommandDescription(n.subcommandDescription(b))));s=s.concat(this.formatItemList(h,p,n))}),s.join(`
|
|
7
7
|
`)}displayWidth(e){return Wy(e).length}styleTitle(e){return e}styleUsage(e){return e.split(" ").map(n=>n==="[options]"?this.styleOptionText(n):n==="[command]"?this.styleSubcommandText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleCommandText(n)).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(n=>n==="[options]"?this.styleOptionText(n):n[0]==="["||n[0]==="<"?this.styleArgumentText(n):this.styleSubcommandText(n)).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,n){return Math.max(n.longestOptionTermLength(e,n),n.longestGlobalOptionTermLength(e,n),n.longestSubcommandTermLength(e,n),n.longestArgumentTermLength(e,n))}preformatted(e){return/\n[^\S\r\n]/.test(e)}formatItem(e,n,r,i){let s=" ".repeat(2);if(!r)return s+e;let a=e.padEnd(n+e.length-i.displayWidth(e)),l=2,c=(this.helpWidth??80)-n-l-2,f;return c<this.minWidthToWrap||i.preformatted(r)?f=r:f=i.boxWrap(r,c).replace(/\n/g,`
|
|
8
8
|
`+" ".repeat(n+l)),s+a+" ".repeat(l)+f.replace(/\n/g,`
|
|
9
9
|
${s}`)}boxWrap(e,n){if(n<this.minWidthToWrap)return e;let r=e.split(/\r\n|\n/),i=/[\s]*[^\s]+/g,o=[];return r.forEach(s=>{let a=s.match(i);if(a===null){o.push("");return}let l=[a.shift()],u=this.displayWidth(l[0]);a.forEach(c=>{let f=this.displayWidth(c);if(u+f<=n){l.push(c),u+=f;return}o.push(l.join(""));let h=c.trimStart();l=[h],u=this.displayWidth(h)}),o.push(l.join(""))}),o.join(`
|