state-jet 1.0.7 → 1.0.9
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/index.cjs +36 -0
- package/dist/store.js +1 -1
- package/dist/types/crdt.d.ts.map +1 -1
- package/dist/types/derived.d.ts.map +1 -1
- package/dist/types/devtools.d.ts.map +1 -1
- package/dist/types/encryption.d.ts.map +1 -1
- package/dist/types/middleware.d.ts.map +1 -1
- package/dist/types/optimistic.d.ts.map +1 -1
- package/dist/types/persistence.d.ts.map +1 -1
- package/dist/types/store.d.ts.map +1 -1
- package/package.json +18 -12
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var index_exports = {};
|
|
20
|
+
__export(index_exports, {
|
|
21
|
+
decrypt: () => import_encryption.decrypt,
|
|
22
|
+
encrypt: () => import_encryption.encrypt,
|
|
23
|
+
loadEncryptedState: () => import_encryption.loadEncryptedState,
|
|
24
|
+
optimisticUpdate: () => import_optimistic.optimisticUpdate,
|
|
25
|
+
restoreState: () => import_persistence.restoreState,
|
|
26
|
+
saveEncryptedState: () => import_encryption.saveEncryptedState,
|
|
27
|
+
saveState: () => import_persistence.saveState,
|
|
28
|
+
syncCRDT: () => import_crdt.syncCRDT,
|
|
29
|
+
useStateGlobal: () => import_store.useStateGlobal
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(index_exports);
|
|
32
|
+
var import_store = require("./store");
|
|
33
|
+
var import_persistence = require("./persistence");
|
|
34
|
+
var import_optimistic = require("./optimistic");
|
|
35
|
+
var import_encryption = require("./encryption");
|
|
36
|
+
var import_crdt = require("./crdt");
|
package/dist/store.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { produce } from "immer";
|
|
2
2
|
import { saveState, restoreState } from "./persistence";
|
|
3
|
-
import { useSyncExternalStore } from
|
|
3
|
+
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
|
4
4
|
import { notifyDevTools, undoState, redoState, measurePerformance } from "./devtools";
|
|
5
5
|
import { globalObject } from "./global";
|
|
6
6
|
const store = new Map();
|
package/dist/types/crdt.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crdt.d.ts","sourceRoot":"","sources":["../../src/crdt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"crdt.d.ts","sourceRoot":"","sources":["../../src/crdt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,GAAI,YAAY,GAAG,EAAE,aAAa,GAAG,QAE1D,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,KAAK,MAAM,EAAE,aAAa,GAAG,SAIrD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derived.d.ts","sourceRoot":"","sources":["../../src/derived.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"derived.d.ts","sourceRoot":"","sources":["../../src/derived.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,GAAI,cAAc,KAAK,CAAC,GAAG,CAAC,EAAE,WAAW,QAAQ,cAQzE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/devtools.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"devtools.d.ts","sourceRoot":"","sources":["../../src/devtools.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,SAarD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,EAAE,UAAU,MAAM,IAAI,SAWnE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,QAKpC,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,QAKpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/encryption.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"encryption.d.ts","sourceRoot":"","sources":["../../src/encryption.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,WAA+B,CAAC;AACjE,eAAO,MAAM,OAAO,GAAI,MAAM,GAAG,QAA2B,CAAC;AAE7D,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,SAEzD,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,QAG7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["../../src/middleware.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,SAEvE,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAU,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,kBAE9E,CAAC;AAEF,eAAO,MAAM,qBAAqB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,WAM5E,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,QAAQ,MAAM,MACjC,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,MAAM,EAAE,KAAK,GAAG,kBAclE,CAAC;AAEF,KAAK,MAAM,CAAC,CAAC,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC,CAAA;CAAE,CAAC;AAE/C,eAAO,MAAM,iBAAiB,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,QAAQ,MAAM,CAAC,GAAG,CAAC,WAW/E,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,MAEpC,KAAK,MAAM,EAAE,MAAM,MAAM,EAAE,MAAM,GAAG,WAO7C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optimistic.d.ts","sourceRoot":"","sources":["../../src/optimistic.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"optimistic.d.ts","sourceRoot":"","sources":["../../src/optimistic.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,GAAI,UAAU,GAAG,EAAE,SAAS,GAAG,EAAE,UAAU,GAAG,SAMxE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/persistence.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../src/persistence.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,OAAO,GAAG,EAAE,iBAAe,SAMjE,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,KAAK,MAAM,QAKvC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAOA,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AAMjE,eAAO,MAAM,cAAc,GAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/store.ts"],"names":[],"mappings":"AAOA,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;AAMjE,eAAO,MAAM,cAAc,GAAI,CAAC,EAC5B,KAAK,MAAM,EACX,eAAe,CAAC,EAChB,UAAU;IAAE,UAAU,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE;;oBAkEzD,CAAC;;;CAW3B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "state-jet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "Ultra-lightweight global state management for React",
|
|
5
|
-
"main": "dist/index.
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
7
6
|
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/types/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
11
|
"exports": {
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"require": "./dist/index.js"
|
|
15
|
-
}
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
16
14
|
},
|
|
17
15
|
"repository": {
|
|
18
16
|
"type": "git",
|
|
@@ -33,24 +31,31 @@
|
|
|
33
31
|
"url": "https://github.com/venkateshsundaram/state-jet/issues"
|
|
34
32
|
},
|
|
35
33
|
"scripts": {
|
|
36
|
-
"build": "tsc",
|
|
34
|
+
"build": "tsc && npm run build:cjs",
|
|
35
|
+
"build:cjs": "esbuild src/index.ts --format=cjs --outfile=dist/index.cjs",
|
|
37
36
|
"test": "vitest",
|
|
38
37
|
"clean": "rm -rf dist/*",
|
|
38
|
+
"prepare": "npm run build",
|
|
39
39
|
"publish:npm": "npm publish --access public",
|
|
40
40
|
"lint": "eslint src --ext .ts,.tsx"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@types/react": "^
|
|
43
|
+
"@types/react": "^19.0.10",
|
|
44
|
+
"@types/react-dom": "^19.0.4",
|
|
45
|
+
"@types/use-sync-external-store": "^0.0.6",
|
|
46
|
+
"esbuild": "^0.25.0",
|
|
44
47
|
"eslint": "^8.57.1",
|
|
45
48
|
"immer": "^10.1.1",
|
|
46
|
-
"react": "
|
|
49
|
+
"react": "19.0.0",
|
|
50
|
+
"react-dom": "19.0.0",
|
|
47
51
|
"typescript": "^5.7.3",
|
|
48
52
|
"vitest": "^2.1.8"
|
|
49
53
|
},
|
|
50
54
|
"peerDependencies": {
|
|
51
55
|
"@types/react": ">=18.0.0",
|
|
52
56
|
"immer": ">=9.0.6",
|
|
53
|
-
"react": ">=18.0.0"
|
|
57
|
+
"react": ">=18.0.0",
|
|
58
|
+
"use-sync-external-store": ">=1.2.0"
|
|
54
59
|
},
|
|
55
60
|
"peerDependenciesMeta": {
|
|
56
61
|
"@types/react": {
|
|
@@ -62,5 +67,6 @@
|
|
|
62
67
|
"react": {
|
|
63
68
|
"optional": true
|
|
64
69
|
}
|
|
65
|
-
}
|
|
70
|
+
},
|
|
71
|
+
"type": "commonjs"
|
|
66
72
|
}
|