stroid 0.1.3 → 0.1.4

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 (133) hide show
  1. package/CHANGELOG.md +312 -265
  2. package/README.md +1017 -115
  3. package/dist/async.d.ts +1 -1
  4. package/dist/async.js +1 -33
  5. package/dist/chunk-645IESIU.js +2 -0
  6. package/dist/chunk-6ELWGQ4Q.js +2 -0
  7. package/dist/chunk-BW32TJGE.js +13 -0
  8. package/dist/chunk-FOQKGHPS.js +26 -0
  9. package/dist/chunk-KQCSFGHJ.js +2 -0
  10. package/dist/chunk-M2NJVI36.js +2 -0
  11. package/dist/chunk-PVATWAY4.js +2 -0
  12. package/dist/chunk-X3JR32JD.js +2 -0
  13. package/dist/chunk-YU5GMPCC.js +2 -0
  14. package/dist/computed-types.d.ts +42 -0
  15. package/dist/computed-types.js +2 -0
  16. package/dist/computed.d.ts +9 -2
  17. package/dist/computed.js +1 -12
  18. package/dist/core.js +1 -22
  19. package/dist/devtools.d.ts +1 -1
  20. package/dist/devtools.js +1 -1
  21. package/dist/feature.js +1 -1
  22. package/dist/helpers.js +1 -22
  23. package/dist/index-internal.d.ts +1 -1
  24. package/dist/index.d.cts +3 -1
  25. package/dist/index.d.ts +3 -1
  26. package/dist/index.js +1 -35
  27. package/dist/install.js +1 -1
  28. package/dist/options.d.ts +1 -1
  29. package/dist/persist.js +1 -1
  30. package/dist/psr.d.ts +48 -0
  31. package/dist/psr.js +2 -0
  32. package/dist/react/index.d.ts +3 -1
  33. package/dist/react/index.js +5 -36
  34. package/dist/registry.d.ts +1 -0
  35. package/dist/runtime-admin.js +1 -1
  36. package/dist/runtime-patch.d.ts +29 -0
  37. package/dist/runtime-tools.d.ts +6 -1
  38. package/dist/runtime-tools.js +1 -3
  39. package/dist/selectors.js +1 -1
  40. package/dist/server.d.ts +4 -1
  41. package/dist/server.js +1 -12
  42. package/dist/store-registry.d.ts +8 -0
  43. package/dist/sync.js +1 -1
  44. package/dist/testing.js +1 -22
  45. package/dist/types/adapters/options.d.ts +335 -0
  46. package/dist/types/async/cache.d.ts +40 -0
  47. package/dist/types/async/clone.d.ts +10 -0
  48. package/dist/types/async/errors.d.ts +3 -0
  49. package/dist/types/async/fetch.d.ts +37 -0
  50. package/dist/types/async/inflight.d.ts +30 -0
  51. package/dist/types/async/rate.d.ts +5 -0
  52. package/dist/types/async/registry.d.ts +117 -0
  53. package/dist/types/async/request.d.ts +11 -0
  54. package/dist/types/async/retry.d.ts +10 -0
  55. package/dist/types/async.d.ts +10 -0
  56. package/dist/types/computed/computed-graph.d.ts +33 -0
  57. package/dist/types/computed/index.d.ts +21 -0
  58. package/dist/types/computed/types.d.ts +40 -0
  59. package/dist/types/config.d.ts +10 -0
  60. package/dist/types/core/index.d.ts +11 -0
  61. package/dist/types/core/lifecycle-hooks.d.ts +16 -0
  62. package/dist/types/core/runtime-patch.d.ts +67 -0
  63. package/dist/types/core/store-admin-impl.d.ts +9 -0
  64. package/dist/types/core/store-admin.d.ts +9 -0
  65. package/dist/types/core/store-core.d.ts +13 -0
  66. package/dist/types/core/store-create.d.ts +16 -0
  67. package/dist/types/core/store-hydrate-impl.d.ts +35 -0
  68. package/dist/types/core/store-hydrate.d.ts +9 -0
  69. package/dist/types/core/store-lifecycle/hooks.d.ts +20 -0
  70. package/dist/types/core/store-lifecycle/identity.d.ts +23 -0
  71. package/dist/types/core/store-lifecycle/registry.d.ts +54 -0
  72. package/dist/types/core/store-lifecycle/types.d.ts +67 -0
  73. package/dist/types/core/store-lifecycle/validation.d.ts +53 -0
  74. package/dist/types/core/store-name.d.ts +28 -0
  75. package/dist/types/core/store-notify.d.ts +13 -0
  76. package/dist/types/core/store-read.d.ts +18 -0
  77. package/dist/types/core/store-registry.d.ts +115 -0
  78. package/dist/types/core/store-replace-impl.d.ts +11 -0
  79. package/dist/types/core/store-replace.d.ts +9 -0
  80. package/dist/types/core/store-set-impl.d.ts +13 -0
  81. package/dist/types/core/store-set.d.ts +9 -0
  82. package/dist/types/core/store-shared/core.d.ts +13 -0
  83. package/dist/types/core/store-shared/notify.d.ts +12 -0
  84. package/dist/types/core/store-transaction.d.ts +28 -0
  85. package/dist/types/core/store-write-shared.d.ts +25 -0
  86. package/dist/types/core/store-write.d.ts +13 -0
  87. package/dist/types/features/feature-registry.d.ts +91 -0
  88. package/dist/types/features/lifecycle.d.ts +40 -0
  89. package/dist/types/index.d.ts +17 -0
  90. package/dist/types/integrations/query.d.ts +8 -0
  91. package/dist/types/internals/computed-order.d.ts +3 -0
  92. package/dist/types/internals/config.d.ts +116 -0
  93. package/dist/types/internals/diagnostics.d.ts +21 -0
  94. package/dist/types/internals/reporting.d.ts +9 -0
  95. package/dist/types/internals/store-admin.d.ts +7 -0
  96. package/dist/types/internals/store-ops.d.ts +13 -0
  97. package/dist/types/internals/test-reset.d.ts +2 -0
  98. package/dist/types/internals/write-context.d.ts +20 -0
  99. package/dist/types/notification/delivery.d.ts +3 -0
  100. package/dist/types/notification/index.d.ts +10 -0
  101. package/dist/types/notification/metrics.d.ts +12 -0
  102. package/dist/types/notification/priority.d.ts +9 -0
  103. package/dist/types/notification/scheduler.d.ts +11 -0
  104. package/dist/types/notification/snapshot.d.ts +8 -0
  105. package/dist/types/runtime-admin/index.d.ts +2 -0
  106. package/dist/types/runtime-tools/index.d.ts +63 -0
  107. package/dist/types/store.d.ts +16 -0
  108. package/dist/types/types/utility.d.ts +17 -0
  109. package/dist/types/utils/clone.d.ts +4 -0
  110. package/dist/types/utils/devfreeze.d.ts +2 -0
  111. package/dist/types/utils/hash.d.ts +8 -0
  112. package/dist/types/utils/path.d.ts +5 -0
  113. package/dist/types/utils/validation.d.ts +14 -0
  114. package/dist/types/utils.d.ts +13 -0
  115. package/dist/types.d.ts +2 -2
  116. package/package.json +31 -20
  117. package/dist/async.js.map +0 -1
  118. package/dist/computed.js.map +0 -1
  119. package/dist/core.js.map +0 -1
  120. package/dist/devtools.js.map +0 -1
  121. package/dist/feature.js.map +0 -1
  122. package/dist/helpers.js.map +0 -1
  123. package/dist/index.js.map +0 -1
  124. package/dist/install.js.map +0 -1
  125. package/dist/persist.js.map +0 -1
  126. package/dist/react/index.js.map +0 -1
  127. package/dist/runtime-admin.js.map +0 -1
  128. package/dist/runtime-tools.js.map +0 -1
  129. package/dist/selectors.js.map +0 -1
  130. package/dist/server.js.map +0 -1
  131. package/dist/sync.js.map +0 -1
  132. package/dist/testing.js.map +0 -1
  133. package/dist/tsdoc-metadata.json +0 -11
