@immense/vue-pom-generator 1.0.66 → 1.0.68

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.
Files changed (57) hide show
  1. package/AGENTS.md +21 -0
  2. package/README.md +1 -0
  3. package/RELEASE_NOTES.md +16 -9
  4. package/class-generation/index.ts +16 -5
  5. package/dist/class-generation/index.d.ts.map +1 -1
  6. package/dist/compiler-metadata-utils.d.ts.map +1 -1
  7. package/dist/index.cjs +309 -97
  8. package/dist/index.cjs.map +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.mjs +309 -97
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/manifest-generator.d.ts +2 -0
  14. package/dist/manifest-generator.d.ts.map +1 -1
  15. package/dist/metadata-collector.d.ts +2 -0
  16. package/dist/metadata-collector.d.ts.map +1 -1
  17. package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
  18. package/dist/plugin/internal/build-plugin.d.ts.map +1 -0
  19. package/dist/plugin/internal/dev-plugin.d.ts.map +1 -0
  20. package/dist/plugin/internal/virtual-modules.d.ts.map +1 -0
  21. package/dist/plugin/{support-plugins.d.ts → internal-plugins.d.ts} +14 -3
  22. package/dist/plugin/internal-plugins.d.ts.map +1 -0
  23. package/dist/plugin/path-utils.d.ts +12 -0
  24. package/dist/plugin/path-utils.d.ts.map +1 -1
  25. package/dist/plugin/runtime/annotator/client.d.ts +67 -0
  26. package/dist/plugin/runtime/annotator/client.d.ts.map +1 -0
  27. package/dist/plugin/runtime/annotator/format.d.ts +13 -0
  28. package/dist/plugin/runtime/annotator/format.d.ts.map +1 -0
  29. package/dist/plugin/runtime/annotator/plugin.d.ts +12 -0
  30. package/dist/plugin/runtime/annotator/plugin.d.ts.map +1 -0
  31. package/dist/plugin/runtime/annotator/styles.d.ts +3 -0
  32. package/dist/plugin/runtime/annotator/styles.d.ts.map +1 -0
  33. package/dist/plugin/runtime/annotator/vue-detector.d.ts +12 -0
  34. package/dist/plugin/runtime/annotator/vue-detector.d.ts.map +1 -0
  35. package/dist/plugin/types.d.ts +58 -3
  36. package/dist/plugin/types.d.ts.map +1 -1
  37. package/dist/plugin/vue-plugin.d.ts +4 -0
  38. package/dist/plugin/vue-plugin.d.ts.map +1 -1
  39. package/dist/tests/path-utils-scope.test.d.ts +2 -0
  40. package/dist/tests/path-utils-scope.test.d.ts.map +1 -0
  41. package/dist/transform.d.ts +4 -0
  42. package/dist/transform.d.ts.map +1 -1
  43. package/dist/utils.d.ts +19 -0
  44. package/dist/utils.d.ts.map +1 -1
  45. package/package.json +3 -1
  46. package/plugin/runtime/annotator/client.ts +1005 -0
  47. package/plugin/runtime/annotator/format.ts +76 -0
  48. package/plugin/runtime/annotator/plugin.ts +109 -0
  49. package/plugin/runtime/annotator/styles.ts +379 -0
  50. package/plugin/runtime/annotator/vue-detector.ts +216 -0
  51. package/dist/plugin/support/build-plugin.d.ts.map +0 -1
  52. package/dist/plugin/support/dev-plugin.d.ts.map +0 -1
  53. package/dist/plugin/support/virtual-modules.d.ts.map +0 -1
  54. package/dist/plugin/support-plugins.d.ts.map +0 -1
  55. /package/dist/plugin/{support → internal}/build-plugin.d.ts +0 -0
  56. /package/dist/plugin/{support → internal}/dev-plugin.d.ts +0 -0
  57. /package/dist/plugin/{support → internal}/virtual-modules.d.ts +0 -0
package/AGENTS.md CHANGED
@@ -28,6 +28,27 @@ Stop and ask for guidance instead of implementing a fallback. Explain:
28
28
  - which consumers/call sites are affected,
29
29
  - and what the clean breaking change would look like.
30
30
 
