hi_score
Advanced tools
Comparing version 1.7.1 to 1.7.2
@@ -10,3 +10,3 @@ /* | ||
*/ | ||
/*global xhi, xhiJQ */ | ||
/*global xhi, xhiJQ*/ | ||
// == BEGIN MODULE xhi._02_data_ ====================================== | ||
@@ -19,4 +19,3 @@ xhi._02_data_ = ( function ( $ ) { | ||
var | ||
// Set app symbols | ||
aKey = aMap._aKey_, | ||
// Set app symbols (use aMap._aKey_ when needed here) | ||
nMap = aMap._nMap_, | ||
@@ -101,11 +100,2 @@ subName = '_02_data_', | ||
// BEGIN public method /handleNoauth/ | ||
function handleNoauth () { | ||
cancelJqxhrList(); | ||
return $.gevent[ vMap._publish_ ]( | ||
aKey + '-_data_', { '_use_str_' : '_noauth_' } | ||
); | ||
} | ||
// . END public method /handleNoauth/ | ||
// BEGIN private method /onFailJqxhr/ | ||
@@ -117,3 +107,3 @@ function onFailJqxhr ( jqxhr, status_type, error_data ) { | ||
if ( error_data === 'Unauthorized' ) { | ||
return handleNoauth(); | ||
cancelJqxhrList(); | ||
} | ||
@@ -120,0 +110,0 @@ if ( smap && smap._fail_fn_ ) { |
@@ -362,3 +362,3 @@ /* | ||
// toggleStateKeyFn( | ||
// '_is_footer_shown_', __true, [ powered_html ] | ||
// '_is_footer_shown_', __true | ||
// ); | ||
@@ -390,9 +390,12 @@ // | ||
if ( ! pub_key ) { | ||
// Do not process if publish key is undef | ||
if ( pub_key === __undef ) { | ||
return logFn( '_error_', '_state_key_not_found_', arg_state_key ); | ||
} | ||
// Handle same value requirment | ||
if ( arg_bool === '_same_' ) { | ||
solve_bool = !! current_bool; // Ensure boolean value | ||
solve_bool = !! current_bool; | ||
} | ||
// Use arg_bool if defined, otherwise toggle current | ||
else { | ||
@@ -402,9 +405,12 @@ solve_bool = utilObj._castBool_( arg_bool, ! current_bool ); | ||
// Do not update key unless value changed or force flag set | ||
// Do not update or publish unless value changed or force flag set | ||
if ( solve_bool === current_bool && ! arg_do_force ) { return; } | ||
// Set state value | ||
stateMap[ arg_state_key ] = solve_bool; | ||
// Publish associated event (do not publish if event is blank) | ||
if ( pub_key === __blank ) { return; } | ||
param_list = [ pub_key, stateMap[ arg_state_key ] ][ vMap._concat_ ]( | ||
data_list ); | ||
publishEventFn[ vMap._apply_ ]( __undef, param_list ); | ||
@@ -411,0 +417,0 @@ } |
@@ -428,35 +428,2 @@ /* | ||
}, | ||
// | ||
// This is probably redundant with shell_card_ | ||
// TODO 2017-11-29 mmikowski info - review and remove or keep | ||
// { _selector_str_ : pFn('.{_p_}-_x_box_'), | ||
// _rule_map_ : { | ||
// _border_top_ : [[ '_d1875rem_', '_solid_', '_accent_hex_' ]], | ||
// _overflow_ : '_hidden_', | ||
// _background_ : '_area_hex_', | ||
// _box_shadow_ : '_shdw_03a_', | ||
// _color_ : '_txt_hex_', | ||
// _margin_bottom_ : '_spc_rem_03_', | ||
// _clear_ : '_both_' | ||
// } | ||
// }, | ||
// { _selector_str_ : pFn('.{_p_}-_x_box_inr_' ), | ||
// _rule_map_ : { | ||
// _padding_ : [[ '_spc_rem_03_', '_1d25rem_', '_spc_rem_03_', '_1d75rem_' ]] | ||
// } | ||
// }, | ||
// { _selector_str_ : pFn('.{_p_}-_x_box_inr_ p' ), | ||
// _rule_map_ : { _margin_: [[ '_0_','_0_','_1rem_','_0_' ]] } | ||
// }, | ||
// { _selector_str_ : pFn('.{_p_}-_x_box_title_'), | ||
// _rule_map_ : { | ||
// _padding_ : [[ '_0_', '_1d25rem_', '_0_', '_1d25rem_' ]], | ||
// _font_size_ : '_spc_rem_02_', | ||
// _background_ : '_frame_hex_', | ||
// _line_height_ : '_2d5rem_', | ||
// _color_ : '_txt_hex_', | ||
// _border_bottom_ : [[ '_d0625rem_', '_solid_', '_frame_dk_hex_' ]] | ||
// } | ||
// }, | ||
// | ||
{ _selector_str_ : pFn('.{_p_}-_x_hlink_'), | ||
@@ -463,0 +430,0 @@ _rule_map_ : { _display_ : '_none_' } |
@@ -6,5 +6,12 @@ /* | ||
*/ | ||
/*global module */ | ||
/*global*/ | ||
'use strict'; | ||
// == BEGIN PUBLIC METHOD /startHttpFn/ =============================== | ||
// Purpose : Start http server | ||
// Example : xhi dev_start | ||
// Returns : | ||
// Runs ctx_obj.catchFn on failure. | ||
// Runs ctx_obj.nextFn on success. | ||
// Throws : none | ||
// | ||
function startHttpFn () { | ||
@@ -15,4 +22,4 @@ // == BEGIN MODULE SCOPE VARIABLES ================================== | ||
argStr = xhiObj.fqProjDirname + '/server/index.js', | ||
commandMap = xhiObj.commandMap, | ||
execStr = xhiObj.fqModuleDirname + '/.bin/http-server', | ||
logFn = xhiObj.logFn, | ||
@@ -23,6 +30,26 @@ prefixStr = xhiObj.makePrefixStr( commandMap ), | ||
aliasStr = commandMap.alias_str, | ||
postObj, childProcObj | ||
postObj, cleanupToid, childProcObj | ||
; | ||
// == . END MODULE SCOPE VARIABLES ================================== | ||
// == BEGIN PRIVATE METHODS ========================================= | ||
// BEGIN private method /cleanupFn/ | ||
function cleanupFn ( src_str ) { | ||
if ( ! src_str ) { | ||
logFn( prefixStr + 'No error in 2s. Server should work.' ); | ||
} | ||
else if ( cleanupToid ) { | ||
clearTimeout( cleanupToid ); | ||
cleanupToid = ''; | ||
} | ||
childProcObj.unref(); | ||
// Store success and finish | ||
stageStatusMap[ aliasStr ] = true; | ||
logFn( prefixStr + 'Success' ); | ||
xhiObj.nextFn(); | ||
} | ||
// . END pivate method /cleanupFn/ | ||
// == . END PRIVATE METHODS ========================================= | ||
// == BEGIN EVENT HANDLERS ========================================== | ||
@@ -38,12 +65,11 @@ // BEGIN event handler /onErrorFn/ | ||
// BEGIN event handler /onCleanupFn/ | ||
function onCleanupFn () { | ||
childProcObj.unref(); | ||
// Store success and finish | ||
stageStatusMap[ aliasStr ] = true; | ||
logFn( prefixStr + 'Success' ); | ||
xhiObj.nextFn(); | ||
// BEGIN event handler /onExitFn/ | ||
function onExitFn ( code ) { | ||
// Set to error handler if non-zero | ||
if ( String( code ) !== '0' ) { | ||
return onErrorFn( 'Non-zero exit' ); | ||
} | ||
cleanupFn( '_from_exit_' ); | ||
} | ||
// . END event handler /onCleanupFn/ | ||
// . END event handler /onExitFn/ | ||
@@ -59,3 +85,3 @@ // BEGIN event handler /onPsListFn/ | ||
if ( proc_list.length > 0 ) { | ||
logFn( prefixStr + ' http-server already started' ); | ||
logFn( prefixStr + ' server already started' ); | ||
logFn( prefixStr + ' (' | ||
@@ -71,3 +97,3 @@ + String( proc_list.length ) + ' processes)' | ||
childProcObj = xhiObj.makeSpawnObj( | ||
execStr, [ '--cors' ], { stdio : 'ignore', detached : true } | ||
'node', [ argStr ], { stdio : 'ignore', detached : true } | ||
); | ||
@@ -77,3 +103,6 @@ | ||
childProcObj.on( 'error', onErrorFn ); | ||
setTimeout( onCleanupFn, 1000 ); | ||
childProcObj.on( 'exit' , onExitFn ); | ||
// Add timeout | ||
cleanupToid = setTimeout( cleanupFn, 2000 ); | ||
} | ||
@@ -89,3 +118,3 @@ // . END event handler /onPsListFn/ | ||
postObj.psObj.lookup( | ||
{ command : 'node', arguments: [ execStr ] }, onPsListFn ); | ||
{ command : 'node', arguments: [ argStr ] }, onPsListFn ); | ||
} | ||
@@ -92,0 +121,0 @@ // == . END MAIN ==================================================== |
@@ -6,3 +6,3 @@ /* | ||
*/ | ||
/*global module */ | ||
/*global*/ | ||
'use strict'; | ||
@@ -23,4 +23,4 @@ // == BEGIN PUBLIC METHOD /stopHttpFn/ ================================ | ||
PromiseObj = xhiObj.PromiseObj, | ||
argStr = xhiObj.fqProjDirname + '/server/index.js', | ||
commandMap = xhiObj.commandMap, | ||
execStr = xhiObj.fqModuleDirname + '/.bin/http-server', | ||
logFn = xhiObj.logFn, | ||
@@ -86,3 +86,3 @@ prefixStr = xhiObj.makePrefixStr( commandMap ), | ||
stageStatusMap[ aliasStr ] = true; | ||
logFn( prefixStr + ' No running http-server ' ); | ||
logFn( prefixStr + ' No running server' ); | ||
logFn( prefixStr + 'Success' ); | ||
@@ -116,5 +116,5 @@ return xhiObj.nextFn(); | ||
// Look up http-server processes | ||
// Look up server processes | ||
postObj.psObj.lookup( | ||
{ command : 'node', arguments: [ execStr ] }, onPsListFn | ||
{ command : 'node', arguments: [ argStr ] }, onPsListFn | ||
); | ||
@@ -121,0 +121,0 @@ } |
@@ -13,3 +13,6 @@ { | ||
"apply-patch": "0.1.2", | ||
"coveralls": "3.0.4", | ||
"aws-sdk": "2.516.0", | ||
"azure-storage": "2.10.3", | ||
"coveralls": "3.0.6", | ||
"dotenv": "8.1.0", | ||
"diff": "4.0.1", | ||
@@ -22,3 +25,2 @@ "eslint": "6.2.1", | ||
"font-roboto": "0.0.2", | ||
"http-server": "0.11.1", | ||
"istanbul": "0.4.5", | ||
@@ -33,6 +35,6 @@ "jquery": "3.4.1", | ||
"line-by-line": "0.1.6", | ||
"mongodb": "3.2.7", | ||
"mongodb": "3.3.0", | ||
"mysql2": "1.6.5", | ||
"nodeunit": "0.11.3", | ||
"npm": "6.11.1", | ||
"npm": "6.11.2", | ||
"open-sans-fontface": "1.4.0", | ||
@@ -42,2 +44,3 @@ "powercss": "1.4.6", | ||
"rmdir": "1.2.0", | ||
"serve-index": "1.9.1", | ||
"shelljs": "0.8.3", | ||
@@ -127,3 +130,3 @@ "taffydb": "2.7.3", | ||
}, | ||
"version": "1.7.1", | ||
"version": "1.7.2", | ||
"xhi_commandTable": [ | ||
@@ -281,6 +284,6 @@ [ | ||
], | ||
"Start local HTTPS server", | ||
"Start local HTTP server", | ||
[ | ||
"Start the local HTTPS server, 'http-server' in SSL mode", | ||
"using localhost:8443. This is a wrapper around ", | ||
"Start the local HTTP server, server/index.js on port 3000.", | ||
"To serve HTTPS consider installing http-server and run", | ||
"'http-server -p8443 -SU -C config/cert.pem -K config/key.pem'.", | ||
@@ -287,0 +290,0 @@ "Use this command directly to diagnose problems.", |
@@ -32,2 +32,13 @@ ![hi_score][_0A] | ||
Version 1.7.2 enhancements: | ||
- (x) `server/index.js` Replace http-server with express server | ||
Supports .env, directory listing | ||
- (x) `package.json` Add cloud storage libs, update libs to lastest | ||
- (x) `bin/make_doc` Improve techniques used in bash utility | ||
- (x) `doc/js-code-standard.adoc` Add section on value passing to | ||
- (x) `xhi/02_data.js` Remove no-auth hack from | ||
- (x) `xhi/03_model.js` Extend event publish capability | ||
- (x) `xhi/05_02_css_base.js` Remove unused code from CSS module | ||
- (x) `lib/xhi_06`, `lib/xhi_13` Adjust to start and stop `server/index.js` | ||
--- | ||
@@ -748,2 +759,4 @@ ## Quick start | ||
2019-07-25 ongoing | ||
Version 1.7.0 enhancements: | ||
- (x) Enhance utility capabilities | ||
@@ -757,7 +770,23 @@ - (x) Replace makeDeepKeyList with more-useful makeDeepData | ||
Version 1.7.1 enhancements: | ||
- (x) Update js code standard to recent developments | ||
- (x) Fix js code standard to render correctly | ||
- (x) Update dependent library (`bin/xhi dev_upgrade`) | ||
Version 1.7.2 enhancements: | ||
- (x) `server/index.js` Replace http-server with express server | ||
Supports .env, directory listing | ||
- (x) `package.json` Add cloud storage libs, update libs to lastest | ||
- (x) `bin/make_doc` Improve techniques used in bash utility | ||
- (x) `doc/js-code-standard.adoc` Add section on value passing to | ||
- (x) `xhi/02_data.js` Remove no-auth hack from | ||
- (x) `xhi/03_model.js` Extend event publish capability | ||
- (x) `xhi/05_02_css_base.js` Remove unused code from CSS module | ||
- (x) `lib/xhi_06`, `lib/xhi_13` Adjust to start and stop `server/index.js` | ||
### Backlog | ||
- (i) Create new virtual appliance | ||
- (i) Improve CLI presentation of `bin/xhi design` reference by searching and using platform viewers | ||
- (i) Add generator to create new apps cleanly and very quickly | ||
- (i) Update tb02 libs to latest best practice (events) | ||
- (i) Example conversion of TB2 to new app | ||
- (i) Improve CLI presentation of `bin/xhi design` reference by searching and using platform viewers | ||
- (i) Update virtual appliance | ||
- (i) Add CSS => PowerCSS parser | ||
@@ -764,0 +793,0 @@ - (o) Convert SuperPack Perl to JS and use `package.json` config |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
8237916
120
14879
844
35
11