@hyperone/cli-ext-config-autocomplete
Advanced tools
Comparing version 2.1.4 to 2.1.5
@@ -1,1 +0,1 @@ | ||
(()=>{"use strict";var e={761:(e,t)=>{class r{constructor(e){this.i=0,this.string=e,this.whitespace=" \t\r\n",this.quotes="'\"",this.escapes="\\",this.escapedQuotes='"',this.ansiCQuotes=!0,this.localeQuotes=!0,this.debug=!1}readChar(){return this.string.charAt(this.i++)}processEscapes(e,t,r){if(!r&&!this.escapedQuotes.includes(t))return e;let s="["+this.escapes.replace(/(.)/g,"\\$1")+"]";if(!r&&this.escapedQuotes.includes(t)){let r=new RegExp(s+"("+s+"|\\"+t+")","g");return e.replace(r,"$1")}if(r){let t={"([\\\\'\"?])":e=>e,a:()=>"",b:()=>"\b","e|E":()=>"",f:()=>"\f",n:()=>"\n",r:()=>"\r",t:()=>"\t",v:()=>"\v","([0-7]{1,3})":e=>String.fromCharCode(parseInt(e,8)),"x([0-9a-fA-F]{1,2})":e=>String.fromCharCode(parseInt(e,16)),"u([0-9a-fA-F]{1,4})":e=>String.fromCharCode(parseInt(e,16)),"U([0-9a-fA-F]{1,8})":e=>String.fromCharCode(parseInt(e,16)),"c(.)":e=>"?"===e?"":"@"===e?"\0":String.fromCharCode(31&e.charCodeAt(0))},r=new RegExp(s+"("+Object.keys(t).join("|")+")","g");return e.replace(r,(function(e,r){for(let e in t){let s=new RegExp("^"+e+"$").exec(r);if(null!==s)return t[e].apply(null,s.slice(1))}}))}}*[Symbol.iterator](){let e,t=!1,r=!1,s=!1,o=-2;for(this.debug&&console.log("full input:",">"+this.string+"<");;){const i=this.i,n=this.readChar();if(this.debug&&console.log("position:",i,"input:",">"+n+"<","accumulated:",e,"inQuote:",t,"inDollarQuote:",r,"lastDollar:",o,"escaped:",s),""===n){if(t)throw new Error("Got EOF while in a quoted string");if(s)throw new Error("Got EOF while in an escape sequence");return void(void 0!==e&&(yield e))}if(s)"\n"===n||(e=t?(e||"")+s+n:(e||"")+n),s=!1;else if(!this.escapes.includes(n)||t&&!1===r&&!this.escapedQuotes.includes(t))if(!1===t)this.quotes.includes(n)?(t=n,o===i-1&&("'"!==n||this.ansiCQuotes)&&('"'!==n||this.localeQuotes)&&(r=n),e=e||"",!1!==r&&(e=e.slice(0,-1))):(!1===t&&"$"===n&&(o=i),this.whitespace.includes(n)?(void 0!==e&&(yield e),e=void 0):e=(e||"")+n);else{if(n===t){e=this.processEscapes(e,t,"'"===r),t=!1,r=!1;continue}e=(e||"")+n}else s=n}}}t.V=function(e){return Array.from(new r(e))}},147:e=>{e.exports=JSON.parse('{"u2":"@hyperone/cli-ext-config-autocomplete","i8":"2.1.4"}')}},t={};function r(s){var o=t[s];if(void 0!==o)return o.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e=require("@hyperone/cli-framework");var t=r(761);const s=(e,t)=>e.filter((e=>e.startsWith(t))).join("\n"),o=(new e.Command({name:"comply",summary:"List suggestion for command",options:[{name:"cmd",required:!0}],handler:async(e,r)=>{let o=r;for(;o.parent;)o=o.parent;const i=(0,t.V)(e._all.cmd),n=i[i.length-1];let a,c,l,p=o;for(c=1;c<i.length&&p.findCommand&&(l=await p.loadCommands(),a=i[c],l.some((e=>e.name===a)));c++)p=l.find((e=>e.name===a));if(n.startsWith("-")){const e=(await p.getOptions()).map((e=>`--${e.name}`));return s(e,n)}if(p.findCommand&&l){const e=l.map((e=>e.name));return s(e,a)}return s([],n)}}),require("fs"));var i=r.n(o);const n=require("path");var a=r.n(n);const c=require("os");var l=r.n(c);new e.Command({name:"install",summary:"Update shell configuration to support autocomplete",description:"Only the Bash shell is currently supported. Let us know if you need support from other shells.",handler:async(e,t)=>{const r=["_cli()","{",`words=$(IFS=" "; ${process.pkg?process.argv[0]:`${process.argv[0]} ${process.argv[1]}`} config autocomplete comply --cmd "\${COMP_WORDS[*]}")`,'COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )',"return 0","}","complete -F _cli h1"].join("\n");await i().promises.mkdir(await t.device.dataDir(),{recursive:!0});const s=a().join(await t.device.dataDir(),"completion.sh");await i().promises.writeFile(s,r,{mode:493});const o=[`# begin ${t.device.scope} completion`,`source ${s}`,`# end ${t.device.scope} completion`].join("\n");t.device.log(`Completion shim saved in path ${s}`);const n=a().join(l().homedir(),".bash_profile");await i().promises.writeFile(n,o,{flag:"a"}),t.device.log(`Completion appended loader in path ${n}`)}}),r(147).u2,r(147).i8})()})(); | ||
(()=>{"use strict";var e={761:(e,t)=>{class r{constructor(e){this.i=0,this.string=e,this.whitespace=" \t\r\n",this.quotes="'\"",this.escapes="\\",this.escapedQuotes='"',this.ansiCQuotes=!0,this.localeQuotes=!0,this.debug=!1}readChar(){return this.string.charAt(this.i++)}processEscapes(e,t,r){if(!r&&!this.escapedQuotes.includes(t))return e;let s="["+this.escapes.replace(/(.)/g,"\\$1")+"]";if(!r&&this.escapedQuotes.includes(t)){let r=new RegExp(s+"("+s+"|\\"+t+")","g");return e.replace(r,"$1")}if(r){let t={"([\\\\'\"?])":e=>e,a:()=>"",b:()=>"\b","e|E":()=>"",f:()=>"\f",n:()=>"\n",r:()=>"\r",t:()=>"\t",v:()=>"\v","([0-7]{1,3})":e=>String.fromCharCode(parseInt(e,8)),"x([0-9a-fA-F]{1,2})":e=>String.fromCharCode(parseInt(e,16)),"u([0-9a-fA-F]{1,4})":e=>String.fromCharCode(parseInt(e,16)),"U([0-9a-fA-F]{1,8})":e=>String.fromCharCode(parseInt(e,16)),"c(.)":e=>"?"===e?"":"@"===e?"\0":String.fromCharCode(31&e.charCodeAt(0))},r=new RegExp(s+"("+Object.keys(t).join("|")+")","g");return e.replace(r,(function(e,r){for(let e in t){let s=new RegExp("^"+e+"$").exec(r);if(null!==s)return t[e].apply(null,s.slice(1))}}))}}*[Symbol.iterator](){let e,t=!1,r=!1,s=!1,o=-2;for(this.debug&&console.log("full input:",">"+this.string+"<");;){const i=this.i,n=this.readChar();if(this.debug&&console.log("position:",i,"input:",">"+n+"<","accumulated:",e,"inQuote:",t,"inDollarQuote:",r,"lastDollar:",o,"escaped:",s),""===n){if(t)throw new Error("Got EOF while in a quoted string");if(s)throw new Error("Got EOF while in an escape sequence");return void(void 0!==e&&(yield e))}if(s)"\n"===n||(e=t?(e||"")+s+n:(e||"")+n),s=!1;else if(!this.escapes.includes(n)||t&&!1===r&&!this.escapedQuotes.includes(t))if(!1===t)this.quotes.includes(n)?(t=n,o===i-1&&("'"!==n||this.ansiCQuotes)&&('"'!==n||this.localeQuotes)&&(r=n),e=e||"",!1!==r&&(e=e.slice(0,-1))):(!1===t&&"$"===n&&(o=i),this.whitespace.includes(n)?(void 0!==e&&(yield e),e=void 0):e=(e||"")+n);else{if(n===t){e=this.processEscapes(e,t,"'"===r),t=!1,r=!1;continue}e=(e||"")+n}else s=n}}}t.V=function(e){return Array.from(new r(e))}},147:e=>{e.exports=JSON.parse('{"u2":"@hyperone/cli-ext-config-autocomplete","i8":"2.1.5"}')}},t={};function r(s){var o=t[s];if(void 0!==o)return o.exports;var i=t[s]={exports:{}};return e[s](i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var s in t)r.o(t,s)&&!r.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:t[s]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{const e=require("@hyperone/cli-framework");var t=r(761);const s=(e,t)=>e.filter((e=>e.startsWith(t))).join("\n"),o=(new e.Command({name:"comply",summary:"List suggestion for command",options:[{name:"cmd",required:!0}],handler:async(e,r)=>{let o=r;for(;o.parent;)o=o.parent;const i=(0,t.V)(e._all.cmd),n=i[i.length-1];let a,c,l,p=o;for(c=1;c<i.length&&p.findCommand&&(l=await p.loadCommands(),a=i[c],l.some((e=>e.name===a)));c++)p=l.find((e=>e.name===a));if(n.startsWith("-")){const e=(await p.getOptions()).map((e=>`--${e.name}`));return s(e,n)}if(p.findCommand&&l){const e=l.map((e=>e.name));return s(e,a)}return s([],n)}}),require("fs"));var i=r.n(o);const n=require("path");var a=r.n(n);const c=require("os");var l=r.n(c);new e.Command({name:"install",summary:"Update shell configuration to support autocomplete",description:"Only the Bash shell is currently supported. Let us know if you need support from other shells.",handler:async(e,t)=>{const r=["_cli()","{",`words=$(IFS=" "; ${process.pkg?process.argv[0]:`${process.argv[0]} ${process.argv[1]}`} config autocomplete comply --cmd "\${COMP_WORDS[*]}")`,'COMPREPLY=( $(compgen -W "${words}" -- ${cur}) )',"return 0","}","complete -F _cli h1"].join("\n");await i().promises.mkdir(await t.device.dataDir(),{recursive:!0});const s=a().join(await t.device.dataDir(),"completion.sh");await i().promises.writeFile(s,r,{mode:493});const o=[`# begin ${t.device.scope} completion`,`source ${s}`,`# end ${t.device.scope} completion`].join("\n");t.device.log(`Completion shim saved in path ${s}`);const n=a().join(l().homedir(),".bash_profile");await i().promises.writeFile(n,o,{flag:"a"}),t.device.log(`Completion appended loader in path ${n}`)}}),r(147).u2,r(147).i8})()})(); |
{ | ||
"name": "@hyperone/cli-ext-config-autocomplete", | ||
"version": "2.1.4", | ||
"version": "2.1.5", | ||
"description": "Extension to manage autocompletion of CLI.", | ||
@@ -21,7 +21,7 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@hyperone/cli-core": "^2.1.4", | ||
"@hyperone/cli-framework": "^2.1.4", | ||
"@hyperone/cli-core": "^2.1.5", | ||
"@hyperone/cli-framework": "^2.1.5", | ||
"shlex": "^2.0.2" | ||
}, | ||
"gitHead": "86399317f94330bb2695a5088174d04331bc8a02", | ||
"gitHead": "086663733e031ad84bea0bbd4105bfbd1395ddce", | ||
"publishConfig": { | ||
@@ -28,0 +28,0 @@ "access": "public", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
0
Updated@hyperone/cli-core@^2.1.5