@immense/vue-pom-generator 1.0.53 → 1.0.55
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 +12 -5
- package/RELEASE_NOTES.md +13 -48
- package/class-generation/base-page.ts +18 -6
- package/class-generation/callout.ts +229 -679
- package/class-generation/floating-ui-callout.ts +857 -0
- package/class-generation/index.ts +1 -1
- package/class-generation/pointer.ts +152 -109
- package/dist/class-generation/base-page.d.ts +11 -5
- package/dist/class-generation/base-page.d.ts.map +1 -1
- package/dist/class-generation/callout.d.ts +44 -1
- package/dist/class-generation/callout.d.ts.map +1 -1
- package/dist/class-generation/floating-ui-callout.d.ts +4 -0
- package/dist/class-generation/floating-ui-callout.d.ts.map +1 -0
- package/dist/class-generation/pointer.d.ts +24 -5
- package/dist/class-generation/pointer.d.ts.map +1 -1
- package/dist/index.cjs +267 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +267 -49
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/support/build-plugin.d.ts.map +1 -1
- package/dist/plugin/support/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/support/virtual-modules.d.ts +2 -2
- package/dist/plugin/support/virtual-modules.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +2 -2
- package/dist/router-introspection.d.ts.map +1 -1
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +9 -13
package/README.md
CHANGED
|
@@ -74,7 +74,7 @@ The generator does not use one naming trick. It layers several signals.
|
|
|
74
74
|
- **Router links / `:to` bindings** can contribute route-based naming and typed navigation return types when the target can be resolved.
|
|
75
75
|
- **Wrapper components** can be explicit (`nativeWrappers`) or inferred from simple local SFC templates.
|
|
76
76
|
- **Fallback naming exists, but it is intentionally conservative.** That is why `generation.nameCollisionBehavior` exists.
|
|
77
|
-
- **
|
|
77
|
+
- **Wrapper-action generation fails fast by default.** The generator blocks button-like wrapper `:handler` expressions that it cannot turn into a semantic action name; set `errorBehavior: "ignore"` if you explicitly want the old permissive fallback.
|
|
78
78
|
|
|
79
79
|
Important limit: wrapper inference is helpful, not magical. The current implementation recursively inspects simple local SFC templates for the first inferable primitive (`input`, `textarea`, `select`, `button`, `vselect`, radio/checkbox inputs). It also recognizes some naming patterns like `*Button`. For anything more complex, configure `nativeWrappers` explicitly.
|
|
80
80
|
|
|
@@ -617,6 +617,7 @@ What it gives you:
|
|
|
617
617
|
- lower-camel-case fixtures for component classes too
|
|
618
618
|
- `pomFactory.create(Ctor)` for ad-hoc page-object construction inside tests
|
|
619
619
|
- an `animation` option that wires the generated runtime's pointer settings
|
|
620
|
+
- per-page `renderers` overrides so you can keep the simple default callout or swap in a custom pointer / callout overlay implementation such as the bundled `floating-ui-callout.ts` renderer
|
|
620
621
|
|
|
621
622
|
Current caveats:
|
|
622
623
|
|
|
@@ -625,6 +626,12 @@ Current caveats:
|
|
|
625
626
|
- component fixtures are skipped when their lower-camel-case name would collide with reserved Playwright fixture names such as `page`, `context`, `browser`, or `request`
|
|
626
627
|
- an override class still needs a `new (page)`-compatible constructor because that is what fixtures call
|
|
627
628
|
|
|
629
|
+
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.
|
|
630
|
+
|
|
631
|
+
Example floating-ui callout sequence captured from the Playwright fixture coverage:
|
|
632
|
+
|
|
633
|
+

