@immense/vue-pom-generator 1.0.65 → 1.0.66

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,31 +1,27 @@
1
- ● ## v1.0.65
1
+ ● ## Highlights
2
2
 
3
- ### Highlights
3
+ - Fixed component child POM attachment bug
4
+ - Added comprehensive test coverage for class generation
4
5
 
5
- - Fixed parsing of guarded handler expressions (e.g., `@click="condition && handler"`)
6
- - Improved semantic name resolution for wrapped and conditional event handlers
7
- - Enhanced Vue compiler AST traversal to handle logical expressions (`&&` operators)
6
+ ## Changes
8
7
 
9
- ### Changes
10
-
11
- **Parser Improvements**
12
- - Added support for `LogicalExpression` nodes in handler attribute parsing
13
- - Introduced `unwrapSemanticHelperCall` to handle Vue compiler helpers (`_unref`,
14
- `_withModifiers`, etc.)
15
- - Refactored `resolveSemanticName` to recursively unwrap nested expressions and guarded calls
16
- - Handler names now correctly extracted from conditional expressions like `isValid &&
17
- submitForm`
8
+ **Bug Fixes**
9
+ - Corrected logic for attaching child page object models to component classes
10
+ - Improved reliability of generated POM hierarchies
18
11
 
19
12
  **Testing**
20
- - Added test coverage for guarded handler scenarios
21
- - Updated transform and utils test suites to validate new parsing logic
13
+ - Added 53 lines of test coverage for class generation scenarios
14
+
15
+ ## Breaking Changes
16
+
17
+ None
22
18
 
23
- ### Pull Requests Included
19
+ ## Pull Requests Included
24
20
 
25
- No pull request was created for this fix; it was committed directly to `main`.
21
+ Unable to determine specific PR for commit `e1f328c` from available metadata.
26
22
 
27
- ### Testing
23
+ ## Testing
28
24
 
29
- Validated with expanded unit test coverage in `tests/transform.test.ts` and
30
- `tests/utils-coverage.test.ts`.
25
+ Added new test cases in `tests/class-generation-coverage.test.ts` covering component child POM
26
+ attachment scenarios.
31
27
 
@@ -1710,9 +1710,9 @@ function prepareViewObjectModelClass(
1710
1710
  members.push(...getComponentInstances(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass, widgetInstances));
1711
1711
  members.push(getConstructor(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass, widgetInstances, { testIdAttribute }));
1712
1712
  }
1713
- if (!isView && attachmentsForThisClass.length > 0) {
1714
- members.push(...getComponentInstances(new Set(), componentHierarchyMap, attachmentsForThisClass));
1715
- members.push(getConstructor(new Set(), componentHierarchyMap, attachmentsForThisClass, [], { testIdAttribute }));
1713
+ if (!isView && (componentRefsForInstances.size > 0 || attachmentsForThisClass.length > 0)) {
1714
+ members.push(...getComponentInstances(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass));
1715
+ members.push(getConstructor(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass, [], { testIdAttribute }));
1716
1716
  }
1717
1717
 
1718
1718
  members.push(
@@ -1771,7 +1771,10 @@ function generateViewObjectModelContent(
1771
1771
  const basePageImport = path.relative(fromAbs, toAbs).replace(/\\/g, "/");
1772
1772
  const basePageImportNoExt = stripExtension(basePageImport).replace(/\\/g, "/");
1773
1773
  const basePageImportSpecifier = basePageImportNoExt.startsWith(".") ? basePageImportNoExt : `./${basePageImportNoExt}`;
1774
- const needsPlaywrightPageImport = prepared.isView || prepared.attachmentsForThisClass.length > 0;
1774
+ const needsPlaywrightPageImport = prepared.isView
1775
+ || prepared.attachmentsForThisClass.length > 0
1776
+ || prepared.componentRefsForInstances.size > 0
1777
+ || prepared.widgetInstances.length > 0;
1775
1778
  const customPomImportSpecifiersByClass = options.customPomImportSpecifiersByClass ?? {};
1776
1779
 
1777
1780
  const customImports = Array.from(
package/dist/index.cjs CHANGED
@@ -5601,9 +5601,9 @@ function prepareViewObjectModelClass(componentName, dependencies, componentHiera
5601
5601
  members.push(...getComponentInstances(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass, widgetInstances));
5602
5602
  members.push(getConstructor(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass, widgetInstances, { testIdAttribute }));
5603
5603
  }
5604
- if (!isView && attachmentsForThisClass.length > 0) {
5605
- members.push(...getComponentInstances(/* @__PURE__ */ new Set(), componentHierarchyMap, attachmentsForThisClass));
5606
- members.push(getConstructor(/* @__PURE__ */ new Set(), componentHierarchyMap, attachmentsForThisClass, [], { testIdAttribute }));
5604
+ if (!isView && (componentRefsForInstances.size > 0 || attachmentsForThisClass.length > 0)) {
5605
+ members.push(...getComponentInstances(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass));
5606
+ members.push(getConstructor(componentRefsForInstances, componentHierarchyMap, attachmentsForThisClass, [], { testIdAttribute }));
5607
5607
  }
5608
5608
  members.push(
5609
5609
  ...getAttachmentPassthroughMethods(componentName, dependencies, attachmentsForThisClass, reservedAttachmentPassthroughNames)
@@ -5647,7 +5647,7 @@ function generateViewObjectModelContent(componentName, dependencies, componentHi
5647
5647
  const basePageImport = path.relative(fromAbs, toAbs).replace(/\\/g, "/");
5648
5648
  const basePageImportNoExt = stripExtension(basePageImport).replace(/\\/g, "/");
5649
5649
  const basePageImportSpecifier = basePageImportNoExt.startsWith(".") ? basePageImportNoExt : `./${basePageImportNoExt}`;
5650
- const needsPlaywrightPageImport = prepared.isView || prepared.attachmentsForThisClass.length > 0;
5650
+ const needsPlaywrightPageImport = prepared.isView || prepared.attachmentsForThisClass.length > 0 || prepared.componentRefsForInstances.size > 0 || prepared.widgetInstances.length > 0;
5651
5651
  const customPomImportSpecifiersByClass = options.customPomImportSpecifiersByClass ?? {};
5652
5652
  const customImports = Array.from(
5653
5653
  /* @__PURE__ */ new Set([