@flink-app/flink 0.13.0 ā 0.13.1
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/CHANGELOG.md +6 -0
- package/dist/src/TypeScriptCompiler.js +28 -1
- package/package.json +1 -1
- package/src/TypeScriptCompiler.ts +28 -1
package/CHANGELOG.md
CHANGED
|
@@ -590,7 +590,34 @@ var TypeScriptCompiler = /** @class */ (function () {
|
|
|
590
590
|
console.log(" tsconfig:", tsconfigPath);
|
|
591
591
|
// Create a fresh TypeScript Program that includes the schema file
|
|
592
592
|
// This ensures ts-json-schema-generator can find the types we just generated
|
|
593
|
-
var program
|
|
593
|
+
var program;
|
|
594
|
+
try {
|
|
595
|
+
program = (0, ts_json_schema_generator_1.createProgram)(conf);
|
|
596
|
+
}
|
|
597
|
+
catch (error) {
|
|
598
|
+
// Format the error in a more developer-friendly way
|
|
599
|
+
console.error("\nā Schema generation failed due to TypeScript compilation errors:\n");
|
|
600
|
+
if (error.diagnostic && error.diagnostic.relatedInformation) {
|
|
601
|
+
// Extract and display only the relevant error messages
|
|
602
|
+
for (var _i = 0, _a = error.diagnostic.relatedInformation; _i < _a.length; _i++) {
|
|
603
|
+
var info = _a[_i];
|
|
604
|
+
if (info.file) {
|
|
605
|
+
var _b = info.file.getLineAndCharacterOfPosition(info.start), line = _b.line, character = _b.character;
|
|
606
|
+
var fileName = info.file.fileName.replace(this.cwd, ".");
|
|
607
|
+
var message = typeof info.messageText === "string"
|
|
608
|
+
? info.messageText
|
|
609
|
+
: info.messageText.messageText;
|
|
610
|
+
console.error(" ".concat(fileName, ":").concat(line + 1, ":").concat(character + 1));
|
|
611
|
+
console.error(" ".concat(message, "\n"));
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
else if (error.message) {
|
|
616
|
+
console.error(" ".concat(error.message, "\n"));
|
|
617
|
+
}
|
|
618
|
+
console.error("š” Tip: Fix the TypeScript errors above and try again.\n");
|
|
619
|
+
process.exit(1);
|
|
620
|
+
}
|
|
594
621
|
console.log(" TypeScript version:", ts_morph_1.ts.version);
|
|
595
622
|
console.log(" Program root files:", program.getRootFileNames().length);
|
|
596
623
|
var formatter = (0, ts_json_schema_generator_1.createFormatter)(conf);
|
package/package.json
CHANGED
|
@@ -533,7 +533,34 @@ export default {}; // Export an empty object to make it a module
|
|
|
533
533
|
|
|
534
534
|
// Create a fresh TypeScript Program that includes the schema file
|
|
535
535
|
// This ensures ts-json-schema-generator can find the types we just generated
|
|
536
|
-
|
|
536
|
+
let program;
|
|
537
|
+
try {
|
|
538
|
+
program = createProgram(conf);
|
|
539
|
+
} catch (error: any) {
|
|
540
|
+
// Format the error in a more developer-friendly way
|
|
541
|
+
console.error("\nā Schema generation failed due to TypeScript compilation errors:\n");
|
|
542
|
+
|
|
543
|
+
if (error.diagnostic && error.diagnostic.relatedInformation) {
|
|
544
|
+
// Extract and display only the relevant error messages
|
|
545
|
+
for (const info of error.diagnostic.relatedInformation) {
|
|
546
|
+
if (info.file) {
|
|
547
|
+
const { line, character } = info.file.getLineAndCharacterOfPosition(info.start);
|
|
548
|
+
const fileName = info.file.fileName.replace(this.cwd, ".");
|
|
549
|
+
const message = typeof info.messageText === "string"
|
|
550
|
+
? info.messageText
|
|
551
|
+
: info.messageText.messageText;
|
|
552
|
+
|
|
553
|
+
console.error(` ${fileName}:${line + 1}:${character + 1}`);
|
|
554
|
+
console.error(` ${message}\n`);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
} else if (error.message) {
|
|
558
|
+
console.error(` ${error.message}\n`);
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
console.error("š” Tip: Fix the TypeScript errors above and try again.\n");
|
|
562
|
+
process.exit(1);
|
|
563
|
+
}
|
|
537
564
|
|
|
538
565
|
console.log(" TypeScript version:", ts.version);
|
|
539
566
|
console.log(" Program root files:", program.getRootFileNames().length);
|