31
+ ## Local source wiring into a consumer app
32
+
33
+ When testing `vue-pom-generator` from a local checkout, do **not** import `../vue-pom-generator/index.ts` directly from the consumer's Vite config.
34
+ That pulls in this repo's source-level TypeScript types and its own `vite` dependency tree, which causes avoidable type/runtime mismatches.
35
+
36
+ Use this flow instead:
37
+
38
+ 1. Build this repo first:
39
+ - `cd /path/to/vue-pom-generator`
40
+ - `npm run build`
41
+ 2. In the consumer app's `package.json`, point the dependency at the local checkout:
42
+ - `"@immense/vue-pom-generator": "file:../../../vue-pom-generator"`
43
+ - adjust the relative path for that consumer repo
44
+ 3. Keep imports by package name:
45
+ - `import { defineVuePomGeneratorConfig, vuePomGenerator } from "@immense/vue-pom-generator";`
46
+ 4. Reinstall in the consumer:
47
+ - `npm install`
48
+ 5. If the consumer has type friction around `PluginOption[]`, prefer a local cast in the consumer helper rather than importing this repo's TS source directly.
49
+
50
+ Short version: **build here, use a `file:` dependency there, keep package-name imports.**
51
+
31
52
  ## Scope
32
53
 
33
54
  These rules apply to:
package/README.md CHANGED
@@ -625,6 +625,7 @@ Current caveats:
625
625
  - there are no generated `openXPage` helpers; tests call `goTo()` explicitly when available
626
626
  - override preference only affects fixture construction
627
627
  - component fixtures are skipped when their lower-camel-case name would collide with reserved Playwright fixture names such as `page`, `context`, `browser`, or `request`
628
+ - generic wrapper-only component fallbacks whose best standalone name is just their wrapper class are skipped so parent views/components keep the more meaningful handler-derived API
628
629
  - an override class still needs a `new (page)`-compatible constructor because that is what fixtures call
629
630
 
630
631
  By default the runtime uses a simple red fallback bubble. The example below uses the optional floating-ui renderer so the callout can auto-place around nearby UI and point back to the target with an arrow.
package/RELEASE_NOTES.md CHANGED
@@ -1,27 +1,34 @@
1
1
  ● ## Highlights
2
2
 
3
- - Fixed component child POM attachment bug
4
- - Added comprehensive test coverage for class generation
3
+ - Fixed file scope path checks to properly normalize paths before comparison
4
+ - Extracted path normalization logic into dedicated utility functions
5
+ - Added comprehensive test coverage for path scope validation
5
6
 
6
7
  ## Changes
7
8
 
8
9
  **Bug Fixes**
9
- - Corrected logic for attaching child page object models to component classes
10
- - Improved reliability of generated POM hierarchies
10
+ - Normalized file scope path checks to handle platform-specific path separators and inconsistent
11
+ path formats (#29)
12
+ - Refactored path comparison logic in Vue plugin to use centralized utility functions
11
13
 
12
14
  **Testing**
13
- - Added 53 lines of test coverage for class generation scenarios
15
+ - Added `tests/path-utils-scope.test.ts` with 29 test cases for path scope validation
16
+
17
+ **Code Quality**
18
+ - Extracted 68 lines of path utility logic from `vue-plugin.ts` to `plugin/path-utils.ts`
19
+ - Reduced code duplication in plugin path handling (net -29 lines in vue-plugin.ts)
14
20
 
15
21
  ## Breaking Changes
16
22
 
17
- None
23
+ None.
18
24
 
19
25
  ## Pull Requests Included
20
26
 
21
- Unable to determine specific PR for commit `e1f328c` from available metadata.
27
+ - #29 fix: normalize file scope path checks
28
+ (https://github.com/immense/vue-pom-generator/pull/29) by @dkattan
22
29
 
23
30
  ## Testing
24
31
 
25
- Added new test cases in `tests/class-generation-coverage.test.ts` covering component child POM
26
- attachment scenarios.
32
+ New test suite added (`path-utils-scope.test.ts`) covering path normalization and scope
33
+ validation edge cases.
27
34
 
@@ -54,6 +54,7 @@ import {
54
54
  PomExtraClickMethodSpec,
55
55
  PomPrimarySpec,
56
56
  PomSelectorSpec,
57
+ shouldSuppressStandaloneWrapperFallbackSurface,
57
58
  toPascalCase,
58
59
  upperFirst,
59
60
  } from "../utils";
@@ -663,6 +664,11 @@ export async function generateFiles(
663
664
  layoutDirs,
664
665
  })
665
666
  : undefined);
