@immense/vue-pom-generator 1.0.32 → 1.0.34
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 +20 -19
- package/class-generation/index.ts +29 -4
- package/dist/class-generation/index.d.ts +2 -0
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/index.cjs +409 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +409 -75
- package/dist/index.mjs.map +1 -1
- package/dist/plugin/path-utils.d.ts.map +1 -1
- package/dist/plugin/support/build-plugin.d.ts +2 -0
- package/dist/plugin/support/build-plugin.d.ts.map +1 -1
- package/dist/plugin/support/dev-plugin.d.ts.map +1 -1
- package/dist/plugin/support/generation-metrics.d.ts +10 -0
- package/dist/plugin/support/generation-metrics.d.ts.map +1 -0
- package/dist/plugin/support-plugins.d.ts.map +1 -1
- package/dist/plugin/vue-plugin.d.ts +1 -0
- package/dist/plugin/vue-plugin.d.ts.map +1 -1
- package/dist/router-introspection.d.ts +10 -0
- package/dist/router-introspection.d.ts.map +1 -1
- package/dist/tests/generation-metrics.test.d.ts +2 -0
- package/dist/tests/generation-metrics.test.d.ts.map +1 -0
- package/dist/transform.d.ts.map +1 -1
- package/dist/utils.d.ts +10 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
● #
|
|
1
|
+
● # v1.0.34
|
|
2
2
|
|
|
3
3
|
## Highlights
|
|
4
4
|
|
|
5
|
-
- Fixed
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
coverage
|
|
9
|
-
- Introduced PR release-notes preview comments via GitHub Actions
|
|
5
|
+
- Fixed strict click collision detection to prevent false positives
|
|
6
|
+
- Improved lazy route component naming for better code generation
|
|
7
|
+
- Enhanced router introspection with significant improvements to route handling
|
|
8
|
+
- Added comprehensive test coverage for class generation and router introspection
|
|
10
9
|
|
|
11
10
|
## Changes
|
|
12
11
|
|
|
13
12
|
**Bug Fixes**
|
|
14
|
-
-
|
|
15
|
-
|
|
13
|
+
- Fixed strict click collision detection logic in transform pipeline
|
|
14
|
+
- Corrected lazy route component naming in class generation
|
|
16
15
|
|
|
17
|
-
**Testing**
|
|
18
|
-
- Added
|
|
19
|
-
lines
|
|
20
|
-
-
|
|
16
|
+
**Testing & Quality**
|
|
17
|
+
- Added 70+ lines of new tests for class-generation coverage
|
|
18
|
+
- Added 64+ lines of new tests for router introspection
|
|
19
|
+
- Added 37+ lines of new tests for transform logic
|
|
21
20
|
|
|
22
|
-
**
|
|
23
|
-
-
|
|
21
|
+
**Internal Improvements**
|
|
22
|
+
- Enhanced router introspection with 140+ lines of improvements
|
|
23
|
+
- Updated plugin path utilities with better handling
|
|
24
|
+
- Improved support plugins for both build and dev modes
|
|
24
25
|
|
|
25
26
|
## Breaking Changes
|
|
26
27
|
|
|
27
|
-
None
|
|
28
|
+
None.
|
|
28
29
|
|
|
29
30
|
## Pull Requests Included
|
|
30
31
|
|
|
31
|
-
-
|
|
32
|
-
|
|
32
|
+
- #1 Add PR release-notes preview comments (https://github.com/immense/vue-pom-generator/pull/1)
|
|
33
|
+
by @dkattan
|
|
33
34
|
|
|
34
35
|
## Testing
|
|
35
36
|
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
Comprehensive test coverage added across class generation, router introspection, and transform
|
|
38
|
+
modules. All tests passing.
|
|
38
39
|
|
|
@@ -66,12 +66,27 @@ async function getRouteMetaByComponent(
|
|
|
66
66
|
projectRoot?: string,
|
|
67
67
|
routerEntry?: string,
|
|
68
68
|
routerType?: "vue-router" | "nuxt",
|
|
69
|
+
options: {
|
|
70
|
+
viewsDir?: string;
|
|
71
|
+
scanDirs?: string[];
|
|
72
|
+
} = {},
|
|
69
73
|
): Promise<Record<string, RouteMeta>> {
|
|
70
74
|
const root = projectRoot ?? process.cwd();
|
|
75
|
+
const viewsDir = options.viewsDir ?? "src/views";
|
|
76
|
+
const viewsDirAbs = path.isAbsolute(viewsDir) ? viewsDir : path.resolve(root, viewsDir);
|
|
77
|
+
const scanDirs = options.scanDirs?.length ? options.scanDirs : ["src"];
|
|
78
|
+
const extraRoots = process.cwd() !== root ? [process.cwd()] : [];
|
|
71
79
|
|
|
72
80
|
const { routeMetaEntries } = routerType === "nuxt"
|
|
73
81
|
? await introspectNuxtPages(root)
|
|
74
|
-
: await parseRouterFileFromCwd(resolveRouterEntry(root, routerEntry)
|
|
82
|
+
: await parseRouterFileFromCwd(resolveRouterEntry(root, routerEntry), {
|
|
83
|
+
componentNaming: {
|
|
84
|
+
projectRoot: root,
|
|
85
|
+
viewsDirAbs,
|
|
86
|
+
scanDirs,
|
|
87
|
+
extraRoots,
|
|
88
|
+
},
|
|
89
|
+
});
|
|
75
90
|
|
|
76
91
|
const map = new Map<string, RouteMeta[]>();
|
|
77
92
|
for (const entry of routeMetaEntries) {
|
|
@@ -382,6 +397,9 @@ export interface GenerateFilesOptions {
|
|
|
382
397
|
/** The type of router introspection to perform. */
|
|
383
398
|
routerType?: "vue-router" | "nuxt";
|
|
384
399
|
|
|
400
|
+
viewsDir?: string;
|
|
401
|
+
scanDirs?: string[];
|
|
402
|
+
|
|
385
403
|
routeMetaByComponent?: Record<string, RouteMeta>;
|
|
386
404
|
}
|
|
387
405
|
|
|
@@ -443,6 +461,9 @@ export async function generateFiles(
|
|
|
443
461
|
vueRouterFluentChaining,
|
|
444
462
|
routerEntry,
|
|
445
463
|
routerType,
|
|
464
|
+
viewsDir,
|
|
465
|
+
scanDirs,
|
|
466
|
+
routeMetaByComponent: routeMetaByComponentOverride,
|
|
446
467
|
} = options;
|
|
447
468
|
|
|
448
469
|
const emitLanguages: Array<"ts" | "csharp"> = emitLanguagesOverride?.length
|
|
@@ -451,9 +472,13 @@ export async function generateFiles(
|
|
|
451
472
|
|
|
452
473
|
const outDir = outDirOverride ?? "./pom";
|
|
453
474
|
|
|
454
|
-
const routeMetaByComponent =
|
|
455
|
-
|
|
456
|
-
|
|
475
|
+
const routeMetaByComponent = routeMetaByComponentOverride
|
|
476
|
+
?? (vueRouterFluentChaining
|
|
477
|
+
? await getRouteMetaByComponent(projectRoot, routerEntry, routerType, {
|
|
478
|
+
viewsDir,
|
|
479
|
+
scanDirs,
|
|
480
|
+
})
|
|
481
|
+
: undefined);
|
|
457
482
|
const generatedFilePaths: string[] = [];
|
|
458
483
|
const writeGeneratedFile = (file: GeneratedFileOutput) => {
|
|
459
484
|
const resolvedFilePath = path.resolve(file.filePath);
|
|
@@ -81,6 +81,8 @@ export interface GenerateFilesOptions {
|
|
|
81
81
|
routerEntry?: string;
|
|
82
82
|
/** The type of router introspection to perform. */
|
|
83
83
|
routerType?: "vue-router" | "nuxt";
|
|
84
|
+
viewsDir?: string;
|
|
85
|
+
scanDirs?: string[];
|
|
84
86
|
routeMetaByComponent?: Record<string, RouteMeta>;
|
|
85
87
|
}
|
|
86
88
|
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":"AAIA,OAAO,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAoE,MAAM,UAAU,CAAC;AAQpH,OAAO,EAAE,oCAAoC,EAAE,CAAC;AA8ChD,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../class-generation/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAoE,MAAM,UAAU,CAAC;AAQpH,OAAO,EAAE,oCAAoC,EAAE,CAAC;AA8ChD,UAAU,SAAS;IACjB,QA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