@immense/vue-pom-generator 1.0.51 → 1.0.53
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 +61 -22
- package/RELEASE_NOTES.md +47 -14
- package/class-generation/base-page.ts +0 -1
- package/class-generation/index.ts +23 -60
- package/dist/class-generation/base-page.d.ts.map +1 -1
- package/dist/class-generation/index.d.ts +3 -2
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/index.cjs +531 -167
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +531 -167
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts +2 -2
- package/dist/plugin/create-vue-pom-generator-plugins.d.ts.map +1 -1
- package/dist/plugin/nuxt-discovery.d.ts +47 -0
- package/dist/plugin/nuxt-discovery.d.ts.map +1 -0
- package/dist/plugin/path-utils.d.ts +4 -5
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/support/build-plugin.d.ts +6 -3
- package/dist/plugin/support/build-plugin.d.ts.map +1 -1
- package/dist/plugin/support/dev-plugin.d.ts +6 -3
- package/dist/plugin/support/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/support-plugins.d.ts +5 -2
- package/dist/plugin/support-plugins.d.ts.map +1 -1
- package/dist/plugin/types.d.ts +33 -17
- package/dist/plugin/types.d.ts.map +1 -1
- package/dist/plugin/vue-plugin.d.ts +1 -1
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/dist/router-introspection.d.ts +4 -2
- package/dist/router-introspection.d.ts.map +1 -1
- package/dist/tests/nuxt-discovery.test.d.ts +2 -0
- package/dist/tests/nuxt-discovery.test.d.ts.map +1 -0
- package/dist/transform.d.ts +11 -0
- package/dist/transform.d.ts.map +1 -1
- package/dist/utils.d.ts +15 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/plugin/support/generation-metrics.d.ts +0 -10
- package/dist/plugin/support/generation-metrics.d.ts.map +0 -1
- package/dist/tests/generation-metrics.test.d.ts +0 -2
- package/dist/tests/generation-metrics.test.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -184,14 +184,17 @@ Without `flatten`, helper composition is still available; it is just more explic
|
|
|
184
184
|
npm install @immense/vue-pom-generator
|
|
185
185
|
```
|
|
186
186
|
|
|
187
|
+
Peer Vite support: Vite 5, 6, or 7.
|
|
188
|
+
|
|
187
189
|
Exports:
|
|
188
190
|
|
|
189
191
|
- `createVuePomGeneratorPlugins()`
|
|
190
192
|
- `vuePomGenerator()` (alias)
|
|
191
193
|
- `defineVuePomGeneratorConfig()`
|
|
194
|
+
- `defineNuxtPomGeneratorConfig()`
|
|
192
195
|
- `@immense/vue-pom-generator/eslint`
|
|
193
196
|
|
|
194
|
-
## Basic Vite setup
|
|
197
|
+
## Basic Vue/Vite setup
|
|
195
198
|
|
|
196
199
|
```ts
|
|
197
200
|
import { defineConfig } from "vite";
|
|
@@ -206,7 +209,8 @@ const pomConfig = defineVuePomGeneratorConfig({
|
|
|
206
209
|
injection: {
|
|
207
210
|
attribute: "data-testid",
|
|
208
211
|
viewsDir: "src/views",
|
|
209
|
-
|
|
212
|
+
componentDirs: ["src/components"],
|
|
213
|
+
layoutDirs: ["src/layouts"],
|
|
210
214
|
wrapperSearchRoots: ["../shared-ui/src/components"],
|
|
211
215
|
nativeWrappers: {
|
|
212
216
|
AppButton: { role: "button" },
|
|
@@ -259,6 +263,29 @@ export default defineConfig({
|
|
|
259
263
|
});
|
|
260
264
|
```
|
|
261
265
|
|
|
266
|
+
## Basic Nuxt setup
|
|
267
|
+
|
|
268
|
+
```ts
|
|
269
|
+
import { defineNuxtConfig } from "nuxt/config";
|
|
270
|
+
import { defineNuxtPomGeneratorConfig, vuePomGenerator } from "@immense/vue-pom-generator";
|
|
271
|
+
|
|
272
|
+
const pomConfig = defineNuxtPomGeneratorConfig({
|
|
273
|
+
generation: {
|
|
274
|
+
outDir: "tests/playwright/__generated__",
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
export default defineNuxtConfig({
|
|
279
|
+
vite: {
|
|
280
|
+
plugins: [
|
|
281
|
+
...vuePomGenerator(pomConfig),
|
|
282
|
+
],
|
|
283
|
+
},
|
|
284
|
+
});
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Nuxt projects are auto-detected from standard project artifacts, and their pages/layouts/components are resolved from Nuxt's own config. That means custom page directories such as `dir.pages = "views"` come from `nuxt.config`, while component directories are picked up automatically from Nuxt conventions/config. `defineNuxtPomGeneratorConfig(...)` is optional, but it keeps the config surface Nuxt-specific at type-check time.
|
|
288
|
+
|
|
262
289
|
### Important Vite ownership rule
|
|
263
290
|
|
|
264
291
|
By default, this package creates and returns its own `@vitejs/plugin-vue` instance.
|
|
@@ -287,7 +314,7 @@ export default defineConfig({
|
|
|
287
314
|
});
|
|
288
315
|
```
|
|
289
316
|
|
|
290
|
-
Nuxt-style routing also uses the resolved app-owned Vue plugin. In practice,
|
|
317
|
+
Nuxt-style routing also uses the resolved app-owned Vue plugin. In practice, Nuxt projects are auto-detected and use external Vue plugin ownership automatically.
|
|
291
318
|
|
|
292
319
|
## What gets generated
|
|
293
320
|
|
|
@@ -318,7 +345,7 @@ If you emit outside a `__generated__` path, the generator also manages `.gitattr
|
|
|
318
345
|
|
|
319
346
|
This is important if you are deciding whether the tool will fit into a real codebase.
|
|
320
347
|
|
|
321
|
-
- **Dev server:** on startup, it scans the configured
|
|
348
|
+
- **Dev server:** on startup, it scans the configured Vue page/component/layout directories (or the directories resolved from Nuxt config in Nuxt mode), compiles each `.vue` file into a snapshot, writes the configured TypeScript outputs once, then batches add/change/delete events and regenerates incrementally.
|
|
322
349
|
- **Build:** it generates from the richest build pass it sees, which matters because Vite can run multiple passes (for example SSR plus client). The generator avoids letting a thinner pass clobber a richer one.
|
|
323
350
|
- **Always-on virtual module:** `virtual:testids` is registered whether generation is enabled or disabled.
|
|
324
351
|
- **Generation can be disabled:** `generation: false` still keeps compile-time test-id injection and the virtual module, but skips emitted POM files.
|
|
@@ -855,6 +882,30 @@ The sections below follow the actual `VuePomGeneratorPluginOptions` shape from `
|
|
|
855
882
|
injection: { viewsDir: "app/pages" }
|
|
856
883
|
```
|
|
857
884
|
|
|
885
|
+
#### `injection.componentDirs`
|
|
886
|
+
|
|
887
|
+
- **What it does:** Lists the directories that should be treated as reusable component roots.
|
|
888
|
+
- **Why it exists:** Vue apps often keep components outside a single catch-all tree, and the generator needs explicit component roots now that generic scan lists are gone.
|
|
889
|
+
- **Benefit:** component naming and filesystem supplementation stay aligned with the directories you actually consider components.
|
|
890
|
+
- **Without it:** the generator uses `["src/components"]`.
|
|
891
|
+
- **Example:**
|
|
892
|
+
|
|
893
|
+
```ts
|
|
894
|
+
injection: { componentDirs: ["src/components", "../shared-ui/src/components"] }
|
|
895
|
+
```
|
|
896
|
+
|
|
897
|
+
#### `injection.layoutDirs`
|
|
898
|
+
|
|
899
|
+
- **What it does:** Lists layout-style Vue directories that should be included in generation and naming.
|
|
900
|
+
- **Why it exists:** some Vue apps keep shell components outside `views` and `components`, but still want them in the generated POM graph.
|
|
901
|
+
- **Benefit:** layouts participate explicitly without falling back to a generic scan of unrelated folders.
|
|
902
|
+
- **Without it:** the generator uses `["src/layouts"]`.
|
|
903
|
+
- **Example:**
|
|
904
|
+
|
|
905
|
+
```ts
|
|
906
|
+
injection: { layoutDirs: ["src/layouts"] }
|
|
907
|
+
```
|
|
908
|
+
|
|
858
909
|
#### `injection.nativeWrappers`
|
|
859
910
|
|
|
860
911
|
- **What it does:** Describes wrapper components so the generator can treat them like native controls.
|
|
@@ -908,24 +959,12 @@ The sections below follow the actual `VuePomGeneratorPluginOptions` shape from `
|
|
|
908
959
|
injection: { excludeComponents: ["LegacyWidget"] }
|
|
909
960
|
```
|
|
910
961
|
|
|
911
|
-
#### `injection.scanDirs`
|
|
912
|
-
|
|
913
|
-
- **What it does:** Sets which directories are scanned for `.vue` files when building the POM graph.
|
|
914
|
-
- **Why it exists:** real projects rarely keep all SFCs under one folder, especially in Nuxt or monorepos.
|
|
915
|
-
- **Benefit:** generation sees the same files your app actually uses.
|
|
916
|
-
- **Without it:** the generator scans `src`.
|
|
917
|
-
- **Example:**
|
|
918
|
-
|
|
919
|
-
```ts
|
|
920
|
-
injection: { scanDirs: ["src", "components", "layouts"] }
|
|
921
|
-
```
|
|
922
|
-
|
|
923
962
|
#### `injection.wrapperSearchRoots`
|
|
924
963
|
|
|
925
|
-
- **What it does:** Adds extra roots for wrapper inference outside
|
|
964
|
+
- **What it does:** Adds extra roots for wrapper inference outside the configured page/component/layout directories.
|
|
926
965
|
- **Why it exists:** wrapper components often live in sibling packages or shared UI workspaces.
|
|
927
966
|
- **Benefit:** local wrapper inference can still work across package boundaries.
|
|
928
|
-
- **Without it:** no extra wrapper lookup is done outside the
|
|
967
|
+
- **Without it:** no extra wrapper lookup is done outside the configured app directories.
|
|
929
968
|
- **Example:**
|
|
930
969
|
|
|
931
970
|
```ts
|
|
@@ -1011,13 +1050,13 @@ If omitted, router introspection is off.
|
|
|
1011
1050
|
|
|
1012
1051
|
#### `generation.router.type`
|
|
1013
1052
|
|
|
1014
|
-
- **What it does:** Chooses the router discovery strategy.
|
|
1015
|
-
- **Why it exists:**
|
|
1016
|
-
- **Benefit:**
|
|
1053
|
+
- **What it does:** Chooses the Vue-router discovery strategy for standard Vue apps.
|
|
1054
|
+
- **Why it exists:** some Vue apps want router introspection without any Nuxt integration.
|
|
1055
|
+
- **Benefit:** keeps Vue-router discovery explicit.
|
|
1017
1056
|
- **Without it:** defaults to `"vue-router"`.
|
|
1057
|
+
- **Nuxt note:** Nuxt projects are auto-detected. Do not set `generation.router.type: "nuxt"`.
|
|
1018
1058
|
- **Current options:**
|
|
1019
1059
|
- `"vue-router"`
|
|
1020
|
-
- `"nuxt"`
|
|
1021
1060
|
|
|
1022
1061
|
#### `generation.router.moduleShims`
|
|
1023
1062
|
|
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,30 +1,63 @@
|
|
|
1
|
-
●
|
|
1
|
+
● # Release Notes: v1.0.53
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
3
|
+
## Highlights
|
|
4
|
+
|
|
5
|
+
- **Nuxt auto-detection**: Framework mode is now automatically detected—no manual configuration
|
|
6
|
+
required
|
|
7
|
+
- **Simplified configuration**: Removed `scanDirs` option in favor of automatic discovery
|
|
8
|
+
- **Improved dev-mode reliability**: Multiple fixes for Nuxt app-root POM generation and
|
|
9
|
+
snapshot preservation
|
|
10
|
+
- **Cleaner codebase**: Removed unused generation-metrics feature
|
|
6
11
|
|
|
7
12
|
## Changes
|
|
8
13
|
|
|
14
|
+
### Configuration & Auto-detection
|
|
15
|
+
- Auto-detect Nuxt mode without requiring explicit `mode` config
|
|
16
|
+
- Remove `scanDirs` configuration option (replaced by automatic discovery)
|
|
17
|
+
|
|
9
18
|
### Bug Fixes
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
19
|
+
- Resolve Nuxt app-root dev POM clobber issue
|
|
20
|
+
- Preserve richer dev POM snapshots during generation
|
|
21
|
+
- Confirm incomplete dev snapshots to prevent silent failures
|
|
13
22
|
|
|
14
|
-
###
|
|
15
|
-
-
|
|
23
|
+
### Internal
|
|
24
|
+
- Add dedicated Nuxt discovery module (`plugin/nuxt-discovery.ts`)
|
|
25
|
+
- Remove generation-metrics feature and associated code
|
|
26
|
+
- Refactor path utilities and plugin creation logic
|
|
16
27
|
|
|
17
28
|
## Breaking Changes
|
|
18
29
|
|
|
19
|
-
|
|
30
|
+
- **Removed `scanDirs` config option**: The plugin now uses automatic directory discovery.
|
|
31
|
+
Remove any `scanDirs` configuration from your setup.
|
|
32
|
+
- **Removed generation-metrics**: The generation metrics tracking feature has been removed along
|
|
33
|
+
with `plugin/support/generation-metrics.ts`.
|
|
20
34
|
|
|
21
35
|
## Pull Requests Included
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
-
|
|
37
|
+
- #15 [fix: resolve Nuxt app-root dev POM
|
|
38
|
+
clobber](https://github.com/immense/vue-pom-generator/pull/15) (@dkattan)
|
|
39
|
+
- #13 [Relax Vite peer dependency range](https://github.com/immense/vue-pom-generator/pull/13)
|
|
40
|
+
(@Copilot)
|
|
41
|
+
- #12 [feat: add split Playwright POM output for
|
|
42
|
+
discoverability](https://github.com/immense/vue-pom-generator/pull/12) (@dkattan)
|
|
43
|
+
- #11 [feat: fail fast on unnameable wrapper
|
|
44
|
+
handlers](https://github.com/immense/vue-pom-generator/pull/11) (@dkattan)
|
|
45
|
+
- #8 [chore: bump version to 1.0.43](https://github.com/immense/vue-pom-generator/pull/8)
|
|
46
|
+
(@mayfieldiv)
|
|
47
|
+
- #7 [test: add build–serve parity regression
|
|
48
|
+
tests](https://github.com/immense/vue-pom-generator/pull/7) (@mayfieldiv)
|
|
49
|
+
- #6 [fix: fail fast on dev snapshot generation
|
|
50
|
+
errors](https://github.com/immense/vue-pom-generator/pull/6) (@dkattan)
|
|
51
|
+
- #5 [fix: dev-mode POM generation parity with build
|
|
52
|
+
mode](https://github.com/immense/vue-pom-generator/pull/5) (@mayfieldiv)
|
|
53
|
+
- #4 [Fix keyed POM dedupe and C# navigation
|
|
54
|
+
returns](https://github.com/immense/vue-pom-generator/pull/4) (@dkattan)
|
|
55
|
+
- #1 [Add PR release-notes preview
|
|
56
|
+
comments](https://github.com/immense/vue-pom-generator/pull/1) (@dkattan)
|
|
25
57
|
|
|
26
58
|
## Testing
|
|
27
59
|
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
Added `tests/nuxt-discovery.test.ts` for new Nuxt auto-detection. Significantly expanded
|
|
61
|
+
`tests/build-serve-parity.test.ts` (+210 lines) and updated multiple test suites for
|
|
62
|
+
configuration and dev-plugin changes.
|
|
30
63
|
|
|
@@ -18,9 +18,7 @@ import {
|
|
|
18
18
|
createClassConstructor,
|
|
19
19
|
createClassMethod,
|
|
20
20
|
createClassProperty,
|
|
21
|
-
renderClassMembers as renderTsMorphClassMembers,
|
|
22
21
|
renderSourceFile,
|
|
23
|
-
renderTypeScript,
|
|
24
22
|
StructureKind,
|
|
25
23
|
VariableDeclarationKind,
|
|
26
24
|
type ConstructorDeclarationStructure,
|
|
@@ -31,8 +29,6 @@ import {
|
|
|
31
29
|
type PropertyDeclarationStructure,
|
|
32
30
|
type TypeScriptClassMember,
|
|
33
31
|
type TypeScriptSourceFile,
|
|
34
|
-
type TypeScriptWriter,
|
|
35
|
-
writeCommentBlock,
|
|
36
32
|
} from "../typescript-codegen";
|
|
37
33
|
import {
|
|
38
34
|
IComponentDependencies,
|
|
@@ -53,7 +49,6 @@ export { generateViewObjectModelMethodContent };
|
|
|
53
49
|
|
|
54
50
|
const GENERATED_GITATTRIBUTES_BLOCK_START = "# BEGIN vue-pom-generator generated files";
|
|
55
51
|
const GENERATED_GITATTRIBUTES_BLOCK_END = "# END vue-pom-generator generated files";
|
|
56
|
-
const eslintSuppressionHeader = "/* eslint-disable perfectionist/sort-imports */\n";
|
|
57
52
|
const VUE_POM_GENERATOR_ERROR_PREFIX = "[vue-pom-generator]" as const;
|
|
58
53
|
|
|
59
54
|
class VuePomGeneratorError extends Error {
|
|
@@ -66,43 +61,6 @@ class VuePomGeneratorError extends Error {
|
|
|
66
61
|
}
|
|
67
62
|
}
|
|
68
63
|
|
|
69
|
-
function renderClassMembers(write: (writer: TypeScriptWriter) => void): string {
|
|
70
|
-
const content = renderTypeScript((writer) => {
|
|
71
|
-
writer.indent(() => {
|
|
72
|
-
write(writer);
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
return content.endsWith("\n") ? content : `${content}\n`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function writeMemberBlock(writer: TypeScriptWriter, signature: string, body: (writer: TypeScriptWriter) => void): void {
|
|
79
|
-
writer.write(`${signature} `).block(() => {
|
|
80
|
-
body(writer);
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
function writeClassMembersText(writer: TypeScriptWriter, content: string): void {
|
|
85
|
-
if (!content) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
const normalized = content
|
|
90
|
-
.replace(/\r\n/g, "\n")
|
|
91
|
-
.split("\n")
|
|
92
|
-
.map(line => line.startsWith(" ") ? line.slice(4) : line)
|
|
93
|
-
.join("\n");
|
|
94
|
-
|
|
95
|
-
writer.write(normalized.endsWith("\n") ? normalized : `${normalized}\n`);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function writeGeneratedMembers(writer: TypeScriptWriter, members: TypeScriptClassMember[]): void {
|
|
99
|
-
if (!members.length) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
writeClassMembersText(writer, renderTsMorphClassMembers(members));
|
|
104
|
-
}
|
|
105
|
-
|
|
106
64
|
function splitParameterList(parameters: string): string[] {
|
|
107
65
|
const parts: string[] = [];
|
|
108
66
|
let current = "";
|
|
@@ -378,23 +336,29 @@ async function getRouteMetaByComponent(
|
|
|
378
336
|
routerEntry?: string,
|
|
379
337
|
routerType?: "vue-router" | "nuxt",
|
|
380
338
|
options: {
|
|
381
|
-
|
|
382
|
-
|
|
339
|
+
pageDirs?: string[];
|
|
340
|
+
componentDirs?: string[];
|
|
341
|
+
layoutDirs?: string[];
|
|
383
342
|
} = {},
|
|
384
343
|
): Promise<Record<string, RouteMeta>> {
|
|
385
344
|
const root = projectRoot ?? process.cwd();
|
|
386
|
-
const
|
|
387
|
-
const
|
|
388
|
-
const
|
|
345
|
+
const pageDirs = options.pageDirs?.length ? options.pageDirs : ["src/views"];
|
|
346
|
+
const pageDirsAbs = pageDirs.map(dir => path.isAbsolute(dir) ? dir : path.resolve(root, dir));
|
|
347
|
+
const primaryPageDirAbs = pageDirsAbs[0] ?? path.resolve(root, "src/views");
|
|
348
|
+
const sourceDirs = [
|
|
349
|
+
...pageDirs,
|
|
350
|
+
...(options.componentDirs?.length ? options.componentDirs : ["src/components"]),
|
|
351
|
+
...(options.layoutDirs?.length ? options.layoutDirs : ["src/layouts"]),
|
|
352
|
+
];
|
|
389
353
|
const extraRoots = process.cwd() !== root ? [process.cwd()] : [];
|
|
390
354
|
|
|
391
355
|
const { routeMetaEntries } = routerType === "nuxt"
|
|
392
|
-
? await introspectNuxtPages(root)
|
|
356
|
+
? await introspectNuxtPages(root, { pageDirs: pageDirsAbs })
|
|
393
357
|
: await parseRouterFileFromCwd(resolveRouterEntry(root, routerEntry), {
|
|
394
358
|
componentNaming: {
|
|
395
359
|
projectRoot: root,
|
|
396
|
-
viewsDirAbs,
|
|
397
|
-
|
|
360
|
+
viewsDirAbs: primaryPageDirAbs,
|
|
361
|
+
sourceDirs,
|
|
398
362
|
extraRoots,
|
|
399
363
|
},
|
|
400
364
|
});
|
|
@@ -729,8 +693,9 @@ export interface GenerateFilesOptions {
|
|
|
729
693
|
/** The type of router introspection to perform. */
|
|
730
694
|
routerType?: "vue-router" | "nuxt";
|
|
731
695
|
|
|
732
|
-
|
|
733
|
-
|
|
696
|
+
pageDirs?: string[];
|
|
697
|
+
componentDirs?: string[];
|
|
698
|
+
layoutDirs?: string[];
|
|
734
699
|
|
|
735
700
|
routeMetaByComponent?: Record<string, RouteMeta>;
|
|
736
701
|
}
|
|
@@ -791,8 +756,9 @@ export async function generateFiles(
|
|
|
791
756
|
vueRouterFluentChaining,
|
|
792
757
|
routerEntry,
|
|
793
758
|
routerType,
|
|
794
|
-
|
|
795
|
-
|
|
759
|
+
pageDirs,
|
|
760
|
+
componentDirs,
|
|
761
|
+
layoutDirs,
|
|
796
762
|
routeMetaByComponent: routeMetaByComponentOverride,
|
|
797
763
|
} = options;
|
|
798
764
|
|
|
@@ -805,8 +771,9 @@ export async function generateFiles(
|
|
|
805
771
|
const routeMetaByComponent = routeMetaByComponentOverride
|
|
806
772
|
?? (vueRouterFluentChaining
|
|
807
773
|
? await getRouteMetaByComponent(projectRoot, routerEntry, routerType, {
|
|
808
|
-
|
|
809
|
-
|
|
774
|
+
pageDirs,
|
|
775
|
+
componentDirs,
|
|
776
|
+
layoutDirs,
|
|
810
777
|
})
|
|
811
778
|
: undefined);
|
|
812
779
|
const generatedFilePaths: string[] = [];
|
|
@@ -2418,10 +2385,6 @@ function buildRuntimeGeneratedFilesFromSpecs(assetSpecs: RuntimeGeneratedAssetSp
|
|
|
2418
2385
|
}));
|
|
2419
2386
|
}
|
|
2420
2387
|
|
|
2421
|
-
function buildRuntimeGeneratedBarrelExports(outputDir: string, assetSpecs: RuntimeGeneratedAssetSpec[]): string[] {
|
|
2422
|
-
return assetSpecs.map(spec => `export * from "${stripExtension(toPosixRelativePath(outputDir, spec.outputPath))}";`);
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
2388
|
function resolveCustomPomImportResolution(
|
|
2426
2389
|
generatedClassNames: Set<string>,
|
|
2427
2390
|
projectRoot: string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base-page.d.ts","sourceRoot":"","sources":["../../class-generation/base-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,KAAK,EAAE,iBAAiB,EAAyB,MAAM,WAAW,CAAC;AAe1E;;;;;;;;GAQG;AACH;;;GAGG;AACH,KAAK,UAAU,CAAC,CAAC,EAAE,KAAK,SAAS,MAAM,IAAI;KACxC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,EAAE,GACzD,CAAC,SAAS,aAAa,GACvB,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,EAAE,CA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,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIzE;;;;OAIG;cACa,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAInE;;;;OAIG;cACa,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIvE;;;;;;OAMG;cACa,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAI5F;;;OAGG;cACa,aAAa,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM5D;;;;OAIG;cACa,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG7E"}
|
|
@@ -91,8 +91,9 @@ export interface GenerateFilesOptions {
|
|
|
91
91
|
routerEntry?: string;
|
|
92
92
|
/** The type of router introspection to perform. */
|
|
93
93
|
routerType?: "vue-router" | "nuxt";
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
pageDirs?: string[];
|
|
95
|
+
componentDirs?: string[];
|
|
96
|
+
layoutDirs?: string[];
|
|
96
97
|
routeMetaByComponent?: Record<string, RouteMeta>;
|
|
97
98
|
}
|
|
98
99
|
export declare function generateFiles(componentHierarchyMap: Map<string, IComponentDependencies>, vueFilesPathMap: Map<string, string>, basePageClassPath: string, options?: GenerateFilesOptions): Promise<void>;
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":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AC7B,MAAM,CAAC,EAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IAEF,6EAA6E;IAC7E,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAElC,2FAA2F;IAC3F,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,mDAAmD;IACnD,UAAU,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAEnC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IAEtB,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;CAClD;AAqCD,wBAAsB,aAAa,CACjC,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAC1D,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,iBAAiB,EAAE,MAAM,EACzB,OAAO,GAAE,oBAAyB,iBAiGnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.ts"],"names":[],"mappings":";AAEA,
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../eslint.config.ts"],"names":[],"mappings":";AAEA,wBAsGG"}
|