667
+ const emittableComponentHierarchyMap = new Map(
668
+ Array.from(componentHierarchyMap.entries()).filter(([componentName, dependencies]) => {
669
+ return !shouldSuppressStandaloneWrapperFallbackSurface(componentName, dependencies);
670
+ }),
671
+ );
666
672
  const generatedFilePaths: string[] = [];
667
673
  const writeGeneratedFile = (file: GeneratedFileOutput) => {
668
674
  const resolvedFilePath = path.resolve(file.filePath);
@@ -672,7 +678,7 @@ export async function generateFiles(
672
678
 
673
679
  if (emitLanguages.includes("ts")) {
674
680
  const files = typescriptOutputStructure === "split"
675
- ? await generateSplitTypeScriptFiles(componentHierarchyMap, vueFilesPathMap, basePageClassPath, outDir, {
681
+ ? await generateSplitTypeScriptFiles(emittableComponentHierarchyMap, vueFilesPathMap, basePageClassPath, outDir, {
676
682
  customPomAttachments,
677
683
  projectRoot,
678
684
  customPomDir,
@@ -683,7 +689,7 @@ export async function generateFiles(
683
689
  routeMetaByComponent,
684
690
  vueRouterFluentChaining,
685
691
  })
686
- : await generateAggregatedFiles(componentHierarchyMap, vueFilesPathMap, basePageClassPath, outDir, {
692
+ : await generateAggregatedFiles(emittableComponentHierarchyMap, vueFilesPathMap, basePageClassPath, outDir, {
687
693
  customPomAttachments,
688
694
  projectRoot,
689
695
  customPomDir,
@@ -699,7 +705,7 @@ export async function generateFiles(
699
705
  writeGeneratedFile(file);
700
706
  }
701
707
 
702
- const fixtureRegistryFile = maybeGenerateFixtureRegistry(componentHierarchyMap, {
708
+ const fixtureRegistryFile = maybeGenerateFixtureRegistry(emittableComponentHierarchyMap, {
703
709
  generateFixtures,
704
710
  pomOutDir: outDir,
705
711
  projectRoot,
@@ -711,7 +717,7 @@ export async function generateFiles(
711
717
  }
712
718
 
713
719
  if (emitLanguages.includes("csharp")) {
714
- const csFiles = generateAggregatedCSharpFiles(componentHierarchyMap, outDir, {
720
+ const csFiles = generateAggregatedCSharpFiles(emittableComponentHierarchyMap, outDir, {
715
721
  projectRoot,
716
722
  testIdAttribute,
717
723
  csharp,
@@ -1636,7 +1642,12 @@ function prepareViewObjectModelClass(
1636
1642
  : childrenComponentSet;
1637
1643
  const componentRefsForInstances = new Set<string>();
1638
1644
  for (const ref of rawComponentRefsForInstances) {
1639
- componentRefsForInstances.add(resolveTrackedComponentRef(ref) ?? normalizeTrackedComponentRef(ref));
1645
+ const resolvedRef = resolveTrackedComponentRef(ref) ?? normalizeTrackedComponentRef(ref);
1646
+ const resolvedDependencies = componentHierarchyMap.get(resolvedRef);
1647
+ if (!resolvedDependencies?.dataTestIdSet.size) {
1648
+ continue;
1649
+ }
1650
+ componentRefsForInstances.add(resolvedRef);
1640
1651
  }
1641
1652
 
1642
1653
  const hasChildComponent = (needle: string) => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAo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AClD;AAsCD,wBAAsB,aAAa,CACjC,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAC1D,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,iBAAiB,EAAE,MAAM,EACzB,OAAO,GAAE,oBAAyB,iBAyGnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"compiler-metadata-utils.d.ts","sourceRoot":"","sources":["../compiler-metadata-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,oBAAoB,EAGrB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,aAAa,GAAG,SAAS,CAAC;AAEvE,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,aAAa,GAAE,MAAsB,GAAG,cAAc,CAQ9G;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAcrE;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,GAAG,MAAM,EAAE,GAAG,SAAS,CA+C/G;AAkCD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,OAAO,EAAE,WAAW,CAAC;IACrB,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC,EAAE,OAAO,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,eAAe,GAAG,IAAI,CA2DzB"}
1
+ {"version":3,"file":"compiler-metadata-utils.d.ts","sourceRoot":"","sources":["../compiler-metadata-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EAC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