Skip to content

Commit

Permalink
fix: do not fail validation process yet
Browse files Browse the repository at this point in the history
  • Loading branch information
patzick committed Nov 4, 2024
1 parent 44be652 commit b550cef
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-plums-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@shopware/api-gen": patch
---

Fix process failing on errors to give more time for adoption.
7 changes: 6 additions & 1 deletion packages/api-gen/src/commands/validateJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,12 @@ export async function validateJson(args: {
console.error(
c.red(`Validation failed with ${c.bold(errors.length)} errors.`),
);
process.exit(1);
// process.exit(1);
console.warn(
c.yellow(
"Errors found! This command will start failing in the future. Fix the errors from summary. Bypassing process fail for now.",
),
);
} else {
console.log(c.green("✔️ Validation passed successfully."));
}
Expand Down
2 changes: 1 addition & 1 deletion packages/api-gen/src/jsonOverrideUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export function displayPatchingSummary({
alreadyApliedPatches: number;
errors?: string[];
}) {
if (todosToFix.length) {
if (!errors?.length && todosToFix.length) {
console.log(c.yellow("Warnings to fix in the schema:"));
todosToFix.forEach((todo) => {
console.log(`${c.yellow("WARNING")}: ${todo[0]}`);
Expand Down

0 comments on commit b550cef

Please sign in to comment.