@@ -0,0 +1,21 @@
1
+ export declare const __DEV__: boolean;
2
+ export declare const isDev: () => boolean;
3
+ export declare const critical: (msg: string, meta?: Record<string, unknown>) => void;
4
+ export declare const warn: (msg: string, meta?: Record<string, unknown>) => void;
5
+ export declare const warnAlways: (msg: string, meta?: Record<string, unknown>) => void;
6
+ export declare const error: (msg: string, meta?: Record<string, unknown>) => void;
7
+ export declare const log: (msg: string, meta?: Record<string, unknown>) => void;
8
+ export declare const getInvalidFunctionStoreValueMessage: () => string;
9
+ export declare const getMapSetStoreWarningMessage: () => string;
10
+ export declare const getDateStoreWarningMessage: () => string;
11
+ export declare const getSanitizeDateWarningMessage: () => string;
12
+ export declare const getSanitizeMapWarningMessage: () => string;
13
+ export declare const getSanitizeSetWarningMessage: () => string;
14
+ export declare const getPathDepthExceededMessage: (depth: number, maxDepth: number, parts: string[]) => string;
15
+ export declare const getDeepNestingWarningMessage: (depth: number, parts: string[]) => string;
16
+ export declare const getPathReachedNullMessage: (parts: string[], part: string) => string;
17
+ export declare const getPathNotObjectMessage: (part: string) => string;
18
+ export declare const getInvalidStoreNameMessage: (name: string) => string;
19
+ export declare const getStoreNameContainsSpacesMessage: (name: string) => string;
20
+ export declare const getForbiddenStoreNameMessage: (name: string) => string;
21
+ export declare const suggestStoreName: (name: string, existingNames: string[]) => void;
@@ -0,0 +1,9 @@
1
+ export type IssueSeverity = "warn" | "critical";
2
+ export type IssueVisibility = "dev" | "always";
3
+ export type IssueOptions = {
4
+ severity?: IssueSeverity;
5
+ visibility?: IssueVisibility;
6
+ onError?: (message: string) => void;
7
+ };
8
+ export declare const safeInvoke: <T extends unknown[]>(fn: ((...args: T) => void) | undefined, label: string, ...args: T) => void;
9
+ export declare const reportIssue: (message: string, options?: IssueOptions) => void;
@@ -0,0 +1,7 @@
1
+ import { type StoreRegistry } from "../core/store-registry.js";
2
+ export declare const createStoreAdmin: (registry: StoreRegistry) => {
3
+ deleteExistingStore: (name: string) => void;
4
+ clearAllStores: () => string[];
5
+ clearStores: (pattern?: string) => string[];
6
+ reportStoreError: (name: string, message: string) => void;
7
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @module internals/store-ops
3
+ *
4
+ * LAYER: Internal subsystem
5
+ * OWNS: Module-level behavior and exports for internals/store-ops.
6
+ *
7
+ * Consumers: Internal imports and public API.
8
+ */
9
+ export { createStore } from "../core/store-create.js";
10
+ export { replaceStore } from "../core/store-replace.js";
11
+ export { setStore, setStoreWithContext } from "../core/store-set.js";
12
+ export { getStore, hasStore } from "../core/store-read.js";
13
+ export { subscribeStore } from "../core/store-notify.js";
@@ -0,0 +1,2 @@
1
+ export declare const registerTestResetHook: (name: string, fn: () => void, order?: number) => void;
2
+ export declare const runTestResets: () => void;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @module internals/write-context
3
+ *
4
+ * LAYER: Internal subsystem
5
+ * OWNS: Correlation/trace context for write chains.
6
+ *
7
+ * Consumers: store-write.ts, notification/delivery.ts, async-fetch.ts.
8
+ */
9
+ import type { TraceContext } from "../types/utility.js";
10
+ export type WriteContext = {
11
+ correlationId?: string;
12
+ traceContext?: TraceContext;
13
+ };
14
+ export type WriteContextRunner = {
15
+ run: <T>(context: WriteContext, fn: () => T) => T;
16
+ get: () => WriteContext | null;
17
+ };
18
+ export declare const injectWriteContextRunner: (runner: WriteContextRunner | null) => void;
19
+ export declare const getWriteContext: () => WriteContext | null;
20
+ export declare const runWithWriteContext: <T>(context: WriteContext | null | undefined, fn: () => T) => T;
@@ -0,0 +1,3 @@
1
+ import { type StoreRegistry } from "../core/store-registry.js";
2
+ import type { FlushPlan } from "./priority.js";
3
+ export declare const deliverFlush: (registry: StoreRegistry, plan: FlushPlan, flushVersion: number, onComplete: () => void) => void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @module notification/index
3
+ *
4
+ * LAYER: Notification pipeline
5
+ * OWNS: Orchestrating flush scheduling without owning sub-responsibilities.
6
+ *
7
+ * Consumers: store-notify.ts
8
+ */
9
+ import type { StoreRegistry } from "../core/store-registry.js";
10
+ export declare const scheduleFlush: (registry: StoreRegistry) => void;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @module notification/metrics
3
+ *
4
+ * LAYER: Notification pipeline
5
+ * OWNS: Notify timing and metric aggregation.
6
+ *
7
+ * Consumers: notification/delivery.ts
8
+ */
9
+ import type { FeatureMetrics, StoreFeatureMeta } from "../features/feature-registry.js";
10
+ export declare const createMetrics: (metrics?: FeatureMetrics) => FeatureMetrics;
11
+ export declare const recordMetrics: (metrics: FeatureMetrics, elapsedMs: number) => FeatureMetrics;
12
+ export declare const commitMetrics: (metaEntry: StoreFeatureMeta | undefined, metrics: FeatureMetrics) => void;
@@ -0,0 +1,9 @@
1
+ import type { NotifyState } from "../core/store-registry.js";
2
+ export type FlushPlan = {
3
+ names: string[];
4
+ sliceSize: number;
5
+ chunkDelayMs: number;
6
+ runInline: boolean;
7
+ prioritySet: Set<string> | null;
8
+ };
9
+ export declare const buildFlushPlan: (state: NotifyState) => FlushPlan;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @module notification/scheduler
3
+ *
4
+ * LAYER: Notification pipeline
5
+ * OWNS: Flush scheduling and chunk timers.
6
+ *
7
+ * Consumers: notification/index.ts, notification/delivery.ts
8
+ */
9
+ import { type StoreRegistry } from "../core/store-registry.js";
10
+ export declare const scheduleChunk: (fn: () => void, delayMs: number) => void;
11
+ export declare const scheduleFlush: (registry: StoreRegistry, flush: (registry: StoreRegistry) => void) => void;
@@ -0,0 +1,8 @@
1
+ import type { SnapshotMode } from "../adapters/options.js";
2
+ import type { StoreValue } from "../core/store-lifecycle/types.js";
3
+ export declare const resolveSnapshotMode: (metaEntry: {
4
+ options?: {
5
+ snapshot?: SnapshotMode;
6
+ };
7
+ } | undefined, fallback: SnapshotMode) => SnapshotMode;
8
+ export declare const cloneSnapshot: (value: StoreValue, mode: SnapshotMode) => StoreValue;
@@ -0,0 +1,2 @@
1
+ export declare const clearAllStores: () => void;
2
+ export declare const clearStores: (pattern?: string) => void;
@@ -0,0 +1,63 @@
1
+ import type { StoreFeatureMeta } from "../features/feature-registry.js";
2
+ import { getAsyncMetrics } from "../async/fetch.js";
3
+ import type { ComputedDescriptor, RuntimeGraph, RuntimeNodeId } from "../computed/types.js";
4
+ export declare const listStores: (pattern?: string) => string[];
5
+ export declare const getStoreMeta: (name: string) => StoreFeatureMeta | null;
6
+ export declare const getInitialState: () => Record<string, unknown>;
7
+ export declare const getMetrics: (name: string) => StoreFeatureMeta["metrics"] | null;
8
+ export declare const getSubscriberCount: (name: string) => number;
9
+ export declare const getAsyncInflightCount: (name: string) => number;
10
+ export type ColdStoreReport = {
11
+ name: string;
12
+ createdAt: string;
13
+ lastReadAt: string | null;
14
+ updateCount: number;
15
+ readCount: number;
16
+ subscriberCount: number;
17
+ ageMs: number;
18
+ verdict: "cold" | "write-only" | "stale" | "active";
19
+ };
20
+ export declare const findColdStores: (options?: {
21
+ unreadThresholdMs?: number;
22
+ includeWriteOnly?: boolean;
23
+ }) => ColdStoreReport[];
24
+ export type StoreHealthEntry = {
25
+ name: string;
26
+ meta: StoreFeatureMeta | null;
27
+ metrics: StoreFeatureMeta["metrics"] | null;
28
+ async: {
29
+ inflight: number;
30
+ lastCorrelationId: string | null;
31
+ traceContext: StoreFeatureMeta["lastTraceContext"] | null;
32
+ };
33
+ persist: {
34
+ queueDepth: number;
35
+ };
36
+ };
37
+ export type StoreHealthReport = {
38
+ stores: StoreHealthEntry[];
39
+ async: ReturnType<typeof getAsyncMetrics>;
40
+ registry: {
41
+ totalStores: number;
42
+ coldStores: ColdStoreReport[];
43
+ };
44
+ };
45
+ export declare const getStoreHealth: (name?: string) => StoreHealthEntry | StoreHealthReport | null;
46
+ export declare const getPersistQueueDepth: (name: string) => number;
47
+ export declare const getComputedGraph: () => {
48
+ nodes: string[];
49
+ edges: Array<{
50
+ from: string;
51
+ to: string;
52
+ }>;
53
+ dependencies: Record<string, string[]>;
54
+ dependents: Record<string, string[]>;
55
+ };
56
+ export declare const getRuntimeGraph: () => RuntimeGraph;
57
+ export declare const getComputedDeps: (name: string) => {
58
+ deps: string[];
59
+ dependents: string[];
60
+ } | null;
61
+ export declare const getComputedDescriptor: (nodeId: RuntimeNodeId) => ComputedDescriptor | null;
62
+ export declare const evaluateComputed: (nodeId: RuntimeNodeId, snapshot: Record<string, unknown>) => unknown;
63
+ export type { ComputedClassification, ComputedDescriptor, RuntimeEdgeType, RuntimeGraph, RuntimeGraphEdge, RuntimeGraphGranularity, RuntimeGraphNode, RuntimeNodeId, RuntimeNodeType, } from "../computed/types.js";
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @module store
3
+ *
4
+ * LAYER: Store runtime
5
+ * OWNS: Module-level behavior and exports for store.
6
+ *
7
+ * Consumers: Internal imports and public API.
8
+ */
9
+ export type { Path, PathDepth, PathValue, PartialDeep, HydrateSnapshotFor, HydrationFailure, HydrationResult, StoreDefinition, StoreValue, StoreKey, StoreName, StateFor, StoreStateMap, StrictStoreMap, WriteResult, } from "./core/store-lifecycle/types.js";
10
+ export type { FeatureOptions, FeatureOptionsMap, PersistConfig, PersistOptions, MiddlewareCtx, StoreOptions, SnapshotMode, SyncOptions, } from "./adapters/options.js";
11
+ export { setStore, replaceStore, deleteStore, resetStore, hydrateStores, } from "./core/store-write.js";
12
+ export { createStore, createStoreStrict } from "./core/store-create.js";
13
+ export { setStoreBatch, subscribeStore, subscribeInternal as _subscribe, subscribe, getStoreSnapshot, getSnapshot as _getSnapshot, } from "./core/store-notify.js";
14
+ export { getStore, hasStore, isLazyStore, isStoreMaterialized, isLazyPending, _hasStoreEntryInternal, _getStoreValueRef, _getFeatureApi, getInitialState, getMetrics, } from "./core/store-read.js";
15
+ export { clearAllStores, clearStores } from "./runtime-admin/index.js";
16
+ export { store, namespace } from "./core/store-name.js";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @module types/utility
3
+ *
4
+ * LAYER: Types
5
+ * OWNS: Shared utility types for cross-module reuse.
6
+ *
7
+ * Consumers: store-create.ts, store-name.ts, computed.ts, testing.ts.
8
+ */
9
+ export type NonFunction<T> = T extends Function ? never : T;
10
+ export type DeepReadonly<T> = {
11
+ readonly [K in keyof T]: DeepReadonly<T[K]>;
12
+ };
13
+ export type StoreId = string | symbol;
14
+ export type TraceContext = {
15
+ traceId: string;
16
+ spanId: string;
17
+ } & Record<string, unknown>;
@@ -0,0 +1,4 @@
1
+ export declare const shallowClone: <T>(value: T) => T;
2
+ export declare const deepClone: <T>(value: T) => T;
3
+ export declare const shallowEqual: (a: unknown, b: unknown) => boolean;
4
+ export declare const produceClone: <T>(base: T, recipe: (draft: T) => void) => T;
@@ -0,0 +1,2 @@
1
+ export declare const devShallowFreeze: <T>(value: T) => T;
2
+ export declare const devDeepFreeze: <T>(value: T) => T;
@@ -0,0 +1,8 @@
1
+ export declare const crc32: (str: string) => number;
2
+ /**
3
+ * Non-cryptographic checksum for integrity (best-effort). Do not use for security.
4
+ * String inputs preserve the legacy CRC32(JSON.stringify(value)) behavior to keep
5
+ * persisted checksums stable across versions.
6
+ */
7
+ export declare const hashState: (value: unknown) => number;
8
+ export declare const checksumState: (value: unknown) => number;
@@ -0,0 +1,5 @@
1
+ export type PathInput = string | readonly string[] | string[];
2
+ export declare const parsePath: (path: PathInput) => string[];
3
+ export declare const validateDepth: (path: PathInput) => boolean;
4
+ export declare const getByPath: (obj: unknown, path: PathInput) => unknown;
5
+ export declare const setByPath: <T extends Record<string, unknown> | unknown[]>(obj: T, path: PathInput, value: unknown) => T;
@@ -0,0 +1,14 @@
1
+ export declare const FORBIDDEN_OBJECT_KEYS: Set<string>;
2
+ export declare const runSchemaValidation: (schema: unknown, value: unknown) => {
3
+ ok: boolean;
4
+ data?: unknown;
5
+ error?: unknown;
6
+ };
7
+ declare const SUPPORTED_TYPES: readonly ["object", "array", "string", "number", "boolean", "null"];
8
+ export type SupportedType = typeof SUPPORTED_TYPES[number] | "function" | "map" | "set" | "date" | "undefined" | "bigint" | "symbol";
9
+ export declare const getType: (value: unknown) => SupportedType;
10
+ export declare const isValidData: (value: unknown) => boolean;
11
+ export declare const canReuseSanitized: (value: unknown) => boolean;
12
+ export declare const sanitize: (value: unknown) => unknown;
13
+ export declare const isValidStoreName: (name: string) => boolean;
14
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @module utils
3
+ *
4
+ * LAYER: Utilities
5
+ * OWNS: Module-level behavior and exports for utils.
6
+ *
7
+ * Consumers: Internal imports and public API.
8
+ */
9
+ export { __DEV__, isDev, warn, warnAlways, error, log, critical, suggestStoreName, } from "./internals/diagnostics.js";
10
+ export { crc32, hashState, checksumState } from "./utils/hash.js";
11
+ export { shallowClone, deepClone, shallowEqual, produceClone } from "./utils/clone.js";
12
+ export { parsePath, validateDepth, getByPath, setByPath, type PathInput } from "./utils/path.js";
13
+ export { runSchemaValidation, getType, isValidData, canReuseSanitized, sanitize, isValidStoreName, type SupportedType, } from "./utils/validation.js";
package/dist/types.d.ts CHANGED
@@ -59,7 +59,7 @@ type WriteResult = {
59
59
  ok: true;
60
60
  } | {
61
61
  ok: false;
62
- reason: "not-found" | "validate" | "path" | "middleware" | "ssr" | "invalid-args" | "lazy-uninitialized";
62
+ reason: "not-found" | "validate" | "path" | "middleware" | "ssr" | "invalid-args" | "lazy-uninitialized" | "unsupported-op" | "unsupported-path-shape";
63
63
  };
64
64
 
65
- export type { HydrateSnapshotFor as H, PartialDeep as P, StoreStateMap as S, WriteResult as W, StoreDefinition as a, StoreKey as b, StoreName as c, StoreValue as d, StateFor as e, StrictStoreMap as f, HydrationResult as g, HydrationFailure as h, Path as i, PathValue as j };
65
+ export type { HydrateSnapshotFor as H, PartialDeep as P, StoreValue as S, WriteResult as W, StoreDefinition as a, StoreKey as b, StoreStateMap as c, StoreName as d, StateFor as e, StrictStoreMap as f, HydrationResult as g, HydrationFailure as h, Path as i, PathValue as j };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stroid",
3
- "version": "0.1.3",
4
- "description": "SSR-Safe, Named-store state engine for JavaScript/React with optional persistence, async caching, sync, and devtools.",
3
+ "version": "0.1.4",
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",
@@ -24,6 +24,10 @@
24
24
  "types": "./dist/index.d.ts",
25
25
  "import": "./dist/index.js"
26
26
  },
