waygraph 0.15.19 → 0.15.21
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/README.md +72 -1309
- package/dist/auto-session.d.ts +10 -1
- package/dist/auto-session.js +27 -7
- package/dist/cli.js +98 -31
- package/dist/engine.d.ts +20 -0
- package/dist/engine.js +18 -0
- package/dist/highlight-shorthand.d.ts +24 -0
- package/dist/highlight-shorthand.js +30 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/mem-stub.d.ts +41 -0
- package/dist/mem-stub.js +36 -0
- package/examples/saucedemo/.waygraph-auto/11c497cd.log +44 -0
- package/examples/saucedemo/.waygraph-auto/29d11a49.log +44 -0
- package/examples/saucedemo/.waygraph-auto/2c9a4003.log +44 -0
- package/examples/saucedemo/.waygraph-auto/32ef32a8.log +44 -0
- package/examples/saucedemo/.waygraph-auto/36ba01f7.log +44 -0
- package/examples/saucedemo/.waygraph-auto/537af83d.log +44 -0
- package/examples/saucedemo/.waygraph-auto/5adfacd5.log +44 -0
- package/examples/saucedemo/.waygraph-auto/76c7d418.log +44 -0
- package/examples/saucedemo/.waygraph-auto/78197960.log +44 -0
- package/examples/saucedemo/.waygraph-auto/7c2acbc2.log +44 -0
- package/examples/saucedemo/.waygraph-auto/844b63ff.log +44 -0
- package/examples/saucedemo/.waygraph-auto/88a4200b.log +0 -0
- package/examples/saucedemo/.waygraph-auto/b0eed995.log +44 -0
- package/examples/saucedemo/.waygraph-auto/bb69dc1a.log +44 -0
- package/examples/saucedemo/.waygraph-auto/bc4ae56f.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c17253b0.log +44 -0
- package/examples/saucedemo/.waygraph-auto/c31a9465.log +0 -0
- package/examples/saucedemo/.waygraph-auto/c5ac2393.log +44 -0
- package/examples/saucedemo/.waygraph-auto/c701e3c2.log +0 -0
- package/examples/saucedemo/.waygraph-auto/d207a000.log +44 -0
- package/examples/saucedemo/.waygraph-auto/fa3c5655.log +44 -0
- package/examples/saucedemo/package-lock.json +20 -532
- package/examples/saucedemo/package.json +0 -1
- package/examples/saucedemo/src/flows/mem-stub-demo.flow.ts +23 -0
- package/package.json +1 -1
- package/templates/scaffold/README.md +21 -19
- package/templates/scaffold/STRUCTURE.md +37 -70
- package/templates/scaffold/src/map/(app_base)/docs/_nav.block.ts +1 -1
- package/templates/scaffold/src/map/(external)/mailpit/_methods/assert-email-content.method.block.ts +1 -1
- package/templates/skills/waygraph-convention.skill.md +5 -1
- package/templates/skills/waygraph-pilot.skill.md +1 -1
- package/examples/saucedemo/.waygraph-auto/4adfbe91.json +0 -8
- package/examples/saucedemo/.waygraph-auto/9f0287e6.json +0 -8
- /package/examples/saucedemo/.waygraph-auto/{4adfbe91.log → 32e2c26f.log} +0 -0
- /package/examples/saucedemo/.waygraph-auto/{9f0287e6.log → 4c6b9e15.log} +0 -0
|
@@ -1,81 +1,48 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Scaffold layout (`waygraph init`)
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
This scaffold uses the **Waygraph Map**: folders under `src/map/` mirror your app's URLs.
|
|
4
|
+
One folder = one page = one Checkpoint. `(group)` folders are organizational only (like
|
|
5
|
+
Next.js route groups) and never appear in a URL or Checkpoint name.
|
|
5
6
|
|
|
6
7
|
```text
|
|
7
8
|
.
|
|
8
9
|
├── package.json
|
|
9
|
-
├── STRUCTURE.md # this file
|
|
10
|
-
├── README.md
|
|
11
10
|
├── src/
|
|
12
|
-
│ ├──
|
|
13
|
-
│ │ ├──
|
|
14
|
-
│ │
|
|
15
|
-
│ │
|
|
16
|
-
│ │
|
|
17
|
-
│ │
|
|
18
|
-
│ │
|
|
19
|
-
│ │
|
|
20
|
-
│ │
|
|
21
|
-
│ │
|
|
22
|
-
│ │
|
|
23
|
-
│ │
|
|
24
|
-
│ │
|
|
25
|
-
│
|
|
26
|
-
│ │
|
|
27
|
-
│
|
|
28
|
-
│
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
│ │ └── routes-demo.flow.ts # Home (manual mode) -> Docs (Map convention)
|
|
32
|
-
│ └── routes/ # Waygraph Map convention - see README.md
|
|
33
|
-
│ └── (external)/
|
|
34
|
-
│ └── docs/
|
|
35
|
-
│ ├── docs.sel.ts
|
|
36
|
-
│ ├── nav.block.ts # fixed name - every page-slug folder's Nav
|
|
37
|
-
│ └── page.block.ts # fixed name - every page-slug folder's arrival hub
|
|
38
|
-
├── scripts/
|
|
39
|
-
│ ├── fixture-server.mjs # serves home.html on :4177
|
|
40
|
-
│ └── with-fixture.mjs # start server + run waygraph auto/demo/run
|
|
41
|
-
└── tests/
|
|
42
|
-
└── example.spec.ts
|
|
11
|
+
│ ├── map/
|
|
12
|
+
│ │ ├── (app_base)/ # your app (served on :4177 here)
|
|
13
|
+
│ │ │ ├── home/ # URL /home.html
|
|
14
|
+
│ │ │ │ ├── _nav.block.ts # how to get here
|
|
15
|
+
│ │ │ │ ├── _page.block.ts # "you have arrived" hub
|
|
16
|
+
│ │ │ │ ├── _sel.ts # every selector for this page
|
|
17
|
+
│ │ │ │ ├── home.html # offline fixture page
|
|
18
|
+
│ │ │ │ └── _methods/ # one action per Block
|
|
19
|
+
│ │ │ │ ├── add-item.effect.block.ts # + instanceOptions (auto menu)
|
|
20
|
+
│ │ │ │ ├── remove-item.effect.block.ts
|
|
21
|
+
│ │ │ │ ├── clear-cart.method.block.ts
|
|
22
|
+
│ │ │ │ ├── assert-hello.method.block.ts # + stubs + YAP slide
|
|
23
|
+
│ │ │ │ └── assert-item-added.method.block.ts
|
|
24
|
+
│ │ │ └── docs/ # a second page, same shape
|
|
25
|
+
│ │ └── (external)/mailpit/ # a different origin (mail catcher)
|
|
26
|
+
│ ├── states/ # Checkpoint types + mem keys
|
|
27
|
+
│ └── flows/ # example / shop / mail-verify
|
|
28
|
+
├── scripts/ # local fixture server
|
|
29
|
+
└── tests/example.spec.ts
|
|
43
30
|
```
|
|
44
31
|
|
|
45
|
-
|
|
32
|
+
Underscore-prefixed files (`_nav`, `_page`, `_sel`, `_methods/`) are the fixed names every
|
|
33
|
+
page folder uses, so any agent or teammate knows where to look without asking.
|
|
46
34
|
|
|
47
|
-
|
|
48
|
-
|---------|--------|
|
|
49
|
-
| Nav (`defineNavBlock`) | `nav-home.block.ts` |
|
|
50
|
-
| Page hub (`definePageBlock` + `methods`) | `home.page.block.ts` |
|
|
51
|
-
| Method (`defineMethodBlock`) | `assert-hello`, `clear-cart` |
|
|
52
|
-
| Effect + `instanceOptions` (auto menus) | `add-item`, `remove-item` |
|
|
53
|
-
| Mem (`keyGroup`) | `demo.mem-keys.ts` |
|
|
54
|
-
| `stubBefore` / `stubAfter` / `stubOnError` | all instruction blocks |
|
|
55
|
-
| Flow fixtures + title | `example.flow.ts`, `shop.flow.ts` |
|
|
56
|
-
| YAP slides | `assert-hello` |
|
|
57
|
-
| `withSessionReset` | `shop.flow.ts` |
|
|
58
|
-
| `waygraph auto` / `auto --cli` | `npm run auto` |
|
|
59
|
-
| `demo` / `run` / `list` / `check` / `graph` | `package.json` scripts |
|
|
35
|
+
## What each piece is for
|
|
60
36
|
|
|
61
|
-
|
|
37
|
+
| Want to... | Look at |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Add a page | copy a folder under `src/map/`, keep the `_nav` / `_page` / `_sel` names |
|
|
40
|
+
| Add an action on a page | one file in that page's `_methods/` |
|
|
41
|
+
| Verify a state (button disabled, error shown) | `defineAssertBlock` + `Trait.disabled` / `Trait.enabled` |
|
|
42
|
+
| Wire steps together | `src/flows/*.flow.ts` |
|
|
43
|
+
| Give a flow fake data | `registerMemStub(key, fake)` + `withMemStub(flow)` (docs: docs/REFERENCE.md, "memStub") |
|
|
44
|
+
| Explore by hand | `npm run auto` (headed) or `npm run auto:cli` |
|
|
45
|
+
| Check your work | `npm run check`, `npm run graph`, `waygraph map` |
|
|
62
46
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
npm run auto:cli # same menus in the terminal
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
After `nav-home`, Effect blocks expose one menu row per visible Add/Remove button.
|
|
69
|
-
|
|
70
|
-
## Two authoring modes
|
|
71
|
-
|
|
72
|
-
`src/blocks/` (`demo-web/`, `demo-external/`) is **manual mode** - freeform, developer-chosen
|
|
73
|
-
file layout, the default this whole scaffold otherwise uses.
|
|
74
|
-
|
|
75
|
-
`src/routes/` is the **Waygraph Map** convention - `(group)/<page-slug>/page.block.ts` +
|
|
76
|
-
`nav.block.ts` + `methods/*.block.ts`, one Checkpoint per folder, `(group)` purely
|
|
77
|
-
organizational (parens, Next.js route-group style - never part of the Checkpoint tag). Same
|
|
78
|
-
Block helpers, same execution - only where files live and what they're named changes. A
|
|
79
|
-
project can adopt it folder by folder; `routes-demo.flow.ts` proves both modes compose in one
|
|
80
|
-
flow (`nav-home` from `blocks/`, `nav-docs` from `routes/`). See the main package's own
|
|
81
|
-
`README.md` "Waygraph Map" section and `openspec/changes/waygraph-map/`.
|
|
47
|
+
`waygraph map` fails if a folder path stops matching the real URL it claims to represent.
|
|
48
|
+
Full convention: https://deviate-dv8.github.io/waygraph/consumer.html
|
|
@@ -7,7 +7,7 @@ import { DocsSel, DOCS_URL } from "./_sel.js";
|
|
|
7
7
|
* Route: (app_base)/docs/
|
|
8
8
|
*
|
|
9
9
|
* Same origin as home/ (same fixture server, different HTML file) - lives
|
|
10
|
-
* under (app_base), not (external). See
|
|
10
|
+
* under (app_base), not (external). See docs/REFERENCE.md "Waygraph Map" and
|
|
11
11
|
* openspec/changes/waygraph-map. `(app_base)` is purely organizational
|
|
12
12
|
* (Next.js route-group style) - never part of the Checkpoint tag.
|
|
13
13
|
*/
|
package/templates/scaffold/src/map/(external)/mailpit/_methods/assert-email-content.method.block.ts
CHANGED
|
@@ -27,7 +27,7 @@ const bodyContainsExpectedText: Trait = {
|
|
|
27
27
|
* "Does the email actually say what it's supposed to" - not just "does a
|
|
28
28
|
* link exist somewhere in it." Reads the message body straight out of the
|
|
29
29
|
* preview iframe (the top-level page's own `Trait.text`/`Trait.visible`
|
|
30
|
-
* can't see inside an iframe at all - see
|
|
30
|
+
* can't see inside an iframe at all - see docs/REFERENCE.md "Mail adapters" section).
|
|
31
31
|
* Self-loop on MailpitMessageOpen - no state change, verify only.
|
|
32
32
|
*
|
|
33
33
|
* Deliberately named for what it does, not for one scenario: the expected
|
|
@@ -28,7 +28,11 @@ against a live site, use `--skill-pilot-blind`.
|
|
|
28
28
|
`Trait.enabled(selector)` cover that directly; write a custom Trait only for a state
|
|
29
29
|
condition neither one expresses.
|
|
30
30
|
5. **`requires` = externally supplied.** A key an earlier Block in the same chain produces
|
|
31
|
-
is never listed under `requires` - preflight checks the whole chain up front.
|
|
31
|
+
is never listed under `requires` - preflight checks the whole chain up front. For a
|
|
32
|
+
genuinely arbitrary key (a username, an email) that a demo/dev run shouldn't need
|
|
33
|
+
hand-supplied every time, `registerMemStub(key, fake)` + `withMemStub(flow)` (or
|
|
34
|
+
`--mem-stub`) fills it from a registry instead - a key with no registration still fails
|
|
35
|
+
preflight exactly as before, so this narrows what needs real input, never removes the guard.
|
|
32
36
|
6. **Keep Checkpoints typed — never `Checkpoint<string>`.** Block helpers take concrete
|
|
33
37
|
Checkpoint types from `src/states/` (e.g. `defineMethodBlock<LoginPage, LoginPage>`).
|
|
34
38
|
Wildcard `Checkpoint<string>` compiles but kills graph honesty; `waygraph check` / `waygraph typecheck` warn.
|
|
@@ -134,7 +134,7 @@ waygraph auto highlight <sessionId> '{"clear":true}'
|
|
|
134
134
|
Supported fields (demo parity):
|
|
135
135
|
- `rings[]`: `selector`, `label`, `detail`, `tag`, `tone`, `size`, `weight`, `color`, `zoom`, `zoomOut`, `focus`
|
|
136
136
|
- `todos` / `todoIndex` / `todoTitle` / `todoPos` (`right` default | `left`)
|
|
137
|
-
- `todoUi`: `{ compact?, cap?, expandCap?, collision?, behindRing? }` — same dock UX as demo (defaults smart-on; see
|
|
137
|
+
- `todoUi`: `{ compact?, cap?, expandCap?, collision?, behindRing? }` — same dock UX as demo (defaults smart-on; see docs/REFERENCE.md "Todo dock UI")
|
|
138
138
|
- `zoom` / `zoomSelector` / `zoomOut` - scroll + zoom badge (not CSS page scale)
|
|
139
139
|
- `device`: `mobile` | `tablet` | `desktop` (Playwright viewport)
|
|
140
140
|
- `holdMs`: ms to keep fixtures; `0` = until the next highlight / clear (default 30000)
|
|
File without changes
|
|
File without changes
|