@immense/vue-pom-generator 1.0.103 → 1.0.104

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/dist/index.mjs CHANGED
@@ -6905,12 +6905,16 @@ Fix: give direct and slot-projected instances distinct accessible names or seman
6905
6905
  const members = [];
6906
6906
  if (isView && (componentRefsForInstances.size > 0 || attachmentsForThisClass.length > 0 || widgetInstances.length > 0)) {
6907
6907
  members.push(...getComponentInstances(directComponentInstances, projectedComponentInstances, attachmentsForThisClass, widgetInstances));
6908
- members.push(getConstructor(directComponentInstances, attachmentsForThisClass, widgetInstances, { testIdAttribute }));
6909
6908
  }
6910
6909
  if (!isView && (componentRefsForInstances.size > 0 || attachmentsForThisClass.length > 0)) {
6911
6910
  members.push(...getComponentInstances(directComponentInstances, projectedComponentInstances, attachmentsForThisClass));
6912
- members.push(getConstructor(directComponentInstances, attachmentsForThisClass, [], { testIdAttribute }));
6913
6911
  }
6912
+ members.push(getConstructor(
6913
+ directComponentInstances,
6914
+ attachmentsForThisClass,
6915
+ isView ? widgetInstances : [],
6916
+ { testIdAttribute }
6917
+ ));
6914
6918
  members.push(
6915
6919
  ...getAttachmentPassthroughMethods(componentName, dependencies, attachmentsForThisClass, reservedAttachmentPassthroughNames)
6916
6920
  );
@@ -6955,7 +6959,6 @@ function generateViewObjectModelContent(componentName, dependencies, componentHi
6955
6959
  const basePageImport = path.relative(fromAbs, toAbs).replace(/\\/g, "/");
6956
6960
  const basePageImportNoExt = stripExtension(basePageImport).replace(/\\/g, "/");
6957
6961
  const basePageImportSpecifier = basePageImportNoExt.startsWith(".") ? basePageImportNoExt : `./${basePageImportNoExt}`;
6958
- const needsPlaywrightPageImport = prepared.isView || prepared.attachmentsForThisClass.length > 0 || prepared.componentRefsForInstances.size > 0 || prepared.widgetInstances.length > 0;
6959
6962
  const customPomImportSpecifiersByClass = options.customPomImportSpecifiersByClass ?? {};
6960
6963
  const customImports = Array.from(
6961
6964
  /* @__PURE__ */ new Set([
@@ -7007,16 +7010,14 @@ function generateViewObjectModelContent(componentName, dependencies, componentHi
7007
7010
  const prefixText = `${buildFilePrefix({ eslintDisableSortImports: true })}${doc}
7008
7011
  `;
7009
7012
  return renderSourceFile(`${prepared.className}.ts`, (sourceFile) => {
7010
- if (needsPlaywrightPageImport) {
7011
- addNamedImport(sourceFile, {
7012
- moduleSpecifier: "@playwright/test",
7013
- isTypeOnly: true,
7014
- namedImports: [
7015
- { name: "Locator", alias: "PwLocator" },
7016
- { name: "Page", alias: "PwPage" }
7017
- ]
7018
- });
7019
- }
7013
+ addNamedImport(sourceFile, {
7014
+ moduleSpecifier: "@playwright/test",
7015
+ isTypeOnly: true,
7016
+ namedImports: [
7017
+ { name: "Locator", alias: "PwLocator" },
7018
+ { name: "Page", alias: "PwPage" }
7019
+ ]
7020
+ });
7020
7021
  addNamedImport(sourceFile, {
7021
7022
  moduleSpecifier: basePageImportSpecifier,
7022
7023
  namedImports: ["BasePage", "Fluent"]