hfs 0.48.0-alpha2 → 0.48.0-alpha4
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/admin/assets/index-67290e78.js +536 -0
- package/admin/assets/{sha512-136b5a7c.js → sha512-92cfe0b0.js} +1 -1
- package/admin/index.html +1 -1
- package/frontend/assets/index-110410d0.js +94 -0
- package/frontend/assets/{sha512-549e6c3a.js → sha512-8d938ca9.js} +1 -1
- package/frontend/index.html +1 -1
- package/package.json +4 -3
- package/src/QuickZipStream.js +1 -0
- package/src/api.file_list.js +38 -37
- package/src/api.net.js +141 -46
- package/src/api.plugins.js +25 -20
- package/src/config.js +2 -3
- package/src/const.js +3 -3
- package/src/cross.js +30 -1
- package/src/debounceAsync.js +13 -4
- package/src/frontEndApis.js +5 -11
- package/src/github.js +30 -29
- package/src/index.js +2 -0
- package/src/langs/embedded.js +2 -1
- package/src/langs/hfs-lang-fi.json +131 -0
- package/src/langs/hfs-lang-it.json +2 -0
- package/src/langs/hfs-lang-ru.json +11 -5
- package/src/listen.js +29 -15
- package/src/log.js +4 -5
- package/src/middlewares.js +2 -2
- package/src/misc.js +29 -2
- package/src/util-files.js +3 -7
- package/src/watchLoad.js +5 -5
- package/admin/assets/index-344723f8.js +0 -520
- package/frontend/assets/index-12411ff6.js +0 -94
package/src/util-files.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
5
|
};
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.loadFileAttr = exports.storeFileAttr = exports.isValidFileName = exports.createFileWithPath = exports.prepareFolder = exports.unzip = exports.dirStream = exports.adjustStaticPathForGlob = exports.
|
|
7
|
+
exports.loadFileAttr = exports.storeFileAttr = exports.isValidFileName = exports.createFileWithPath = exports.prepareFolder = exports.unzip = exports.dirStream = exports.adjustStaticPathForGlob = exports.dirTraversal = exports.watchDir = exports.readFileBusy = exports.isDirectory = void 0;
|
|
8
8
|
const promises_1 = __importDefault(require("fs/promises"));
|
|
9
9
|
const misc_1 = require("./misc");
|
|
10
10
|
const util_1 = require("util");
|
|
@@ -77,10 +77,6 @@ function dirTraversal(s) {
|
|
|
77
77
|
return s && /(^|[/\\])\.\.($|[/\\])/.test(s);
|
|
78
78
|
}
|
|
79
79
|
exports.dirTraversal = dirTraversal;
|
|
80
|
-
function isWindowsDrive(s) {
|
|
81
|
-
return s && /^[a-zA-Z]:$/.test(s);
|
|
82
|
-
}
|
|
83
|
-
exports.isWindowsDrive = isWindowsDrive;
|
|
84
80
|
// apply this to paths that may contain \ as separator (not supported by fast-glob) and other special chars to be escaped (parenthesis)
|
|
85
81
|
function adjustStaticPathForGlob(path) {
|
|
86
82
|
return fast_glob_1.default.escapePath(path.replace(/\\/g, '/'));
|
|
@@ -139,7 +135,7 @@ exports.unzip = unzip;
|
|
|
139
135
|
async function prepareFolder(path, dirnameIt = true) {
|
|
140
136
|
if (dirnameIt)
|
|
141
137
|
path = (0, path_1.dirname)(path);
|
|
142
|
-
if (isWindowsDrive(path))
|
|
138
|
+
if ((0, misc_1.isWindowsDrive)(path))
|
|
143
139
|
return;
|
|
144
140
|
try {
|
|
145
141
|
await promises_1.default.mkdir(path, { recursive: true });
|
|
@@ -152,7 +148,7 @@ async function prepareFolder(path, dirnameIt = true) {
|
|
|
152
148
|
exports.prepareFolder = prepareFolder;
|
|
153
149
|
function createFileWithPath(path, options) {
|
|
154
150
|
const folder = (0, path_1.dirname)(path);
|
|
155
|
-
if (!isWindowsDrive(folder))
|
|
151
|
+
if (!(0, misc_1.isWindowsDrive)(folder))
|
|
156
152
|
try {
|
|
157
153
|
(0, fs_1.mkdirSync)(folder, { recursive: true });
|
|
158
154
|
}
|
package/src/watchLoad.js
CHANGED
|
@@ -18,11 +18,11 @@ function watchLoad(path, parser, { failedOnFirstAttempt, immediateFirst } = {})
|
|
|
18
18
|
install(true);
|
|
19
19
|
return {
|
|
20
20
|
unwatch: uninstall,
|
|
21
|
-
save(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
saving = undefined)
|
|
25
|
-
}
|
|
21
|
+
save: (data) => Promise.resolve(saving).catch(() => { }).then(() => {
|
|
22
|
+
console.debug('writing', path);
|
|
23
|
+
return saving = promises_1.default.writeFile(path, data, 'utf8').finally(() => // save but also keep track of the current operation
|
|
24
|
+
saving = undefined);
|
|
25
|
+
}) // clear
|
|
26
26
|
};
|
|
27
27
|
function install(first = false) {
|
|
28
28
|
try {
|