27
+ "./psr": {
28
+ "types": "./dist/psr.d.ts",
29
+ "import": "./dist/psr.js"
30
+ },
27
31
  "./core": {
28
32
  "types": "./dist/core.d.ts",
29
33
  "import": "./dist/core.js"
@@ -80,14 +84,6 @@
80
84
  "types": "./dist/react/index.d.ts",
81
85
  "import": "./dist/react/index.js"
82
86
  },
83
- "./vue": {
84
- "types": "./dist/vue/index.d.ts",
85
- "import": "./dist/vue/index.js"
86
- },
87
- "./svelte": {
88
- "types": "./dist/svelte/index.d.ts",
89
- "import": "./dist/svelte/index.js"
90
- },
91
87
  "./testing": {
92
88
  "types": "./dist/testing.d.ts",
93
89
  "import": "./dist/testing.js"
@@ -96,11 +92,17 @@
96
92
  },
97
93
  "types": "dist/index.d.ts",
98
94
  "files": [
99
- "dist",
95
+ "dist/**/*.js",
96
+ "dist/**/*.d.ts",
97
+ "dist/**/*.d.cts",
98
+ "dist/**/*.json",
100
99
  "README.md",
101
100
  "CHANGELOG.md",
102
101
  "LICENSE"
103
102
  ],
