@immense/vue-pom-generator 1.0.82 → 1.0.84
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 +54 -54
- package/class-generation/playwright-types.ts +120 -2
- package/dist/class-generation/playwright-types.d.ts +256 -2
- package/dist/class-generation/playwright-types.d.ts.map +1 -1
- package/dist/compiler-metadata-utils.d.ts.map +1 -1
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/index.cjs +37 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +37 -41
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/runtime/annotator/client.d.ts +13 -0
- package/dist/plugin/runtime/annotator/client.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/format.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/plugin.d.ts +16 -0
- package/dist/plugin/runtime/annotator/plugin.d.ts.map +1 -1
- package/dist/plugin/runtime/annotator/text-utils.d.ts +15 -0
- package/dist/plugin/runtime/annotator/text-utils.d.ts.map +1 -0
- package/dist/plugin/runtime/annotator/vue-detector.d.ts +49 -0
- package/dist/plugin/runtime/annotator/vue-detector.d.ts.map +1 -1
- package/dist/pom-discoverability.d.ts.map +1 -1
- package/dist/pom-patterns.d.ts +28 -4
- package/dist/pom-patterns.d.ts.map +1 -1
- package/dist/tests/annotator-runtime-helpers.test.d.ts +2 -0
- package/dist/tests/annotator-runtime-helpers.test.d.ts.map +1 -0
- package/dist/tests/broad/accessibility-audit-ts.test.d.ts +2 -0
- package/dist/tests/broad/accessibility-audit-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/class-generation-base-page-ts.test.d.ts +2 -0
- package/dist/tests/broad/class-generation-base-page-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/compiler-metadata-utils-ts.test.d.ts +2 -0
- package/dist/tests/broad/compiler-metadata-utils-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/helpers/fake-runtime.d.ts +162 -0
- package/dist/tests/broad/helpers/fake-runtime.d.ts.map +1 -0
- package/dist/tests/broad/manifest-generator-ts.test.d.ts +2 -0
- package/dist/tests/broad/manifest-generator-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/metadata-collector-ts.test.d.ts +2 -0
- package/dist/tests/broad/metadata-collector-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/plugin-logger-ts.test.d.ts +2 -0
- package/dist/tests/broad/plugin-logger-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/plugin-resolved-generation-options-ts.test.d.ts +2 -0
- package/dist/tests/broad/plugin-resolved-generation-options-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/plugin-runtime-annotator-format-ts.test.d.ts +2 -0
- package/dist/tests/broad/plugin-runtime-annotator-format-ts.test.d.ts.map +1 -0
- package/dist/tests/broad/typescript-codegen-ts.test.d.ts +2 -0
- package/dist/tests/broad/typescript-codegen-ts.test.d.ts.map +1 -0
- package/dist/tests/helpers/typed-mocks.d.ts +58 -0
- package/dist/tests/helpers/typed-mocks.d.ts.map +1 -0
- package/dist/transform.d.ts +36 -5
- package/dist/transform.d.ts.map +1 -1
- package/dist/utils.d.ts +261 -2
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
- package/plugin/runtime/annotator/client.ts +24 -12
- package/plugin/runtime/annotator/format.ts +5 -7
- package/plugin/runtime/annotator/plugin.ts +24 -6
- package/plugin/runtime/annotator/text-utils.ts +23 -0
- package/plugin/runtime/annotator/vue-detector.ts +56 -0
package/dist/utils.d.ts
CHANGED
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import type { AttributeNode, CompoundExpressionNode, DirectiveNode, ElementNode, SimpleExpressionNode, TransformContext } from "@vue/compiler-core";
|
|
2
|
-
import type { TemplateLiteral } from "@babel/types";
|
|
2
|
+
import type { MemberExpression, Node as BabelNode, OptionalMemberExpression, TemplateLiteral } from "@babel/types";
|
|
3
3
|
import { type PomStringPattern } from "./pom-patterns";
|
|
4
4
|
import { type PomMethodSignature, type PomParameterSpec } from "./pom-params";
|
|
5
5
|
export { isSimpleExpressionNode } from "./compiler/ast-guards";
|
|
6
6
|
export type { RouterIntrospectionResult } from "./router-introspection";
|
|
7
7
|
export { analyzeToDirectiveTarget, getRouteNameKeyFromToDirective, setResolveToComponentNameFn, setRouteNameToComponentNameMap, tryResolveToDirectiveTargetComponentName, } from "./routing/to-directive";
|
|
8
8
|
export type { RouteDirectiveTargetAnalysis } from "./routing/to-directive";
|
|
9
|
+
declare function getDataTestIdFromGroupOption(text: string): string;
|
|
9
10
|
export declare function upperFirst(value: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Collapse runs of whitespace in `value` to single spaces and trim both ends.
|
|
13
|
+
*
|
|
14
|
+
* Used to normalize rendered UI/display text — e.g. multi-line Vue text nodes
|
|
15
|
+
* or joined text content — into a single readable line. This is display-text
|
|
16
|
+
* normalization, not source-code parsing, so a whitespace regex is the
|
|
17
|
+
* appropriate tool. Callers that need an `undefined` for empty input should
|
|
18
|
+
* fall back themselves (e.g. `collapseWhitespace(s) || undefined`).
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* collapseWhitespace(" foo bar\n\tbaz ") // "foo bar baz"
|
|
22
|
+
* collapseWhitespace("\n\n") // ""
|
|
23
|
+
*/
|
|
24
|
+
export declare function collapseWhitespace(value: string): string;
|
|
10
25
|
export declare function isAsciiUppercaseLetterCode(code: number): boolean;
|
|
11
26
|
export declare function isAsciiLowercaseLetterCode(code: number): boolean;
|
|
12
27
|
export declare function isAsciiLetterCode(code: number): boolean;
|
|
@@ -38,6 +53,7 @@ export type AttributeValue = {
|
|
|
38
53
|
};
|
|
39
54
|
type VueExpressionNode = SimpleExpressionNode | CompoundExpressionNode;
|
|
40
55
|
type VueExpressionSourceView = "content" | "loc" | "compiled";
|
|
56
|
+
type BabelParserPluginName = "typescript" | "jsx";
|
|
41
57
|
export interface ResolvedKeyInfo {
|
|
42
58
|
selectorFragment: string;
|
|
43
59
|
runtimeFragment: string;
|
|
@@ -56,6 +72,18 @@ export declare function getAttributeValueText(value: AttributeValue): string;
|
|
|
56
72
|
* - `compiled`: compiler-rewritten source from `stringifyExpression()`
|
|
57
73
|
*/
|
|
58
74
|
export declare function getVueExpressionSource(expression: VueExpressionNode | null | undefined, ...preferredViews: VueExpressionSourceView[]): string;
|
|
75
|
+
declare function tryGetExistingVueExpressionAst(expression: VueExpressionNode | null | undefined): BabelNode | null;
|
|
76
|
+
declare function tryParseBabelExpressionFromSource(source: string, plugins: BabelParserPluginName[]): BabelNode | null;
|
|
77
|
+
declare function tryGetVueExpressionAst(expression: VueExpressionNode | null | undefined, options?: {
|
|
78
|
+
preferredViews?: VueExpressionSourceView[];
|
|
79
|
+
plugins?: BabelParserPluginName[];
|
|
80
|
+
preferExistingAst?: boolean;
|
|
81
|
+
}): BabelNode | null;
|
|
82
|
+
declare function tryGetDirectiveBabelAst(directive: DirectiveNode, options?: {
|
|
83
|
+
preferredViews?: VueExpressionSourceView[];
|
|
84
|
+
plugins?: BabelParserPluginName[];
|
|
85
|
+
preferExistingAst?: boolean;
|
|
86
|
+
}): BabelNode | null;
|
|
59
87
|
/**
|
|
60
88
|
* Converts a string to PascalCase.
|
|
61
89
|
*
|
|
@@ -63,6 +91,22 @@ export declare function getVueExpressionSource(expression: VueExpressionNode | n
|
|
|
63
91
|
* and common template remnants.
|
|
64
92
|
*/
|
|
65
93
|
export declare function toPascalCase(str: string): string;
|
|
94
|
+
/**
|
|
95
|
+
* Finds a regular attribute by key name (non-directive)
|
|
96
|
+
* Equivalent to findAttributeByKey in utils
|
|
97
|
+
*/
|
|
98
|
+
declare function findAttributeByKey(node: ElementNode, keyName: string): AttributeNode | undefined;
|
|
99
|
+
/**
|
|
100
|
+
* Finds a directive by name and optional argument
|
|
101
|
+
* e.g., findDirectiveByName(element, "bind", "key") finds :key
|
|
102
|
+
*/
|
|
103
|
+
declare function findDirectiveByName(node: ElementNode, directiveName: string, argumentName?: string): DirectiveNode | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Checks if a prop/attribute is a @click directive
|
|
106
|
+
*
|
|
107
|
+
* @internal
|
|
108
|
+
*/
|
|
109
|
+
declare function isClickDirective(prop: AttributeNode | DirectiveNode): boolean;
|
|
66
110
|
/**
|
|
67
111
|
* Returns the @click / v-on:click directive if present.
|
|
68
112
|
*
|
|
@@ -77,6 +121,17 @@ export declare function tryGetClickDirective(node: ElementNode): DirectiveNode |
|
|
|
77
121
|
*/
|
|
78
122
|
export declare function nodeHasClickDirective(node: ElementNode): boolean;
|
|
79
123
|
export declare function findTemplateSlotScopeExpression(node: ElementNode): VueExpressionNode | null;
|
|
124
|
+
/**
|
|
125
|
+
* Checks if a node is a <template> element with slot scope data
|
|
126
|
+
*
|
|
127
|
+
* This detects template elements with v-slot directives that have parameters,
|
|
128
|
+
* such as <template #item="{ data }"> or <template v-slot="item">
|
|
129
|
+
*
|
|
130
|
+
* Returns true if the template has a slot scope with at least one parameter
|
|
131
|
+
*
|
|
132
|
+
* @internal
|
|
133
|
+
*/
|
|
134
|
+
declare function isTemplateWithData(node: ElementNode): boolean;
|
|
80
135
|
/**
|
|
81
136
|
* Returns true when the raw slot-scope content parses as a single identifier expression.
|
|
82
137
|
*
|
|
@@ -85,12 +140,21 @@ export declare function findTemplateSlotScopeExpression(node: ElementNode): VueE
|
|
|
85
140
|
*/
|
|
86
141
|
declare function isSimpleScopeIdentifier(value: string): boolean;
|
|
87
142
|
export declare function buildSlotScopeFallbackKeyExpression(identifier: string): string;
|
|
143
|
+
declare function tryGetBindingIdentifierName(node: BabelNode | null | undefined): string | null;
|
|
144
|
+
type SlotScopeKeyCandidate = {
|
|
145
|
+
priority: number;
|
|
146
|
+
expression: string;
|
|
147
|
+
};
|
|
88
148
|
/**
|
|
89
149
|
* Flattens a nullish-coalescing chain into its top-level operand source strings.
|
|
90
150
|
*
|
|
91
151
|
* For example, `foo ?? bar ?? baz` becomes `["foo", "bar", "baz"]`.
|
|
92
152
|
*/
|
|
93
153
|
declare function splitNullishCoalescingExpression(expr: string): string[];
|
|
154
|
+
declare function getSlotScopeObjectPropertyKeyName(node: BabelNode): string | null;
|
|
155
|
+
declare function tryGetSlotScopeKeyCandidate(node: BabelNode | null | undefined): SlotScopeKeyCandidate | null;
|
|
156
|
+
declare function tryGetTemplateSlotScopeBindingNode(expression: VueExpressionNode): BabelNode | null;
|
|
157
|
+
declare function toResolvedTemplateFragment(source: string): InterpolatedTemplateFragment | null;
|
|
94
158
|
export declare function toResolvedKeyInfo(selectorSource: string | null, runtimeSource?: string | null): ResolvedKeyInfo | null;
|
|
95
159
|
export declare function tryGetTemplateSlotScopeKeyInfo(expression: VueExpressionNode): ResolvedKeyInfo | null;
|
|
96
160
|
/**
|
|
@@ -100,6 +164,21 @@ export declare function tryGetTemplateSlotScopeKeyInfo(expression: VueExpression
|
|
|
100
164
|
* `item` → `["item"]`
|
|
101
165
|
*/
|
|
102
166
|
export declare function tryExtractSlotScopeVariableNames(expression: VueExpressionNode): string[];
|
|
167
|
+
/**
|
|
168
|
+
* Unwraps a parsed click-handler AST down to a bare identifier name, but only
|
|
169
|
+
* when the handler is a callback *reference* — i.e. the expression is (or
|
|
170
|
+
* unwraps to) a plain identifier. Method calls (`remove(item)`), member access
|
|
171
|
+
* (`data.action()`), assignments, and conditionals are NOT bare callbacks, so
|
|
172
|
+
* they return `null` and keep their existing (keyed) handling.
|
|
173
|
+
*
|
|
174
|
+
* Recognized wrappers that still denote "invoke this callback reference":
|
|
175
|
+
* - `withModifiers(fn, [...])` / `_withModifiers(fn, [...])` (Vue modifier wrapper)
|
|
176
|
+
* - `() => fn` (arrow with an expression body)
|
|
177
|
+
* - statement/expression-statement envelopes
|
|
178
|
+
*
|
|
179
|
+
* @internal
|
|
180
|
+
*/
|
|
181
|
+
declare function unwrapToBareCallbackIdentifier(node: BabelNode | null | undefined): string | null;
|
|
103
182
|
/**
|
|
104
183
|
* Returns the name of an element's `@click` handler when that handler is a bare
|
|
105
184
|
* identifier callback reference (optionally wrapped in `withModifiers(...)`, an
|
|
@@ -132,6 +211,88 @@ export declare function isSlotScopeCallbackClickHandler(node: ElementNode, hiera
|
|
|
132
211
|
* @internal
|
|
133
212
|
*/
|
|
134
213
|
export declare function nodeHasToDirective(node: ElementNode): DirectiveNode | undefined;
|
|
214
|
+
/**
|
|
215
|
+
* Checks if node has a v-for directive
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
*/
|
|
219
|
+
declare function nodeHasForDirective(node: ElementNode): boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Gets the :key directive from a node
|
|
222
|
+
*
|
|
223
|
+
* Returns the directive if found, null otherwise
|
|
224
|
+
*
|
|
225
|
+
* @internal
|
|
226
|
+
*/
|
|
227
|
+
declare function getKeyDirective(node: ElementNode): DirectiveNode | null;
|
|
228
|
+
/**
|
|
229
|
+
* Attempts to unwrap a full template-literal expression source into its body text.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* tryUnwrapTemplateLiteralSource("`row-${item.id}`")
|
|
233
|
+
* // => { template: "row-${item.id}", expressionCount: 1 }
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* tryUnwrapTemplateLiteralSource("item.id")
|
|
237
|
+
* // => null
|
|
238
|
+
*/
|
|
239
|
+
declare function tryUnwrapTemplateLiteralSource(source: string): {
|
|
240
|
+
template: string;
|
|
241
|
+
expressionCount: number;
|
|
242
|
+
} | null;
|
|
243
|
+
/**
|
|
244
|
+
* Attempts to unwrap a template-literal expression node into its body text.
|
|
245
|
+
*
|
|
246
|
+
* Accepts the original Vue template-expression node so callers stay on the AST-driven path.
|
|
247
|
+
* Vue commonly represents template-literal bindings as `CompoundExpressionNode`s even when the
|
|
248
|
+
* attached Babel AST is a single `TemplateLiteral`, so this helper intentionally accepts both
|
|
249
|
+
* simple and compound expression nodes.
|
|
250
|
+
*
|
|
251
|
+
* Vue also exposes two different string views of the same binding:
|
|
252
|
+
* - `loc.source` preserves the author-written local scope expression (e.g. `item.id`)
|
|
253
|
+
* - `stringifyExpression()` emits the compiler-rewritten form (often including `_ctx.*`)
|
|
254
|
+
*
|
|
255
|
+
* We still prefer carrying structured AST metadata through the pipeline, but this helper is the
|
|
256
|
+
* narrow bridge where we normalize those compiler-provided string forms before reparsing a template
|
|
257
|
+
* fragment later on. That keeps the rest of the codebase from having to care which compiler view
|
|
258
|
+
* produced the binding in the first place.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* const exp = findDirectiveByName(node, "bind", "key")?.exp as SimpleExpressionNode | CompoundExpressionNode;
|
|
262
|
+
* tryUnwrapTemplateLiteralExpressionSource(exp)
|
|
263
|
+
* // => { template: "row-${item.id}", expressionCount: 1 }
|
|
264
|
+
*
|
|
265
|
+
* @example
|
|
266
|
+
* const exp = findDirectiveByName(node, "bind", "key")?.exp as SimpleExpressionNode | CompoundExpressionNode;
|
|
267
|
+
* tryUnwrapTemplateLiteralExpressionSource(exp)
|
|
268
|
+
* // => null
|
|
269
|
+
*/
|
|
270
|
+
declare function tryUnwrapTemplateLiteralExpressionSource(expression: SimpleExpressionNode | CompoundExpressionNode | null): {
|
|
271
|
+
template: string;
|
|
272
|
+
expressionCount: number;
|
|
273
|
+
} | null;
|
|
274
|
+
/**
|
|
275
|
+
* Parses the inside of a template literal as a `TemplateLiteral` AST node.
|
|
276
|
+
*
|
|
277
|
+
* `parseExpression()` only accepts complete JavaScript expressions, so fragments like
|
|
278
|
+
* `line-${item.id}` need synthetic backticks before they can be parsed.
|
|
279
|
+
*
|
|
280
|
+
* @example
|
|
281
|
+
* tryParseTemplateFragment("line-${item.id}")?.templateLiteral.expressions.length
|
|
282
|
+
* // => 1
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
* tryParseTemplateFragment("plain-text")?.templateLiteral.expressions.length
|
|
286
|
+
* // => 0
|
|
287
|
+
*/
|
|
288
|
+
declare function tryParseTemplateFragment(fragment: string): ParsedTemplateFragment | null;
|
|
289
|
+
declare function getTemplateExpressionSource(parsedTemplate: ParsedTemplateFragment, index: number): string | null;
|
|
290
|
+
declare function getSingleExpressionTemplateFragment(parsedTemplate: ParsedTemplateFragment): {
|
|
291
|
+
prefix: string;
|
|
292
|
+
expressionSource: string;
|
|
293
|
+
suffix: string;
|
|
294
|
+
} | null;
|
|
295
|
+
declare function templateFragmentContainsSingleExpression(container: ParsedTemplateFragment, candidate: ParsedTemplateFragment): boolean;
|
|
135
296
|
/**
|
|
136
297
|
* Returns `true` when a template fragment already contains one or more `${...}` interpolations.
|
|
137
298
|
*
|
|
@@ -183,6 +344,15 @@ export declare function toInterpolatedTemplateFragment(fragment: string | null):
|
|
|
183
344
|
export declare function renderTemplateLiteralExpression(templateValue: Extract<AttributeValue, {
|
|
184
345
|
kind: "template";
|
|
185
346
|
}>): string;
|
|
347
|
+
/**
|
|
348
|
+
* Gets the value placeholder for a :key directive
|
|
349
|
+
*
|
|
350
|
+
* Returns a placeholder string if the element has a :key directive, null otherwise
|
|
351
|
+
* This is used to indicate where a unique value should be interpolated
|
|
352
|
+
*
|
|
353
|
+
* @internal
|
|
354
|
+
*/
|
|
355
|
+
declare function getKeyDirectiveExpression(node: ElementNode): VueExpressionNode | null;
|
|
186
356
|
export declare function getKeyDirectiveInfo(node: ElementNode): ResolvedKeyInfo | null;
|
|
187
357
|
/**
|
|
188
358
|
* Gets both v-model and :model-value directive values in a single pass
|
|
@@ -237,6 +407,7 @@ export declare function getContainedInVForDirectiveKeyInfo(context: TransformCon
|
|
|
237
407
|
* - v-for="item in ['One', 'Two']" => ['One', 'Two']
|
|
238
408
|
*/
|
|
239
409
|
export declare function tryGetContainedInStaticVForSourceLiteralValues(context: TransformContext, _node: ElementNode, _hierarchyMap: HierarchyMap): string[] | null;
|
|
410
|
+
declare function getParent(hierarchyMap: HierarchyMap, node: ElementNode): ElementNode | null;
|
|
240
411
|
/**
|
|
241
412
|
* Analyzes a :handler directive to extract the handler name
|
|
242
413
|
*
|
|
@@ -299,6 +470,23 @@ export declare function getComposedClickHandlerContent(node: ElementNode, _conte
|
|
|
299
470
|
componentName?: string;
|
|
300
471
|
contextFilename?: string;
|
|
301
472
|
}): string;
|
|
473
|
+
declare function tryParseBabelAstFromHandlerSource(source: string): object | null;
|
|
474
|
+
declare function extractEmittedEventNameFromAst(ast: BabelNode): string;
|
|
475
|
+
declare function walkForEmittedEventName(node: object | null): string | null;
|
|
476
|
+
declare function getStableClickHandlerNameFromAst(ast: BabelNode | null): string;
|
|
477
|
+
declare function getStableClickHandlerNameFromExpression(exp: BabelNode | null | undefined): string;
|
|
478
|
+
declare function getClickHandlerNameFromAst(ast: BabelNode | undefined): {
|
|
479
|
+
name: string;
|
|
480
|
+
isAssignment: boolean;
|
|
481
|
+
};
|
|
482
|
+
declare function extractNameFromCallee(callee: BabelNode): string;
|
|
483
|
+
declare function extractMemberPropertyName(member: MemberExpression | OptionalMemberExpression): string;
|
|
484
|
+
declare function getLastIdentifierFromMemberChainBabel(node: BabelNode | null | undefined): string;
|
|
485
|
+
declare function getAssignmentTargetNameFromBabel(node: BabelNode | null | undefined): string;
|
|
486
|
+
declare function getStableAssignmentValueSuffixFromBabel(node: BabelNode | null | undefined): string;
|
|
487
|
+
declare function isCompilerGeneratedReferenceRoot(name: string): boolean;
|
|
488
|
+
declare function tryGetPreservableDynamicReferenceExpression(node: BabelNode | null | false | undefined): string | null;
|
|
489
|
+
declare function normalizeHandlerName(name: string): string;
|
|
302
490
|
export declare function getInnerText(node: ElementNode): string;
|
|
303
491
|
/**
|
|
304
492
|
* Finds an existing test id attribute (static or bound).
|
|
@@ -348,6 +536,10 @@ export interface ResolvedDataTestIdValues {
|
|
|
348
536
|
* Unknown expressions are treated as dynamic/unknown.
|
|
349
537
|
*/
|
|
350
538
|
export declare function tryGetExistingElementDataTestId(node: ElementNode, attributeName?: string): ExistingElementDataTestIdInfo | null;
|
|
539
|
+
declare function isTemplatePlaceholder(part: string): boolean;
|
|
540
|
+
declare function isAllCapsOrDigits(value: string): boolean;
|
|
541
|
+
declare function startsWithDigit(value: string): boolean;
|
|
542
|
+
declare function stripNonIdentifierChars(value: string): string;
|
|
351
543
|
declare function safeMethodNameFromParts(parts: string[]): string;
|
|
352
544
|
/**
|
|
353
545
|
* Replaces any `${...}` interpolation in a template string with the stable POM placeholder `${key}`.
|
|
@@ -356,14 +548,79 @@ declare function safeMethodNameFromParts(parts: string[]): string;
|
|
|
356
548
|
* interpolation expressions; the POM layer just needs to know that a keyed slot exists and where
|
|
357
549
|
* it sits relative to the surrounding literal text.
|
|
358
550
|
*/
|
|
551
|
+
/**
|
|
552
|
+
* Replaces any `${...}` interpolation in a template string with the stable POM placeholder `${key}`,
|
|
553
|
+
* and reports the template variable names carried as metadata.
|
|
554
|
+
*
|
|
555
|
+
* This is only for the generated POM selector shape. Runtime/test-id generation keeps the real
|
|
556
|
+
* interpolation expressions; the POM layer just needs to know that a keyed slot exists and where
|
|
557
|
+
* it sits relative to the surrounding literal text. Every interpolation collapses to the single
|
|
558
|
+
* `${key}` slot, so the variable name is the constant `key` — known at construction, not derived
|
|
559
|
+
* from the emitted string.
|
|
560
|
+
*/
|
|
359
561
|
declare function toPomKeyPattern(templateValue: Extract<AttributeValue, {
|
|
360
562
|
kind: "template";
|
|
361
|
-
}>):
|
|
563
|
+
}>): {
|
|
564
|
+
formatted: string;
|
|
565
|
+
templateVariables: string[];
|
|
566
|
+
};
|
|
362
567
|
export declare const __internal: {
|
|
363
568
|
isSimpleScopeIdentifier: typeof isSimpleScopeIdentifier;
|
|
364
569
|
safeMethodNameFromParts: typeof safeMethodNameFromParts;
|
|
365
570
|
splitNullishCoalescingExpression: typeof splitNullishCoalescingExpression;
|
|
366
571
|
toPomKeyPattern: typeof toPomKeyPattern;
|
|
572
|
+
getDataTestIdFromGroupOption: typeof getDataTestIdFromGroupOption;
|
|
573
|
+
getVueExpressionSource: typeof getVueExpressionSource;
|
|
574
|
+
tryGetExistingVueExpressionAst: typeof tryGetExistingVueExpressionAst;
|
|
575
|
+
tryParseBabelExpressionFromSource: typeof tryParseBabelExpressionFromSource;
|
|
576
|
+
tryGetVueExpressionAst: typeof tryGetVueExpressionAst;
|
|
577
|
+
tryGetDirectiveBabelAst: typeof tryGetDirectiveBabelAst;
|
|
578
|
+
findAttributeByKey: typeof findAttributeByKey;
|
|
579
|
+
findDirectiveByName: typeof findDirectiveByName;
|
|
580
|
+
isClickDirective: typeof isClickDirective;
|
|
581
|
+
findTemplateSlotScopeExpression: typeof findTemplateSlotScopeExpression;
|
|
582
|
+
isTemplateWithData: typeof isTemplateWithData;
|
|
583
|
+
tryGetBindingIdentifierName: typeof tryGetBindingIdentifierName;
|
|
584
|
+
getSlotScopeObjectPropertyKeyName: typeof getSlotScopeObjectPropertyKeyName;
|
|
585
|
+
tryGetSlotScopeKeyCandidate: typeof tryGetSlotScopeKeyCandidate;
|
|
586
|
+
tryGetTemplateSlotScopeBindingNode: typeof tryGetTemplateSlotScopeBindingNode;
|
|
587
|
+
toResolvedTemplateFragment: typeof toResolvedTemplateFragment;
|
|
588
|
+
toResolvedKeyInfo: typeof toResolvedKeyInfo;
|
|
589
|
+
tryGetTemplateSlotScopeKeyInfo: typeof tryGetTemplateSlotScopeKeyInfo;
|
|
590
|
+
tryExtractSlotScopeVariableNames: typeof tryExtractSlotScopeVariableNames;
|
|
591
|
+
unwrapToBareCallbackIdentifier: typeof unwrapToBareCallbackIdentifier;
|
|
592
|
+
tryGetBareCallbackClickHandlerName: typeof tryGetBareCallbackClickHandlerName;
|
|
593
|
+
isSlotScopeCallbackClickHandler: typeof isSlotScopeCallbackClickHandler;
|
|
594
|
+
nodeHasForDirective: typeof nodeHasForDirective;
|
|
595
|
+
getKeyDirective: typeof getKeyDirective;
|
|
596
|
+
tryUnwrapTemplateLiteralSource: typeof tryUnwrapTemplateLiteralSource;
|
|
597
|
+
tryUnwrapTemplateLiteralExpressionSource: typeof tryUnwrapTemplateLiteralExpressionSource;
|
|
598
|
+
tryParseTemplateFragment: typeof tryParseTemplateFragment;
|
|
599
|
+
getTemplateExpressionSource: typeof getTemplateExpressionSource;
|
|
600
|
+
getSingleExpressionTemplateFragment: typeof getSingleExpressionTemplateFragment;
|
|
601
|
+
templateFragmentContainsSingleExpression: typeof templateFragmentContainsSingleExpression;
|
|
602
|
+
getKeyDirectiveExpression: typeof getKeyDirectiveExpression;
|
|
603
|
+
getParent: typeof getParent;
|
|
604
|
+
tryParseBabelAstFromHandlerSource: typeof tryParseBabelAstFromHandlerSource;
|
|
605
|
+
extractEmittedEventNameFromAst: typeof extractEmittedEventNameFromAst;
|
|
606
|
+
walkForEmittedEventName: typeof walkForEmittedEventName;
|
|
607
|
+
getStableClickHandlerNameFromAst: typeof getStableClickHandlerNameFromAst;
|
|
608
|
+
getStableClickHandlerNameFromExpression: typeof getStableClickHandlerNameFromExpression;
|
|
609
|
+
getClickHandlerNameFromAst: typeof getClickHandlerNameFromAst;
|
|
610
|
+
extractNameFromCallee: typeof extractNameFromCallee;
|
|
611
|
+
extractMemberPropertyName: typeof extractMemberPropertyName;
|
|
612
|
+
getLastIdentifierFromMemberChainBabel: typeof getLastIdentifierFromMemberChainBabel;
|
|
613
|
+
getAssignmentTargetNameFromBabel: typeof getAssignmentTargetNameFromBabel;
|
|
614
|
+
getStableAssignmentValueSuffixFromBabel: typeof getStableAssignmentValueSuffixFromBabel;
|
|
615
|
+
isCompilerGeneratedReferenceRoot: typeof isCompilerGeneratedReferenceRoot;
|
|
616
|
+
tryGetPreservableDynamicReferenceExpression: typeof tryGetPreservableDynamicReferenceExpression;
|
|
617
|
+
normalizeHandlerName: typeof normalizeHandlerName;
|
|
618
|
+
isTemplatePlaceholder: typeof isTemplatePlaceholder;
|
|
619
|
+
isAllCapsOrDigits: typeof isAllCapsOrDigits;
|
|
620
|
+
startsWithDigit: typeof startsWithDigit;
|
|
621
|
+
stripNonIdentifierChars: typeof stripNonIdentifierChars;
|
|
622
|
+
stripTrailingAsciiDigits: typeof stripTrailingAsciiDigits;
|
|
623
|
+
matchesStandaloneWrapperFallbackMethodName: typeof matchesStandaloneWrapperFallbackMethodName;
|
|
367
624
|
};
|
|
368
625
|
/**
|
|
369
626
|
* Resolve/apply a data-testid for an element, record it into dependencies, and append generated POM method content.
|
|
@@ -557,6 +814,8 @@ export interface IComponentDependencies {
|
|
|
557
814
|
/** Internal: lookup of already-emitted primaries by their generated getter name. */
|
|
558
815
|
__pomPrimaryByGetterName?: Map<string, IDataTestId>;
|
|
559
816
|
}
|
|
817
|
+
declare function stripTrailingAsciiDigits(value: string): string;
|
|
818
|
+
declare function matchesStandaloneWrapperFallbackMethodName(methodName: string, componentClassName: string): boolean;
|
|
560
819
|
/**
|
|
561
820
|
* Suppress standalone wrapper surfaces when every emitted primary is just a generic native-control fallback:
|
|
562
821
|
* the wrapper only exposes button/input/select/etc. semantics, and the generated member names collapse to the
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,sBAAsB,EACtB,aAAa,EACb,WAAW,EACX,oBAAoB,EAEpB,gBAAgB,EACjB,MAAM,oBAAoB,CAAC;AAO5B,OAAO,KAAK,EAOV,eAAe,EAGhB,MAAM,cAAc,CAAC;AA8BtB,OAAO,EAAuE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC5H,OAAO,EAOL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EACL,wBAAwB,EACxB,8BAA8B,EAC9B,2BAA2B,EAC3B,8BAA8B,EAC9B,wCAAwC,GACzC,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,4BAA4B,EAAE,MAAM,wBAAwB,CAAC;AAY3E,wBAAgB,UAAU,CAAC,KAAK,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kB,GAAG,IAAI,CAAC,CAAC;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,eAAe,CAAC,EAAE,uBAAuB,EAAE,CAAC;IAE5C;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAErC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAEpD,oFAAoF;IACpF,wBAAwB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CACrD;AAaD,iBAAS,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMvD;AAED,iBAAS,0CAA0C,CAAC,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAAG,OAAO,CAO3G;AAED;;;;;GAKG;AACH,wBAAgB,8CAA8C,CAC5D,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,sBAAsB,GACnC,OAAO,CA4BT"}
|
package/package.json
CHANGED
|
@@ -2,6 +2,7 @@ import { arrow, autoPlacement, autoUpdate, computePosition, offset, shift, type
|
|
|
2
2
|
|
|
3
3
|
import { formatAnnotations, formatSingleAnnotationPreview, type FormattedAnnotation, type OutputDetail } from "./format";
|
|
4
4
|
import { ANNOTATOR_ROOT_ATTR, ANNOTATOR_STYLES } from "./styles";
|
|
5
|
+
import { normalizeInlineText } from "./text-utils";
|
|
5
6
|
import { resolveVueComponentInfo, type VueDetectorOptions } from "./vue-detector";
|
|
6
7
|
|
|
7
8
|
export interface AnnotatorClientOptions extends VueDetectorOptions {
|
|
@@ -63,13 +64,6 @@ const SHORTCUT_LABELS = {
|
|
|
63
64
|
cancel: "Esc",
|
|
64
65
|
} as const;
|
|
65
66
|
|
|
66
|
-
function normalizeText(value: string | undefined): string | undefined {
|
|
67
|
-
/* eslint-disable no-restricted-syntax -- collapsing whitespace in UI display text, not parsing source code */
|
|
68
|
-
const normalized = value?.replace(/\s+/g, " ").trim();
|
|
69
|
-
/* eslint-enable no-restricted-syntax */
|
|
70
|
-
return normalized || undefined;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
67
|
function formatShortcutTitle(label: string, shortcut: string | undefined): string {
|
|
74
68
|
return shortcut ? `${label} (${shortcut})` : label;
|
|
75
69
|
}
|
|
@@ -121,12 +115,12 @@ function getElementPath(element: Element): string {
|
|
|
121
115
|
}
|
|
122
116
|
|
|
123
117
|
function getNearbyText(element: Element): string | undefined {
|
|
124
|
-
const ownText =
|
|
118
|
+
const ownText = normalizeInlineText(element.textContent || undefined);
|
|
125
119
|
if (ownText && ownText.length >= 2) {
|
|
126
120
|
return ownText.length > 160 ? `${ownText.slice(0, 160)}...` : ownText;
|
|
127
121
|
}
|
|
128
122
|
|
|
129
|
-
const parentText =
|
|
123
|
+
const parentText = normalizeInlineText(element.parentElement?.textContent || undefined);
|
|
130
124
|
if (parentText) {
|
|
131
125
|
return parentText.length > 160 ? `${parentText.slice(0, 160)}...` : parentText;
|
|
132
126
|
}
|
|
@@ -159,6 +153,21 @@ function toCssPixels(value: number): string {
|
|
|
159
153
|
return `${Math.round(value)}px`;
|
|
160
154
|
}
|
|
161
155
|
|
|
156
|
+
/**
|
|
157
|
+
* The primary side of a Floating UI placement token (e.g. `"top"` from
|
|
158
|
+
* `"top-start"`). Used to derive the static side opposite the arrow. This
|
|
159
|
+
* splits a CSS placement token on its separator, not source code.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
* placementPrimarySide("top-start") // "top"
|
|
163
|
+
* placementPrimarySide("right") // "right"
|
|
164
|
+
*/
|
|
165
|
+
function placementPrimarySide(placement: string): string {
|
|
166
|
+
/* eslint-disable no-restricted-syntax -- splitting a CSS placement token on its separator, not parsing source code */
|
|
167
|
+
return placement.split("-")[0];
|
|
168
|
+
/* eslint-enable no-restricted-syntax */
|
|
169
|
+
}
|
|
170
|
+
|
|
162
171
|
function clamp(value: number, min: number, max: number): number {
|
|
163
172
|
return Math.min(Math.max(value, min), max);
|
|
164
173
|
}
|
|
@@ -727,9 +736,7 @@ class AnnotatorRuntime {
|
|
|
727
736
|
panel.style.visibility = "visible";
|
|
728
737
|
|
|
729
738
|
const arrowData = result.middlewareData.arrow;
|
|
730
|
-
|
|
731
|
-
const side = result.placement.split("-")[0];
|
|
732
|
-
/* eslint-enable no-restricted-syntax */
|
|
739
|
+
const side = placementPrimarySide(result.placement);
|
|
733
740
|
const staticSide = side === "top" ? "bottom" : side === "bottom" ? "top" : side === "left" ? "right" : "left";
|
|
734
741
|
arrowEl.style.removeProperty("top");
|
|
735
742
|
arrowEl.style.removeProperty("right");
|
|
@@ -1007,3 +1014,8 @@ export function mountAnnotatorClient(options: AnnotatorClientOptions) {
|
|
|
1007
1014
|
runtimeWindow[RUNTIME_GUARD] = runtime;
|
|
1008
1015
|
return runtime;
|
|
1009
1016
|
}
|
|
1017
|
+
|
|
1018
|
+
// Exposed for unit tests. Pure helper (no DOM access).
|
|
1019
|
+
export const __internal = {
|
|
1020
|
+
placementPrimarySide,
|
|
1021
|
+
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { normalizeInlineText } from "./text-utils";
|
|
2
|
+
|
|
1
3
|
export type OutputDetail = "standard" | "forensic";
|
|
2
4
|
|
|
3
5
|
export interface FormattedAnnotation {
|
|
@@ -10,13 +12,6 @@ export interface FormattedAnnotation {
|
|
|
10
12
|
domHint?: string;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
function normalizeInlineText(value: string | undefined): string | undefined {
|
|
14
|
-
/* eslint-disable no-restricted-syntax -- collapsing whitespace in UI display text, not parsing source code */
|
|
15
|
-
const normalized = value?.replace(/\s+/g, " ").trim();
|
|
16
|
-
/* eslint-enable no-restricted-syntax */
|
|
17
|
-
return normalized || undefined;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
15
|
export function formatAnnotations(
|
|
21
16
|
annotations: FormattedAnnotation[],
|
|
22
17
|
detail: OutputDetail,
|
|
@@ -76,5 +71,8 @@ export function formatSingleAnnotationPreview(
|
|
|
76
71
|
): string {
|
|
77
72
|
const formatted = formatAnnotations([annotation], detail, pageUrl);
|
|
78
73
|
const headingIndex = formatted.indexOf("### 1.");
|
|
74
|
+
// reason: `formatAnnotations` is always called with a single-element array, so it
|
|
75
|
+
// always emits a `### 1.` heading; the false branch of this ternary is unreachable.
|
|
76
|
+
/* c8 ignore next */
|
|
79
77
|
return headingIndex >= 0 ? formatted.slice(headingIndex).trim() : formatted.trim();
|
|
80
78
|
}
|
|
@@ -25,12 +25,27 @@ const DEFAULT_ENTRY_SUFFIXES = [
|
|
|
25
25
|
"/src/main.jsx",
|
|
26
26
|
];
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Normalize Windows backslash path separators to POSIX forward slashes.
|
|
30
|
+
*
|
|
31
|
+
* Used to build Vite `/@fs/` import URLs and to compare entry-path suffixes
|
|
32
|
+
* consistently across platforms. This is path-separator normalization, not
|
|
33
|
+
* source-code parsing.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* normalizePathSeparators("src\\widgets\\Item.vue") // "src/widgets/Item.vue"
|
|
37
|
+
* normalizePathSeparators("src/widgets/Item.vue") // "src/widgets/Item.vue"
|
|
38
|
+
*/
|
|
39
|
+
function normalizePathSeparators(filePath: string): string {
|
|
40
|
+
/* eslint-disable no-restricted-syntax -- normalizing path separators, not parsing source code */
|
|
41
|
+
return filePath.replace(/\\/g, "/");
|
|
31
42
|
/* eslint-enable no-restricted-syntax */
|
|
32
43
|
}
|
|
33
44
|
|
|
45
|
+
function toFsImportPath(filePath: string): string {
|
|
46
|
+
return `/@fs/${normalizePathSeparators(filePath)}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
34
49
|
function resolveAnnotatorClientPath(): string {
|
|
35
50
|
const candidates = [
|
|
36
51
|
fileURLToPath(new URL("./client.ts", import.meta.url)),
|
|
@@ -79,9 +94,7 @@ export function createAnnotatorUiPlugin(options: ResolvedAnnotatorUiOptions): Pl
|
|
|
79
94
|
return null;
|
|
80
95
|
}
|
|
81
96
|
|
|
82
|
-
|
|
83
|
-
const normalizedId = id.replace(/\\/g, "/");
|
|
84
|
-
/* eslint-enable no-restricted-syntax */
|
|
97
|
+
const normalizedId = normalizePathSeparators(id);
|
|
85
98
|
if (!DEFAULT_ENTRY_SUFFIXES.some(suffix => normalizedId.endsWith(suffix))) {
|
|
86
99
|
return null;
|
|
87
100
|
}
|
|
@@ -111,3 +124,8 @@ export function createAnnotatorUiPlugin(options: ResolvedAnnotatorUiOptions): Pl
|
|
|
111
124
|
},
|
|
112
125
|
};
|
|
113
126
|
}
|
|
127
|
+
|
|
128
|
+
// Exposed for unit tests. Pure helper (no I/O).
|
|
129
|
+
export const __internal = {
|
|
130
|
+
normalizePathSeparators,
|
|
131
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Display-text helpers for the annotator runtime. These normalize text
|
|
2
|
+
// captured from the DOM (collapsing whitespace, trimming) for readable UI
|
|
3
|
+
// labels — not source code — so whitespace regexes are the appropriate tool.
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Normalize a UI display string: collapse whitespace runs to single spaces,
|
|
7
|
+
* trim the ends, and return `undefined` for blank input.
|
|
8
|
+
*
|
|
9
|
+
* Returns `undefined` when `value` is itself `undefined` or collapses to empty,
|
|
10
|
+
* so callers can use a simple truthiness check to decide whether to render a
|
|
11
|
+
* line. This is display-text normalization, not source-code parsing.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* normalizeInlineText(" foo\n bar ") // "foo bar"
|
|
15
|
+
* normalizeInlineText(" ") // undefined
|
|
16
|
+
* normalizeInlineText(undefined) // undefined
|
|
17
|
+
*/
|
|
18
|
+
export function normalizeInlineText(value: string | undefined): string | undefined {
|
|
19
|
+
/* eslint-disable no-restricted-syntax -- collapsing whitespace runs in display text, not parsing source code */
|
|
20
|
+
const normalized = value?.replace(/\s+/g, " ").trim();
|
|
21
|
+
/* eslint-enable no-restricted-syntax */
|
|
22
|
+
return normalized || undefined;
|
|
23
|
+
}
|