@yorha2b-lab/autodev 5.2.0 → 5.2.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.
- package/package.json +1 -1
- package/src/bootstrap/index.js +10 -1
- package/src/commands/watch.js +8 -12
package/package.json
CHANGED
package/src/bootstrap/index.js
CHANGED
|
@@ -42,7 +42,16 @@ module.exports = {
|
|
|
42
42
|
return instance
|
|
43
43
|
},
|
|
44
44
|
|
|
45
|
-
get: () =>
|
|
45
|
+
get: () => {
|
|
46
|
+
return new Proxy({}, {
|
|
47
|
+
get(target, prop) {
|
|
48
|
+
if (!instance) {
|
|
49
|
+
throw new Error()
|
|
50
|
+
}
|
|
51
|
+
return instance[prop]
|
|
52
|
+
}
|
|
53
|
+
})
|
|
54
|
+
},
|
|
46
55
|
|
|
47
56
|
reboot() {
|
|
48
57
|
const { template, dialog } = instance
|
package/src/commands/watch.js
CHANGED
|
@@ -5,20 +5,16 @@ module.exports = () => {
|
|
|
5
5
|
const chokidar = require('chokidar')
|
|
6
6
|
|
|
7
7
|
const bootstrap = require('../bootstrap')
|
|
8
|
-
const
|
|
8
|
+
const ctx = bootstrap.get()
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const { contextStringify } = foundation
|
|
12
|
-
const { pod042, commander, operator6O } = yorha
|
|
13
|
-
|
|
14
|
-
const queue = createTaskQueue(2)
|
|
10
|
+
const queue = ctx.core.createTaskQueue(2)
|
|
15
11
|
|
|
16
12
|
queue.onIdle(() => {
|
|
17
|
-
pod042.report(dialog.pod042.queueEmpty)
|
|
18
|
-
const utilsDir = path.join(process.cwd(), config.utilsDir)
|
|
13
|
+
ctx.yorha.pod042.report(ctx.dialog.pod042.queueEmpty)
|
|
14
|
+
const utilsDir = path.join(process.cwd(), ctx.config.utilsDir)
|
|
19
15
|
if (!fs.existsSync(utilsDir)) fs.mkdirSync(utilsDir, { recursive: true })
|
|
20
|
-
fs.writeFileSync(path.join(utilsDir, 'menus.js'), `export const menus = ${contextStringify({ context: menus, maxLength: 50 })}`)
|
|
21
|
-
commander.report(dialog.bunker.systemStandby, 'gray')
|
|
16
|
+
fs.writeFileSync(path.join(utilsDir, 'menus.js'), `export const menus = ${ctx.foundation.contextStringify({ context: ctx.menus, maxLength: 50 })}`)
|
|
17
|
+
ctx.yorha.commander.report(ctx.dialog.bunker.systemStandby, 'gray')
|
|
22
18
|
})
|
|
23
19
|
|
|
24
20
|
const options = {
|
|
@@ -31,9 +27,9 @@ module.exports = () => {
|
|
|
31
27
|
const fileWatcher = chokidar.watch(['./config.js'], options)
|
|
32
28
|
const dirWatcher = chokidar.watch(['./screenShot', './screenPart', './response'], options)
|
|
33
29
|
|
|
34
|
-
operator6O.report(dialog.operator6O.call2B)
|
|
30
|
+
ctx.yorha.operator6O.report(ctx.dialog.operator6O.call2B)
|
|
35
31
|
|
|
36
|
-
const routes = Object.values(handlers)
|
|
32
|
+
const routes = Object.values(ctx.handlers)
|
|
37
33
|
|
|
38
34
|
dirWatcher.on('add', filePath => {
|
|
39
35
|
const absolutePath = path.resolve(filePath)
|