@immense/vue-pom-generator 1.0.86 → 1.0.88
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/RELEASE_NOTES.md +38 -47
- package/dist/index.cjs +55 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +55 -8
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/internal/build-plugin.d.ts +2 -0
- package/dist/plugin/internal/build-plugin.d.ts.map +1 -1
- package/dist/plugin/internal/dev-plugin.d.ts +1 -0
- package/dist/plugin/internal/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/internal-plugins.d.ts +1 -0
- package/dist/plugin/internal-plugins.d.ts.map +1 -1
- package/dist/plugin/resolved-injection-options.d.ts +2 -0
- package/dist/plugin/resolved-injection-options.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +13 -0
- 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 +6 -0
- package/dist/transform.d.ts.map +1 -1
- package/dist/utils.d.ts +29 -6
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,68 +1,59 @@
|
|
|
1
|
-
I'll gather the actual
|
|
2
|
-
window and what commits are in the compare range.
|
|
1
|
+
I'll gather the actual commit and PR data for this release to generate accurate notes.
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
window.
|
|
3
|
+
Let me examine the actual changes to write accurate release notes.
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
Now I have all the information needed. Here's what I found:
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
the tests pass to include accurate testing info.
|
|
17
|
-
|
|
18
|
-
I have all the information needed. The environment restricts running Node.js tests, but I've
|
|
19
|
-
thoroughly reviewed the diff. Here are the release notes:
|
|
7
|
+
- v1.0.87 (f7af29c) was tagged at 2026-08-12T04:26:35-05:00 — the start of the window
|
|
8
|
+
- HEAD (253b6a0) was committed at 2026-08-12T05:19:26-05:00 — the end of the window
|
|
9
|
+
- The range contains one commit (no PR number): feat: recognize 'tab' as a native wrapper role
|
|
10
|
+
- The most recent PR (#52) was merged 2026-08-07, well before the window — no PRs fall in this
|
|
11
|
+
release window
|
|
12
|
+
- The change adds 'tab' as a recognized NativeRole, enabling per-usage tab accessors with -tab
|
|
13
|
+
selector suffixes
|
|
20
14
|
|
|
21
15
|
Highlights
|
|
22
16
|
|
|
23
|
-
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
constructor's narrowed page parameter.
|
|
17
|
+
- tab is now a first-class native wrapper role. Declaring role: "tab" on a wrapper component (with
|
|
18
|
+
a valueAttribute such as title) lets the generator derive per-usage data-testids from each tab's
|
|
19
|
+
literal prop value and emit distinct named click accessors (e.g. clickUsers, clickRoles).
|
|
20
|
+
- Consistent -tab selector suffix. Getter names now carry the Tab suffix (e.g. UsersTab, RolesTab)
|
|
21
|
+
matching the injected -tab test-id, instead of falling back to a Button suffix when tab was not a
|
|
22
|
+
recognized NativeRole.
|
|
23
|
+
- No breaking changes. The addition is purely additive — 'tab' is appended to the existing
|
|
24
|
+
NativeRole union and role-handling switch cases.
|
|
32
25
|
|
|
33
26
|
Changes
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
POM generation — native roles
|
|
36
29
|
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
- PwLocator doc comment updated to clarify it is for internal parameters only; return types widen
|
|
45
|
-
at the boundary.
|
|
30
|
+
- Added 'tab' to the NativeRole type in utils.ts.
|
|
31
|
+
- Recognized tab in applyResolvedDataTestId so the role string is returned as-is for selector
|
|
32
|
+
suffixing.
|
|
33
|
+
- Added "tab" to the STANDALONE_WRAPPER_FALLBACK_ROLES set, allowing tab wrappers to be treated as
|
|
34
|
+
standalone interactive controls.
|
|
35
|
+
- Added inferredRole === "tab" to the interactive-role check in createTestIdTransform
|
|
36
|
+
(transform.ts), so tab wrappers are no longer rejected as unrecognized.
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
Tests
|
|
48
39
|
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
40
|
+
- Added a test (tests/transform.test.ts) verifying that a role: "tab" wrapper with valueAttribute:
|
|
41
|
+
"title" produces per-usage test-ids (MyPage-Users-tab, MyPage-Roles-tab), distinct click accessors
|
|
42
|
+
(clickUsers, clickRoles), and correctly-suffixed getter names (UsersTab, RolesTab — not
|
|
43
|
+
UsersButton).
|
|
53
44
|
|
|
54
|
-
|
|
45
|
+
Breaking Changes
|
|
55
46
|
|
|
56
|
-
|
|
57
|
-
this.page usage in generated output.
|
|
47
|
+
None. The change is purely additive.
|
|
58
48
|
|
|
59
49
|
Pull Requests Included
|
|
60
50
|
|
|
61
|
-
|
|
51
|
+
No pull requests were merged in this release window. The sole change was committed directly
|
|
52
|
+
(253b6a0).
|
|
62
53
|
|
|
63
54
|
Testing
|
|
64
55
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
Added a new test case covering the tab native wrapper role — verifying per-usage data-testid
|
|
57
|
+
generation, click accessor naming, and getter suffix consistency. Existing tests are unaffected by
|
|
58
|
+
the additive type change.
|
|
68
59
|
|
package/dist/index.cjs
CHANGED
|
@@ -277,6 +277,7 @@ function resolveInjectionSupportOptions(options) {
|
|
|
277
277
|
layoutDirs: isNuxt ? ["app/layouts"] : options.layoutDirs ?? ["src/layouts"],
|
|
278
278
|
wrapperSearchRoots: isNuxt ? [] : options.wrapperSearchRoots ?? [],
|
|
279
279
|
nativeWrappers: options.nativeWrappers ?? {},
|
|
280
|
+
optionKeyAttribute: options.optionKeyAttribute ?? {},
|
|
280
281
|
excludedComponents: options.excludedComponents ?? [],
|
|
281
282
|
existingIdBehavior: options.existingIdBehavior ?? "error",
|
|
282
283
|
testIdAttribute: (options.testIdAttribute ?? "data-testid").trim() || "data-testid"
|
|
@@ -1327,12 +1328,13 @@ function findDirectiveByName(node, directiveName, argumentName) {
|
|
|
1327
1328
|
return matchesDirective;
|
|
1328
1329
|
});
|
|
1329
1330
|
}
|
|
1331
|
+
const ACTION_EVENTS = /* @__PURE__ */ new Set(["click", "change", "mousedown"]);
|
|
1330
1332
|
function isClickDirective(prop) {
|
|
1331
1333
|
if (prop.type !== compilerCore.NodeTypes.DIRECTIVE) {
|
|
1332
1334
|
return false;
|
|
1333
1335
|
}
|
|
1334
1336
|
const directive = prop;
|
|
1335
|
-
return directive.name === "on" && directive.arg?.type === compilerCore.NodeTypes.SIMPLE_EXPRESSION && directive.arg.content
|
|
1337
|
+
return directive.name === "on" && directive.arg?.type === compilerCore.NodeTypes.SIMPLE_EXPRESSION && ACTION_EVENTS.has(directive.arg.content);
|
|
1336
1338
|
}
|
|
1337
1339
|
function tryGetClickDirective(node) {
|
|
1338
1340
|
return node.props.find((p) => isClickDirective(p));
|
|
@@ -1734,6 +1736,17 @@ function getKeyDirectiveInfo(node) {
|
|
|
1734
1736
|
const runtimeSource = getVueExpressionSource(keyExpression, "loc", "compiled");
|
|
1735
1737
|
return toResolvedKeyInfo(selectorSource, runtimeSource);
|
|
1736
1738
|
}
|
|
1739
|
+
function getBindingKeyInfo(node, attrName) {
|
|
1740
|
+
const directive = findDirectiveByName(node, "bind", attrName);
|
|
1741
|
+
const exp = directive?.exp;
|
|
1742
|
+
if (!exp || exp.type !== compilerCore.NodeTypes.SIMPLE_EXPRESSION && exp.type !== compilerCore.NodeTypes.COMPOUND_EXPRESSION) {
|
|
1743
|
+
return null;
|
|
1744
|
+
}
|
|
1745
|
+
const expression = exp;
|
|
1746
|
+
const selectorSource = getVueExpressionSource(expression, "compiled", "loc");
|
|
1747
|
+
const runtimeSource = getVueExpressionSource(expression, "loc", "compiled");
|
|
1748
|
+
return toResolvedKeyInfo(selectorSource, runtimeSource);
|
|
1749
|
+
}
|
|
1737
1750
|
function getModelBindingValues(node) {
|
|
1738
1751
|
let vModel = "";
|
|
1739
1752
|
const vModelDirective = findDirectiveByName(node, "model");
|
|
@@ -1753,6 +1766,15 @@ function getModelBindingValues(node) {
|
|
|
1753
1766
|
}
|
|
1754
1767
|
return { vModel, modelValue };
|
|
1755
1768
|
}
|
|
1769
|
+
function getBindingValueHint(node) {
|
|
1770
|
+
const directive = findDirectiveByName(node, "bind", "value");
|
|
1771
|
+
const exp = directive?.exp;
|
|
1772
|
+
if (!exp || exp.type !== compilerCore.NodeTypes.SIMPLE_EXPRESSION && exp.type !== compilerCore.NodeTypes.COMPOUND_EXPRESSION) {
|
|
1773
|
+
return null;
|
|
1774
|
+
}
|
|
1775
|
+
const source = getVueExpressionSource(exp, "loc", "content");
|
|
1776
|
+
return source || null;
|
|
1777
|
+
}
|
|
1756
1778
|
function getStaticIdOrNameHint(node) {
|
|
1757
1779
|
let idAttr = findAttributeByKey(node, "id");
|
|
1758
1780
|
if (!idAttr) {
|
|
@@ -3004,6 +3026,7 @@ Fix: either (1) include ${bestKeyPreservePlaceholder} in your :${attrLabel} temp
|
|
|
3004
3026
|
case "radio":
|
|
3005
3027
|
case "grid":
|
|
3006
3028
|
case "link":
|
|
3029
|
+
case "tab":
|
|
3007
3030
|
return role;
|
|
3008
3031
|
default:
|
|
3009
3032
|
return void 0;
|
|
@@ -3629,7 +3652,8 @@ const STANDALONE_WRAPPER_FALLBACK_ROLES = /* @__PURE__ */ new Set([
|
|
|
3629
3652
|
"checkbox",
|
|
3630
3653
|
"toggle",
|
|
3631
3654
|
"radio",
|
|
3632
|
-
"link"
|
|
3655
|
+
"link",
|
|
3656
|
+
"tab"
|
|
3633
3657
|
]);
|
|
3634
3658
|
function stripTrailingAsciiDigits(value) {
|
|
3635
3659
|
let end = value.length;
|
|
@@ -7531,6 +7555,7 @@ function createTestIdTransform(componentName, componentHierarchyMap, nativeWrapp
|
|
|
7531
7555
|
const wrapperSearchRoots = options.wrapperSearchRoots ?? [];
|
|
7532
7556
|
const annotatorMetadata = options.annotatorMetadata ?? null;
|
|
7533
7557
|
const crossFileKeyRegistry = options.crossFileKeyRegistry;
|
|
7558
|
+
const optionKeyAttribute = options.optionKeyAttribute ?? {};
|
|
7534
7559
|
const safeRealpath2 = (p) => {
|
|
7535
7560
|
try {
|
|
7536
7561
|
return fs.existsSync(p) ? fs.realpathSync(p) : p;
|
|
@@ -7711,6 +7736,13 @@ Fix: set \`role\` explicitly in nativeWrappers (e.g. { "${element.tag}": { role:
|
|
|
7711
7736
|
const getBestAvailableKeyInfo = () => {
|
|
7712
7737
|
const parentNode = context.parent && typeof context.parent === "object" ? context.parent : null;
|
|
7713
7738
|
const isDirectVForChild = parentNode?.type === compilerCore.NodeTypes.FOR;
|
|
7739
|
+
const configuredAttrName = optionKeyAttribute[componentName];
|
|
7740
|
+
if (configuredAttrName && configuredAttrName !== "key") {
|
|
7741
|
+
const bindingKeyInfo = getBindingKeyInfo(element, configuredAttrName);
|
|
7742
|
+
if (bindingKeyInfo) {
|
|
7743
|
+
return bindingKeyInfo;
|
|
7744
|
+
}
|
|
7745
|
+
}
|
|
7714
7746
|
const vForKeyInfo = (isDirectVForChild ? getKeyDirectiveInfo(element) : null) || getContainedInVForDirectiveKeyInfo(context, element, hierarchyMap);
|
|
7715
7747
|
if (vForKeyInfo) {
|
|
7716
7748
|
return vForKeyInfo;
|
|
@@ -7918,7 +7950,8 @@ Fix: remove the explicit ${attrLabel}, or change existingIdBehavior to "overwrit
|
|
|
7918
7950
|
const rawIdentifier = getStaticAttributeContent(element, "id") || getStaticAttributeContent(element, "name");
|
|
7919
7951
|
const labelText = getAssociatedLabelText(element, hierarchyMap);
|
|
7920
7952
|
const { vModel, modelValue } = getModelBindingValues(element);
|
|
7921
|
-
const
|
|
7953
|
+
const valueBindingHint = nativeHtmlRole === "radio" || nativeHtmlRole === "checkbox" ? getBindingValueHint(element) : null;
|
|
7954
|
+
const bindingHint = modelValue || vModel || valueBindingHint || null;
|
|
7922
7955
|
const labelToken = labelText ? toPascalCase(labelText) : "";
|
|
7923
7956
|
const bindingToken = bindingHint ? toPascalCase(bindingHint) : "";
|
|
7924
7957
|
let identifierToken = null;
|
|
@@ -8016,7 +8049,7 @@ Fix: remove the explicit ${attrLabel}, or change existingIdBehavior to "overwrit
|
|
|
8016
8049
|
}
|
|
8017
8050
|
if (existingElementDataTestId) {
|
|
8018
8051
|
const inferredRole = getNativeRoleFromTagSuffix().toLowerCase();
|
|
8019
|
-
const isRecognizedInteractiveRole = inferredRole === "button" || inferredRole === "input" || inferredRole === "select" || inferredRole === "vselect" || inferredRole === "checkbox" || inferredRole === "toggle" || inferredRole === "radio" || inferredRole === "grid" || inferredRole === "link" || isComponentLikeTag(element.tag);
|
|
8052
|
+
const isRecognizedInteractiveRole = inferredRole === "button" || inferredRole === "input" || inferredRole === "select" || inferredRole === "vselect" || inferredRole === "checkbox" || inferredRole === "toggle" || inferredRole === "radio" || inferredRole === "grid" || inferredRole === "link" || inferredRole === "tab" || isComponentLikeTag(element.tag);
|
|
8020
8053
|
if (!isRecognizedInteractiveRole) {
|
|
8021
8054
|
return;
|
|
8022
8055
|
}
|
|
@@ -8089,6 +8122,7 @@ function createBuildProcessorPlugin(options) {
|
|
|
8089
8122
|
generation,
|
|
8090
8123
|
projectRootRef,
|
|
8091
8124
|
nativeWrappers,
|
|
8125
|
+
optionKeyAttribute,
|
|
8092
8126
|
excludedComponents,
|
|
8093
8127
|
getWrapperSearchRoots,
|
|
8094
8128
|
getResolvedRouterEntry,
|
|
@@ -8221,7 +8255,8 @@ function createBuildProcessorPlugin(options) {
|
|
|
8221
8255
|
warn: (message) => loggerRef.current.warn(message),
|
|
8222
8256
|
vueFilesPathMap,
|
|
8223
8257
|
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
8224
|
-
crossFileKeyRegistry
|
|
8258
|
+
crossFileKeyRegistry,
|
|
8259
|
+
optionKeyAttribute
|
|
8225
8260
|
}
|
|
8226
8261
|
)
|
|
8227
8262
|
]
|
|
@@ -8340,6 +8375,7 @@ function createBuildProcessorPlugin(options) {
|
|
|
8340
8375
|
function createDevProcessorPlugin(options) {
|
|
8341
8376
|
const {
|
|
8342
8377
|
nativeWrappers,
|
|
8378
|
+
optionKeyAttribute,
|
|
8343
8379
|
excludedComponents,
|
|
8344
8380
|
getPageDirs,
|
|
8345
8381
|
getComponentDirs,
|
|
@@ -8573,7 +8609,8 @@ function createDevProcessorPlugin(options) {
|
|
|
8573
8609
|
warn: (message) => loggerRef.current.warn(message),
|
|
8574
8610
|
vueFilesPathMap: provisionalVuePathMap,
|
|
8575
8611
|
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
8576
|
-
crossFileKeyRegistry: provisionalKeyRegistry
|
|
8612
|
+
crossFileKeyRegistry: provisionalKeyRegistry,
|
|
8613
|
+
optionKeyAttribute
|
|
8577
8614
|
}
|
|
8578
8615
|
)
|
|
8579
8616
|
]
|
|
@@ -9104,6 +9141,7 @@ function createInternalPlugins(options) {
|
|
|
9104
9141
|
elementMetadata,
|
|
9105
9142
|
vueFilesPathMap,
|
|
9106
9143
|
nativeWrappers,
|
|
9144
|
+
optionKeyAttribute,
|
|
9107
9145
|
excludedComponents,
|
|
9108
9146
|
getPageDirs,
|
|
9109
9147
|
getComponentDirs,
|
|
@@ -9154,6 +9192,7 @@ function createInternalPlugins(options) {
|
|
|
9154
9192
|
generation,
|
|
9155
9193
|
projectRootRef,
|
|
9156
9194
|
nativeWrappers,
|
|
9195
|
+
optionKeyAttribute,
|
|
9157
9196
|
excludedComponents,
|
|
9158
9197
|
getWrapperSearchRoots,
|
|
9159
9198
|
getResolvedRouterEntry: resolveRouterEntry2,
|
|
@@ -9161,6 +9200,7 @@ function createInternalPlugins(options) {
|
|
|
9161
9200
|
});
|
|
9162
9201
|
const devProcessor = createDevProcessorPlugin({
|
|
9163
9202
|
nativeWrappers,
|
|
9203
|
+
optionKeyAttribute,
|
|
9164
9204
|
excludedComponents,
|
|
9165
9205
|
getPageDirs,
|
|
9166
9206
|
getComponentDirs,
|
|
@@ -9365,6 +9405,7 @@ function createVuePluginWithTestIds(options) {
|
|
|
9365
9405
|
nameCollisionBehavior,
|
|
9366
9406
|
missingSemanticNameBehavior = "error",
|
|
9367
9407
|
nativeWrappers,
|
|
9408
|
+
optionKeyAttribute,
|
|
9368
9409
|
elementMetadata,
|
|
9369
9410
|
semanticNameMap,
|
|
9370
9411
|
componentHierarchyMap,
|
|
@@ -9439,7 +9480,8 @@ function createVuePluginWithTestIds(options) {
|
|
|
9439
9480
|
vueFilesPathMap,
|
|
9440
9481
|
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
9441
9482
|
annotatorMetadata,
|
|
9442
|
-
crossFileKeyRegistry
|
|
9483
|
+
crossFileKeyRegistry,
|
|
9484
|
+
optionKeyAttribute
|
|
9443
9485
|
}
|
|
9444
9486
|
)
|
|
9445
9487
|
);
|
|
@@ -9496,7 +9538,8 @@ function createVuePluginWithTestIds(options) {
|
|
|
9496
9538
|
vueFilesPathMap,
|
|
9497
9539
|
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
9498
9540
|
annotatorMetadata,
|
|
9499
|
-
crossFileKeyRegistry
|
|
9541
|
+
crossFileKeyRegistry,
|
|
9542
|
+
optionKeyAttribute
|
|
9500
9543
|
}
|
|
9501
9544
|
);
|
|
9502
9545
|
perFileTransform.set(componentName, transform);
|
|
@@ -9833,6 +9876,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9833
9876
|
layoutDirs: injection.layoutDirs,
|
|
9834
9877
|
wrapperSearchRoots: injection.wrapperSearchRoots,
|
|
9835
9878
|
nativeWrappers: injection.nativeWrappers,
|
|
9879
|
+
optionKeyAttribute: injection.optionKeyAttribute,
|
|
9836
9880
|
excludedComponents: injection.excludeComponents,
|
|
9837
9881
|
existingIdBehavior: injection.existingIdBehavior,
|
|
9838
9882
|
testIdAttribute: injection.attribute
|
|
@@ -9840,6 +9884,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9840
9884
|
};
|
|
9841
9885
|
const resolvedInjectionOptions = resolvedInjectionOptionsRef.current;
|
|
9842
9886
|
const nativeWrappers = resolvedInjectionOptions.nativeWrappers;
|
|
9887
|
+
const optionKeyAttribute = resolvedInjectionOptions.optionKeyAttribute;
|
|
9843
9888
|
const excludedComponents = resolvedInjectionOptions.excludedComponents;
|
|
9844
9889
|
const testIdAttribute = resolvedInjectionOptions.testIdAttribute;
|
|
9845
9890
|
const routerEntry = !isNuxt ? vueGenerationOptions?.router?.entry : void 0;
|
|
@@ -9962,6 +10007,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9962
10007
|
nameCollisionBehavior: resolvedGenerationOptions.nameCollisionBehavior,
|
|
9963
10008
|
missingSemanticNameBehavior: resolvedGenerationOptions.missingSemanticNameBehavior,
|
|
9964
10009
|
nativeWrappers,
|
|
10010
|
+
optionKeyAttribute,
|
|
9965
10011
|
elementMetadata,
|
|
9966
10012
|
semanticNameMap,
|
|
9967
10013
|
componentHierarchyMap,
|
|
@@ -9987,6 +10033,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9987
10033
|
elementMetadata,
|
|
9988
10034
|
vueFilesPathMap,
|
|
9989
10035
|
nativeWrappers,
|
|
10036
|
+
optionKeyAttribute,
|
|
9990
10037
|
excludedComponents,
|
|
9991
10038
|
getPageDirs,
|
|
9992
10039
|
getComponentDirs,
|