stroid 0.1.4-beta.0 → 0.1.5

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.
Files changed (73) hide show
  1. package/CHANGELOG.md +427 -288
  2. package/README.md +1125 -118
  3. package/dist/async-internal.d.ts +30 -0
  4. package/dist/async.d.ts +7 -12
  5. package/dist/async.js +1 -33
  6. package/dist/chunk-4C666HHU.js +2 -0
  7. package/dist/chunk-4D6OA3DD.js +2 -0
  8. package/dist/chunk-6IBJ7CIK.js +14 -0
  9. package/dist/chunk-BWNLQKTY.js +2 -0
  10. package/dist/chunk-E33L4MII.js +2 -0
  11. package/dist/chunk-FSNVSMAV.js +2 -0
  12. package/dist/chunk-GZQGU64H.js +2 -0
  13. package/dist/chunk-LWUT37FW.js +13 -0
  14. package/dist/chunk-NFT6AZXY.js +2 -0
  15. package/dist/chunk-PHE2BCFG.js +2 -0
  16. package/dist/chunk-SF6EP56S.js +2 -0
  17. package/dist/chunk-WE3ZR6OG.js +2 -0
  18. package/dist/chunk-WXJ3IREA.js +2 -0
  19. package/dist/chunk-X2MKRN7O.js +14 -0
  20. package/dist/chunk-Y54SMROI.js +2 -0
  21. package/dist/chunk-YU5GMPCC.js +2 -0
  22. package/dist/computed.d.ts +6 -5
  23. package/dist/computed.js +1 -12
  24. package/dist/core-internal.d.ts +23 -0
  25. package/dist/core.d.ts +3 -2
  26. package/dist/core.js +1 -22
  27. package/dist/devtools-internal.d.ts +26 -0
  28. package/dist/devtools.d.ts +4 -25
  29. package/dist/devtools.js +1 -1
  30. package/dist/feature.d.ts +9 -2
  31. package/dist/feature.js +1 -1
  32. package/dist/fetch-4RH6MPY3.js +2 -0
  33. package/dist/graph-D28.d.ts +20 -0
  34. package/dist/helpers.d.ts +2 -1
  35. package/dist/helpers.js +1 -22
  36. package/dist/index-internal.d.ts +19 -19
  37. package/dist/index.d.cts +40 -22
  38. package/dist/index.d.ts +40 -22
  39. package/dist/index.js +1 -35
  40. package/dist/install.d.ts +16 -4
  41. package/dist/install.js +1 -1
  42. package/dist/metrics.d.ts +13 -0
  43. package/dist/persist.d.ts +3 -1
  44. package/dist/persist.js +1 -1
  45. package/dist/psr.d.ts +20 -11
  46. package/dist/psr.js +1 -18
  47. package/dist/query.d.ts +17 -0
  48. package/dist/query.js +2 -0
  49. package/dist/react/index.d.ts +10 -3
  50. package/dist/react/index.js +5 -36
  51. package/dist/registry.d.ts +23 -14
  52. package/dist/runtime-admin.js +1 -1
  53. package/dist/runtime-tools.d.ts +38 -65
  54. package/dist/runtime-tools.js +1 -3
  55. package/dist/selectors.d.ts +1 -1
  56. package/dist/selectors.js +1 -1
  57. package/dist/server/portable.d.ts +27 -0
  58. package/dist/server/portable.js +2 -0
  59. package/dist/server.d.ts +9 -19
  60. package/dist/server.js +1 -12
  61. package/dist/shared.d.ts +36 -0
  62. package/dist/store-registry.d.ts +5 -1
  63. package/dist/sync.d.ts +10 -1
  64. package/dist/sync.js +1 -1
  65. package/dist/testing.d.ts +1 -0
  66. package/dist/testing.js +1 -22
  67. package/dist/tsdoc-metadata.json +1 -1
  68. package/dist/types-internal-2.d.ts +168 -0
  69. package/dist/{computed-types.d.ts → types-internal-3.d.ts} +1 -1
  70. package/dist/{options.d.ts → types-internal.d.ts} +26 -10
  71. package/dist/types.d.ts +12 -2
  72. package/package.json +111 -44
  73. package/dist/computed-types.js +0 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stroid",
3
- "version": "0.1.4-beta.0",
4
- "description": "SSR-Safe, Named-store state engine for JavaScript/React with optional persistence, async caching, sync, and devtools.",
3
+ "version": "0.1.5",
4
+ "description": "Deterministic state engine for React and JavaScript with SSR-safe isolation, multi-store coordination, and decision-driven state workflows.",
5
5
  "keywords": [
6
6
  "state-management",
7
7
  "state",
@@ -15,22 +15,28 @@
15
15
  "sync",
16
16
  "broadcastchannel",
17
17
  "devtools",
18
- "ssr"
18
+ "ssr",
19
+ "tree-shakeable"
19
20
  ],
