@asyncapi/cli 0.48.4 → 0.48.5

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.
@@ -93,12 +93,12 @@ class Diff extends base_1.default {
93
93
  this.log(`The output format ${outputFormat} is not supported at the moment.`);
94
94
  }
95
95
  if (!noError) {
96
- throwOnBreakingChange(diffOutput);
96
+ throwOnBreakingChange(diffOutput, outputFormat);
97
97
  }
98
98
  }
99
99
  catch (error) {
100
100
  if (error instanceof diff_error_1.DiffBreakingChangeError) {
101
- throw error;
101
+ this.error(error);
102
102
  }
103
103
  throw new validation_error_1.ValidationError({
104
104
  type: 'parser-error',
@@ -218,9 +218,10 @@ const enableWatch = (status, watcher) => {
218
218
  /**
219
219
  * Throws `DiffBreakingChangeError` when breaking changes are detected
220
220
  */
221
- function throwOnBreakingChange(diffOutput) {
221
+ function throwOnBreakingChange(diffOutput, outputFormat) {
222
222
  const breakingChanges = diffOutput.breaking();
223
- if (breakingChanges.length !== 0) {
223
+ if ((outputFormat === 'json' && breakingChanges.length !== 0) ||
224
+ ((outputFormat === 'yaml' || outputFormat === 'yml') && breakingChanges !== '[]\n')) {
224
225
  throw new diff_error_1.DiffBreakingChangeError();
225
226
  }
226
227
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.48.4",
2
+ "version": "0.48.5",
3
3
  "commands": {
4
4
  "bundle": {
5
5
  "id": "bundle",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@asyncapi/cli",
3
3
  "description": "All in one CLI for all AsyncAPI tools",
4
- "version": "0.48.4",
4
+ "version": "0.48.5",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"