diff-mindustry-bundles 1.0.3 → 1.0.4
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/README.md +1 -1
- package/build/index.js +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/build/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import{createRequire as tq}from"node:module";var mq=Object.create;var{getPrototypeOf:dq,defineProperty:Jq,getOwnPropertyNames:lq}=Object;var pq=Object.prototype.hasOwnProperty;function iq(q){return this[q]}var sq,nq,rq=(q,J,z)=>{var Q=q!=null&&typeof q==="object";if(Q){var X=J?sq??=new WeakMap:nq??=new WeakMap,Z=X.get(q);if(Z)return Z}z=q!=null?mq(dq(q)):{};let $=J||!q||!q.__esModule?Jq(z,"default",{value:q,enumerable:!0}):z;for(let U of lq(q))if(!pq.call($,U))Jq($,U,{get:iq.bind(q,U),enumerable:!0});if(Q)X.set(q,$);return $};var E=(q,J)=>()=>(J||q((J={exports:{}}).exports,J),J.exports);var w=tq(import.meta.url);var A=E((aq)=>{class h extends Error{constructor(q,J,z){super(z);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=J,this.exitCode=q,this.nestedError=void 0}}class zq extends h{constructor(q){super(1,"commander.invalidArgument",q);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}aq.CommanderError=h;aq.InvalidArgumentError=zq});var C=E((z1)=>{var{InvalidArgumentError:q1}=A();class Qq{constructor(q,J){switch(this.description=J||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,q[0]){case"<":this.required=!0,this._name=q.slice(1,-1);break;case"[":this.required=!1,this._name=q.slice(1,-1);break;default:this.required=!0,this._name=q;break}if(this._name.endsWith("..."))this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_collectValue(q,J){if(J===this.defaultValue||!Array.isArray(J))return[q];return J.push(q),J}default(q,J){return this.defaultValue=q,this.defaultValueDescription=J,this}argParser(q){return this.parseArg=q,this}choices(q){return this.argChoices=q.slice(),this.parseArg=(J,z)=>{if(!this.argChoices.includes(J))throw new q1(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._collectValue(J,z);return J},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function J1(q){let J=q.name()+(q.variadic===!0?"...":"");return q.required?"<"+J+">":"["+J+"]"}z1.Argument=Qq;z1.humanReadableArgName=J1});var u=E(($1)=>{var{humanReadableArgName:Z1}=C();class Xq{constructor(){this.helpWidth=void 0,this.minWidthToWrap=40,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}prepareContext(q){this.helpWidth=this.helpWidth??q.helpWidth??80}visibleCommands(q){let J=q.commands.filter((Q)=>!Q._hidden),z=q._getHelpCommand();if(z&&!z._hidden)J.push(z);if(this.sortSubcommands)J.sort((Q,X)=>{return Q.name().localeCompare(X.name())});return J}compareOptions(q,J){let z=(Q)=>{return Q.short?Q.short.replace(/^-/,""):Q.long.replace(/^--/,"")};return z(q).localeCompare(z(J))}visibleOptions(q){let J=q.options.filter((Q)=>!Q.hidden),z=q._getHelpOption();if(z&&!z.hidden){let Q=z.short&&q._findOption(z.short),X=z.long&&q._findOption(z.long);if(!Q&&!X)J.push(z);else if(z.long&&!X)J.push(q.createOption(z.long,z.description));else if(z.short&&!Q)J.push(q.createOption(z.short,z.description))}if(this.sortOptions)J.sort(this.compareOptions);return J}visibleGlobalOptions(q){if(!this.showGlobalOptions)return[];let J=[];for(let z=q.parent;z;z=z.parent){let Q=z.options.filter((X)=>!X.hidden);J.push(...Q)}if(this.sortOptions)J.sort(this.compareOptions);return J}visibleArguments(q){if(q._argsDescription)q.registeredArguments.forEach((J)=>{J.description=J.description||q._argsDescription[J.name()]||""});if(q.registeredArguments.find((J)=>J.description))return q.registeredArguments;return[]}subcommandTerm(q){let J=q.registeredArguments.map((z)=>Z1(z)).join(" ");return q._name+(q._aliases[0]?"|"+q._aliases[0]:"")+(q.options.length?" [options]":"")+(J?" "+J:"")}optionTerm(q){return q.flags}argumentTerm(q){return q.name()}longestSubcommandTermLength(q,J){return J.visibleCommands(q).reduce((z,Q)=>{return Math.max(z,this.displayWidth(J.styleSubcommandTerm(J.subcommandTerm(Q))))},0)}longestOptionTermLength(q,J){return J.visibleOptions(q).reduce((z,Q)=>{return Math.max(z,this.displayWidth(J.styleOptionTerm(J.optionTerm(Q))))},0)}longestGlobalOptionTermLength(q,J){return J.visibleGlobalOptions(q).reduce((z,Q)=>{return Math.max(z,this.displayWidth(J.styleOptionTerm(J.optionTerm(Q))))},0)}longestArgumentTermLength(q,J){return J.visibleArguments(q).reduce((z,Q)=>{return Math.max(z,this.displayWidth(J.styleArgumentTerm(J.argumentTerm(Q))))},0)}commandUsage(q){let J=q._name;if(q._aliases[0])J=J+"|"+q._aliases[0];let z="";for(let Q=q.parent;Q;Q=Q.parent)z=Q.name()+" "+z;return z+J+" "+q.usage()}commandDescription(q){return q.description()}subcommandDescription(q){return q.summary()||q.description()}optionDescription(q){let J=[];if(q.argChoices)J.push(`choices: ${q.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if(q.defaultValue!==void 0){if(q.required||q.optional||q.isBoolean()&&typeof q.defaultValue==="boolean")J.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`)}if(q.presetArg!==void 0&&q.optional)J.push(`preset: ${JSON.stringify(q.presetArg)}`);if(q.envVar!==void 0)J.push(`env: ${q.envVar}`);if(J.length>0){let z=`(${J.join(", ")})`;if(q.description)return`${q.description} ${z}`;return z}return q.description}argumentDescription(q){let J=[];if(q.argChoices)J.push(`choices: ${q.argChoices.map((z)=>JSON.stringify(z)).join(", ")}`);if(q.defaultValue!==void 0)J.push(`default: ${q.defaultValueDescription||JSON.stringify(q.defaultValue)}`);if(J.length>0){let z=`(${J.join(", ")})`;if(q.description)return`${q.description} ${z}`;return z}return q.description}formatItemList(q,J,z){if(J.length===0)return[];return[z.styleTitle(q),...J,""]}groupItems(q,J,z){let Q=new Map;return q.forEach((X)=>{let Z=z(X);if(!Q.has(Z))Q.set(Z,[])}),J.forEach((X)=>{let Z=z(X);if(!Q.has(Z))Q.set(Z,[]);Q.get(Z).push(X)}),Q}formatHelp(q,J){let z=J.padWidth(q,J),Q=J.helpWidth??80;function X(H,K){return J.formatItem(H,z,K,J)}let Z=[`${J.styleTitle("Usage:")} ${J.styleUsage(J.commandUsage(q))}`,""],$=J.commandDescription(q);if($.length>0)Z=Z.concat([J.boxWrap(J.styleCommandDescription($),Q),""]);let U=J.visibleArguments(q).map((H)=>{return X(J.styleArgumentTerm(J.argumentTerm(H)),J.styleArgumentDescription(J.argumentDescription(H)))});if(Z=Z.concat(this.formatItemList("Arguments:",U,J)),this.groupItems(q.options,J.visibleOptions(q),(H)=>H.helpGroupHeading??"Options:").forEach((H,K)=>{let V=H.map((B)=>{return X(J.styleOptionTerm(J.optionTerm(B)),J.styleOptionDescription(J.optionDescription(B)))});Z=Z.concat(this.formatItemList(K,V,J))}),J.showGlobalOptions){let H=J.visibleGlobalOptions(q).map((K)=>{return X(J.styleOptionTerm(J.optionTerm(K)),J.styleOptionDescription(J.optionDescription(K)))});Z=Z.concat(this.formatItemList("Global Options:",H,J))}return this.groupItems(q.commands,J.visibleCommands(q),(H)=>H.helpGroup()||"Commands:").forEach((H,K)=>{let V=H.map((B)=>{return X(J.styleSubcommandTerm(J.subcommandTerm(B)),J.styleSubcommandDescription(J.subcommandDescription(B)))});Z=Z.concat(this.formatItemList(K,V,J))}),Z.join(`
|
|
2
3
|
`)}displayWidth(q){return Zq(q).length}styleTitle(q){return q}styleUsage(q){return q.split(" ").map((J)=>{if(J==="[options]")return this.styleOptionText(J);if(J==="[command]")return this.styleSubcommandText(J);if(J[0]==="["||J[0]==="<")return this.styleArgumentText(J);return this.styleCommandText(J)}).join(" ")}styleCommandDescription(q){return this.styleDescriptionText(q)}styleOptionDescription(q){return this.styleDescriptionText(q)}styleSubcommandDescription(q){return this.styleDescriptionText(q)}styleArgumentDescription(q){return this.styleDescriptionText(q)}styleDescriptionText(q){return q}styleOptionTerm(q){return this.styleOptionText(q)}styleSubcommandTerm(q){return q.split(" ").map((J)=>{if(J==="[options]")return this.styleOptionText(J);if(J[0]==="["||J[0]==="<")return this.styleArgumentText(J);return this.styleSubcommandText(J)}).join(" ")}styleArgumentTerm(q){return this.styleArgumentText(q)}styleOptionText(q){return q}styleArgumentText(q){return q}styleSubcommandText(q){return q}styleCommandText(q){return q}padWidth(q,J){return Math.max(J.longestOptionTermLength(q,J),J.longestGlobalOptionTermLength(q,J),J.longestSubcommandTermLength(q,J),J.longestArgumentTermLength(q,J))}preformatted(q){return/\n[^\S\r\n]/.test(q)}formatItem(q,J,z,Q){let Z=" ".repeat(2);if(!z)return Z+q;let $=q.padEnd(J+q.length-Q.displayWidth(q)),U=2,G=(this.helpWidth??80)-J-U-2,H;if(G<this.minWidthToWrap||Q.preformatted(z))H=z;else H=Q.boxWrap(z,G).replace(/\n/g,`
|
|
3
4
|
`+" ".repeat(J+U));return Z+$+" ".repeat(U)+H.replace(/\n/g,`
|