@mountaya/studio 0.1.0 → 0.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/CHANGELOG.md +30 -0
- package/dist/agent/index.cjs +2561 -2815
- package/dist/agent/index.cjs.map +1 -1
- package/dist/agent/index.d.cts +766 -786
- package/dist/agent/index.d.ts +766 -786
- package/dist/agent/index.js +2553 -2790
- package/dist/agent/index.js.map +1 -1
- package/dist/chunk-3Oi_Zrtm.js +9 -0
- package/dist/chunk-3Oi_Zrtm.js.map +1 -0
- package/dist/chunk-B18OPIu_.js +6 -0
- package/dist/chunk-B18OPIu_.js.map +1 -0
- package/dist/chunk-B5Uz3Qct.cjs +15 -0
- package/dist/chunk-B5Uz3Qct.cjs.map +1 -0
- package/dist/chunk-BBEJwkd3.d.cts +839 -0
- package/dist/chunk-BIEc_SkR.cjs +29 -0
- package/dist/chunk-BIEc_SkR.cjs.map +1 -0
- package/dist/chunk-BKMFOe-N.js +171 -0
- package/dist/chunk-BKMFOe-N.js.map +1 -0
- package/dist/chunk-BP4uy7E1.d.ts +11583 -0
- package/dist/chunk-BSHTsFiB.js +1403 -0
- package/dist/chunk-BSHTsFiB.js.map +1 -0
- package/dist/chunk-BTUUABGI.js +17 -0
- package/dist/chunk-BTUUABGI.js.map +1 -0
- package/dist/chunk-BaPiaz5X.cjs +115 -0
- package/dist/chunk-BaPiaz5X.cjs.map +1 -0
- package/dist/chunk-BeCVpkYr.cjs +542 -0
- package/dist/chunk-BeCVpkYr.cjs.map +1 -0
- package/dist/chunk-BgngsvK8.cjs +6202 -0
- package/dist/chunk-BgngsvK8.cjs.map +1 -0
- package/dist/chunk-BhInd7CJ.d.cts +253 -0
- package/dist/chunk-Bn6ZbxkS.cjs +27 -0
- package/dist/chunk-By9ZnkVI.js +60 -0
- package/dist/chunk-By9ZnkVI.js.map +1 -0
- package/dist/chunk-BzqPhxsz.cjs +367 -0
- package/dist/chunk-BzqPhxsz.cjs.map +1 -0
- package/dist/chunk-C2mMX81q.d.ts +443 -0
- package/dist/chunk-C2rr9Q0V.cjs +1402 -0
- package/dist/chunk-C2rr9Q0V.cjs.map +1 -0
- package/dist/{directorThreads-CqmvsV8b.d.cts → chunk-CDJCbwIQ.d.cts} +20 -22
- package/dist/chunk-CLGvBOVH.d.cts +1654 -0
- package/dist/chunk-COdw1dc6.d.ts +525 -0
- package/dist/chunk-CQCJnT2i.d.ts +511 -0
- package/dist/chunk-CSyHY67q.cjs +353 -0
- package/dist/chunk-CSyHY67q.cjs.map +1 -0
- package/dist/chunk-CiK1Iqrv.js +950 -0
- package/dist/chunk-CiK1Iqrv.js.map +1 -0
- package/dist/chunk-CmJBgSwZ.cjs +24 -0
- package/dist/chunk-CmJBgSwZ.cjs.map +1 -0
- package/dist/chunk-CnrsRK2u.cjs +83 -0
- package/dist/chunk-CnrsRK2u.cjs.map +1 -0
- package/dist/chunk-Co782_9r.js +326 -0
- package/dist/chunk-Co782_9r.js.map +1 -0
- package/dist/chunk-Csr3KDpZ.cjs +32 -0
- package/dist/chunk-Csr3KDpZ.cjs.map +1 -0
- package/dist/chunk-CwkmccXv.js +89 -0
- package/dist/chunk-CwkmccXv.js.map +1 -0
- package/dist/chunk-D0Q4iL9B.cjs +255 -0
- package/dist/chunk-D0Q4iL9B.cjs.map +1 -0
- package/dist/chunk-DFwiSzUS.cjs +72 -0
- package/dist/chunk-DFwiSzUS.cjs.map +1 -0
- package/dist/chunk-DIFayl2P.d.cts +443 -0
- package/dist/chunk-DIGF58ux.d.cts +525 -0
- package/dist/chunk-DKuuuld5.js +101 -0
- package/dist/chunk-DKuuuld5.js.map +1 -0
- package/dist/chunk-DMePkFEo.js +5054 -0
- package/dist/chunk-DMePkFEo.js.map +1 -0
- package/dist/chunk-DO5SIBgu.js +305 -0
- package/dist/chunk-DO5SIBgu.js.map +1 -0
- package/dist/chunk-DOQ_7eE5.d.ts +6662 -0
- package/dist/{tabs-B2nRO4p_.d.ts → chunk-DThaaNeb.d.cts} +2 -2
- package/dist/{tabs-B2nRO4p_.d.cts → chunk-DThaaNeb.d.ts} +2 -2
- package/dist/{directorThreads-CqmvsV8b.d.ts → chunk-DUQzjUJy.d.ts} +20 -22
- package/dist/chunk-DX37IPhV.cjs +1903 -0
- package/dist/chunk-DX37IPhV.cjs.map +1 -0
- package/dist/chunk-Damps5Tk.cjs +155 -0
- package/dist/chunk-Damps5Tk.cjs.map +1 -0
- package/dist/chunk-DbK5PhpJ.d.ts +1654 -0
- package/dist/chunk-De0vAASv.d.ts +253 -0
- package/dist/chunk-DhSZ7YZt.d.cts +6662 -0
- package/dist/chunk-DjEvqvPA.cjs +43 -0
- package/dist/chunk-DjEvqvPA.cjs.map +1 -0
- package/dist/{saveFile-j-1kkApx.d.cts → chunk-DkwDzwvu.d.cts} +7 -9
- package/dist/{saveFile-j-1kkApx.d.ts → chunk-DkwDzwvu.d.ts} +7 -9
- package/dist/chunk-Dmszv9If.js +71 -0
- package/dist/chunk-Dmszv9If.js.map +1 -0
- package/dist/chunk-Dp_ftNWY.d.cts +511 -0
- package/dist/chunk-DsHQySz0.js +31 -0
- package/dist/chunk-DsHQySz0.js.map +1 -0
- package/dist/chunk-DwoUyHHh.js +281 -0
- package/dist/chunk-DwoUyHHh.js.map +1 -0
- package/dist/chunk-IaIDQflj.d.cts +2315 -0
- package/dist/chunk-IaIDQflj.d.ts +2315 -0
- package/dist/chunk-cVXLsZfL.d.ts +839 -0
- package/dist/chunk-mIaCX9EJ.d.cts +11583 -0
- package/dist/chunk-nJQxbOwQ.cjs +8962 -0
- package/dist/chunk-nJQxbOwQ.cjs.map +1 -0
- package/dist/chunk-o9jaxhCO.js +8852 -0
- package/dist/chunk-o9jaxhCO.js.map +1 -0
- package/dist/chunk-p-Tt_Lwz.js +14 -0
- package/dist/chunk-p-Tt_Lwz.js.map +1 -0
- package/dist/engines/index.cjs +2046 -3401
- package/dist/engines/index.cjs.map +1 -1
- package/dist/engines/index.d.cts +1510 -1550
- package/dist/engines/index.d.ts +1510 -1550
- package/dist/engines/index.js +2039 -3380
- package/dist/engines/index.js.map +1 -1
- package/dist/handlers/index.cjs +47 -93
- package/dist/handlers/index.cjs.map +1 -1
- package/dist/handlers/index.d.cts +61 -103
- package/dist/handlers/index.d.ts +61 -103
- package/dist/handlers/index.js +27 -36
- package/dist/handlers/index.js.map +1 -1
- package/dist/index.cjs +3347 -4398
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -7297
- package/dist/index.d.ts +8 -7297
- package/dist/index.js +2997 -3187
- package/dist/index.js.map +1 -1
- package/dist/plugins/index.cjs +482 -949
- package/dist/plugins/index.cjs.map +1 -1
- package/dist/plugins/index.d.cts +44 -61
- package/dist/plugins/index.d.ts +44 -61
- package/dist/plugins/index.js +471 -915
- package/dist/plugins/index.js.map +1 -1
- package/dist/seams/index.cjs +77 -140
- package/dist/seams/index.cjs.map +1 -1
- package/dist/seams/index.d.cts +125 -158
- package/dist/seams/index.d.ts +125 -158
- package/dist/seams/index.js +41 -71
- package/dist/seams/index.js.map +1 -1
- package/dist/strings/fr/index.cjs +2130 -2116
- package/dist/strings/fr/index.cjs.map +1 -1
- package/dist/strings/fr/index.d.cts +3 -5
- package/dist/strings/fr/index.d.ts +3 -5
- package/dist/strings/fr/index.js +2125 -2114
- package/dist/strings/fr/index.js.map +1 -1
- package/dist/strings/index.cjs +2331 -2625
- package/dist/strings/index.cjs.map +1 -1
- package/dist/strings/index.d.cts +3 -731
- package/dist/strings/index.d.ts +3 -731
- package/dist/strings/index.js +2324 -2615
- package/dist/strings/index.js.map +1 -1
- package/dist/testing/index.cjs +214 -276
- package/dist/testing/index.cjs.map +1 -1
- package/dist/testing/index.d.cts +61 -121
- package/dist/testing/index.d.ts +61 -121
- package/dist/testing/index.js +208 -273
- package/dist/testing/index.js.map +1 -1
- package/dist/time/index.cjs +23 -23
- package/dist/time/index.cjs.map +1 -1
- package/dist/time/index.d.cts +5 -7
- package/dist/time/index.d.ts +5 -7
- package/dist/time/index.js +18 -21
- package/dist/time/index.js.map +1 -1
- package/package.json +14 -15
- package/src/agent/rules/stateDelta.ts +1 -0
- package/src/agent/stores/agentThreads.ts +1 -4
- package/src/bus/rules/bus.ts +1 -2
- package/src/bus/rules/defineRegistry.ts +3 -5
- package/src/bus/rules/types.ts +6 -7
- package/src/chrome/stores/uiStore.ts +4 -2
- package/src/embed/rules/fieldDependencies.ts +2 -0
- package/src/embed/rules/safetyRules.ts +2 -0
- package/src/embed/rules/tableCode.ts +4 -3
- package/src/index.ts +6 -27
- package/src/itinerary/rules/import.ts +6 -8
- package/src/plugins/contracts/plugin.ts +4 -2
- package/src/seams/rules/formatters.ts +5 -3
- package/src/testing/index.ts +1 -5
- package/src/viewer/rules/platformViewer.ts +1 -0
- package/dist/bus-BwiNiXdH.d.ts +0 -514
- package/dist/bus-DzmhPwdK.d.cts +0 -514
- package/dist/chainModel-B23pEP_1.d.cts +0 -127
- package/dist/chainModel-B23pEP_1.d.ts +0 -127
- package/dist/chunk-2HFY7ETU.js +0 -5721
- package/dist/chunk-2HFY7ETU.js.map +0 -1
- package/dist/chunk-355TOXSB.js +0 -72
- package/dist/chunk-355TOXSB.js.map +0 -1
- package/dist/chunk-4ZCUZVSV.js +0 -10275
- package/dist/chunk-4ZCUZVSV.js.map +0 -1
- package/dist/chunk-6HEKY3NF.js +0 -95
- package/dist/chunk-6HEKY3NF.js.map +0 -1
- package/dist/chunk-7GFLGGBX.cjs +0 -8
- package/dist/chunk-7GFLGGBX.cjs.map +0 -1
- package/dist/chunk-7NBRCENN.cjs +0 -19
- package/dist/chunk-7NBRCENN.cjs.map +0 -1
- package/dist/chunk-AF5GCXE3.js +0 -8
- package/dist/chunk-AF5GCXE3.js.map +0 -1
- package/dist/chunk-CJDIFRGZ.cjs +0 -2005
- package/dist/chunk-CJDIFRGZ.cjs.map +0 -1
- package/dist/chunk-CNPZY7N3.js +0 -349
- package/dist/chunk-CNPZY7N3.js.map +0 -1
- package/dist/chunk-DZJHTWSF.cjs +0 -45
- package/dist/chunk-DZJHTWSF.cjs.map +0 -1
- package/dist/chunk-EABIHHWA.js +0 -42
- package/dist/chunk-EABIHHWA.js.map +0 -1
- package/dist/chunk-EKZWV6RS.cjs +0 -415
- package/dist/chunk-EKZWV6RS.cjs.map +0 -1
- package/dist/chunk-EOKRXXAC.cjs +0 -24
- package/dist/chunk-EOKRXXAC.cjs.map +0 -1
- package/dist/chunk-F73W2ZTJ.js +0 -1126
- package/dist/chunk-F73W2ZTJ.js.map +0 -1
- package/dist/chunk-H4DVOZ5O.js +0 -1897
- package/dist/chunk-H4DVOZ5O.js.map +0 -1
- package/dist/chunk-HI52PBFT.cjs +0 -10314
- package/dist/chunk-HI52PBFT.cjs.map +0 -1
- package/dist/chunk-IDBXFBLG.cjs +0 -1225
- package/dist/chunk-IDBXFBLG.cjs.map +0 -1
- package/dist/chunk-LBWTJZUJ.js +0 -297
- package/dist/chunk-LBWTJZUJ.js.map +0 -1
- package/dist/chunk-NCLA6DKD.cjs +0 -310
- package/dist/chunk-NCLA6DKD.cjs.map +0 -1
- package/dist/chunk-O4MC5DPD.js +0 -19
- package/dist/chunk-O4MC5DPD.js.map +0 -1
- package/dist/chunk-OP37FKW6.cjs +0 -98
- package/dist/chunk-OP37FKW6.cjs.map +0 -1
- package/dist/chunk-OQSYFH3Z.cjs +0 -5945
- package/dist/chunk-OQSYFH3Z.cjs.map +0 -1
- package/dist/chunk-PACIO4NS.cjs +0 -26
- package/dist/chunk-PACIO4NS.cjs.map +0 -1
- package/dist/chunk-PSZ2R3TC.cjs +0 -75
- package/dist/chunk-PSZ2R3TC.cjs.map +0 -1
- package/dist/chunk-QFO5CZG2.cjs +0 -136
- package/dist/chunk-QFO5CZG2.cjs.map +0 -1
- package/dist/chunk-QL63MUEW.cjs +0 -140
- package/dist/chunk-QL63MUEW.cjs.map +0 -1
- package/dist/chunk-RFUPPVZO.js +0 -17
- package/dist/chunk-RFUPPVZO.js.map +0 -1
- package/dist/chunk-RPG2LWMP.js +0 -23
- package/dist/chunk-RPG2LWMP.js.map +0 -1
- package/dist/chunk-TIBXK6B7.cjs +0 -12
- package/dist/chunk-TIBXK6B7.cjs.map +0 -1
- package/dist/chunk-UU65VNEV.js +0 -381
- package/dist/chunk-UU65VNEV.js.map +0 -1
- package/dist/chunk-VGX6TR2I.js +0 -209
- package/dist/chunk-VGX6TR2I.js.map +0 -1
- package/dist/chunk-WUTDDBVP.js +0 -130
- package/dist/chunk-WUTDDBVP.js.map +0 -1
- package/dist/chunk-WVQQLKCI.cjs +0 -224
- package/dist/chunk-WVQQLKCI.cjs.map +0 -1
- package/dist/chunk-WZYXG3SE.js +0 -111
- package/dist/chunk-WZYXG3SE.js.map +0 -1
- package/dist/chunk-XDI2X3KE.js +0 -6
- package/dist/chunk-XDI2X3KE.js.map +0 -1
- package/dist/chunk-XKHLRIC7.cjs +0 -381
- package/dist/chunk-XKHLRIC7.cjs.map +0 -1
- package/dist/context-DNtd2WUv.d.cts +0 -11666
- package/dist/context-DgB72Bur.d.ts +0 -11666
- package/dist/en-Bu4Ti9Ev.d.cts +0 -2315
- package/dist/en-Bu4Ti9Ev.d.ts +0 -2315
- package/dist/shareLink-B6hlt942.d.ts +0 -144
- package/dist/shareLink-C7rIMb7x.d.ts +0 -527
- package/dist/shareLink-CnTxxXjp.d.cts +0 -144
- package/dist/shareLink-DyZVYH2V.d.cts +0 -527
- package/dist/studioPlugin-C3C7VjMy.d.ts +0 -847
- package/dist/studioPlugin-Cf3OBNUv.d.cts +0 -847
- package/dist/types-BzJRV6UI.d.cts +0 -845
- package/dist/types-BzJRV6UI.d.ts +0 -845
- package/dist/zoneForm-CdYNtnnA.d.cts +0 -320
- package/dist/zoneForm-mG85yt5e.d.ts +0 -320
package/dist/testing/index.d.cts
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import { StudioPluginToolSink } from
|
|
2
|
-
import { StudioToolContext,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import 'zod';
|
|
6
|
-
import '@mountaya/elements/camera';
|
|
7
|
-
import '@mountaya/elements/map-client';
|
|
8
|
-
import '@mountaya/elements/seams';
|
|
9
|
-
import 'geojson';
|
|
10
|
-
import '../types-BzJRV6UI.cjs';
|
|
11
|
-
import 'zustand/vanilla';
|
|
12
|
-
import '@mountaya/elements/data';
|
|
13
|
-
import '../en-Bu4Ti9Ev.cjs';
|
|
14
|
-
import '@mountaya/elements/errors';
|
|
15
|
-
import '../saveFile-j-1kkApx.cjs';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The two doubles a plugin's own suite needs, and neither one is a plugin.
|
|
19
|
-
*
|
|
20
|
-
* A consumer writing a plugin has two things worth testing that they cannot reach with the
|
|
21
|
-
* published API alone: whether their gate opens under the grants they expect, and whether their
|
|
22
|
-
* tools land on a bus and come back off it. The first needs a {@link StudioToolContext}, whose
|
|
23
|
-
* required members include two whole subsystems, and the second needs something that records
|
|
24
|
-
* what a registry did to it.
|
|
25
|
-
*
|
|
26
|
-
* Here rather than under `@mountaya/studio/plugins`, because an `index.ts` is legal only where
|
|
27
|
-
* `package.json#exports` names one: a `plugins/testing/` barrel would either be unreachable or
|
|
28
|
-
* would put doubles on a production consumer's import path. The fixtures entry is where doubles
|
|
29
|
-
* live, and it is already off every other barrel.
|
|
30
|
-
*/
|
|
31
|
-
|
|
1
|
+
import { s as StudioPluginToolSink } from "../chunk-BBEJwkd3.cjs";
|
|
2
|
+
import { a as StudioToolContext, c as StudioEntitlement, l as StudioViewer, m as StudioUrlSeam, oo as StudioToolOutputs, p as MirroredSearch, z as StudioCache } from "../chunk-mIaCX9EJ.cjs";
|
|
3
|
+
import { t as ToolBus } from "../chunk-Dp_ftNWY.cjs";
|
|
4
|
+
import { ResourceRef } from "@mountaya/client";
|
|
32
5
|
/**
|
|
33
6
|
* FakeStudioToolSink is a recording {@link StudioPluginToolSink}: it holds the tools a registry
|
|
34
7
|
* registered, remembers every name taken back off it, and can be made to refuse one.
|
|
@@ -42,15 +15,15 @@ import '../saveFile-j-1kkApx.cjs';
|
|
|
42
15
|
* one tool twice fails over this sink as it fails over a bus. A name taken back is free again.
|
|
43
16
|
*/
|
|
44
17
|
interface FakeStudioToolSink extends StudioPluginToolSink {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
/** Refuses the named tool at `register`, throwing. Pass null to refuse nothing. */
|
|
19
|
+
failOn: (name: string | null) => void;
|
|
20
|
+
/** Every name `register` accepted, in order, minus the ones taken back. */
|
|
21
|
+
readonly names: () => readonly string[];
|
|
22
|
+
/** Every name `unregister` was called with, in order, whether or not it was there. */
|
|
23
|
+
readonly unregistered: string[];
|
|
51
24
|
}
|
|
52
25
|
/** fakeStudioToolSink builds a recording sink holding no tools. */
|
|
53
|
-
declare const fakeStudioToolSink: () => FakeStudioToolSink;
|
|
26
|
+
export declare const fakeStudioToolSink: () => FakeStudioToolSink;
|
|
54
27
|
/**
|
|
55
28
|
* fakeStudioToolContext builds the minimal context a gate is evaluated against and a `run` is
|
|
56
29
|
* handed.
|
|
@@ -69,25 +42,7 @@ declare const fakeStudioToolSink: () => FakeStudioToolSink;
|
|
|
69
42
|
* the PERSON holds, and the second one answering "nothing" is what an unhydrated session looks
|
|
70
43
|
* like. Use `fakeViewer` next door when the entitlements have to move during the test.
|
|
71
44
|
*/
|
|
72
|
-
declare const fakeStudioToolContext: (overrides?: Partial<StudioToolContext>) => StudioToolContext;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The fixtures the studio handlers' own suites are built over.
|
|
76
|
-
*
|
|
77
|
-
* Every dispatch takes a {@link StudioToolContext}, and three of its seams have no honest
|
|
78
|
-
* default: a viewer is a session, a cache is a host's query layer, and a bus is the thing under
|
|
79
|
-
* test. This module supplies one double for each, so a suite arranges a context in a line
|
|
80
|
-
* rather than hand-rolling a partial literal that drifts from the seam it stands for.
|
|
81
|
-
*
|
|
82
|
-
* Published from `@mountaya/studio/testing`, which is what the entry is for: a consumer writing a
|
|
83
|
-
* test against a surface that takes a `StudioViewer` builds one in a line rather than out of the
|
|
84
|
-
* interface by hand.
|
|
85
|
-
*
|
|
86
|
-
* Nothing here names a test runner. A fixture inside a published tarball may not import
|
|
87
|
-
* `vitest`: the manifest cannot declare it, and the failure would be `publint` and `attw`
|
|
88
|
-
* reporting an unresolvable specifier rather than a red suite.
|
|
89
|
-
*/
|
|
90
|
-
|
|
45
|
+
export declare const fakeStudioToolContext: (overrides?: Partial<StudioToolContext>) => StudioToolContext;
|
|
91
46
|
/**
|
|
92
47
|
* The recording {@link StudioCache} every handler suite runs against.
|
|
93
48
|
*
|
|
@@ -105,29 +60,29 @@ declare const fakeStudioToolContext: (overrides?: Partial<StudioToolContext>) =>
|
|
|
105
60
|
* against a double that lacks it.
|
|
106
61
|
*/
|
|
107
62
|
interface FakeStudioCache extends StudioCache {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Removes the entry seeded or written under the resource, and records the resource in
|
|
65
|
+
* {@link evicted}. Stated as required here, where the seam leaves it optional, so a suite calls
|
|
66
|
+
* it with no guard.
|
|
67
|
+
*/
|
|
68
|
+
evict: (key: ResourceRef) => void;
|
|
69
|
+
/** Every resource `evict` was named with, in order. */
|
|
70
|
+
readonly evicted: ResourceRef[];
|
|
71
|
+
/**
|
|
72
|
+
* Every resource `invalidate` was named with, flattened across calls, in order.
|
|
73
|
+
*
|
|
74
|
+
* A recorded LIST rather than a spy, because the assertion a suite wants to write is "this
|
|
75
|
+
* dispatch made exactly these resources stale": one `toEqual` naming them, where a spy makes
|
|
76
|
+
* it one `toHaveBeenCalledWith` per call plus a count nobody remembers to assert.
|
|
77
|
+
*/
|
|
78
|
+
readonly invalidated: ResourceRef[];
|
|
79
|
+
/** Every `(resource, value)` pair `set` was called with, in order. */
|
|
80
|
+
readonly written: {
|
|
81
|
+
key: ResourceRef;
|
|
82
|
+
value: unknown;
|
|
83
|
+
}[];
|
|
84
|
+
/** Put a value where `get` will find it. */
|
|
85
|
+
seed: (key: ResourceRef, value: unknown) => void;
|
|
131
86
|
}
|
|
132
87
|
/**
|
|
133
88
|
* fakeStudioCache builds an empty recording {@link FakeStudioCache}.
|
|
@@ -144,7 +99,7 @@ interface FakeStudioCache extends StudioCache {
|
|
|
144
99
|
* console.log(cache.invalidated);
|
|
145
100
|
* ```
|
|
146
101
|
*/
|
|
147
|
-
declare const fakeStudioCache: () => FakeStudioCache;
|
|
102
|
+
export declare const fakeStudioCache: () => FakeStudioCache;
|
|
148
103
|
/**
|
|
149
104
|
* FakeViewer is a {@link StudioViewer} a suite can move.
|
|
150
105
|
*
|
|
@@ -158,12 +113,12 @@ declare const fakeStudioCache: () => FakeStudioCache;
|
|
|
158
113
|
* surface reads, whatever a host derives it from.
|
|
159
114
|
*/
|
|
160
115
|
interface FakeViewer extends StudioViewer {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
116
|
+
/** Replaces the held set, so `setEntitlements()` with nothing revokes everything. */
|
|
117
|
+
setEntitlements: (...held: readonly StudioEntitlement[]) => void;
|
|
118
|
+
/** Sets what `getItineraryLimit` answers in every scope; null states no limit. */
|
|
119
|
+
setItineraryLimit: (limit: number | null) => void;
|
|
120
|
+
/** Sets what `getUserId` answers; null is a viewer who is not signed in. */
|
|
121
|
+
setUserId: (userId: string | null) => void;
|
|
167
122
|
}
|
|
168
123
|
/**
|
|
169
124
|
* fakeViewer builds the viewer an unhydrated session presents: no user, no entitlement, no
|
|
@@ -176,7 +131,7 @@ interface FakeViewer extends StudioViewer {
|
|
|
176
131
|
* Preferences MERGE rather than replace, matching the seam's contract: a partial write carries
|
|
177
132
|
* only the fields it names, and the first one turns `getPreferences` from null into a record.
|
|
178
133
|
*/
|
|
179
|
-
declare const fakeViewer: () => FakeViewer;
|
|
134
|
+
export declare const fakeViewer: () => FakeViewer;
|
|
180
135
|
/**
|
|
181
136
|
* FakeStudioBus is the bus a suite dispatches through, LOOSE in its tool set by default.
|
|
182
137
|
*
|
|
@@ -216,7 +171,7 @@ type FakeStudioBus<TInputs extends object = Record<string, unknown>, TOutputs ex
|
|
|
216
171
|
* is not checked, and a tool of your own registered on this bus is held to the `output` it
|
|
217
172
|
* states.
|
|
218
173
|
*/
|
|
219
|
-
declare const studioToolBus: () => FakeStudioBus;
|
|
174
|
+
export declare const studioToolBus: () => FakeStudioBus;
|
|
220
175
|
/**
|
|
221
176
|
* emptyStudioToolBus is the same bus with NOTHING registered, for a suite that wants the
|
|
222
177
|
* smallest tool surface its subject needs.
|
|
@@ -228,21 +183,7 @@ declare const studioToolBus: () => FakeStudioBus;
|
|
|
228
183
|
* It holds every answer to its tool's `output` schema, as {@link studioToolBus} does and for
|
|
229
184
|
* the reason given there.
|
|
230
185
|
*/
|
|
231
|
-
declare const emptyStudioToolBus: () => FakeStudioBus;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* The URL seam a suite runs against: the mirrored slice held in memory, as a host's router holds
|
|
235
|
-
* it in an address bar.
|
|
236
|
-
*
|
|
237
|
-
* A handler writes a patch and a surface reads the slice back, so a suite asserts both halves:
|
|
238
|
-
* what was written, and what the URL holds once it was. A seam written out by hand at each site
|
|
239
|
-
* states every member of {@link StudioUrlSeam} again, and a member added to the seam is then an
|
|
240
|
-
* edit of every one of them.
|
|
241
|
-
*
|
|
242
|
-
* It names no test runner, for the reason the fixtures next door give: a module inside a
|
|
243
|
-
* published tarball may not import one.
|
|
244
|
-
*/
|
|
245
|
-
|
|
186
|
+
export declare const emptyStudioToolBus: () => FakeStudioBus;
|
|
246
187
|
/**
|
|
247
188
|
* FakeStudioUrlSeam is a {@link StudioUrlSeam} that keeps the mirrored slice in memory and
|
|
248
189
|
* records every write.
|
|
@@ -255,20 +196,20 @@ declare const emptyStudioToolBus: () => FakeStudioBus;
|
|
|
255
196
|
* the fault of one that throws leaves no `write` and is surfaced on a microtask.
|
|
256
197
|
*/
|
|
257
198
|
interface FakeStudioUrlSeam extends StudioUrlSeam {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
199
|
+
/**
|
|
200
|
+
* The hash the last write carried, or `undefined` when it carried none and before any write.
|
|
201
|
+
*
|
|
202
|
+
* A write that carries no hash drops the one before it, as a router that does not observe the
|
|
203
|
+
* map's own `#view` writes does.
|
|
204
|
+
*/
|
|
205
|
+
readonly hash: () => string | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Every patch `write` was handed, in order and as handed, a key stated as `undefined` included.
|
|
208
|
+
*
|
|
209
|
+
* A recorded list and not a spy, so a suite states the writes of a dispatch in one `toEqual`
|
|
210
|
+
* and an empty list says that nothing was mirrored.
|
|
211
|
+
*/
|
|
212
|
+
readonly written: MirroredSearch[];
|
|
272
213
|
}
|
|
273
214
|
/**
|
|
274
215
|
* fakeStudioUrlSeam builds a recording URL seam over a slice held in memory.
|
|
@@ -300,7 +241,6 @@ interface FakeStudioUrlSeam extends StudioUrlSeam {
|
|
|
300
241
|
* url.read(); // { creating: true }
|
|
301
242
|
* ```
|
|
302
243
|
*/
|
|
303
|
-
declare const fakeStudioUrlSeam: (initial?: MirroredSearch) => FakeStudioUrlSeam;
|
|
304
|
-
|
|
305
|
-
export { emptyStudioToolBus, fakeStudioCache, fakeStudioToolContext, fakeStudioToolSink, fakeStudioUrlSeam, fakeViewer, studioToolBus };
|
|
244
|
+
export declare const fakeStudioUrlSeam: (initial?: MirroredSearch) => FakeStudioUrlSeam;
|
|
306
245
|
export type { FakeStudioBus, FakeStudioCache, FakeStudioToolSink, FakeStudioUrlSeam, FakeViewer };
|
|
246
|
+
//# sourceMappingURL=index.d.cts.map
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import { StudioPluginToolSink } from
|
|
2
|
-
import { StudioToolContext,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import 'zod';
|
|
6
|
-
import '@mountaya/elements/camera';
|
|
7
|
-
import '@mountaya/elements/map-client';
|
|
8
|
-
import '@mountaya/elements/seams';
|
|
9
|
-
import 'geojson';
|
|
10
|
-
import '../types-BzJRV6UI.js';
|
|
11
|
-
import 'zustand/vanilla';
|
|
12
|
-
import '@mountaya/elements/data';
|
|
13
|
-
import '../en-Bu4Ti9Ev.js';
|
|
14
|
-
import '@mountaya/elements/errors';
|
|
15
|
-
import '../saveFile-j-1kkApx.js';
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* The two doubles a plugin's own suite needs, and neither one is a plugin.
|
|
19
|
-
*
|
|
20
|
-
* A consumer writing a plugin has two things worth testing that they cannot reach with the
|
|
21
|
-
* published API alone: whether their gate opens under the grants they expect, and whether their
|
|
22
|
-
* tools land on a bus and come back off it. The first needs a {@link StudioToolContext}, whose
|
|
23
|
-
* required members include two whole subsystems, and the second needs something that records
|
|
24
|
-
* what a registry did to it.
|
|
25
|
-
*
|
|
26
|
-
* Here rather than under `@mountaya/studio/plugins`, because an `index.ts` is legal only where
|
|
27
|
-
* `package.json#exports` names one: a `plugins/testing/` barrel would either be unreachable or
|
|
28
|
-
* would put doubles on a production consumer's import path. The fixtures entry is where doubles
|
|
29
|
-
* live, and it is already off every other barrel.
|
|
30
|
-
*/
|
|
31
|
-
|
|
1
|
+
import { s as StudioPluginToolSink } from "../chunk-cVXLsZfL.js";
|
|
2
|
+
import { a as StudioToolContext, c as StudioEntitlement, l as StudioViewer, m as StudioUrlSeam, oo as StudioToolOutputs, p as MirroredSearch, z as StudioCache } from "../chunk-BP4uy7E1.js";
|
|
3
|
+
import { t as ToolBus } from "../chunk-CQCJnT2i.js";
|
|
4
|
+
import { ResourceRef } from "@mountaya/client";
|
|
32
5
|
/**
|
|
33
6
|
* FakeStudioToolSink is a recording {@link StudioPluginToolSink}: it holds the tools a registry
|
|
34
7
|
* registered, remembers every name taken back off it, and can be made to refuse one.
|
|
@@ -42,15 +15,15 @@ import '../saveFile-j-1kkApx.js';
|
|
|
42
15
|
* one tool twice fails over this sink as it fails over a bus. A name taken back is free again.
|
|
43
16
|
*/
|
|
44
17
|
interface FakeStudioToolSink extends StudioPluginToolSink {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
18
|
+
/** Refuses the named tool at `register`, throwing. Pass null to refuse nothing. */
|
|
19
|
+
failOn: (name: string | null) => void;
|
|
20
|
+
/** Every name `register` accepted, in order, minus the ones taken back. */
|
|
21
|
+
readonly names: () => readonly string[];
|
|
22
|
+
/** Every name `unregister` was called with, in order, whether or not it was there. */
|
|
23
|
+
readonly unregistered: string[];
|
|
51
24
|
}
|
|
52
25
|
/** fakeStudioToolSink builds a recording sink holding no tools. */
|
|
53
|
-
declare const fakeStudioToolSink: () => FakeStudioToolSink;
|
|
26
|
+
export declare const fakeStudioToolSink: () => FakeStudioToolSink;
|
|
54
27
|
/**
|
|
55
28
|
* fakeStudioToolContext builds the minimal context a gate is evaluated against and a `run` is
|
|
56
29
|
* handed.
|
|
@@ -69,25 +42,7 @@ declare const fakeStudioToolSink: () => FakeStudioToolSink;
|
|
|
69
42
|
* the PERSON holds, and the second one answering "nothing" is what an unhydrated session looks
|
|
70
43
|
* like. Use `fakeViewer` next door when the entitlements have to move during the test.
|
|
71
44
|
*/
|
|
72
|
-
declare const fakeStudioToolContext: (overrides?: Partial<StudioToolContext>) => StudioToolContext;
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* The fixtures the studio handlers' own suites are built over.
|
|
76
|
-
*
|
|
77
|
-
* Every dispatch takes a {@link StudioToolContext}, and three of its seams have no honest
|
|
78
|
-
* default: a viewer is a session, a cache is a host's query layer, and a bus is the thing under
|
|
79
|
-
* test. This module supplies one double for each, so a suite arranges a context in a line
|
|
80
|
-
* rather than hand-rolling a partial literal that drifts from the seam it stands for.
|
|
81
|
-
*
|
|
82
|
-
* Published from `@mountaya/studio/testing`, which is what the entry is for: a consumer writing a
|
|
83
|
-
* test against a surface that takes a `StudioViewer` builds one in a line rather than out of the
|
|
84
|
-
* interface by hand.
|
|
85
|
-
*
|
|
86
|
-
* Nothing here names a test runner. A fixture inside a published tarball may not import
|
|
87
|
-
* `vitest`: the manifest cannot declare it, and the failure would be `publint` and `attw`
|
|
88
|
-
* reporting an unresolvable specifier rather than a red suite.
|
|
89
|
-
*/
|
|
90
|
-
|
|
45
|
+
export declare const fakeStudioToolContext: (overrides?: Partial<StudioToolContext>) => StudioToolContext;
|
|
91
46
|
/**
|
|
92
47
|
* The recording {@link StudioCache} every handler suite runs against.
|
|
93
48
|
*
|
|
@@ -105,29 +60,29 @@ declare const fakeStudioToolContext: (overrides?: Partial<StudioToolContext>) =>
|
|
|
105
60
|
* against a double that lacks it.
|
|
106
61
|
*/
|
|
107
62
|
interface FakeStudioCache extends StudioCache {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
63
|
+
/**
|
|
64
|
+
* Removes the entry seeded or written under the resource, and records the resource in
|
|
65
|
+
* {@link evicted}. Stated as required here, where the seam leaves it optional, so a suite calls
|
|
66
|
+
* it with no guard.
|
|
67
|
+
*/
|
|
68
|
+
evict: (key: ResourceRef) => void;
|
|
69
|
+
/** Every resource `evict` was named with, in order. */
|
|
70
|
+
readonly evicted: ResourceRef[];
|
|
71
|
+
/**
|
|
72
|
+
* Every resource `invalidate` was named with, flattened across calls, in order.
|
|
73
|
+
*
|
|
74
|
+
* A recorded LIST rather than a spy, because the assertion a suite wants to write is "this
|
|
75
|
+
* dispatch made exactly these resources stale": one `toEqual` naming them, where a spy makes
|
|
76
|
+
* it one `toHaveBeenCalledWith` per call plus a count nobody remembers to assert.
|
|
77
|
+
*/
|
|
78
|
+
readonly invalidated: ResourceRef[];
|
|
79
|
+
/** Every `(resource, value)` pair `set` was called with, in order. */
|
|
80
|
+
readonly written: {
|
|
81
|
+
key: ResourceRef;
|
|
82
|
+
value: unknown;
|
|
83
|
+
}[];
|
|
84
|
+
/** Put a value where `get` will find it. */
|
|
85
|
+
seed: (key: ResourceRef, value: unknown) => void;
|
|
131
86
|
}
|
|
132
87
|
/**
|
|
133
88
|
* fakeStudioCache builds an empty recording {@link FakeStudioCache}.
|
|
@@ -144,7 +99,7 @@ interface FakeStudioCache extends StudioCache {
|
|
|
144
99
|
* console.log(cache.invalidated);
|
|
145
100
|
* ```
|
|
146
101
|
*/
|
|
147
|
-
declare const fakeStudioCache: () => FakeStudioCache;
|
|
102
|
+
export declare const fakeStudioCache: () => FakeStudioCache;
|
|
148
103
|
/**
|
|
149
104
|
* FakeViewer is a {@link StudioViewer} a suite can move.
|
|
150
105
|
*
|
|
@@ -158,12 +113,12 @@ declare const fakeStudioCache: () => FakeStudioCache;
|
|
|
158
113
|
* surface reads, whatever a host derives it from.
|
|
159
114
|
*/
|
|
160
115
|
interface FakeViewer extends StudioViewer {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
116
|
+
/** Replaces the held set, so `setEntitlements()` with nothing revokes everything. */
|
|
117
|
+
setEntitlements: (...held: readonly StudioEntitlement[]) => void;
|
|
118
|
+
/** Sets what `getItineraryLimit` answers in every scope; null states no limit. */
|
|
119
|
+
setItineraryLimit: (limit: number | null) => void;
|
|
120
|
+
/** Sets what `getUserId` answers; null is a viewer who is not signed in. */
|
|
121
|
+
setUserId: (userId: string | null) => void;
|
|
167
122
|
}
|
|
168
123
|
/**
|
|
169
124
|
* fakeViewer builds the viewer an unhydrated session presents: no user, no entitlement, no
|
|
@@ -176,7 +131,7 @@ interface FakeViewer extends StudioViewer {
|
|
|
176
131
|
* Preferences MERGE rather than replace, matching the seam's contract: a partial write carries
|
|
177
132
|
* only the fields it names, and the first one turns `getPreferences` from null into a record.
|
|
178
133
|
*/
|
|
179
|
-
declare const fakeViewer: () => FakeViewer;
|
|
134
|
+
export declare const fakeViewer: () => FakeViewer;
|
|
180
135
|
/**
|
|
181
136
|
* FakeStudioBus is the bus a suite dispatches through, LOOSE in its tool set by default.
|
|
182
137
|
*
|
|
@@ -216,7 +171,7 @@ type FakeStudioBus<TInputs extends object = Record<string, unknown>, TOutputs ex
|
|
|
216
171
|
* is not checked, and a tool of your own registered on this bus is held to the `output` it
|
|
217
172
|
* states.
|
|
218
173
|
*/
|
|
219
|
-
declare const studioToolBus: () => FakeStudioBus;
|
|
174
|
+
export declare const studioToolBus: () => FakeStudioBus;
|
|
220
175
|
/**
|
|
221
176
|
* emptyStudioToolBus is the same bus with NOTHING registered, for a suite that wants the
|
|
222
177
|
* smallest tool surface its subject needs.
|
|
@@ -228,21 +183,7 @@ declare const studioToolBus: () => FakeStudioBus;
|
|
|
228
183
|
* It holds every answer to its tool's `output` schema, as {@link studioToolBus} does and for
|
|
229
184
|
* the reason given there.
|
|
230
185
|
*/
|
|
231
|
-
declare const emptyStudioToolBus: () => FakeStudioBus;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* The URL seam a suite runs against: the mirrored slice held in memory, as a host's router holds
|
|
235
|
-
* it in an address bar.
|
|
236
|
-
*
|
|
237
|
-
* A handler writes a patch and a surface reads the slice back, so a suite asserts both halves:
|
|
238
|
-
* what was written, and what the URL holds once it was. A seam written out by hand at each site
|
|
239
|
-
* states every member of {@link StudioUrlSeam} again, and a member added to the seam is then an
|
|
240
|
-
* edit of every one of them.
|
|
241
|
-
*
|
|
242
|
-
* It names no test runner, for the reason the fixtures next door give: a module inside a
|
|
243
|
-
* published tarball may not import one.
|
|
244
|
-
*/
|
|
245
|
-
|
|
186
|
+
export declare const emptyStudioToolBus: () => FakeStudioBus;
|
|
246
187
|
/**
|
|
247
188
|
* FakeStudioUrlSeam is a {@link StudioUrlSeam} that keeps the mirrored slice in memory and
|
|
248
189
|
* records every write.
|
|
@@ -255,20 +196,20 @@ declare const emptyStudioToolBus: () => FakeStudioBus;
|
|
|
255
196
|
* the fault of one that throws leaves no `write` and is surfaced on a microtask.
|
|
256
197
|
*/
|
|
257
198
|
interface FakeStudioUrlSeam extends StudioUrlSeam {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
199
|
+
/**
|
|
200
|
+
* The hash the last write carried, or `undefined` when it carried none and before any write.
|
|
201
|
+
*
|
|
202
|
+
* A write that carries no hash drops the one before it, as a router that does not observe the
|
|
203
|
+
* map's own `#view` writes does.
|
|
204
|
+
*/
|
|
205
|
+
readonly hash: () => string | undefined;
|
|
206
|
+
/**
|
|
207
|
+
* Every patch `write` was handed, in order and as handed, a key stated as `undefined` included.
|
|
208
|
+
*
|
|
209
|
+
* A recorded list and not a spy, so a suite states the writes of a dispatch in one `toEqual`
|
|
210
|
+
* and an empty list says that nothing was mirrored.
|
|
211
|
+
*/
|
|
212
|
+
readonly written: MirroredSearch[];
|
|
272
213
|
}
|
|
273
214
|
/**
|
|
274
215
|
* fakeStudioUrlSeam builds a recording URL seam over a slice held in memory.
|
|
@@ -300,7 +241,6 @@ interface FakeStudioUrlSeam extends StudioUrlSeam {
|
|
|
300
241
|
* url.read(); // { creating: true }
|
|
301
242
|
* ```
|
|
302
243
|
*/
|
|
303
|
-
declare const fakeStudioUrlSeam: (initial?: MirroredSearch) => FakeStudioUrlSeam;
|
|
304
|
-
|
|
305
|
-
export { emptyStudioToolBus, fakeStudioCache, fakeStudioToolContext, fakeStudioToolSink, fakeStudioUrlSeam, fakeViewer, studioToolBus };
|
|
244
|
+
export declare const fakeStudioUrlSeam: (initial?: MirroredSearch) => FakeStudioUrlSeam;
|
|
306
245
|
export type { FakeStudioBus, FakeStudioCache, FakeStudioToolSink, FakeStudioUrlSeam, FakeViewer };
|
|
246
|
+
//# sourceMappingURL=index.d.ts.map
|