@immense/vue-pom-generator 1.0.88 → 1.0.89
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 +41 -39
- package/class-generation/index.ts +1 -6
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/index.cjs +2 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +2 -54
- package/dist/index.mjs.map +1 -1
- package/dist/manifest-generator.d.ts.map +1 -1
- package/dist/utils.d.ts +0 -11
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -3603,54 +3603,6 @@ function buildPomGeneratedPropertyName(pom) {
|
|
|
3603
3603
|
function buildPomGeneratedActionName(pom) {
|
|
3604
3604
|
return requireStructuredPomName(pom.generatedActionName, "generatedActionName", pom);
|
|
3605
3605
|
}
|
|
3606
|
-
const STANDALONE_WRAPPER_FALLBACK_ROLES = /* @__PURE__ */ new Set([
|
|
3607
|
-
"button",
|
|
3608
|
-
"input",
|
|
3609
|
-
"select",
|
|
3610
|
-
"vselect",
|
|
3611
|
-
"checkbox",
|
|
3612
|
-
"toggle",
|
|
3613
|
-
"radio",
|
|
3614
|
-
"link",
|
|
3615
|
-
"tab"
|
|
3616
|
-
]);
|
|
3617
|
-
function stripTrailingAsciiDigits(value) {
|
|
3618
|
-
let end = value.length;
|
|
3619
|
-
while (end > 0 && isAsciiDigitCode(value.charCodeAt(end - 1))) {
|
|
3620
|
-
end -= 1;
|
|
3621
|
-
}
|
|
3622
|
-
return value.slice(0, end);
|
|
3623
|
-
}
|
|
3624
|
-
function matchesStandaloneWrapperFallbackMethodName(methodName, componentClassName) {
|
|
3625
|
-
let normalizedMethodName = methodName;
|
|
3626
|
-
if (normalizedMethodName.endsWith("ByKey")) {
|
|
3627
|
-
normalizedMethodName = normalizedMethodName.slice(0, -"ByKey".length);
|
|
3628
|
-
}
|
|
3629
|
-
normalizedMethodName = stripTrailingAsciiDigits(normalizedMethodName);
|
|
3630
|
-
return normalizedMethodName === componentClassName;
|
|
3631
|
-
}
|
|
3632
|
-
function shouldSuppressStandaloneWrapperFallbackSurface(componentName, dependencies) {
|
|
3633
|
-
if (dependencies.isView || (dependencies.pomExtraMethods?.length ?? 0) > 0) {
|
|
3634
|
-
return false;
|
|
3635
|
-
}
|
|
3636
|
-
const entries = Array.from(dependencies.dataTestIdSet ?? []);
|
|
3637
|
-
if (!entries.length) {
|
|
3638
|
-
return false;
|
|
3639
|
-
}
|
|
3640
|
-
const primaryEntries = entries.filter((entry) => {
|
|
3641
|
-
return !!entry.pom && entry.pom.emitPrimary !== false;
|
|
3642
|
-
});
|
|
3643
|
-
if (!primaryEntries.length || primaryEntries.length !== entries.length) {
|
|
3644
|
-
return false;
|
|
3645
|
-
}
|
|
3646
|
-
const componentClassName = toPascalCase(componentName.endsWith(".vue") ? componentName.slice(0, -4) : componentName);
|
|
3647
|
-
if (!componentClassName) {
|
|
3648
|
-
return false;
|
|
3649
|
-
}
|
|
3650
|
-
return primaryEntries.every(({ pom }) => {
|
|
3651
|
-
return STANDALONE_WRAPPER_FALLBACK_ROLES.has(pom.nativeRole) && matchesStandaloneWrapperFallbackMethodName(pom.methodName, componentClassName);
|
|
3652
|
-
});
|
|
3653
|
-
}
|
|
3654
3606
|
function safeRealpath(value) {
|
|
3655
3607
|
try {
|
|
3656
3608
|
if (fs.existsSync(value)) {
|
|
@@ -5114,11 +5066,7 @@ async function generateFiles(componentHierarchyMap, vueFilesPathMap, basePageCla
|
|
|
5114
5066
|
componentDirs,
|
|
5115
5067
|
layoutDirs
|
|
5116
5068
|
}) : void 0);
|
|
5117
|
-
const emittableComponentHierarchyMap =
|
|
5118
|
-
Array.from(componentHierarchyMap.entries()).filter(([componentName, dependencies]) => {
|
|
5119
|
-
return !shouldSuppressStandaloneWrapperFallbackSurface(componentName, dependencies);
|
|
5120
|
-
})
|
|
5121
|
-
);
|
|
5069
|
+
const emittableComponentHierarchyMap = componentHierarchyMap;
|
|
5122
5070
|
const generatedFilePaths = [];
|
|
5123
5071
|
const writeGeneratedFile = (file) => {
|
|
5124
5072
|
const resolvedFilePath = path.resolve(file.filePath);
|
|
@@ -8888,7 +8836,7 @@ function getManifestEntry(componentName, entry, componentMetadata, extraMethods)
|
|
|
8888
8836
|
};
|
|
8889
8837
|
}
|
|
8890
8838
|
function buildPomManifest(componentHierarchyMap, elementMetadata) {
|
|
8891
|
-
const manifestEntries = Array.from(componentHierarchyMap.entries()).
|
|
8839
|
+
const manifestEntries = Array.from(componentHierarchyMap.entries()).sort((a, b) => a[0].localeCompare(b[0])).map(([componentName, dependencies]) => {
|
|
8892
8840
|
const entries = Array.from(dependencies.dataTestIdSet).sort((a, b) => a.selectorValue.formatted.localeCompare(b.selectorValue.formatted)).map((entry) => getManifestEntry(componentName, entry, elementMetadata.get(componentName), dependencies.pomExtraMethods ?? []));
|
|
8893
8841
|
if (!entries.length) {
|
|
8894
8842
|
return null;
|