@solidjs/signals 0.13.13 → 2.0.0-beta.8
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 +8 -7
- package/dist/dev.js +312 -174
- package/dist/node.cjs +1068 -953
- package/dist/prod.js +744 -619
- package/dist/types/boundaries.d.ts +44 -3
- package/dist/types/core/core.d.ts +2 -2
- package/dist/types/core/effect.d.ts +3 -2
- package/dist/types/core/graph.d.ts +1 -0
- package/dist/types/core/scheduler.d.ts +1 -0
- package/dist/types/core/types.d.ts +2 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/signals.d.ts +34 -26
- package/dist/types/store/optimistic.d.ts +3 -3
- package/dist/types/store/projection.d.ts +19 -5
- package/dist/types/store/store.d.ts +4 -4
- package/dist/types-cjs/boundaries.d.cts +93 -0
- package/dist/types-cjs/core/action.d.cts +1 -0
- package/dist/types-cjs/core/async.d.cts +6 -0
- package/dist/types-cjs/core/constants.d.cts +25 -0
- package/dist/types-cjs/core/context.d.cts +28 -0
- package/dist/types-cjs/core/core.d.cts +54 -0
- package/dist/types-cjs/core/dev.d.cts +49 -0
- package/dist/types-cjs/core/effect.d.cts +31 -0
- package/dist/types-cjs/core/error.d.cts +14 -0
- package/dist/types-cjs/core/external.d.cts +26 -0
- package/dist/types-cjs/core/graph.d.cts +4 -0
- package/dist/types-cjs/core/heap.d.cts +14 -0
- package/dist/types-cjs/core/index.d.cts +12 -0
- package/dist/types-cjs/core/lanes.d.cts +54 -0
- package/dist/types-cjs/core/owner.d.cts +26 -0
- package/dist/types-cjs/core/scheduler.d.cts +82 -0
- package/dist/types-cjs/core/types.d.cts +86 -0
- package/dist/types-cjs/index.d.cts +9 -0
- package/dist/types-cjs/map.d.cts +24 -0
- package/dist/types-cjs/package.json +3 -0
- package/dist/types-cjs/signals.d.cts +200 -0
- package/dist/types-cjs/store/index.d.cts +9 -0
- package/dist/types-cjs/store/optimistic.d.cts +19 -0
- package/dist/types-cjs/store/projection.d.cts +40 -0
- package/dist/types-cjs/store/reconcile.d.cts +1 -0
- package/dist/types-cjs/store/store.d.cts +68 -0
- package/dist/types-cjs/store/storePath.d.cts +30 -0
- package/dist/types-cjs/store/utils.d.cts +43 -0
- package/package.json +31 -24
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { $REFRESH } from "../core/index.cjs";
|
|
2
|
+
import { type NoFn, type ProjectionOptions, type Store, type StoreSetter } from "./store.cjs";
|
|
3
|
+
/**
|
|
4
|
+
* Creates an optimistic store that can be used to optimistically update a value
|
|
5
|
+
* and then revert it back to the previous value at end of transition.
|
|
6
|
+
*
|
|
7
|
+
* When called with a plain value, creates an optimistic store.
|
|
8
|
+
* When called with a function, creates a derived optimistic store with `ProjectionOptions` (name, key).
|
|
9
|
+
*
|
|
10
|
+
* @param fn a function that receives the current store and can be used to mutate it directly inside a transition
|
|
11
|
+
* @param store The plain store value, or the backing seed when using the derived-store form.
|
|
12
|
+
* @param options Optional projection options for reconciliation.
|
|
13
|
+
*
|
|
14
|
+
* @returns A tuple containing a store accessor and a setter function to apply changes.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createOptimisticStore<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): [get: Store<T>, set: StoreSetter<T>];
|
|
17
|
+
export declare function createOptimisticStore<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: Partial<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Store<T> & {
|
|
18
|
+
[$REFRESH]: any;
|
|
19
|
+
}, set: StoreSetter<T>];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { $REFRESH, type Computed } from "../core/index.cjs";
|
|
2
|
+
import { type ProjectionOptions, type Store } from "./store.cjs";
|
|
3
|
+
export declare function createProjectionInternal<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed: Partial<T>, options?: ProjectionOptions): {
|
|
4
|
+
store: Store<T> & {
|
|
5
|
+
[$REFRESH]: any;
|
|
6
|
+
};
|
|
7
|
+
node: Computed<void | T>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Creates a mutable derived store (projection). The derive function receives a mutable
|
|
11
|
+
* draft and can mutate it directly or return a new value for reconciliation.
|
|
12
|
+
*
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const store = createProjection<T>(fn, seed, options?: ProjectionOptions);
|
|
15
|
+
* ```
|
|
16
|
+
* @param fn a function that receives the current draft and mutates it or returns new data
|
|
17
|
+
* @param seed the backing store host value to wrap and reconcile into
|
|
18
|
+
* @param options `ProjectionOptions` -- name, key
|
|
19
|
+
*
|
|
20
|
+
* @see {@link https://github.com/solidjs/x-reactivity#createprojection}
|
|
21
|
+
*/
|
|
22
|
+
export declare function createProjection<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, seed: Partial<T>, options?: ProjectionOptions): Store<T> & {
|
|
23
|
+
[$REFRESH]: any;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Shared projection computed body used by both `createProjection` and the derived
|
|
27
|
+
* form of `createOptimisticStore`. Encapsulates the write-trap draft, `storeSetter`
|
|
28
|
+
* wrapping, the `handleAsync` subscription with a setter callback, and the commit
|
|
29
|
+
* path (which must always go through `storeSetter` so the `writeOnly` guard is
|
|
30
|
+
* engaged during `reconcile`'s property reads).
|
|
31
|
+
*
|
|
32
|
+
* `wrapCommit` is invoked for every commit (sync return and each async yield) and
|
|
33
|
+
* lets callers layer extra context around the write — e.g. the optimistic store
|
|
34
|
+
* re-enters `setProjectionWriteActive` so reconciles target `STORE_OVERRIDE`
|
|
35
|
+
* instead of `STORE_OPTIMISTIC_OVERRIDE` even when an async yield fires outside
|
|
36
|
+
* the outer `setProjectionWriteActive` scope.
|
|
37
|
+
*/
|
|
38
|
+
export declare function runProjectionComputed<T extends object>(wrappedStore: Store<T>, fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, key: string | ((item: NonNullable<any>) => any), wrapCommit?: (write: () => void) => void): Computed<void | T>;
|
|
39
|
+
export declare function createWriteTraps(isActive?: () => boolean): ProxyHandler<any>;
|
|
40
|
+
export declare const writeTraps: ProxyHandler<any>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function reconcile<T extends U, U>(value: T, key: string | ((item: NonNullable<any>) => any)): (state: U) => void;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { $REFRESH, STORE_SNAPSHOT_PROPS, type Computed, type Signal } from "../core/index.cjs";
|
|
2
|
+
export type Store<T> = Readonly<T>;
|
|
3
|
+
export type StoreSetter<T> = (fn: (state: T) => T | void) => void;
|
|
4
|
+
/** Base options for store primitives. */
|
|
5
|
+
export interface StoreOptions {
|
|
6
|
+
/** Debug name (dev mode only) */
|
|
7
|
+
name?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Options for derived/projected stores created with `createStore(fn)`, `createProjection`, or `createOptimisticStore(fn)`. */
|
|
10
|
+
export interface ProjectionOptions extends StoreOptions {
|
|
11
|
+
/** Key property name or function for reconciliation identity */
|
|
12
|
+
key?: string | ((item: NonNullable<any>) => any);
|
|
13
|
+
}
|
|
14
|
+
export type NoFn<T> = T extends Function ? never : T;
|
|
15
|
+
type DataNode = Signal<any>;
|
|
16
|
+
type DataNodes = Record<PropertyKey, DataNode>;
|
|
17
|
+
export declare const $TRACK: unique symbol, $TARGET: unique symbol, $PROXY: unique symbol, $DELETED: unique symbol;
|
|
18
|
+
export declare const STORE_VALUE = "v", STORE_OVERRIDE = "o", STORE_OPTIMISTIC_OVERRIDE = "x", STORE_NODE = "n", STORE_HAS = "h", STORE_WRAP = "w", STORE_LOOKUP = "l", STORE_FIREWALL = "f", STORE_OPTIMISTIC = "p";
|
|
19
|
+
export type StoreNode = {
|
|
20
|
+
[$PROXY]: any;
|
|
21
|
+
[STORE_VALUE]: Record<PropertyKey, any>;
|
|
22
|
+
[STORE_OVERRIDE]?: Record<PropertyKey, any>;
|
|
23
|
+
[STORE_OPTIMISTIC_OVERRIDE]?: Record<PropertyKey, any>;
|
|
24
|
+
[STORE_NODE]?: DataNodes;
|
|
25
|
+
[STORE_HAS]?: DataNodes;
|
|
26
|
+
[STORE_WRAP]?: (value: any, target?: StoreNode) => any;
|
|
27
|
+
[STORE_LOOKUP]?: WeakMap<any, any>;
|
|
28
|
+
[STORE_FIREWALL]?: Computed<any>;
|
|
29
|
+
[STORE_OPTIMISTIC]?: boolean;
|
|
30
|
+
[STORE_SNAPSHOT_PROPS]?: Record<PropertyKey, any>;
|
|
31
|
+
};
|
|
32
|
+
export declare namespace SolidStore {
|
|
33
|
+
interface Unwrappable {
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export type NotWrappable = string | number | bigint | symbol | boolean | Function | null | undefined | SolidStore.Unwrappable[keyof SolidStore.Unwrappable];
|
|
37
|
+
export declare function createStoreProxy<T extends object>(value: T, traps?: ProxyHandler<StoreNode>, extend?: (target: StoreNode) => void): any;
|
|
38
|
+
export declare const storeLookup: WeakMap<WeakKey, any>;
|
|
39
|
+
export declare function wrap<T extends Record<PropertyKey, any>>(value: T, target?: StoreNode): T;
|
|
40
|
+
export declare function isWrappable<T>(obj: T | NotWrappable): obj is T;
|
|
41
|
+
export declare function setWriteOverride(value: boolean): void;
|
|
42
|
+
export declare function trackSelf(target: StoreNode, symbol?: symbol): void;
|
|
43
|
+
export declare function getKeys(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, enumerable?: boolean): PropertyKey[];
|
|
44
|
+
export declare function getPropertyDescriptor(source: Record<PropertyKey, any>, override: Record<PropertyKey, any> | undefined, property: PropertyKey): PropertyDescriptor | undefined;
|
|
45
|
+
export declare const storeTraps: ProxyHandler<StoreNode>;
|
|
46
|
+
export declare function storeSetter<T extends object>(store: Store<T>, fn: (draft: T) => T | void): void;
|
|
47
|
+
/**
|
|
48
|
+
* Creates a deeply reactive store with proxy-based tracking.
|
|
49
|
+
*
|
|
50
|
+
* When called with a plain value, wraps it in a reactive proxy.
|
|
51
|
+
* When called with a function, creates a derived projection store with `ProjectionOptions` (name, key).
|
|
52
|
+
*
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // Plain store
|
|
55
|
+
* const [store, setStore] = createStore<T>(initialValue);
|
|
56
|
+
* // Derived store (projection)
|
|
57
|
+
* const [store, setStore] = createStore<T>(fn, seed, options?: ProjectionOptions);
|
|
58
|
+
* ```
|
|
59
|
+
* @param store initial value to wrap in a reactive proxy, or a derive function
|
|
60
|
+
* @param options `ProjectionOptions` -- name, key (only for derived stores)
|
|
61
|
+
*
|
|
62
|
+
* @returns `[store: Store<T>, setStore: StoreSetter<T>]`
|
|
63
|
+
*/
|
|
64
|
+
export declare function createStore<T extends object = {}>(store: NoFn<T> | Store<NoFn<T>>): [get: Store<T>, set: StoreSetter<T>];
|
|
65
|
+
export declare function createStore<T extends object = {}>(fn: (store: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, store: Partial<T> | Store<NoFn<T>>, options?: ProjectionOptions): [get: Store<T> & {
|
|
66
|
+
[$REFRESH]: any;
|
|
67
|
+
}, set: StoreSetter<T>];
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type NotWrappable } from "./store.cjs";
|
|
2
|
+
type W<T> = Exclude<T, NotWrappable>;
|
|
3
|
+
type KeyOf<T> = number extends keyof T ? 0 extends 1 & T ? keyof T : [T] extends [never] ? never : [T] extends [readonly unknown[]] ? number : keyof T : keyof T;
|
|
4
|
+
export type CustomPartial<T> = T extends readonly unknown[] ? "0" extends keyof T ? {
|
|
5
|
+
[K in Extract<keyof T, `${number}`>]?: T[K];
|
|
6
|
+
} : {
|
|
7
|
+
[x: number]: T[number];
|
|
8
|
+
} : Partial<T>;
|
|
9
|
+
export type StorePathRange = {
|
|
10
|
+
from?: number;
|
|
11
|
+
to?: number;
|
|
12
|
+
by?: number;
|
|
13
|
+
};
|
|
14
|
+
export type ArrayFilterFn<T> = (item: T, index: number) => boolean;
|
|
15
|
+
export type PathSetter<T> = T | CustomPartial<T> | ((prev: T) => T | CustomPartial<T>) | typeof DELETE;
|
|
16
|
+
export type Part<T, K extends KeyOf<T> = KeyOf<T>> = K | ([K] extends [never] ? never : readonly K[]) | ([T] extends [readonly unknown[]] ? ArrayFilterFn<T[number]> | StorePathRange : never);
|
|
17
|
+
declare const DELETE: unique symbol;
|
|
18
|
+
export interface storePath {
|
|
19
|
+
DELETE: typeof DELETE;
|
|
20
|
+
<T, K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>, K7 extends KeyOf<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, k7: Part<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>, K7>, setter: PathSetter<W<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>[K7]>): (state: T) => void;
|
|
21
|
+
<T, K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>, K6 extends KeyOf<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, k6: Part<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>, K6>, setter: PathSetter<W<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>[K6]>): (state: T) => void;
|
|
22
|
+
<T, K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>, K5 extends KeyOf<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, k5: Part<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>, K5>, setter: PathSetter<W<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>[K5]>): (state: T) => void;
|
|
23
|
+
<T, K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>, K4 extends KeyOf<W<W<W<W<T>[K1]>[K2]>[K3]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, k4: Part<W<W<W<W<T>[K1]>[K2]>[K3]>, K4>, setter: PathSetter<W<W<W<W<T>[K1]>[K2]>[K3]>[K4]>): (state: T) => void;
|
|
24
|
+
<T, K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>, K3 extends KeyOf<W<W<W<T>[K1]>[K2]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, k3: Part<W<W<W<T>[K1]>[K2]>, K3>, setter: PathSetter<W<W<W<T>[K1]>[K2]>[K3]>): (state: T) => void;
|
|
25
|
+
<T, K1 extends KeyOf<W<T>>, K2 extends KeyOf<W<W<T>[K1]>>>(k1: Part<W<T>, K1>, k2: Part<W<W<T>[K1]>, K2>, setter: PathSetter<W<W<T>[K1]>[K2]>): (state: T) => void;
|
|
26
|
+
<T, K1 extends KeyOf<W<T>>>(k1: Part<W<T>, K1>, setter: PathSetter<W<T>[K1]>): (state: T) => void;
|
|
27
|
+
<T>(setter: PathSetter<T>): (state: T) => void;
|
|
28
|
+
}
|
|
29
|
+
export declare const storePath: storePath;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a non reactive copy of the store object.
|
|
3
|
+
* It will attempt to preserver the original reference unless the value has been modified.
|
|
4
|
+
* @param item store proxy object
|
|
5
|
+
*/
|
|
6
|
+
export declare function snapshot<T>(item: T): T;
|
|
7
|
+
export declare function snapshot<T>(item: T, map?: Map<unknown, unknown>, lookup?: WeakMap<any, any>): T;
|
|
8
|
+
/**
|
|
9
|
+
* Returns a non-reactive snapshot of the store while subscribing to all nested changes.
|
|
10
|
+
* Subscribes to `$TRACK` at every level so that any deep change triggers recomputation,
|
|
11
|
+
* and returns plain (non-proxy) data. Works correctly with `reconcile()`.
|
|
12
|
+
* @param store store proxy object
|
|
13
|
+
*/
|
|
14
|
+
export declare function deep<T extends object>(store: T): T;
|
|
15
|
+
type DistributeOverride<T, F> = T extends undefined ? F : T;
|
|
16
|
+
type Override<T, U> = T extends any ? U extends any ? {
|
|
17
|
+
[K in keyof T]: K extends keyof U ? DistributeOverride<U[K], T[K]> : T[K];
|
|
18
|
+
} & {
|
|
19
|
+
[K in keyof U]: K extends keyof T ? DistributeOverride<U[K], T[K]> : U[K];
|
|
20
|
+
} : T & U : T & U;
|
|
21
|
+
type OverrideSpread<T, U> = T extends any ? {
|
|
22
|
+
[K in keyof ({
|
|
23
|
+
[K in keyof T]: any;
|
|
24
|
+
} & {
|
|
25
|
+
[K in keyof U]?: any;
|
|
26
|
+
} & {
|
|
27
|
+
[K in U extends any ? keyof U : keyof U]?: any;
|
|
28
|
+
})]: K extends keyof T ? Exclude<U extends any ? U[K & keyof U] : never, undefined> | T[K] : U extends any ? U[K & keyof U] : never;
|
|
29
|
+
} : T & U;
|
|
30
|
+
type Simplify<T> = T extends any ? {
|
|
31
|
+
[K in keyof T]: T[K];
|
|
32
|
+
} : T;
|
|
33
|
+
type _Merge<T extends unknown[], Curr = {}> = T extends [
|
|
34
|
+
infer Next | (() => infer Next),
|
|
35
|
+
...infer Rest
|
|
36
|
+
] ? _Merge<Rest, Override<Curr, Next>> : T extends [...infer Rest, infer Next | (() => infer Next)] ? Override<_Merge<Rest, Curr>, Next> : T extends [] ? Curr : T extends (infer I | (() => infer I))[] ? OverrideSpread<Curr, I> : Curr;
|
|
37
|
+
export type Merge<T extends unknown[]> = Simplify<_Merge<T>>;
|
|
38
|
+
export declare function merge<T extends unknown[]>(...sources: T): Merge<T>;
|
|
39
|
+
export type Omit<T, K extends readonly (keyof T)[]> = {
|
|
40
|
+
[P in keyof T as Exclude<P, K[number]>]: T[P];
|
|
41
|
+
};
|
|
42
|
+
export declare function omit<T extends Record<any, any>, K extends readonly (keyof T)[]>(props: T, ...keys: K): Omit<T, K>;
|
|
43
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,23 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solidjs/signals",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "SolidJS'
|
|
3
|
+
"version": "2.0.0-beta.8",
|
|
4
|
+
"description": "SolidJS' reactive core implementation",
|
|
5
5
|
"author": "Ryan Carniato",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://solidjs.com",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/solidjs/
|
|
10
|
+
"url": "https://github.com/solidjs/solid"
|
|
10
11
|
},
|
|
11
|
-
"type": "module",
|
|
12
|
-
"main": "dist/node.cjs",
|
|
13
|
-
"module": "dist/prod.js",
|
|
14
|
-
"types": "dist/types/index.d.ts",
|
|
15
12
|
"publishConfig": {
|
|
16
13
|
"access": "public"
|
|
17
14
|
},
|
|
15
|
+
"main": "./dist/node.cjs",
|
|
16
|
+
"module": "./dist/prod.js",
|
|
17
|
+
"types": "./dist/types/index.d.ts",
|
|
18
|
+
"type": "module",
|
|
19
|
+
"sideEffects": false,
|
|
18
20
|
"files": [
|
|
19
|
-
"dist"
|
|
21
|
+
"dist",
|
|
22
|
+
"package.json"
|
|
20
23
|
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"import": {
|
|
27
|
+
"types": "./dist/types/index.d.ts",
|
|
28
|
+
"test": "./dist/dev.js",
|
|
29
|
+
"development": "./dist/dev.js",
|
|
30
|
+
"default": "./dist/prod.js"
|
|
31
|
+
},
|
|
32
|
+
"require": {
|
|
33
|
+
"types": "./dist/types-cjs/index.d.cts",
|
|
34
|
+
"default": "./dist/node.cjs"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"./package.json": "./package.json"
|
|
38
|
+
},
|
|
21
39
|
"devDependencies": {
|
|
22
40
|
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
|
|
23
41
|
"@rollup/plugin-replace": "^6.0.3",
|
|
@@ -32,27 +50,16 @@
|
|
|
32
50
|
"vite": "^5.4.10",
|
|
33
51
|
"vitest": "^2.0.0"
|
|
34
52
|
},
|
|
35
|
-
"exports": {
|
|
36
|
-
".": {
|
|
37
|
-
"types": "./dist/types/index.d.ts",
|
|
38
|
-
"import": {
|
|
39
|
-
"test": "./dist/dev.js",
|
|
40
|
-
"development": "./dist/dev.js",
|
|
41
|
-
"default": "./dist/prod.js"
|
|
42
|
-
},
|
|
43
|
-
"require": "./dist/node.cjs"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
53
|
"scripts": {
|
|
47
|
-
"build": "
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
54
|
+
"build": "npm-run-all -nl build:* && pnpm types",
|
|
55
|
+
"build:clean": "rimraf dist/dev.js dist/prod.js dist/node.cjs",
|
|
56
|
+
"build:js": "rollup -c",
|
|
57
|
+
"types": "tsc -p tsconfig.build.json && node ../../scripts/sync-dual-types.mjs ./dist/types ./dist/types-cjs",
|
|
51
58
|
"test": "vitest run",
|
|
52
59
|
"test:watch": "vitest watch tests",
|
|
53
60
|
"test:gc": "node --expose-gc ./vitest.js",
|
|
54
61
|
"test:gc:watch": "node --expose-gc ./vitest.js --watch",
|
|
55
|
-
"
|
|
62
|
+
"coverage": "vitest run --coverage",
|
|
56
63
|
"bench": "vitest bench --run"
|
|
57
64
|
}
|
|
58
65
|
}
|