cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2020-06-09 16:48:23 +03:00
parent 329a8b4fd5
commit f2fb2c481d
3 changed files with 36 additions and 87 deletions

View File

@ -24,76 +24,6 @@ if(typeof(process) != 'undefined'){
/*********************************************************************/
// setup logger...
// XXX STUB...
var logger = {
root: true,
message: null,
log: null,
ig: null,
emit: function(e, v){
var msg = this.message
var log = this.log = this.log || []
// XXX HACK...
var ig = this.ig
// report progress...
// XXX HACK -- need meaningful status...
if(e == 'queued'
|| e == 'found'){
ig.showProgress(msg || ['Progress', e], '+0', '+1')
} else if(e == 'loaded' || e == 'done' || e == 'written'
|| e == 'index'){
ig.showProgress(msg || ['Progress', e], '+1')
} else if(e == 'skipping' || e == 'skipped'){
// XXX if everything is skipped the indicator does not
// get hidden...
//ig.showProgress(msg || ['Progress', e], '+0', '-1')
ig.showProgress(msg || ['Progress', e], '+1')
// XXX STUB...
} else if(e == 'error' ){
ig.showProgress(['Error'].concat(msg), '+0', '+1')
console.log(msg ?
' '+ msg.join(': ') + ':'
: '', ...arguments)
} else {
// console...
console.log(msg ?
' '+ msg.join(': ') + ':'
: '', ...arguments)
}
// XXX
//log.push([msg, e, v])
},
push: function(msg){
if(msg == null){
return this
}
var logger = Object.create(this)
logger.root = false
logger.message = logger.message == null ? [msg] : logger.message.concat([msg])
logger.log = this.log = this.log || []
return logger
},
pop: function(){
return !this.__proto__.root ? this.__proto__ : this
},
}
/*********************************************************************/ /*********************************************************************/
// XXX what we need here is: // XXX what we need here is:
// - base introspection // - base introspection
@ -199,6 +129,7 @@ var CLIActions = actions.Actions({
}) })
// XXX move this to the argv parser used in object.js
var CLI = var CLI =
module.CLI = core.ImageGridFeatures.Feature({ module.CLI = core.ImageGridFeatures.Feature({
title: '', title: '',
@ -206,7 +137,8 @@ module.CLI = core.ImageGridFeatures.Feature({
tag: 'commandline', tag: 'commandline',
depends: [ depends: [
'lifecycle' 'lifecycle',
'logger',
], ],
// XXX should this be ONLY node??? // XXX should this be ONLY node???
@ -225,9 +157,6 @@ module.CLI = core.ImageGridFeatures.Feature({
function(){ function(){
var that = this var that = this
this.logger = logger
logger.ig = that
// get the arguments... // get the arguments...
if(this.runtime.nw){ if(this.runtime.nw){
var argv = nw.App.argv var argv = nw.App.argv

View File

@ -966,9 +966,9 @@
} }
}, },
"ig-object": { "ig-object": {
"version": "5.0.2", "version": "5.0.8",
"resolved": "https://registry.npmjs.org/ig-object/-/ig-object-5.0.2.tgz", "resolved": "https://registry.npmjs.org/ig-object/-/ig-object-5.0.8.tgz",
"integrity": "sha512-fRfaR11KrUMd2/2glHOmqwHwbkx9K0zwyV7H8MYn5LvWtmCfHaBA7bzWiguuG0UCQEps15/a4jbZVIopknOq0g==" "integrity": "sha512-zGY4xyotQUSjKdu5dJzZM+VCTOYUzhz0MIq3H5YCTEwfph0Lf9OP1yPcVc3rEgXb3VZlWOPrO9CI7Eor/0sqZA=="
}, },
"image-size": { "image-size": {
"version": "0.5.5", "version": "0.5.5",
@ -1088,17 +1088,17 @@
} }
}, },
"less": { "less": {
"version": "3.11.1", "version": "3.11.3",
"resolved": "https://registry.npmjs.org/less/-/less-3.11.1.tgz", "resolved": "https://registry.npmjs.org/less/-/less-3.11.3.tgz",
"integrity": "sha512-tlWX341RECuTOvoDIvtFqXsKj072hm3+9ymRBe76/mD6O5ZZecnlAOVDlWAleF2+aohFrxNidXhv2773f6kY7g==", "integrity": "sha512-VkZiTDdtNEzXA3LgjQiC3D7/ejleBPFVvq+aRI9mIj+Zhmif5TvFPM244bT4rzkvOCvJ9q4zAztok1M7Nygagw==",
"dev": true, "dev": true,
"requires": { "requires": {
"clone": "^2.1.2", "clone": "^2.1.2",
"errno": "^0.1.1", "errno": "^0.1.1",
"graceful-fs": "^4.1.2", "graceful-fs": "^4.1.2",
"image-size": "~0.5.0", "image-size": "~0.5.0",
"make-dir": "^2.1.0",
"mime": "^1.4.1", "mime": "^1.4.1",
"mkdirp": "^0.5.0",
"promise": "^7.1.1", "promise": "^7.1.1",
"request": "^2.83.0", "request": "^2.83.0",
"source-map": "~0.6.0", "source-map": "~0.6.0",
@ -1159,6 +1159,26 @@
"signal-exit": "^3.0.0" "signal-exit": "^3.0.0"
} }
}, },
"make-dir": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
"integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
"dev": true,
"optional": true,
"requires": {
"pify": "^4.0.1",
"semver": "^5.6.0"
},
"dependencies": {
"pify": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
"integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
"dev": true,
"optional": true
}
}
},
"map-obj": { "map-obj": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
@ -2277,9 +2297,9 @@
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
}, },
"v8-compile-cache": { "v8-compile-cache": {
"version": "2.1.0", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz",
"integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==" "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ=="
}, },
"validate-npm-package-license": { "validate-npm-package-license": {
"version": "3.0.4", "version": "3.0.4",

View File

@ -29,13 +29,13 @@
"guarantee-events": "^1.0.0", "guarantee-events": "^1.0.0",
"ig-actions": "^3.24.11", "ig-actions": "^3.24.11",
"ig-features": "^3.4.2", "ig-features": "^3.4.2",
"ig-object": "^5.0.2", "ig-object": "^5.0.8",
"moment": "^2.26.0", "moment": "^2.26.0",
"requirejs": "^2.3.6", "requirejs": "^2.3.6",
"requirejs-plugins": "^1.0.2", "requirejs-plugins": "^1.0.2",
"sharp": "^0.25.3", "sharp": "^0.25.3",
"strip-json-comments": "^2.0.1", "strip-json-comments": "^2.0.1",
"v8-compile-cache": "^2.1.0", "v8-compile-cache": "^2.1.1",
"wildglob": "^0.1.1" "wildglob": "^0.1.1"
}, },
"dependencies-disabled": { "dependencies-disabled": {
@ -54,7 +54,7 @@
"devDependencies": { "devDependencies": {
"asar": "^3.0.1", "asar": "^3.0.1",
"electron-rebuild": "^1.11.0", "electron-rebuild": "^1.11.0",
"less": "^3.11.1" "less": "^3.11.3"
}, },
"bin": { "bin": {
"ig": "ig.js" "ig": "ig.js"