pug-site-core 2.0.22 → 3.0.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/index.js +5 -0
- package/lib/ai/aiPanel.js +0 -0
- package/lib/ai/aiRouter.js +628 -0
- package/lib/debug/debugRouter.js +548 -0
- package/lib/debug/pugDebug.js +2104 -0
- package/lib/devServer.js +26 -5
- package/lib/generate.js +742 -213
- package/lib/paths.js +4 -0
- package/lib/utils.js +1 -7
- package/package.json +8 -4
package/lib/paths.js
CHANGED
|
@@ -7,6 +7,7 @@ const projectRoot = process.cwd();
|
|
|
7
7
|
|
|
8
8
|
// 定义基础路径
|
|
9
9
|
const templateRoot = path.join(projectRoot, "template");
|
|
10
|
+
const debugTemplateRoot = path.join(projectRoot, "template-debug");
|
|
10
11
|
|
|
11
12
|
// 辅助函数,用于生成文件URL
|
|
12
13
|
const fileUrl = (filePath) =>
|
|
@@ -18,12 +19,15 @@ export const paths = {
|
|
|
18
19
|
lib: __dirname,
|
|
19
20
|
config: fileUrl("config.js"),
|
|
20
21
|
getData: fileUrl("getData.js"),
|
|
22
|
+
languageData: fileUrl("languageData.js"),
|
|
21
23
|
pagesPugFn: fileUrl("pagesPugFn/index.js"),
|
|
22
24
|
router: fileUrl("router.js"),
|
|
23
25
|
|
|
24
26
|
// 模板相关路径
|
|
25
27
|
template: {
|
|
26
28
|
root: templateRoot,
|
|
29
|
+
debug: debugTemplateRoot,
|
|
30
|
+
debugPages: path.join(debugTemplateRoot, "pages"),
|
|
27
31
|
pages: path.join(templateRoot, "pages"),
|
|
28
32
|
static: path.join(templateRoot, "static"),
|
|
29
33
|
},
|
package/lib/utils.js
CHANGED
|
@@ -12,21 +12,15 @@ export const pathSymbol = process.platform.startsWith("win") ? "\\" : "/";
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* 获取pages目录下所有pug文件的路径数组
|
|
15
|
-
* @param {boolean} isFilter - 是否需要过滤路径(去除语言和设备类型目录)
|
|
16
15
|
* @returns {Promise<string[]>} 返回pug文件路径数组
|
|
17
16
|
*/
|
|
18
|
-
export async function getPagesPugFilePathArr(
|
|
17
|
+
export async function getPagesPugFilePathArr() {
|
|
19
18
|
let pagesPugFilePathArr = (
|
|
20
19
|
await fse.readdir(paths.template.pages, {
|
|
21
20
|
recursive: true,
|
|
22
21
|
})
|
|
23
22
|
).filter((fileName) => fileName.endsWith(".pug"));
|
|
24
23
|
|
|
25
|
-
if (isFilter) {
|
|
26
|
-
pagesPugFilePathArr = pagesPugFilePathArr.map((fileName) => {
|
|
27
|
-
return pagesPathFilter(fileName);
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
24
|
pagesPugFilePathArr = Array.from(new Set(pagesPugFilePathArr));
|
|
31
25
|
return pagesPugFilePathArr;
|
|
32
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pug-site-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
"lang": "node index.js",
|
|
14
14
|
"imagemin": "node index.js",
|
|
15
15
|
"build": "npm run getData && npm run buildFn",
|
|
16
|
-
"update": "npm install pug-site-core@latest"
|
|
16
|
+
"update": "npm install pug-site-core@latest",
|
|
17
|
+
"debug": "node index.js"
|
|
17
18
|
},
|
|
18
19
|
"keywords": [],
|
|
19
20
|
"author": "xy",
|
|
@@ -43,11 +44,14 @@
|
|
|
43
44
|
"lodash": "^4.17.21",
|
|
44
45
|
"nodemon": "^3.1.4",
|
|
45
46
|
"pug": "^3.0.3",
|
|
47
|
+
"pug-lexer": "^5.0.1",
|
|
48
|
+
"pug-parser": "^6.0.0",
|
|
49
|
+
"pug-walk": "^2.0.0",
|
|
46
50
|
"uglify-js": "^3.19.3",
|
|
47
51
|
"ws": "^8.18.0"
|
|
48
52
|
},
|
|
49
53
|
"license": "ISC",
|
|
50
|
-
"description": "
|
|
54
|
+
"description": "修复并优化静态html打包功能、并将默认下载数据线程12->3",
|
|
51
55
|
"files": [
|
|
52
56
|
"lib/",
|
|
53
57
|
"index.js"
|
|
@@ -55,4 +59,4 @@
|
|
|
55
59
|
"exports": {
|
|
56
60
|
".": "./index.js"
|
|
57
61
|
}
|
|
58
|
-
}
|
|
62
|
+
}
|