@tinkered/core 0.28.0 → 0.29.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkered/core",
3
- "version": "0.28.0",
3
+ "version": "0.29.2",
4
4
  "description": "Tinkered core: a small, fast reactive/graph dependency engine.",
5
5
  "keywords": [
6
6
  "tanstack-intent"
@@ -14,7 +14,7 @@ metadata:
14
14
  task skill to load next.
15
15
  type: core
16
16
  library: '@tinkered/core'
17
- library_version: '0.28.0'
17
+ library_version: '0.29.2'
18
18
  sources:
19
19
  - 'lagz0ne/tinkered:packages/core/src/main.ts'
20
20
  - 'lagz0ne/tinkered:docs/best-practices.md'
@@ -13,7 +13,7 @@ metadata:
13
13
  binding only.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.28.0'
16
+ library_version: '0.29.2'
17
17
  requires:
18
18
  - core
19
19
  sources:
@@ -13,7 +13,7 @@ metadata:
13
13
  cell read only.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.28.0'
16
+ library_version: '0.29.2'
17
17
  requires:
18
18
  - core
19
19
  sources:
@@ -13,7 +13,7 @@ metadata:
13
13
  allowed in app code.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.28.0'
16
+ library_version: '0.29.2'
17
17
  requires:
18
18
  - core
19
19
  sources:
@@ -13,7 +13,7 @@ metadata:
13
13
  on the client with remote data.
14
14
  type: sub-skill
15
15
  library: '@tinkered/core'
16
- library_version: '0.28.0'
16
+ library_version: '0.29.2'
17
17
  requires:
18
18
  - core
19
19
  - capsule
@@ -12,7 +12,7 @@ metadata:
12
12
  and join two scopes with the memory backend.
13
13
  type: sub-skill
14
14
  library: '@tinkered/core'
15
- library_version: '0.28.0'
15
+ library_version: '0.29.2'
16
16
  requires:
17
17
  - core
18
18
  sources:
@@ -175,6 +175,45 @@ and assert on the result.
175
175
  that fails by chance. Use `makeTestClock` and
176
176
  `clock.advance`.
177
177
 
178
+ ### HIGH: an exit that no test reaches [tinker/exit]
179
+
180
+ An operation's `run` type declares its exits:
181
+ each answer `kind`, a hook's refusal, and a plain
182
+ return. `tinker check` runs the tests and names
183
+ each exit that no test reached.
184
+
185
+ Wrong:
186
+
187
+ ```ts no-check
188
+ // run answers "moved" | "stale" | "gone"
189
+ const out = await tab.run(api["issue.move"], call);
190
+ expect(out).toEqual({ kind: "moved", version: 2 });
191
+ // no test gets "stale" or "gone"
192
+ ```
193
+
194
+ Right: a test for each exit the check names. The
195
+ test makes the state that gives that answer, runs
196
+ the operation through a scope, and asserts on the
197
+ answer. The scope lists the `exits` capsule first:
198
+
199
+ ```ts no-check
200
+ import { exits } from "@tinkered/cli/test";
201
+
202
+ const scope = createScope({
203
+ capsules: [
204
+ exits({ file: process.env.TINKER_EXITS }),
205
+ board.api({ implement: ops }),
206
+ ],
207
+ });
208
+ ```
209
+
210
+ In a browser test the scope has no file. It
211
+ passes the page's store:
212
+ `exits({ store: localStorage })`.
213
+
214
+ If no state can give the answer, remove it from
215
+ the operation.
216
+
178
217
  ### MEDIUM: a scope that stays open
179
218
 
180
219
  An open scope keeps timers and sockets. Close