bajo 2.7.0 → 2.7.3

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/base.js CHANGED
@@ -38,7 +38,7 @@ class Base extends Plugin {
38
38
  */
39
39
  loadConfig = async () => {
40
40
  const { defaultsDeep } = this.app.lib.aneka
41
- const { get, keys, pick, isEmpty } = this.app.lib._
41
+ const { get, keys, pick, isEmpty, upperFirst } = this.app.lib._
42
42
  const { log, getModuleDir, readAllConfigs } = this.app.bajo
43
43
  const { parseObject } = this.app.lib
44
44
 
@@ -60,8 +60,7 @@ class Base extends Plugin {
60
60
  } catch (err) {}
61
61
  const cfgEnv = get(this, `app.env.${this.ns}`, {})
62
62
  const cfgArgv = get(this, `app.argv.${this.ns}`, {})
63
- const envArgv = defaultsDeep({}, cfgEnv, cfgArgv)
64
- cfg = pick(defaultsDeep({}, envArgv ?? {}, cfg ?? {}, this.config ?? {}), defKeys)
63
+ cfg = pick(defaultsDeep({}, cfgEnv ?? {}, cfgArgv ?? {}, cfg ?? {}, this[`config${upperFirst(this.app.bajo.config.env)}`] ?? {}, this.config ?? {}), defKeys)
65
64
  this.config = parseObject(cfg, { parseValue: true })
66
65
  }
67
66
 
@@ -10,9 +10,6 @@ import {
10
10
  collectHooks,
11
11
  run
12
12
  } from './base.js'
13
- import aneka from 'aneka'
14
-
15
- const { currentLoc, resolvePath } = aneka
16
13
 
17
14
  const {
18
15
  orderBy,
@@ -108,7 +105,7 @@ export default factory
108
105
  */
109
106
  export async function buildBaseConfig () {
110
107
  // dirs
111
- const { defaultsDeep } = this.app.lib.aneka
108
+ const { defaultsDeep, textToArray, currentLoc, resolvePath } = this.app.lib.aneka
112
109
  this.config = defaultsDeep({}, this.app.envVars._, this.app.argv._)
113
110
  set(this, 'dir.base', this.app.dir)
114
111
  const path = currentLoc(import.meta).dir + '/../..'
@@ -130,12 +127,7 @@ export async function buildBaseConfig () {
130
127
  if (isEmpty(pluginPkgs)) {
131
128
  const pluginsFile = `${this.dir.data}/config/.plugins`
132
129
  if (fs.existsSync(pluginsFile)) {
133
- let lines = fs.readFileSync(pluginsFile, 'utf8')
134
- lines = lines.trim().split('\n').map(p => p.trim())
135
- pluginPkgs = lines.filter(c => {
136
- const line = c.split('#')[0].trim()
137
- return !isEmpty(line)
138
- })
130
+ pluginPkgs = textToArray(fs.readFileSync(pluginsFile, 'utf8'))
139
131
  }
140
132
  }
141
133
  }
@@ -153,6 +145,7 @@ export async function buildBaseConfig () {
153
145
  * @async
154
146
  */
155
147
  export async function buildPlugins () {
148
+ const { resolvePath } = this.app.lib.aneka
156
149
  this.log.trace('buildPluginsStart')
157
150
  for (const pkg of this.app.pluginPkgs) {
158
151
  const ns = camelCase(pkg)
@@ -50,9 +50,9 @@ export async function checkNameAliases () {
50
50
  const plugin = this.bajo.app[camelCase(pkg)]
51
51
  const { ns, alias } = plugin
52
52
  let item = find(refs, { ns })
53
- if (item) throw this.error('pluginNameClash%s%s%s%s', ns, pkg, item.ns, item.pkg, { code: 'BAJO_NAME_CLASH' })
53
+ if (item) throw this.bajo.error('pluginNameClash%s%s%s%s', ns, pkg, item.ns, item.pkg, { code: 'BAJO_NAME_CLASH' })
54
54
  item = find(refs, { alias })
55
- if (item) throw this.error('pluginNameClash%s%s%s%s', alias, pkg, item.alias, item.pkg, { code: 'BAJO_ALIAS_CLASH' })
55
+ if (item) throw this.bajo.error('pluginNameClash%s%s%s%s', alias, pkg, item.alias, item.pkg, { code: 'BAJO_ALIAS_CLASH' })
56
56
  refs.push({ ns, alias, pkg })
57
57
  }
58
58
  }
package/class/plugin.js CHANGED
@@ -170,6 +170,7 @@ class Plugin {
170
170
  * @param {string[]} names - Method's names
171
171
  */
172
172
  selfBind (names) {
173
+ if (!Array.isArray(names)) names = [names]
173
174
  for (const name of names) {
174
175
  this[name] = this[name].bind(this)
175
176
  }
@@ -181,5 +181,6 @@
181
181
  "exist%s%s": "%s|upperFirst '%s' exists already",
182
182
  "fieldError%s%s": "'%s': %s|lowerFirst",
183
183
  "reservedName%s%s": "%s|upperFirst name '%s' is a reserved name. Please rename to something else",
184
- "missing%s%s": "Missing '%s' %s"
184
+ "missing%s%s": "Missing '%s' %s",
185
+ "processing...": "Processing..."
185
186
  }
@@ -181,5 +181,6 @@
181
181
  "exist%s%s": "%s|upperFirst '%s' sudah ada",
182
182
  "fieldError%s%s": "'%s': %s|lowerFirst",
183
183
  "reservedName%s%s": "Nama %s|lowerFirst '%s' adalah nama tang di reserve. Silahkan gunakan nama lainnya",
184
- "missing%s%s": "%s|upperFirst '%s' tidak ditemukan"
184
+ "missing%s%s": "%s|upperFirst '%s' tidak ditemukan",
185
+ "processing...": "Memroses..."
185
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bajo",
3
- "version": "2.7.0",
3
+ "version": "2.7.3",
4
4
  "description": "The ultimate framework for whipping up massive apps in no time",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  "homepage": "https://github.com/ardhi/bajo#readme",
27
27
  "dependencies": {
28
28
  "add-filename-increment": "^1.0.0",
29
- "aneka": "^0.12.0",
29
+ "aneka": "^0.13.1",
30
30
  "chalk": "^5.6.0",
31
31
  "dayjs": "^1.11.13",
32
32
  "deep-freeze-strict": "^1.1.1",
package/wiki/CHANGES.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changes
2
2
 
3
+ ## 2026-03-15
4
+
5
+ - [2.7.3] Bug fix in checking plugin dependency handler
6
+
7
+ ## 2026-03-11
8
+
9
+ - [2.7.2] Bug fix in env dependent config building
10
+ - [2.7.2] ```selfBind()``` now also accept string for single method
11
+
12
+ ## 2026-03-10
13
+
14
+ - [2.7.1] Using ```textToArray()``` from ```aneka``` instead of custom function to parse text into array
15
+
3
16
  ## 2026-03-02
4
17
 
5
18
  - [2.7.0] Add ```useDefaultName``` parameter to ```buildCollection()```