@converse/skeletor 3.1.0 → 3.1.1

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/dist/skeletor.js CHANGED
@@ -8671,7 +8671,11 @@
8671
8671
  await localForage.config({ 'driver': IN_MEMORY });
8672
8672
  }
8673
8673
  else if (type === 'node') {
8674
- const { NodeSQLiteStorage } = await import('./drivers/nodeSQLiteStorage');
8674
+ const NodeSQLiteStorage = PersistentStorage.nodeStorage;
8675
+ if (!NodeSQLiteStorage) {
8676
+ throw new Error("Skeletor.storage: the 'node' storage type is only available in Node.js builds. " +
8677
+ "Import from '@converse/skeletor/node' instead of '@converse/skeletor'.");
8678
+ }
8675
8679
  this.store = new NodeSQLiteStorage(this.name);
8676
8680
  if (batchedWrites) {
8677
8681
  this.store.debouncedSetItems = mergebounce((items) => this.store.setItems(items), 50, {
@@ -8875,6 +8879,10 @@
8875
8879
  return this.name + '-' + id;
8876
8880
  }
8877
8881
  }
8882
+ // The Node.js SQLite storage driver. Left null in browser builds so the
8883
+ // node-only driver (and its `node:sqlite` import) never enters the browser
8884
+ // bundle; the `@converse/skeletor/node` entry sets it.
8885
+ PersistentStorage.nodeStorage = null;
8878
8886
  PersistentStorage.sessionStorageInitialized = localForage.defineDriver(sessionStorageWrapper);
8879
8887
  PersistentStorage.localForage = localForage;
8880
8888