@xmachines/play-signals 1.0.0-beta.8 → 1.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/LICENSE +21 -0
- package/README.md +110 -65
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/watch-signal.d.ts +21 -0
- package/dist/watch-signal.d.ts.map +1 -0
- package/dist/watch-signal.js +47 -0
- package/dist/watch-signal.js.map +1 -0
- package/package.json +18 -6
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mikael Karon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,29 +1,79 @@
|
|
|
1
|
+
<!-- generated-by: gsd-doc-writer -->
|
|
2
|
+
|
|
1
3
|
# @xmachines/play-signals
|
|
2
4
|
|
|
3
|
-
|
|
5
|
+
TC39 Signals polyfill for XMachines — fine-grained reactive state primitives that enable glitch-free, subscription-free state propagation in the Play Architecture.
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
Part of the [xmachines-js monorepo](../../README.md).
|
|
6
8
|
|
|
7
|
-
##
|
|
9
|
+
## Installation
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
```bash
|
|
12
|
+
pnpm add @xmachines/play-signals
|
|
13
|
+
```
|
|
12
14
|
|
|
13
|
-
|
|
15
|
+
## Overview
|
|
14
16
|
|
|
15
|
-
|
|
17
|
+
This package wraps the [`signal-polyfill`](https://github.com/nicolo-ribaudo/tc39-proposal-signals-polyfill) reference implementation of the [TC39 Signals proposal](https://github.com/tc39/proposal-signals) (Stage 1). It re-exports the full `Signal` namespace and adds a memory-safe `watchSignal` utility, isolating the rest of the codebase from potential Stage 1 API churn.
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
**All signal imports in the XMachines ecosystem should come from this package**, not directly from `signal-polyfill`, so that polyfill version bumps or API adaptations can be made in one place.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
### `Signal.State` — writable reactive state
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { Signal } from "@xmachines/play-signals";
|
|
27
|
+
|
|
28
|
+
const count = new Signal.State(0);
|
|
29
|
+
|
|
30
|
+
console.log(count.get()); // 0
|
|
31
|
+
count.set(5);
|
|
32
|
+
console.log(count.get()); // 5
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### `Signal.Computed` — lazy memoized derived values
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
import { Signal } from "@xmachines/play-signals";
|
|
39
|
+
|
|
40
|
+
const count = new Signal.State(0);
|
|
41
|
+
const doubled = new Signal.Computed(() => count.get() * 2);
|
|
42
|
+
|
|
43
|
+
console.log(doubled.get()); // 0 (computed on first access)
|
|
44
|
+
count.set(5);
|
|
45
|
+
console.log(doubled.get()); // 10 (recomputed because dependency changed)
|
|
46
|
+
console.log(doubled.get()); // 10 (memoized — no recomputation)
|
|
19
47
|
```
|
|
20
48
|
|
|
21
|
-
|
|
49
|
+
Computations automatically track every signal accessed inside them. Dynamic branching is fully supported — only signals read in the _current_ execution path are tracked as dependencies.
|
|
22
50
|
|
|
23
|
-
|
|
24
|
-
- Type exports from `src/types.ts`: `SignalState`, `SignalComputed`, `SignalWatcher`, `SignalOptions`, `ComputedOptions`, `WatcherNotify`
|
|
51
|
+
### `watchSignal` — memory-safe one-shot effect
|
|
25
52
|
|
|
26
|
-
|
|
53
|
+
Use `watchSignal` to subscribe to a `Signal.State` or `Signal.Computed` and receive its value after each change. Updates are coalesced into a single microtask per synchronous batch.
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
import { Signal, watchSignal } from "@xmachines/play-signals";
|
|
57
|
+
|
|
58
|
+
const count = new Signal.State(0);
|
|
59
|
+
|
|
60
|
+
const cleanup = watchSignal(count, (value) => {
|
|
61
|
+
console.log("count changed:", value);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
count.set(1); // → logs "count changed: 1" (via microtask)
|
|
65
|
+
count.set(2); // coalesced with any rapid synchronous changes
|
|
66
|
+
count.set(3); // → logs "count changed: 3" once
|
|
67
|
+
|
|
68
|
+
// Stop watching
|
|
69
|
+
cleanup();
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The returned cleanup function is idempotent — calling it multiple times is safe and will not throw.
|
|
73
|
+
|
|
74
|
+
### `Signal.subtle.Watcher` — low-level multi-signal observation
|
|
75
|
+
|
|
76
|
+
For advanced use cases such as framework integrations, the full `Signal.subtle.Watcher` API is available:
|
|
27
77
|
|
|
28
78
|
```typescript
|
|
29
79
|
import { Signal } from "@xmachines/play-signals";
|
|
@@ -34,79 +84,74 @@ const doubled = new Signal.Computed(() => count.get() * 2);
|
|
|
34
84
|
const watcher = new Signal.subtle.Watcher(() => {
|
|
35
85
|
queueMicrotask(() => {
|
|
36
86
|
const pending = watcher.getPending();
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
watcher.watch(...pending);
|
|
87
|
+
console.log("signals changed:", pending.length);
|
|
88
|
+
watcher.watch(...pending); // re-arm for future changes
|
|
41
89
|
});
|
|
42
90
|
});
|
|
43
91
|
|
|
92
|
+
watcher.watch(count);
|
|
44
93
|
watcher.watch(doubled);
|
|
45
|
-
doubled.get();
|
|
46
|
-
|
|
47
|
-
count.set(2);
|
|
48
|
-
|
|
49
|
-
const dispose = () => {
|
|
50
|
-
watcher.unwatch(doubled);
|
|
51
|
-
};
|
|
52
94
|
|
|
53
|
-
|
|
95
|
+
count.set(5); // schedules microtask notification
|
|
54
96
|
```
|
|
55
97
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
Use one lifecycle pattern everywhere (React, Vue, Solid, router bridges, helper wrappers):
|
|
59
|
-
|
|
60
|
-
1. `notify` callback runs.
|
|
61
|
-
2. Schedule work with `queueMicrotask`.
|
|
62
|
-
3. Drain `watcher.getPending()`.
|
|
63
|
-
4. Perform reads/effects.
|
|
64
|
-
5. Re-arm watcher with `watch()` or `watch(...signals)`.
|
|
98
|
+
### Custom equality
|
|
65
99
|
|
|
66
|
-
|
|
100
|
+
Both `Signal.State` and `Signal.Computed` accept an `equals` option to control when dependents are notified:
|
|
67
101
|
|
|
68
|
-
|
|
102
|
+
```typescript
|
|
103
|
+
import { Signal } from "@xmachines/play-signals";
|
|
104
|
+
import type { SignalOptions } from "@xmachines/play-signals";
|
|
69
105
|
|
|
70
|
-
|
|
106
|
+
const options: SignalOptions<{ name: string; age: number }> = {
|
|
107
|
+
equals: (a, b) => a.name === b.name && a.age === b.age,
|
|
108
|
+
};
|
|
71
109
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
110
|
+
const person = new Signal.State({ name: "Alice", age: 30 }, options);
|
|
111
|
+
// Setting structurally identical value will not notify dependents
|
|
112
|
+
person.set({ name: "Alice", age: 30 });
|
|
113
|
+
```
|
|
75
114
|
|
|
76
|
-
##
|
|
115
|
+
## API Summary
|
|
77
116
|
|
|
78
|
-
|
|
117
|
+
| Export | Kind | Description |
|
|
118
|
+
| ------------------------------ | --------- | ------------------------------------------------------------------------------------------------------ |
|
|
119
|
+
| `Signal` | namespace | Full TC39 Signals namespace (`State`, `Computed`, `subtle.Watcher`) re-exported from `signal-polyfill` |
|
|
120
|
+
| `watchSignal(signal, onValue)` | function | Memory-safe subscription helper; returns a cleanup function |
|
|
121
|
+
| `SignalState<T>` | interface | Shape of `Signal.State<T>` (`.get()`, `.set()`) |
|
|
122
|
+
| `SignalComputed<T>` | interface | Shape of `Signal.Computed<T>` (`.get()`) |
|
|
123
|
+
| `SignalWatcher` | interface | Shape of `Signal.subtle.Watcher` (`.watch()`, `.unwatch()`, `.getPending()`) |
|
|
124
|
+
| `SignalOptions<T>` | interface | Options bag for `Signal.State` constructor (`equals?`) |
|
|
125
|
+
| `ComputedOptions<T>` | interface | Options bag for `Signal.Computed` constructor (`equals?`) |
|
|
126
|
+
| `WatcherNotify` | type | Callback signature for `Signal.subtle.Watcher` notify function |
|
|
79
127
|
|
|
80
|
-
|
|
81
|
-
- `createSignalEffect(effect, options)`
|
|
82
|
-
- `toSubscribable(signal, options)`
|
|
128
|
+
## Testing
|
|
83
129
|
|
|
84
|
-
|
|
130
|
+
Run tests for this package in isolation:
|
|
85
131
|
|
|
86
|
-
|
|
132
|
+
```bash
|
|
133
|
+
# From this package directory
|
|
134
|
+
pnpm test
|
|
87
135
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
136
|
+
# Watch mode
|
|
137
|
+
pnpm test -- --watch
|
|
138
|
+
```
|
|
91
139
|
|
|
92
|
-
|
|
140
|
+
From the monorepo root:
|
|
93
141
|
|
|
94
|
-
|
|
142
|
+
```bash
|
|
143
|
+
# Run tests for this package
|
|
144
|
+
pnpm --filter @xmachines/play-signals test
|
|
95
145
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- **Event-only mutation path:** Signals are not a business mutation channel.
|
|
146
|
+
# Run with coverage (lines ≥ 90 %, functions ≥ 90 %, branches ≥ 85 %, statements ≥ 90 %)
|
|
147
|
+
pnpm run test:coverage
|
|
148
|
+
```
|
|
100
149
|
|
|
101
|
-
##
|
|
150
|
+
## Requirements
|
|
102
151
|
|
|
103
|
-
-
|
|
104
|
-
-
|
|
105
|
-
- [RFC Play v1](https://gitlab.com/xmachin-es/rfc/-/blob/main/src/play-v1.md)
|
|
152
|
+
- **Node.js** `>= 22.0.0`
|
|
153
|
+
- **TypeScript** `5.7+` (for consumers using TypeScript)
|
|
106
154
|
|
|
107
155
|
## License
|
|
108
156
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
This work is licensed under the terms of the MIT license.
|
|
112
|
-
For a copy, see <https://opensource.org/licenses/MIT>.
|
|
157
|
+
MIT — see [LICENSE](LICENSE).
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* count.set(5); // Logs: Count: 5 Doubled: 10
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @see
|
|
35
|
+
* @see [Play RFC](../../docs/rfc/play.md) - Invariant INV-05
|
|
36
36
|
* @see {@link https://github.com/tc39/proposal-signals | TC39 Signals Proposal}
|
|
37
37
|
*
|
|
38
38
|
* @remarks
|
|
@@ -46,5 +46,6 @@
|
|
|
46
46
|
* consuming packages. This architectural decision protects against Stage 1 API churn.
|
|
47
47
|
*/
|
|
48
48
|
export { Signal } from "signal-polyfill";
|
|
49
|
+
export { watchSignal } from "./watch-signal.js";
|
|
49
50
|
export type { SignalState, SignalComputed, SignalWatcher, SignalOptions, ComputedOptions, WatcherNotify, } from "./types.js";
|
|
50
51
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAGH,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,YAAY,EACX,WAAW,EACX,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,aAAa,GACb,MAAM,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* count.set(5); // Logs: Count: 5 Doubled: 10
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @see
|
|
35
|
+
* @see [Play RFC](../../docs/rfc/play.md) - Invariant INV-05
|
|
36
36
|
* @see {@link https://github.com/tc39/proposal-signals | TC39 Signals Proposal}
|
|
37
37
|
*
|
|
38
38
|
* @remarks
|
|
@@ -47,4 +47,5 @@
|
|
|
47
47
|
*/
|
|
48
48
|
// Re-export complete Signal namespace from official polyfill
|
|
49
49
|
export { Signal } from "signal-polyfill";
|
|
50
|
+
export { watchSignal } from "./watch-signal.js";
|
|
50
51
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAEH,6DAA6D;AAC7D,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Signal } from "signal-polyfill";
|
|
2
|
+
/**
|
|
3
|
+
* Subscribe to a single signal using the canonical one-shot watcher lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* The callback runs from a queued microtask after pending notifications are
|
|
6
|
+
* drained, then the watcher re-arms itself so future updates are not missed.
|
|
7
|
+
* The returned cleanup keeps teardown idempotent by tolerating already-detached
|
|
8
|
+
* watchers.
|
|
9
|
+
*
|
|
10
|
+
* **Memory safety (Phase 29):**
|
|
11
|
+
* - `disposed` flag prevents post-cleanup callback execution: if cleanup is
|
|
12
|
+
* called before a pending microtask fires, the microtask returns early.
|
|
13
|
+
* - `needsEnqueue` guard dedups rapid synchronous signal changes: only one
|
|
14
|
+
* microtask is ever queued per batch of synchronous mutations.
|
|
15
|
+
*
|
|
16
|
+
* @param signal - A `Signal.State` or `Signal.Computed` to subscribe to.
|
|
17
|
+
* @param onValue - Called with the current signal value after each change.
|
|
18
|
+
* @returns A cleanup function that unregisters the watcher.
|
|
19
|
+
*/
|
|
20
|
+
export declare function watchSignal<T>(signal: Signal.State<T> | Signal.Computed<T>, onValue: (value: T) => void): () => void;
|
|
21
|
+
//# sourceMappingURL=watch-signal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-signal.d.ts","sourceRoot":"","sources":["../src/watch-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC5B,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAC5C,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,GACzB,MAAM,IAAI,CA0BZ"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Signal } from "signal-polyfill";
|
|
2
|
+
/**
|
|
3
|
+
* Subscribe to a single signal using the canonical one-shot watcher lifecycle.
|
|
4
|
+
*
|
|
5
|
+
* The callback runs from a queued microtask after pending notifications are
|
|
6
|
+
* drained, then the watcher re-arms itself so future updates are not missed.
|
|
7
|
+
* The returned cleanup keeps teardown idempotent by tolerating already-detached
|
|
8
|
+
* watchers.
|
|
9
|
+
*
|
|
10
|
+
* **Memory safety (Phase 29):**
|
|
11
|
+
* - `disposed` flag prevents post-cleanup callback execution: if cleanup is
|
|
12
|
+
* called before a pending microtask fires, the microtask returns early.
|
|
13
|
+
* - `needsEnqueue` guard dedups rapid synchronous signal changes: only one
|
|
14
|
+
* microtask is ever queued per batch of synchronous mutations.
|
|
15
|
+
*
|
|
16
|
+
* @param signal - A `Signal.State` or `Signal.Computed` to subscribe to.
|
|
17
|
+
* @param onValue - Called with the current signal value after each change.
|
|
18
|
+
* @returns A cleanup function that unregisters the watcher.
|
|
19
|
+
*/
|
|
20
|
+
export function watchSignal(signal, onValue) {
|
|
21
|
+
let disposed = false;
|
|
22
|
+
let needsEnqueue = true;
|
|
23
|
+
const watcher = new Signal.subtle.Watcher(() => {
|
|
24
|
+
if (disposed || !needsEnqueue)
|
|
25
|
+
return;
|
|
26
|
+
needsEnqueue = false;
|
|
27
|
+
queueMicrotask(() => {
|
|
28
|
+
if (disposed)
|
|
29
|
+
return;
|
|
30
|
+
needsEnqueue = true;
|
|
31
|
+
watcher.getPending();
|
|
32
|
+
onValue(signal.get());
|
|
33
|
+
watcher.watch(signal);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
watcher.watch(signal);
|
|
37
|
+
return () => {
|
|
38
|
+
disposed = true;
|
|
39
|
+
try {
|
|
40
|
+
watcher.unwatch(signal);
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
// Ignore detached watcher errors to keep cleanup idempotent.
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=watch-signal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"watch-signal.js","sourceRoot":"","sources":["../src/watch-signal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,WAAW,CAC1B,MAA4C,EAC5C,OAA2B;IAE3B,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,IAAI,YAAY,GAAG,IAAI,CAAC;IAExB,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE;QAC9C,IAAI,QAAQ,IAAI,CAAC,YAAY;YAAE,OAAO;QACtC,YAAY,GAAG,KAAK,CAAC;QACrB,cAAc,CAAC,GAAG,EAAE;YACnB,IAAI,QAAQ;gBAAE,OAAO;YACrB,YAAY,GAAG,IAAI,CAAC;YACpB,OAAO,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC;YACtB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAEtB,OAAO,GAAG,EAAE;QACX,QAAQ,GAAG,IAAI,CAAC;QAChB,IAAI,CAAC;YACJ,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC;YACR,6DAA6D;QAC9D,CAAC;IACF,CAAC,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xmachines/play-signals",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "TC39 Signals polyfill for XMachines - Fine-grained reactive state primitives",
|
|
6
6
|
"keywords": [
|
|
@@ -10,16 +10,25 @@
|
|
|
10
10
|
"tc39",
|
|
11
11
|
"xmachines"
|
|
12
12
|
],
|
|
13
|
+
"homepage": "https://gitlab.com/xmachin-es/xmachines-js/tree/main/packages/play-signals",
|
|
13
14
|
"license": "MIT",
|
|
14
15
|
"author": "XMachines Contributors",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+ssh://git@gitlab.com/xmachin-es/xmachines-js.git",
|
|
19
|
+
"directory": "packages/play-signals"
|
|
20
|
+
},
|
|
15
21
|
"files": [
|
|
16
22
|
"dist",
|
|
17
23
|
"README.md",
|
|
18
24
|
"LICENSE"
|
|
19
25
|
],
|
|
20
26
|
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
21
29
|
"exports": {
|
|
22
30
|
".": {
|
|
31
|
+
"source": "./src/index.ts",
|
|
23
32
|
"types": "./dist/index.d.ts",
|
|
24
33
|
"import": "./dist/index.js"
|
|
25
34
|
}
|
|
@@ -29,8 +38,7 @@
|
|
|
29
38
|
},
|
|
30
39
|
"scripts": {
|
|
31
40
|
"build": "tsc --build",
|
|
32
|
-
"clean": "rm -rf dist *.tsbuildinfo node_modules/.
|
|
33
|
-
"typecheck": "tsc --noEmit",
|
|
41
|
+
"clean": "rm -rf dist *.tsbuildinfo coverage .vitest-attachments test/browser/__screenshots__ node_modules/.svelte2tsx-* node_modules/.vite*",
|
|
34
42
|
"test": "vitest",
|
|
35
43
|
"lint": "oxlint .",
|
|
36
44
|
"lint:fix": "oxlint --fix .",
|
|
@@ -42,9 +50,13 @@
|
|
|
42
50
|
"signal-polyfill": "^0.2.2"
|
|
43
51
|
},
|
|
44
52
|
"devDependencies": {
|
|
45
|
-
"@
|
|
46
|
-
"@
|
|
47
|
-
"vitest": "^4.1.
|
|
53
|
+
"@testing-library/jest-dom": "^6.9.1",
|
|
54
|
+
"@types/node": "^26.1.1",
|
|
55
|
+
"@vitest/browser-playwright": "^4.1.10",
|
|
56
|
+
"@xmachines/shared": "1.0.0",
|
|
57
|
+
"oxfmt": "^0.58.0",
|
|
58
|
+
"oxlint": "^1.73.0",
|
|
59
|
+
"vitest": "^4.1.10"
|
|
48
60
|
},
|
|
49
61
|
"engines": {
|
|
50
62
|
"node": ">=22.0.0"
|