@converse/skeletor 3.1.5 → 3.1.6

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
@@ -8705,7 +8705,7 @@
8705
8705
  throw new Error("Skeletor.storage: the 'node' storage type is only available in Node.js builds. " +
8706
8706
  "Import from '@converse/skeletor/node' instead of '@converse/skeletor'.");
8707
8707
  }
8708
- this.store = new NodeSQLiteStorage(this.name);
8708
+ this.store = new NodeSQLiteStorage(this.name, PersistentStorage.nodeStorageDir ?? undefined);
8709
8709
  if (batchedWrites) {
8710
8710
  this.store.debouncedSetItems = mergebounce((items) => this.store.setItems(items), 50, {
8711
8711
  'promise': true,
@@ -8909,6 +8909,18 @@
8909
8909
  // node-only driver (and its `node:sqlite` import) never enters the browser
8910
8910
  // bundle; the `@converse/skeletor/node` entry sets it.
8911
8911
  PersistentStorage.nodeStorage = null;
8912
+ /**
8913
+ * Directory the `'node'` store type writes its database files to. The driver's
8914
+ * own default is relative, so it resolves against `process.cwd()` and a process
8915
+ * started from two directories ends up with two separate sets of state. Set an
8916
+ * absolute path (`$XDG_STATE_HOME/<app>`, say) to pin it. Left `null`, the
8917
+ * driver's default applies.
8918
+ *
8919
+ * Only the `'node'` string store type reads this; passing a driver instance to
8920
+ * the constructor means you've already chosen a directory yourself.
8921
+ * @public
8922
+ */
8923
+ PersistentStorage.nodeStorageDir = null;
8912
8924
  PersistentStorage.sessionStorageInitialized = localForage.defineDriver(sessionStorageWrapper);
8913
8925
  PersistentStorage.localForage = localForage;
8914
8926