@olenbetong/appframe-vite 5.1.27 → 5.1.28
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/lib/localization.js +3 -3
- package/package.json +2 -2
package/lib/localization.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* handler that generates the article HTML, we then get the cached strings,
|
|
11
11
|
* and add a script that adds the strings to the client cache.
|
|
12
12
|
*/
|
|
13
|
-
import
|
|
13
|
+
import fs from "fs-extra";
|
|
14
14
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
15
15
|
import { resolve } from "node:path";
|
|
16
16
|
import { getLoginInfo } from "./devServer.js";
|
|
@@ -26,14 +26,14 @@ function debounce(callback, delay = 300) {
|
|
|
26
26
|
const stringCache = new Map();
|
|
27
27
|
const cachePath = resolve(process.cwd(), "./node_modules/.appframe");
|
|
28
28
|
const cacheFile = resolve(cachePath, "./localizeCache.json");
|
|
29
|
-
if (await exists(cacheFile)) {
|
|
29
|
+
if (await fs.exists(cacheFile)) {
|
|
30
30
|
let cache = await importJson(cacheFile, true);
|
|
31
31
|
for (let text in cache) {
|
|
32
32
|
stringCache.set(text, cache[text]);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
async function saveCacheToFile() {
|
|
36
|
-
if (!(await exists(cacheFile))) {
|
|
36
|
+
if (!(await fs.exists(cacheFile))) {
|
|
37
37
|
await mkdir(cachePath, { recursive: true });
|
|
38
38
|
}
|
|
39
39
|
let data = JSON.stringify(Object.fromEntries(stringCache));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olenbetong/appframe-vite",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.28",
|
|
4
4
|
"description": "Tools to use and deploy Vite applications to Appframe",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -41,5 +41,5 @@
|
|
|
41
41
|
"open": "^10.1.0",
|
|
42
42
|
"tcp-port-used": "^1.0.2"
|
|
43
43
|
},
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "48bef4ad11242f24897c4f4c0297c6adca1453ec"
|
|
45
45
|
}
|