@yorha2b-lab/autodev 1.0.40 → 1.0.42
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/README.md +5 -0
- package/README_EN.md +5 -0
- package/config.js +5 -0
- package/package.json +1 -1
- package/src/commands/watch-page.js +7 -4
- package/src/prompts/mock.js +1 -3
package/README.md
CHANGED
|
@@ -143,6 +143,11 @@ module.exports = {
|
|
|
143
143
|
visionModel: 'qwen3.5-plus',
|
|
144
144
|
textModel: 'qwen-turbo',
|
|
145
145
|
|
|
146
|
+
// 自定义模板目录
|
|
147
|
+
// 如果为空,将使用内置模板
|
|
148
|
+
// 自定义模板需要在hbsdir目录创建自己的index.hbs和resource.hbs文件
|
|
149
|
+
hbsDir: '',
|
|
150
|
+
|
|
146
151
|
// 目标项目的目录路径
|
|
147
152
|
hooksDir: 'src/hooks',
|
|
148
153
|
pagesDir: 'src/pages',
|
package/README_EN.md
CHANGED
|
@@ -143,6 +143,11 @@ module.exports = {
|
|
|
143
143
|
visionModel: 'qwen3.5-plus',
|
|
144
144
|
textModel: 'qwen-turbo',
|
|
145
145
|
|
|
146
|
+
// Custom template directory path
|
|
147
|
+
// If empty, will use built-in templates
|
|
148
|
+
// Custom templates need to create their own index.hbs and resource.hbs files in the hbsdir directory
|
|
149
|
+
hbsDir: '',
|
|
150
|
+
|
|
146
151
|
// Target project directory paths
|
|
147
152
|
hooksDir: 'src/hooks',
|
|
148
153
|
pagesDir: 'src/pages',
|
package/config.js
CHANGED
package/package.json
CHANGED
|
@@ -42,9 +42,12 @@ const watchPage = options => {
|
|
|
42
42
|
const { index, resource } = require(compilerPath)
|
|
43
43
|
|
|
44
44
|
try {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
//默认使用内置模板
|
|
46
|
+
if (config.hbsDir === '') {
|
|
47
|
+
copyTemplateDir(options, 'hooks', config.hooksDir)
|
|
48
|
+
copyTemplateDir(options, 'utils', config.utilsDir)
|
|
49
|
+
copyTemplateDir(options, 'components', config.componentsDir)
|
|
50
|
+
}
|
|
48
51
|
} catch (error) {
|
|
49
52
|
console.error(language('❌ 程序运行出错:', '❌ Runtime error:'), error)
|
|
50
53
|
}
|
|
@@ -52,7 +55,7 @@ const watchPage = options => {
|
|
|
52
55
|
const queue = createTaskQueue(2)
|
|
53
56
|
const menus = getExistingMenus()
|
|
54
57
|
|
|
55
|
-
const tplDir = path.join(__dirname, `../../templates/${options.template}`)
|
|
58
|
+
const tplDir = config.hbsDir !== '' ? path.join(process.cwd(), config.hbsDir) : path.join(__dirname, `../../templates/${options.template}`)
|
|
56
59
|
const indexTpl = Handlebars.compile(fs.readFileSync(path.join(tplDir, 'index.hbs'), 'utf-8'))
|
|
57
60
|
const resourceTpl = Handlebars.compile(fs.readFileSync(path.join(tplDir, 'resource.hbs'), 'utf-8'))
|
|
58
61
|
|