From bf31fad41ce9ee13414ba1040470cc1b04c61e92 Mon Sep 17 00:00:00 2001 From: thecodeah Date: Mon, 22 Mar 2021 17:17:17 +0100 Subject: [PATCH] 0.5.0 release! --- CHANGELOG.md | 8 ++++++++ lib/quicli.min.js | 2 +- package-lock.json | 4 ++-- package.json | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a1946b..f6bdcce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,16 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. +#### [v0.5.0](https://github.com/thecodeah/quicli/compare/v0.4.0...v0.5.0) + +- feat: cli.promptInput() [`64bdc14`](https://github.com/thecodeah/quicli/commit/64bdc14953d8bcdbbfe4d7db8ced8d99d56c5fbe) +- docs: Added example usage of cli.promptInput() to README.md [`6c54a87`](https://github.com/thecodeah/quicli/commit/6c54a87a206f99f7c9d04bcfbf4f61753c49a677) +- docs: Update Why QuiCLI section in README.md with better information [`0ae9cc3`](https://github.com/thecodeah/quicli/commit/0ae9cc3e127bfa5a83946c47e6acb9b0c28cf7d0) + #### [v0.4.0](https://github.com/thecodeah/quicli/compare/v0.3.0...v0.4.0) +> 18 March 2021 + - feat: Menus! (cli.promptMenu) [`adc7c85`](https://github.com/thecodeah/quicli/commit/adc7c851e7bb53624e52b4d01628dbf2615e03b6) - feat: Put spaces between each cli.log argument just like console.log [`7d828ed`](https://github.com/thecodeah/quicli/commit/7d828ed17a12dce2bf33a4fc9571716cd0a1e8e4) - docs: Added cli.promptMenu example to README.md [`8ad7175`](https://github.com/thecodeah/quicli/commit/8ad71750f9c9915d0e77c9513b3fb7cacf188847) diff --git a/lib/quicli.min.js b/lib/quicli.min.js index b47a5b5..0c93605 100644 --- a/lib/quicli.min.js +++ b/lib/quicli.min.js @@ -1 +1 @@ -/* Using QuiCLI v0.4.0 */var __awaiter=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,s){function i(e){try{u(n.next(e))}catch(e){s(e)}}function a(e){try{u(n.throw(e))}catch(e){s(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,a)}u((n=n.apply(e,t||[])).next())}))},__generator=this&&this.__generator||function(e,t){var r,n,o,s,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,n=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)if("string"==typeof e[0])this.items=e.map((function(e,t){return{text:e,value:t}}));else{var t=e.filter((function(e){return"text"in e&&"value"in e}));if(!(t.length>0))throw new Error("Menu items must either be an array of strings or an array of { text: string, value: any }");this.items=t}}return e.prototype.prompt=function(){return __awaiter(this,void 0,Promise,(function(){var e=this;return __generator(this,(function(t){return this.render(!1),process.stdin.resume(),process.stdin.setRawMode(!0),[2,new Promise((function(t){var n=function(o){var s=Object.keys(r).find((function(e){return 0===o.compare(r[e])}));if(void 0!==s){switch(s){case"arrowUp":e.cursor=Math.max(0,e.cursor-1);break;case"arrowDown":e.cursor=Math.min(e.items.length-1,e.cursor+1);break;case"enter":process.stdin.setRawMode(!1),process.stdin.pause(),process.stdin.removeListener("data",n),t(e.items[e.cursor].value);break;case"exit":process.exit(1)}e.render()}};return process.stdin.on("data",n)}))]}))}))},e.prototype.render=function(e){void 0===e&&(e=!0),e&&(process.stdout.moveCursor(0,-1*this.items.length),process.stdout.clearScreenDown());for(var t=0;t "))}}((r=process.argv.slice(2),n=[],o=[],r.forEach((function(e){if(e.startsWith("-"))e.startsWith("--")?o.push({name:e.slice(2),values:[]}):e.slice(1).split("").forEach((function(e){o.push({name:e,values:[]})}));else if(o.length>0){var t=void 0;t=e.match(/^[0-9]+$/)?Number(e):"true"===e||"false"===e?Boolean(e):e,o[o.length-1].values.push(t)}else n.push(e)})),{commands:n,flags:o})))})),{log:function(){for(var e=[],t=0;t0&&o[o.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]0)if("string"==typeof e[0])this.items=e.map((function(e,t){return{text:e,value:t}}));else{var t=e.filter((function(e){return"text"in e&&"value"in e}));if(!(t.length>0))throw new Error("Menu items must either be an array of strings or an array of { text: string, value: any }");this.items=t}}return e.prototype.prompt=function(){return __awaiter(this,void 0,Promise,(function(){var e=this;return __generator(this,(function(t){return this.render(!1),process.stdin.resume(),process.stdin.setRawMode(!0),[2,new Promise((function(t){var n=function(o){var s=Object.keys(r).find((function(e){return 0===o.compare(r[e])}));if(void 0!==s){switch(s){case"arrowUp":e.cursor=Math.max(0,e.cursor-1);break;case"arrowDown":e.cursor=Math.min(e.items.length-1,e.cursor+1);break;case"enter":process.stdin.setRawMode(!1),process.stdin.pause(),process.stdin.removeListener("data",n),t(e.items[e.cursor].value);break;case"exit":process.exit(1)}e.render()}};return process.stdin.on("data",n)}))]}))}))},e.prototype.render=function(e){void 0===e&&(e=!0),e&&(process.stdout.moveCursor(0,-1*this.items.length),process.stdout.clearScreenDown());for(var t=0;t "))}}((r=process.argv.slice(2),n=[],o=[],r.forEach((function(e){if(e.startsWith("-"))e.startsWith("--")?o.push({name:e.slice(2),values:[]}):e.slice(1).split("").forEach((function(e){o.push({name:e,values:[]})}));else if(o.length>0){var t=void 0;t=e.match(/^[0-9]+$/)?Number(e):"true"===e||"false"===e?Boolean(e):e,o[o.length-1].values.push(t)}else n.push(e)})),{commands:n,flags:o})))})),{log:function(){for(var e=[],t=0;t