@immense/vue-pom-generator 1.0.115 → 1.0.116
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 +18 -32
- package/dist/index.cjs +5 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +6 -15
- package/dist/index.mjs.map +1 -1
- package/dist/transform.d.ts.map +1 -1
- package/dist/wrapper-contract.d.ts +12 -6
- package/dist/wrapper-contract.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import { parse as parse$2, NodeTypes as NodeTypes$1 } from "@vue/compiler-dom";
|
|
|
10
10
|
import { parse as parse$1, compileScript } from "@vue/compiler-sfc";
|
|
11
11
|
import { Project, QuoteKind, NewLineKind, IndentationText, CodeBlockWriter, StructureKind, VariableDeclarationKind } from "ts-morph";
|
|
12
12
|
import { camelize } from "@vue/shared";
|
|
13
|
-
import { isIdentifier, isObjectPattern, isRestElement, isObjectProperty, isArrayExpression, isStringLiteral, isTemplateLiteral, isArrowFunctionExpression, isExpressionStatement, isAssignmentPattern, isMemberExpression, isOptionalMemberExpression, isCallExpression, isOptionalCallExpression, isAssignmentExpression, isObjectExpression, isFile, isBlockStatement, isLogicalExpression, isConditionalExpression, isSequenceExpression, isProgram, isArrayPattern, VISITOR_KEYS, isBooleanLiteral, isNumericLiteral, isNullLiteral,
|
|
13
|
+
import { isIdentifier, isObjectPattern, isRestElement, isObjectProperty, isArrayExpression, isStringLiteral, isTemplateLiteral, isArrowFunctionExpression, isExpressionStatement, isAssignmentPattern, isMemberExpression, isOptionalMemberExpression, isCallExpression, isOptionalCallExpression, isAssignmentExpression, isObjectExpression, isFile, isBlockStatement, isLogicalExpression, isConditionalExpression, isSequenceExpression, isProgram, isArrayPattern, VISITOR_KEYS, isBooleanLiteral, isNumericLiteral, isNullLiteral, isExpression, isTSAsExpression, isTSTypeAssertion, isTSNonNullExpression, isImportDeclaration, isImportSpecifier, isExportDefaultDeclaration, isVariableDeclaration, isFunctionDeclaration, isFunctionExpression, isReturnStatement, isForInStatement, isIfStatement } from "@babel/types";
|
|
14
14
|
import { createHash, randomUUID } from "node:crypto";
|
|
15
15
|
import { POM_ROUTER_GLOBAL_NAME } from "./router.mjs";
|
|
16
16
|
import { performance } from "node:perf_hooks";
|
|
@@ -8996,9 +8996,8 @@ function analyzeWrapperContractFromSfc(options) {
|
|
|
8996
8996
|
role: null,
|
|
8997
8997
|
targetRoles: [],
|
|
8998
8998
|
forwardedTestIdTargetOffsets: /* @__PURE__ */ new Set(),
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
explicitlyForwardedTestIdTargetSfcOffsets: /* @__PURE__ */ new Set()
|
|
8999
|
+
attrsObjectNames: /* @__PURE__ */ new Set(),
|
|
9000
|
+
attrsFunctionNames: /* @__PURE__ */ new Set()
|
|
9002
9001
|
};
|
|
9003
9002
|
}
|
|
9004
9003
|
const scriptMetadata = analyzeScriptForwardingMetadata(
|
|
@@ -9007,7 +9006,6 @@ function analyzeWrapperContractFromSfc(options) {
|
|
|
9007
9006
|
);
|
|
9008
9007
|
const ast = parse$2(template, { comments: false });
|
|
9009
9008
|
const targets = /* @__PURE__ */ new Map();
|
|
9010
|
-
const explicitTargetOffsets = /* @__PURE__ */ new Set();
|
|
9011
9009
|
if (scriptMetadata.inheritAttrs) {
|
|
9012
9010
|
for (const element of getRenderedRootElements(ast)) {
|
|
9013
9011
|
targets.set(element.loc.start.offset, element);
|
|
@@ -9016,7 +9014,6 @@ function analyzeWrapperContractFromSfc(options) {
|
|
|
9016
9014
|
walkTemplate(ast, (element) => {
|
|
9017
9015
|
if (elementExplicitlyForwardsTestId(element, options.testIdAttribute, scriptMetadata)) {
|
|
9018
9016
|
targets.set(element.loc.start.offset, element);
|
|
9019
|
-
explicitTargetOffsets.add(element.loc.start.offset);
|
|
9020
9017
|
}
|
|
9021
9018
|
});
|
|
9022
9019
|
const targetRoles = [...targets.values()].map((element) => {
|
|
@@ -9031,17 +9028,12 @@ function analyzeWrapperContractFromSfc(options) {
|
|
|
9031
9028
|
});
|
|
9032
9029
|
const uniqueRoles = new Set(targetRoles);
|
|
9033
9030
|
const role = uniqueRoles.size === 1 && !uniqueRoles.has(null) ? targetRoles[0] ?? null : null;
|
|
9034
|
-
const templateContentStartOffset = descriptor.template?.loc.start.offset ?? 0;
|
|
9035
|
-
const toSfcOffsets = (offsets) => new Set(
|
|
9036
|
-
[...offsets].map((offset2) => offset2 + templateContentStartOffset)
|
|
9037
|
-
);
|
|
9038
9031
|
return {
|
|
9039
9032
|
role,
|
|
9040
9033
|
targetRoles,
|
|
9041
9034
|
forwardedTestIdTargetOffsets: new Set(targets.keys()),
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
explicitlyForwardedTestIdTargetSfcOffsets: toSfcOffsets(explicitTargetOffsets)
|
|
9035
|
+
attrsObjectNames: scriptMetadata.attrsObjectNames,
|
|
9036
|
+
attrsFunctionNames: scriptMetadata.attrsFunctionNames
|
|
9045
9037
|
};
|
|
9046
9038
|
}
|
|
9047
9039
|
function resolveWrapperContractForTag(options) {
|
|
@@ -9710,8 +9702,7 @@ function createTestIdTransform(componentName, componentHierarchyMap, nativeWrapp
|
|
|
9710
9702
|
}
|
|
9711
9703
|
}
|
|
9712
9704
|
const ownWrapperContract = getWrapperContract(componentName);
|
|
9713
|
-
const
|
|
9714
|
-
const isExplicitFallthroughTarget = ownWrapperContract?.explicitlyForwardedTestIdTargetOffsets.has(elementStartOffset) || ownWrapperContract?.explicitlyForwardedTestIdTargetSfcOffsets.has(elementStartOffset);
|
|
9705
|
+
const isExplicitFallthroughTarget = !!ownWrapperContract && elementExplicitlyForwardsTestId(element, testIdAttribute, ownWrapperContract);
|
|
9715
9706
|
if (!dependencies.isView && isExplicitFallthroughTarget) {
|
|
9716
9707
|
return;
|
|
9717
9708
|
}
|