@geekles007/spring-to-ts 1.0.0
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/LICENSE +21 -0
- package/README.md +274 -0
- package/bin/spring-to-ts.js +3 -0
- package/dist/cli/cli.d.ts +3 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.js +87 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/config/config-loader.d.ts +8 -0
- package/dist/config/config-loader.d.ts.map +1 -0
- package/dist/config/config-loader.js +119 -0
- package/dist/config/config-loader.js.map +1 -0
- package/dist/generator/typescript-generator.d.ts +13 -0
- package/dist/generator/typescript-generator.d.ts.map +1 -0
- package/dist/generator/typescript-generator.js +162 -0
- package/dist/generator/typescript-generator.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +96 -0
- package/dist/index.js.map +1 -0
- package/dist/parser/entity-parser.d.ts +21 -0
- package/dist/parser/entity-parser.d.ts.map +1 -0
- package/dist/parser/entity-parser.js +193 -0
- package/dist/parser/entity-parser.js.map +1 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/file-utils.d.ts +9 -0
- package/dist/utils/file-utils.d.ts.map +1 -0
- package/dist/utils/file-utils.js +74 -0
- package/dist/utils/file-utils.js.map +1 -0
- package/dist/utils/type-mapper.d.ts +13 -0
- package/dist/utils/type-mapper.d.ts.map +1 -0
- package/dist/utils/type-mapper.js +129 -0
- package/dist/utils/type-mapper.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.TypeScriptGenerator = void 0;
|
|
37
|
+
const path = __importStar(require("path"));
|
|
38
|
+
const file_utils_1 = require("../utils/file-utils");
|
|
39
|
+
class TypeScriptGenerator {
|
|
40
|
+
constructor(config) {
|
|
41
|
+
this.config = config;
|
|
42
|
+
}
|
|
43
|
+
generate(entities) {
|
|
44
|
+
file_utils_1.FileUtils.ensureDirectoryExists(this.config.outputDir);
|
|
45
|
+
// Generate individual entity files
|
|
46
|
+
for (const entity of entities) {
|
|
47
|
+
const content = entity.isEnum
|
|
48
|
+
? this.generateEnum(entity)
|
|
49
|
+
: this.generateInterface(entity, entities);
|
|
50
|
+
const fileName = `${entity.name}.ts`;
|
|
51
|
+
const filePath = path.join(this.config.outputDir, fileName);
|
|
52
|
+
file_utils_1.FileUtils.writeFile(filePath, content);
|
|
53
|
+
}
|
|
54
|
+
// Generate index file
|
|
55
|
+
this.generateIndexFile(entities);
|
|
56
|
+
}
|
|
57
|
+
generateInterface(entity, allEntities) {
|
|
58
|
+
const imports = this.generateImports(entity, allEntities);
|
|
59
|
+
const documentation = this.generateDocumentation(entity.documentation);
|
|
60
|
+
const interfaceName = entity.name;
|
|
61
|
+
let content = '';
|
|
62
|
+
if (imports) {
|
|
63
|
+
content += imports + '\n\n';
|
|
64
|
+
}
|
|
65
|
+
if (documentation) {
|
|
66
|
+
content += documentation;
|
|
67
|
+
}
|
|
68
|
+
content += `export interface ${interfaceName} {\n`;
|
|
69
|
+
// Add fields
|
|
70
|
+
for (const field of entity.fields) {
|
|
71
|
+
const fieldDoc = this.generateFieldDocumentation(field.annotations);
|
|
72
|
+
if (fieldDoc) {
|
|
73
|
+
content += fieldDoc;
|
|
74
|
+
}
|
|
75
|
+
const optionalMarker = field.nullable ? '?' : '';
|
|
76
|
+
content += ` ${field.name}${optionalMarker}: ${field.type};\n`;
|
|
77
|
+
}
|
|
78
|
+
// Add relations
|
|
79
|
+
if (this.config.includeRelations) {
|
|
80
|
+
for (const relation of entity.relations) {
|
|
81
|
+
const optionalMarker = relation.nullable ? '?' : '';
|
|
82
|
+
const relationType = relation.isArray ? `${relation.targetEntity}[]` : relation.targetEntity;
|
|
83
|
+
content += ` ${relation.name}${optionalMarker}: ${relationType};\n`;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
content += '}\n';
|
|
87
|
+
return content;
|
|
88
|
+
}
|
|
89
|
+
generateEnum(entity) {
|
|
90
|
+
const documentation = this.generateDocumentation(entity.documentation);
|
|
91
|
+
let content = '';
|
|
92
|
+
if (documentation) {
|
|
93
|
+
content += documentation;
|
|
94
|
+
}
|
|
95
|
+
content += `export enum ${entity.name} {\n`;
|
|
96
|
+
if (entity.enumValues) {
|
|
97
|
+
for (const value of entity.enumValues) {
|
|
98
|
+
content += ` ${value} = '${value}',\n`;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
content += '}\n';
|
|
102
|
+
return content;
|
|
103
|
+
}
|
|
104
|
+
generateImports(entity, allEntities) {
|
|
105
|
+
const imports = new Set();
|
|
106
|
+
// Check relations for imports
|
|
107
|
+
for (const relation of entity.relations) {
|
|
108
|
+
const targetEntity = allEntities.find((e) => e.name === relation.targetEntity);
|
|
109
|
+
if (targetEntity && targetEntity.name !== entity.name) {
|
|
110
|
+
imports.add(relation.targetEntity);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
// Check field types for custom entities
|
|
114
|
+
for (const field of entity.fields) {
|
|
115
|
+
const fieldEntity = allEntities.find((e) => e.name === field.type);
|
|
116
|
+
if (fieldEntity && fieldEntity.name !== entity.name) {
|
|
117
|
+
imports.add(field.type);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (imports.size === 0) {
|
|
121
|
+
return '';
|
|
122
|
+
}
|
|
123
|
+
const importStatements = Array.from(imports)
|
|
124
|
+
.sort()
|
|
125
|
+
.map((imp) => `import { ${imp} } from './${imp}';`)
|
|
126
|
+
.join('\n');
|
|
127
|
+
return importStatements;
|
|
128
|
+
}
|
|
129
|
+
generateDocumentation(doc) {
|
|
130
|
+
if (!doc)
|
|
131
|
+
return '';
|
|
132
|
+
const lines = doc.split('\n');
|
|
133
|
+
let result = '/**\n';
|
|
134
|
+
for (const line of lines) {
|
|
135
|
+
result += ` * ${line}\n`;
|
|
136
|
+
}
|
|
137
|
+
result += ' */\n';
|
|
138
|
+
return result;
|
|
139
|
+
}
|
|
140
|
+
generateFieldDocumentation(annotations) {
|
|
141
|
+
const relevantAnnotations = annotations.filter((a) => a.includes('NotNull') ||
|
|
142
|
+
a.includes('NotBlank') ||
|
|
143
|
+
a.includes('Size') ||
|
|
144
|
+
a.includes('Email') ||
|
|
145
|
+
a.includes('Pattern'));
|
|
146
|
+
if (relevantAnnotations.length === 0 || !this.config.includeValidation) {
|
|
147
|
+
return '';
|
|
148
|
+
}
|
|
149
|
+
return ` /** Validations: ${relevantAnnotations.join(', ')} */\n`;
|
|
150
|
+
}
|
|
151
|
+
generateIndexFile(entities) {
|
|
152
|
+
let content = '// Auto-generated barrel file\n\n';
|
|
153
|
+
const sortedEntities = [...entities].sort((a, b) => a.name.localeCompare(b.name));
|
|
154
|
+
for (const entity of sortedEntities) {
|
|
155
|
+
content += `export * from './${entity.name}';\n`;
|
|
156
|
+
}
|
|
157
|
+
const indexPath = path.join(this.config.outputDir, 'index.ts');
|
|
158
|
+
file_utils_1.FileUtils.writeFile(indexPath, content);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
exports.TypeScriptGenerator = TypeScriptGenerator;
|
|
162
|
+
//# sourceMappingURL=typescript-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-generator.js","sourceRoot":"","sources":["../../src/generator/typescript-generator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,oDAAgD;AAEhD,MAAa,mBAAmB;IAG9B,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,QAAQ,CAAC,QAAwB;QAC/B,sBAAS,CAAC,qBAAqB,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEvD,mCAAmC;QACnC,KAAK,MAAM,MAAM,IAAI,QAAQ,EAAE,CAAC;YAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM;gBAC3B,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CA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,SAAS,EAAE,OAAO,CAAC,CAAC;IAC1C,CAAC;CACF;AAnKD,kDAmKC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ConfigLoader } from './config/config-loader';
|
|
2
|
+
import { SpringToTsConfig } from './types';
|
|
3
|
+
export declare class SpringToTsConverter {
|
|
4
|
+
private config;
|
|
5
|
+
private typeMapper;
|
|
6
|
+
private entityParser;
|
|
7
|
+
private generator;
|
|
8
|
+
constructor(config: SpringToTsConfig);
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
private generateTypes;
|
|
11
|
+
private startWatchMode;
|
|
12
|
+
}
|
|
13
|
+
export { ConfigLoader, SpringToTsConfig };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAKtD,OAAO,EAAE,gBAAgB,EAAgB,MAAM,SAAS,CAAC;AAEzD,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,SAAS,CAAsB;gBAE3B,MAAM,EAAE,gBAAgB;IAO9B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAmBZ,aAAa;IA2B3B,OAAO,CAAC,cAAc;CAwCvB;AAED,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ConfigLoader = exports.SpringToTsConverter = void 0;
|
|
7
|
+
const chokidar_1 = __importDefault(require("chokidar"));
|
|
8
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const config_loader_1 = require("./config/config-loader");
|
|
10
|
+
Object.defineProperty(exports, "ConfigLoader", { enumerable: true, get: function () { return config_loader_1.ConfigLoader; } });
|
|
11
|
+
const entity_parser_1 = require("./parser/entity-parser");
|
|
12
|
+
const typescript_generator_1 = require("./generator/typescript-generator");
|
|
13
|
+
const type_mapper_1 = require("./utils/type-mapper");
|
|
14
|
+
const file_utils_1 = require("./utils/file-utils");
|
|
15
|
+
class SpringToTsConverter {
|
|
16
|
+
constructor(config) {
|
|
17
|
+
this.config = config;
|
|
18
|
+
this.typeMapper = new type_mapper_1.TypeMapper(config);
|
|
19
|
+
this.entityParser = new entity_parser_1.EntityParser(this.typeMapper);
|
|
20
|
+
this.generator = new typescript_generator_1.TypeScriptGenerator(config);
|
|
21
|
+
}
|
|
22
|
+
async run() {
|
|
23
|
+
console.log(chalk_1.default.blue('🚀 Spring to TypeScript Generator'));
|
|
24
|
+
console.log(chalk_1.default.gray(`Source: ${this.config.sourceDir}`));
|
|
25
|
+
console.log(chalk_1.default.gray(`Output: ${this.config.outputDir}`));
|
|
26
|
+
console.log();
|
|
27
|
+
try {
|
|
28
|
+
await this.generateTypes();
|
|
29
|
+
console.log(chalk_1.default.green('✅ Generation completed successfully!'));
|
|
30
|
+
if (this.config.watch) {
|
|
31
|
+
this.startWatchMode();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
console.error(chalk_1.default.red('❌ Generation failed:'), error);
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
async generateTypes() {
|
|
40
|
+
const files = await file_utils_1.FileUtils.findSourceFiles(this.config.sourceDir, this.config.excludePatterns);
|
|
41
|
+
console.log(chalk_1.default.blue(`Found ${files.length} source files`));
|
|
42
|
+
const entities = [];
|
|
43
|
+
for (const file of files) {
|
|
44
|
+
const content = file_utils_1.FileUtils.readFile(file);
|
|
45
|
+
const entity = this.entityParser.parse(content, file);
|
|
46
|
+
if (entity) {
|
|
47
|
+
entities.push(entity);
|
|
48
|
+
console.log(chalk_1.default.gray(` ✓ Parsed ${entity.name}`));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
console.log(chalk_1.default.blue(`\nGenerating TypeScript types for ${entities.length} entities...`));
|
|
52
|
+
this.generator.generate(entities);
|
|
53
|
+
console.log(chalk_1.default.gray(` ✓ Generated types in ${this.config.outputDir}`));
|
|
54
|
+
}
|
|
55
|
+
startWatchMode() {
|
|
56
|
+
console.log(chalk_1.default.yellow('\n👀 Watch mode enabled. Watching for changes...'));
|
|
57
|
+
console.log(chalk_1.default.gray('Press Ctrl+C to stop\n'));
|
|
58
|
+
const watcher = chokidar_1.default.watch(`${this.config.sourceDir}/**/*.{kt,java}`, {
|
|
59
|
+
ignored: this.config.excludePatterns,
|
|
60
|
+
persistent: true,
|
|
61
|
+
ignoreInitial: true,
|
|
62
|
+
});
|
|
63
|
+
watcher.on('change', async (filePath) => {
|
|
64
|
+
console.log(chalk_1.default.yellow(`\n📝 File changed: ${filePath}`));
|
|
65
|
+
try {
|
|
66
|
+
await this.generateTypes();
|
|
67
|
+
console.log(chalk_1.default.green('✅ Regeneration completed!'));
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
console.error(chalk_1.default.red('❌ Regeneration failed:'), error);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
watcher.on('add', async (filePath) => {
|
|
74
|
+
console.log(chalk_1.default.yellow(`\n➕ File added: ${filePath}`));
|
|
75
|
+
try {
|
|
76
|
+
await this.generateTypes();
|
|
77
|
+
console.log(chalk_1.default.green('✅ Regeneration completed!'));
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
console.error(chalk_1.default.red('❌ Regeneration failed:'), error);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
watcher.on('unlink', async (filePath) => {
|
|
84
|
+
console.log(chalk_1.default.yellow(`\n🗑️ File removed: ${filePath}`));
|
|
85
|
+
try {
|
|
86
|
+
await this.generateTypes();
|
|
87
|
+
console.log(chalk_1.default.green('✅ Regeneration completed!'));
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
console.error(chalk_1.default.red('❌ Regeneration failed:'), error);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
exports.SpringToTsConverter = SpringToTsConverter;
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;AAAA,wDAAgC;AAChC,kDAA0B;AAC1B,0DAAsD;AA4G7C,6FA5GA,4BAAY,OA4GA;AA3GrB,0DAAsD;AACtD,2EAAuE;AACvE,qDAAiD;AACjD,mDAA+C;AAG/C,MAAa,mBAAmB;IAM9B,YAAY,MAAwB;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,IAAI,wBAAU,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,IAAI,4BAAY,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACtD,IAAI,CAAC,SAAS,GAAG,IAAI,0CAAmB,CAAC,MAAM,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,GAAG;QACP,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAC5D,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,M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YACnC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,mBAAmB,QAAQ,EAAE,CAAC,CAAC,CAAC;YACzD,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;gBAC3B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;YACxD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACtC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,MAAM,CAAC,wBAAwB,QAAQ,EAAE,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;gBAC3B,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,2BAA2B,CAAC,CAAC,CAAC;YACxD,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,KAAK,CAAC,CAAC;YAC5D,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AAnGD,kDAmGC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ParsedEntity } from '../types';
|
|
2
|
+
import { TypeMapper } from '../utils/type-mapper';
|
|
3
|
+
export declare class EntityParser {
|
|
4
|
+
private typeMapper;
|
|
5
|
+
constructor(typeMapper: TypeMapper);
|
|
6
|
+
parse(fileContent: string, _fileName: string): ParsedEntity | null;
|
|
7
|
+
private isEntity;
|
|
8
|
+
private isEnum;
|
|
9
|
+
private extractClassName;
|
|
10
|
+
private extractPackageName;
|
|
11
|
+
private extractClassAnnotations;
|
|
12
|
+
private extractClassDocumentation;
|
|
13
|
+
private extractEnumValues;
|
|
14
|
+
private extractFields;
|
|
15
|
+
private extractRelations;
|
|
16
|
+
private extractFieldAnnotations;
|
|
17
|
+
private isRelationAnnotation;
|
|
18
|
+
private isArrayType;
|
|
19
|
+
private extractTargetEntityFromType;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=entity-parser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-parser.d.ts","sourceRoot":"","sources":["../../src/parser/entity-parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAA+B,MAAM,UAAU,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAElD,qBAAa,YAAY;IACvB,OAAO,CAAC,UAAU,CAAa;gBAEnB,UAAU,EAAE,UAAU;IAIlC,KAAK,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAiClE,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,MAAM;IAId,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,kBAAkB;IAK1B,OAAO,CAAC,uBAAuB;IAe/B,OAAO,CAAC,yBAAyB;IAYjC,OAAO,CAAC,iBAAiB;IAazB,OAAO,CAAC,aAAa;IAmCrB,OAAO,CAAC,gBAAgB;IAwCxB,OAAO,CAAC,uBAAuB;IAkB/B,OAAO,CAAC,oBAAoB;IAY5B,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,2BAA2B;CAOpC"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EntityParser = void 0;
|
|
4
|
+
class EntityParser {
|
|
5
|
+
constructor(typeMapper) {
|
|
6
|
+
this.typeMapper = typeMapper;
|
|
7
|
+
}
|
|
8
|
+
parse(fileContent, _fileName) {
|
|
9
|
+
const isEntity = this.isEntity(fileContent);
|
|
10
|
+
const isEnum = this.isEnum(fileContent);
|
|
11
|
+
if (!isEntity && !isEnum) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const className = this.extractClassName(fileContent);
|
|
15
|
+
if (!className) {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
const entity = {
|
|
19
|
+
name: className,
|
|
20
|
+
packageName: this.extractPackageName(fileContent),
|
|
21
|
+
fields: [],
|
|
22
|
+
relations: [],
|
|
23
|
+
isEnum,
|
|
24
|
+
annotations: this.extractClassAnnotations(fileContent),
|
|
25
|
+
documentation: this.extractClassDocumentation(fileContent),
|
|
26
|
+
};
|
|
27
|
+
if (isEnum) {
|
|
28
|
+
entity.enumValues = this.extractEnumValues(fileContent);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
entity.fields = this.extractFields(fileContent);
|
|
32
|
+
entity.relations = this.extractRelations(fileContent);
|
|
33
|
+
}
|
|
34
|
+
return entity;
|
|
35
|
+
}
|
|
36
|
+
isEntity(content) {
|
|
37
|
+
return (content.includes('@Entity') ||
|
|
38
|
+
content.includes('@Table') ||
|
|
39
|
+
content.includes('@Document') ||
|
|
40
|
+
content.includes('data class'));
|
|
41
|
+
}
|
|
42
|
+
isEnum(content) {
|
|
43
|
+
return /enum\s+class\s+\w+/.test(content) || /public\s+enum\s+\w+/.test(content);
|
|
44
|
+
}
|
|
45
|
+
extractClassName(content) {
|
|
46
|
+
// Kotlin class
|
|
47
|
+
const kotlinMatch = content.match(/(?:data\s+)?class\s+(\w+)/);
|
|
48
|
+
if (kotlinMatch)
|
|
49
|
+
return kotlinMatch[1];
|
|
50
|
+
// Kotlin enum
|
|
51
|
+
const kotlinEnumMatch = content.match(/enum\s+class\s+(\w+)/);
|
|
52
|
+
if (kotlinEnumMatch)
|
|
53
|
+
return kotlinEnumMatch[1];
|
|
54
|
+
// Java class
|
|
55
|
+
const javaMatch = content.match(/public\s+(?:class|enum)\s+(\w+)/);
|
|
56
|
+
if (javaMatch)
|
|
57
|
+
return javaMatch[1];
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
extractPackageName(content) {
|
|
61
|
+
const match = content.match(/package\s+([\w.]+)/);
|
|
62
|
+
return match ? match[1] : undefined;
|
|
63
|
+
}
|
|
64
|
+
extractClassAnnotations(content) {
|
|
65
|
+
const annotations = [];
|
|
66
|
+
const annotationRegex = /@(\w+)(?:\([^)]*\))?/g;
|
|
67
|
+
let match;
|
|
68
|
+
const classDeclarationIndex = content.search(/(?:data\s+)?(?:class|enum)/);
|
|
69
|
+
const beforeClass = content.substring(0, classDeclarationIndex);
|
|
70
|
+
while ((match = annotationRegex.exec(beforeClass)) !== null) {
|
|
71
|
+
annotations.push(match[1]);
|
|
72
|
+
}
|
|
73
|
+
return annotations;
|
|
74
|
+
}
|
|
75
|
+
extractClassDocumentation(content) {
|
|
76
|
+
const docMatch = content.match(/\/\*\*([\s\S]*?)\*\//);
|
|
77
|
+
if (docMatch) {
|
|
78
|
+
return docMatch[1]
|
|
79
|
+
.split('\n')
|
|
80
|
+
.map((line) => line.trim().replace(/^\*\s?/, ''))
|
|
81
|
+
.join('\n')
|
|
82
|
+
.trim();
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
86
|
+
extractEnumValues(content) {
|
|
87
|
+
const enumBodyMatch = content.match(/enum\s+class\s+\w+\s*\{([^}]+)\}/);
|
|
88
|
+
if (!enumBodyMatch)
|
|
89
|
+
return [];
|
|
90
|
+
const body = enumBodyMatch[1];
|
|
91
|
+
const values = body
|
|
92
|
+
.split(',')
|
|
93
|
+
.map((v) => v.trim().split(/[(\s]/)[0])
|
|
94
|
+
.filter((v) => v && v !== ';');
|
|
95
|
+
return values;
|
|
96
|
+
}
|
|
97
|
+
extractFields(content) {
|
|
98
|
+
const fields = [];
|
|
99
|
+
// Kotlin val/var properties
|
|
100
|
+
const kotlinFieldRegex = /(?:@\w+(?:\([^)]*\))?\s*)*(val|var)\s+(\w+)\s*:\s*([^=\n]+)/g;
|
|
101
|
+
let match;
|
|
102
|
+
while ((match = kotlinFieldRegex.exec(content)) !== null) {
|
|
103
|
+
const fieldName = match[2];
|
|
104
|
+
// Remove trailing comma, spaces, and other unwanted characters
|
|
105
|
+
const rawType = match[3].trim().replace(/[,\s]+$/, '');
|
|
106
|
+
// Skip relations (will be handled separately)
|
|
107
|
+
if (this.isRelationAnnotation(content, fieldName)) {
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
const cleanType = this.typeMapper.removeNullability(rawType);
|
|
111
|
+
const isNullable = this.typeMapper.isNullable(rawType);
|
|
112
|
+
const isArray = this.isArrayType(cleanType);
|
|
113
|
+
const mappedType = this.typeMapper.mapType(cleanType);
|
|
114
|
+
fields.push({
|
|
115
|
+
name: fieldName,
|
|
116
|
+
type: mappedType,
|
|
117
|
+
nullable: isNullable,
|
|
118
|
+
isArray,
|
|
119
|
+
isEnum: false,
|
|
120
|
+
annotations: this.extractFieldAnnotations(content, fieldName),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
return fields;
|
|
124
|
+
}
|
|
125
|
+
extractRelations(content) {
|
|
126
|
+
const relations = [];
|
|
127
|
+
const relationAnnotations = ['@OneToMany', '@ManyToOne', '@OneToOne', '@ManyToMany'];
|
|
128
|
+
for (const annotation of relationAnnotations) {
|
|
129
|
+
// More flexible regex that allows other annotations between relation annotation and field
|
|
130
|
+
// Make the parentheses optional with (?:\([^)]*\))?
|
|
131
|
+
// Use [\s\S]*? to match any character including newlines and @ symbols
|
|
132
|
+
const regex = new RegExp(`${annotation.replace('@', '@')}(?:\\s*\\([^)]*\\))?[\\s\\S]*?(?:val|var)\\s+(\\w+)\\s*:\\s*([^=\\n]+)`, 'g');
|
|
133
|
+
let match;
|
|
134
|
+
while ((match = regex.exec(content)) !== null) {
|
|
135
|
+
const fieldName = match[1];
|
|
136
|
+
// Remove trailing comma, spaces, and other unwanted characters
|
|
137
|
+
const rawType = match[2].trim().replace(/[,\s]+$/, '');
|
|
138
|
+
const relationType = annotation.replace('@', '');
|
|
139
|
+
const cleanType = this.typeMapper.removeNullability(rawType);
|
|
140
|
+
const isNullable = this.typeMapper.isNullable(rawType);
|
|
141
|
+
const isArray = relationType === 'OneToMany' || relationType === 'ManyToMany' || this.isArrayType(cleanType);
|
|
142
|
+
const targetEntity = this.extractTargetEntityFromType(cleanType);
|
|
143
|
+
relations.push({
|
|
144
|
+
name: fieldName,
|
|
145
|
+
type: relationType,
|
|
146
|
+
targetEntity,
|
|
147
|
+
nullable: isNullable,
|
|
148
|
+
isArray,
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return relations;
|
|
153
|
+
}
|
|
154
|
+
extractFieldAnnotations(content, fieldName) {
|
|
155
|
+
const fieldRegex = new RegExp(`((?:@\\w+(?:\\([^)]*\\))?\\s*)+)(?:val|var)\\s+${fieldName}\\s*:`);
|
|
156
|
+
const match = content.match(fieldRegex);
|
|
157
|
+
if (!match)
|
|
158
|
+
return [];
|
|
159
|
+
const annotationsString = match[1];
|
|
160
|
+
const annotations = [];
|
|
161
|
+
const annotationRegex = /@(\w+)/g;
|
|
162
|
+
let annotationMatch;
|
|
163
|
+
while ((annotationMatch = annotationRegex.exec(annotationsString)) !== null) {
|
|
164
|
+
annotations.push(annotationMatch[1]);
|
|
165
|
+
}
|
|
166
|
+
return annotations;
|
|
167
|
+
}
|
|
168
|
+
isRelationAnnotation(content, fieldName) {
|
|
169
|
+
// Find the field declaration and extract all annotations before it
|
|
170
|
+
const fieldRegex = new RegExp(`([\\s\\S]*?)(?:val|var)\\s+${fieldName}\\s*:`);
|
|
171
|
+
const match = content.match(fieldRegex);
|
|
172
|
+
if (!match)
|
|
173
|
+
return false;
|
|
174
|
+
// Get the text before the field (last 500 chars to capture all annotations)
|
|
175
|
+
const textBefore = match[1].slice(-500);
|
|
176
|
+
return /@(?:OneToMany|ManyToOne|OneToOne|ManyToMany)/.test(textBefore);
|
|
177
|
+
}
|
|
178
|
+
isArrayType(type) {
|
|
179
|
+
return (type.includes('List<') ||
|
|
180
|
+
type.includes('Set<') ||
|
|
181
|
+
type.includes('Collection<') ||
|
|
182
|
+
type.includes('[]'));
|
|
183
|
+
}
|
|
184
|
+
extractTargetEntityFromType(type) {
|
|
185
|
+
const genericMatch = type.match(/<(.+)>/);
|
|
186
|
+
if (genericMatch) {
|
|
187
|
+
return genericMatch[1].trim();
|
|
188
|
+
}
|
|
189
|
+
return type.replace('[]', '').trim();
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
exports.EntityParser = EntityParser;
|
|
193
|
+
//# sourceMappingURL=entity-parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-parser.js","sourceRoot":"","sources":["../../src/parser/entity-parser.ts"],"names":[],"mappings":";;;AAGA,MAAa,YAAY;IAGvB,YAAY,UAAsB;QAChC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,WAAmB,EAAE,SAAiB;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAExC,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACzB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,EAAE,CAAC;YACf,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,MAAM,GAAiB;YAC3B,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC;YACjD,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,EAAE;YACb,MAAM;YACN,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,CAAC;QAExC,IAAI,CAAC,KAAK;YAAE,OAAO,KAAK,CAAC;QAEzB,4EAA4E;QAC5E,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,8CAA8C,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACzE,CAAC;IAEO,WAAW,CAAC,IAAY;QAC9B,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC;YACtB,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;YACrB,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC;YAC5B,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CACpB,CAAC;IACJ,CAAC;IAEO,2BAA2B,CAAC,IAAY;QAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC1C,IAAI,YAAY,EAAE,CAAC;YACjB,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QAChC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvC,CAAC;CACF;AA3OD,oCA2OC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface SpringToTsConfig {
|
|
2
|
+
sourceDir: string;
|
|
3
|
+
outputDir: string;
|
|
4
|
+
includeValidation?: boolean;
|
|
5
|
+
dateFormat?: 'ISO' | 'Date' | 'number';
|
|
6
|
+
includeEnums?: boolean;
|
|
7
|
+
includeRelations?: boolean;
|
|
8
|
+
customTypeMapping?: Record<string, string>;
|
|
9
|
+
excludePatterns?: string[];
|
|
10
|
+
watch?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface EntityField {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
nullable: boolean;
|
|
16
|
+
isArray: boolean;
|
|
17
|
+
isEnum: boolean;
|
|
18
|
+
annotations: string[];
|
|
19
|
+
documentation?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface EntityRelation {
|
|
22
|
+
name: string;
|
|
23
|
+
type: 'OneToMany' | 'ManyToOne' | 'OneToOne' | 'ManyToMany';
|
|
24
|
+
targetEntity: string;
|
|
25
|
+
nullable: boolean;
|
|
26
|
+
isArray: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface ParsedEntity {
|
|
29
|
+
name: string;
|
|
30
|
+
packageName?: string;
|
|
31
|
+
fields: EntityField[];
|
|
32
|
+
relations: EntityRelation[];
|
|
33
|
+
isEnum: boolean;
|
|
34
|
+
enumValues?: string[];
|
|
35
|
+
documentation?: string;
|
|
36
|
+
annotations: string[];
|
|
37
|
+
}
|
|
38
|
+
export interface GeneratorOptions {
|
|
39
|
+
config: SpringToTsConfig;
|
|
40
|
+
entities: ParsedEntity[];
|
|
41
|
+
}
|
|
42
|
+
export type TypeMapping = Record<string, string>;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;IAC5D,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class FileUtils {
|
|
2
|
+
static findSourceFiles(sourceDir: string, excludePatterns?: string[]): Promise<string[]>;
|
|
3
|
+
static ensureDirectoryExists(dirPath: string): void;
|
|
4
|
+
static writeFile(filePath: string, content: string): void;
|
|
5
|
+
static readFile(filePath: string): string;
|
|
6
|
+
static getRelativePath(from: string, to: string): string;
|
|
7
|
+
static getFileNameWithoutExtension(filePath: string): string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=file-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-utils.d.ts","sourceRoot":"","sources":["../../src/utils/file-utils.ts"],"names":[],"mappings":"AAIA,qBAAa,SAAS;WACP,eAAe,CAC1B,SAAS,EAAE,MAAM,EACjB,eAAe,GAAE,MAAM,EAAO,GAC7B,OAAO,CAAC,MAAM,EAAE,CAAC;IAcpB,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAMnD,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI;IAMzD,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIzC,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAKxD,MAAM,CAAC,2BAA2B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;CAG7D"}
|