Make @systemModule implicit; require @userModule for user modules

This commit is contained in:
Bryan Ashby 2017-11-30 17:15:18 -07:00
parent 22b09d8018
commit 1849d275f5
4 changed files with 58 additions and 53 deletions

View File

@ -44,11 +44,15 @@ ENiGMA 0.0.8-alpha comes with some structure changes:
* `./mods` is now reserved for actual user addon modules * `./mods` is now reserved for actual user addon modules
* Themes have been moved from `./mods/themes` to `./art/themes` * Themes have been moved from `./mods/themes` to `./art/themes`
With the change to the `./mods` directory, `@systemModule` is now implied for `module` declarations in `menu.hjson`. To use a user module in `./mods` you must specify `@userModule`!
With the above changes, you'll need to to at least: With the above changes, you'll need to to at least:
* Move your `~/.config/enigma-bbs/config.hjson` to `./config/config.hjson` or utlize the `--config` option. * Move your `~/.config/enigma-bbs/config.hjson` to `./config/config.hjson` or utlize the `--config` option.
* Move your `prompt.hjson` and `menu.hjson` (e.g. `myboardname.hjson`) to `./config` * Move your `prompt.hjson` and `menu.hjson` (e.g. `myboardname.hjson`) to `./config`
* Move any non-theme art files, and theme directories to their appropriate locations mentioned above * Move any non-theme art files, and theme directories to their appropriate locations mentioned above
* Move any module directories such as `message_post_evt` to `./mods/` * Move any module directories such as `message_post_evt` to `./mods/`
* Move any certificates, pub/private keys, etc. from `./misc` to `./config`
* Specify user modules as `@userModule:my_module_name`
# 0.0.6-alpha to 0.0.7-alpha # 0.0.6-alpha to 0.0.7-alpha
No issues No issues

View File

