Simplify internals #32
Replies: 3 comments 5 replies
-
const {Command} = require('seeli')
class MyCommand extends Command {
name = 'mycmd'
description = 'hello world'
string = false
usage = [
String
, String
]
commands = [
Command
, Command
]
async run(data){
}
} This would be a bit easier to work with, but defining sane defaults becomes a bit more difficult. It would really require the end user to know quite a bit about the internals and have to manually re-use them. |
Beta Was this translation helpful? Give feedback.
-
Configuration being a global thing is kind of difficult. I think this would be better initialized from // package.json
{
"name": 'a-cli'
, "version": "0.0.1"
, "seeli": {
"color": "blue"
, "name": "whizbang"
, "exitOnContent": false
, "stream": 1
}
} This would make it easy to initialize defaults at start up instead of forcing the end user to do it |
Beta Was this translation helpful? Give feedback.
-
replace inquirer with enquirer This would bring the number of dependencies down quite a bit, it only has 1. inquirer has 15 |
Beta Was this translation helpful? Give feedback.
-
Seeli is the first node package I wrote and it has accumulated a bit of cruft over the years. The way I want to use it has change over the years and some of the initial decisions on implementation are getting rather difficult to work around
console.log
make it difficult to test + stub a writable destinationIf the command runner loaded classes rather than instances, many problems would be mitigated.
This would probably be easier with class properties
Beta Was this translation helpful? Give feedback.
All reactions