@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 CHANGED
@@ -1,70 +1,73 @@
1
- I'll investigate the actual repository state to understand the full scope of changes between v1.0.76
2
- and HEAD.
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 check the tag timing and PR merge dates to understand which PRs are actually new in this
5
- release.
4
+ Let me verify the v1.0.77 tag position relative to PR #36's merge.
6
5
 
7
- Now I understand - v1.0.76 was tagged at 2026-07-28T17:02:36-05:00 (start of window) and HEAD is at
8
- 2026-07-29T07:09:25-05:00 (end of window). Let me verify which PRs were actually merged in this
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 verify the merge times of key PRs to confirm which are actually in this release window.
9
+ Let me check the plugin wiring changes to fully understand the feature.
12
10
 
13
- Now I have clear evidence. Only PR #36 is new in this release:
11
+ I now have everything needed. Verification summary:
14
12
 
15
- - #36 (e5b00f4): 2026-07-29T07:09:25-05:00 = HEAD (end of window)
16
- - #35 (28e58a2): 2026-07-28T17:02:36-05:00 = v1.0.76 (start of window)
17
- - #34 and earlier: all before the window start
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
- Let me examine the actual diff to write accurate release notes.
18
+ -----------------------------------------------------------------------------------------------
20
19
 
21
- Now I have a complete understanding. Let me also check the PR #36 description for additional
22
- context.
20
+ Highlights
23
21
 
24
- I now have all the information needed. The git evidence is conclusive:
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
- - v1.0.76 was tagged at commit #35 (2026-07-28T17:02:36-05:00)
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
- Here are the release notes:
34
+ Cross-file key registry
32
35
 
33
- Highlights
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
- - Slot-scope key detection now traverses v-if wrappers — scoped-slot data objects wrapped in
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
- Changes
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
- Transform
49
+ Utilities
43
50
 
44
- - Preserve element-to-element hierarchy through non-element wrappers — when an element's immediate
45
- parent is a non-element node (IF_BRANCH, FOR, IF), the transform now falls back to
46
- context.grandParent to maintain the correct parent chain in the hierarchy map (transform.ts).
47
- - This ensures slot-scope and v-for key detection can walk past v-if/v-for wrappers to find the
48
- enclosing <template> or v-for element, producing stable keyed test IDs such as
49
- `MyComp-${maintenanceItem.key ?? ...}-MoveToTop-button`.
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 regression test verifying stable keyed test IDs for scoped-slot data objects through v-if
54
- wrappers.
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
- - ]8;id=md-1g29ijb;https://github.com/immense/vue-pom-generator/pull/36#36 — fix: preserve slot-scope key detection through v-if wrappers]8;;]8;; (@dkattan)]8;;
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
- Two new unit tests were added to tests/transform.test.ts covering scoped-slot key detection through
69
- v-if wrappers and explicit key prop destructuring. No existing tests were modified.
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
- const slotScopeExpression = findTemplateSlotScopeExpression(parent);
1708
- if (slotScopeExpression) {
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
- return getContainedInSlotDataKeyInfo(element, hierarchyMap);
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,