@immense/vue-pom-generator 1.0.119 → 1.0.120
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/README.md +68 -0
- package/RELEASE_NOTES.md +28 -36
- package/class-generation/index.ts +41 -43
- package/dist/class-generation/index.d.ts +2 -0
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/index.cjs +222 -137
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +222 -137
- package/dist/index.mjs.map +1 -1
- package/dist/manifest-generator.d.ts +18 -0
- package/dist/manifest-generator.d.ts.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/internal/build-plugin.d.ts.map +1 -1
- package/dist/plugin/internal/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/path-utils.d.ts +1 -0
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/resolved-generation-options.d.ts +1 -0
- package/dist/plugin/resolved-generation-options.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +6 -0
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/router-introspection.d.ts +10 -1
- package/dist/router-introspection.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -488,6 +488,7 @@ Optional Playwright fixture output:
|
|
|
488
488
|
|
|
489
489
|
- `fixtures.g.ts` next to the POMs by default
|
|
490
490
|
- `pom-manifest.g.ts` — a Node-importable map from Vue source/test ids to generated methods
|
|
491
|
+
- `component-graph.json` — component usage and route edges, when `generation.playwright.componentGraph` is on (see [Component usage graph](#component-usage-graph-component-graphjson))
|
|
491
492
|
- or a custom directory / file path when configured
|
|
492
493
|
|
|
493
494
|
Optional C# output:
|
|
@@ -1176,6 +1177,64 @@ What it contains:
|
|
|
1176
1177
|
- for each component: source file, whether it is a view or component, sorted test ids, and rich entry metadata
|
|
1177
1178
|
- for each entry: test id, semantic name, inferred role, generated property name, generated action names, collected compiler metadata when available, and accessibility review metadata when available
|
|
1178
1179
|
|
|
1180
|
+
## Component usage graph (`component-graph.json`)
|
|
1181
|
+
|
|
1182
|
+
The manifest says what each component contains, not where it is used. Set `generation.playwright.componentGraph: true` (with `fixtures` on) to also write `component-graph.json` next to `pom-manifest.g.ts`. It holds the usage edges, so tools can work out which routes reach a component.
|
|
1183
|
+
|
|
1184
|
+
Schema (`version: 1`):
|
|
1185
|
+
|
|
1186
|
+
- `components` — keyed by source file, relative to the project root, with `/` separators
|
|
1187
|
+
- `name` — the generated component/class name (the key in `pom-manifest.g.ts`)
|
|
1188
|
+
- `uses` — source files of the project components this template uses. Tags resolve the same way as for POM generation (component name or file basename; kebab-case tags included). Tags that are not project components, such as built-ins and library components, are left out.
|
|
1189
|
+
- `routes` — one entry per route record from router introspection; empty when no router is configured
|
|
1190
|
+
- `path` — the path pattern as declared (`/users/:id`)
|
|
1191
|
+
- `name` — the route name, or `null`
|
|
1192
|
+
- `components` — source files the route renders: parent route components first, then the route's own components, named views included. Nuxt pages list their page file.
|
|
1193
|
+
|
|
1194
|
+
Keys and lists are sorted, so the file diffs cleanly. The `ComponentGraph` type is exported from the package.
|
|
1195
|
+
|
|
1196
|
+
```json
|
|
1197
|
+
{
|
|
1198
|
+
"version": 1,
|
|
1199
|
+
"components": {
|
|
1200
|
+
"src/components/NavBar.vue": { "name": "NavBar", "uses": ["src/components/users/UserAvatar.vue"] },
|
|
1201
|
+
"src/components/users/UserAvatar.vue": { "name": "UsersUserAvatar", "uses": [] },
|
|
1202
|
+
"src/layouts/AppShell.vue": { "name": "AppShell", "uses": ["src/components/NavBar.vue"] },
|
|
1203
|
+
"src/views/UserDetail.vue": { "name": "UserDetail", "uses": [] }
|
|
1204
|
+
},
|
|
1205
|
+
"routes": [
|
|
1206
|
+
{ "path": "/users", "name": null, "components": ["src/layouts/AppShell.vue"] },
|
|
1207
|
+
{ "path": "/users/:id", "name": "user-detail", "components": ["src/layouts/AppShell.vue", "src/views/UserDetail.vue"] }
|
|
1208
|
+
]
|
|
1209
|
+
}
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
Routes that reach a component:
|
|
1213
|
+
|
|
1214
|
+
```ts
|
|
1215
|
+
import fs from "node:fs";
|
|
1216
|
+
import type { ComponentGraph } from "@immense/vue-pom-generator";
|
|
1217
|
+
|
|
1218
|
+
const graph: ComponentGraph = JSON.parse(fs.readFileSync("tests/playwright/__generated__/component-graph.json", "utf8"));
|
|
1219
|
+
|
|
1220
|
+
function routesReaching(file: string) {
|
|
1221
|
+
return graph.routes.filter((route) => {
|
|
1222
|
+
const seen = new Set<string>();
|
|
1223
|
+
const visit = (current: string): boolean => {
|
|
1224
|
+
if (current === file) return true;
|
|
1225
|
+
if (seen.has(current)) return false;
|
|
1226
|
+
seen.add(current);
|
|
1227
|
+
return (graph.components[current]?.uses ?? []).some(visit);
|
|
1228
|
+
};
|
|
1229
|
+
return route.components.some(visit);
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
routesReaching("src/components/users/UserAvatar.vue"); // both /users routes
|
|
1234
|
+
```
|
|
1235
|
+
|
|
1236
|
+
Unnamed routes are placed in the route tree by resolving their own path pattern. Generation fails with an error if that pattern does not match itself (for example `/items/:id(\\d+)`). Name the route to fix it.
|
|
1237
|
+
|
|
1179
1238
|
## ESLint rules that actually ship
|
|
1180
1239
|
|
|
1181
1240
|
The package exports `@immense/vue-pom-generator/eslint`.
|
|
@@ -1586,6 +1645,15 @@ This object holds Playwright-specific additions on top of the generated TypeScri
|
|
|
1586
1645
|
- `"path"` — if the string ends in `.ts` / `.tsx` / `.mts` / `.cts`, it is treated as a file path; otherwise as an output directory
|
|
1587
1646
|
- `{ outDir }` — emit to a custom directory
|
|
1588
1647
|
|
|
1648
|
+
#### `generation.playwright.componentGraph`
|
|
1649
|
+
|
|
1650
|
+
- **What it does:** Writes `component-graph.json` next to `pom-manifest.g.ts`: what each component uses and what each route renders.
|
|
1651
|
+
- **Why it exists:** the manifest has no usage edges, so tools cannot tell which routes reach a component.
|
|
1652
|
+
- **Benefit:** one deterministic file that maps components and routes to source files.
|
|
1653
|
+
- **Without it:** no graph file is written. Other outputs are the same either way.
|
|
1654
|
+
- **Requires:** `generation.playwright.fixtures`. Routes need `generation.router` (or Nuxt).
|
|
1655
|
+
- **Schema:** see [Component usage graph](#component-usage-graph-component-graphjson).
|
|
1656
|
+
|
|
1589
1657
|
#### `generation.playwright.outputStructure`
|
|
1590
1658
|
|
|
1591
1659
|
- **What it does:** Chooses whether generated TypeScript POMs are emitted as one aggregate or split per class.
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,49 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Range confirmed: exactly one commit (#87). Let me check the README additions for accurate option
|
|
2
|
+
details.
|
|
3
3
|
|
|
4
4
|
Highlights
|
|
5
5
|
|
|
6
|
-
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
output is
|
|
6
|
+
- New opt-in component usage graph: set generation.playwright.componentGraph: true to emit
|
|
7
|
+
component-graph.json next to pom-manifest.g.ts
|
|
8
|
+
- The manifest describes what each component contains; the graph adds the usage edges so tools can
|
|
9
|
+
determine which routes reach a component
|
|
10
|
+
- components are keyed by project-relative source file with the generated name and the project
|
|
11
|
+
components each template uses; routes list path pattern, name, and rendered source files (parent
|
|
12
|
+
route components first, named views included; Nuxt pages list their page file)
|
|
13
|
+
- Keys and lists are sorted, so the file diffs cleanly; output is byte-identical when the option is
|
|
14
|
+
off
|
|
15
|
+
- Generation fails fast if the option is enabled without fixtures, or if an unnamed route's pattern
|
|
16
|
+
can't be resolved into the route tree
|
|
14
17
|
|
|
15
18
|
Changes
|
|
16
19
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Docs
|
|
31
|
-
|
|
32
|
-
- README documents the new customPoms.fixtures option and usage
|
|
20
|
+
- Manifest
|
|
21
|
+
- Emit component-graph.json (schema version: 1) when generation.playwright.componentGraph is on
|
|
22
|
+
with fixtures enabled, in both dev and build generation paths
|
|
23
|
+
- Export the ComponentGraph type from the package
|
|
24
|
+
- Shared internals
|
|
25
|
+
- Move the tag resolver used by class generation into manifest-generator.ts so both share it;
|
|
26
|
+
graph tags resolve with the same toPascalCase normalization as POM generation
|
|
27
|
+
- Nuxt route entries list componentFiles only when collectComponentFiles is on, matching the
|
|
28
|
+
vue-router branch
|
|
29
|
+
- Docs
|
|
30
|
+
- README: document the new option and component-graph.json schema with examples for tracing routes
|
|
31
|
+
that reach a component
|
|
33
32
|
|
|
34
33
|
Pull Requests Included
|
|
35
34
|
|
|
36
|
-
- ]8;id=md-
|
|
37
|
-
|
|
38
|
-
Only #86 falls within the v1.0.118..HEAD compare range (9 files, +273/−36); other PRs in the merge
|
|
39
|
-
window were already shipped in prior releases.
|
|
35
|
+
- ]8;id=md-1bbrzn7;https://github.com/immense/vue-pom-generator/pull/87#87 — feat(manifest): emit a component usage graph as JSON]8;;]8;; (@dkattan)]8;;
|
|
40
36
|
|
|
41
37
|
Testing
|
|
42
38
|
|
|
43
|
-
- tests/
|
|
44
|
-
|
|
45
|
-
(duplicate listing, missing file, reserved/colliding names with owner in the message, fixtures off)
|
|
46
|
-
- tests/generate-vue-poms.test.ts: end-to-end coverage through the public plugin option
|
|
47
|
-
- Local runs: npm run lint -- --max-warnings 0, npm run typecheck, npm run knip, npm test (519
|
|
48
|
-
passed), and npm run build all passed
|
|
39
|
+
- Added coverage in tests/generate-vue-poms.test.ts and tests/router-introspection.test.ts for
|
|
40
|
+
graph emission, tag resolution, and route-tree handling.
|
|
49
41
|
|
|
@@ -9,7 +9,7 @@ import path from "node:path";
|
|
|
9
9
|
import process from "node:process";
|
|
10
10
|
import { fileURLToPath } from "node:url";
|
|
11
11
|
import { generateViewObjectModelMembers, generateViewObjectModelMethodContent } from "../method-generation";
|
|
12
|
-
import { generatePomManifestModule } from "../manifest-generator";
|
|
12
|
+
import { generateComponentGraphJson, generatePomManifestModule, normalizeTrackedComponentRef, resolveTrackedComponentRef } from "../manifest-generator";
|
|
13
13
|
import type { ElementMetadata } from "../metadata-collector";
|
|
14
14
|
import { writeGeneratedOutputs, type GeneratedFileOutput } from "../plugin/generated-outputs";
|
|
15
15
|
import {
|
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
type PomStringPattern,
|
|
33
33
|
} from "../pom-patterns";
|
|
34
34
|
import { buildPomLocatorDescription, stripPomActionPrefix } from "../pom-discoverability";
|
|
35
|
+
import type { RouterIntrospectionResult } from "../router-introspection";
|
|
35
36
|
import { introspectNuxtPages, parseRouterFileFromCwd } from "../router-introspection";
|
|
36
37
|
import {
|
|
37
38
|
addNamedImport,
|
|
@@ -279,7 +280,7 @@ function resolveVueSourcePath(
|
|
|
279
280
|
return candidates.find(candidate => fs.existsSync(candidate));
|
|
280
281
|
}
|
|
281
282
|
|
|
282
|
-
async function
|
|
283
|
+
async function introspectRouteMetaEntries(
|
|
283
284
|
projectRoot?: string,
|
|
284
285
|
routerEntry?: string,
|
|
285
286
|
routerType?: "vue-router" | "nuxt",
|
|
@@ -287,8 +288,9 @@ async function getRouteMetaByComponent(
|
|
|
287
288
|
pageDirs?: string[];
|
|
288
289
|
componentDirs?: string[];
|
|
289
290
|
layoutDirs?: string[];
|
|
291
|
+
collectComponentFiles?: boolean;
|
|
290
292
|
} = {},
|
|
291
|
-
): Promise<
|
|
293
|
+
): Promise<RouterIntrospectionResult["routeMetaEntries"]> {
|
|
292
294
|
const root = projectRoot ?? process.cwd();
|
|
293
295
|
const pageDirs = options.pageDirs?.length ? options.pageDirs : ["src/views"];
|
|
294
296
|
const pageDirsAbs = pageDirs.map(dir => path.isAbsolute(dir) ? dir : path.resolve(root, dir));
|
|
@@ -301,7 +303,7 @@ async function getRouteMetaByComponent(
|
|
|
301
303
|
const extraRoots = process.cwd() !== root ? [process.cwd()] : [];
|
|
302
304
|
|
|
303
305
|
const { routeMetaEntries } = routerType === "nuxt"
|
|
304
|
-
? await introspectNuxtPages(root, { pageDirs: pageDirsAbs })
|
|
306
|
+
? await introspectNuxtPages(root, { pageDirs: pageDirsAbs, collectComponentFiles: options.collectComponentFiles })
|
|
305
307
|
: await parseRouterFileFromCwd(resolveRouterEntry(root, routerEntry), {
|
|
306
308
|
componentNaming: {
|
|
307
309
|
projectRoot: root,
|
|
@@ -309,8 +311,12 @@ async function getRouteMetaByComponent(
|
|
|
309
311
|
sourceDirs,
|
|
310
312
|
extraRoots,
|
|
311
313
|
},
|
|
314
|
+
collectComponentFiles: options.collectComponentFiles,
|
|
312
315
|
});
|
|
316
|
+
return routeMetaEntries;
|
|
317
|
+
}
|
|
313
318
|
|
|
319
|
+
function buildRouteMetaByComponent(routeMetaEntries: RouterIntrospectionResult["routeMetaEntries"]): Record<string, RouteMeta> {
|
|
314
320
|
const map = new Map<string, RouteEntry[]>();
|
|
315
321
|
for (const entry of routeMetaEntries) {
|
|
316
322
|
const list = map.get(entry.componentName) ?? [];
|
|
@@ -806,6 +812,9 @@ export interface GenerateFilesOptions {
|
|
|
806
812
|
*/
|
|
807
813
|
customPomFixtures?: string[];
|
|
808
814
|
|
|
815
|
+
/** Write `component-graph.json` next to the generated manifest. Requires `generateFixtures`. */
|
|
816
|
+
componentGraph?: boolean;
|
|
817
|
+
|
|
809
818
|
/**
|
|
810
819
|
* Handwritten POM helper attachments. These helpers are assumed to be present in the
|
|
811
820
|
* aggregated output (e.g. via `tests/playwright/pom/custom/*.ts` inlining), but we only attach them to
|
|
@@ -900,6 +909,7 @@ export async function generateFiles(
|
|
|
900
909
|
customPomImportAliases,
|
|
901
910
|
customPomImportNameCollisionBehavior = "error",
|
|
902
911
|
customPomFixtures = [],
|
|
912
|
+
componentGraph = false,
|
|
903
913
|
testIdAttribute,
|
|
904
914
|
emitLanguages: emitLanguagesOverride,
|
|
905
915
|
typescriptOutputStructure = "aggregated",
|
|
@@ -926,14 +936,16 @@ export async function generateFiles(
|
|
|
926
936
|
throw new Error("[vue-pom-generator] generation.vueTestUtils.outDir must differ from generation.outDir.");
|
|
927
937
|
}
|
|
928
938
|
|
|
939
|
+
const routeMetaEntries = vueRouterFluentChaining && (!routeMetaByComponentOverride || componentGraph)
|
|
940
|
+
? await introspectRouteMetaEntries(projectRoot, routerEntry, routerType, {
|
|
941
|
+
pageDirs,
|
|
942
|
+
componentDirs,
|
|
943
|
+
layoutDirs,
|
|
944
|
+
collectComponentFiles: componentGraph,
|
|
945
|
+
})
|
|
946
|
+
: [];
|
|
929
947
|
const routeMetaByComponent = routeMetaByComponentOverride
|
|
930
|
-
?? (vueRouterFluentChaining
|
|
931
|
-
? await getRouteMetaByComponent(projectRoot, routerEntry, routerType, {
|
|
932
|
-
pageDirs,
|
|
933
|
-
componentDirs,
|
|
934
|
-
layoutDirs,
|
|
935
|
-
})
|
|
936
|
-
: undefined);
|
|
948
|
+
?? (vueRouterFluentChaining ? buildRouteMetaByComponent(routeMetaEntries) : undefined);
|
|
937
949
|
const emittableComponentHierarchyMap = componentHierarchyMap;
|
|
938
950
|
const generatedFiles: GeneratedFileOutput[] = [];
|
|
939
951
|
|
|
@@ -973,6 +985,7 @@ export async function generateFiles(
|
|
|
973
985
|
projectRoot,
|
|
974
986
|
customPomDir,
|
|
975
987
|
customPomFixtures,
|
|
988
|
+
componentGraphRoutes: componentGraph ? routeMetaEntries : undefined,
|
|
976
989
|
elementMetadata,
|
|
977
990
|
testIdAttribute,
|
|
978
991
|
});
|
|
@@ -1881,17 +1894,24 @@ function maybeGenerateFixtureRegistry(
|
|
|
1881
1894
|
projectRoot?: string;
|
|
1882
1895
|
customPomDir?: string;
|
|
1883
1896
|
customPomFixtures: string[];
|
|
1897
|
+
/** Routes for `component-graph.json`; the graph is written only when set. */
|
|
1898
|
+
componentGraphRoutes?: RouterIntrospectionResult["routeMetaEntries"];
|
|
1884
1899
|
elementMetadata: Map<string, Map<string, ElementMetadata>>;
|
|
1885
1900
|
testIdAttribute?: string;
|
|
1886
1901
|
},
|
|
1887
1902
|
): GeneratedFileOutput[] {
|
|
1888
|
-
const { generateFixtures, pomOutDir, customPomFixtures } = options;
|
|
1903
|
+
const { generateFixtures, pomOutDir, customPomFixtures, componentGraphRoutes } = options;
|
|
1889
1904
|
if (!generateFixtures) {
|
|
1890
1905
|
if (customPomFixtures.length > 0) {
|
|
1891
1906
|
throw new VuePomGeneratorError(
|
|
1892
1907
|
"generation.playwright.customPoms.fixtures requires generation.playwright.fixtures to be enabled.",
|
|
1893
1908
|
);
|
|
1894
1909
|
}
|
|
1910
|
+
if (componentGraphRoutes) {
|
|
1911
|
+
throw new VuePomGeneratorError(
|
|
1912
|
+
"generation.playwright.componentGraph requires generation.playwright.fixtures to be enabled.",
|
|
1913
|
+
);
|
|
1914
|
+
}
|
|
1895
1915
|
return [];
|
|
1896
1916
|
}
|
|
1897
1917
|
|
|
@@ -2310,6 +2330,12 @@ function maybeGenerateFixtureRegistry(
|
|
|
2310
2330
|
filePath: path.resolve(fixtureOutDirAbs, manifestFileName),
|
|
2311
2331
|
content: manifestContent,
|
|
2312
2332
|
},
|
|
2333
|
+
...(componentGraphRoutes
|
|
2334
|
+
? [{
|
|
2335
|
+
filePath: path.resolve(fixtureOutDirAbs, "component-graph.json"),
|
|
2336
|
+
content: generateComponentGraphJson(componentHierarchyMap, componentGraphRoutes, root),
|
|
2337
|
+
}]
|
|
2338
|
+
: []),
|
|
2313
2339
|
diagnosticsRuntimeFile,
|
|
2314
2340
|
];
|
|
2315
2341
|
|
|
@@ -2328,36 +2354,8 @@ function prepareViewObjectModelClass(
|
|
|
2328
2354
|
testIdAttribute,
|
|
2329
2355
|
} = options;
|
|
2330
2356
|
|
|
2331
|
-
const normalizeTrackedComponentRef = (value: string): string => {
|
|
2332
|
-
return value.endsWith(".vue") ? value.slice(0, -4) : value;
|
|
2333
|
-
};
|
|
2334
|
-
|
|
2335
|
-
const resolveTrackedComponentRef = (value: string): string | null => {
|
|
2336
|
-
const normalizedValue = normalizeTrackedComponentRef(value);
|
|
2337
|
-
if (componentHierarchyMap.has(value)) {
|
|
2338
|
-
return value;
|
|
2339
|
-
}
|
|
2340
|
-
if (componentHierarchyMap.has(normalizedValue)) {
|
|
2341
|
-
return normalizedValue;
|
|
2342
|
-
}
|
|
2343
|
-
|
|
2344
|
-
let match: string | null = null;
|
|
2345
|
-
for (const [candidateName, candidateDeps] of componentHierarchyMap.entries()) {
|
|
2346
|
-
const normalizedCandidate = normalizeTrackedComponentRef(candidateName);
|
|
2347
|
-
const candidateBaseName = path.parse(candidateDeps.filePath).name;
|
|
2348
|
-
if (normalizedCandidate !== normalizedValue && candidateBaseName !== normalizedValue) {
|
|
2349
|
-
continue;
|
|
2350
|
-
}
|
|
2351
|
-
if (match && match !== candidateName) {
|
|
2352
|
-
return null;
|
|
2353
|
-
}
|
|
2354
|
-
match = candidateName;
|
|
2355
|
-
}
|
|
2356
|
-
return match;
|
|
2357
|
-
};
|
|
2358
|
-
|
|
2359
2357
|
const hasGeneratedPomSurface = (value: string, seen = new Set<string>()): boolean => {
|
|
2360
|
-
const resolvedRef = resolveTrackedComponentRef(value);
|
|
2358
|
+
const resolvedRef = resolveTrackedComponentRef(value, componentHierarchyMap);
|
|
2361
2359
|
if (!resolvedRef || seen.has(resolvedRef)) {
|
|
2362
2360
|
return false;
|
|
2363
2361
|
}
|
|
@@ -2391,7 +2389,7 @@ function prepareViewObjectModelClass(
|
|
|
2391
2389
|
};
|
|
2392
2390
|
|
|
2393
2391
|
const resolveComponentInstance = (spec: PomComponentInstanceSpec): ResolvedComponentInstance | null => {
|
|
2394
|
-
const componentRef = resolveTrackedComponentRef(spec.componentName);
|
|
2392
|
+
const componentRef = resolveTrackedComponentRef(spec.componentName, componentHierarchyMap);
|
|
2395
2393
|
if (
|
|
2396
2394
|
!componentRef
|
|
2397
2395
|
|| isSelfReference(componentRef)
|
|
@@ -2531,7 +2529,7 @@ function prepareViewObjectModelClass(
|
|
|
2531
2529
|
const hasChildComponent = (needle: string) => {
|
|
2532
2530
|
const normalizedNeedle = normalizeTrackedComponentRef(needle);
|
|
2533
2531
|
for (const child of rawComponentRefsForInstances) {
|
|
2534
|
-
const resolvedChild = resolveTrackedComponentRef(child);
|
|
2532
|
+
const resolvedChild = resolveTrackedComponentRef(child, componentHierarchyMap);
|
|
2535
2533
|
if (normalizeTrackedComponentRef(child) === normalizedNeedle)
|
|
2536
2534
|
return true;
|
|
2537
2535
|
if (resolvedChild && normalizeTrackedComponentRef(resolvedChild) === normalizedNeedle)
|
|
@@ -91,6 +91,8 @@ export interface GenerateFilesOptions {
|
|
|
91
91
|
* Playwright fixtures next to the generated ones. Requires `generateFixtures`.
|
|
92
92
|
*/
|
|
93
93
|
customPomFixtures?: string[];
|
|
94
|
+
/** Write `component-graph.json` next to the generated manifest. Requires `generateFixtures`. */
|
|
95
|
+
componentGraph?: boolean;
|
|
94
96
|
/**
|
|
95
97
|
* Handwritten POM helper attachments. These helpers are assumed to be present in the
|
|
96
98
|
* aggregated output (e.g. via `tests/playwright/pom/custom/*.ts` inlining), but we only attach them to
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAE5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAE5G,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAwB7D,OAAO,EAeL,KAA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