@immense/vue-pom-generator 1.0.109 → 1.0.111

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 CHANGED
@@ -77,7 +77,7 @@ The generator does not use one naming trick. It layers several signals.
77
77
  - **Router links / `:to` bindings** can contribute route-based naming and typed navigation return types when the target can be resolved.
78
78
  - **Wrapper components** are inferred from the rendered element that actually receives Vue fallthrough attributes; `nativeWrappers` supplies exceptional overrides.
79
79
  - **Fallback naming exists, but it is intentionally conservative.** That is why `generation.nameCollisionBehavior` exists.
80
- - **Wrapper-action generation fails fast.** The generator blocks button-like wrapper `:handler` expressions that it cannot turn into a semantic action name.
80
+ - **Wrapper-action generation fails fast.** The generator blocks button-like wrapper `:loadAction` (legacy `:handler`, or a wrapper-declared `actionProp`) expressions that it cannot turn into a semantic action name, and fails when a wrapper that declares `actionProp` is used without that binding (or `@click`).
81
81
 
82
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
 
@@ -1309,6 +1309,15 @@ The sections below follow the actual `VuePomGeneratorPluginOptions` shape from `
1309
1309
  - **Benefit:** You get meaningful ids and method names from wrapper props instead of fallback names.
1310
1310
  - **Without it:** wrapper naming falls back to model bindings or other weaker signals.
1311
1311
 
1312
+ ##### `nativeWrappers[...].actionProp`
1313
+
1314
+ - **What it does:** Names the wrapper prop that triggers the component's click action (for example `"loadAction"`), so semantic POM action methods (`clickSave()`, `clickResolveFailuresForAgent()`, ...) are derived from that binding.
1315
+ - **Why it exists:** Without it, the generator matches a built-in set of LoadButton-style prop names (`loadAction`, kebab-case `load-action`, legacy `handler`). A consumer that renames its action prop would otherwise silently lose semantic action names until the generator learns the new name.
1316
+ - **Benefit:** Prop renames become a one-line config change in the same PR as the rename; the contract lives with the consumer that owns the component.
1317
+ - **Matching:** The declared name matches any attribute spelling that normalizes to it — Vue accepts both `:loadAction` and `:load-action` for the same prop.
1318
+ - **Without it:** the built-in `loadAction` and legacy `handler` names are matched, in either spelling.
1319
+ - **Fail-fast:** a usage of a wrapper that declares `actionProp` must bind that prop (either spelling) or `@click`; anything else fails generation instead of emitting a POM member with no actionable behavior.
1320
+
1312
1321
  ##### `nativeWrappers[...].requiresOptionDataTestIdPrefix`
1313
1322
 
1314
1323
  - **What it does:** Adds an `option-data-testid-prefix` attribute for wrappers that need stable option-level ids.
package/RELEASE_NOTES.md CHANGED
@@ -1,47 +1,37 @@
1
- Git access is blocked, so I'll verify the change content by reading the affected files directly.
2
-
3
- v1.0.109
4
-
5
1
  Highlights
6
2
 
7
- - Annotator keyboard shortcuts removed — all annotator control is now toolbar-driven. The
8
- capture-phase keydown handler previously swallowed single-letter keys before text surfaces like the
9
- Monaco terminal editor could handle them.
10
- - Crosshair cursor while inspecting elements, making selection mode visually obvious.
11
- - Live annotation count displayed in the annotator toolbar.
12
- - Readable preview popout — sized wide with a tall monospace textarea so the full feedback text can
13
- be read in one view.
14
- - New regression tests lock in the keyboard policy and preview behavior.
3
+ - Wrapper POM action names now derive from :loadAction as well as the legacy :handler binding, so
4
+ load-style wrappers get semantic method names (#75)
5
+ - Action-prop matching is now consumer-declared: nativeWrappers[...].actionProp replaces the
6
+ built-in name set, so renaming a wrapper's prop no longer requires generator changes (#75)
7
+ - Matching uses Vue's own camelize on normalized prop names, so any spelling the Vue runtime maps
8
+ to the prop (:loadAction, :load-action, legacy :handler) works (#75)
15
9
 
16
10
  Changes
17
11
 
18
- Annotator
19
-
20
- - Removed all window-level keyboard shortcuts (s, p, c, x, ,, Escape); the annotator no longer
21
- binds any keydown listener at mount and is fully inert to keyboard input.
22
- - Switched the inspect shield to a crosshair cursor.
23
- - Added a count badge (N annotation(s)) to the toolbar.
24
- - Enlarged the preview panel (720–940px wide) with a taller, vertically resizable monospace
25
- textarea so copied/previewed feedback is readable together.
26
-
27
- Tests
28
-
29
- - Added annotator-keyboard.test.ts: verifies no keydown listeners are bound and every former
30
- shortcut key is ignored.
31
- - Added annotator-preview.test.ts: verifies the preview panel opens and contains all seeded
32
- feedback items.
33
-
34
- Chores
35
-
36
- - Added .nodeterm/project.json (local tooling state).
12
+ - POM naming
13
+ - Declared actionProp on a native wrapper replaces the built-in action-prop names for that wrapper
14
+ (#75)
15
+ - Fail fast when a wrapper declaring actionProp is used without that binding or a static @click;
16
+ @change/@mousedown and dynamic event/argument bindings don't count as proof (#75)
17
+ - Echo the matched directive argument in the unnameable-handler error so legacy :handler consumers
18
+ get valid advice (#75)
19
+ - Keep the handler:expr: merge-key prefix — generated POM identity is unchanged (#75)
20
+ - Dependencies
21
+ - @vue/shared moves to peerDependencies (>=3.5), matching how the compiler packages are declared
22
+ (#75)
23
+ - Docs
24
+ - README and sequence-diagram updated for the action-prop contract (#75)
37
25
 
38
26
  Pull Requests Included
39
27
 
40
- - #74 fix(annotator): remove keyboard shortcuts; crosshair cursor, count badge, readable preview —
41
- ]8;id=md-co8rmx;https://github.com/immense/vue-pom-generator/pull/74https://github.com/immense/vue-pom-generator/pull/74]8;;]8;; (@dkattan)]8;;
28
+ - ]8;id=md-ce95xy;https://github.com/immense/vue-pom-generator/pull/75#75]8;;]8;; — fix(pom): derive semantic action names from :loadAction as well as :handler ]8;;
29
+ (@steve-price-immybot)
42
30
 
43
31
  Testing
44
32
 
45
- Two new vitest suites cover this change (jsdom): keyboard-inertness of the mounted annotator client
46
- and preview-panel content/affordances.
33
+ - Extended transform coverage for action-prop matching and naming (+208 lines in
34
+ transform.test.ts), plus updates to utils-coverage, existing-id-behavior,
35
+ semantic-component-instances, and vue-test-utils-pom suites; vendor-specific naming dropped from
36
+ fixtures.
47
37
 
@@ -0,0 +1,85 @@
1
+ export declare const isNodeType: (node: object | null, type: string) => node is {
2
+ type: string;
3
+ };
4
+ export declare const isIdentifierNode: (node: object | null) => node is {
5
+ type: "Identifier";
6
+ name: string;
7
+ };
8
+ export declare const isStringLiteralNode: (node: object | null) => node is {
9
+ type: "StringLiteral";
10
+ value: string;
11
+ };
12
+ export declare const isBooleanLiteralNode: (node: object | null) => node is {
13
+ type: "BooleanLiteral";
14
+ value: boolean;
15
+ };
16
+ export declare const isNumericLiteralNode: (node: object | null) => node is {
17
+ type: "NumericLiteral";
18
+ value: number;
19
+ };
20
+ export declare const isNullLiteralNode: (node: object | null) => node is {
21
+ type: "NullLiteral";
22
+ };
23
+ export declare const isMemberExpressionNode: (node: object | null) => node is {
24
+ type: "MemberExpression";
25
+ computed: boolean;
26
+ object: object;
27
+ property: object;
28
+ };
29
+ export declare const isCallExpressionNode: (node: object | null) => node is {
30
+ type: "CallExpression";
31
+ callee: object;
32
+ arguments: object[];
33
+ };
34
+ export declare const isAwaitExpressionNode: (node: object | null) => node is {
35
+ type: "AwaitExpression";
36
+ argument: object;
37
+ };
38
+ export declare const isAssignmentExpressionNode: (node: object | null) => node is {
39
+ type: "AssignmentExpression";
40
+ left: object;
41
+ right: object;
42
+ };
43
+ export declare const isArrowFunctionExpressionNode: (node: object | null) => node is {
44
+ type: "ArrowFunctionExpression";
45
+ body: object;
46
+ };
47
+ export declare const isBlockStatementNode: (node: object | null) => node is {
48
+ type: "BlockStatement";
49
+ body: object[];
50
+ };
51
+ export declare const isExpressionStatementNode: (node: object | null) => node is {
52
+ type: "ExpressionStatement";
53
+ expression: object;
54
+ };
55
+ export declare const isReturnStatementNode: (node: object | null) => node is {
56
+ type: "ReturnStatement";
57
+ argument: object | null;
58
+ };
59
+ export declare const isObjectExpressionNode: (node: object | null) => node is {
60
+ type: "ObjectExpression";
61
+ properties: object[];
62
+ };
63
+ export declare const isObjectPropertyNode: (node: object | null) => node is {
64
+ type: "ObjectProperty";
65
+ computed: boolean;
66
+ key: object;
67
+ value: object;
68
+ };
69
+ /**
70
+ * Same shape test without the `computed` field check — matches the guard
71
+ * previously inlined in utils.ts's to-directive metadata reader and in
72
+ * routing/to-directive.ts.
73
+ */
74
+ export declare const isObjectPropertyNodeShallow: (node: object | null) => node is {
75
+ type: "ObjectProperty";
76
+ key: object;
77
+ value: object;
78
+ };
79
+ export declare const isLogicalExpressionNode: (node: object | null) => node is {
80
+ type: "LogicalExpression";
81
+ operator: string;
82
+ left: object;
83
+ right: object;
84
+ };
85
+ //# sourceMappingURL=babel-guards.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"babel-guards.d.ts","sourceRoot":"","sources":["../../compiler/babel-guards.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,MAAM,KAAG,IAAI,IAAI;IAAE,IAAI,EAAE,MAAM,CAAA;CAEpF,CAAC;AACF,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,GAAG,IAAI,KAAG,IAAI,IAAI;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAEhG,CAAC;AACF,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,GAAG,IAAI,KAAG,IAAI,IAAI;IAAE,IAAI,EAAE,eAAe,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAEvG,CAAC;AACF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,GAAG,IAAI,KAAG,IAAI,IAAI;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAE1G,CAAC;AACF,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,GAAG,IAAI,KAAG,IAAI,IAAI;IAAE,IAAI,EAAE,gBA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