bajo 2.15.1 → 2.16.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.js +17 -5
- package/package.json +2 -2
- package/wiki/CHANGES.md +6 -0
package/class/app.js
CHANGED
|
@@ -4,11 +4,11 @@ import Base from './base.js'
|
|
|
4
4
|
import { runAsApplet } from './helper/bajo.js'
|
|
5
5
|
import Cache from './app/cache.js'
|
|
6
6
|
import Tools from './plugin/tools.js'
|
|
7
|
-
|
|
8
7
|
import { outmatchNs, parseObject, lib } from './helper/app.js'
|
|
8
|
+
import { fileURLToPath } from 'url'
|
|
9
9
|
|
|
10
10
|
const { camelCase, isPlainObject, get, reverse, map, last, without, set } = lib._
|
|
11
|
-
const { pascalCase } = lib.aneka
|
|
11
|
+
const { pascalCase, getCallerFilename } = lib.aneka
|
|
12
12
|
let unknownLangWarning = false
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -197,6 +197,11 @@ class App {
|
|
|
197
197
|
*/
|
|
198
198
|
this.envVars = {}
|
|
199
199
|
|
|
200
|
+
/**
|
|
201
|
+
* Placeholder for boxen that will get imported from ```bajoCli``` later during boot process.
|
|
202
|
+
*/
|
|
203
|
+
this.boxen = null
|
|
204
|
+
|
|
200
205
|
this.cache = new Cache(this)
|
|
201
206
|
|
|
202
207
|
if (!options.cwd) options.cwd = process.cwd()
|
|
@@ -239,13 +244,19 @@ class App {
|
|
|
239
244
|
* @param {...any} args - any arguments passed will be displayed on screen. If the last argument is a boolean 'true', app will quit rightaway
|
|
240
245
|
*/
|
|
241
246
|
dump = (...args) => {
|
|
247
|
+
let caller = getCallerFilename()
|
|
248
|
+
caller = caller ? fileURLToPath(caller) : 'Unavailable'
|
|
242
249
|
const terminate = last(args) === true
|
|
243
250
|
if (terminate) args.pop()
|
|
244
|
-
|
|
245
|
-
|
|
251
|
+
const value = args.length === 1 ? args[0] : args
|
|
252
|
+
if (this.boxen) {
|
|
253
|
+
const result = util.inspect(value, { depth: 10, colors: true })
|
|
254
|
+
const info = this.boxen(result, { title: `Caller: ${caller}`, titleAlignment: 'center', padding: 1, margin: 1, borderStyle: 'round' })
|
|
255
|
+
console.log(info)
|
|
256
|
+
} else {
|
|
257
|
+
const result = util.inspect([caller, value], { depth: 10, colors: true })
|
|
246
258
|
console.log(result)
|
|
247
259
|
}
|
|
248
|
-
// if (terminate) process.kill(process.pid, 'SIGINT')
|
|
249
260
|
if (terminate) process.exit('1')
|
|
250
261
|
}
|
|
251
262
|
|
|
@@ -285,6 +296,7 @@ class App {
|
|
|
285
296
|
this.applet = this.envVars._.applet ?? this.argv._.applet
|
|
286
297
|
await this.bajo.runHook('bajo:beforeBoot')
|
|
287
298
|
await this.bajo.init()
|
|
299
|
+
if (this.bajoCli) this.boxen = await this.bajo.importPkg('bajoCli:boxen')
|
|
288
300
|
// cache
|
|
289
301
|
this.cache.purge()
|
|
290
302
|
setInterval(this.cache.purge, this.bajo.config.cache.purgeIntvDur)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bajo",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0",
|
|
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.
|
|
29
|
+
"aneka": "^0.14.0",
|
|
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,11 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-06-01
|
|
4
|
+
|
|
5
|
+
- [2.16.0] Upgrade ```aneka@0.14.0```
|
|
6
|
+
- [2.16.0] Adding caller filename to the ```app.dump()```
|
|
7
|
+
- [2.16.0] Formatting ```app.dump()``` to be more catchy when ```bajoCli``` is loaded
|
|
8
|
+
|
|
3
9
|
## 2026-05-30
|
|
4
10
|
|
|
5
11
|
- [2.15.1] Bug fix in ```app.boot()```
|