@specpin/cli 0.0.2 → 0.0.4
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
package/skill/SKILL.md
CHANGED
|
@@ -133,7 +133,8 @@ Compare `npm view @specpin/cli version` against your installed
|
|
|
133
133
|
- `references/schema-authoring.md`: the full v1 shape (Manifest, SpecFile, Spec,
|
|
134
134
|
LocalizedString, fingerprint, meta), a complete minimal valid example, and the
|
|
135
135
|
Markdown subset.
|
|
136
|
-
- `references/fingerprint-strategy.md`: the test-id-first decision tree
|
|
137
|
-
|
|
136
|
+
- `references/fingerprint-strategy.md`: the test-id-first decision tree, how to
|
|
137
|
+
derive each fingerprint field from source, and page scoping (`pageUrl`) for
|
|
138
|
+
multi-screen apps.
|
|
138
139
|
- `references/cli-commands.md`: every command, its flags, and exit-code
|
|
139
140
|
semantics.
|
|
@@ -61,6 +61,24 @@ attribute as an optional, opt-in upgrade.
|
|
|
61
61
|
- `nearbyLabels` (optional): visible labels near the element, e.g.
|
|
62
62
|
`["Email", "Password"]`.
|
|
63
63
|
- `frameworkHint` (optional): `"react" | "vue" | "angular" | "vanilla"`.
|
|
64
|
+
- `pageUrl` (optional, nullable): path glob scoping the spec to its route (see
|
|
65
|
+
"Page scope" below).
|
|
66
|
+
|
|
67
|
+
## Page scope (multi-screen apps)
|
|
68
|
+
|
|
69
|
+
The extension matches a spec against the live DOM by selector, so a spec pinned
|
|
70
|
+
on one screen also renders on another screen whose layout produces the same
|
|
71
|
+
`cssSelector`/`xpath` (common in SPAs: list screens sharing a search/filter bar).
|
|
72
|
+
`fingerprint.pageUrl` prevents this: a spec renders only on paths its glob covers.
|
|
73
|
+
|
|
74
|
+
- Derive the route from the source, not a live URL (you are not in the browser):
|
|
75
|
+
read the router config (React Router / Vue Router paths), the file-based route
|
|
76
|
+
(e.g. `pages/orders/[id].tsx` -> `/orders/**`), or the link/nav target.
|
|
77
|
+
- `*` matches one path segment, `**` matches across segments; query and hash are
|
|
78
|
+
ignored. For a parameterized route use a glob: `/orders/**`, not `/orders/123`.
|
|
79
|
+
- Set it whenever the element is screen-specific. Leave it `null` (or omit) for
|
|
80
|
+
elements present on every screen (global nav, header, footer) so they match
|
|
81
|
+
everywhere. Absent/null is backward compatible.
|
|
64
82
|
|
|
65
83
|
## Brittleness caveat
|
|
66
84
|
|
|
@@ -65,12 +65,16 @@ A locale-keyed object, NOT a flat string:
|
|
|
65
65
|
|
|
66
66
|
Required: `cssSelector`, `xpath`, `domPath`, `tagName`, `attributes`, `positionHint`.
|
|
67
67
|
Optional (all nullable where noted): `testId`, `ariaLabel`, `id`, `textContent`,
|
|
68
|
-
`nearbyLabels`, `frameworkHint`.
|
|
68
|
+
`nearbyLabels`, `frameworkHint`, `pageUrl`.
|
|
69
69
|
|
|
70
70
|
- `domPath`: tag chain array, e.g. `["form", "button"]`.
|
|
71
71
|
- `attributes`: object of whitelisted attrs (role, type, name, placeholder, href), string values.
|
|
72
72
|
- `positionHint`: `{ "index": int >= 0, "siblingCount": int >= 0 }` (both required).
|
|
73
73
|
- `frameworkHint`: `"react" | "vue" | "angular" | "vanilla"`.
|
|
74
|
+
- `pageUrl`: path glob scoping the spec to a page/route (`*` = one path segment,
|
|
75
|
+
`**` = across segments; query and hash ignored). Absent/null matches on any
|
|
76
|
+
page. Set it on multi-screen apps so a spec does not render on another screen
|
|
77
|
+
whose layout yields a colliding selector. See `fingerprint-strategy.md`.
|
|
74
78
|
|
|
75
79
|
See `fingerprint-strategy.md` for how to fill these from source.
|
|
76
80
|
|
|
@@ -130,7 +134,8 @@ Git-diffable.
|
|
|
130
134
|
"attributes": { "type": "button" },
|
|
131
135
|
"nearbyLabels": ["Settings"],
|
|
132
136
|
"positionHint": { "index": 5, "siblingCount": 6 },
|
|
133
|
-
"frameworkHint": "react"
|
|
137
|
+
"frameworkHint": "react",
|
|
138
|
+
"pageUrl": null
|
|
134
139
|
},
|
|
135
140
|
"meta": {
|
|
136
141
|
"createdBy": "agent",
|