@converse/skeletor 3.1.4 → 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/CHANGES.md +18 -0
- package/README.md +9 -3
- package/dist/skeletor.d.ts +22 -3
- package/dist/skeletor.esm.js +267 -242
- package/dist/skeletor.esm.js.map +1 -1
- package/dist/skeletor.js +267 -242
- package/dist/skeletor.js.map +1 -1
- package/dist/skeletor.min.js +4 -4
- package/dist/skeletor.node.d.ts +956 -0
- package/dist/skeletor.node.js +269 -243
- package/dist/skeletor.node.mjs +269 -243
- package/package.json +6 -2
- package/src/declarations.d.ts +11 -0
- package/src/drivers/nodeSQLiteStorage.ts +3 -7
- package/src/drivers/types.ts +8 -2
- package/src/index.ts +1 -0
- package/src/storage.ts +33 -28
package/CHANGES.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.1.6 (2026-08-06)
|
|
4
|
+
|
|
5
|
+
- The `'node'` store type can now be told where to put its database files, via the new
|
|
6
|
+
`PersistentStorage.nodeStorageDir`. The driver has always taken a `storageDir` argument,
|
|
7
|
+
but nothing could reach it through the string store type, so `new PersistentStorage(id, 'node')`
|
|
8
|
+
was stuck with the driver's default. That default is relative, so it resolves against
|
|
9
|
+
`process.cwd()` and an app started from two directories keeps two separate sets of state.
|
|
10
|
+
Set an absolute path (`$XDG_STATE_HOME/<app>`, say) to pin it. The default is unchanged.
|
|
11
|
+
|
|
12
|
+
- Ship a separate `dist/skeletor.node.d.ts` for the `@converse/skeletor/node` entry point.
|
|
13
|
+
Both entry points pointed their `types` at the browser rollup.
|
|
14
|
+
|
|
15
|
+
## 3.1.5 (2026-07-22)
|
|
16
|
+
|
|
17
|
+
- Fix every write through the Node.js SQLite driver failing with `Record Not Found` while
|
|
18
|
+
the data was in fact stored.
|
|
19
|
+
- Switch TypeScript `moduleResolution` to `bundler` and add `types` conditions to the `exports` map.
|
|
20
|
+
|
|
3
21
|
## 3.1.4 (2026-06-23)
|
|
4
22
|
|
|
5
23
|
- Fix the `autoSync` hydration promise clobbering a consumer's own `initialized` promise.
|
package/README.md
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="images/skeletor-logo.svg" alt="Skeletor" width="120" height="120">
|
|
3
|
+
</p>
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
<h1 align="center">Skeletor</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://chat.conversejs.org/#converse/room?jid=discuss@conference.conversejs.org"><img alt="XMPP Chat" src="https://conference.conversejs.org/muc_badge/discuss@conference.conversejs.org"></a>
|
|
9
|
+
<a href="https://github.com/conversejs/skeletor/actions/workflows/karma-tests.yml"><img alt="CI Tests" src="https://github.com/conversejs/skeletor/actions/workflows/karma-tests.yml/badge.svg"></a>
|
|
10
|
+
</p>
|
|
5
11
|
|
|
6
12
|
Skeletor is a lightweight, TypeScript-first reactive data library.
|
|
7
13
|
|
package/dist/skeletor.d.ts
CHANGED
|
@@ -762,8 +762,9 @@ export declare function noConflict(): any;
|
|
|
762
762
|
/**
|
|
763
763
|
* Constructor for a Node.js-only storage driver. Registered by the
|
|
764
764
|
* `@converse/skeletor/node` entry point via {@link PersistentStorage.nodeStorage}.
|
|
765
|
+
* @public
|
|
765
766
|
*/
|
|
766
|
-
declare type NodeStorageConstructor = new (name: string) => StorageDriver;
|
|
767
|
+
export declare type NodeStorageConstructor = new (name: string, storageDir?: string, inMemory?: boolean) => StorageDriver;
|
|
767
768
|
|
|
768
769
|
/**
|
|
769
770
|
* @public
|
|
@@ -795,6 +796,18 @@ export declare class PersistentStorage {
|
|
|
795
796
|
static sessionStorageInitialized: Promise<void>;
|
|
796
797
|
static localForage: typeof localForage;
|
|
797
798
|
static nodeStorage: NodeStorageConstructor | null;
|
|
799
|
+
/**
|
|
800
|
+
* Directory the `'node'` store type writes its database files to. The driver's
|
|
801
|
+
* own default is relative, so it resolves against `process.cwd()` and a process
|
|
802
|
+
* started from two directories ends up with two separate sets of state. Set an
|
|
803
|
+
* absolute path (`$XDG_STATE_HOME/<app>`, say) to pin it. Left `null`, the
|
|
804
|
+
* driver's default applies.
|
|
805
|
+
*
|
|
806
|
+
* Only the `'node'` string store type reads this; passing a driver instance to
|
|
807
|
+
* the constructor means you've already chosen a directory yourself.
|
|
808
|
+
* @public
|
|
809
|
+
*/
|
|
810
|
+
static nodeStorageDir: string | null;
|
|
798
811
|
/** Register a storage instance with a weak reference. @public */
|
|
799
812
|
static register(instance: PersistentStorage): void;
|
|
800
813
|
/**
|
|
@@ -860,10 +873,16 @@ export declare interface StorageDriver {
|
|
|
860
873
|
length(): Promise<number>;
|
|
861
874
|
key(keyIndex: number): Promise<string | null>;
|
|
862
875
|
keys(): Promise<string[]>;
|
|
863
|
-
|
|
876
|
+
/**
|
|
877
|
+
* Write several items in one go. A successful write is signalled by the
|
|
878
|
+
* promise settling, not by what it resolves with: drivers may resolve with
|
|
879
|
+
* the written items (localForage does) or with nothing, and callers must
|
|
880
|
+
* treat both as success.
|
|
881
|
+
*/
|
|
882
|
+
setItems?(items: Record<string, any>): Promise<Record<string, any> | void>;
|
|
864
883
|
getItems?(keys: string[]): Promise<Record<string, any>>;
|
|
865
884
|
debouncedSetItems?: {
|
|
866
|
-
(items: Record<string, any>): Promise<void>;
|
|
885
|
+
(items: Record<string, any>): Promise<Record<string, any> | void>;
|
|
867
886
|
flush?: () => void;
|
|
868
887
|
};
|
|
869
888
|
}
|