bajo 2.10.0 → 2.11.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/class/app/log.js CHANGED
@@ -258,7 +258,7 @@ class Log {
258
258
  /**
259
259
  * Dispose internal references
260
260
  */
261
- dispose = () => {
261
+ dispose = async () => {
262
262
  this.app = null
263
263
  }
264
264
  }
package/class/app.js CHANGED
@@ -328,6 +328,7 @@ class App {
328
328
 
329
329
  _prepTrans = (ns, text, params) => {
330
330
  const { fallback, supported } = this.bajo.config.intl
331
+ const { isSet } = this.lib.aneka
331
332
  if (!text) {
332
333
  text = ns
333
334
  ns = 'bajo'
@@ -349,13 +350,13 @@ class App {
349
350
  for (const p of plugins) {
350
351
  const store = get(this, `${p}.intl.${lang}`, {})
351
352
  trans = get(store, text)
352
- if (trans) break
353
+ if (isSet(trans)) break
353
354
  }
354
- if (!trans) {
355
+ if (!isSet(trans)) {
355
356
  for (const p of plugins) {
356
357
  const store = get(this, `${p}.intl.${fallback}`, {})
357
358
  trans = get(store, text)
358
- if (trans) break
359
+ if (isSet(trans)) break
359
360
  }
360
361
  }
361
362
  return { ns, text, lang, params, plugins, trans }
@@ -380,9 +381,9 @@ class App {
380
381
  * @returns {string}
381
382
  */
382
383
  t = (ns, text, ...params) => {
383
- const { formatText } = this.lib.aneka
384
+ const { formatText, isSet } = this.lib.aneka
384
385
  let { text: newText, trans, params: args } = this._prepTrans(ns, text, params)
385
- if (!trans) trans = newText
386
+ if (!isSet(trans)) trans = newText
386
387
  return formatText(trans, ...args)
387
388
  }
388
389
 
package/class/bajo.js CHANGED
@@ -907,7 +907,7 @@ class Bajo extends Plugin {
907
907
  return parseObject(JSON.parse(resp))
908
908
  }
909
909
 
910
- fromJs = async (file, options = {}) => {
910
+ async fromJs (file, options = {}) {
911
911
  const args = options.args ?? []
912
912
  let mod = await importModule(file)
913
913
  if (isFunction(mod)) mod = await mod.call(this, ...args)
package/class/base.js CHANGED
@@ -94,14 +94,14 @@ class Base extends Plugin {
94
94
  * @async
95
95
  */
96
96
  exit = async () => {
97
- this.dispose()
97
+ await this.dispose()
98
98
  }
99
99
 
100
100
  /**
101
101
  * Dispose internal references
102
102
  */
103
- dispose = () => {
104
- super.dispose()
103
+ dispose = async () => {
104
+ await super.dispose()
105
105
  this.state = null
106
106
  }
107
107
  }
@@ -33,7 +33,7 @@ class Tools {
33
33
  /**
34
34
  * Dispose internal references
35
35
  */
36
- dispose () {
36
+ dispose = async () => {
37
37
  this.app = null
38
38
  this.plugin = null
39
39
  }
package/class/plugin.js CHANGED
@@ -189,7 +189,7 @@ class Plugin {
189
189
  /**
190
190
  * Dispose internal references
191
191
  */
192
- dispose = () => {
192
+ dispose = async () => {
193
193
  this.app = null
194
194
  this.config = null
195
195
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "The ultimate framework for whipping up massive apps in no time",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/wiki/CHANGES.md CHANGED
@@ -1,10 +1,16 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-04-07
4
+
5
+ - [2.11.0] Change ```dispose()``` to be an async function
6
+ - [2.11.0] Bug fix in ```_prepTrans()```
7
+
3
8
  ## 2026-03-30
4
9
 
5
10
  - [2.10.0] Add ability to pass options of ```configHandlers``` with type ```.js```
6
11
  - [2.10.0] Freezing config object now occurs ```{ns}:afterStart()```
7
- - [2.10.0] Bug fix on ```print.fatal()``` when argument is an Error object
12
+ - [2.10.0] Bug fix in ```print.fatal()``` when argument is an Error object
13
+ - [2.10.1] Bug fix in ```fromJs()```
8
14
 
9
15
  ## 2026-03-25
10
16
 
@@ -38,30 +44,30 @@
38
44
 
39
45
  ## 2026-02-26
40
46
 
41
- - [2.6.2] Bug fix on ```getMethod()```
47
+ - [2.6.2] Bug fix in ```getMethod()```
42
48
 
43
49
  ## 2026-02-23
44
50
 
45
- - [2.6.1] Bug fix on ```readConfig()```
46
- - [2.6.1] Bug fix on ```base.loadConfig()```
51
+ - [2.6.1] Bug fix in ```readConfig()```
52
+ - [2.6.1] Bug fix in ```base.loadConfig()```
47
53
 
48
54
  ## 2026-02-20
49
55
 
50
56
  - [2.6.0] Upgrade to ```aneka@0.12.0```
51
57
  - [2.6.0] Add ```te()```
52
- - [2.6.0] Bug fix on ```formatErrorDetails()``` in ```Err``` class
58
+ - [2.6.0] Bug fix in ```formatErrorDetails()``` in ```Err``` class
53
59
 
54
60
  ## 2026-02-08
55
61
 
56
- - [2.5.0] Bug fix on handling log for ```error``` level
62
+ - [2.5.0] Bug fix in handling log for ```error``` level
57
63
  - [2.5.0] Add ```log.getErrorMessage()``` to get the right value of error message
58
64
  - [2.5.0] Add ```timeZone``` in config for datetime data type
59
65
 
60
66
  ## 2026-01-29
61
67
 
62
68
  - [2.4.0] Hooks can now be added through ```config``` object. This is specially usefull if you provide a custom config object on app boot
63
- - [2.4.1] Bug fix on ```runHook()``` resolver. Source defaults to ```main``` if not provided. Scope defaults to ```bajo``` if not found/initialized yet
64
- - [2.4.2] Bug fix on getting wrongly parsed ```env``` value
69
+ - [2.4.1] Bug fix in ```runHook()``` resolver. Source defaults to ```main``` if not provided. Scope defaults to ```bajo``` if not found/initialized yet
70
+ - [2.4.2] Bug fix in getting wrongly parsed ```env``` value
65
71
 
66
72
  ## 2026-01-24
67
73
 
@@ -69,18 +75,18 @@
69
75
 
70
76
  ## 2026-01-21
71
77
 
72
- - [2.3.1] Bug fix on keys that needs to be used while reading plugin's config files
78
+ - [2.3.1] Bug fix in keys that needs to be used while reading plugin's config files
73
79
 
74
80
  ## 2026-01-18
75
81
 
76
82
  - [2.3.0] ```App``` constructor now accept an object as its parameter. For details, please see documentation
77
83
  - [2.3.0] Package upgrade to ```aneka@0.11.0```
78
- - [2.3.0] Bug fix on ```checkDependencies()```
84
+ - [2.3.0] Bug fix in ```checkDependencies()```
79
85
 
80
86
  ## 2026-01-16
81
87
 
82
- - [2.2.1] Bug fix on multiple appearance of loaded plugins info
83
- - [2.2.1] Bug fix on ```app.lib.parseObject()``` wrapper
88
+ - [2.2.1] Bug fix in multiple appearance of loaded plugins info
89
+ - [2.2.1] Bug fix in ```app.lib.parseObject()``` wrapper
84
90
 
85
91
  ## 2026-01-11
86
92