zen-fs-config 0.5.26 → 0.5.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.
|
@@ -175,20 +175,24 @@ function _cacheSet(key, value) {
|
|
|
175
175
|
}
|
|
176
176
|
var OPTIONAL_BACKEND_GLOBALS = {
|
|
177
177
|
"zen-fs-github": ["ZenFSGitHub", "Github"],
|
|
178
|
-
|
|
178
|
+
// Only 'ZenFSGitee' — the UMD global name emitted by zen-fs-gitee's IIFE
|
|
179
|
+
// build. Do NOT add 'Gitee' here: a coincidental window.Gitee (e.g. some
|
|
180
|
+
// third-party Gitee widget) would shadow the real backend and break mounting
|
|
181
|
+
// with "Invalid mount configuration".
|
|
182
|
+
"zen-fs-gitee": ["ZenFSGitee"],
|
|
179
183
|
"zen-fs-remotestoragejs": ["ZenFSRemoteStorage", "RemoteStorageFileSystem"]
|
|
180
184
|
};
|
|
181
185
|
async function importOptionalBackend(pkg) {
|
|
182
186
|
const candidates = OPTIONAL_BACKEND_GLOBALS[pkg];
|
|
183
|
-
if (candidates) {
|
|
184
|
-
for (const name of candidates) {
|
|
185
|
-
const g = globalThis[name];
|
|
186
|
-
if (g) return g;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
187
|
try {
|
|
190
188
|
return await import(pkg);
|
|
191
189
|
} catch {
|
|
190
|
+
if (candidates) {
|
|
191
|
+
for (const name of candidates) {
|
|
192
|
+
const g = globalThis[name];
|
|
193
|
+
if (g) return g;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
192
196
|
const globalHint = candidates?.length ? `, or load its UMD bundle via <script src=".../${pkg}.js"> (exposes global "${candidates[0]}")` : "";
|
|
193
197
|
throw new Error(
|
|
194
198
|
`Backend package "${pkg}" is not available. In a bundler/import-map environment run: npm install ${pkg}${globalHint}.`
|
package/dist/index.js
CHANGED
|
@@ -187,15 +187,15 @@ function _cacheSet(key, value) {
|
|
|
187
187
|
}
|
|
188
188
|
async function importOptionalBackend(pkg) {
|
|
189
189
|
const candidates = OPTIONAL_BACKEND_GLOBALS[pkg];
|
|
190
|
-
if (candidates) {
|
|
191
|
-
for (const name of candidates) {
|
|
192
|
-
const g = globalThis[name];
|
|
193
|
-
if (g) return g;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
190
|
try {
|
|
197
191
|
return await import(pkg);
|
|
198
192
|
} catch {
|
|
193
|
+
if (candidates) {
|
|
194
|
+
for (const name of candidates) {
|
|
195
|
+
const g = globalThis[name];
|
|
196
|
+
if (g) return g;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
199
|
const globalHint = candidates?.length ? `, or load its UMD bundle via <script src=".../${pkg}.js"> (exposes global "${candidates[0]}")` : "";
|
|
200
200
|
throw new Error(
|
|
201
201
|
`Backend package "${pkg}" is not available. In a bundler/import-map environment run: npm install ${pkg}${globalHint}.`
|
|
@@ -241,7 +241,11 @@ var init_backend_registry = __esm({
|
|
|
241
241
|
_memCache = /* @__PURE__ */ new Map();
|
|
242
242
|
OPTIONAL_BACKEND_GLOBALS = {
|
|
243
243
|
"zen-fs-github": ["ZenFSGitHub", "Github"],
|
|
244
|
-
|
|
244
|
+
// Only 'ZenFSGitee' — the UMD global name emitted by zen-fs-gitee's IIFE
|
|
245
|
+
// build. Do NOT add 'Gitee' here: a coincidental window.Gitee (e.g. some
|
|
246
|
+
// third-party Gitee widget) would shadow the real backend and break mounting
|
|
247
|
+
// with "Invalid mount configuration".
|
|
248
|
+
"zen-fs-gitee": ["ZenFSGitee"],
|
|
245
249
|
"zen-fs-remotestoragejs": ["ZenFSRemoteStorage", "RemoteStorageFileSystem"]
|
|
246
250
|
};
|
|
247
251
|
registerBackend("GitHub", async (options) => {
|
|
@@ -1700,9 +1704,13 @@ var ConfigRepo = class {
|
|
|
1700
1704
|
if (!vPath) return;
|
|
1701
1705
|
try {
|
|
1702
1706
|
const existing = await readVersion(this.fullFS, vPath);
|
|
1703
|
-
if (existing && existing.hash === version.hash)
|
|
1707
|
+
if (existing && existing.hash === version.hash) {
|
|
1708
|
+
log2.log("[ConfigRepo] skip version sidecar (hash unchanged):", vPath);
|
|
1709
|
+
return;
|
|
1710
|
+
}
|
|
1704
1711
|
} catch {
|
|
1705
1712
|
}
|
|
1713
|
+
log2.log("[ConfigRepo] write version sidecar:", vPath, "v" + version.version);
|
|
1706
1714
|
await this.ensureDir(vPath);
|
|
1707
1715
|
await writeVersion(this.fullFS, vPath, version);
|
|
1708
1716
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
registerBackend,
|
|
10
10
|
unregisterBackend,
|
|
11
11
|
wrapZenFSFileSystem
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XLOBWTYJ.mjs";
|
|
13
13
|
|
|
14
14
|
// src/config-repo.ts
|
|
15
15
|
import {
|
|
@@ -351,7 +351,7 @@ function registerFolderBackend() {
|
|
|
351
351
|
const pathMod = await import("path");
|
|
352
352
|
const dir = options.path;
|
|
353
353
|
const store = new FolderStore({ path: dir, label: options.label, fs, pathMod });
|
|
354
|
-
return (await import("./backend-registry-
|
|
354
|
+
return (await import("./backend-registry-7OTQSRXY.mjs")).wrapZenFSFileSystem({ backend: FolderBackend, path: dir, label: options.label });
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
type: "Folder",
|
|
@@ -1306,9 +1306,13 @@ var ConfigRepo = class {
|
|
|
1306
1306
|
if (!vPath) return;
|
|
1307
1307
|
try {
|
|
1308
1308
|
const existing = await readVersion(this.fullFS, vPath);
|
|
1309
|
-
if (existing && existing.hash === version.hash)
|
|
1309
|
+
if (existing && existing.hash === version.hash) {
|
|
1310
|
+
log2.log("[ConfigRepo] skip version sidecar (hash unchanged):", vPath);
|
|
1311
|
+
return;
|
|
1312
|
+
}
|
|
1310
1313
|
} catch {
|
|
1311
1314
|
}
|
|
1315
|
+
log2.log("[ConfigRepo] write version sidecar:", vPath, "v" + version.version);
|
|
1312
1316
|
await this.ensureDir(vPath);
|
|
1313
1317
|
await writeVersion(this.fullFS, vPath, version);
|
|
1314
1318
|
}
|
package/dist/zen-fs-config.js
CHANGED
|
@@ -24500,15 +24500,15 @@ var ZenFSConfig = (() => {
|
|
|
24500
24500
|
}
|
|
24501
24501
|
async function importOptionalBackend(pkg) {
|
|
24502
24502
|
const candidates = OPTIONAL_BACKEND_GLOBALS[pkg];
|
|
24503
|
-
if (candidates) {
|
|
24504
|
-
for (const name of candidates) {
|
|
24505
|
-
const g = globalThis[name];
|
|
24506
|
-
if (g) return g;
|
|
24507
|
-
}
|
|
24508
|
-
}
|
|
24509
24503
|
try {
|
|
24510
24504
|
return await import(pkg);
|
|
24511
24505
|
} catch {
|
|
24506
|
+
if (candidates) {
|
|
24507
|
+
for (const name of candidates) {
|
|
24508
|
+
const g = globalThis[name];
|
|
24509
|
+
if (g) return g;
|
|
24510
|
+
}
|
|
24511
|
+
}
|
|
24512
24512
|
const globalHint = candidates?.length ? `, or load its UMD bundle via <script src=".../${pkg}.js"> (exposes global "${candidates[0]}")` : "";
|
|
24513
24513
|
throw new Error(
|
|
24514
24514
|
`Backend package "${pkg}" is not available. In a bundler/import-map environment run: npm install ${pkg}${globalHint}.`
|
|
@@ -24554,7 +24554,11 @@ var ZenFSConfig = (() => {
|
|
|
24554
24554
|
_memCache = /* @__PURE__ */ new Map();
|
|
24555
24555
|
OPTIONAL_BACKEND_GLOBALS = {
|
|
24556
24556
|
"zen-fs-github": ["ZenFSGitHub", "Github"],
|
|
24557
|
-
|
|
24557
|
+
// Only 'ZenFSGitee' — the UMD global name emitted by zen-fs-gitee's IIFE
|
|
24558
|
+
// build. Do NOT add 'Gitee' here: a coincidental window.Gitee (e.g. some
|
|
24559
|
+
// third-party Gitee widget) would shadow the real backend and break mounting
|
|
24560
|
+
// with "Invalid mount configuration".
|
|
24561
|
+
"zen-fs-gitee": ["ZenFSGitee"],
|
|
24558
24562
|
"zen-fs-remotestoragejs": ["ZenFSRemoteStorage", "RemoteStorageFileSystem"]
|
|
24559
24563
|
};
|
|
24560
24564
|
registerBackend("GitHub", async (options) => {
|
|
@@ -27577,9 +27581,13 @@ var ZenFSConfig = (() => {
|
|
|
27577
27581
|
if (!vPath) return;
|
|
27578
27582
|
try {
|
|
27579
27583
|
const existing = await readVersion(this.fullFS, vPath);
|
|
27580
|
-
if (existing && existing.hash === version2.hash)
|
|
27584
|
+
if (existing && existing.hash === version2.hash) {
|
|
27585
|
+
log6.log("[ConfigRepo] skip version sidecar (hash unchanged):", vPath);
|
|
27586
|
+
return;
|
|
27587
|
+
}
|
|
27581
27588
|
} catch {
|
|
27582
27589
|
}
|
|
27590
|
+
log6.log("[ConfigRepo] write version sidecar:", vPath, "v" + version2.version);
|
|
27583
27591
|
await this.ensureDir(vPath);
|
|
27584
27592
|
await writeVersion(this.fullFS, vPath, version2);
|
|
27585
27593
|
}
|