solid22 0.0.1

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.
@@ -0,0 +1,99 @@
1
+ import { type EffectOptions, type NoInfer } from "@solidjs/signals";
2
+ export type Cleanup = () => void;
3
+ export interface EffectScope {
4
+ /**
5
+ * Re-enter the owner for this specific effect invocation.
6
+ *
7
+ * Useful after an async boundary:
8
+ *
9
+ * createEffect([count], async ([count], { scope }) => {
10
+ * const value = await load(count);
11
+ * scope(() => {
12
+ * onCleanup(...);
13
+ * createEffect(...);
14
+ * });
15
+ * });
16
+ *
17
+ * If the invocation has already been disposed, the callback is not run and
18
+ * `undefined` is returned.
19
+ */
20
+ <T>(fn: () => T): T | undefined;
21
+ /** True while this specific effect invocation still owns a live scope. */
22
+ readonly active: boolean;
23
+ }
24
+ /**
25
+ * Per-invocation helpers passed as the second effect callback argument.
26
+ *
27
+ * `scope` is lazy: the EffectScope function/closure is not created unless the
28
+ * property is actually read by user code. The context object itself is still a
29
+ * small per-invocation allocation because it is passed to every callback.
30
+ */
31
+ export interface EffectContext {
32
+ readonly scope: EffectScope;
33
+ }
34
+ export type EffectResult = void | Cleanup | PromiseLike<void | Cleanup>;
35
+ type Dependencies = readonly unknown[];
36
+ type DependencyAccessor<T = unknown> = () => T;
37
+ type DependencyAccessors = readonly DependencyAccessor[];
38
+ type AsyncDependencyResult<T extends Dependencies> = T | PromiseLike<T> | AsyncIterable<T>;
39
+ type DependencyReader<T extends Dependencies> = () => AsyncDependencyResult<T>;
40
+ type AccessorValues<T extends DependencyAccessors> = {
41
+ readonly [K in keyof T]: T[K] extends () => infer V ? V : never;
42
+ };
43
+ type EffectFn<T extends Dependencies> = (values: NoInfer<T>, context: EffectContext) => EffectResult;
44
+ export type CreateEffectOptions = EffectOptions & {
45
+ /**
46
+ * Explicitly wrap the user callback in `untrack()`.
47
+ *
48
+ * This is true by default to silence Solid 2's strict untracked-read warning
49
+ * for snapshot reads inside an explicitly-dependency-scoped effect body.
50
+ *
51
+ * When false, the initial/synchronous callback executes directly inside the
52
+ * native Solid effect apply phase, preserving Solid's strict-read diagnostic.
53
+ * `context.scope()` also restores the diagnostic label after async boundaries.
54
+ *
55
+ * @default true
56
+ */
57
+ untrack?: boolean;
58
+ /**
59
+ * Run the user callback under the per-invocation owner.
60
+ *
61
+ * When true (default), synchronous `onCleanup()` and nested owned primitives
62
+ * work directly inside the effect callback.
63
+ *
64
+ * When false, the callback is explicitly run with no owner. The invocation
65
+ * owner is still created and retained so `context.scope(() => ...)` can opt
66
+ * back into that exact invocation owner, synchronously or after `await`.
67
+ *
68
+ * This option is independent from `untrack`.
69
+ *
70
+ * @default true
71
+ */
72
+ owned?: boolean;
73
+ /**
74
+ * Stop observing dependencies after the first dependency-change execution.
75
+ *
76
+ * - `{ once: true }`: initial execution + one changed execution.
77
+ * - `{ defer: true, once: true }`: one changed execution only.
78
+ *
79
+ * The terminal invocation is allowed to finish. For an async callback, its
80
+ * `context.scope()` remains active until the returned promise settles; the invocation
81
+ * is then disposed and its cleanup runs.
82
+ *
83
+ * @default false
84
+ */
85
+ once?: boolean;
86
+ };
87
+ export type DeferredEffectOptions = Omit<CreateEffectOptions, "defer">;
88
+ export declare function createEffect<const T extends Dependencies>(dependencies: DependencyReader<T>, effect: EffectFn<T>, options?: CreateEffectOptions): void;
89
+ export declare function createEffect<const T extends DependencyAccessors>(dependencies: T, effect: EffectFn<AccessorValues<T>>, options?: CreateEffectOptions): void;
90
+ export declare function createEffect2<const T extends Dependencies>(effect: EffectFn<T>, dependencies: DependencyReader<T>, options?: CreateEffectOptions): void;
91
+ export declare function createEffect2<const T extends DependencyAccessors>(effect: EffectFn<AccessorValues<T>>, dependencies: T, options?: CreateEffectOptions): void;
92
+ export interface OnBuilder<T extends Dependencies> {
93
+ effect(effect: EffectFn<T>, options?: CreateEffectOptions): void;
94
+ deferEffect(effect: EffectFn<T>, options?: DeferredEffectOptions): void;
95
+ }
96
+ export declare function on<const T extends Dependencies>(dependencies: DependencyReader<T>): OnBuilder<T>;
97
+ export declare function on<const T extends DependencyAccessors>(dependencies: T): OnBuilder<AccessorValues<T>>;
98
+ export {};
99
+ //# sourceMappingURL=createEffect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEffect.d.ts","sourceRoot":"","sources":["../../src/effects/createEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,aAAa,EAClB,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAC;AAE1B,MAAM,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC;AAEjC,MAAM,WAAW,WAAW;IAC1B;;;;;;;;;;;;;;;OAeG;IACH,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAEhC,0EAA0E;IAC1E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC;CAC7B;AAED,MAAM,MAAM,YAAY,GACpB,IAAI,GACJ,OAAO,GACP,WAAW,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;AAEhC,KAAK,YAAY,GAAG,SAAS,OAAO,EAAE,CAAC;AACvC,KAAK,kBAAkB,CAAC,CAAC,GAAG,OAAO,IAAI,MAAM,CAAC,CAAC;AAC/C,KAAK,mBAAmB,GAAG,SAAS,kBAAkB,EAAE,CAAC;AACzD,KAAK,qBAAqB,CAAC,CAAC,SAAS,YAAY,IAC7C,CAAC,GACD,WAAW,CAAC,CAAC,CAAC,GACd,aAAa,CAAC,CAAC,CAAC,CAAC;AACrB,KAAK,gBAAgB,CAAC,CAAC,SAAS,YAAY,IAAI,MAAM,qBAAqB,CAAC,CAAC,CAAC,CAAC;AAE/E,KAAK,cAAc,CAAC,CAAC,SAAS,mBAAmB,IAAI;IACnD,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC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,EACnC,YAAY,EAAE,CAAC,EACf,OAAO,CAAC,EAAE,mBAAmB,GAC5B,IAAI,CAAC;AAkBR,MAAM,WAAW,SAAS,CAAC,CAAC,SAAS,YAAY;IAC/C,MAAM,CACJ,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,IAAI,CAAC;IAER,WAAW,CACT,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;CACT;AAED,wBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,YAAY,EAC7C,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAChC,SAAS,CAAC,CAAC,CAAC,CAAC;AAEhB,wBAAgB,EAAE,CAAC,KAAK,CAAC,CAAC,SAAS,mBAAmB,EACpD,YAAY,EAAE,CAAC,GACd,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,235 @@
1
+ import { createEffect as solidCreateEffect, createRoot, createSignal, getOwner, isDisposed, onCleanup, runWithOwner, untrack as solidUntrack } from "@solidjs/signals";
2
+ const EFFECT_STRICT_READ_LABEL = "an effect callback";
3
+ function normalizeDependencies(dependencies) {
4
+ if (Array.isArray(dependencies)) {
5
+ return {
6
+ kind: "accessors",
7
+ compute: () => dependencies.map(dependency => dependency())
8
+ };
9
+ }
10
+ return {
11
+ kind: "callback",
12
+ compute: dependencies
13
+ };
14
+ }
15
+ /**
16
+ * Materialize dependency callbacks as a Solid async/computed signal.
17
+ *
18
+ * This is deliberate. In browser builds the async graph's signal path is the
19
+ * authoritative path for Promise/AsyncIterable values: while pending its
20
+ * accessor throws NotReadyError, stale promise results are versioned away, and
21
+ * async iterables can publish repeatedly. The native effect therefore only ever
22
+ * computes by synchronously reading this accessor instead of forwarding a raw
23
+ * Promise/AsyncIterable from its compute function.
24
+ *
25
+ * Accessor arrays stay direct so simple `[a, b]` dependencies do not pay for an
26
+ * extra computed node.
27
+ */
28
+ function createDependencyReader(dependencies) {
29
+ if (dependencies.kind === "accessors") {
30
+ return dependencies.compute;
31
+ }
32
+ const [read] = createSignal(dependencies.compute);
33
+ return read;
34
+ }
35
+ function withOwner(owner, fn) {
36
+ // Preserve the owner captured at declaration time exactly. In particular,
37
+ // a captured `null` owner must clear any incidental owner that may exist when
38
+ // a later scheduler callback executes.
39
+ return runWithOwner(owner, fn);
40
+ }
41
+ /**
42
+ * Run the synchronous effect body.
43
+ *
44
+ * Native createEffect already makes the apply phase untracked. The explicit
45
+ * `solidUntrack` call is primarily about strict-read diagnostics: without a
46
+ * label it opts the whole body into intentional snapshot reads.
47
+ */
48
+ function runEffectBody(explicitUntrack, fn) {
49
+ return explicitUntrack ? solidUntrack(fn) : fn();
50
+ }
51
+ function createScope(owner, explicitUntrack) {
52
+ const scope = ((fn) => {
53
+ if (isDisposed(owner))
54
+ return undefined;
55
+ return runWithOwner(owner, () => explicitUntrack
56
+ ? solidUntrack(fn)
57
+ : solidUntrack(fn, EFFECT_STRICT_READ_LABEL));
58
+ });
59
+ Object.defineProperty(scope, "active", {
60
+ enumerable: true,
61
+ get() {
62
+ return !isDisposed(owner);
63
+ }
64
+ });
65
+ return scope;
66
+ }
67
+ class EffectContextImpl {
68
+ state;
69
+ constructor(state) {
70
+ this.state = state;
71
+ }
72
+ get scope() {
73
+ return (this.state.scope ??= createScope(this.state.owner, this.state.explicitUntrack));
74
+ }
75
+ }
76
+ function registerCleanup(invocation, cleanup) {
77
+ if (!isDisposed(invocation.owner)) {
78
+ // Cleanup registration only needs the invocation owner. Do not go through
79
+ // context.scope here, otherwise returned cleanups would eagerly pay the
80
+ // EffectScope allocation even when user code never asks for it.
81
+ runWithOwner(invocation.owner, () => {
82
+ onCleanup(cleanup);
83
+ });
84
+ }
85
+ else {
86
+ // The async callback produced a cleanup after its invocation had already
87
+ // been replaced/disposed. There is nowhere valid to register it, so dispose
88
+ // the late-created resource immediately.
89
+ cleanup();
90
+ }
91
+ }
92
+ function handleEffectResult(result, invocation, disposeRun, terminal) {
93
+ if (typeof result === "function") {
94
+ registerCleanup(invocation, result);
95
+ if (terminal)
96
+ disposeRun();
97
+ return;
98
+ }
99
+ if (result && typeof result.then === "function") {
100
+ // Do not return this promise to native createEffect: native effect callbacks
101
+ // accept only void | cleanup and intentionally reject promises as invalid
102
+ // cleanup values. We own the async lifecycle here instead.
103
+ void Promise.resolve(result).then(cleanup => {
104
+ if (typeof cleanup === "function") {
105
+ registerCleanup(invocation, cleanup);
106
+ }
107
+ // `once` unsubscribes immediately, but its terminal invocation stays
108
+ // alive through await so context.scope can still restore ownership. Once
109
+ // the callback settles, tear down that final invocation scope.
110
+ if (terminal)
111
+ disposeRun();
112
+ }, error => {
113
+ if (terminal)
114
+ disposeRun();
115
+ // Preserve normal unhandled async-error behavior rather than silently
116
+ // swallowing a rejected async effect callback.
117
+ throw error;
118
+ });
119
+ return;
120
+ }
121
+ if (terminal)
122
+ disposeRun();
123
+ }
124
+ /**
125
+ * Shared implementation for createEffect(), createEffect2(), and on().
126
+ */
127
+ function createScopedEffect(dependencies, effect, options) {
128
+ const declarationOwner = getOwner();
129
+ const { untrack: explicitUntrack = true, owned = true, once = false, ...solidOptions } = options ?? {};
130
+ const defer = !!solidOptions.defer;
131
+ const terminalRun = once ? (defer ? 1 : 2) : Number.POSITIVE_INFINITY;
132
+ let applyCount = 0;
133
+ let disposeEffectRoot;
134
+ const apply = (values) => {
135
+ applyCount++;
136
+ const terminal = once && applyCount >= terminalRun;
137
+ let disposeRun;
138
+ let invocation;
139
+ let result;
140
+ let threw = false;
141
+ let error;
142
+ // The invocation root is parented to the owner where this wrapper effect was
143
+ // declared, not to the private once-subscription root. That lets us unsubscribe
144
+ // a terminal `once` effect immediately while preserving its async invocation scope
145
+ // until the callback itself settles.
146
+ //
147
+ // The callback is invoked *after* createRoot's setup callback returns. This
148
+ // lets `owned: false` explicitly clear ambient ownership while still retaining
149
+ // a live invocation owner for context.scope().
150
+ withOwner(declarationOwner, () => {
151
+ createRoot(dispose => {
152
+ disposeRun = dispose;
153
+ const runOwner = getOwner();
154
+ if (!runOwner) {
155
+ // createRoot always installs an owner while its callback is running.
156
+ throw new Error("createEffect: failed to create an invocation owner");
157
+ }
158
+ invocation = {
159
+ owner: runOwner,
160
+ explicitUntrack
161
+ };
162
+ });
163
+ });
164
+ const context = new EffectContextImpl(invocation);
165
+ const runUserEffect = () => runEffectBody(explicitUntrack, () => effect(values, context));
166
+ try {
167
+ result = owned
168
+ ? runWithOwner(invocation.owner, runUserEffect)
169
+ : runWithOwner(null, runUserEffect);
170
+ }
171
+ catch (err) {
172
+ threw = true;
173
+ error = err;
174
+ }
175
+ if (threw) {
176
+ disposeRun();
177
+ if (terminal)
178
+ disposeEffectRoot?.();
179
+ throw error;
180
+ }
181
+ // For a terminal once-run, stop dependency observation now. The invocation scope is
182
+ // deliberately separate and is disposed by handleEffectResult when the
183
+ // callback (including async work) finishes.
184
+ if (terminal) {
185
+ disposeEffectRoot?.();
186
+ }
187
+ handleEffectResult(result, invocation, disposeRun, terminal);
188
+ // Native Solid owns disposal of non-terminal invocations. It invokes this
189
+ // cleanup before the next apply and when the effect itself is disposed.
190
+ if (!terminal)
191
+ return disposeRun;
192
+ };
193
+ const createNativeEffect = () => {
194
+ // Create the computed/async dependency node under the same ownership scope
195
+ // as the native subscription. For `once`, disposing the private effect root
196
+ // therefore also disposes an async dependency callback that might otherwise
197
+ // continue observing its sources after the effect has stopped.
198
+ const readDependencies = createDependencyReader(dependencies);
199
+ solidCreateEffect(readDependencies, apply, solidOptions);
200
+ };
201
+ if (once) {
202
+ // We need a public disposer for the native effect subscription so once can
203
+ // truly remove it rather than merely ignoring future callbacks.
204
+ withOwner(declarationOwner, () => {
205
+ createRoot(dispose => {
206
+ disposeEffectRoot = dispose;
207
+ createNativeEffect();
208
+ });
209
+ });
210
+ }
211
+ else {
212
+ withOwner(declarationOwner, createNativeEffect);
213
+ }
214
+ }
215
+ export function createEffect(dependencies, effect, options) {
216
+ createScopedEffect(normalizeDependencies(dependencies), effect, options);
217
+ }
218
+ export function createEffect2(effect, dependencies, options) {
219
+ createScopedEffect(normalizeDependencies(dependencies), effect, options);
220
+ }
221
+ export function on(dependencies) {
222
+ const read = normalizeDependencies(dependencies);
223
+ return {
224
+ effect(effect, options) {
225
+ createScopedEffect(read, effect, options);
226
+ },
227
+ deferEffect(effect, options) {
228
+ createScopedEffect(read, effect, {
229
+ ...options,
230
+ defer: true
231
+ });
232
+ }
233
+ };
234
+ }
235
+ //# sourceMappingURL=createEffect.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createEffect.js","sourceRoot":"","sources":["../../src/effects/createEffect.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,IAAI,iBAAiB,EACjC,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,SAAS,EACT,YAAY,EACZ,OAAO,IAAI,YAAY,EAIxB,MAAM,kBAAkB,CAAC;AA+G1B,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAwBtD,SAAS,qBAAqB,CAC5B,YAA6B;IAE7B,IAAI,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE,CAAC;QAChC,OAAO;YACL,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,CAAC;SAC5D,CAAC;IACJ,CAAC;IAED,OAAO;QACL,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,YAA8C;KACxD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,sBAAsB,CAC7B,YAAuC;IAEvC,IAAI,YAAY,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QACtC,OAAO,YAAY,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,GAAG,YAAY,CAAI,YAAY,CAAC,OAA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C;IACJ,CAAC,CAAC;IAEF,IAAI,IAAI,EAAE,CAAC;QACT,2EAA2E;QAC3E,gEAAgE;QAChE,SAAS,CAAC,gBAAgB,EAAE,GAAG,EAAE;YAC/B,UAAU,CAAC,OAAO,CAAC,EAAE;gBACnB,iBAAiB,GAAG,OAAO,CAAC;gBAC5B,kBAAkB,EAAE,CAAC;YACvB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,SAAS,CAAC,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAkBD,MAAM,UAAU,YAAY,CAC1B,YAA6B,EAC7B,MAA8B,EAC9B,OAA6B;IAE7B,kBAAkB,CAChB,qBAAqB,CAAC,YAAY,CAAC,EACnC,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC;AAkBD,MAAM,UAAU,aAAa,CAC3B,MAA8B,EAC9B,YAA6B,EAC7B,OAA6B;IAE7B,kBAAkB,CAChB,qBAAqB,CAAC,YAAY,CAAC,EACnC,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC;AA0BD,MAAM,UAAU,EAAE,CAChB,YAA6B;IAE7B,MAAM,IAAI,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;IAEjD,OAAO;QACL,MAAM,CAAC,MAAM,EAAE,OAAO;YACpB,kBAAkB,CAChB,IAAI,EACJ,MAAM,EACN,OAAO,CACR,CAAC;QACJ,CAAC;QAED,WAAW,CAAC,MAAM,EAAE,OAAO;YACzB,kBAAkB,CAChB,IAAI,EACJ,MAAM,EACN;gBACE,GAAG,OAAO;gBACV,KAAK,EAAE,IAAI;aACZ,CACF,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./createEffect.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./createEffect.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/effects/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./effects/index.js";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,oBAAoB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ // Convenience root barrel. Subpath imports such as `solid2/effects` are the
2
+ // preferred way to consume independently versionable primitive families.
3
+ export * from "./effects/index.js";
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,yEAAyE;AACzE,cAAc,oBAAoB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,51 @@
1
+ {
2
+ "name": "solid22",
3
+ "version": "0.0.1",
4
+ "description": "Experimental Solid 2 primitives and helpers with focused subpath exports.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "files": [
8
+ "dist",
9
+ "README.md",
10
+ "CHANGELOG.md"
11
+ ],
12
+ "exports": {
13
+ ".": {
14
+ "types": "./dist/index.d.ts",
15
+ "import": "./dist/index.js",
16
+ "default": "./dist/index.js"
17
+ },
18
+ "./*": {
19
+ "types": "./dist/*/index.d.ts",
20
+ "import": "./dist/*/index.js",
21
+ "default": "./dist/*/index.js"
22
+ },
23
+ "./package.json": "./package.json"
24
+ },
25
+ "scripts": {
26
+ "clean": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
27
+ "build": "npm run clean && tsc -p tsconfig.build.json",
28
+ "typecheck": "tsc -p tsconfig.json --noEmit",
29
+ "test": "tsx tests/runner.ts",
30
+ "prepack": "npm run build"
31
+ },
32
+ "peerDependencies": {
33
+ "@solidjs/signals": ">=2.0.0-rc.8 <3.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@solidjs/signals": "2.0.0-rc.8",
37
+ "tsx": "^4.20.0",
38
+ "typescript": "^5.8.3"
39
+ },
40
+ "keywords": [
41
+ "solid",
42
+ "solidjs",
43
+ "solid2",
44
+ "signals",
45
+ "reactivity",
46
+ "effects"
47
+ ],
48
+ "publishConfig": {
49
+ "access": "public"
50
+ }
51
+ }