20
21
  "type": "module",
21
22
  "main": "dist/index.js",
23
+ "module": "dist/index.js",
22
24
  "exports": {
23
- ".": {
24
- "types": "./dist/index.d.ts",
25
- "import": "./dist/index.js"
26
- },
27
- "./psr": {
28
- "types": "./dist/psr.d.ts",
29
- "import": "./dist/psr.js"
30
- },
31
- "./core": {
32
- "types": "./dist/core.d.ts",
33
- "import": "./dist/core.js"
25
+ ".": {
26
+ "types": "./dist/index.d.ts",
27
+ "import": "./dist/index.js"
28
+ },
29
+ "./psr": {
30
+ "types": "./dist/psr.d.ts",
31
+ "import": "./dist/psr.js"
32
+ },
33
+ "./core": {
34
+ "types": "./dist/core.d.ts",
35
+ "import": "./dist/core.js"
36
+ },
37
+ "./query": {
38
+ "types": "./dist/query.d.ts",
39
+ "import": "./dist/query.js"
34
40
  },
35
41
  "./runtime-tools": {
36
42
  "types": "./dist/runtime-tools.d.ts",
@@ -56,6 +62,10 @@
56
62
  "types": "./dist/server.d.ts",
57
63
  "import": "./dist/server.js"
58
64
  },
65
+ "./server/portable": {
66
+ "types": "./dist/server/portable.d.ts",
67
+ "import": "./dist/server/portable.js"
68
+ },
59
69
  "./async": {
60
70
  "types": "./dist/async.d.ts",
61
71
  "import": "./dist/async.js"
@@ -91,19 +101,19 @@
91
101
  "./package.json": "./package.json"
92
102
  },
93
103
  "types": "dist/index.d.ts",
94
- "files": [
95
- "dist/**/*.js",
96
- "dist/**/*.d.ts",
97
- "dist/**/*.d.cts",
98
- "dist/**/*.json",
99
- "README.md",
100
- "CHANGELOG.md",
101
- "LICENSE"
102
- ],
103
- "publishConfig": {
104
- "tag": "beta"
105
- },
106
- "repository": {
104
+ "files": [
105
+ "dist/**/*.js",
106
+ "dist/**/*.d.ts",
107
+ "dist/**/*.d.cts",
108
+ "dist/**/*.json",
109
+ "README.md",
110
+ "CHANGELOG.md",
111
+ "LICENSE"
112
+ ],
113
+ "publishConfig": {
114
+ "tag": "latest"
115
+ },
116
+ "repository": {
107
117
  "type": "git",
108
118
  "url": "git+https://github.com/Himesh-Bhattarai/stroid.git"
109
119
  },
@@ -111,26 +121,73 @@
111
121
  "url": "https://github.com/Himesh-Bhattarai/stroid/issues"
112
122
  },
113
123
  "homepage": "https://github.com/Himesh-Bhattarai/stroid#readme",
114
- "sideEffects": [
115
- "./src/core/store-notify.ts"
116
- ],
124
+ "stroid": {
125
+ "treeShakeable": true,
126
+ "recommendedEntrypoints": [
127
+ "./core",
128
+ "./query",
129
+ "./runtime-tools",
130
+ "./persist",
131
+ "./sync",
132
+ "./devtools",
133
+ "./async",
134
+ "./react"
135
+ ]
136
+ },
117
137
  "scripts": {
118
- "test": "node --import ./tests/preload.mjs --import tsx --import ./tests/setup.ts --test-concurrency=1 --test tests/unit/**/*.test.ts tests/unit/**/*.test.tsx tests/integration/**/*.test.ts tests/integration/**/*.test.tsx tests/regression/**/*.test.ts tests/ssr/**/*.test.ts tests/utils/**/*.test.ts",
119
- "test:coverage": "c8 node --import ./tests/preload.mjs --import tsx --import ./tests/setup.ts --test tests/unit/**/*.test.ts tests/unit/**/*.test.tsx tests/integration/**/*.test.ts tests/integration/**/*.test.tsx tests/regression/**/*.test.ts tests/ssr/**/*.test.ts tests/utils/**/*.test.ts",
120
- "test:performance": "node --import ./tests/preload.mjs --import tsx --import ./tests/setup.ts --test-concurrency=1 --test tests/performance/notify-flush.perf.test.ts tests/performance/snapshot-cache.perf.test.ts tests/performance/stress-memory.perf.test.ts tests/performance/subscriber-concurrent.perf.test.ts tests/performance/sync-lite.perf.test.ts --test-force-exit",
138
+ "test": "node scripts/run-node-tests.mjs main",
139
+ "test:coverage": "c8 node scripts/run-node-tests.mjs main",
140
+ "test:performance": "node scripts/run-node-tests.mjs performance",
121
141
  "test:heavy": "npm run test:performance",
142
+ "test:package": "node scripts/run-node-tests.mjs package",
122
143
  "check:react-types": "node scripts/check-react-types.mjs",
144
+ "check:publint": "node scripts/run-publint.mjs",
145
+ "check:attw": "node scripts/run-attw.mjs",
123
146
  "docs:api": "api-extractor run --local",
124
- "test:dts": "tsc -p tsconfig.dtscheck.json --noEmit",
125
- "test:types": "npm run build && npm run check:react-types && npm run docs:api && npm run test:dts && tsc -p tsconfig.typetests.json",
126
- "typecheck": "tsc -p tsconfig.types.json",
127
- "typecheck:layers": "tsc -b tsconfig.layers.json",
128
- "build": "tsup && node scripts/normalize-dts.mjs",
129
- "benchmark:subscriber": "node --expose-gc --import tsx scripts/subscriber-benchmark.ts",
130
- "benchmark:subscriber:concurrent": "node --expose-gc --import tsx scripts/subscriber-concurrent-benchmark.ts",
131
- "test:all": "npm test && npm run test:types",
132
- "test:full": "npm run test:coverage && npm run test:types"
133
- },
147
+ "test:dts": "tsc -p tsconfig.dtscheck.json --noEmit",
148
+ "test:types": "npm run build && npm run check:publint && npm run check:attw && npm run test:package && npm run check:react-types && npm run docs:api && npm run test:dts && tsc -p tsconfig.typetests.json",
149
+ "typecheck": "tsc -p tsconfig.types.json",
150
+ "typecheck:layers": "tsc -b tsconfig.layers.json",
151
+ "build": "tsup && node scripts/normalize-dts.mjs",
152
+ "benchmark:compare": "node --expose-gc --import tsx scripts/comparison/compare-state-libraries.ts",
153
+ "benchmark:core-small": "node --expose-gc --import tsx scripts/core/core-small-benchmark.ts",
154
+ "benchmark:subscriber": "node --expose-gc --import tsx scripts/core/subscriber-benchmark.ts",
155
+ "benchmark:subscriber:concurrent": "node --expose-gc --import tsx scripts/core/subscriber-concurrent-benchmark.ts",
156
+ "benchmark:selector": "node --expose-gc --import tsx scripts/core/selector-benchmark.ts",
157
+ "benchmark:deep-update": "node --expose-gc --import tsx scripts/core/deep-update-benchmark.ts",
158
+ "benchmark:lifecycle": "node --expose-gc --import tsx scripts/core/lifecycle-benchmark.ts",
159
+ "benchmark:ssr-isolation": "node --expose-gc --import tsx scripts/ssr/ssr-isolation-benchmark.ts",
160
+ "benchmark:ssr-warm": "node --expose-gc --import tsx scripts/ssr/ssr-warm-container-benchmark.ts",
161
+ "benchmark:serverless-provider": "node --expose-gc --import tsx scripts/ssr/serverless-provider-certification.ts",
162
+ "benchmark:next-server-actions": "node --expose-gc --import tsx scripts/ssr/next-server-actions-benchmark.ts",
163
+ "benchmark:ssr-gaps": "node --expose-gc --import tsx scripts/ssr/ssr-gap-benchmark.ts",
164
+ "benchmark:ssr-als-audit": "node --expose-gc --import tsx scripts/ssr/ssr-als-audit-ladder-benchmark.ts",
165
+ "benchmark:react-concurrency": "node --expose-gc --import tsx scripts/react/react-concurrency-benchmark.ts",
166
+ "benchmark:websocket-stream": "node --expose-gc --import tsx scripts/hydration/websocket-hydration-stream-benchmark.ts",
167
+ "benchmark:ssr-fair-compare": "node --expose-gc --import tsx scripts/ssr/ssr-fair-compare.ts",
168
+ "benchmark:atomic-failure": "node --expose-gc --import tsx scripts/guarantees/atomic-failure-benchmark.ts",
169
+ "benchmark:race": "node --expose-gc --import tsx scripts/guarantees/race-condition-benchmark.ts",
170
+ "benchmark:hydration-divergence": "node --expose-gc --import tsx scripts/hydration/hydration-divergence-benchmark.ts",
171
+ "benchmark:hydration-randomized": "node --expose-gc --import tsx scripts/hydration/hydration-randomized-benchmark.ts",
172
+ "benchmark:hydration-large-payload": "node --expose-gc --import tsx scripts/hydration/hydration-large-payload-benchmark.ts",
173
+ "benchmark:determinism": "node --expose-gc --import tsx scripts/guarantees/determinism-replay-benchmark.ts",
174
+ "benchmark:memory-leak": "node --expose-gc --import tsx scripts/guarantees/memory-leak-benchmark.ts",
175
+ "benchmark:governance": "node --expose-gc --import tsx scripts/guarantees/governance-lifecycle-benchmark.ts",
176
+ "benchmark:production-reality": "node --expose-gc --import tsx scripts/guarantees/production-reality-benchmark.ts",
177
+ "benchmark:guarantees": "node --expose-gc --import tsx scripts/guarantees/guarantee-benchmark-suite.ts",
178
+ "benchmark:trust-matrix": "node --expose-gc --import tsx scripts/guarantees/production-trust-matrix-benchmark.ts",
179
+ "benchmark:all": "node --import tsx scripts/guarantees/run-all-benchmarks.ts",
180
+ "test:stress": "vitest run --config vitest.config.ts",
181
+ "test:stress:coverage": "vitest run --config vitest.config.ts --coverage",
182
+ "test:stress:fuzz": "vitest run --config vitest.config.ts tests/fuzz",
183
+ "bench:stress": "node --expose-gc --import tsx scripts/core/stress-benchmark-suite.bench.ts",
184
+ "bench:stress:check": "node --import tsx scripts/core/check-benchmark-regression.bench.ts",
185
+ "bench:stress:ci": "npm run bench:stress && npm run bench:stress:check",
186
+ "bench:stress:update-baseline": "node -e \"const fs=require('fs'); const path=require('path'); const dir=path.resolve('scripts/benchmark-results'); fs.mkdirSync(dir,{recursive:true}); fs.copyFileSync(path.join(dir,'latest.json'), path.join(dir,'baseline.json')); console.log('updated scripts/benchmark-results/baseline.json');\"",
187
+ "ci:gate-me": "node scripts/ci/run-gate-me-suite.mjs",
188
+ "test:all": "npm test && npm run test:types",
189
+ "test:full": "npm run test:coverage && npm run test:types"
190
+ },
134
191
  "engines": {
135
192
  "node": ">=18"
136
193
  },
@@ -139,14 +196,20 @@
139
196
  "react": ">=18"
140
197
  },
