@immense/vue-pom-generator 1.0.94 → 1.0.95
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 +1 -1
- package/RELEASE_NOTES.md +18 -71
- package/dist/index.cjs +4 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/index.mjs.map +1 -1
- package/dist/wrapper-contract.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -79,7 +79,7 @@ The generator does not use one naming trick. It layers several signals.
|
|
|
79
79
|
- **Fallback naming exists, but it is intentionally conservative.** That is why `generation.nameCollisionBehavior` exists.
|
|
80
80
|
- **Wrapper-action generation fails fast.** The generator blocks button-like wrapper `:handler` expressions that it cannot turn into a semantic action name.
|
|
81
81
|
|
|
82
|
-
Wrapper inference follows the public attribute contract instead of scanning for an arbitrary interactive descendant. It recognizes automatic single-root fallthrough, `v-bind="$attrs"`, aliases returned by `useAttrs()`, explicit forwarding such as `:data-testid="$attrs['data-testid']"`, and simple helpers that copy all attributes except named keys. The role comes from that target's explicit static ARIA role first, then its native HTML semantics. This means `<button role="tab">` is a tab, while `<div><button>...</button></div>` is not misclassified as a button wrapper because the caller's test id lands on the `<div>`. Nested wrappers are followed recursively. Polymorphic targets with different roles are deliberately left unresolved; configure `nativeWrappers` when one stable generated role is still appropriate.
|
|
82
|
+
Wrapper inference follows the public attribute contract instead of scanning for an arbitrary interactive descendant. It recognizes automatic single-root fallthrough, `v-bind="$attrs"`, aliases returned by `useAttrs()`, explicit forwarding such as `:data-testid="$attrs['data-testid']"`, and simple helpers that copy all attributes except named keys. The role comes from that target's explicit static ARIA role first, then its native HTML semantics. This means `<button role="tab">` is a tab, while an editable `<input role="combobox">` retains input behavior so generated actions fill it instead of calling native `selectOption()`. A `<div><button>...</button></div>` is not misclassified as a button wrapper because the caller's test id lands on the `<div>`. Nested wrappers are followed recursively. Polymorphic targets with different roles are deliberately left unresolved; configure `nativeWrappers` when one stable generated role is still appropriate.
|
|
83
83
|
|
|
84
84
|
## Playwright before/after examples
|
|
85
85
|
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,83 +1,30 @@
|
|
|
1
|
-
I'll analyze the provided information and verify which PRs fall within the release window using the
|
|
2
|
-
GitHub API.
|
|
3
|
-
|
|
4
|
-
The git log confirms only one commit (#57) in the range. Let me verify PR merge times using the
|
|
5
|
-
GitHub API.
|
|
6
|
-
|
|
7
|
-
Good — v1.0.93..HEAD contains only #57 (v1.0.93 points at #56). Let me get PR #57's details and diff
|
|
8
|
-
for accurate notes.
|
|
9
|
-
|
|
10
|
-
Now I have all the information needed. Only PR #57 is in this release (v1.0.93 points at #56's
|
|
11
|
-
commit). Let me verify the test files were updated.
|
|
12
|
-
|
|
13
1
|
Highlights
|
|
14
2
|
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
tag semantics, so <button role="tab"> is correctly classified as a tab while a <div> wrapping a
|
|
21
|
-
<button> is no longer misclassified as a button wrapper.
|
|
22
|
-
- Polymorphic targets fail fast. When multiple forwarding targets expose different roles, the
|
|
23
|
-
generator throws rather than guessing — you declare role explicitly when a single stable role is
|
|
24
|
-
appropriate.
|
|
25
|
-
- New tab role added to NativeRole, enabling tab-pattern wrapper components to generate correct
|
|
26
|
-
accessors and test-id suffixes.
|
|
27
|
-
- Inferred wrappers auto-derive valueAttribute from common semantic attributes (aria-label, name,
|
|
28
|
-
id, title, label) when none is configured.
|
|
3
|
+
- Editable combobox wrappers (<input role="combobox">) now generate fill actions instead of native
|
|
4
|
+
selectOption(), which only works on <select> elements.
|
|
5
|
+
- Wrapper role inference now considers the underlying element tag when mapping the combobox ARIA
|
|
6
|
+
role, distinguishing editable inputs from native select-like comboboxes.
|
|
7
|
+
- Documentation and test coverage updated to reflect the corrected behavior.
|
|
29
8
|
|
|
30
9
|
Changes
|
|
31
10
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
- getNativeWrapperTransformInfo in utils.ts now resolves valueAttribute from inferred semantic
|
|
43
|
-
attributes when an explicit value is absent.
|
|
44
|
-
|
|
45
|
-
Plugin Options
|
|
46
|
-
|
|
47
|
-
- wrapperSearchRoots now automatically includes configured page, component, and layout directories
|
|
48
|
-
— no manual duplication needed.
|
|
49
|
-
- README updated to document the new fallthrough-based inference model, the tab role, and the
|
|
50
|
-
revised nativeWrappers semantics.
|
|
51
|
-
|
|
52
|
-
Tests
|
|
53
|
-
|
|
54
|
-
- New tests/wrapper-contract.test.ts (222 lines) covering fallthrough detection, useAttrs()
|
|
55
|
-
aliases, explicit forwarding, ARIA-role precedence, polymorphic-target errors, and recursive
|
|
56
|
-
nesting.
|
|
57
|
-
- Existing tests (build-serve-parity, dev-plugin-options, resolved-injection-options, transform,
|
|
58
|
-
vue-plugin-state) updated for the renamed option.
|
|
59
|
-
|
|
60
|
-
Breaking Changes
|
|
61
|
-
|
|
62
|
-
- injection.excludeComponents → injection.skipTestIdGenerationInsideComponents: The option is
|
|
63
|
-
renamed and semantically narrowed. Normal wrapper components no longer need it — fallthrough targets
|
|
64
|
-
are suppressed at the element level while internal controls remain generated. Use it only as a
|
|
65
|
-
last-resort escape hatch for untransformable SFC templates.
|
|
66
|
-
- nativeWrappers without role now errors when no single role can be proven from the source.
|
|
67
|
-
Previously it silently defaulted to button; now it throws so misclassified wrappers surface
|
|
68
|
-
immediately.
|
|
69
|
-
- wrapperSearchRoots auto-includes source directories. If you previously listed your
|
|
70
|
-
component/page/layout dirs in wrapperSearchRoots, they are now searched automatically and can be
|
|
71
|
-
removed from the list.
|
|
11
|
+
- wrapper-contract.ts: mapExplicitAriaRole now accepts the element tag and returns "input" for
|
|
12
|
+
<input>/<uinput> elements with role="combobox", falling back to "select" otherwise.
|
|
13
|
+
getElementControlRole passes the tag through to this function.
|
|
14
|
+
- README.md: Expanded the wrapper-inference section to explain that an editable <input
|
|
15
|
+
role="combobox"> retains input behavior so generated actions fill it rather than calling
|
|
16
|
+
selectOption().
|
|
17
|
+
- tests/wrapper-contract.test.ts: Added a test verifying that an editable combobox target resolves
|
|
18
|
+
to input interaction behavior.
|
|
19
|
+
- tests/transform.test.ts: Added an end-to-end test confirming a typeSearch method is generated
|
|
20
|
+
(and selectSearch is not) for an editable combobox wrapper.
|
|
72
21
|
|
|
73
22
|
Pull Requests Included
|
|
74
23
|
|
|
75
|
-
- ]8;id=md-
|
|
24
|
+
- #58 fix(wrappers): fill editable comboboxes (]8;id=md-1eex0z3;https://github.com/immense/vue-pom-generator/pull/58#58]8;;]8;;)]8;;
|
|
76
25
|
|
|
77
26
|
Testing
|
|
78
27
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
- Existing test suites updated and passing with the renamed skipTestIdGenerationInsideComponents
|
|
82
|
-
option and revised wrapper-resolution behavior.
|
|
28
|
+
Added targeted tests for wrapper-contract inference and end-to-end transform output. Full suite (417
|
|
29
|
+
tests), typecheck, lint, build, and smoke-pack all passing per the PR.
|
|
83
30
|
|
package/dist/index.cjs
CHANGED
|
@@ -8000,7 +8000,7 @@ function getStaticAttributeContent$1(element, name) {
|
|
|
8000
8000
|
});
|
|
8001
8001
|
return attribute?.value?.content?.trim() || null;
|
|
8002
8002
|
}
|
|
8003
|
-
function mapExplicitAriaRole(role) {
|
|
8003
|
+
function mapExplicitAriaRole(role, elementTag) {
|
|
8004
8004
|
switch (role.toLowerCase()) {
|
|
8005
8005
|
case "button":
|
|
8006
8006
|
case "checkbox":
|
|
@@ -8012,6 +8012,7 @@ function mapExplicitAriaRole(role) {
|
|
|
8012
8012
|
case "radiogroup":
|
|
8013
8013
|
return "radio";
|
|
8014
8014
|
case "combobox":
|
|
8015
|
+
return elementTag === "input" || elementTag === "uinput" ? "input" : "select";
|
|
8015
8016
|
case "listbox":
|
|
8016
8017
|
return "select";
|
|
8017
8018
|
case "searchbox":
|
|
@@ -8033,11 +8034,11 @@ function hasAttribute(element, name) {
|
|
|
8033
8034
|
});
|
|
8034
8035
|
}
|
|
8035
8036
|
function getElementControlRole(element) {
|
|
8037
|
+
const tag = element.tag.toLowerCase();
|
|
8036
8038
|
const explicitRole = getStaticAttributeContent$1(element, "role");
|
|
8037
8039
|
if (explicitRole) {
|
|
8038
|
-
return mapExplicitAriaRole(explicitRole);
|
|
8040
|
+
return mapExplicitAriaRole(explicitRole, tag);
|
|
8039
8041
|
}
|
|
8040
|
-
const tag = element.tag.toLowerCase();
|
|
8041
8042
|
const type = (getStaticAttributeContent$1(element, "type") || "").toLowerCase();
|
|
8042
8043
|
if (tag === "input" || tag === "uinput") {
|
|
8043
8044
|
if (type === "radio") {
|