bajo 2.10.1 → 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/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.1",
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,11 +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
8
- - [2.10.1] Bug fix on ```fromJs()```
12
+ - [2.10.0] Bug fix in ```print.fatal()``` when argument is an Error object
13
+ - [2.10.1] Bug fix in ```fromJs()```
9
14
 
10
15
  ## 2026-03-25
11
16
 
@@ -39,30 +44,30 @@
39
44
 
40
45
  ## 2026-02-26
41
46
 
42
- - [2.6.2] Bug fix on ```getMethod()```
47
+ - [2.6.2] Bug fix in ```getMethod()```
43
48
 
44
49
  ## 2026-02-23
45
50
 
46
- - [2.6.1] Bug fix on ```readConfig()```
47
- - [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()```
48
53
 
49
54
  ## 2026-02-20
50
55
 
51
56
  - [2.6.0] Upgrade to ```aneka@0.12.0```
52
57
  - [2.6.0] Add ```te()```
53
- - [2.6.0] Bug fix on ```formatErrorDetails()``` in ```Err``` class
58
+ - [2.6.0] Bug fix in ```formatErrorDetails()``` in ```Err``` class
54
59
 
55
60
  ## 2026-02-08
56
61
 
57
- - [2.5.0] Bug fix on handling log for ```error``` level
62
+ - [2.5.0] Bug fix in handling log for ```error``` level
58
63
  - [2.5.0] Add ```log.getErrorMessage()``` to get the right value of error message
59
64
  - [2.5.0] Add ```timeZone``` in config for datetime data type
60
65
 
61
66
  ## 2026-01-29
62
67
 
63
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
64
- - [2.4.1] Bug fix on ```runHook()``` resolver. Source defaults to ```main``` if not provided. Scope defaults to ```bajo``` if not found/initialized yet
65
- - [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
66
71
 
67
72
  ## 2026-01-24
68
73
 
@@ -70,18 +75,18 @@
70
75
 
71
76
  ## 2026-01-21
72
77
 
73
- - [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
74
79
 
75
80
  ## 2026-01-18
76
81
 
77
82
  - [2.3.0] ```App``` constructor now accept an object as its parameter. For details, please see documentation
78
83
  - [2.3.0] Package upgrade to ```aneka@0.11.0```
79
- - [2.3.0] Bug fix on ```checkDependencies()```
84
+ - [2.3.0] Bug fix in ```checkDependencies()```
80
85
 
81
86
  ## 2026-01-16
82
87
 
83
- - [2.2.1] Bug fix on multiple appearance of loaded plugins info
84
- - [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
85
90
 
86
91
  ## 2026-01-11
87
92