pug-site-core 1.0.2 → 1.0.4
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 +3 -1
- package/lib/devServer.js +1 -1
- package/lib/translate.js +1 -3
- package/package.json +3 -6
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { startDevServer } from "./lib/devServer.js";
|
|
2
|
+
import { translateLanguageData } from "./lib/translate.js";
|
|
2
3
|
import {
|
|
3
4
|
generateGetDataFn,
|
|
4
5
|
compilePagesPugToFn,
|
|
@@ -13,5 +14,6 @@ export const pugSiteCore = {
|
|
|
13
14
|
compilePagesPugToFn,
|
|
14
15
|
fetchDataToJsonFile,
|
|
15
16
|
buildFn,
|
|
16
|
-
buildStatic
|
|
17
|
+
buildStatic,
|
|
18
|
+
translateLanguageData
|
|
17
19
|
};
|
package/lib/devServer.js
CHANGED
|
@@ -129,7 +129,7 @@ function setupRoutes(app, wss) {
|
|
|
129
129
|
`请求路径:${req.path} 模版路径:${pugPath} 数据JSON文件路径或getData中的函数名:${jsonDataPath}`
|
|
130
130
|
);
|
|
131
131
|
let commonData = {};
|
|
132
|
-
if (config.
|
|
132
|
+
if (config.langChangeUpdateCommon) {
|
|
133
133
|
const getDataPath = pathToFileURL(
|
|
134
134
|
path.resolve(projectRoot, "getData.js")
|
|
135
135
|
).href;
|
package/lib/translate.js
CHANGED
|
@@ -55,7 +55,7 @@ async function translateStr(str, targetLanguage) {
|
|
|
55
55
|
return result;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
async function
|
|
58
|
+
export async function translateLanguageData() {
|
|
59
59
|
let orginData = languageData[orginLang];
|
|
60
60
|
console.log("开始翻译");
|
|
61
61
|
let startTime = Date.now();
|
|
@@ -104,5 +104,3 @@ async function main() {
|
|
|
104
104
|
);
|
|
105
105
|
console.log("翻译完成花费:", (Date.now() - startTime) / 1000 + "s");
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
main();
|
package/package.json
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pug-site-core",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
|
-
},
|
|
6
|
+
"scripts": {},
|
|
9
7
|
"keywords": [],
|
|
10
8
|
"author": "xy",
|
|
11
9
|
"dependencies": {
|
|
12
10
|
"@google-cloud/translate": "^8.5.0",
|
|
13
11
|
"async": "^3.2.6",
|
|
14
|
-
"axios": "^1.7.7",
|
|
15
12
|
"chokidar": "^3.6.0",
|
|
16
13
|
"express": "^4.19.2",
|
|
17
14
|
"express-useragent": "^1.0.15",
|
|
@@ -30,7 +27,7 @@
|
|
|
30
27
|
"ws": "^8.18.0"
|
|
31
28
|
},
|
|
32
29
|
"license": "ISC",
|
|
33
|
-
"description": "",
|
|
30
|
+
"description": "配置参数优化",
|
|
34
31
|
"files": [
|
|
35
32
|
"lib/",
|
|
36
33
|
"index.js"
|