141
198
  "overrides": {
142
- "flatted": "^3.4.2"
199
+ "flatted": "^3.4.2",
200
+ "lodash": "4.18.1",
201
+ "@typescript-eslint/typescript-estree": {
202
+ "minimatch": "9.0.9"
203
+ }
143
204
  },
144
205
  "devDependencies": {
206
+ "@arethetypeswrong/cli": "^0.18.2",
145
207
  "@microsoft/api-extractor": "^7.57.7",
146
208
  "@testing-library/dom": "^10.4.0",
147
209
  "@testing-library/react": "^16.2.0",
148
210
  "@types/node": "^22.9.0",
149
211
  "@types/react": "^18.2.46",
212
+ "@vitest/coverage-v8": "^3.2.4",
150
213
  "c8": "^10.1.2",
151
214
  "eslint": "^8.57.0",
152
215
  "eslint-config-standard-with-typescript": "^39.1.1",
@@ -154,13 +217,17 @@
154
217
  "eslint-plugin-n": "^16.6.2",
155
218
  "eslint-plugin-promise": "^6.1.1",
156
219
  "immer": "^11.1.4",
220
+ "jotai": "^2.12.4",
157
221
  "jsdom": "^25.0.1",
222
+ "publint": "^0.3.18",
158
223
  "react": "^18.2.0",
159
224
  "react-dom": "^18.2.0",
160
225
  "redux": "^5.0.1",
161
226
  "tsup": "^8.5.1",
162
227
  "tsx": "^4.7.0",
163
228
  "typescript": "^5.7.2",
229
+ "vite": "^6.4.1",
230
+ "vitest": "^3.2.4",
164
231
  "zustand": "^5.0.11"
165
232
  }
166
233
  }
@@ -1,2 +0,0 @@
1
- //# sourceMappingURL=computed-types.js.map
2
- //# sourceMappingURL=computed-types.js.map