@immense/vue-pom-generator 1.0.77 → 1.0.78
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 +48 -45
- package/dist/index.cjs +92 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +93 -10
- 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 +1 -0
- package/dist/plugin/internal/build-plugin.d.ts.map +1 -1
- 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/vue-plugin.d.ts +2 -0
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/dist/transform.d.ts +11 -0
- package/dist/transform.d.ts.map +1 -1
- package/dist/utils.d.ts +16 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,70 +1,73 @@
|
|
|
1
|
-
I'll
|
|
2
|
-
|
|
1
|
+
I'll verify which PRs actually fall within the release window by checking their merge timestamps via
|
|
2
|
+
the GitHub API.
|
|
3
3
|
|
|
4
|
-
Let me
|
|
5
|
-
release.
|
|
4
|
+
Let me verify the v1.0.77 tag position relative to PR #36's merge.
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
window.
|
|
6
|
+
v1.0.77 points to #36's merge commit, confirming #36 belongs to the prior release. Only #37 (plus a
|
|
7
|
+
follow-up test commit) is in v1.0.78. Let me get the PR details and diff for accurate notes.
|
|
10
8
|
|
|
11
|
-
Let me
|
|
9
|
+
Let me check the plugin wiring changes to fully understand the feature.
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
I now have everything needed. Verification summary:
|
|
14
12
|
|
|
15
|
-
- #36
|
|
16
|
-
- #
|
|
17
|
-
|
|
13
|
+
- v1.0.77 tag = e5b00f4 (PR #36 merge), so #36 belongs to the prior release.
|
|
14
|
+
- Range v1.0.77..HEAD contains only #37's merge commit (03d66fa) plus a follow-up test fix
|
|
15
|
+
(d12efe7).
|
|
16
|
+
- The long PR list in the prompt spans months; only #37 falls in the release window and git range.
|
|
18
17
|
|
|
19
|
-
|
|
18
|
+
-----------------------------------------------------------------------------------------------
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
context.
|
|
20
|
+
Highlights
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
- Introduces a cross-file key registry so child components rendered inside keyed slot scopes (e.g.
|
|
23
|
+
<template #item="{ data, key }">) get automatically keyed testids
|
|
24
|
+
- Parent templates record which prop receives the slot-scope data; child components look up the
|
|
25
|
+
registry to key their internal testids (e.g. RolePermissionSubject-${subject.key ?? subject.id ??
|
|
26
|
+
…}-SelectAll-button)
|
|
27
|
+
- Relies on Rolldown's depth-first module processing to guarantee the parent is always compiled
|
|
28
|
+
before the child
|
|
29
|
+
- Threads the shared registry through both the build and dev plugin pipelines
|
|
30
|
+
- Adds new slot-scope variable extraction utilities plus positive/negative regression tests
|
|
25
31
|
|
|
26
|
-
|
|
27
|
-
- HEAD is commit #36 (2026-07-29T07:09:25-05:00)
|
|
28
|
-
- Only PR #36 is in the v1.0.76..HEAD range
|
|
29
|
-
- All other listed PRs (#1–#35) were already released in prior versions
|
|
32
|
+
Changes
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
Cross-file key registry
|
|
32
35
|
|
|
33
|
-
|
|
36
|
+
- Added CrossFileKeyRegistry type (Map<string, string>) exported from transform.ts
|
|
37
|
+
- Parent transform records childComponentName → slotDataPropName when a component is rendered
|
|
38
|
+
inside a v-slot keyed scope
|
|
39
|
+
- Child transform consults the registry to build a keyed fallback expression when no in-file slot
|
|
40
|
+
key is found
|
|
34
41
|
|
|
35
|
-
|
|
36
|
-
v-if/v-for branches no longer lose their stable keyed test IDs, ensuring generated POM locators
|
|
37
|
-
remain consistent across conditional rendering boundaries.
|
|
38
|
-
- Minimal, surgical release: 1 PR, 2 files changed (+56 / −1).
|
|
42
|
+
Plugin pipeline
|
|
39
43
|
|
|
40
|
-
|
|
44
|
+
- Threaded crossFileKeyRegistry through createVuePomGeneratorPlugins, createInternalPlugins, the
|
|
45
|
+
build processor, the dev processor, and the Vue plugin
|
|
46
|
+
- Build mode shares the registry across files; dev mode uses a provisional per-file key registry
|
|
47
|
+
- Added crossFileKeyRegistry to shared generator state
|
|
41
48
|
|
|
42
|
-
|
|
49
|
+
Utilities
|
|
43
50
|
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
51
|
+
- New tryExtractSlotScopeVariableNames parses slot-scope bindings (simple identifiers, object
|
|
52
|
+
destructuring, aliases, rest elements)
|
|
53
|
+
- New getContainedInSlotTemplateNode walks the hierarchy map to the nearest enclosing scoped-slot
|
|
54
|
+
<template>
|
|
55
|
+
- Refactored getContainedInSlotDataKeyInfo to reuse getContainedInSlotTemplateNode
|
|
56
|
+
- Exported previously-internal helpers: findTemplateSlotScopeExpression,
|
|
57
|
+
buildSlotScopeFallbackKeyExpression, toResolvedKeyInfo, tryGetTemplateSlotScopeKeyInfo
|
|
50
58
|
|
|
51
59
|
Tests
|
|
52
60
|
|
|
53
|
-
- Added
|
|
54
|
-
|
|
55
|
-
- Added regression test verifying stable keyed test IDs for scoped-slot data objects destructured
|
|
56
|
-
with an explicit key prop.
|
|
57
|
-
|
|
58
|
-
Breaking Changes
|
|
59
|
-
|
|
60
|
-
None.
|
|
61
|
+
- Added transform tests for the cross-file key registry (keyed case and non-keyed negative case)
|
|
62
|
+
- Updated the vue-plugin-state test to include crossFileKeyRegistry in shared state
|
|
61
63
|
|
|
62
64
|
Pull Requests Included
|
|
63
65
|
|
|
64
|
-
-
|
|
66
|
+
- #37 feat: cross-file key registry for child components in keyed slots — by @dkattan
|
|
67
|
+
(]8;id=md-1fs9wuc;https://github.com/immense/vue-pom-generator/pull/37https://github.com/immense/vue-pom-generator/pull/37]8;;]8;;)]8;;
|
|
65
68
|
|
|
66
69
|
Testing
|
|
67
70
|
|
|
68
|
-
|
|
69
|
-
|
|
71
|
+
All 204 tests pass per PR #37, including new cross-file key registry regression tests covering both
|
|
72
|
+
the keyed and non-keyed cases.
|
|
70
73
|
|
package/dist/index.cjs
CHANGED
|
@@ -1519,6 +1519,31 @@ function tryGetTemplateSlotScopeKeyInfo(expression) {
|
|
|
1519
1519
|
const candidateExpression = bindingNode ? tryGetSlotScopeKeyCandidate(bindingNode)?.expression ?? null : null;
|
|
1520
1520
|
return candidateExpression ? toResolvedKeyInfo(candidateExpression) : null;
|
|
1521
1521
|
}
|
|
1522
|
+
function tryExtractSlotScopeVariableNames(expression) {
|
|
1523
|
+
const bindingNode = tryGetTemplateSlotScopeBindingNode(expression);
|
|
1524
|
+
if (!bindingNode) {
|
|
1525
|
+
return [];
|
|
1526
|
+
}
|
|
1527
|
+
if (types.isIdentifier(bindingNode)) {
|
|
1528
|
+
return [bindingNode.name];
|
|
1529
|
+
}
|
|
1530
|
+
if (!types.isObjectPattern(bindingNode)) {
|
|
1531
|
+
return [];
|
|
1532
|
+
}
|
|
1533
|
+
const names = [];
|
|
1534
|
+
for (const property of bindingNode.properties) {
|
|
1535
|
+
if (types.isRestElement(property)) {
|
|
1536
|
+
const argName = tryGetBindingIdentifierName(property.argument);
|
|
1537
|
+
if (argName) names.push(argName);
|
|
1538
|
+
} else if (types.isObjectProperty(property)) {
|
|
1539
|
+
const bindingName = tryGetBindingIdentifierName(property.value) ?? tryGetBindingIdentifierName(property.key);
|
|
1540
|
+
if (bindingName) {
|
|
1541
|
+
names.push(bindingName);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
return names;
|
|
1546
|
+
}
|
|
1522
1547
|
function nodeHasToDirective(node) {
|
|
1523
1548
|
const toDirective = findDirectiveByName(node, "bind", "to");
|
|
1524
1549
|
if (toDirective?.exp) {
|
|
@@ -1701,12 +1726,21 @@ function getStaticIdOrNameHint(node) {
|
|
|
1701
1726
|
return identifier;
|
|
1702
1727
|
}
|
|
1703
1728
|
function getContainedInSlotDataKeyInfo(node, hierarchyMap2) {
|
|
1729
|
+
const templateNode = getContainedInSlotTemplateNode(node, hierarchyMap2);
|
|
1730
|
+
if (templateNode) {
|
|
1731
|
+
const slotScopeExpression = findTemplateSlotScopeExpression(templateNode);
|
|
1732
|
+
if (slotScopeExpression) {
|
|
1733
|
+
return tryGetTemplateSlotScopeKeyInfo(slotScopeExpression);
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
return null;
|
|
1737
|
+
}
|
|
1738
|
+
function getContainedInSlotTemplateNode(node, hierarchyMap2) {
|
|
1704
1739
|
let parent = getParent(hierarchyMap2, node);
|
|
1705
1740
|
while (parent) {
|
|
1706
1741
|
if (parent.type === compilerCore.NodeTypes.ELEMENT && parent.tag === "template") {
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
return tryGetTemplateSlotScopeKeyInfo(slotScopeExpression);
|
|
1742
|
+
if (findTemplateSlotScopeExpression(parent)) {
|
|
1743
|
+
return parent;
|
|
1710
1744
|
}
|
|
1711
1745
|
}
|
|
1712
1746
|
parent = getParent(hierarchyMap2, parent);
|
|
@@ -7259,6 +7293,7 @@ function createTestIdTransform(componentName, componentHierarchyMap, nativeWrapp
|
|
|
7259
7293
|
const vueFilesPathMap = options.vueFilesPathMap;
|
|
7260
7294
|
const wrapperSearchRoots = options.wrapperSearchRoots ?? [];
|
|
7261
7295
|
const annotatorMetadata = options.annotatorMetadata ?? null;
|
|
7296
|
+
const crossFileKeyRegistry = options.crossFileKeyRegistry;
|
|
7262
7297
|
const safeRealpath2 = (p) => {
|
|
7263
7298
|
try {
|
|
7264
7299
|
return fs.existsSync(p) ? fs.realpathSync(p) : p;
|
|
@@ -7388,6 +7423,31 @@ function createTestIdTransform(componentName, componentHierarchyMap, nativeWrapp
|
|
|
7388
7423
|
};
|
|
7389
7424
|
if (isComponentLikeTag(element.tag)) {
|
|
7390
7425
|
dependencies.usedComponentSet.add(element.tag);
|
|
7426
|
+
if (crossFileKeyRegistry && context.scopes.vSlot > 0) {
|
|
7427
|
+
const findSlotTemplate = () => {
|
|
7428
|
+
const gp = context.grandParent;
|
|
7429
|
+
if (gp?.type === compilerCore.NodeTypes.ELEMENT && gp.tag === "template") {
|
|
7430
|
+
return gp;
|
|
7431
|
+
}
|
|
7432
|
+
return getContainedInSlotTemplateNode(element, hierarchyMap);
|
|
7433
|
+
};
|
|
7434
|
+
const slotTemplate = findSlotTemplate();
|
|
7435
|
+
if (slotTemplate) {
|
|
7436
|
+
const slotScopeExpression = findTemplateSlotScopeExpression(slotTemplate);
|
|
7437
|
+
if (slotScopeExpression) {
|
|
7438
|
+
const slotVarNames = tryExtractSlotScopeVariableNames(slotScopeExpression);
|
|
7439
|
+
if (slotVarNames.length > 0) {
|
|
7440
|
+
for (const prop of element.props) {
|
|
7441
|
+
if (prop.type === compilerCore.NodeTypes.DIRECTIVE && prop.name === "bind" && prop.arg?.type === compilerCore.NodeTypes.SIMPLE_EXPRESSION && prop.exp?.type === compilerCore.NodeTypes.SIMPLE_EXPRESSION && slotVarNames.includes(prop.exp.content)) {
|
|
7442
|
+
const propName = prop.arg.content;
|
|
7443
|
+
crossFileKeyRegistry.set(element.tag, propName);
|
|
7444
|
+
break;
|
|
7445
|
+
}
|
|
7446
|
+
}
|
|
7447
|
+
}
|
|
7448
|
+
}
|
|
7449
|
+
}
|
|
7450
|
+
}
|
|
7391
7451
|
}
|
|
7392
7452
|
if (!nativeWrappers[element.tag]) {
|
|
7393
7453
|
const inferred = tryInferNativeWrapperRoleFromSfc(element.tag, vueFilesPathMap, wrapperSearchRoots);
|
|
@@ -7406,7 +7466,18 @@ function createTestIdTransform(componentName, componentHierarchyMap, nativeWrapp
|
|
|
7406
7466
|
if (vForKeyInfo) {
|
|
7407
7467
|
return vForKeyInfo;
|
|
7408
7468
|
}
|
|
7409
|
-
|
|
7469
|
+
const slotKeyInfo = getContainedInSlotDataKeyInfo(element, hierarchyMap);
|
|
7470
|
+
if (slotKeyInfo) {
|
|
7471
|
+
return slotKeyInfo;
|
|
7472
|
+
}
|
|
7473
|
+
if (crossFileKeyRegistry) {
|
|
7474
|
+
const propName = crossFileKeyRegistry.get(componentName);
|
|
7475
|
+
if (propName) {
|
|
7476
|
+
const fallbackExpr = buildSlotScopeFallbackKeyExpression(propName);
|
|
7477
|
+
return toResolvedKeyInfo(fallbackExpr, fallbackExpr);
|
|
7478
|
+
}
|
|
7479
|
+
}
|
|
7480
|
+
return null;
|
|
7410
7481
|
};
|
|
7411
7482
|
const bestKeyInfo = getBestAvailableKeyInfo();
|
|
7412
7483
|
const bestKeyPlaceholder = bestKeyInfo?.selectorFragment ?? null;
|
|
@@ -7754,6 +7825,7 @@ function isLessRich(candidate, previous) {
|
|
|
7754
7825
|
function createBuildProcessorPlugin(options) {
|
|
7755
7826
|
const {
|
|
7756
7827
|
componentHierarchyMap,
|
|
7828
|
+
crossFileKeyRegistry,
|
|
7757
7829
|
vueFilesPathMap,
|
|
7758
7830
|
getPageDirs,
|
|
7759
7831
|
getComponentDirs,
|
|
@@ -7896,7 +7968,8 @@ function createBuildProcessorPlugin(options) {
|
|
|
7896
7968
|
missingSemanticNameBehavior,
|
|
7897
7969
|
warn: (message) => loggerRef.current.warn(message),
|
|
7898
7970
|
vueFilesPathMap,
|
|
7899
|
-
wrapperSearchRoots: getWrapperSearchRoots()
|
|
7971
|
+
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
7972
|
+
crossFileKeyRegistry
|
|
7900
7973
|
}
|
|
7901
7974
|
)
|
|
7902
7975
|
]
|
|
@@ -8219,6 +8292,7 @@ function createDevProcessorPlugin(options) {
|
|
|
8219
8292
|
}
|
|
8220
8293
|
const { bindings: bindingMetadata, isScriptSetup } = getScriptInfo(sfc, absolutePath);
|
|
8221
8294
|
const provisionalHierarchy = /* @__PURE__ */ new Map();
|
|
8295
|
+
const provisionalKeyRegistry = /* @__PURE__ */ new Map();
|
|
8222
8296
|
const provisionalVuePathMap = new Map(targetVuePathMap);
|
|
8223
8297
|
provisionalVuePathMap.set(componentName, absolutePath);
|
|
8224
8298
|
compilerDom__namespace.compile(template, {
|
|
@@ -8246,7 +8320,8 @@ function createDevProcessorPlugin(options) {
|
|
|
8246
8320
|
testIdAttribute,
|
|
8247
8321
|
warn: (message) => loggerRef.current.warn(message),
|
|
8248
8322
|
vueFilesPathMap: provisionalVuePathMap,
|
|
8249
|
-
wrapperSearchRoots: getWrapperSearchRoots()
|
|
8323
|
+
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
8324
|
+
crossFileKeyRegistry: provisionalKeyRegistry
|
|
8250
8325
|
}
|
|
8251
8326
|
)
|
|
8252
8327
|
]
|
|
@@ -8770,6 +8845,7 @@ ${code}`,
|
|
|
8770
8845
|
function createInternalPlugins(options) {
|
|
8771
8846
|
const {
|
|
8772
8847
|
componentHierarchyMap,
|
|
8848
|
+
crossFileKeyRegistry,
|
|
8773
8849
|
elementMetadata,
|
|
8774
8850
|
vueFilesPathMap,
|
|
8775
8851
|
nativeWrappers,
|
|
@@ -8825,6 +8901,7 @@ function createInternalPlugins(options) {
|
|
|
8825
8901
|
const normalizedBasePagePath = path.posix.normalize(basePageClassPath);
|
|
8826
8902
|
const tsProcessor = createBuildProcessorPlugin({
|
|
8827
8903
|
componentHierarchyMap,
|
|
8904
|
+
crossFileKeyRegistry,
|
|
8828
8905
|
vueFilesPathMap,
|
|
8829
8906
|
getPageDirs,
|
|
8830
8907
|
getComponentDirs,
|
|
@@ -9050,6 +9127,7 @@ function createVuePluginWithTestIds(options) {
|
|
|
9050
9127
|
elementMetadata,
|
|
9051
9128
|
semanticNameMap,
|
|
9052
9129
|
componentHierarchyMap,
|
|
9130
|
+
crossFileKeyRegistry,
|
|
9053
9131
|
vueFilesPathMap,
|
|
9054
9132
|
excludedComponents,
|
|
9055
9133
|
getViewsDirAbs,
|
|
@@ -9119,7 +9197,8 @@ function createVuePluginWithTestIds(options) {
|
|
|
9119
9197
|
warn: (message) => loggerRef.current.warn(message),
|
|
9120
9198
|
vueFilesPathMap,
|
|
9121
9199
|
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
9122
|
-
annotatorMetadata
|
|
9200
|
+
annotatorMetadata,
|
|
9201
|
+
crossFileKeyRegistry
|
|
9123
9202
|
}
|
|
9124
9203
|
)
|
|
9125
9204
|
);
|
|
@@ -9175,7 +9254,8 @@ function createVuePluginWithTestIds(options) {
|
|
|
9175
9254
|
warn: (message) => loggerRef.current.warn(message),
|
|
9176
9255
|
vueFilesPathMap,
|
|
9177
9256
|
wrapperSearchRoots: getWrapperSearchRoots(),
|
|
9178
|
-
annotatorMetadata
|
|
9257
|
+
annotatorMetadata,
|
|
9258
|
+
crossFileKeyRegistry
|
|
9179
9259
|
}
|
|
9180
9260
|
);
|
|
9181
9261
|
perFileTransform.set(componentName, transform);
|
|
@@ -9419,6 +9499,7 @@ function getSharedGeneratorState(key) {
|
|
|
9419
9499
|
elementMetadata: /* @__PURE__ */ new Map(),
|
|
9420
9500
|
semanticNameMap: /* @__PURE__ */ new Map(),
|
|
9421
9501
|
componentHierarchyMap: /* @__PURE__ */ new Map(),
|
|
9502
|
+
crossFileKeyRegistry: /* @__PURE__ */ new Map(),
|
|
9422
9503
|
vueFilesPathMap: /* @__PURE__ */ new Map()
|
|
9423
9504
|
};
|
|
9424
9505
|
sharedGeneratorStateRegistry.set(key, state);
|
|
@@ -9633,7 +9714,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9633
9714
|
};
|
|
9634
9715
|
const getViewsDirAbs = () => resolveFromProjectRoot(projectRootRef.current, getViewsDir());
|
|
9635
9716
|
const getWrapperSearchRootsAbs = () => getWrapperSearchRoots().map((root) => resolveFromProjectRoot(projectRootRef.current, root));
|
|
9636
|
-
const { elementMetadata, semanticNameMap, componentHierarchyMap, vueFilesPathMap } = sharedState;
|
|
9717
|
+
const { elementMetadata, semanticNameMap, componentHierarchyMap, crossFileKeyRegistry, vueFilesPathMap } = sharedState;
|
|
9637
9718
|
const { metadataCollectorPlugin, internalVuePlugin, templateCompilerOptions } = createVuePluginWithTestIds({
|
|
9638
9719
|
vueOptions,
|
|
9639
9720
|
existingIdBehavior: resolvedGenerationOptions.existingIdBehavior,
|
|
@@ -9643,6 +9724,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9643
9724
|
elementMetadata,
|
|
9644
9725
|
semanticNameMap,
|
|
9645
9726
|
componentHierarchyMap,
|
|
9727
|
+
crossFileKeyRegistry,
|
|
9646
9728
|
vueFilesPathMap,
|
|
9647
9729
|
excludedComponents,
|
|
9648
9730
|
getViewsDirAbs,
|
|
@@ -9660,6 +9742,7 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
9660
9742
|
templateCompilerOptionsForResolvedPlugin = templateCompilerOptions;
|
|
9661
9743
|
const internalPlugins = createInternalPlugins({
|
|
9662
9744
|
componentHierarchyMap,
|
|
9745
|
+
crossFileKeyRegistry,
|
|
9663
9746
|
elementMetadata,
|
|
9664
9747
|
vueFilesPathMap,
|
|
9665
9748
|
nativeWrappers,
|