@ersbeth/picoflow 2.0.3 → 2.2.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 +15 -0
- package/SKILL.md +6 -1
- package/dist/picoflow.js +414 -241
- package/dist/types/api/base/flowConfig.d.ts +18 -0
- package/dist/types/api/base/flowConfig.d.ts.map +1 -0
- package/dist/types/api/base/flowObservable.d.ts +3 -3
- package/dist/types/api/base/flowObservable.d.ts.map +1 -1
- package/dist/types/api/base/flowSubscribable.d.ts +2 -2
- package/dist/types/api/base/flowSubscribable.d.ts.map +1 -1
- package/dist/types/api/base/flowTracker.d.ts +1 -1
- package/dist/types/api/base/flowTracker.d.ts.map +1 -1
- package/dist/types/api/base/index.d.ts +5 -4
- package/dist/types/api/base/index.d.ts.map +1 -1
- package/dist/types/api/index.d.ts +2 -2
- package/dist/types/api/index.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowConstantAsync.d.ts +1 -1
- package/dist/types/api/nodes/async/flowConstantAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowDerivationAsync.d.ts +3 -3
- package/dist/types/api/nodes/async/flowDerivationAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowStateAsync.d.ts +3 -3
- package/dist/types/api/nodes/async/flowStateAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/flowWritableDerivationAsync.d.ts +2 -2
- package/dist/types/api/nodes/async/flowWritableDerivationAsync.d.ts.map +1 -1
- package/dist/types/api/nodes/async/index.d.ts +4 -4
- package/dist/types/api/nodes/async/index.d.ts.map +1 -1
- package/dist/types/api/nodes/collections/flowArray.d.ts +7 -4
- package/dist/types/api/nodes/collections/flowArray.d.ts.map +1 -1
- package/dist/types/api/nodes/collections/flowMap.d.ts +3 -2
- package/dist/types/api/nodes/collections/flowMap.d.ts.map +1 -1
- package/dist/types/api/nodes/collections/index.d.ts +2 -2
- package/dist/types/api/nodes/collections/index.d.ts.map +1 -1
- package/dist/types/api/nodes/flowEffect.d.ts +2 -2
- package/dist/types/api/nodes/flowEffect.d.ts.map +1 -1
- package/dist/types/api/nodes/flowSignal.d.ts +1 -1
- package/dist/types/api/nodes/flowSignal.d.ts.map +1 -1
- package/dist/types/api/nodes/flowValue.d.ts +2 -2
- package/dist/types/api/nodes/flowValue.d.ts.map +1 -1
- package/dist/types/api/nodes/index.d.ts +7 -7
- package/dist/types/api/nodes/index.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowConstant.d.ts +2 -2
- package/dist/types/api/nodes/sync/flowConstant.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowDerivation.d.ts +3 -3
- package/dist/types/api/nodes/sync/flowDerivation.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowState.d.ts +3 -3
- package/dist/types/api/nodes/sync/flowState.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/flowWritableDerivation.d.ts +2 -2
- package/dist/types/api/nodes/sync/flowWritableDerivation.d.ts.map +1 -1
- package/dist/types/api/nodes/sync/index.d.ts +4 -4
- package/dist/types/api/nodes/sync/index.d.ts.map +1 -1
- package/dist/types/api/nodes/utils.d.ts +1 -1
- package/dist/types/api/nodes/utils.d.ts.map +1 -1
- package/dist/types/base/disposable.d.ts +4 -4
- package/dist/types/base/disposable.d.ts.map +1 -1
- package/dist/types/base/executionStack.d.ts +26 -1
- package/dist/types/base/executionStack.d.ts.map +1 -1
- package/dist/types/base/index.d.ts +5 -5
- package/dist/types/base/index.d.ts.map +1 -1
- package/dist/types/base/node.d.ts +6 -5
- package/dist/types/base/node.d.ts.map +1 -1
- package/dist/types/base/observable.d.ts +3 -3
- package/dist/types/base/observable.d.ts.map +1 -1
- package/dist/types/base/observer.d.ts +11 -2
- package/dist/types/base/observer.d.ts.map +1 -1
- package/dist/types/converters/index.d.ts +1 -1
- package/dist/types/converters/index.d.ts.map +1 -1
- package/dist/types/converters/solid.d.ts +12 -8
- package/dist/types/converters/solid.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/nodes/actionNode.d.ts +23 -0
- package/dist/types/nodes/actionNode.d.ts.map +1 -0
- package/dist/types/nodes/arrayNode.d.ts +4 -3
- package/dist/types/nodes/arrayNode.d.ts.map +1 -1
- package/dist/types/nodes/effectNode.d.ts +18 -2
- package/dist/types/nodes/effectNode.d.ts.map +1 -1
- package/dist/types/nodes/index.d.ts +8 -7
- package/dist/types/nodes/index.d.ts.map +1 -1
- package/dist/types/nodes/mapNode.d.ts +4 -3
- package/dist/types/nodes/mapNode.d.ts.map +1 -1
- package/dist/types/nodes/signalNode.d.ts +2 -2
- package/dist/types/nodes/signalNode.d.ts.map +1 -1
- package/dist/types/nodes/valueAsyncNode.d.ts +3 -3
- package/dist/types/nodes/valueAsyncNode.d.ts.map +1 -1
- package/dist/types/nodes/valueNode.d.ts +10 -3
- package/dist/types/nodes/valueNode.d.ts.map +1 -1
- package/dist/types/nodes/valueSyncNode.d.ts +3 -3
- package/dist/types/nodes/valueSyncNode.d.ts.map +1 -1
- package/dist/types/schedulers/asyncScheduler.d.ts +2 -1
- package/dist/types/schedulers/asyncScheduler.d.ts.map +1 -1
- package/dist/types/schedulers/index.d.ts +4 -4
- package/dist/types/schedulers/index.d.ts.map +1 -1
- package/dist/types/schedulers/syncResolver.d.ts +1 -2
- package/dist/types/schedulers/syncResolver.d.ts.map +1 -1
- package/dist/types/schedulers/syncScheduler.d.ts +1 -1
- package/dist/types/schedulers/syncScheduler.d.ts.map +1 -1
- package/package.json +22 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Elisabeth Rousset
|
|
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
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
> **Upgrading from v1.x?** See the [Upgrade Guide](https://ersbeth-web.gitlab.io/picoflow/guide/advanced/migration-v2.html) for migration instructions.
|
|
6
6
|
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
The schedulers use `Promise.withResolvers()`, so picoflow needs **Node ≥ 22**, or Chrome ≥ 119, Safari ≥ 17.4, Firefox ≥ 121 in the browser. There is no fallback: on an older runtime the failure is immediate, on the first primitive you create.
|
|
10
|
+
|
|
7
11
|
## Installation
|
|
8
12
|
|
|
9
13
|
```bash
|
|
@@ -21,6 +25,17 @@ yarn add @ersbeth/picoflow
|
|
|
21
25
|
|
|
22
26
|
For comprehensive guides and API documentation, visit the [official website](https://ersbeth-web.gitlab.io/picoflow/)
|
|
23
27
|
|
|
28
|
+
## Development
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm install
|
|
32
|
+
pnpm playwright:install # once — downloads Chromium for the browser tests
|
|
33
|
+
pnpm test # watch Node tests
|
|
34
|
+
pnpm test:browser # watch browser tests
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
See [`CONTRIBUTING.md`](CONTRIBUTING.md) for the full setup, the conventions and the release procedure. Known issues and their status are tracked in [`audits/FINDINGS.md`](audits/FINDINGS.md); planned breaking changes in [`ROADMAP.md`](ROADMAP.md); vulnerability reporting in [`SECURITY.md`](SECURITY.md).
|
|
38
|
+
|
|
24
39
|
## AI Coding Agents
|
|
25
40
|
|
|
26
41
|
Picoflow ships a [`SKILL.md`](SKILL.md) with the npm package, matching the exact version you have
|
package/SKILL.md
CHANGED
|
@@ -59,7 +59,12 @@ callback) rather than needing manual `await`/try-catch inside a derivation.
|
|
|
59
59
|
- **Creating a subscription inside another subscription's callback** — it re-creates one on every run
|
|
60
60
|
and leaks. Combine into a single `subscribe()` whose data function reads all the needed primitives.
|
|
61
61
|
- **A `subscribe()`/`.subscribe()` callback that calls `.set()` on a primitive it also reads** — infinite
|
|
62
|
-
loop.
|
|
62
|
+
loop. PicoFlow's own cycle guard stops it after 10 000 steps and reports it through `onFlushError()`
|
|
63
|
+
(see below) rather than crashing the process, but the loop is still a bug to fix, not something to rely
|
|
64
|
+
on the guard for.
|
|
65
|
+
- **`subscribe(fn)` with no `onError`, and no global `onFlushError()` handler installed** — any exception
|
|
66
|
+
thrown inside `fn` is only logged via `console.error` by default; install `onFlushError((error) => ...)`
|
|
67
|
+
once at startup if the application needs to observe or report these instead of the default logging.
|
|
63
68
|
- **Using `add()`/`update()` on `array`/`map` without checking preconditions** — `array.update(index, x)`
|
|
64
69
|
throws if the index is out of bounds; `map.add(key, x)` throws if the key exists; `map.update(key, x)`
|
|
65
70
|
throws if it doesn't. Check first (`.pick()`) or branch on it, don't assume.
|