zen-fs-config 0.5.27 → 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.
@@ -9,7 +9,7 @@ import {
9
9
  registerBackend,
10
10
  unregisterBackend,
11
11
  wrapZenFSFileSystem
12
- } from "./chunk-R65B37S2.mjs";
12
+ } from "./chunk-XLOBWTYJ.mjs";
13
13
  export {
14
14
  createBackend,
15
15
  getAccountFields,
@@ -175,20 +175,24 @@ function _cacheSet(key, value) {
175
175
  }
176
176
  var OPTIONAL_BACKEND_GLOBALS = {
177
177
  "zen-fs-github": ["ZenFSGitHub", "Github"],
178
- "zen-fs-gitee": ["ZenFSGitee", "Gitee"],
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
- "zen-fs-gitee": ["ZenFSGitee", "Gitee"],
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) => {
package/dist/index.mjs CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  registerBackend,
10
10
  unregisterBackend,
11
11
  wrapZenFSFileSystem
12
- } from "./chunk-R65B37S2.mjs";
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-VHPBA57D.mjs")).wrapZenFSFileSystem({ backend: FolderBackend, path: dir, label: options.label });
354
+ return (await import("./backend-registry-7OTQSRXY.mjs")).wrapZenFSFileSystem({ backend: FolderBackend, path: dir, label: options.label });
355
355
  },
356
356
  {
357
357
  type: "Folder",
@@ -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
- "zen-fs-gitee": ["ZenFSGitee", "Gitee"],
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) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zen-fs-config",
3
- "version": "0.5.27",
3
+ "version": "0.5.28",
4
4
  "description": "Distributed config management library built on ZenFS, zen-fs-cache, and zen-fs-sync",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",