smartlift-cli
v1.0.10
Published
commandline tool for managing the smartlift application
Downloads
13
Readme
SmartLift CLI
Commandline tool for managing the smartlift application
This project uses JavaScript Standard Style.
care that 'node_modules' excludes itself each file .... ||
build commandline tool
->
Path of the current executeable:
/home/autarc/.nvm/versions/io.js/v2.3.0/lib/node_modules/smartlift-cli
ERROR in ./src/main.js Module parse failed: /home/autarc/.nvm/versions/io.js/v2.3.0/lib/node_modules/smartlift-cli/src/main.js Line 9: Unexpected token You may need an appropriate loader to handle this file type. | */ | | import Configstore from 'configstore' | import updateNotifier from 'update-notifier' |
-> ignores as in node modules directiy
1.) Only regular depencies get installed after a package is loaded -> devDependencies not -> include everthing required during the runtime
2.) carefull about building something in the /node_modules/ folder, as pattern can therefore also include even the basic files ... (therfore include directly the '/bin')
3.) dont re-build on the client side, as path etc. differ and can't be controlled, ship with an executable and merely modify it for the enviornment !
optional dependencies "rf-release": "^0.4.0"
"rf-release": "^0.4.0"
setup steps for
The commandline tool to manage and run the SmartLift application. It helps to setup the environment by handling the (core) modules and runtime.
// message.push('Update available: ' + chalk.green.bold(notifier.update.latest) + chalk.gray(' (current: ' + notifier.update.current + ')')) // message.push('Run ' + chalk.magenta('npm install -g ' + pkg.name) + ' to update.'); // console.log(yosay(message.join(' '), {maxLength: stringLength(message[0])}));
// https://github.com/Automattic/cli-table
Currently the different configurations in the build scripts are not optimized for production but can be modified later !
- add explanation on each step whats happening, so the user sees the progress better ...
for now allowing to set the credentials in there -> or should the server self use his crdentials ? -> shoudl e enoughn as the lift is limited !
think about a better configuration, setting systems -> each module should add itself, provide configuration by itself -> creating the general overview ?!
check option for presets - using the settings confoguration tof fogure out which module to install
next steps:
-> create basic server ! -> create basic electron
-> creaete basic client ! -> split modules
-> for simplicty now, create new repository ....
.... module for the smartlift application
using the same structure for easier orientation
Commands:
- toggle for enable/disable a module ?
to checK:
npm scopes
https://docs.npmjs.com/misc/scope
Commmon settings defined: { ROOT_DIRECTORY: '', SERVER_PORT: '' GITLAB_TOKEN: '' }
TODO:
- talk with andre about gitlab/token exchange, best experience so far () ...
smartlift stop, stops the currently running process smartlift update (name) - updates modules Smartlift install name@
convention over configuration
-> using the smartlift name dependency to handle further requirements -> if a build step is required, define alias using npm run build
-> don't store settings/configurations if not required -> the complete listing etc. happens during the runtime, doesn't take to long in most csaes
Definin a new commands follows:
action(params, cli, smartlift)
// share store settings between applications, e.g. port
Basic approaches:
- using a global 'Configstore' (key: smartlift) to access settings a cross different applications -> stored in the system configuration directory
https://github.com/ryanflorence/rf-release https://github.com/ryanflorence/rf-changelog
Usae Cases
- setup a local smartlift instance to run
- load existing modules to run
- create a new module which can be easily integrated
as the server hooks up the script -> no additional built step is required, althought could be refenreced too if wishesd ...
http://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm
// function will be invoked -> descroption adn command is sotred inside for better encapsulation !
// // // const commands = { // ['configure', 'change the settings of local smartlift instance' // // }
//
// var argv = yargs
// .usage(
// / ___| _ __ ___ __ _ _ __| |_| | (_)/ _| |_
// \___ \| '_ ' _ \ / _' | '__| __| | | | |_| __|
// ___) | | | | | | (_| | | | |_| |___| | _| |_
// |____/|_| |_| |_|\__,_|_| \__|_____|_|_| \__|
//
)
// // .demand(['w','h'])
// .argv
// this[command](params, options)
http://blog.npmjs.org/post/118810260230/building-a-simple-command-line-tool-with-npm
// console.log(argv);
// program // .version(pkg.version) // .command('configure ', 'change the settings of local smartlift instance') // // .option() // '-c, --configure ', // // .command('list', '') // // .option() // --remote || --local || filters -> else both ! // .command('start', 'runs the local smartlift application') // .parse(process.argv) //
// // // // smartlift configure || -> changes the local settings which are initially defined during the // setup process // // smartlift start || runs the smartlift applications (can us optional params for configuration) // // --dev || original runs as production, but can toggle dev mode // // smartlift list || lists all installed available modules (remotly available + // label which are installed locally) // // smartlift install || installs an existing module // smartlift uninstall || // // smartlift new || creates a new smartlift module
// // smartlift version || shows a list of all local available version // // smartlift help || shows information about tool (e.g. commands)
// help, version || default, not
// // // // // const smartlift = new SmartLift() // // // // console.log(pkg) // // // // check for updates on start // // // check if already conffigure - installed // // // // // steps: // // - define propmt, show commands available and install // // - setup basic modules for client + server + runtime (electron) // // // // bin will be generated
API
// shows
.d$b. .d$b. .d$$$$$$b. .d$$$$$$b. .d$$$$$$b. .d$b..d$$$$$$$$b. $$$$$..$$$$$.$$$$$$$$$$$b .$$$$$$$$$$$b $$$$$$$$$$b $$$$$$$$$$$$$$$P' $$$$$$$$$$$$d$$$$$$$$$$$$bd$$$$$$$$$$$$b$$$$$$$$$$$b$$$$$$$$$$$$$$$b. $$$$$$$$$$$$Q$$$$$$$$$$$$PQ$$$$$$$$$$$$P$$$$$$$$$$$P$$$$$$$$$$$$$$$P' $$$$$´`$$$$$'$$$$$$$$$$$$''$$$$$$$$$$$$'$$$$$$$$$$P $$$$$$$$$$$$$$$b. 'Q$P' 'Q$P' 'Q$$$$$$P' 'Q$$$$$$P' 'Q$$$$$$$P 'Q$P''Q$$$$$$$$P'
Version: 0.6.3 (node v2.3.0, npm 2.13.5, platform: linux)
smartlift configure || -> changes the local settings which are initially defined during the setup process
smartlift start || runs the smartlift applications (can us optional params for configuration)
--dev || original runs as production, but can toggle dev mode
smartlift list || lists all installed available modules (remotly available + label which are installed locally)
smartlift install || installs an existing module smartlift uninstall ||
smartlift new || creates a new smartlift module
smartlift version || shows a list of all local available version
smartlift help || shows information about tool (e.g. commands)
Options: -v --verbose verbose output
// just the name shows the commands, similar like --help
// directly on installation (or first time usage - lets see), defines the setup for the basic application (as only needed once)
smartlift init || setups up the basic smartlift enviroement with client/server module -> starts a procdure which guids and ask for path, credentials etc.
https://github.com/hoodiehq/hoodie
references:
hoodie-cli ember-cli
http://hood.ie/intro/#get-started
// logo- reference:
http://patorjk.com/software/taag/#p=display&f=Standard&t=SmartLift
/ | _ __ ___ __ _ _ __| || | (_)/ | |
_ | '_ _ \ / _
| '| | | | | || __|
__) | | | | | | (| | | | || || | | |
|/|| || ||_,|| _|_____||| __|