unistash 2.0.0
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/README.md +50 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/react/createStore.d.ts +7 -0
- package/dist/react/createStore.d.ts.map +1 -0
- package/dist/react/createStore.js +32 -0
- package/dist/shallow.d.ts +2 -0
- package/dist/shallow.d.ts.map +1 -0
- package/dist/shallow.js +23 -0
- package/dist/types.d.ts +29 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/vanilla/store.d.ts +16 -0
- package/dist/vanilla/store.d.ts.map +1 -0
- package/dist/vanilla/store.js +65 -0
- package/package.json +56 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# unistash
|
|
2
|
+
|
|
3
|
+
**Write once. Stash anywhere.** A tiny, typed, zero-dependency React state library.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npm install unistash
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { createStore } from "unistash";
|
|
11
|
+
|
|
12
|
+
const useCounter = createStore({
|
|
13
|
+
state: { count: 0 },
|
|
14
|
+
actions: {
|
|
15
|
+
increment: (s) => ({ count: s.count + 1 }),
|
|
16
|
+
add: (s, n: number) => ({ count: s.count + n }),
|
|
17
|
+
},
|
|
18
|
+
computed: {
|
|
19
|
+
doubled: (s) => s.count * 2,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
function Counter() {
|
|
24
|
+
const { count, doubled, increment } = useCounter();
|
|
25
|
+
return <button onClick={() => increment()}>{count} ({doubled})</button>;
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Selectors
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
// re-renders only when `count` changes
|
|
33
|
+
const count = useCounter((s) => s.count);
|
|
34
|
+
|
|
35
|
+
// custom equality
|
|
36
|
+
import { shallow } from "unistash";
|
|
37
|
+
const { a, b } = useCounter((s) => ({ a: s.count, b: s.doubled }), shallow);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Imperative API
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
useCounter.getState();
|
|
44
|
+
useCounter.setState({ count: 5 });
|
|
45
|
+
const unsubscribe = useCounter.subscribe((snapshot) => {
|
|
46
|
+
/* ... */
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Requires React 18 or 19 (peer dependency). Zero runtime dependencies.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,eAAe,EACf,QAAQ,EACR,WAAW,EACX,SAAS,GACV,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { StoreHook } from "../types";
|
|
2
|
+
export declare function createStore<TState extends object, TActions extends Record<string, (state: TState, ...args: never[]) => Partial<TState>>, TComputed extends Record<string, (state: TState) => unknown>>(config: {
|
|
3
|
+
state: TState;
|
|
4
|
+
actions?: TActions;
|
|
5
|
+
computed?: TComputed;
|
|
6
|
+
}): StoreHook<TState, TActions, TComputed>;
|
|
7
|
+
//# sourceMappingURL=createStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createStore.d.ts","sourceRoot":"","sources":["../../src/react/createStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,SAAS,EAAE,MAAM,UAAU,CAAC;AAGpD,wBAAgB,WAAW,CACzB,MAAM,SAAS,MAAM,EACrB,QAAQ,SAAS,MAAM,CACrB,MAAM,EACN,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CACrD,EACD,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,EAC5D,MAAM,EAAE;IACR,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB,GAAG,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CA6DzC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useRef, useSyncExternalStore } from "react";
|
|
2
|
+
import { createVanillaStore } from "../vanilla/store";
|
|
3
|
+
export function createStore(config) {
|
|
4
|
+
// The vanilla store is internally loosely typed; we apply the real types here.
|
|
5
|
+
const store = createVanillaStore(config);
|
|
6
|
+
const identity = (snapshot) => snapshot;
|
|
7
|
+
function useStore(selector = identity, equalityFn = Object.is) {
|
|
8
|
+
// Per-component memo so the value handed to useSyncExternalStore is
|
|
9
|
+
// referentially stable when the selected slice is unchanged.
|
|
10
|
+
const memo = useRef(null);
|
|
11
|
+
const getSelection = (snapshot) => {
|
|
12
|
+
const cached = memo.current;
|
|
13
|
+
if (cached && cached.snapshot === snapshot) {
|
|
14
|
+
return cached.selection;
|
|
15
|
+
}
|
|
16
|
+
const next = selector(snapshot);
|
|
17
|
+
if (cached && equalityFn(cached.selection, next)) {
|
|
18
|
+
// Keep the previous selection reference; just advance the snapshot pointer.
|
|
19
|
+
memo.current = { snapshot, selection: cached.selection };
|
|
20
|
+
return cached.selection;
|
|
21
|
+
}
|
|
22
|
+
memo.current = { snapshot, selection: next };
|
|
23
|
+
return next;
|
|
24
|
+
};
|
|
25
|
+
return useSyncExternalStore(store.subscribe, () => getSelection(store.getSnapshot()), () => getSelection(store.getServerSnapshot()));
|
|
26
|
+
}
|
|
27
|
+
const hook = useStore;
|
|
28
|
+
hook.getState = store.getState;
|
|
29
|
+
hook.setState = store.setState;
|
|
30
|
+
hook.subscribe = store.subscribe;
|
|
31
|
+
return hook;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shallow.d.ts","sourceRoot":"","sources":["../src/shallow.ts"],"names":[],"mappings":"AAAA,wBAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CA4B9C"}
|
package/dist/shallow.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function shallow(a, b) {
|
|
2
|
+
if (Object.is(a, b))
|
|
3
|
+
return true;
|
|
4
|
+
if (typeof a !== "object" ||
|
|
5
|
+
a === null ||
|
|
6
|
+
typeof b !== "object" ||
|
|
7
|
+
b === null) {
|
|
8
|
+
return false;
|
|
9
|
+
}
|
|
10
|
+
const keysA = Object.keys(a);
|
|
11
|
+
const keysB = Object.keys(b);
|
|
12
|
+
if (keysA.length !== keysB.length)
|
|
13
|
+
return false;
|
|
14
|
+
for (const key of keysA) {
|
|
15
|
+
if (
|
|
16
|
+
// biome-ignore lint/suspicious/noPrototypeBuiltins: Object.hasOwn is ES2022; this package targets ES2020
|
|
17
|
+
!Object.prototype.hasOwnProperty.call(b, key) ||
|
|
18
|
+
!Object.is(a[key], b[key])) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** An action: receives current state plus args, returns a partial to shallow-merge. */
|
|
2
|
+
export type ActionFn<TState> = (state: TState, ...args: never[]) => Partial<TState>;
|
|
3
|
+
/** A computed selector: derives a value from state. */
|
|
4
|
+
export type ComputedFn<TState> = (state: TState) => unknown;
|
|
5
|
+
/** Configuration passed to createStore. */
|
|
6
|
+
export interface StoreConfig<TState extends object, TActions extends Record<string, ActionFn<TState>>, TComputed extends Record<string, ComputedFn<TState>>> {
|
|
7
|
+
state: TState;
|
|
8
|
+
actions?: TActions;
|
|
9
|
+
computed?: TComputed;
|
|
10
|
+
}
|
|
11
|
+
/** Strips the leading `state` param from each action: (state, ...args) => P -> (...args) => void. */
|
|
12
|
+
export type BoundActions<TActions> = {
|
|
13
|
+
[K in keyof TActions]: TActions[K] extends (state: never, ...args: infer P) => unknown ? (...args: P) => void : never;
|
|
14
|
+
};
|
|
15
|
+
/** Maps each computed fn to its return type. */
|
|
16
|
+
export type ComputedReturns<TComputed> = {
|
|
17
|
+
[K in keyof TComputed]: TComputed[K] extends (state: never) => infer R ? R : never;
|
|
18
|
+
};
|
|
19
|
+
/** The merged value the hook returns / the selector receives. */
|
|
20
|
+
export type Snapshot<TState, TActions, TComputed> = TState & ComputedReturns<TComputed> & BoundActions<TActions>;
|
|
21
|
+
/** The hook returned by createStore: bare call + selector overload + imperative statics. */
|
|
22
|
+
export interface StoreHook<TState extends object, TActions, TComputed> {
|
|
23
|
+
(): Snapshot<TState, TActions, TComputed>;
|
|
24
|
+
<U>(selector: (snapshot: Snapshot<TState, TActions, TComputed>) => U, equalityFn?: (a: U, b: U) => boolean): U;
|
|
25
|
+
getState: () => TState;
|
|
26
|
+
setState: (partial: Partial<TState> | ((state: TState) => Partial<TState>)) => void;
|
|
27
|
+
subscribe: (listener: (snapshot: Snapshot<TState, TActions, TComputed>) => void) => () => void;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,MAAM,QAAQ,CAAC,MAAM,IAAI,CAC7B,KAAK,EAAE,MAAM,EACb,GAAG,IAAI,EAAE,KAAK,EAAE,KACb,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,uDAAuD;AACvD,MAAM,MAAM,UAAU,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC;AAE5D,2CAA2C;AAC3C,MAAM,WAAW,WAAW,CAC1B,MAAM,SAAS,MAAM,EACrB,QAAQ,SAAS,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,EACjD,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;IAEpD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,QAAQ,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,uGAAuG;AACvG,MAAM,MAAM,YAAY,CAAC,QAAQ,IAAI;KAClC,CAAC,IAAI,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,SAAS,CACzC,KAAK,EAAE,KAAK,EACZ,GAAG,IAAI,EAAE,MAAM,CAAC,KACb,OAAO,GACR,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,IAAI,GACpB,KAAK;CACV,CAAC;AAEF,gDAAgD;AAChD,MAAM,MAAM,eAAe,CAAC,SAAS,IAAI;KACtC,CAAC,IAAI,MAAM,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,KAAK,MAAM,CAAC,GAClE,CAAC,GACD,KAAK;CACV,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,IAAI,MAAM,GACxD,eAAe,CAAC,SAAS,CAAC,GAC1B,YAAY,CAAC,QAAQ,CAAC,CAAC;AAEzB,4FAA4F;AAC5F,MAAM,WAAW,SAAS,CAAC,MAAM,SAAS,MAAM,EAAE,QAAQ,EAAE,SAAS;IACnE,IAAI,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;IAC1C,CAAC,CAAC,EACA,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,KAAK,CAAC,EAChE,UAAU,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO,GACnC,CAAC,CAAC;IACL,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,QAAQ,EAAE,CACR,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC,KAC5D,IAAI,CAAC;IACV,SAAS,EAAE,CACT,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,KAAK,IAAI,KAChE,MAAM,IAAI,CAAC;CACjB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
type AnyState = Record<string, unknown>;
|
|
2
|
+
export interface VanillaStore<TSnapshot> {
|
|
3
|
+
getState: () => AnyState;
|
|
4
|
+
setState: (partial: AnyState | ((state: AnyState) => AnyState)) => void;
|
|
5
|
+
subscribe: (listener: (snapshot: TSnapshot) => void) => () => void;
|
|
6
|
+
getSnapshot: () => TSnapshot;
|
|
7
|
+
getServerSnapshot: () => TSnapshot;
|
|
8
|
+
}
|
|
9
|
+
export interface VanillaConfig {
|
|
10
|
+
state: AnyState;
|
|
11
|
+
actions?: Record<string, (state: AnyState, ...args: unknown[]) => AnyState>;
|
|
12
|
+
computed?: Record<string, (state: AnyState) => unknown>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createVanillaStore<TSnapshot = AnyState>(config: VanillaConfig): VanillaStore<TSnapshot>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/vanilla/store.ts"],"names":[],"mappings":"AAAA,KAAK,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExC,MAAM,WAAW,YAAY,CAAC,SAAS;IACrC,QAAQ,EAAE,MAAM,QAAQ,CAAC;IACzB,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,KAAK,QAAQ,CAAC,KAAK,IAAI,CAAC;IACxE,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,SAAS,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;IACnE,WAAW,EAAE,MAAM,SAAS,CAAC;IAC7B,iBAAiB,EAAE,MAAM,SAAS,CAAC;CACpC;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,QAAQ,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,QAAQ,CAAC,CAAC;IAC5E,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,OAAO,CAAC,CAAC;CACzD;AAsBD,wBAAgB,kBAAkB,CAAC,SAAS,GAAG,QAAQ,EACrD,MAAM,EAAE,aAAa,GACpB,YAAY,CAAC,SAAS,CAAC,CAwDzB"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
function assertNoCollisions(config) {
|
|
2
|
+
const seen = new Set();
|
|
3
|
+
const groups = [
|
|
4
|
+
["state", Object.keys(config.state)],
|
|
5
|
+
["computed", config.computed ? Object.keys(config.computed) : []],
|
|
6
|
+
["actions", config.actions ? Object.keys(config.actions) : []],
|
|
7
|
+
];
|
|
8
|
+
for (const [, keys] of groups) {
|
|
9
|
+
for (const key of keys) {
|
|
10
|
+
if (seen.has(key)) {
|
|
11
|
+
throw new Error(`unistash: key "${key}" collides across state/computed/actions. ` +
|
|
12
|
+
`State, computed, and action names must be unique.`);
|
|
13
|
+
}
|
|
14
|
+
seen.add(key);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export function createVanillaStore(config) {
|
|
19
|
+
assertNoCollisions(config);
|
|
20
|
+
let state = { ...config.state };
|
|
21
|
+
const listeners = new Set();
|
|
22
|
+
// Bound actions are created once and reused (stable references).
|
|
23
|
+
const boundActions = {};
|
|
24
|
+
if (config.actions) {
|
|
25
|
+
for (const key of Object.keys(config.actions)) {
|
|
26
|
+
const fn = config.actions[key];
|
|
27
|
+
boundActions[key] = (...args) => {
|
|
28
|
+
setState(fn(state, ...args));
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function buildSnapshot() {
|
|
33
|
+
const computedValues = {};
|
|
34
|
+
if (config.computed) {
|
|
35
|
+
for (const key of Object.keys(config.computed)) {
|
|
36
|
+
computedValues[key] = config.computed[key](state);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
...state,
|
|
41
|
+
...computedValues,
|
|
42
|
+
...boundActions,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
let snapshot = buildSnapshot();
|
|
46
|
+
const serverSnapshot = snapshot; // stable reference for SSR
|
|
47
|
+
const getState = () => state;
|
|
48
|
+
function setState(partial) {
|
|
49
|
+
const next = typeof partial === "function" ? partial(state) : partial;
|
|
50
|
+
state = { ...state, ...next };
|
|
51
|
+
snapshot = buildSnapshot();
|
|
52
|
+
for (const listener of listeners) {
|
|
53
|
+
listener(snapshot);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const subscribe = (listener) => {
|
|
57
|
+
listeners.add(listener);
|
|
58
|
+
return () => {
|
|
59
|
+
listeners.delete(listener);
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const getSnapshot = () => snapshot;
|
|
63
|
+
const getServerSnapshot = () => serverSnapshot;
|
|
64
|
+
return { getState, setState, subscribe, getSnapshot, getServerSnapshot };
|
|
65
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "unistash",
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"description": "Write once. Stash anywhere. A tiny, typed, zero-dependency React state library.",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"module": "dist/index.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"import": "./dist/index.js",
|
|
15
|
+
"require": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"unistash",
|
|
20
|
+
"state-management",
|
|
21
|
+
"react",
|
|
22
|
+
"store",
|
|
23
|
+
"typescript",
|
|
24
|
+
"hooks",
|
|
25
|
+
"zero-dependency"
|
|
26
|
+
],
|
|
27
|
+
"author": "ShobhitPatra<shobhitpatra.dev@gmail.com>",
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/ShobhitPatra/unistash",
|
|
32
|
+
"directory": "packages/unistash"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://unistash-seven.vercel.app",
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18.0.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/react": "^19.2.15",
|
|
40
|
+
"@types/react-dom": "^19.2.3",
|
|
41
|
+
"react": "^19.2.6",
|
|
42
|
+
"react-dom": "^19.2.6",
|
|
43
|
+
"typescript": "^5.0.0",
|
|
44
|
+
"@unistash/tsconfig": "0.0.0"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist"
|
|
48
|
+
],
|
|
49
|
+
"scripts": {
|
|
50
|
+
"build": "tsc -p tsconfig.build.json",
|
|
51
|
+
"clean": "rm -rf dist",
|
|
52
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
53
|
+
"typecheck": "tsc --noEmit",
|
|
54
|
+
"test": "vitest run"
|
|
55
|
+
}
|
|
56
|
+
}
|