bajo 0.2.20 → 0.2.22
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/boot/lib/build-helper.js +2 -2
- package/boot/lib/print.js +3 -6
- package/package.json +1 -1
package/boot/lib/build-helper.js
CHANGED
|
@@ -37,13 +37,13 @@ export default async function (dir, pkg = 'bajo') {
|
|
|
37
37
|
const files = await fastGlob([`!${dir}/**/_*.{js,json}`, `${dir}/**/*.{js,json}`])
|
|
38
38
|
const helper = {}
|
|
39
39
|
for (const f of files) {
|
|
40
|
-
const ext = path.extname()
|
|
40
|
+
const ext = path.extname(f)
|
|
41
41
|
const base = f.replace(dir, '').replace(ext, '')
|
|
42
42
|
const name = camelCase(base)
|
|
43
43
|
const fnName = pkg + '.' + name
|
|
44
44
|
let mod
|
|
45
45
|
if (ext === '.json') mod = readJson(f)
|
|
46
|
-
else await importModule(f)
|
|
46
|
+
else mod = await importModule(f)
|
|
47
47
|
if (isFunction(mod)) {
|
|
48
48
|
if (mod.constructor.name === 'AsyncFunction') mod = wrapAsyncFn.call(this, fnName, mod, true)
|
|
49
49
|
else mod = wrapFn.call(this, fnName, mod, true)
|
package/boot/lib/print.js
CHANGED
|
@@ -82,7 +82,7 @@ export class Print {
|
|
|
82
82
|
|
|
83
83
|
succeed (text, ...args) {
|
|
84
84
|
const { log } = this.scope.bajo.helper
|
|
85
|
-
if (this.opts.isLog) return log.
|
|
85
|
+
if (this.opts.isLog) return log.debug(text, ...args)
|
|
86
86
|
this.setText(text, ...args)
|
|
87
87
|
this.ora.succeed()
|
|
88
88
|
return this
|
|
@@ -106,7 +106,7 @@ export class Print {
|
|
|
106
106
|
|
|
107
107
|
info (text, ...args) {
|
|
108
108
|
const { log } = this.scope.bajo.helper
|
|
109
|
-
if (this.opts.isLog) return log.
|
|
109
|
+
if (this.opts.isLog) return log.debug(text, ...args)
|
|
110
110
|
this.setText(text, ...args)
|
|
111
111
|
this.ora.info()
|
|
112
112
|
return this
|
|
@@ -124,10 +124,7 @@ export class Print {
|
|
|
124
124
|
|
|
125
125
|
fatal (text, ...args) {
|
|
126
126
|
const { log } = this.scope.bajo.helper
|
|
127
|
-
if (this.opts.isLog)
|
|
128
|
-
log.fatal(text, ...args)
|
|
129
|
-
process.exit(1)
|
|
130
|
-
}
|
|
127
|
+
if (this.opts.isLog) return log.fatal(text, ...args)
|
|
131
128
|
this.setText(text, ...args)
|
|
132
129
|
this.ora.fail()
|
|
133
130
|
process.exit(1)
|