bajo 2.22.0 → 2.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsdoc.conf.json +2 -1
- package/class/app.js +220 -107
- package/class/bajo.js +258 -177
- package/class/base.js +85 -24
- package/class/cache.js +8 -16
- package/class/err.js +31 -10
- package/class/log.js +46 -38
- package/class/plugin.js +53 -30
- package/class/print.js +18 -15
- package/class/tools.js +6 -5
- package/docs/App.html +51 -1
- package/docs/Bajo.html +1 -1
- package/docs/Base.html +34 -1
- package/docs/Cache.html +1 -1
- package/docs/Err.html +2 -2
- package/docs/Log.html +2 -2
- package/docs/Main.html +3 -0
- package/docs/Plugin.html +1 -1
- package/docs/Print.html +1 -1
- package/docs/Tools.html +1 -1
- package/docs/class_app.js.html +222 -109
- package/docs/class_bajo.js.html +260 -179
- package/docs/class_base.js.html +87 -26
- package/docs/class_cache.js.html +10 -18
- package/docs/class_err.js.html +33 -12
- package/docs/class_log.js.html +48 -40
- package/docs/class_plugin.js.html +55 -32
- package/docs/class_print.js.html +20 -17
- package/docs/class_tools.js.html +8 -7
- package/docs/data/search.json +1 -1
- package/docs/extend_bajo_hook.js.html +289 -0
- package/docs/global.html +22 -1
- package/docs/index.html +1 -1
- package/docs/index.js.html +53 -16
- package/docs/lib_applet-hook.js.html +328 -0
- package/docs/lib_config.js.html +167 -0
- package/docs/lib_helper.js.html +186 -192
- package/docs/module-Applet.html +3 -0
- package/docs/module-Helper-Main.html +3 -0
- package/docs/module-Helper.html +1 -8
- package/docs/module-Hook.html +1 -1
- package/docs/tutorial-01_WELCOME.html +3 -0
- package/docs/tutorial-02_GETTING_STARTED.html +125 -0
- package/docs/tutorial-03_USER_GUIDE.html +54 -0
- package/docs/tutorial-04_DEV_GUIDE.html +178 -0
- package/docs/tutorial-05_ECOSYSTEM.html +3 -0
- package/extend/bajo/intl/en-US.json +2 -1
- package/extend/bajo/intl/id.json +2 -1
- package/index.js +51 -14
- package/lib/applet-hook.js +325 -0
- package/lib/config.js +164 -0
- package/lib/helper.js +184 -190
- package/package.json +6 -2
- package/test/00-global-hooks.test.js +44 -0
- package/test/e2e/_run.js +19 -0
- package/test/e2e/e2e-applet-process.test.js +66 -0
- package/test/e2e/e2e-boot-process.test.js +62 -0
- package/test/e2e/e2e-hooks-process.test.js +68 -0
- package/test/integration/_setup.js +55 -0
- package/test/integration/aspect-01-boot-instance.test.js +24 -0
- package/test/integration/aspect-02-plugin-loading.test.js +24 -0
- package/test/integration/aspect-03-config-merge.test.js +27 -0
- package/test/integration/aspect-04-intl-loading.test.js +29 -0
- package/test/integration/aspect-05-cache-roundtrip.test.js +26 -0
- package/test/integration/aspect-06-log-file-save.test.js +28 -0
- package/test/integration/aspect-07-plugin-data-dir.test.js +25 -0
- package/test/integration/aspect-08-plugin-lookup.test.js +25 -0
- package/test/integration/aspect-09-config-formats.test.js +26 -0
- package/test/integration/aspect-10-hooks.test.js +38 -0
- package/test/unit/app.test.js +115 -0
- package/test/unit/applet-hook.test.js +10 -0
- package/test/unit/bajo.test.js +151 -0
- package/test/unit/base.test.js +90 -0
- package/test/unit/cache.test.js +89 -0
- package/test/unit/config.test.js +14 -0
- package/test/unit/err.test.js +57 -0
- package/test/unit/helper.test.js +116 -0
- package/test/unit/index.test.js +40 -0
- package/test/unit/log.test.js +84 -0
- package/test/unit/plugin.test.js +95 -0
- package/test/unit/print.test.js +72 -0
- package/test/unit/tools.test.js +29 -0
- package/wiki/CHANGES.md +9 -0
- package/wiki/tutorials/01_WELCOME.md +18 -0
- package/wiki/tutorials/02_GETTING_STARTED.md +366 -0
- package/wiki/tutorials/03_USER_GUIDE.md +262 -0
- package/wiki/tutorials/04_DEV_GUIDE.md +386 -0
- package/wiki/tutorials/05_ECOSYSTEM.md +95 -0
- package/wiki/tutorials/tutorials.json +17 -0
- package/lib/hook.js +0 -228
- package/test/app.test.js +0 -183
- package/test/bajo.test.js +0 -124
- package/test/base.test.js +0 -75
- package/test/cache.test.js +0 -94
- package/test/e2e.test.js +0 -137
- package/test/err.test.js +0 -73
- package/test/helper.test.js +0 -39
- package/test/import-module.test.js +0 -138
- package/test/integration.test.js +0 -218
- package/test/log.test.js +0 -119
- package/test/plugin.test.js +0 -116
- package/test/print.test.js +0 -100
- package/test/tools.test.js +0 -38
- package/wiki/CONFIG.md +0 -36
- package/wiki/DEV_GUIDE.md +0 -3
- package/wiki/ECOSYSTEM.md +0 -93
- package/wiki/GETTING-STARTED.md +0 -356
- package/wiki/USER-GUIDE.md +0 -256
package/test/log.test.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/* global describe, it, beforeEach, afterEach */
|
|
2
|
-
|
|
3
|
-
import os from 'node:os'
|
|
4
|
-
import path from 'node:path'
|
|
5
|
-
import { expect } from 'chai'
|
|
6
|
-
import fs from 'fs-extra'
|
|
7
|
-
import dayjs from 'dayjs'
|
|
8
|
-
|
|
9
|
-
import Log from '../class/log.js'
|
|
10
|
-
|
|
11
|
-
const createTempRoot = () => fs.mkdtempSync(path.join(os.tmpdir(), 'bajo-log-test-'))
|
|
12
|
-
|
|
13
|
-
describe('Log', () => {
|
|
14
|
-
let root
|
|
15
|
-
let app
|
|
16
|
-
let log
|
|
17
|
-
|
|
18
|
-
beforeEach(() => {
|
|
19
|
-
root = createTempRoot()
|
|
20
|
-
app = {
|
|
21
|
-
runAt: new Date(),
|
|
22
|
-
t: (prefix, text, ...args) => `${prefix}:${text}:${args.join('|')}`,
|
|
23
|
-
lib: {
|
|
24
|
-
fs,
|
|
25
|
-
dayjs,
|
|
26
|
-
_: {
|
|
27
|
-
isEmpty: (v) => v == null || v === '' || (typeof v === 'object' && Object.keys(v).length === 0),
|
|
28
|
-
merge: (a, b) => Object.assign(a, b),
|
|
29
|
-
without: (arr, item) => arr.filter(i => i !== item)
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
bajo: {
|
|
33
|
-
dir: { data: root },
|
|
34
|
-
config: {
|
|
35
|
-
env: 'dev',
|
|
36
|
-
log: {
|
|
37
|
-
level: 'trace',
|
|
38
|
-
save: false,
|
|
39
|
-
pretty: false,
|
|
40
|
-
useUtc: false,
|
|
41
|
-
timeTaken: false,
|
|
42
|
-
dateFormat: 'YYYY-MM-DD',
|
|
43
|
-
rotation: { cycle: 'none', byPlugin: false }
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
isLogInRange: () => true
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
afterEach(() => {
|
|
52
|
-
if (root) fs.rmSync(root, { recursive: true, force: true })
|
|
53
|
-
})
|
|
54
|
-
|
|
55
|
-
it('formats and prints messages in dev mode', () => {
|
|
56
|
-
const originalLog = console.log
|
|
57
|
-
const lines = []
|
|
58
|
-
console.log = (line) => lines.push(line)
|
|
59
|
-
log = new Log(app)
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
log.info('main', 'hello %s', 'x')
|
|
63
|
-
} finally {
|
|
64
|
-
console.log = originalLog
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
expect(lines.length).to.equal(1)
|
|
68
|
-
expect(lines[0]).to.include('[INFO]')
|
|
69
|
-
expect(lines[0]).to.include('[main]')
|
|
70
|
-
expect(lines[0]).to.include('main:hello %s:x')
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
it('returns error message fallback by code/statusCode', () => {
|
|
74
|
-
log = new Log(app)
|
|
75
|
-
|
|
76
|
-
expect(log.getErrorMessage(new Error('x'))).to.equal('x')
|
|
77
|
-
expect(log.getErrorMessage({ message: '', code: 'E1' })).to.equal('E1')
|
|
78
|
-
expect(log.getErrorMessage({ message: '', statusCode: 404 })).to.equal(404)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
it('builds rotation patterns and saves file', () => {
|
|
82
|
-
app.bajo.config.log.save = true
|
|
83
|
-
log = new Log(app)
|
|
84
|
-
app.bajo.config.log.rotation.cycle = 'daily'
|
|
85
|
-
|
|
86
|
-
const pattern = log.getRotationPattern()
|
|
87
|
-
log.save('\u001b[31mhello\u001b[0m', 'x')
|
|
88
|
-
|
|
89
|
-
expect(pattern).to.be.a('string')
|
|
90
|
-
expect(fs.existsSync(path.join(root, 'log', `bajo.${pattern}.log`))).to.equal(true)
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
it('supports prod json output', () => {
|
|
94
|
-
app.bajo.config.env = 'prod'
|
|
95
|
-
log = new Log(app)
|
|
96
|
-
const originalLog = console.log
|
|
97
|
-
const lines = []
|
|
98
|
-
console.log = (line) => lines.push(line)
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
log.warn('core', { id: 1 }, 'hi')
|
|
102
|
-
} finally {
|
|
103
|
-
console.log = originalLog
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const payload = JSON.parse(lines[0])
|
|
107
|
-
expect(payload.prefix).to.equal('core')
|
|
108
|
-
expect(payload.level).to.be.a('number')
|
|
109
|
-
expect(payload).to.have.property('data')
|
|
110
|
-
})
|
|
111
|
-
|
|
112
|
-
it('disposes app reference', async () => {
|
|
113
|
-
log = new Log(app)
|
|
114
|
-
|
|
115
|
-
await log.dispose()
|
|
116
|
-
|
|
117
|
-
expect(log.app).to.equal(null)
|
|
118
|
-
})
|
|
119
|
-
})
|
package/test/plugin.test.js
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/* global describe, it, beforeEach */
|
|
2
|
-
|
|
3
|
-
import os from 'node:os'
|
|
4
|
-
import path from 'node:path'
|
|
5
|
-
import { expect } from 'chai'
|
|
6
|
-
import fs from 'fs-extra'
|
|
7
|
-
import lodash from 'lodash'
|
|
8
|
-
|
|
9
|
-
import Plugin from '../class/plugin.js'
|
|
10
|
-
|
|
11
|
-
const createTempRoot = () => fs.mkdtempSync(path.join(os.tmpdir(), 'bajo-plugin-test-'))
|
|
12
|
-
|
|
13
|
-
describe('Plugin', () => {
|
|
14
|
-
let app
|
|
15
|
-
|
|
16
|
-
beforeEach(() => {
|
|
17
|
-
const calls = []
|
|
18
|
-
app = {
|
|
19
|
-
lib: {
|
|
20
|
-
_: lodash,
|
|
21
|
-
fs
|
|
22
|
-
},
|
|
23
|
-
log: {
|
|
24
|
-
trace: (...args) => calls.push(['trace', ...args]),
|
|
25
|
-
debug: (...args) => calls.push(['debug', ...args]),
|
|
26
|
-
info: (...args) => calls.push(['info', ...args]),
|
|
27
|
-
warn: (...args) => calls.push(['warn', ...args]),
|
|
28
|
-
error: (...args) => calls.push(['error', ...args]),
|
|
29
|
-
fatal: (...args) => calls.push(['fatal', ...args]),
|
|
30
|
-
silent: (...args) => calls.push(['silent', ...args])
|
|
31
|
-
},
|
|
32
|
-
t: (ns, text, ...params) => `${ns}:${text}:${params.join('|')}`,
|
|
33
|
-
te: (ns, text) => `${ns}:${text}`,
|
|
34
|
-
dump: (...args) => calls.push(['dump', ...args]),
|
|
35
|
-
_calls: calls
|
|
36
|
-
}
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
it('initializes namespace and prefixed log shortcuts', () => {
|
|
40
|
-
const plugin = new Plugin('my-plugin', app)
|
|
41
|
-
|
|
42
|
-
plugin.log.info('hello')
|
|
43
|
-
|
|
44
|
-
expect(plugin.ns).to.equal('myPlugin')
|
|
45
|
-
expect(app._calls[0]).to.deep.equal(['info', 'myPlugin', 'hello'])
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
it('reads package info and selected keys', async () => {
|
|
49
|
-
const root = createTempRoot()
|
|
50
|
-
const pkgDir = path.join(root, 'plugin')
|
|
51
|
-
await fs.ensureDir(pkgDir)
|
|
52
|
-
await fs.writeJson(path.join(pkgDir, 'package.json'), {
|
|
53
|
-
name: 'my-plugin',
|
|
54
|
-
version: '1.2.3',
|
|
55
|
-
private: true
|
|
56
|
-
})
|
|
57
|
-
const plugin = new Plugin('my-plugin', app)
|
|
58
|
-
plugin.dir = { pkg: pkgDir }
|
|
59
|
-
|
|
60
|
-
expect(plugin.getPkgInfo()).to.deep.equal({
|
|
61
|
-
name: 'my-plugin',
|
|
62
|
-
version: '1.2.3'
|
|
63
|
-
})
|
|
64
|
-
expect(plugin.getPkgInfo(pkgDir, [])).to.include({ private: true })
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
it('returns config value with clone and omit support', () => {
|
|
68
|
-
const plugin = new Plugin('my-plugin', app)
|
|
69
|
-
plugin.config = { a: { b: 1, c: 2 } }
|
|
70
|
-
|
|
71
|
-
const val = plugin.getConfig('a', { omit: ['c'] })
|
|
72
|
-
val.b = 99
|
|
73
|
-
|
|
74
|
-
expect(val).to.deep.equal({ b: 99 })
|
|
75
|
-
expect(plugin.config.a.b).to.equal(1)
|
|
76
|
-
expect(plugin.getConfig('missing', { defValue: { x: 1 } })).to.deep.equal({ x: 1 })
|
|
77
|
-
expect(plugin.getConfig('a', { noClone: true })).to.equal(plugin.config.a)
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
it('returns native Error when print is unavailable', () => {
|
|
81
|
-
const plugin = new Plugin('my-plugin', app)
|
|
82
|
-
|
|
83
|
-
const err = plugin.error('plain error')
|
|
84
|
-
const fatalErr = plugin.fatal('fatal error')
|
|
85
|
-
|
|
86
|
-
expect(err).to.be.instanceOf(Error)
|
|
87
|
-
expect(err.message).to.equal('plain error')
|
|
88
|
-
expect(fatalErr).to.be.instanceOf(Error)
|
|
89
|
-
})
|
|
90
|
-
|
|
91
|
-
it('delegates translation and dump to app', () => {
|
|
92
|
-
const plugin = new Plugin('my-plugin', app)
|
|
93
|
-
|
|
94
|
-
expect(plugin.t('hello', 'x')).to.equal('myPlugin:hello:x')
|
|
95
|
-
expect(plugin.te('hello')).to.equal('myPlugin:hello')
|
|
96
|
-
plugin.dump(1, 2)
|
|
97
|
-
|
|
98
|
-
expect(app._calls[0]).to.deep.equal(['dump', 1, 2])
|
|
99
|
-
})
|
|
100
|
-
|
|
101
|
-
it('binds methods and disposes references', async () => {
|
|
102
|
-
const plugin = new Plugin('my-plugin', app)
|
|
103
|
-
plugin.value = 42
|
|
104
|
-
plugin.read = function () {
|
|
105
|
-
return this.value
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
plugin.selfBind('read')
|
|
109
|
-
const reader = plugin.read
|
|
110
|
-
await plugin.dispose()
|
|
111
|
-
|
|
112
|
-
expect(reader()).to.equal(42)
|
|
113
|
-
expect(plugin.app).to.equal(null)
|
|
114
|
-
expect(plugin.config).to.equal(null)
|
|
115
|
-
})
|
|
116
|
-
})
|
package/test/print.test.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
/* global describe, it, beforeEach */
|
|
2
|
-
|
|
3
|
-
import { expect } from 'chai'
|
|
4
|
-
import dayjs from 'dayjs'
|
|
5
|
-
|
|
6
|
-
import Print from '../class/print.js'
|
|
7
|
-
|
|
8
|
-
describe('Print', () => {
|
|
9
|
-
let plugin
|
|
10
|
-
let print
|
|
11
|
-
|
|
12
|
-
beforeEach(() => {
|
|
13
|
-
plugin = {
|
|
14
|
-
app: {
|
|
15
|
-
applet: false,
|
|
16
|
-
exit: () => {},
|
|
17
|
-
lib: { dayjs },
|
|
18
|
-
bajo: {
|
|
19
|
-
config: {
|
|
20
|
-
silent: false,
|
|
21
|
-
counter: false,
|
|
22
|
-
datetime: false
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
t: (text, ...args) => `${text}:${args.join('|')}`
|
|
27
|
-
}
|
|
28
|
-
print = new Print(plugin)
|
|
29
|
-
print.ora = {
|
|
30
|
-
text: '',
|
|
31
|
-
startCalled: false,
|
|
32
|
-
stopCalled: false,
|
|
33
|
-
start () { this.startCalled = true },
|
|
34
|
-
stop () { this.stopCalled = true },
|
|
35
|
-
succeedCalled: false,
|
|
36
|
-
succeed () { this.succeedCalled = true },
|
|
37
|
-
failCalled: false,
|
|
38
|
-
fail () { this.failCalled = true },
|
|
39
|
-
warnCalled: false,
|
|
40
|
-
warn () { this.warnCalled = true },
|
|
41
|
-
infoCalled: false,
|
|
42
|
-
info () { this.infoCalled = true },
|
|
43
|
-
clearCalled: false,
|
|
44
|
-
clear () { this.clearCalled = true },
|
|
45
|
-
renderCalled: false,
|
|
46
|
-
render () { this.renderCalled = true }
|
|
47
|
-
}
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
it('builds translated text with optional prefixes', () => {
|
|
51
|
-
print.options.showCounter = true
|
|
52
|
-
|
|
53
|
-
const text = print.buildText('hello')
|
|
54
|
-
|
|
55
|
-
expect(text).to.include('hello:')
|
|
56
|
-
expect(text).to.match(/\[\d\d:/)
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
it('starts and stops spinner', () => {
|
|
60
|
-
print.start('start')
|
|
61
|
-
print.stop()
|
|
62
|
-
|
|
63
|
-
expect(print.ora.startCalled).to.equal(true)
|
|
64
|
-
expect(print.ora.stopCalled).to.equal(true)
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
it('uses succeed/fail/warn/info/clear/render chainable methods', () => {
|
|
68
|
-
expect(print.succeed('ok')).to.equal(print)
|
|
69
|
-
expect(print.fail('x')).to.equal(print)
|
|
70
|
-
expect(print.warn('w')).to.equal(print)
|
|
71
|
-
expect(print.info('i')).to.equal(print)
|
|
72
|
-
expect(print.clear()).to.equal(print)
|
|
73
|
-
expect(print.render()).to.equal(print)
|
|
74
|
-
|
|
75
|
-
expect(print.ora.succeedCalled).to.equal(true)
|
|
76
|
-
expect(print.ora.failCalled).to.equal(true)
|
|
77
|
-
expect(print.ora.warnCalled).to.equal(true)
|
|
78
|
-
expect(print.ora.infoCalled).to.equal(true)
|
|
79
|
-
expect(print.ora.clearCalled).to.equal(true)
|
|
80
|
-
expect(print.ora.renderCalled).to.equal(true)
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
it('fails and exits on fatal', () => {
|
|
84
|
-
let exited = false
|
|
85
|
-
plugin.app.exit = () => { exited = true }
|
|
86
|
-
|
|
87
|
-
print.fatal('boom')
|
|
88
|
-
|
|
89
|
-
expect(print.ora.failCalled).to.equal(true)
|
|
90
|
-
expect(exited).to.equal(true)
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
it('creates a new spinner sharing start time', () => {
|
|
94
|
-
const spin = print.spinner()
|
|
95
|
-
|
|
96
|
-
expect(spin).to.be.instanceOf(Print)
|
|
97
|
-
expect(spin).to.not.equal(print)
|
|
98
|
-
expect(spin.startTime.valueOf()).to.equal(print.startTime.valueOf())
|
|
99
|
-
})
|
|
100
|
-
})
|
package/test/tools.test.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/* global describe, it */
|
|
2
|
-
|
|
3
|
-
import { expect } from 'chai'
|
|
4
|
-
|
|
5
|
-
import Tools from '../class/tools.js'
|
|
6
|
-
|
|
7
|
-
describe('Tools', () => {
|
|
8
|
-
it('stores plugin and app references', () => {
|
|
9
|
-
const plugin = { app: { name: 'app' } }
|
|
10
|
-
const tools = new Tools(plugin)
|
|
11
|
-
|
|
12
|
-
expect(tools.plugin).to.equal(plugin)
|
|
13
|
-
expect(tools.app).to.equal(plugin.app)
|
|
14
|
-
})
|
|
15
|
-
|
|
16
|
-
it('binds methods to self', () => {
|
|
17
|
-
const plugin = { app: {} }
|
|
18
|
-
const tools = new Tools(plugin)
|
|
19
|
-
tools.value = 7
|
|
20
|
-
tools.read = function () {
|
|
21
|
-
return this.value
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
tools.selfBind(['read'])
|
|
25
|
-
const rebound = tools.read
|
|
26
|
-
|
|
27
|
-
expect(rebound()).to.equal(7)
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
it('disposes references', async () => {
|
|
31
|
-
const tools = new Tools({ app: {} })
|
|
32
|
-
|
|
33
|
-
await tools.dispose()
|
|
34
|
-
|
|
35
|
-
expect(tools.app).to.equal(null)
|
|
36
|
-
expect(tools.plugin).to.equal(null)
|
|
37
|
-
})
|
|
38
|
-
})
|
package/wiki/CONFIG.md
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
# Config Object
|
|
2
|
-
|
|
3
|
-
The following table shows the default app settings. To change these to suit your needs, please refer to [Getting Started](GETTING-STARTED.md)
|
|
4
|
-
|
|
5
|
-
| Key Name | Type | Default | Description |
|
|
6
|
-
| ------- | ---- | ----- | ----------- |
|
|
7
|
-
| ```log``` | ```object``` | | |
|
|
8
|
-
| ```dateFormat``` | ```string``` | ```YYYY-MM-DDTHH:MM:ss.SSS[Z]```| See [dayjs string & format](https://day.js.org/docs/en/parse/string-format) for more info |
|
|
9
|
-
| ```timeTaken``` | ```boolean``` | ```false```| Show time taken from previous activity in ms |
|
|
10
|
-
| ```useUtc``` | ```boolean``` | ```false```| Use UTC, defaults: local date/time |
|
|
11
|
-
| ```pretty``` | ```boolean``` | ```false```| Colorful, pretty styling |
|
|
12
|
-
| ```applet``` | ```boolean``` | ```false```| Show log even in applet mode |
|
|
13
|
-
| ```save``` | ```boolean``` | ```false```| Save log in '{dataDir}/log' |
|
|
14
|
-
| ```rotation``` | ```object``` | | Log rotation config if ```save``` is true |
|
|
15
|
-
| ```cycle``` | ```string``` | ```none``` | Available values: ```none```, ```daily```, ```weekly```, ```monthly``` |
|
|
16
|
-
| ```compressOld``` | ```boolean``` | ```false``` | Set to ```true``` to compress old logs |
|
|
17
|
-
| ```byPlugin``` | ```boolean``` | ```false``` | Split log by plugin's name |
|
|
18
|
-
| ```retain``` | ```integer``` | ```5``` | How many old logs will be kept/retained |
|
|
19
|
-
| ```lang``` | ```string``` | Auto detected | Valid language code e.g: 'en-US', 'id', etc. |
|
|
20
|
-
| ```intl``` | ```object``` | | Internationalization settings |
|
|
21
|
-
| ```supported``` | ```array``` | ```['en-US', 'id']``` | Supported languages |
|
|
22
|
-
| ```fallback``` | ```string``` | ```en-US``` | Language to use if the selected one isn't valid |
|
|
23
|
-
| ```format``` | ```object``` | | |
|
|
24
|
-
| ```emptyValue``` | ```string``` | ```''``` | Value to use if value is ```null``` or ```undefined``` |
|
|
25
|
-
| ```datetime``` | ```object``` | ```{ dateStyle: 'medium', timeStyle: 'short' }``` | See [this link](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat) for more info |
|
|
26
|
-
| ```date``` | ```object``` | ```{ dateStyle: 'medium' }``` | See above |
|
|
27
|
-
| ```time``` | ```object``` | ```{ dateStyle: 'short' }``` | See above |
|
|
28
|
-
| ```float``` | ```object``` | ```{ maximumFractionDigits: 2 }``` | See above |
|
|
29
|
-
| ```double``` | ```object``` | ```{ maximumFractionDigits: 5 }``` | See above |
|
|
30
|
-
| ```smallint``` | ```object``` | ```{}``` | See above |
|
|
31
|
-
| ```integer``` | ```object``` | ```{}``` | See above |
|
|
32
|
-
| ```unitSys``` | ```object``` | | Add new language if necessary. If not specified, value defaults to ```metric```. Accepted values: ```imperial```, ```metric```, ```nautical``` |
|
|
33
|
-
| ```en-US``` | ```string``` | ```imperial``` | |
|
|
34
|
-
| ```id``` | ```string``` | ```metric``` | |
|
|
35
|
-
| ```exitHandler``` | ```boolean``` | ```true``` | If ```false```, no graceful shutdown |
|
|
36
|
-
| ```env``` | ```string``` | ```dev``` | Acceptable values: ```dev```, or ```prod``` |
|
package/wiki/DEV_GUIDE.md
DELETED
package/wiki/ECOSYSTEM.md
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
# Ecosystem
|
|
2
|
-
|
|
3
|
-
## Plugins
|
|
4
|
-
|
|
5
|
-
| Package | Docs | NS | Alias | Description |
|
|
6
|
-
| ------- | ---- | -- | ----- | ----------- |
|
|
7
|
-
| [bajo-cache](https://github.com/ardhi/bajo-cache) | [Docs](https://ardhi.github.io/bajo-cache) | bajoCache | cache | Universal Cache |
|
|
8
|
-
| [bajo-cli](https://github.com/ardhi/bajo-cli) | [Docs](https://ardhi.github.io/bajo-cli) | bajoCli | cli | Command Line Tools |
|
|
9
|
-
| [bajo-common-db](https://github.com/ardhi/bajo-common-db) | [Docs](https://ardhi.github.io/bajo-common-db) | bajoCommonDb | cdb | Common Database |
|
|
10
|
-
| [bajo-config](https://github.com/ardhi/bajo-config) | [Docs](https://ardhi.github.io/bajo-config) | bajoConfig | cdb | YAML & TOML Support |
|
|
11
|
-
| [bajo-cron](https://github.com/ardhi/bajo-cron) | [Docs](https://ardhi.github.io/bajo-cron) | bajoCron | cron | Cron Support |
|
|
12
|
-
| [bajo-extra](https://github.com/ardhi/bajo-extra) | [Docs](https://ardhi.github.io/bajo-extra) | bajoExtra | extra | Extra Booster! |
|
|
13
|
-
| [bajo-logger](https://github.com/ardhi/bajo-logger) | [Docs](https://ardhi.github.io/bajo-logger) | bajoLogger | log | Pino Logger |
|
|
14
|
-
| [bajo-markdown](https://github.com/ardhi/bajo-markdown) | [Docs](https://ardhi.github.io/bajo-markdown) | bajoMarkdown | md | Markdown Support |
|
|
15
|
-
| [bajo-queue](https://github.com/ardhi/bajo-queue) | [Docs](https://ardhi.github.io/bajo-queue) | bajoQueue | q | Queue System |
|
|
16
|
-
| [bajo-spatial](https://github.com/ardhi/bajo-spatial) | [Docs](https://ardhi.github.io/bajo-spatial) | bajoSpatial | spatial | Spatial Support |
|
|
17
|
-
| [bajo-sysinfo](https://github.com/ardhi/bajo-sysinfo) | [Docs](https://ardhi.github.io/bajo-sysinfo) | bajoSysinfo | si | System Information |
|
|
18
|
-
| [bajo-template](https://github.com/ardhi/bajo-template) | [Docs](https://ardhi.github.io/bajo-template) | bajoTemplate | tpl | Template System |
|
|
19
|
-
|
|
20
|
-
## Dobo DBMS Plugins
|
|
21
|
-
|
|
22
|
-
| Package | Docs | NS | Alias | Description |
|
|
23
|
-
| ------- | ---- | -- | ----- | ----------- |
|
|
24
|
-
| [dobo](https://github.com/ardhi/dobo) | [Docs](https://ardhi.github.io/dobo) | dobo | db | Dobo DBMS |
|
|
25
|
-
| [dobo-extra](https://github.com/ardhi/dobo-extra) | [Docs](https://ardhi.github.io/dobo-extra) | doboExtra | dbx | Dobo Extra Tools/Utility |
|
|
26
|
-
| [dobo-couchdb](https://github.com/ardhi/dobo-couchdb) | [Docs](https://ardhi.github.io/dobo-couchdb) | doboCouchdb | dbcouch | CouchDB Driver |
|
|
27
|
-
| [dobo-elasticsearch](https://github.com/ardhi/dobo-elasticsearch) | [Docs](https://ardhi.github.io/dobo-elasticsearch) | doboElasticsearch | dbes | Elasticsearch Driver |
|
|
28
|
-
| [dobo-knex](https://github.com/ardhi/dobo-knex) | [Docs](https://ardhi.github.io/dobo-knex) | doboKnex | dbknex | Knex/SQL Driver |
|
|
29
|
-
| [dobo-mongodb](https://github.com/ardhi/dobo-mongodb) | [Docs](https://ardhi.github.io/dobo-mongodb) | doboMongodb | dbmongo | MongoDB Driver |
|
|
30
|
-
| [dobo-redis](https://github.com/ardhi/dobo-redis) | [Docs](https://ardhi.github.io/dobo-redis) | doboRedis | dbredis | Redis Driver |
|
|
31
|
-
| [dobo-restproxy](https://github.com/ardhi/dobo-restproxy) | [Docs](https://ardhi.github.io/dobo-restproxy) | doboRestproxy | dbrpx | Restproxy Driver |
|
|
32
|
-
| [dobo-restproxy-jsonserver](https://github.com/ardhi/dobo-restproxy-jsonserver) | [Docs](https://ardhi.github.io/dobo-restproxy-jsonserver) | doboResporoxyJsonserver | dbrpxjs |JsonServer Support for doboRestproxy |
|
|
33
|
-
| [dobo-restproxy-ndut](https://github.com/ardhi/dobo-restproxy-ndut) | [Docs](https://ardhi.github.io/dobo-restproxy-ndut) | doboRestproxyNdut | dbrpxndut | NDUT Support for doboRestproxy |
|
|
34
|
-
|
|
35
|
-
## Waibu Web Framework Plugins
|
|
36
|
-
|
|
37
|
-
| Package | Docs | NS | Alias | Description |
|
|
38
|
-
| ------- | ---- | -- | ----- | ----------- |
|
|
39
|
-
| [waibu](https://github.com/ardhi/waibu) | [Docs](https://ardhi.github.io/waibu) | waibu | w |Waibu Web Framework |
|
|
40
|
-
| [waibu-admin](https://github.com/ardhi/waibu-admin) | [Docs](https://ardhi.github.io/waibu-admin) | waibuAdmin | wa | Waibu Admin |
|
|
41
|
-
| [waibu-alpinejs](https://github.com/ardhi/waibu-alpinejs) | [Docs](https://ardhi.github.io/waibu-alpinejs) | waibuAlpinejs | walp | Alpine.js Support |
|
|
42
|
-
| [waibu-blu](https://github.com/ardhi/waibu-blu) | [Docs](https://ardhi.github.io/waibu-blu) | waibuBlu | wblu | Blu theme |
|
|
43
|
-
| [waibu-bootstrap](https://github.com/ardhi/waibu-bootstrap) | [Docs](https://ardhi.github.io/waibu-bootstrap) | waibuBootstrap | wbs | Bootstrap Support |
|
|
44
|
-
| [waibu-bootstrap-icons](https://github.com/ardhi/waibu-bootstrap-icons) | [Docs](https://ardhi.github.io/waibu-bootstrap-icons) | waibuBootstrapIcons | wbsi | Bootstrap Icons Support |
|
|
45
|
-
| [waibu-bootswatch](https://github.com/ardhi/waibu-bootswatch) | [Docs](https://ardhi.github.io/waibu-bootswatch) | waibuBootswatch | wbw | Bootswatch Support |
|
|
46
|
-
| [waibu-db](https://github.com/ardhi/waibu-db) | [Docs](https://ardhi.github.io/waibu-db) | waibuDb | wdb | Database helper |
|
|
47
|
-
| [waibu-extra](https://github.com/ardhi/waibu-extra) | [Docs](https://ardhi.github.io/waibu-extra) | waibuExtra | wx | Most used 3rd party libs |
|
|
48
|
-
| [waibu-maps](https://github.com/ardhi/waibu-maps) | [Docs](https://ardhi.github.io/waibu-maps) | waibuMaps | wmaps | Maps Support |
|
|
49
|
-
| [waibu-mpa](https://github.com/ardhi/waibu-mpa) | [Docs](https://ardhi.github.io/waibu-mpa) | waibuMpa | wmpa | Multi pages app |
|
|
50
|
-
| [waibu-phosphor](https://github.com/ardhi/waibu-phosphor) | [Docs](https://ardhi.github.io/waibu-phosphor) | waibuPhosphor | wpp | Phosphoricons Support |
|
|
51
|
-
| [waibu-rest-api](https://github.com/ardhi/waibu-rest-api) | [Docs](https://ardhi.github.io/waibu-rest-api) | waibuRestApi | wra | Rest API |
|
|
52
|
-
| [waibu-static](https://github.com/ardhi/waibu-static) | [Docs](https://ardhi.github.io/waibu-static) | waibuStatic | wstatic | Static asset |
|
|
53
|
-
| [waibu-swagger](https://github.com/ardhi/waibu-swagger) | [Docs](https://ardhi.github.io/waibu-swagger) | waibuSwagger | wswagger | Rest API Documentation |
|
|
54
|
-
|
|
55
|
-
## Masohi Messaging Plugins
|
|
56
|
-
|
|
57
|
-
| Package | Docs | NS | Alias | Description |
|
|
58
|
-
| ------- | ---- | -- | ----- | ----------- |
|
|
59
|
-
| [masohi](https://github.com/ardhi/masohi) | [Docs](https://ardhi.github.io/masohi) | masohi | masohi | Masohi Messaging |
|
|
60
|
-
| [masohi-codec](https://github.com/ardhi/masohi-codec) | [Docs](https://ardhi.github.io/masohi-codec) | masohiCodec | codec | Codec |
|
|
61
|
-
| [masohi-codec-ais](https://github.com/ardhi/masohi-codec-ais) | [Docs](https://ardhi.github.io/masohi-codec-ais) | masohiCodecAis | codec-ais | AIS Codec |
|
|
62
|
-
| [masohi-mail](https://github.com/ardhi/masohi-mail) | [Docs](https://ardhi.github.io/masohi-mail) | masohiMail | mail | Mail Connector |
|
|
63
|
-
| [masohi-mqtt](https://github.com/ardhi/masohi-mqtt) | [Docs](https://ardhi.github.io/masohi-mqtt) | masohiMqtt | mqtt | MQTT Connector |
|
|
64
|
-
| [masohi-serialport](https://github.com/ardhi/masohi-serialport) | [Docs](https://ardhi.github.io/masohi-serialport) | masohiSerialport | sp | Serialport Connector |
|
|
65
|
-
| [masohi-socket.io](https://github.com/ardhi/masohi-socket.io) | [Docs](https://ardhi.github.io/masohi-socket.io) | masohiSocketIo | sio | Socket.io Connector |
|
|
66
|
-
|
|
67
|
-
## Sumba Biz Suite Plugins
|
|
68
|
-
|
|
69
|
-
| Package | Docs | NS | Alias | Description |
|
|
70
|
-
| ------- | ---- | -- | ----- | ----------- |
|
|
71
|
-
| [sumba](https://github.com/ardhi/sumba) | [Docs](https://ardhi.github.io/sumba) | sumba | sumba | Sumba Biz Suite |
|
|
72
|
-
| [sumba-cms](https://github.com/ardhi/sumba-cms) | [Docs](https://ardhi.github.io/sumba-cms) | sumbaCms | cms | Sumba CMS |
|
|
73
|
-
| [sumba-geonames](https://github.com/ardhi/sumba-geonames) | [Docs](https://ardhi.github.io/sumba-geonames) | sumbaGeonames | geonames | Sumba Geonames |
|
|
74
|
-
| [sumba-nominatim](https://github.com/ardhi/sumba-nominatim) | [Docs](https://ardhi.github.io/sumba-nominatim) | sumbaNominatim | nominatim | Sumba OSM Nominatim |
|
|
75
|
-
| [sumba-oauth](https://github.com/ardhi/sumba-oauth) | [Docs](https://ardhi.github.io/sumba-oauth) | sumbaOauth | oauth | Sumba OAuth Providers |
|
|
76
|
-
|
|
77
|
-
## Sumba Biz Suite Premium Plugins
|
|
78
|
-
|
|
79
|
-
| Package | Docs | NS | Alias | Description |
|
|
80
|
-
| ------- | ---- | -- | ----- | ----------- |
|
|
81
|
-
| [@sumba/geofence](https://bajo.app/premium-plugins/sumba-geofence) | [Docs](https://ardhi.github.io/sumba-geofence) | sumbaGeofence | geofence | Sumba Geofence |
|
|
82
|
-
| [@sumba/maps](https://bajo.app/premium-plugins/sumba-maps) | [Docs](https://ardhi.github.io/sumba-maps) | sumbaMaps | smaps | Sumba Maps |
|
|
83
|
-
| [@sumba/proxy](https://bajo.app/premium-plugins/sumba-proxy) | [Docs](https://ardhi.github.io/sumba-proxy) | sumbaProxy | proxy | Sumba Proxy: Cache any web resources locally |
|
|
84
|
-
| [@sumba/seatrack](https://bajo.app/premium-plugins/sumba-seatrack) | [Docs](https://ardhi.github.io/sumba-seatrack) | sumbaSeatrack | seatrack | Sumba Seatrack: AIS tracking |
|
|
85
|
-
| [@sumba/seatrack-global](https://bajo.app/premium-plugins/sumba-seatrack-global) | [Docs](https://ardhi.github.io/sumba-seatrack-global) | sumbaSeatrackGlobal | seatrack-global | Sumba Seatrack Global: AIS tracking by Rappid Datahub |
|
|
86
|
-
| [@sumba/seatrack-vts](https://bajo.app/premium-plugins/sumba-seatrack-vts) | [Docs](https://ardhi.github.io/sumba-seatrack-vts) | sumbaSeatrackVts | seatrack-vts | Sumba Seatrack VTS: VTS Support for Sumba Seatrack |
|
|
87
|
-
| [@sumba/seatrack-wpi](https://bajo.app/premium-plugins/sumba-seatrack-wpi) | [Docs](https://ardhi.github.io/sumba-seatrack-wpi) | sumbaSeatrackWpi | seatrack-wpi | Sumba Seatrack WPI: WPI Support for Sumba Seatrack |
|
|
88
|
-
| [@sumba/skytrack](https://bajo.app/premium-plugins/sumba-skytrack) | [Docs](https://ardhi.github.io/sumba-skytrack) | sumbaSkytrack | skytrack | Sumba Skytrack: ADSB tracking |
|
|
89
|
-
| [@sumba/skytrack-global](https://bajo.app/premium-plugins/sumba-skytrack-global) | [Docs](https://ardhi.github.io/sumba-skytrack-global) | sumbaSkytrackGlobal | skytrack-global | Sumba Skytrack: ADSB tracking by Rappid Datahub |
|
|
90
|
-
| [@sumba/store](https://bajo.app/premium-plugins/sumba-store) | [Docs](https://ardhi.github.io/sumba-store) | sumbaStore | store | Sumba Store: E-Commerce & online stores |
|
|
91
|
-
| [@sumba/subscription](https://bajo.app/premium-plugins/sumba-subscription) | [Docs](https://ardhi.github.io/sumba-subscription) | sumbaSubscription | subs | Sumba Subscription: Member subscriptions |
|
|
92
|
-
| [@sumba/weather](https://bajo.app/premium-plugins/sumba-weather) | [Docs](https://ardhi.github.io/sumba-weather) | sumbaWeather | weather | Sumba Weather by Rappid Datahub |
|
|
93
|
-
| [@sumba/webstat](https://bajo.app/premium-plugins/sumba-webstat) | [Docs](https://ardhi.github.io/sumba-webstat) | sumbaWebstat | webstat | Sumba Web Statistic |
|