@ -220,7 +220,7 @@
} }
newUserApplication: { newUserApplication: {
module: @systemModule:nua module: nua
art: NUA art: NUA
options: { options: {
menuFlags: [ "noHistory" ] menuFlags: [ "noHistory" ]
@ -341,7 +341,7 @@
// Canceling this form logs off vs falling back to matrix // Canceling this form logs off vs falling back to matrix
// //
newUserApplicationSsh: { newUserApplicationSsh: {
module: @systemModule:nua module: nua
art: NUA art: NUA
fallback: logoff fallback: logoff
options: { options: {
@ -445,7 +445,7 @@
newUserFeedbackToSysOp: { newUserFeedbackToSysOp: {
desc: Feedback to SysOp desc: Feedback to SysOp
module: @systemModule:msg_area_post_fse module: msg_area_post_fse
next: [ next: [
{ {
acs: AS2 acs: AS2
@ -579,7 +579,7 @@
fullLoginSequenceLastCallers: { fullLoginSequenceLastCallers: {
desc: Last Callers desc: Last Callers
module: @systemModule:last_callers module: last_callers
art: LASTCALL art: LASTCALL
options: { options: {
pause: true pause: true
@ -589,7 +589,7 @@
} }
fullLoginSequenceWhosOnline: { fullLoginSequenceWhosOnline: {
desc: Who's Online desc: Who's Online
module: @systemModule:whos_online module: whos_online
art: WHOSON art: WHOSON
options: { pause: true } options: { pause: true }
next: fullLoginSequenceOnelinerz next: fullLoginSequenceOnelinerz
@ -597,7 +597,7 @@
fullLoginSequenceOnelinerz: { fullLoginSequenceOnelinerz: {
desc: Viewing Onelinerz desc: Viewing Onelinerz
module: @systemModule:onelinerz module: onelinerz
next: [ next: [
{ {
// calls >= 2 // calls >= 2
@ -709,7 +709,7 @@
fullLoginSequenceNewScan: { fullLoginSequenceNewScan: {
desc: Performing New Scan desc: Performing New Scan
module: @systemModule:new_scan module: new_scan
art: NEWSCAN art: NEWSCAN
next: fullLoginSequenceSysStats next: fullLoginSequenceSysStats
config: { config: {
@ -732,7 +732,7 @@
newScanMessageList: { newScanMessageList: {
desc: New Messages desc: New Messages
module: @systemModule:msg_list module: msg_list
art: NEWMSGS art: NEWMSGS
config: { config: {
menuViewPost: messageAreaViewPost menuViewPost: messageAreaViewPost
@ -772,7 +772,7 @@
} }
newScanFileBaseList: { newScanFileBaseList: {
module: @systemModule:file_area_list module: file_area_list
desc: New Files desc: New Files
config: { config: {
art: { art: {
@ -1019,14 +1019,14 @@
mainMenuLastCallers: { mainMenuLastCallers: {
desc: Last Callers desc: Last Callers
module: @systemModule:last_callers module: last_callers
art: LASTCALL art: LASTCALL
options: { pause: true } options: { pause: true }
} }
mainMenuWhosOnline: { mainMenuWhosOnline: {
desc: Who's Online desc: Who's Online
module: @systemModule:whos_online module: whos_online
art: WHOSON art: WHOSON
options: { pause: true } options: { pause: true }
} }
@ -1045,7 +1045,7 @@
mainMenuUserList: { mainMenuUserList: {
desc: User Listing desc: User Listing
module: @systemModule:user_list module: user_list
art: USERLST art: USERLST
form: { form: {
0: { 0: {
@ -1066,7 +1066,7 @@
} }
mainMenuUserConfig: { mainMenuUserConfig: {
module: @systemModule:user_config module: user_config
art: CONFSCR art: CONFSCR
form: { form: {
0: { 0: {
@ -1157,7 +1157,7 @@
mainMenuGlobalNewScan: { mainMenuGlobalNewScan: {
desc: Performing New Scan desc: Performing New Scan
module: @systemModule:new_scan module: new_scan
art: NEWSCAN art: NEWSCAN
config: { config: {
messageListMenu: newScanMessageList messageListMenu: newScanMessageList
@ -1166,7 +1166,7 @@
mainMenuFeedbackToSysOp: { mainMenuFeedbackToSysOp: {
desc: Feedback to SysOp desc: Feedback to SysOp
module: @systemModule:msg_area_post_fse module: msg_area_post_fse
config: { config: {
art: { art: {
header: MSGEHDR header: MSGEHDR
@ -1286,7 +1286,7 @@
mainMenuOnelinerz: { mainMenuOnelinerz: {
desc: Viewing Onelinerz desc: Viewing Onelinerz
module: @systemModule:onelinerz module: onelinerz
options: { options: {
cls: true cls: true
} }
@ -1372,7 +1372,7 @@
mainMenuRumorz: { mainMenuRumorz: {
desc: Rumorz desc: Rumorz
module: @systemModule:rumorz module: rumorz
options: { options: {
cls: true cls: true
} }
@ -1458,7 +1458,7 @@
ercClient: { ercClient: {
art: erc art: erc
module: @systemModule:erc_client module: erc_client
config: { config: {
host: localhost host: localhost
port: 5001 port: 5001
@ -1510,7 +1510,7 @@
bbsList: { bbsList: {
desc: Viewing BBS List desc: Viewing BBS List
module: @systemModule:bbs_list module: bbs_list
options: { options: {
cls: true cls: true
} }
@ -1661,7 +1661,7 @@
// //
doorPimpWars: { doorPimpWars: {
desc: Playing PimpWars desc: Playing PimpWars
module: @systemModule:abracadabra module: abracadabra
config: { config: {
name: PimpWars name: PimpWars
dropFileType: DORINFO dropFileType: DORINFO
@ -1684,7 +1684,7 @@
// //
doorTradeWars2002BBSLink: { doorTradeWars2002BBSLink: {
desc: Playing TW 2002 (BBSLink) desc: Playing TW 2002 (BBSLink)
module: @systemModule:bbs_link module: bbs_link
config: { config: {
sysCode: XXXXXXXX sysCode: XXXXXXXX
authCode: XXXXXXXX authCode: XXXXXXXX
@ -1696,7 +1696,7 @@
// DoorParty! support. You'll need to register to obtain credentials // DoorParty! support. You'll need to register to obtain credentials
doorParty: { doorParty: {
desc: Using DoorParty! desc: Using DoorParty!
module: @systemModule:door_party module: door_party
config: { config: {
username: XXXXXXXX username: XXXXXXXX
password: XXXXXXXX password: XXXXXXXX
@ -1707,7 +1707,7 @@
// CombatNet support. You'll need to register at http://combatnet.us/ to obtain credentials // CombatNet support. You'll need to register at http://combatnet.us/ to obtain credentials
combatNet: { combatNet: {
desc: Using CombatNet desc: Using CombatNet
module: @systemModule:combatnet module: combatnet
config: { config: {
bbsTag: CBNxxx bbsTag: CBNxxx
password: XXXXXXXXX password: XXXXXXXXX
@ -1716,7 +1716,7 @@
telnetBridgeAgency: { telnetBridgeAgency: {
desc: Connected to HappyLand BBS desc: Connected to HappyLand BBS
module: @systemModule:telnet_bridge module: telnet_bridge
config: { config: {
host: agency.bbs.geek.nz host: agency.bbs.geek.nz
} }
@ -1779,7 +1779,7 @@
messageAreaChangeCurrentConference: { messageAreaChangeCurrentConference: {
art: CCHANGE art: CCHANGE
module: @systemModule:msg_conf_list module: msg_conf_list
form: { form: {
0: { 0: {
mci: { mci: {
@ -1810,7 +1810,7 @@
messageAreaChangeCurrentArea: { messageAreaChangeCurrentArea: {
// :TODO: rename this art to ACHANGE // :TODO: rename this art to ACHANGE
art: CHANGE art: CHANGE
module: @systemModule:msg_area_list module: msg_area_list
form: { form: {
0: { 0: {
mci: { mci: {
@ -1839,7 +1839,7 @@
} }
messageAreaMessageList: { messageAreaMessageList: {
module: @systemModule:msg_list module: msg_list
art: MSGLIST art: MSGLIST
config: { config: {
menuViewPost: messageAreaViewPost menuViewPost: messageAreaViewPost
@ -1875,7 +1875,7 @@
} }
messageAreaViewPost: { messageAreaViewPost: {
module: @systemModule:msg_area_view_fse module: msg_area_view_fse
config: { config: {
art: { art: {
header: MSGVHDR header: MSGVHDR
@ -1991,7 +1991,7 @@
} }
messageAreaReplyPost: { messageAreaReplyPost: {
module: @systemModule:msg_area_post_fse module: msg_area_post_fse
config: { config: {
art: { art: {
header: MSGEHDR header: MSGEHDR
@ -2150,7 +2150,7 @@
// :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu // :TODO: messageAreaSelect (change msg areas -> call @systemMethod -> fallback to menu
messageAreaNewPost: { messageAreaNewPost: {
desc: Posting message, desc: Posting message,
module: @systemModule:msg_area_post_fse module: msg_area_post_fse
config: { config: {
art: { art: {
header: MSGEHDR header: MSGEHDR
@ -2306,7 +2306,7 @@
mailMenuCreateMessage: { mailMenuCreateMessage: {
desc: Mailing Someone desc: Mailing Someone
module: @systemModule:msg_area_post_fse module: msg_area_post_fse
config: { config: {
art: { art: {
header: MSGEHDR header: MSGEHDR
@ -2423,7 +2423,7 @@
} }
mailMenuInbox: { mailMenuInbox: {
module: @systemModule:msg_list module: msg_list
art: MSGLIST art: MSGLIST
config: { config: {
menuViewPost: messageAreaViewPost menuViewPost: messageAreaViewPost
@ -2501,7 +2501,7 @@
} }
fileBaseListEntries: { fileBaseListEntries: {
module: @systemModule:file_area_list module: file_area_list
desc: Browsing Files desc: Browsing Files
config: { config: {
art: { art: {
@ -2669,7 +2669,7 @@
fileBaseBrowseByAreaSelect: { fileBaseBrowseByAreaSelect: {
desc: Browsing File Areas desc: Browsing File Areas
module: @systemModule:file_base_area_select module: file_base_area_select
art: FAREASEL art: FAREASEL
form: { form: {
0: { 0: {
@ -2725,7 +2725,7 @@
} }
fileBaseSearch: { fileBaseSearch: {
module: @systemModule:file_base_search module: file_base_search
desc: Searching Files desc: Searching Files
art: FSEARCH art: FSEARCH
form: { form: {
@ -2799,7 +2799,7 @@
fileAreaFilterEditor: { fileAreaFilterEditor: {
desc: File Filter Editor desc: File Filter Editor
module: @systemModule:file_area_filter_edit module: file_area_filter_edit
art: FFILEDT art: FFILEDT
form: { form: {
0: { 0: {
@ -2889,7 +2889,7 @@
fileBaseDownloadManager: { fileBaseDownloadManager: {
desc: Download Manager desc: Download Manager
module: @systemModule:file_base_download_manager module: file_base_download_manager
config: { config: {
art: { art: {
queueManager: FDLMGR queueManager: FDLMGR
@ -2950,7 +2950,7 @@
fileBaseWebDownloadManager: { fileBaseWebDownloadManager: {
desc: Web D/L Manager desc: Web D/L Manager
module: @systemModule:file_base_web_download_manager module: file_base_web_download_manager
config: { config: {
art: { art: {
queueManager: FWDLMGR queueManager: FWDLMGR
@ -3017,7 +3017,7 @@
fileTransferProtocolSelection: { fileTransferProtocolSelection: {
desc: Protocol selection desc: Protocol selection
module: @systemModule:file_transfer_protocol_select module: file_transfer_protocol_select
art: FPROSEL art: FPROSEL
form: { form: {
0: { 0: {
@ -3049,7 +3049,7 @@
fileBaseUploadFiles: { fileBaseUploadFiles: {
desc: Uploading desc: Uploading
module: @systemModule:upload module: upload
config: { config: {
art: { art: {
options: ULOPTS options: ULOPTS
@ -3187,7 +3187,7 @@
sendFilesToUser: { sendFilesToUser: {
desc: Downloading desc: Downloading
module: @systemModule:file_transfer module: file_transfer
config: { config: {
// defaults - generally use extraArgs // defaults - generally use extraArgs
protocol: zmodem8kSexyz protocol: zmodem8kSexyz
@ -3197,7 +3197,7 @@
recvFilesFromUser: { recvFilesFromUser: {
desc: Uploading desc: Uploading
module: @systemModule:file_transfer module: file_transfer
config: { config: {
// defaults - generally use extraArgs // defaults - generally use extraArgs
protocol: zmodem8kSexyz protocol: zmodem8kSexyz
@ -3569,7 +3569,7 @@
"art" : "test.ans" "art" : "test.ans"
}, },
"demoFullScreenEditor" : { "demoFullScreenEditor" : {
"module" : "@systemModule:fse", "module" : "fse",
"config" : { "config" : {
"editorType" : "netMail", "editorType" : "netMail",
"art" : { "art" : {

View File

@ -21,7 +21,7 @@ const ALL_ASSETS = [
'art', 'art',
'menu', 'menu',
'method', 'method',
'module', 'userModule',
'systemMethod', 'systemMethod',
'systemModule', 'systemModule',
'prompt', 'prompt',
@ -58,12 +58,12 @@ function getAssetWithShorthand(spec, defaultType) {
assert(_.isString(asset.type)); assert(_.isString(asset.type));
return asset; return asset;
} else { }
return { return {
type : defaultType, type : defaultType,
asset : spec, asset : spec,
}; };
}
} }
function getArtAsset(spec) { function getArtAsset(spec) {
@ -78,13 +78,14 @@ function getArtAsset(spec) {
} }
function getModuleAsset(spec) { function getModuleAsset(spec) {
const asset = getAssetWithShorthand(spec, 'module'); const asset = getAssetWithShorthand(spec, 'systemModule');
if(!asset) { if(!asset) {
return null; return null;
} }
assert( ['module', 'systemModule' ].indexOf(asset.type) > -1); assert( ['userModule', 'systemModule' ].includes(asset.type) );
return asset; return asset;
} }

View File

@ -183,7 +183,7 @@ The module `door_party` provides native support for [DoorParty!](http://www.thro
```hjson ```hjson
doorParty: { doorParty: {
desc: Using DoorParty! desc: Using DoorParty!
module: @systemModule:door_party module: door_party
config: { config: {
username: XXXXXXXX username: XXXXXXXX
password: XXXXXXXX password: XXXXXXXX
@ -200,7 +200,7 @@ The `combatnet` module provides native support for [CombatNet](http://combatnet.
````hjson ````hjson
combatNet: { combatNet: {
desc: Using CombatNet desc: Using CombatNet
module: @systemModule:combatnet module: combatnet
config: { config: {
bbsTag: CBNxxx bbsTag: CBNxxx
password: XXXXXXXXX password: XXXXXXXXX