@immense/vue-pom-generator 1.0.53 → 1.0.54

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
@@ -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
- - **You can opt into stricter wrapper-action generation.** `errorBehavior: "error"` blocks button-like wrapper `:handler` expressions that the generator cannot turn into a semantic action name.
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
+ ![Pointer callout sequence](./docs/assets/pointer-callout-sequence.gif)
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:** `"error"` lets you opt into fail-fast behavior globally, while the object form lets you turn on only the checks you care about.
850
- - **Without it:** the default is `"ignore"`, so existing permissive fallback behavior remains in place.
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: "error" }` — enable only the button-wrapper semantic-name check
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,54 @@
1
- # Release Notes: v1.0.53
2
-
3
- ## Highlights
4
-
5
- - **Nuxt auto-detection**: Framework mode is now automatically detected—no manual configuration
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
1
+ ## Highlights
2
+
3
+ - **Zero runtime dependencies**: Eliminated all runtime dependencies for smaller bundle size and
4
+ reduced version conflicts
5
+ - **Pluggable callout renderer architecture**: Extracted floating-ui implementation into
6
+ swappable renderer system
7
+ - **Stricter semantic naming**: Unnameable wrapper handlers now fail fast by default instead of
8
+ silently succeeding
9
+ - **Streamlined callout placement pipeline**: Refactored pointer callout rendering for improved
10
+ maintainability
11
+ - **Removed peer dependencies**: No longer requires `vue`, `vitest`, or `@vue/shared` as peer
12
+ dependencies
11
13
 
12
14
  ## Changes
13
15
 
14
- ### Configuration & Auto-detection
15
- - Auto-detect Nuxt mode without requiring explicit `mode` config
16
- - Remove `scanDirs` configuration option (replaced by automatic discovery)
16
+ ### Dependencies
17
+ - Eliminated all runtime dependencies
18
+ ([#9](https://github.com/immense/vue-pom-generator/pull/9))
19
+ - Removed `vue`, `vitest`, and `@vue/shared` peer dependencies
20
+ - Updated package structure for zero external runtime requirements
21
+
22
+ ### Callout Rendering
23
+ - Extracted floating-ui callout renderer into separate module (`floating-ui-callout.ts`)
24
+ - Introduced pluggable pointer callout renderer system
25
+ - Streamlined callout placement pipeline for better performance
26
+ - Refactored pointer rendering logic for extensibility
17
27
 
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
28
+ ### Error Handling
29
+ - Semantic-name validation failures now default to throwing errors instead of warnings
30
+ - Improved fail-fast behavior for unnameable wrapper handlers
22
31
 
23
- ### Internal
24
- - Add dedicated Nuxt discovery module (`plugin/nuxt-discovery.ts`)
25
- - Remove generation-metrics feature and associated code
26
- - Refactor path utilities and plugin creation logic
32
+ ### Testing
33
+ - Aligned dev plugin options across test suite
34
+ - Added pointer callout sequence documentation (GIF)
35
+ - Enhanced test coverage for pointer rendering
27
36
 
28
37
  ## Breaking Changes
29
38
 
30
- - **Removed `scanDirs` config option**: The plugin now uses automatic directory discovery.
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`.
39
+ - **Peer dependencies removed**: `vue`, `vitest`, and `@vue/shared` are no longer peer
40
+ dependencies. Ensure your build still works if you relied on these being present.
41
+ - **Semantic naming errors**: Invalid semantic names now throw by default instead of warning.
42
+ Handlers that cannot be named semantically will cause build failures unless explicitly
43
+ configured otherwise.
34
44
 
35
45
  ## Pull Requests Included
36
46
 
37
- - #15 [fix: resolve Nuxt app-root dev POM
38
- clobber](https://github.com/immense/vue-pom-generator/pull/15) (@dkattan)
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)
47
+ - [#9](https://github.com/immense/vue-pom-generator/pull/9) - refactor(deps): eliminate all
48
+ runtime dependencies
57
49
 
58
50
  ## Testing
59
51
 
60
- Added `tests/nuxt-discovery.test.ts` for new Nuxt auto-detection. Significantly expanded
61
- `tests/build-serve-parity.test.ts` (+210 lines) and updated multiple test suites for
62
- configuration and dev-plugin changes.
52
+ Comprehensive test updates included to validate dependency removal, plugin option alignment, and
53
+ pointer callout rendering behavior.
63
54
 
@@ -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 { Pointer } from "./pointer";
6
- import type { AfterPointerClick, AfterPointerClickInfo } from "./pointer";
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?: { testIdAttribute?: string }) {
110
+ public constructor(protected page: PwPage, options?: BasePageOptions) {
103
111
  this.testIdAttribute = (options?.testIdAttribute || "data-testid").trim() || "data-testid";
104
112
 
105
- this.callout = new Callout(this.page);
106
- this.pointer = new Pointer(this.page, this.testIdAttribute, this.callout);
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 cursor to an element.
252
+ * Animates the pointer to an element.
241
253
  */
242
254
  protected async animateCursorToElement(
243
255
  target: string | PwLocator,