@intellegens/cornerstone-cli 0.0.9 → 0.0.10
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.
|
@@ -35,10 +35,9 @@ exports.zodSchemaGeneratorCommand = {
|
|
|
35
35
|
.readdirSync(inputPath)
|
|
36
36
|
.filter((file) => file.endsWith('.json'));
|
|
37
37
|
if (files.length === 0) {
|
|
38
|
-
console.error('
|
|
38
|
+
console.error('No JSON schema files found in the input directory.');
|
|
39
39
|
process.exit(1);
|
|
40
40
|
}
|
|
41
|
-
var exports = {};
|
|
42
41
|
for (const file of files) {
|
|
43
42
|
const filePath = path_1.default.join(inputPath, file);
|
|
44
43
|
const schemaContent = fs_extra_1.default.readFileSync(filePath, 'utf-8');
|
|
@@ -61,25 +60,15 @@ exports.zodSchemaGeneratorCommand = {
|
|
|
61
60
|
depth: 5,
|
|
62
61
|
});
|
|
63
62
|
// Generate TypeScript file
|
|
64
|
-
const fileName = typeName
|
|
63
|
+
const fileName = typeName;
|
|
65
64
|
const outputFilePath = path_1.default.join(namespaceDir, fileName);
|
|
66
65
|
fs_extra_1.default.writeFileSync(outputFilePath, zodSchema, 'utf-8');
|
|
67
|
-
console.log(
|
|
68
|
-
// Register for (re)export
|
|
69
|
-
exports[typeName] = path_1.default.relative(outputPath, outputFilePath);
|
|
66
|
+
console.log(`Generated Zod schema: ${outputFilePath}`);
|
|
70
67
|
}
|
|
71
|
-
|
|
72
|
-
let exportFileContent = '';
|
|
73
|
-
for (const typeName in exports) {
|
|
74
|
-
const typePath = exports[typeName];
|
|
75
|
-
exportFileContent += `export * from './${typePath}'; // .NET ${typeName} class\n`;
|
|
76
|
-
}
|
|
77
|
-
fs_extra_1.default.writeFileSync(path_1.default.join(outputPath, './index.ts'), exportFileContent, 'utf-8');
|
|
78
|
-
// Prompt done
|
|
79
|
-
console.log('\u2705 Zod schemas generated successfully!');
|
|
68
|
+
console.log('✅ Zod schemas generated successfully!');
|
|
80
69
|
}
|
|
81
70
|
catch (error) {
|
|
82
|
-
console.error('
|
|
71
|
+
console.error('❌ Error generating Zod schemas:', error);
|
|
83
72
|
process.exit(1);
|
|
84
73
|
}
|
|
85
74
|
},
|