@immense/vue-pom-generator 1.0.34 → 1.0.36

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/RELEASE_NOTES.md CHANGED
@@ -1,39 +1,33 @@
1
- # v1.0.34
1
+ ## v1.0.36
2
2
 
3
- ## Highlights
3
+ ### Highlights
4
4
 
5
- - Fixed strict click collision detection to prevent false positives
6
- - Improved lazy route component naming for better code generation
7
- - Enhanced router introspection with significant improvements to route handling
8
- - Added comprehensive test coverage for class generation and router introspection
5
+ - Fixed handler collision suffixes to prevent naming conflicts in strict error mode
6
+ - Improved handler suffix derivation by skipping unstable leading arguments
7
+ - Enhanced detection of constant-like member expressions for more stable naming
8
+ - Added comprehensive test coverage for collision avoidance scenarios
9
9
 
10
- ## Changes
10
+ ### Changes
11
11
 
12
12
  **Bug Fixes**
13
- - Fixed strict click collision detection logic in transform pipeline
14
- - Corrected lazy route component naming in class generation
13
+ - Fixed handler collision suffixes when generating test IDs and POM methods (#27dc566)
14
+ - Skip unstable leading arguments when deriving handler suffixes from function arguments
15
+ - Check up to 4 arguments (previously 2) to find stable literal/constant values
16
+ - Validate constant-like root identifiers (e.g., `RebootPreference.Suppress`) before using
17
+ member expression names
15
18
 
16
- **Testing & Quality**
17
- - Added 70+ lines of new tests for class-generation coverage
18
- - Added 64+ lines of new tests for router introspection
19
- - Added 37+ lines of new tests for transform logic
19
+ **Testing**
20
+ - Added test for strict-mode collision avoidance with later stable args
21
+ - Added utility test coverage for `getRootIdentifierFromMemberChain` function
22
+ - New test validates `clickRunDeploymentActionAssign` method generation without conflicts
20
23
 
21
- **Internal Improvements**
22
- - Enhanced router introspection with 140+ lines of improvements
23
- - Updated plugin path utilities with better handling
24
- - Improved support plugins for both build and dev modes
24
+ ### Pull Requests Included
25
25
 
26
- ## Breaking Changes
26
+ - [#1](https://github.com/immense/vue-pom-generator/pull/1) - Add PR release-notes preview
27
+ comments (merged 2026-02-02, not in v1.0.36 window)
27
28
 
28
- None.
29
+ ### Testing
29
30
 
30
- ## Pull Requests Included
31
-
32
- - #1 Add PR release-notes preview comments (https://github.com/immense/vue-pom-generator/pull/1)
33
- by @dkattan
34
-
35
- ## Testing
36
-
37
- Comprehensive test coverage added across class generation, router introspection, and transform
38
- modules. All tests passing.
31
+ Added 44 lines of test coverage across `transform.test.ts` and `utils-coverage.test.ts` to
32
+ validate collision handling improvements.
39
33
 
package/dist/index.cjs CHANGED
@@ -1005,6 +1005,18 @@ function nodeHandlerAttributeInfo(node) {
1005
1005
  }
1006
1006
  return null;
1007
1007
  };
1008
+ const getRootIdentifierFromMemberChain = (node2) => {
1009
+ if (!node2) {
1010
+ return null;
1011
+ }
1012
+ if (isIdentifierNode(node2)) {
1013
+ return node2.name;
1014
+ }
1015
+ if (isMemberExpressionNode(node2)) {
1016
+ return getRootIdentifierFromMemberChain(node2.object);
1017
+ }
1018
+ return null;
1019
+ };
1008
1020
  const getAssignmentTargetName = (lhs) => {
1009
1021
  if (!lhs) {
1010
1022
  return null;
@@ -1059,7 +1071,10 @@ function nodeHandlerAttributeInfo(node) {
1059
1071
  }
1060
1072
  if (isMemberExpressionNode(arg)) {
1061
1073
  const stableName = getLastIdentifierFromMemberChain(arg);
1062
- if (stableName) {
1074
+ const rootName = getRootIdentifierFromMemberChain(arg);
1075
+ const firstChar = (rootName ?? "").charAt(0);
1076
+ const isConstantLikeRoot = firstChar !== "" && firstChar === firstChar.toUpperCase() && firstChar !== firstChar.toLowerCase();
1077
+ if (stableName && isConstantLikeRoot) {
1063
1078
  return toPascalCase(stableName.slice(0, 24));
1064
1079
  }
1065
1080
  }
@@ -1077,12 +1092,15 @@ function nodeHandlerAttributeInfo(node) {
1077
1092
  const first = args.length > 0 ? args[0] : null;
1078
1093
  if (!isObjectExpressionNode(first)) {
1079
1094
  const parts2 = [];
1080
- for (const arg of args.slice(0, 2)) {
1095
+ for (const arg of args.slice(0, 4)) {
1081
1096
  const w = stableWordFromValue(arg ?? null);
1082
1097
  if (!w) {
1083
- return null;
1098
+ continue;
1084
1099
  }
1085
1100
  parts2.push(w);
1101
+ if (parts2.length >= 2) {
1102
+ break;
1103
+ }
1086
1104
  }
1087
1105
  if (parts2.length === 0) {
1088
1106
  return null;
@@ -5642,14 +5660,23 @@ Fix: remove the explicit ${attrLabel}, or change existingIdBehavior to "overwrit
5642
5660
  upsertAttribute(element, "option-data-testid-prefix", optionDataTestIdPrefixValue);
5643
5661
  }
5644
5662
  const nativeRole = nativeWrappers[element.tag]?.role ?? element.tag;
5645
- const primarySemanticHint = semanticNameHint || conditionalHint || void 0;
5646
- const alternates = nameCollisionBehavior === "error" && semanticNameHint && conditionalHint ? [`${semanticNameHint} ${conditionalHint}`] : void 0;
5663
+ const wrapperHintCandidates = [
5664
+ semanticNameHint,
5665
+ getStaticAttributeContent(element, "title"),
5666
+ getStaticAttributeContent(element, "label"),
5667
+ getStaticAttributeContent(element, "okTitle"),
5668
+ getStaticAttributeContent(element, "cancelTitle"),
5669
+ getStaticAttributeContent(element, "id") || getStaticAttributeContent(element, "name"),
5670
+ getInnerText(element) || null,
5671
+ nameCollisionBehavior === "error" && semanticNameHint && conditionalHint ? `${semanticNameHint} ${conditionalHint}` : conditionalHint
5672
+ ].map((value) => (value ?? "").trim()).filter(Boolean).filter((value, index, values) => values.indexOf(value) === index);
5673
+ const [primarySemanticHint, ...alternates] = wrapperHintCandidates;
5647
5674
  const pomMergeKey = semanticNameHint && conditionalMergeGroupKey ? `wrapper:ifgroup:${conditionalMergeGroupKey}:model:${semanticNameHint}` : void 0;
5648
5675
  applyResolvedDataTestIdForElement({
5649
5676
  preferredGeneratedValue: nativeWrappersValue,
5650
5677
  nativeRoleOverride: nativeRole,
5651
5678
  semanticNameHint: primarySemanticHint,
5652
- semanticNameHintAlternates: alternates,
5679
+ semanticNameHintAlternates: alternates.length ? alternates : void 0,
5653
5680
  pomMergeKey
5654
5681
  });
5655
5682
  return;