bajo 2.4.0 → 2.4.2
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.js +2 -1
- package/class/bajo.js +2 -2
- package/package.json +1 -1
- package/wiki/CHANGES.md +2 -0
package/class/app.js
CHANGED
|
@@ -6,7 +6,7 @@ import Tools from './plugin/tools.js'
|
|
|
6
6
|
|
|
7
7
|
import { outmatchNs, parseObject, lib } from './helper/app.js'
|
|
8
8
|
|
|
9
|
-
const { camelCase, isPlainObject, get, reverse, map, last, without } = lib._
|
|
9
|
+
const { camelCase, isPlainObject, get, reverse, map, last, without, set } = lib._
|
|
10
10
|
const { pascalCase } = lib.aneka
|
|
11
11
|
let unknownLangWarning = false
|
|
12
12
|
|
|
@@ -274,6 +274,7 @@ class App {
|
|
|
274
274
|
this.args = args
|
|
275
275
|
this.argv = parseObject(argv, { parseValue: true })
|
|
276
276
|
this.envVars = parseObject(parseEnv(), { parseValue: true })
|
|
277
|
+
if (get(this, 'envVars._.env') === '[object Object]') set(this, 'envVars._.env', 'dev')
|
|
277
278
|
this.applet = this.envVars._.applet ?? this.argv._.applet
|
|
278
279
|
await this.bajo.runHook('bajo:beforeBoot')
|
|
279
280
|
await this.bajo.init()
|
package/class/bajo.js
CHANGED
|
@@ -965,13 +965,13 @@ class Bajo extends Plugin {
|
|
|
965
965
|
} catch (err) {
|
|
966
966
|
return
|
|
967
967
|
}
|
|
968
|
-
let fns = filter(this.
|
|
968
|
+
let fns = filter(this.hooks, { ns, subNs, path })
|
|
969
969
|
if (isEmpty(fns)) return []
|
|
970
970
|
fns = orderBy(fns, ['level'])
|
|
971
971
|
const results = []
|
|
972
972
|
for (const i in fns) {
|
|
973
973
|
const fn = fns[i]
|
|
974
|
-
const scope = this.app[fn.src ?? 'main']
|
|
974
|
+
const scope = this.app[fn.src ?? 'main'] ?? this
|
|
975
975
|
if (fn.noWait) fn.handler.call(scope, ...args)
|
|
976
976
|
else {
|
|
977
977
|
const res = await fn.handler.call(scope, ...args)
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
## 2026-01-29
|
|
4
4
|
|
|
5
5
|
- [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
|
|
6
|
+
- [2.4.1] Bug fix on ```runHook()``` resolver. Source defaults to ```main``` if not provided. Scope defaults to ```bajo``` if not found/initialized yet
|
|
7
|
+
- [2.4.2] Bug fix on getting wrongly parsed ```env``` value
|
|
6
8
|
|
|
7
9
|
## 2026-01-24
|
|
8
10
|
|