@yorha2b-lab/autodev 5.3.0 → 5.4.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/bin/autodev.js +2 -2
- package/package.json +1 -1
- package/src/bootstrap/foundation.js +5 -1
- package/src/commands/watch.js +2 -3
- package/src/dialogs/EN-US.js +2 -2
- package/src/dialogs/ZH-CN.js +1 -1
- package/src/framework/react/handlebars/partials/handleBlock.hbs +2 -2
- package/src/utils/ux.js +1 -1
package/bin/autodev.js
CHANGED
|
@@ -7,7 +7,7 @@ const { program } = require('commander')
|
|
|
7
7
|
const { local, matrixEffect, bootSequence } = require('../src/utils/ux')
|
|
8
8
|
|
|
9
9
|
const dialogs = require('../src/bootstrap/registry')({ dir: path.join(__dirname, '../src/dialogs') })
|
|
10
|
-
const dialog = dialogs[local]
|
|
10
|
+
const dialog = dialogs[local] ?? dialogs['EN-US']
|
|
11
11
|
|
|
12
12
|
program
|
|
13
13
|
.version(pkg.version)
|
|
@@ -20,7 +20,7 @@ program
|
|
|
20
20
|
.description(dialog.bunker.initDesc)
|
|
21
21
|
.action(() => {
|
|
22
22
|
const battlefield = {
|
|
23
|
-
dirs: [
|
|
23
|
+
dirs: [],
|
|
24
24
|
files: [
|
|
25
25
|
{ from: '.env.example', to: '.env', exist: 'envCheck', success: 'envCopy' },
|
|
26
26
|
{ from: 'config.js', to: 'config.js', exist: 'configCheck', success: 'configCopy' }
|
package/package.json
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
|
|
4
|
+
module.exports = ({ yorha, config, dialog, handlers, template, foundation }) => {
|
|
2
5
|
|
|
3
6
|
const { copyTemplateDir } = foundation
|
|
4
7
|
const { hbsDir, hooksDir, utilsDir, componentsDir } = config
|
|
5
8
|
|
|
6
9
|
try {
|
|
10
|
+
Object.values(handlers).forEach(handler => fs.mkdirSync(path.join(process.cwd(), handler.watch), { recursive: true }))
|
|
7
11
|
if (hbsDir === '') {
|
|
8
12
|
copyTemplateDir(template, 'hooks', hooksDir)
|
|
9
13
|
copyTemplateDir(template, 'utils', utilsDir)
|
package/src/commands/watch.js
CHANGED
|
@@ -8,6 +8,7 @@ module.exports = () => {
|
|
|
8
8
|
const ctx = bootstrap.get()
|
|
9
9
|
|
|
10
10
|
const queue = ctx.core.createTaskQueue(2)
|
|
11
|
+
const routes = Object.values(ctx.handlers)
|
|
11
12
|
|
|
12
13
|
queue.onIdle(() => {
|
|
13
14
|
ctx.yorha.pod042.report(ctx.dialog.pod042.queueEmpty)
|
|
@@ -25,12 +26,10 @@ module.exports = () => {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
const fileWatcher = chokidar.watch(['./config.js'], options)
|
|
28
|
-
const dirWatcher = chokidar.watch(
|
|
29
|
+
const dirWatcher = chokidar.watch(routes.map(route => `${route.watch}`), options)
|
|
29
30
|
|
|
30
31
|
ctx.yorha.operator6O.report(ctx.dialog.operator6O.call2B)
|
|
31
32
|
|
|
32
|
-
const routes = Object.values(ctx.handlers)
|
|
33
|
-
|
|
34
33
|
dirWatcher.on('add', filePath => {
|
|
35
34
|
const absolutePath = path.resolve(filePath)
|
|
36
35
|
const route = routes.find(route => absolutePath.includes(route.watch))
|
package/src/dialogs/EN-US.js
CHANGED
|
@@ -31,9 +31,9 @@ module.exports = {
|
|
|
31
31
|
bridgeProtocolComplete: (count, time) => `Semantic bridge protocol complete. Corrected ${count} field deviations. Elapsed: ${time}s`,
|
|
32
32
|
},
|
|
33
33
|
bunker: {
|
|
34
|
-
exit: 'Signal Lost',
|
|
35
|
-
envCopy: '.env storage complete',
|
|
34
|
+
exit: 'Signal Lost...',
|
|
36
35
|
envCheck: '.env already exists',
|
|
36
|
+
envCopy: '.env storage complete',
|
|
37
37
|
systemStandby: 'System is STANDBY',
|
|
38
38
|
configCheck: 'config.js already exists',
|
|
39
39
|
configCopy: 'config.js storage complete',
|
package/src/dialogs/ZH-CN.js
CHANGED
|
@@ -38,9 +38,9 @@ const onTabChange = key => {
|
|
|
38
38
|
{{#if hasExpandable}}
|
|
39
39
|
const onExpand = async (expanded, record) => {
|
|
40
40
|
if (expanded) {
|
|
41
|
-
setExpandedRowKeys(prev=>[...prev, record
|
|
41
|
+
setExpandedRowKeys(prev=>[...prev, record[rowKey])
|
|
42
42
|
} else {
|
|
43
|
-
setExpandedRowKeys(prev=>prev.filter(item => item !== record
|
|
43
|
+
setExpandedRowKeys(prev=>prev.filter(item => item !== record[rowKey]))
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
package/src/utils/ux.js
CHANGED
|
@@ -90,7 +90,7 @@ const matrixEffect = async (duration = 1500, dialog) => {
|
|
|
90
90
|
console.log(chalk.yellow(dialog.bunker.isLegendary(isLegendary, currentTotal, threshold)))
|
|
91
91
|
}
|
|
92
92
|
console.log(chalk.cyan(dialog.bunker.star))
|
|
93
|
-
console.log(chalk.
|
|
93
|
+
console.log(chalk.gray(dialog.bunker.exit))
|
|
94
94
|
process.exit(0)
|
|
95
95
|
return
|
|
96
96
|
}
|