103
+ "publishConfig": {
104
+ "tag": "beta"
105
+ },
104
106
  "repository": {
105
107
  "type": "git",
106
108
  "url": "git+https://github.com/Himesh-Bhattarai/stroid.git"
@@ -110,26 +112,35 @@
110
112
  },
111
113
  "homepage": "https://github.com/Himesh-Bhattarai/stroid#readme",
112
114
  "sideEffects": [
113
- "./src/persist.ts",
114
- "./src/sync.ts",
115
- "./src/devtools/index.ts",
116
- "./src/core/store-notify.ts",
117
- "./dist/persist.js",
118
- "./dist/sync.js",
119
- "./dist/devtools.js"
115
+ "./src/core/store-notify.ts"
120
116
  ],
121
117
  "scripts": {
122
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",
123
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",
124
- "test:performance": "node --import ./tests/preload.mjs --import tsx --import ./tests/setup.ts --test-concurrency=1 --test tests/performance/**/*.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",
125
121
  "test:heavy": "npm run test:performance",
122
+ "test:package": "node --import ./tests/preload.mjs --import tsx --import ./tests/setup.ts --test-concurrency=1 --test tests/package/**/*.test.ts",
126
123
  "check:react-types": "node scripts/check-react-types.mjs",
127
124
  "docs:api": "api-extractor run --local",
128
125
  "test:dts": "tsc -p tsconfig.dtscheck.json --noEmit",
129
- "test:types": "npm run build && npm run check:react-types && npm run docs:api && npm run test:dts && tsc -p tsconfig.typetests.json",
126
+ "test:types": "npm run build && npm run test:package && npm run check:react-types && npm run docs:api && npm run test:dts && tsc -p tsconfig.typetests.json",
130
127
  "typecheck": "tsc -p tsconfig.types.json",
131
128
  "typecheck:layers": "tsc -b tsconfig.layers.json",
132
129
  "build": "tsup && node scripts/normalize-dts.mjs",
130
+ "benchmark:compare": "node --expose-gc --import tsx scripts/compare-state-libraries.ts",
131
+ "benchmark:core-small": "node --expose-gc --import tsx scripts/core-small-benchmark.ts",
132
+ "benchmark:subscriber": "node --expose-gc --import tsx scripts/subscriber-benchmark.ts",
133
+ "benchmark:subscriber:concurrent": "node --expose-gc --import tsx scripts/subscriber-concurrent-benchmark.ts",
134
+ "benchmark:selector": "node --expose-gc --import tsx scripts/selector-benchmark.ts",
135
+ "benchmark:deep-update": "node --expose-gc --import tsx scripts/deep-update-benchmark.ts",
136
+ "benchmark:lifecycle": "node --expose-gc --import tsx scripts/lifecycle-benchmark.ts",
137
+ "benchmark:ssr-isolation": "node --expose-gc --import tsx scripts/ssr-isolation-benchmark.ts",
138
+ "benchmark:atomic-failure": "node --expose-gc --import tsx scripts/atomic-failure-benchmark.ts",
139
+ "benchmark:race": "node --expose-gc --import tsx scripts/race-condition-benchmark.ts",
140
+ "benchmark:determinism": "node --expose-gc --import tsx scripts/determinism-replay-benchmark.ts",
141
+ "benchmark:memory-leak": "node --expose-gc --import tsx scripts/memory-leak-benchmark.ts",
142
+ "benchmark:governance": "node --expose-gc --import tsx scripts/governance-lifecycle-benchmark.ts",
143
+ "benchmark:guarantees": "node --expose-gc --import tsx scripts/guarantee-benchmark-suite.ts",
133
144
  "test:all": "npm test && npm run test:types",
134
145
  "test:full": "npm run test:coverage && npm run test:types"
135
146
  },