@immense/vue-pom-generator 1.0.29 → 1.0.31

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
@@ -35,15 +35,15 @@ Exported entrypoints:
35
35
  - `injection`: how `data-testid` (or your chosen attribute) is derived/injected
36
36
  - `generation`: how Page Object Models (POMs) and Playwright helpers are generated
37
37
 
38
- The generator emits an aggregated output under `generation.outDir` (default `tests/playwright/generated`):
38
+ The generator emits an aggregated output under `generation.outDir` (default `tests/playwright/__generated__`):
39
39
 
40
- - `tests/playwright/generated/page-object-models.g.ts` (generated; do not edit)
41
- - `tests/playwright/generated/index.ts` (generated stable barrel)
42
- - managed `.gitattributes` files alongside generated outputs so GitHub Linguist treats them as generated by default
40
+ - `tests/playwright/__generated__/page-object-models.g.ts` (generated; do not edit)
41
+ - `tests/playwright/__generated__/index.ts` (generated stable barrel)
42
+ - managed `.gitattributes` files only when you emit outside `__generated__`
43
43
 
44
44
  If `generation.playwright.fixtures` is enabled, it also emits:
45
45
 
46
- - `tests/playwright/generated/fixtures.g.ts` (generated; do not edit)
46
+ - `tests/playwright/__generated__/fixtures.g.ts` (generated; do not edit)
47
47
 
48
48
  ### Vite config example
49
49
 
@@ -71,6 +71,10 @@ export default defineConfig(() => {
71
71
  // For Nuxt, you might want ["app", "components", "pages", "layouts"]
72
72
  scanDirs: ["src"],
73
73
 
74
+ // Optional: extra directories to search when inferring wrapper-component roles for
75
+ // components that live outside scanDirs (for example a sibling shared UI package)
76
+ wrapperSearchRoots: ["../shared/ui/src/components"],
77
+
74
78
  // Optional: wrapper semantics for design-system components
75
79
  nativeWrappers: {
76
80
  MyButton: { role: "button" },
@@ -94,8 +98,8 @@ export default defineConfig(() => {
94
98
  namespace: "MyProject.Tests.Generated",
95
99
  },
96
100
 
97
- // Default: tests/playwright/generated
98
- outDir: "tests/playwright/generated",
101
+ // Default: tests/playwright/__generated__
102
+ outDir: "tests/playwright/__generated__",
99
103
 
100
104
  // Controls how to handle duplicate generated member names within a single POM class.
101
105
  // - "error": fail compilation
package/RELEASE_NOTES.md CHANGED
@@ -1,43 +1,57 @@
1
- # Release v1.0.29
1
+ I need to see the actual diff content to understand what the fix addressed. Let me get the file
2
+ diffs:
3
+
4
+ ● Let me look at specific key changes to understand what was fixed:
5
+
6
+ ● Based on the commit and PR details, here are the release notes:
7
+
8
+ ---
2
9
 
3
10
  ## Highlights
4
11
 
5
- - Added new ESLint rule to automatically remove existing `data-test-id` attributes from Vue
6
- components
7
- - Implemented PR release notes preview comment automation
8
- - Enhanced router introspection capabilities
9
- - Expanded documentation with ESLint rule usage examples
10
- - Added comprehensive test coverage for new ESLint rule
12
+ - Changed default output directory from `tests/playwright/generated` to
13
+ `tests/playwright/__generated__` for better convention adherence
14
+ - Improved `.gitattributes` generation: now skips managed entries for paths using
15
+ `__generated__` heuristic (GitHub Linguist auto-detects these)
16
+ - Enhanced slot scope key extraction logic for more robust click handler naming in generated
17
+ POMs
18
+ - Added comprehensive utility functions for analyzing assignment patterns, object destructuring,
19
+ and binding identifiers
11
20
 
12
21
  ## Changes
13
22
 
14
- **ESLint Rules**
15
- - New `remove-existing-test-id-attributes` rule to clean up manually-added test IDs before
16
- auto-generation
17
- - Updated ESLint plugin exports to include the new rule
23
+ **Output Directory Convention**
24
+ - Updated default `generation.outDir` to `tests/playwright/__generated__`
25
+ - Updated default Playwright fixtures output to use `__generated__` subdirectory
26
+ - `.gitattributes` entries are now only generated when using custom output directories outside
27
+ `__generated__`
18
28
 
19
- **Automation & Tooling**
20
- - Added PR release notes preview comment functionality
29
+ **Click Handler Naming**
30
+ - Improved slot scope key candidate extraction with priority-based selection
31
+ - Added support for object destructuring patterns in slot scope analysis
32
+ - Enhanced fallback key expression generation for slot scoped elements
33
+ - Better handling of assignment patterns, rest elements, and object properties
21
34
 
22
- **Documentation**
23
- - Added 45 lines of documentation covering the new ESLint cleanup rule
24
- - Included usage examples and configuration guidance
35
+ **Code Quality**
36
+ - Added test coverage for new utility functions in `class-generation-coverage.test.ts` and
37
+ `utils-coverage.test.ts`
38
+ - Expanded Babel type guards usage for more precise AST node detection
39
+ - Refactored slot scope analysis with dedicated helper functions
25
40
 
26
- **Code Improvements**
27
- - Enhanced router introspection logic (17 line changes)
28
- - Updated utility functions (3 line changes)
41
+ ## Breaking Changes
29
42
 
30
- **Testing**
31
- - Added 58 lines of tests for `remove-existing-test-id-attributes` rule
32
- - Updated existing test for test ID error handling
43
+ - **Default output directory** changed from `tests/playwright/generated` to
44
+ `tests/playwright/__generated__`. If you're relying on the default, generated files will move to
45
+ the new location. To preserve the old behavior, explicitly set `generation.outDir:
46
+ "tests/playwright/generated"` in your config.
33
47
 
34
48
  ## Pull Requests Included
35
49
 
36
- - #1 Add PR release-notes preview comments (https://github.com/immense/vue-pom-generator/pull/1)
37
- by @dkattan
50
+ - [#1 Add PR release-notes preview
51
+ comments](https://github.com/immense/vue-pom-generator/pull/1) by @dkattan
38
52
 
39
53
  ## Testing
40
54
 
41
- Comprehensive test suite added for the new ESLint rule with 58 lines of test coverage. Existing
42
- tests updated to reflect changes.
55
+ Added test coverage for new utility functions covering class generation and slot scope analysis
56
+ edge cases.
43
57
 
@@ -524,6 +524,11 @@ function escapeGitAttributesPattern(value: string): string {
524
524
  return output;
525
525
  }
526
526
 
527
+ function pathUsesGeneratedHeuristic(filePath: string): boolean {
528
+ const normalized = path.normalize(filePath);
529
+ return normalized.split(path.sep).includes("__generated__");
530
+ }
531
+
527
532
  function buildManagedGitAttributesBlock(entries: string[]): string {
528
533
  return [
529
534
  GENERATED_GITATTRIBUTES_BLOCK_START,
@@ -581,6 +586,10 @@ function buildGeneratedGitAttributesFiles(generatedFilePaths: string[]): Generat
581
586
  continue;
582
587
  }
583
588
 
589
+ if (pathUsesGeneratedHeuristic(resolvedFilePath)) {
590
+ continue;
591
+ }
592
+
584
593
  const dir = path.dirname(resolvedFilePath);
585
594
  const entry = `${escapeGitAttributesPattern(path.basename(resolvedFilePath))} linguist-generated`;
586
595
  const entries = entriesByDir.get(dir) ?? new Set<string>();