nemar-cli 0.1.0 → 0.1.1
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/dist/index.js +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
var ik=Object.create;var{getPrototypeOf:ak,defineProperty:t7,getOwnPropertyNames:ok}=Object;var sk=Object.prototype.hasOwnProperty;var h=(D,F,$)=>{$=D!=null?ik(ak(D)):{};let B=F||!D||!D.__esModule?t7($,"default",{value:D,enumerable:!0}):$;for(let J of ok(D))if(!sk.call(B,J))t7(B,J,{get:()=>D[J],enumerable:!0});return B};var W=(D,F)=>()=>(F||D((F={exports:{}}).exports,F),F.exports);var rk=(D,F)=>{for(var $ in F)t7(D,$,{get:F[$],enumerable:!0,configurable:!0,set:(B)=>F[$]=()=>B})};var JD=import.meta.require;var QF=W((tk)=>{class e7 extends Error{constructor(D,F,$){super($);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=F,this.exitCode=D,this.nestedError=void 0}}class uX extends e7{constructor(D){super(1,"commander.invalidArgument",D);Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}}tk.CommanderError=e7;tk.InvalidArgumentError=uX});var t3=W((Bv)=>{var{InvalidArgumentError:Fv}=QF();class bX{constructor(D,F){switch(this.description=F||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,D[0]){case"<":this.required=!0,this._name=D.slice(1,-1);break;case"[":this.required=!1,this._name=D.slice(1,-1);break;default:this.required=!0,this._name=D;break}if(this._name.length>3&&this._name.slice(-3)==="...")this.variadic=!0,this._name=this._name.slice(0,-3)}name(){return this._name}_concatValue(D,F){if(F===this.defaultValue||!Array.isArray(F))return[D];return F.concat(D)}default(D,F){return this.defaultValue=D,this.defaultValueDescription=F,this}argParser(D){return this.parseArg=D,this}choices(D){return this.argChoices=D.slice(),this.parseArg=(F,$)=>{if(!this.argChoices.includes(F))throw new Fv(`Allowed choices are ${this.argChoices.join(", ")}.`);if(this.variadic)return this._concatValue(F,$);return F},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}}function $v(D){let F=D.name()+(D.variadic===!0?"...":"");return D.required?"<"+F+">":"["+F+"]"}Bv.Argument=bX;Bv.humanReadableArgName=$v});var D$=W((Xv)=>{var{humanReadableArgName:Qv}=t3();class mX{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(D){let F=D.commands.filter((B)=>!B._hidden),$=D._getHelpCommand();if($&&!$._hidden)F.push($);if(this.sortSubcommands)F.sort((B,J)=>{return B.name().localeCompare(J.name())});return F}compareOptions(D,F){let $=(B)=>{return B.short?B.short.replace(/^-/,""):B.long.replace(/^--/,"")};return $(D).localeCompare($(F))}visibleOptions(D){let F=D.options.filter((B)=>!B.hidden),$=D._getHelpOption();if($&&!$.hidden){let B=$.short&&D._findOption($.short),J=$.long&&D._findOption($.long);if(!B&&!J)F.push($);else if($.long&&!J)F.push(D.createOption($.long,$.description));else if($.short&&!B)F.push(D.createOption($.short,$.description))}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleGlobalOptions(D){if(!this.showGlobalOptions)return[];let F=[];for(let $=D.parent;$;$=$.parent){let B=$.options.filter((J)=>!J.hidden);F.push(...B)}if(this.sortOptions)F.sort(this.compareOptions);return F}visibleArguments(D){if(D._argsDescription)D.registeredArguments.forEach((F)=>{F.description=F.description||D._argsDescription[F.name()]||""});if(D.registeredArguments.find((F)=>F.description))return D.registeredArguments;return[]}subcommandTerm(D){let F=D.registeredArguments.map(($)=>Qv($)).join(" ");return D._name+(D._aliases[0]?"|"+D._aliases[0]:"")+(D.options.length?" [options]":"")+(F?" "+F:"")}optionTerm(D){return D.flags}argumentTerm(D){return D.name()}longestSubcommandTermLength(D,F){return F.visibleCommands(D).reduce(($,B)=>{return Math.max($,F.subcommandTerm(B).length)},0)}longestOptionTermLength(D,F){return F.visibleOptions(D).reduce(($,B)=>{return Math.max($,F.optionTerm(B).length)},0)}longestGlobalOptionTermLength(D,F){return F.visibleGlobalOptions(D).reduce(($,B)=>{return Math.max($,F.optionTerm(B).length)},0)}longestArgumentTermLength(D,F){return F.visibleArguments(D).reduce(($,B)=>{return Math.max($,F.argumentTerm(B).length)},0)}commandUsage(D){let F=D._name;if(D._aliases[0])F=F+"|"+D._aliases[0];let $="";for(let B=D.parent;B;B=B.parent)$=B.name()+" "+$;return $+F+" "+D.usage()}commandDescription(D){return D.description()}subcommandDescription(D){return D.summary()||D.description()}optionDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0){if(D.required||D.optional||D.isBoolean()&&typeof D.defaultValue==="boolean")F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`)}if(D.presetArg!==void 0&&D.optional)F.push(`preset: ${JSON.stringify(D.presetArg)}`);if(D.envVar!==void 0)F.push(`env: ${D.envVar}`);if(F.length>0)return`${D.description} (${F.join(", ")})`;return D.description}argumentDescription(D){let F=[];if(D.argChoices)F.push(`choices: ${D.argChoices.map(($)=>JSON.stringify($)).join(", ")}`);if(D.defaultValue!==void 0)F.push(`default: ${D.defaultValueDescription||JSON.stringify(D.defaultValue)}`);if(F.length>0){let $=`(${F.join(", ")})`;if(D.description)return`${D.description} ${$}`;return $}return D.description}formatHelp(D,F){let $=F.padWidth(D,F),B=F.helpWidth||80,J=2,Y=2;function Q(V,A){if(A){let U=`${V.padEnd($+2)}${A}`;return F.wrap(U,B-2,$+2)}return V}function X(V){return V.join(`
|
|
4
4
|
`).replace(/^/gm," ".repeat(2))}let E=[`Usage: ${F.commandUsage(D)}`,""],G=F.commandDescription(D);if(G.length>0)E=E.concat([F.wrap(G,B,0),""]);let H=F.visibleArguments(D).map((V)=>{return Q(F.argumentTerm(V),F.argumentDescription(V))});if(H.length>0)E=E.concat(["Arguments:",X(H),""]);let q=F.visibleOptions(D).map((V)=>{return Q(F.optionTerm(V),F.optionDescription(V))});if(q.length>0)E=E.concat(["Options:",X(q),""]);if(this.showGlobalOptions){let V=F.visibleGlobalOptions(D).map((A)=>{return Q(F.optionTerm(A),F.optionDescription(A))});if(V.length>0)E=E.concat(["Global Options:",X(V),""])}let K=F.visibleCommands(D).map((V)=>{return Q(F.subcommandTerm(V),F.subcommandDescription(V))});if(K.length>0)E=E.concat(["Commands:",X(K),""]);return E.join(`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nemar-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"dev": "bun run src/index.ts",
|
|
12
|
-
"build": "bun build src/index.ts --outdir dist --target bun --minify",
|
|
12
|
+
"build": "bun build src/index.ts --outdir dist --target bun --minify && sed -i '' '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js",
|
|
13
13
|
"test": "bun test",
|
|
14
14
|
"lint": "biome check src/",
|
|
15
15
|
"lint:fix": "biome check --fix src/",
|