|
|
634
|
+
|
|
628
635
|
## TypeScript vs C# output
|
|
629
636
|
|
|
630
637
|
### TypeScript output
|
|
@@ -846,12 +853,12 @@ The sections below follow the actual `VuePomGeneratorPluginOptions` shape from `
|
|
|
846
853
|
|
|
847
854
|
- **What it does:** Controls strict/error behavior for generator checks.
|
|
848
855
|
- **Why it exists:** complex inline handlers can otherwise fall through to generic naming, which makes generated APIs harder to discover and review.
|
|
849
|
-
- **Benefit:**
|
|
850
|
-
- **Without it:** the default is `"
|
|
856
|
+
- **Benefit:** fail-fast behavior is the default, while `"ignore"` or the object form let you opt back into only the permissive checks you want.
|
|
857
|
+
- **Without it:** the default is `"error"`, so unsupported button-wrapper handlers stop generation instead of silently falling back.
|
|
851
858
|
- **Accepted values:**
|
|
852
859
|
- `"ignore"` — keep permissive defaults for all supported checks
|
|
853
|
-
- `"error"` — enable error-on-failure behavior for all supported checks
|
|
854
|
-
- `{ missingSemanticNameBehavior: "
|
|
860
|
+
- `"error"` — enable error-on-failure behavior for all supported checks (default)
|
|
861
|
+
- `{ missingSemanticNameBehavior: "ignore" }` — opt out only of the button-wrapper semantic-name check
|
|
855
862
|
- **Current scope:** this first pass is intentionally narrow. The object form currently supports `missingSemanticNameBehavior`, which targets button-like wrappers with `:handler`; value/model-driven wrappers still use their existing naming flow.
|
|
856
863
|
|
|
857
864
|
### `injection`
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,63 +1,28 @@
|
|
|
1
|
-
●
|
|
1
|
+
● ## Highlights
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
6
|
-
required
|
|
7
|
-
- **Simplified configuration**: Removed `scanDirs` option in favor of automatic discovery
|
|
8
|
-
- **Improved dev-mode reliability**: Multiple fixes for Nuxt app-root POM generation and
|
|
9
|
-
snapshot preservation
|
|
10
|
-
- **Cleaner codebase**: Removed unused generation-metrics feature
|
|
3
|
+
- Fixed manual release workflow guardrails to prevent accidental triggers
|
|
4
|
+
- Cleaned up stale regression test
|
|
5
|
+
- Single workflow file change with improved safety checks
|
|
11
6
|
|
|
12
7
|
## Changes
|
|
13
8
|
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
- Remove `scanDirs` configuration option (replaced by automatic discovery)
|
|
17
|
-
|
|
18
|
-
### Bug Fixes
|
|
19
|
-
- Resolve Nuxt app-root dev POM clobber issue
|
|
20
|
-
- Preserve richer dev POM snapshots during generation
|
|
21
|
-
- Confirm incomplete dev snapshots to prevent silent failures
|
|
9
|
+
**CI/CD Improvements**
|
|
10
|
+
- Added guardrails to prevent unintended manual release triggers in GitHub Actions workflow
|
|
22
11
|
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
- Remove generation-metrics feature and associated code
|
|
26
|
-
- Refactor path utilities and plugin creation logic
|
|
12
|
+
**Testing**
|
|
13
|
+
- Removed stale regression test case
|
|
27
14
|
|
|
28
15
|
## Breaking Changes
|
|
29
16
|
|
|
30
|
-
|
|
31
|
-
Remove any `scanDirs` configuration from your setup.
|
|
32
|
-
- **Removed generation-metrics**: The generation metrics tracking feature has been removed along
|
|
33
|
-
with `plugin/support/generation-metrics.ts`.
|
|
17
|
+
None.
|
|
34
18
|
|
|
35
19
|
## Pull Requests Included
|
|
36
20
|
|
|
37
|
-
- #
|
|
38
|
-
|
|
39
|
-
- #13 [Relax Vite peer dependency range](https://github.com/immense/vue-pom-generator/pull/13)
|
|
40
|
-
(@Copilot)
|
|
41
|
-
- #12 [feat: add split Playwright POM output for
|
|
42
|
-
discoverability](https://github.com/immense/vue-pom-generator/pull/12) (@dkattan)
|
|
43
|
-
- #11 [feat: fail fast on unnameable wrapper
|
|
44
|
-
handlers](https://github.com/immense/vue-pom-generator/pull/11) (@dkattan)
|
|
45
|
-
- #8 [chore: bump version to 1.0.43](https://github.com/immense/vue-pom-generator/pull/8)
|
|
46
|
-
(@mayfieldiv)
|
|
47
|
-
- #7 [test: add build–serve parity regression
|
|
48
|
-
tests](https://github.com/immense/vue-pom-generator/pull/7) (@mayfieldiv)
|
|
49
|
-
- #6 [fix: fail fast on dev snapshot generation
|
|
50
|
-
errors](https://github.com/immense/vue-pom-generator/pull/6) (@dkattan)
|
|
51
|
-
- #5 [fix: dev-mode POM generation parity with build
|
|
52
|
-
mode](https://github.com/immense/vue-pom-generator/pull/5) (@mayfieldiv)
|
|
53
|
-
- #4 [Fix keyed POM dedupe and C# navigation
|
|
54
|
-
returns](https://github.com/immense/vue-pom-generator/pull/4) (@dkattan)
|
|
55
|
-
- #1 [Add PR release-notes preview
|
|
56
|
-
comments](https://github.com/immense/vue-pom-generator/pull/1) (@dkattan)
|
|
21
|
+
- #16 fix: guard manual releases (https://github.com/immense/vue-pom-generator/pull/16)
|
|
22
|
+
(@dkattan)
|
|
57
23
|
|
|
58
24
|
## Testing
|
|
59
25
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
configuration and dev-plugin changes.
|
|
26
|
+
Includes test cleanup (removal of stale regression test). Workflow changes validated through
|
|
27
|
+
GitHub Actions.
|
|
63
28
|
|
|
@@ -2,8 +2,8 @@ import type { PwLocator, PwPage } from "./playwright-types";
|
|
|
2
2
|
import { TESTID_CLICK_EVENT_NAME, TESTID_CLICK_EVENT_STRICT_FLAG } from "../click-instrumentation";
|
|
3
3
|
import type { TestIdClickEventDetail } from "../click-instrumentation";
|
|
4
4
|
import { Callout } from "./callout";
|
|
5
|
-
import {
|
|
6
|
-
import type
|
|
5
|
+
import type { CalloutRenderer } from "./callout";
|
|
6
|
+
import { Pointer, type AfterPointerClick, type AfterPointerClickInfo, type PointerRenderer } from "./pointer";
|
|
7
7
|
|
|
8
8
|
// Click instrumentation is optional for generated POMs.
|
|
9
9
|
//
|
|
@@ -55,6 +55,14 @@ export type Fluent<T extends object> = DeepFluent<T, T> & PromiseLike<T>;
|
|
|
55
55
|
|
|
56
56
|
export type ValueFluent<T> = DeepValueFluent<T> & PromiseLike<T>;
|
|
57
57
|
|
|
58
|
+
export interface BasePageOptions {
|
|
59
|
+
renderers?: {
|
|
60
|
+
callout?: CalloutRenderer;
|
|
61
|
+
pointer?: PointerRenderer;
|
|
62
|
+
};
|
|
63
|
+
testIdAttribute?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
58
66
|
export class ObjectId {
|
|
59
67
|
private readonly raw: string;
|
|
60
68
|
|
|
@@ -99,11 +107,15 @@ export class BasePage {
|
|
|
99
107
|
/**
|
|
100
108
|
* @param {Page} page - Playwright page object
|
|
101
109
|
*/
|
|
102
|
-
constructor(protected page: PwPage, options?:
|
|
110
|
+
public constructor(protected page: PwPage, options?: BasePageOptions) {
|
|
103
111
|
this.testIdAttribute = (options?.testIdAttribute || "data-testid").trim() || "data-testid";
|
|
104
112
|
|
|
105
|
-
|
|
106
|
-
this.
|
|
113
|
+
const pointerRenderer = options?.renderers?.pointer;
|
|
114
|
+
this.callout = new Callout(this.page, {
|
|
115
|
+
extraOverlayIds: pointerRenderer?.overlayIds,
|
|
116
|
+
renderer: options?.renderers?.callout,
|
|
117
|
+
});
|
|
118
|
+
this.pointer = new Pointer(this.page, this.testIdAttribute, this.callout, pointerRenderer);
|
|
107
119
|
}
|
|
108
120
|
|
|
109
121
|
private async waitForTestIdClickEventAfter(testId: string, options?: { timeoutMs?: number }): Promise<void> {
|
|
@@ -237,7 +249,7 @@ export class BasePage {
|
|
|
237
249
|
}
|
|
238
250
|
|
|
239
251
|
/**
|
|
240
|
-
* Animates the
|
|
252
|
+
* Animates the pointer to an element.
|
|
241
253
|
*/
|
|
242
254
|
protected async animateCursorToElement(
|
|
243
255
|
target: string | PwLocator,
|