@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 +11 -7
- package/RELEASE_NOTES.md +40 -26
- package/class-generation/index.ts +9 -0
- package/dist/index.cjs +323 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +324 -92
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/support/dev-plugin.d.ts +1 -0
- package/dist/plugin/support/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/support-plugins.d.ts +1 -0
- package/dist/plugin/support-plugins.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +25 -13
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/vue-plugin.d.ts +1 -0
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/dist/transform.d.ts +1 -0
- package/dist/transform.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
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/
|
|
38
|
+
The generator emits an aggregated output under `generation.outDir` (default `tests/playwright/__generated__`):
|
|
39
39
|
|
|
40
|
-
- `tests/playwright/
|
|
41
|
-
- `tests/playwright/
|
|
42
|
-
- managed `.gitattributes` files
|
|
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/
|
|
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/
|
|
98
|
-
outDir: "tests/playwright/
|
|
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
|
-
●
|
|
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
|
-
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
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
|
-
**
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
-
|
|
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
|
-
**
|
|
20
|
-
-
|
|
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
|
-
**
|
|
23
|
-
- Added
|
|
24
|
-
-
|
|
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
|
-
|
|
27
|
-
- Enhanced router introspection logic (17 line changes)
|
|
28
|
-
- Updated utility functions (3 line changes)
|
|
41
|
+
## Breaking Changes
|
|
29
42
|
|
|
30
|
-
**
|
|
31
|
-
|
|
32
|
-
|
|
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
|
|
37
|
-
|
|
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
|
-
|
|
42
|
-
|
|
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>();
|