bajo 0.2.29 → 0.3.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/boot/attach-helper.js +9 -2
- package/boot/run-tool.js +1 -1
- package/package.json +1 -1
package/boot/attach-helper.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import buildHelper from './lib/build-helper.js'
|
|
2
2
|
import logger from './lib/logger.js'
|
|
3
3
|
import print from './lib/print.js'
|
|
4
|
-
import fs from 'fs-extra'
|
|
5
4
|
import deepFreeze from 'deep-freeze-strict'
|
|
6
5
|
import currentLoc from './helper/current-loc.js'
|
|
7
6
|
import dayjs from './lib/dayjs.js'
|
|
7
|
+
import fs from 'fs-extra'
|
|
8
|
+
import fastGlob from 'fast-glob'
|
|
9
|
+
import { sprintf } from 'sprintf-js'
|
|
8
10
|
|
|
9
11
|
export default async function () {
|
|
10
12
|
this.bajo.helper = await buildHelper.call(this, `${currentLoc(import.meta).dir}/helper`)
|
|
@@ -20,8 +22,13 @@ export default async function () {
|
|
|
20
22
|
setImmediate(() => resolve())
|
|
21
23
|
})
|
|
22
24
|
}
|
|
23
|
-
|
|
25
|
+
// commonly used libraries
|
|
26
|
+
this.bajo.helper._ = await import('lodash-es')
|
|
27
|
+
this.bajo.helper.fs = fs
|
|
28
|
+
this.bajo.helper.fastGlob = fastGlob
|
|
29
|
+
this.bajo.helper.sprintf = sprintf
|
|
24
30
|
// last cleanup
|
|
31
|
+
this.bajo.helper.freeze(this.bajo.helper, true)
|
|
25
32
|
if (!fs.existsSync(this.bajo.config.dir.data)) {
|
|
26
33
|
this.bajo.helper.log.warn('Data directory \'%s\' is not set yet!', this.bajo.config.dir.data)
|
|
27
34
|
}
|
package/boot/run-tool.js
CHANGED
|
@@ -16,7 +16,7 @@ async function runTool () {
|
|
|
16
16
|
let name = config.tool
|
|
17
17
|
let toc = false
|
|
18
18
|
if (!isString(config.tool)) {
|
|
19
|
-
const select = await importPkg('
|
|
19
|
+
const select = await importPkg('bajoCli:@inquirer/select')
|
|
20
20
|
name = await select({
|
|
21
21
|
message: print.__('Please select tool provider:'),
|
|
22
22
|
choices: map(tools, t => ({ value: t.ns }))
|