bajo 2.14.0 → 2.14.1

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.
@@ -106,7 +106,7 @@ export default factory
106
106
  export async function buildBaseConfig () {
107
107
  // dirs
108
108
  const { defaultsDeep, textToArray, currentLoc, resolvePath } = this.app.lib.aneka
109
- this.config = defaultsDeep({}, this.app.envVars._, this.app.argv._)
109
+ this.config = defaultsDeep({}, this.app.argv._, this.app.envVars._)
110
110
  set(this, 'dir.base', this.app.dir)
111
111
  const path = currentLoc(import.meta).dir + '/../..'
112
112
  set(this, 'dir.pkg', resolvePath(path))
@@ -100,17 +100,20 @@ export async function checkDependencies () {
100
100
  */
101
101
  export async function collectHooks () {
102
102
  const { eachPlugins, runHook, isLogInRange, importModule } = this.bajo
103
- const me = this
103
+ const me = this // "this" is "app"
104
104
  me.bajo.log.trace('collecting%s', this.t('hooks'))
105
- // collects
106
105
  await eachPlugins(async function ({ dir, file }) {
107
- const _file = file.replace(dir + '/hook/', '').replace('.js', '')
108
- const [names, path] = _file.split('@')
109
- const [ns, subNs] = names.split('.').map(n => camelCase(n))
110
106
  const mod = await importModule(file, { asHandler: true })
111
107
  if (!mod) return undefined
112
- merge(mod, { ns, subNs, path: camelCase(path), src: this.ns })
113
- me.bajo.hooks.push(mod)
108
+ const _file = file.replace(dir + '/hook/', '').replace('.js', '')
109
+ let [names, path] = _file.split('@')
110
+ names = names.split('$').map(n => trim(n))
111
+ for (const name of names) {
112
+ let [ns, subNs, subSubNs] = name.split('.').map(n => camelCase(n))
113
+ if (subSubNs) subNs = `${subNs}.${subSubNs}`
114
+ const m = merge({}, mod, { ns, subNs, path: camelCase(path), src: this.ns })
115
+ me.bajo.hooks.push(m)
116
+ }
114
117
  }, { glob: 'hook/**/*.js', prefix: me.bajo.ns })
115
118
  // for log trace purpose only
116
119
  if (isLogInRange('trace')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "2.14.0",
3
+ "version": "2.14.1",
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,5 +1,10 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-05-22
4
+
5
+ - [2.14.1] Bug fix in ```helper.buildBaseConfig()```
6
+ - [2.14.1] Bug fix in ```helper.collectHooks()```
7
+
3
8
  ## 2026-05-16
4
9
 
5
10
  - [2.14.0] Add ```bajo:beforeReadConfig()``` hook