@immense/vue-pom-generator 1.0.51 → 1.0.52
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 +2 -0
- package/RELEASE_NOTES.md +28 -15
- package/class-generation/base-page.ts +0 -1
- package/class-generation/index.ts +0 -46
- package/dist/class-generation/base-page.d.ts.map +1 -1
- package/dist/class-generation/index.d.ts.map +1 -1
- package/dist/eslint.config.d.ts.map +1 -1
- package/dist/index.cjs +52 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +52 -22
- package/dist/index.mjs.map +1 -1
- 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/README.md
CHANGED
package/RELEASE_NOTES.md
CHANGED
|
@@ -1,30 +1,43 @@
|
|
|
1
|
-
●
|
|
1
|
+
● # Release Notes: v1.0.52
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
-
|
|
3
|
+
## Highlights
|
|
4
|
+
|
|
5
|
+
- Relaxed Vite peer dependency constraint to support newer Vite versions
|
|
6
|
+
- Improved AST-based handling of nullish coalescing in key expressions
|
|
7
|
+
- Fixed repository-wide lint failures and updated lint configuration
|
|
8
|
+
- Enhanced test coverage for utility functions and transform edge cases
|
|
6
9
|
|
|
7
10
|
## Changes
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
**Dependencies**
|
|
13
|
+
- Relaxed Vite peer dependency version range to improve compatibility with downstream projects
|
|
14
|
+
|
|
15
|
+
**Code Quality & Linting**
|
|
16
|
+
- Added ESLint rule exceptions for generated runtime code patterns
|
|
17
|
+
- Clarified AST and lint rule interactions in configuration
|
|
18
|
+
- Polished lint cleanup helper utilities
|
|
19
|
+
- Fixed existing lint violations across the codebase
|
|
20
|
+
|
|
21
|
+
**AST & Transform Logic**
|
|
22
|
+
- Implemented AST-based splitting for nullish coalescing key expressions
|
|
23
|
+
- Updated transform logic to handle edge cases more robustly
|
|
24
|
+
- Improved runtime generation to meet updated lint expectations
|
|
13
25
|
|
|
14
|
-
|
|
15
|
-
- Added
|
|
26
|
+
**Testing**
|
|
27
|
+
- Added test coverage for new utility functions
|
|
28
|
+
- Updated test expectations for class generation coverage
|
|
29
|
+
- Enhanced transform tests with additional edge case scenarios
|
|
16
30
|
|
|
17
31
|
## Breaking Changes
|
|
18
32
|
|
|
19
|
-
None
|
|
33
|
+
None.
|
|
20
34
|
|
|
21
35
|
## Pull Requests Included
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
- Internal commit: fix: upstream runtime headers (9b96445)
|
|
37
|
+
- #13 Relax Vite peer dependency range (https://github.com/immense/vue-pom-generator/pull/13)
|
|
25
38
|
|
|
26
39
|
## Testing
|
|
27
40
|
|
|
28
|
-
|
|
29
|
-
|
|
41
|
+
All changes validated through existing test suite (`npm test`). Added test coverage for new
|
|
42
|
+
utility functions and transform edge cases.
|
|
30
43
|
|
|
@@ -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 = "";
|
|
@@ -2418,10 +2376,6 @@ function buildRuntimeGeneratedFilesFromSpecs(assetSpecs: RuntimeGeneratedAssetSp
|
|
|
2418
2376
|
}));
|
|
2419
2377
|
}
|
|
2420
2378
|
|
|
2421
|
-
function buildRuntimeGeneratedBarrelExports(outputDir: string, assetSpecs: RuntimeGeneratedAssetSpec[]): string[] {
|
|
2422
|
-
return assetSpecs.map(spec => `export * from "${stripExtension(toPosixRelativePath(outputDir, spec.outputPath))}";`);
|
|
2423
|
-
}
|
|
2424
|
-
|
|
2425
2379
|
function resolveCustomPomImportResolution(
|
|
2426
2380
|
generatedClassNames: Set<string>,
|
|
2427
2381
|
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,CAAC,CAAC,GACxC,CAAC,SAAS,kBAAkB,GAC5B,CAAC,GAAG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,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"}
|
|
@@ -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":"AAUA,OAAO,EAAkC,oCAAoC,EAAE,MAAM,sBAAsB,CAAC;AAsB5G,OAAO,EACL,sBAAsB,EAMvB,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,oCAAoC,EAAE,CAAC;AAqKhD,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AASD,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,EAAE,OAAO,GAAG,YAAY,GAAG,MAAM,GAAG,oBAAoB,CAAC;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AASD,MAAM,MAAM,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AE,sBAAsB,CAAC,EAC1D,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACpC,iBAAiB,EAAE,MAAM,EACzB,OAAO,GAAE,oBAAyB,iBA+FnC"}
|
|
@@ -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"}
|
package/dist/index.cjs
CHANGED
|
@@ -769,7 +769,14 @@ function getTemplateSlotScope(node) {
|
|
|
769
769
|
return null;
|
|
770
770
|
}
|
|
771
771
|
function isSimpleScopeIdentifier(value) {
|
|
772
|
-
|
|
772
|
+
if (!value) {
|
|
773
|
+
return false;
|
|
774
|
+
}
|
|
775
|
+
try {
|
|
776
|
+
return types.isIdentifier(parser.parseExpression(value, { plugins: ["typescript"] }));
|
|
777
|
+
} catch {
|
|
778
|
+
return false;
|
|
779
|
+
}
|
|
773
780
|
}
|
|
774
781
|
function buildSlotScopeFallbackKeyExpression(identifier) {
|
|
775
782
|
return `${identifier}.key ?? ${identifier}.data?.id ?? ${identifier}.id ?? ${identifier}.value ?? ${identifier}`;
|
|
@@ -789,6 +796,29 @@ function tryGetBindingIdentifierName(node) {
|
|
|
789
796
|
}
|
|
790
797
|
return null;
|
|
791
798
|
}
|
|
799
|
+
function splitNullishCoalescingExpression(expr) {
|
|
800
|
+
const ast = parser.parseExpression(expr, { plugins: ["typescript"] });
|
|
801
|
+
const toSourceText = (node) => {
|
|
802
|
+
if (node.start == null || node.end == null) {
|
|
803
|
+
throw new Error("[vue-pom-generator] Unable to recover source for nullish-coalescing expression.");
|
|
804
|
+
}
|
|
805
|
+
return expr.slice(node.start, node.end).trim();
|
|
806
|
+
};
|
|
807
|
+
const parts = [];
|
|
808
|
+
const visit = (node) => {
|
|
809
|
+
if (types.isLogicalExpression(node) && node.operator === "??") {
|
|
810
|
+
visit(node.left);
|
|
811
|
+
visit(node.right);
|
|
812
|
+
return;
|
|
813
|
+
}
|
|
814
|
+
const candidate = toSourceText(node);
|
|
815
|
+
if (candidate) {
|
|
816
|
+
parts.push(candidate);
|
|
817
|
+
}
|
|
818
|
+
};
|
|
819
|
+
visit(ast);
|
|
820
|
+
return parts;
|
|
821
|
+
}
|
|
792
822
|
function getSlotScopeObjectPropertyKeyName(node) {
|
|
793
823
|
if (types.isIdentifier(node)) {
|
|
794
824
|
return node.name;
|
|
@@ -2045,7 +2075,7 @@ function applyResolvedDataTestId(args) {
|
|
|
2045
2075
|
if (!expr) {
|
|
2046
2076
|
return [];
|
|
2047
2077
|
}
|
|
2048
|
-
return expr
|
|
2078
|
+
return splitNullishCoalescingExpression(expr);
|
|
2049
2079
|
};
|
|
2050
2080
|
let dataTestId = args.preferredGeneratedValue;
|
|
2051
2081
|
let fromExisting = false;
|
|
@@ -7988,6 +8018,26 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
7988
8018
|
const loggerRef = {
|
|
7989
8019
|
current: createLogger({ verbosity })
|
|
7990
8020
|
};
|
|
8021
|
+
const getViewsDirAbs = () => resolveFromProjectRoot(projectRootRef.current, viewsDir);
|
|
8022
|
+
const getWrapperSearchRootsAbs = () => wrapperSearchRoots.map((root) => resolveFromProjectRoot(projectRootRef.current, root));
|
|
8023
|
+
const { componentTestIds, elementMetadata, semanticNameMap, componentHierarchyMap, vueFilesPathMap } = sharedState;
|
|
8024
|
+
const { metadataCollectorPlugin, internalVuePlugin, templateCompilerOptions } = createVuePluginWithTestIds({
|
|
8025
|
+
vueOptions,
|
|
8026
|
+
existingIdBehavior,
|
|
8027
|
+
nameCollisionBehavior,
|
|
8028
|
+
nativeWrappers,
|
|
8029
|
+
elementMetadata,
|
|
8030
|
+
semanticNameMap,
|
|
8031
|
+
componentHierarchyMap,
|
|
8032
|
+
vueFilesPathMap,
|
|
8033
|
+
excludedComponents,
|
|
8034
|
+
getViewsDirAbs,
|
|
8035
|
+
testIdAttribute,
|
|
8036
|
+
loggerRef,
|
|
8037
|
+
scanDirs,
|
|
8038
|
+
getWrapperSearchRoots: getWrapperSearchRootsAbs,
|
|
8039
|
+
getProjectRoot: () => projectRootRef.current
|
|
8040
|
+
});
|
|
7991
8041
|
const configPlugin = {
|
|
7992
8042
|
name: "vue-pom-generator-config",
|
|
7993
8043
|
enforce: "pre",
|
|
@@ -8013,26 +8063,6 @@ function createVuePomGeneratorPlugins(options = {}) {
|
|
|
8013
8063
|
loggerRef.current.info(`Active plugins: ${(config.plugins ?? []).map((p) => p.name).filter((n) => n.includes("vue-pom")).join(", ")}`);
|
|
8014
8064
|
}
|
|
8015
8065
|
};
|
|
8016
|
-
const getViewsDirAbs = () => resolveFromProjectRoot(projectRootRef.current, viewsDir);
|
|
8017
|
-
const getWrapperSearchRootsAbs = () => wrapperSearchRoots.map((root) => resolveFromProjectRoot(projectRootRef.current, root));
|
|
8018
|
-
const { componentTestIds, elementMetadata, semanticNameMap, componentHierarchyMap, vueFilesPathMap } = sharedState;
|
|
8019
|
-
const { metadataCollectorPlugin, internalVuePlugin, templateCompilerOptions } = createVuePluginWithTestIds({
|
|
8020
|
-
vueOptions,
|
|
8021
|
-
existingIdBehavior,
|
|
8022
|
-
nameCollisionBehavior,
|
|
8023
|
-
nativeWrappers,
|
|
8024
|
-
elementMetadata,
|
|
8025
|
-
semanticNameMap,
|
|
8026
|
-
componentHierarchyMap,
|
|
8027
|
-
vueFilesPathMap,
|
|
8028
|
-
excludedComponents,
|
|
8029
|
-
getViewsDirAbs,
|
|
8030
|
-
testIdAttribute,
|
|
8031
|
-
loggerRef,
|
|
8032
|
-
scanDirs,
|
|
8033
|
-
getWrapperSearchRoots: getWrapperSearchRootsAbs,
|
|
8034
|
-
getProjectRoot: () => projectRootRef.current
|
|
8035
|
-
});
|
|
8036
8066
|
const routerAwarePoms = typeof routerEntry === "string" && routerEntry.trim().length > 0 || routerType === "nuxt";
|
|
8037
8067
|
const supportPlugins = createSupportPlugins({
|
|
8038
8068
|
componentTestIds,
|