@axinom/mosaic-cli 0.10.0-rc.2 → 0.10.0-rc.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.
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/msg-diff/asyncapi-override.d.ts +6 -0
- package/dist/commands/msg-diff/asyncapi-override.js +31 -0
- package/dist/commands/msg-diff/asyncapi-override.js.map +1 -0
- package/dist/commands/msg-diff/git-checkout-tmp.d.ts +9 -0
- package/dist/commands/msg-diff/git-checkout-tmp.js +71 -0
- package/dist/commands/msg-diff/git-checkout-tmp.js.map +1 -0
- package/dist/commands/msg-diff/index.d.ts +3 -0
- package/dist/commands/msg-diff/index.js +52 -0
- package/dist/commands/msg-diff/index.js.map +1 -0
- package/dist/commands/msg-diff/message-diff-options.d.ts +7 -0
- package/dist/commands/msg-diff/message-diff-options.js +3 -0
- package/dist/commands/msg-diff/message-diff-options.js.map +1 -0
- package/dist/commands/msg-diff/msg-diff.d.ts +69 -0
- package/dist/commands/msg-diff/msg-diff.js +281 -0
- package/dist/commands/msg-diff/msg-diff.js.map +1 -0
- package/package.json +7 -5
package/dist/cli/index.js
CHANGED
|
@@ -8,6 +8,7 @@ const create_extension_config_1 = require("../commands/create-extension-config")
|
|
|
8
8
|
const get_access_token_1 = require("../commands/get-access-token");
|
|
9
9
|
const graphql_diff_1 = require("../commands/graphql-diff");
|
|
10
10
|
const msg_codegen_1 = require("../commands/msg-codegen");
|
|
11
|
+
const msg_diff_1 = require("../commands/msg-diff");
|
|
11
12
|
const pg_dump_1 = require("../commands/pg-dump");
|
|
12
13
|
const publish_schema_to_db_1 = require("../commands/publish-schema-to-db");
|
|
13
14
|
const run = () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
|
@@ -40,6 +41,7 @@ const run = () => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
|
|
40
41
|
.command(publish_schema_to_db_1.publishSchemaToDb)
|
|
41
42
|
.command(pg_dump_1.pgDump)
|
|
42
43
|
.command(msg_codegen_1.msgCodegen)
|
|
44
|
+
.command(msg_diff_1.msgDiff)
|
|
43
45
|
.command(create_extension_config_1.createExtensionConfigCommand)
|
|
44
46
|
.command(graphql_diff_1.graphqlDiff);
|
|
45
47
|
//adding cli extensions:
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,iEAA6D;AAC7D,iFAG6C;AAC7C,mEAA8D;AAC9D,2DAAuD;AACvD,yDAAqD;AACrD,iDAA6C;AAC7C,2EAAqE;AAE9D,MAAM,GAAG,GAAG,GAAwB,EAAE;IAC3C,KAAK;SACF,UAAU,CAAC,QAAQ,CAAC;SACpB,GAAG,EAAE;SACL,OAAO,CACN,iBAAiB,EACjB,+CAA+C,EAC/C,CAAC,KAAK,EAAE,EAAE;QACR,KAAK;aACF,MAAM,CAAC,MAAM,EAAE;YACd,KAAK,EAAE,GAAG;YACV,QAAQ,EACN,gHAAgH;YAClH,MAAM,EAAE,IAAI;YACZ,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,SAAS,EAAE;YACjB,KAAK,EAAE,GAAG;YACV,QAAQ,EACN,2EAA2E;YAC7E,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,KAAK,EAAE;YACb,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,SAAS;YACf,QAAQ,EACN,4FAA4F;YAC9F,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC,EACD,gCAAc,CACf;SACA,OAAO,CAAC,iCAAc,CAAC;SACvB,OAAO,CAAC,wCAAiB,CAAC;SAC1B,OAAO,CAAC,gBAAM,CAAC;SACf,OAAO,CAAC,wBAAU,CAAC;SACnB,O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OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;SACd,CAAC;aACD,MAAM,CAAC,KAAK,EAAE;YACb,KAAK,EAAE,GAAG;YACV,IAAI,EAAE,SAAS;YACf,QAAQ,EACN,4FAA4F;YAC9F,OAAO,EAAE,KAAK;YACd,OAAO,EAAE,IAAI;SACd,CAAC,CAAC;IACP,CAAC,EACD,gCAAc,CACf;SACA,OAAO,CAAC,iCAAc,CAAC;SACvB,OAAO,CAAC,wCAAiB,CAAC;SAC1B,OAAO,CAAC,gBAAM,CAAC;SACf,OAAO,CAAC,wBAAU,CAAC;SACnB,OAAO,CAAC,kBAAO,CAAC;SAChB,OAAO,CAAC,sDAA4B,CAAC;SACrC,OAAO,CAAC,0BAAW,CAAC,CAAC;IAExB,wBAAwB;IACxB,MAAM,OAAO,CAAC,GAAG,CACf,IAAA,uCAAa,GAAE,CAAC,GAAG,CAAC,CAAO,OAAO,EAAE,EAAE;QACpC,IAAI;YACF,MAAM,EAAE,YAAY,EAAE,GAAG,2CAAa,OAAO,EAAC,CAAC;YAC/C,IAAI,YAAY,EAAE;gBAChB,YAAY,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;oBACzB,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;gBACrB,CAAC,CAAC,CAAC;aACJ;SACF;QAAC,OAAO,KAAK,EAAE;YACd,gEAAgE;SACjE;IACH,CAAC,CAAA,CAAC,CACH,CAAC;IAEF,KAAK;SACF,aAAa,EAAE;SACf,IAAI,EAAE;SACN,MAAM,CAAC,wDAAwD,CAAC,CAAC,IAAI,CAAC;AAC3E,CAAC,CAAA,CAAC;AA9DW,QAAA,GAAG,OA8Dd"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { OverrideObject } from '@asyncapi/diff';
|
|
2
|
+
/**
|
|
3
|
+
* Asyncapi classifier overrides. See: https://github.com/asyncapi/diff#standard-object.
|
|
4
|
+
* Standard defs (defaults) are here: https://github.com/asyncapi/diff/blob/master/src/standard.ts.
|
|
5
|
+
*/
|
|
6
|
+
export declare const override: OverrideObject;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.override = void 0;
|
|
4
|
+
const unclassified = {
|
|
5
|
+
add: 'unclassified',
|
|
6
|
+
remove: 'unclassified',
|
|
7
|
+
edit: 'unclassified',
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Asyncapi classifier overrides. See: https://github.com/asyncapi/diff#standard-object.
|
|
11
|
+
* Standard defs (defaults) are here: https://github.com/asyncapi/diff/blob/master/src/standard.ts.
|
|
12
|
+
*/
|
|
13
|
+
exports.override = {
|
|
14
|
+
// Custom property used to name queues.
|
|
15
|
+
'/x-service-id': {
|
|
16
|
+
add: 'breaking',
|
|
17
|
+
remove: 'breaking',
|
|
18
|
+
edit: 'breaking',
|
|
19
|
+
},
|
|
20
|
+
// Changing or removing queue name is a breaking change.
|
|
21
|
+
'/channels/*/bindings/amqp/queue/name': {
|
|
22
|
+
add: 'non-breaking',
|
|
23
|
+
remove: 'breaking',
|
|
24
|
+
edit: 'breaking',
|
|
25
|
+
},
|
|
26
|
+
// (workaround) To find the rule above every subpath needs to be defined (if not already defined in standard defs)
|
|
27
|
+
// see: https://github.com/asyncapi/diff/pull/19
|
|
28
|
+
'/channels/*/bindings/amqp/queue': unclassified,
|
|
29
|
+
'/channels/*/bindings/amqp': unclassified,
|
|
30
|
+
};
|
|
31
|
+
//# sourceMappingURL=asyncapi-override.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"asyncapi-override.js","sourceRoot":"","sources":["../../../src/commands/msg-diff/asyncapi-override.ts"],"names":[],"mappings":";;;AAEA,MAAM,YAAY,GAA2B;IAC3C,GAAG,EAAE,cAAc;IACnB,MAAM,EAAE,cAAc;IACtB,IAAI,EAAE,cAAc;CACrB,CAAC;AAEF;;;GAGG;AACU,QAAA,QAAQ,GAAmB;IACtC,uCAAuC;IACvC,eAAe,EAAE;QACf,GAAG,EAAE,UAAU;QACf,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,UAAU;KACjB;IAED,wDAAwD;IACxD,sCAAsC,EAAE;QACtC,GAAG,EAAE,cAAc;QACnB,MAAM,EAAE,UAAU;QAClB,IAAI,EAAE,UAAU;KACjB;IACD,kHAAkH;IAClH,6DAA6D;IAC7D,iCAAiC,EAAE,YAAY;IAC/C,2BAA2B,EAAE,YAAY;CAC1C,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class GitCheckoutTmp {
|
|
2
|
+
private _gitRoot;
|
|
3
|
+
private _tmpDir;
|
|
4
|
+
checkout(localDir: string, branch: string): void;
|
|
5
|
+
get tmpDir(): string | undefined;
|
|
6
|
+
get gitRoot(): string | undefined;
|
|
7
|
+
cleanUp(): void;
|
|
8
|
+
}
|
|
9
|
+
export declare function findGitRoot(dir: string): string;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findGitRoot = exports.GitCheckoutTmp = void 0;
|
|
4
|
+
const child_process_1 = require("child_process");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const uuid = require("uuid");
|
|
9
|
+
/*
|
|
10
|
+
* Checkout a copy of a git directory, from a specified commit/branch, to a temp location.
|
|
11
|
+
* This can be used to compare the current state of the directory to another commit.
|
|
12
|
+
* Ful paths from the git root are preserved in the temp checkout.
|
|
13
|
+
*
|
|
14
|
+
* @param localDir A local directory path. Can be absolute or relative. Must be in a git repo.
|
|
15
|
+
* @param branch A branch or commit directory to use for the checkout.
|
|
16
|
+
*/
|
|
17
|
+
class GitCheckoutTmp {
|
|
18
|
+
checkout(localDir, branch) {
|
|
19
|
+
this._gitRoot = findGitRoot(localDir);
|
|
20
|
+
const gitRelDir = path
|
|
21
|
+
.relative(this._gitRoot, localDir)
|
|
22
|
+
.replace(/\\/g, '/');
|
|
23
|
+
if (!gitRelDir) {
|
|
24
|
+
throw `localDir for checkout cannot be the git root!`;
|
|
25
|
+
}
|
|
26
|
+
this._tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), uuid.v4()));
|
|
27
|
+
try {
|
|
28
|
+
(0, child_process_1.execSync)(`git -C ${this._gitRoot} --work-tree=${this._tmpDir} checkout ${branch} -- ${gitRelDir}`);
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
this.cleanUp();
|
|
32
|
+
throw e;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/*
|
|
36
|
+
* Location of the temp directory. Root directory of the checked out files.
|
|
37
|
+
*/
|
|
38
|
+
get tmpDir() {
|
|
39
|
+
return this._tmpDir;
|
|
40
|
+
}
|
|
41
|
+
/*
|
|
42
|
+
* Location of the git root dir. Root directory of the original files.
|
|
43
|
+
*/
|
|
44
|
+
get gitRoot() {
|
|
45
|
+
return this._gitRoot;
|
|
46
|
+
}
|
|
47
|
+
/*
|
|
48
|
+
* Clean up temp files. This will remove the temp directory if it exists.
|
|
49
|
+
*/
|
|
50
|
+
cleanUp() {
|
|
51
|
+
try {
|
|
52
|
+
if (this._tmpDir !== undefined) {
|
|
53
|
+
fs.rmdirSync(this._tmpDir, { recursive: true });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
console.error(`Failed to clean up tmp dir ${this._tmpDir}: ${e}`);
|
|
58
|
+
}
|
|
59
|
+
this._gitRoot = undefined;
|
|
60
|
+
this._tmpDir = undefined;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.GitCheckoutTmp = GitCheckoutTmp;
|
|
64
|
+
/*
|
|
65
|
+
* Finds the git root directory for a local path (relative or absolute).
|
|
66
|
+
*/
|
|
67
|
+
function findGitRoot(dir) {
|
|
68
|
+
return (0, child_process_1.execSync)(`git -C ${dir} rev-parse --show-toplevel`).toString().trim();
|
|
69
|
+
}
|
|
70
|
+
exports.findGitRoot = findGitRoot;
|
|
71
|
+
//# sourceMappingURL=git-checkout-tmp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-checkout-tmp.js","sourceRoot":"","sources":["../../../src/commands/msg-diff/git-checkout-tmp.ts"],"names":[],"mappings":";;;AAAA,iDAAyC;AACzC,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAC7B,6BAA6B;AAE7B;;;;;;;GAOG;AACH,MAAa,cAAc;IAIlB,QAAQ,CAAC,QAAgB,EAAE,MAAc;QAC9C,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,IAAI;aACnB,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC;aACjC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,SAAS,EAAE;YACd,MAAM,+CAA+C,CAAC;SACvD;QACD,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QACjE,IAAI;YACF,IAAA,wBAAQ,EACN,UAAU,IAAI,CAAC,QAAQ,gBAAgB,IAAI,CAAC,OAAO,aAAa,MAAM,OAAO,SAAS,EAAE,CACzF,CAAC;SACH;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,MAAM,CAAC,CAAC;SACT;IACH,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,IAAI;YACF,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE;gBAC9B,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;aACjD;SACF;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,8BAA8B,IAAI,CAAC,OAAO,KAAK,CAAC,EAAE,CAAC,CAAC;SACnE;QACD,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;CACF;AAnDD,wCAmDC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,GAAW;IACrC,OAAO,IAAA,wBAAQ,EAAC,UAAU,GAAG,4BAA4B,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;AAC/E,CAAC;AAFD,kCAEC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.msgDiff = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const yargs = require("yargs");
|
|
6
|
+
const msg_diff_1 = require("./msg-diff");
|
|
7
|
+
exports.msgDiff = {
|
|
8
|
+
command: 'msg-diff',
|
|
9
|
+
describe: 'Generates code from AsyncAPI document.',
|
|
10
|
+
builder: (yargs) => yargs
|
|
11
|
+
.option('inputDir', {
|
|
12
|
+
alias: 'i',
|
|
13
|
+
describe: 'Path to input directory - AsyncAPI document root.',
|
|
14
|
+
type: 'string',
|
|
15
|
+
demandOption: true,
|
|
16
|
+
})
|
|
17
|
+
.option('filePattern', {
|
|
18
|
+
alias: 'p',
|
|
19
|
+
describe: 'Regular expression used to include suitable input files.',
|
|
20
|
+
type: 'string',
|
|
21
|
+
default: '^.*(-asyncapi).(json|yaml|yml)$',
|
|
22
|
+
})
|
|
23
|
+
.option('excludePattern', {
|
|
24
|
+
alias: 'e',
|
|
25
|
+
describe: 'Exclude input files matching a regular expression. Exclusion takes precedence over inclusion.',
|
|
26
|
+
type: 'string',
|
|
27
|
+
default: undefined,
|
|
28
|
+
})
|
|
29
|
+
.option('branch', {
|
|
30
|
+
alias: 'b',
|
|
31
|
+
description: 'Git branch or commit identifier to compare to.',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: 'origin/master',
|
|
34
|
+
})
|
|
35
|
+
.option('verbose', {
|
|
36
|
+
alias: 'v',
|
|
37
|
+
description: 'Verbose output including non-breaking changes.',
|
|
38
|
+
type: 'boolean',
|
|
39
|
+
default: false,
|
|
40
|
+
}),
|
|
41
|
+
handler: (argv) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
|
|
42
|
+
const diff = new msg_diff_1.MessageDiff(argv);
|
|
43
|
+
yield diff.run();
|
|
44
|
+
console.log('done.');
|
|
45
|
+
}),
|
|
46
|
+
};
|
|
47
|
+
// Dev helper. Script can be run directly with command:
|
|
48
|
+
// ts-node libs/cli/src/commands/msg-diff/index.ts msg-diff -i libs/messages/schemas
|
|
49
|
+
if (require.main === module) {
|
|
50
|
+
yargs.command(exports.msgDiff).demandCommand().argv;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/msg-diff/index.ts"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAG/B,yCAAyC;AAE5B,QAAA,OAAO,GAA+C;IACjE,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,wCAAwC;IAClD,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,MAAM,CAAC,UAAU,EAAE;QAClB,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,mDAAmD;QAC7D,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB,CAAC;SACD,MAAM,CAAC,aAAa,EAAE;QACrB,KAAK,EAAE,GAAG;QACV,QAAQ,EAAE,0DAA0D;QACpE,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,iCAAiC;KAC3C,CAAC;SACD,MAAM,CAAC,gBAAgB,EAAE;QACxB,KAAK,EAAE,GAAG;QACV,QAAQ,EACN,+FAA+F;QACjG,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,SAAS;KACnB,CAAC;SACD,MAAM,CAAC,QAAQ,EAAE;QAChB,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,gDAAgD;QAC7D,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,eAAe;KACzB,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,WAAW,EAAE,gDAAgD;QAC7D,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;KACf,CAAC;IACN,OAAO,EAAE,CAAO,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,GAAG,IAAI,sBAAW,CAAC,IAAI,CAAC,CAAC;QACnC,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC,CAAA;CACF,CAAC;AAEF,uDAAuD;AACvD,sFAAsF;AACtF,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE;IAC3B,KAAK,CAAC,OAAO,CAAC,eAAO,CAAC,CAAC,aAAa,EAAE,CAAC,IAAI,CAAC;CAC7C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-diff-options.js","sourceRoot":"","sources":["../../../src/commands/msg-diff/message-diff-options.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { AsyncAPIDocument, Channel } from '@asyncapi/parser';
|
|
2
|
+
import { MessageDiffOptions as MessageDiffOptions } from './message-diff-options';
|
|
3
|
+
/**
|
|
4
|
+
* Diff results. Each file (asyncapi document or payload) is classified to one of 'skipped', 'same', 'changed' or 'breaking'.
|
|
5
|
+
*/
|
|
6
|
+
interface Results {
|
|
7
|
+
skipped: number;
|
|
8
|
+
same: number;
|
|
9
|
+
changed: number;
|
|
10
|
+
breaking: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Finds AsyncAPI documents found in git, and compares them with the current file system.
|
|
14
|
+
* The following changes are considered breaking:
|
|
15
|
+
* - Removed / renamed asyncapi document
|
|
16
|
+
* - Breaking changes in any asyncapi document
|
|
17
|
+
* - Breaking changes in any message payload
|
|
18
|
+
* Message payloads are referenced through asyncapi channel definitions. It is safe to rename payload files if
|
|
19
|
+
* file references in the asyncapi document are updated accordingly.
|
|
20
|
+
*
|
|
21
|
+
* @param options (object):
|
|
22
|
+
* schemaRoot Path to directory to scan. All files required to parse the schema must be inside this dir
|
|
23
|
+
* & subdirectories. This includes JSON Schema references.
|
|
24
|
+
* filePattern Regular expression that matches suitable input files.
|
|
25
|
+
* excludePattern Regular expression that matches suitable input files.
|
|
26
|
+
* branch Git branch to compare to.
|
|
27
|
+
* verbose Verbose output includes full diff for all files, not only where breaking changes were found.
|
|
28
|
+
*/
|
|
29
|
+
export declare class MessageDiff {
|
|
30
|
+
private readonly schemaRoot;
|
|
31
|
+
private readonly filePattern;
|
|
32
|
+
private readonly excludePattern;
|
|
33
|
+
private readonly branch;
|
|
34
|
+
private readonly verbose;
|
|
35
|
+
readonly results: {
|
|
36
|
+
skipped: number;
|
|
37
|
+
same: number;
|
|
38
|
+
changed: number;
|
|
39
|
+
breaking: number;
|
|
40
|
+
};
|
|
41
|
+
constructor(options: MessageDiffOptions);
|
|
42
|
+
run(): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Recursively walks a directory comparing matching files to another directory.
|
|
45
|
+
* @param dir1 - Root dir to scan for matching files.
|
|
46
|
+
* @param dir2 - Root dir for comparision.
|
|
47
|
+
*/
|
|
48
|
+
walk(dir1: string, dir2: string): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* Full comparison of asyncapi documents. Each channel payload is also compared.
|
|
51
|
+
*/
|
|
52
|
+
private asyncApiDiff;
|
|
53
|
+
/**
|
|
54
|
+
* Compare asyncapi documents using AsyncAPI Diff: https://github.com/asyncapi/diff
|
|
55
|
+
* Note: non standard rules are defined in file: asyncapi-override.ts
|
|
56
|
+
*/
|
|
57
|
+
documentDiff(document1: AsyncAPIDocument, document2: AsyncAPIDocument): Promise<keyof Results>;
|
|
58
|
+
/**
|
|
59
|
+
* Compare payload schemas using JsonSchema Diff: https://www.npmjs.com/package/json-schema-diff
|
|
60
|
+
* NOTE: It might be possible to define rules for asyncapi-diff to compare properties in message schemas but
|
|
61
|
+
* it would not have the ability to properly evaluate breaking changes as json-schema-diff does.
|
|
62
|
+
* e.g. adding an existing property to the list of required properties is a breaking change.
|
|
63
|
+
*
|
|
64
|
+
* Only schema version http://json-schema.org/draft-07/schema# is supported.
|
|
65
|
+
* If any other version is used (in local file or git) then the comparison result will be 'skipped'.
|
|
66
|
+
*/
|
|
67
|
+
payloadDiff(channel1: Channel, channel2: Channel): Promise<keyof Results>;
|
|
68
|
+
}
|
|
69
|
+
export {};
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageDiff = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
|
+
/* eslint-disable no-console */
|
|
7
|
+
const diff_1 = require("@asyncapi/diff");
|
|
8
|
+
const parser_1 = require("@asyncapi/parser");
|
|
9
|
+
const chalk_1 = require("chalk");
|
|
10
|
+
const jsonDiff = require("diff");
|
|
11
|
+
const fs = require("fs");
|
|
12
|
+
const jsonSchemaDiff = require("json-schema-diff");
|
|
13
|
+
const path = require("path");
|
|
14
|
+
const asyncapi_override_1 = require("./asyncapi-override");
|
|
15
|
+
const git_checkout_tmp_1 = require("./git-checkout-tmp");
|
|
16
|
+
/**
|
|
17
|
+
* Finds AsyncAPI documents found in git, and compares them with the current file system.
|
|
18
|
+
* The following changes are considered breaking:
|
|
19
|
+
* - Removed / renamed asyncapi document
|
|
20
|
+
* - Breaking changes in any asyncapi document
|
|
21
|
+
* - Breaking changes in any message payload
|
|
22
|
+
* Message payloads are referenced through asyncapi channel definitions. It is safe to rename payload files if
|
|
23
|
+
* file references in the asyncapi document are updated accordingly.
|
|
24
|
+
*
|
|
25
|
+
* @param options (object):
|
|
26
|
+
* schemaRoot Path to directory to scan. All files required to parse the schema must be inside this dir
|
|
27
|
+
* & subdirectories. This includes JSON Schema references.
|
|
28
|
+
* filePattern Regular expression that matches suitable input files.
|
|
29
|
+
* excludePattern Regular expression that matches suitable input files.
|
|
30
|
+
* branch Git branch to compare to.
|
|
31
|
+
* verbose Verbose output includes full diff for all files, not only where breaking changes were found.
|
|
32
|
+
*/
|
|
33
|
+
class MessageDiff {
|
|
34
|
+
constructor(options) {
|
|
35
|
+
this.results = {
|
|
36
|
+
skipped: 0,
|
|
37
|
+
same: 0,
|
|
38
|
+
changed: 0,
|
|
39
|
+
breaking: 0,
|
|
40
|
+
};
|
|
41
|
+
this.schemaRoot = path.resolve(options.inputDir);
|
|
42
|
+
this.branch = options.branch;
|
|
43
|
+
this.verbose = options.verbose;
|
|
44
|
+
try {
|
|
45
|
+
this.filePattern = new RegExp(options.filePattern);
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error(`${options.filePattern} is not a valid regular expression.`);
|
|
49
|
+
process.exit(2);
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
this.excludePattern =
|
|
53
|
+
options.excludePattern === undefined
|
|
54
|
+
? undefined
|
|
55
|
+
: new RegExp(options.excludePattern);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
console.error(`${options.excludePattern} is not a valid regular expression.`);
|
|
59
|
+
process.exit(2);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
run() {
|
|
63
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
64
|
+
// checkout branch to temp dir
|
|
65
|
+
const gitTmp = new git_checkout_tmp_1.GitCheckoutTmp();
|
|
66
|
+
gitTmp.checkout(this.schemaRoot, this.branch);
|
|
67
|
+
const rootDir1 = gitTmp.tmpDir;
|
|
68
|
+
const rootDir2 = gitTmp.gitRoot;
|
|
69
|
+
if (rootDir1 === undefined || rootDir2 === undefined) {
|
|
70
|
+
throw `Git checkout failed`;
|
|
71
|
+
}
|
|
72
|
+
// scan the checked out files
|
|
73
|
+
try {
|
|
74
|
+
const relPath = path.relative(rootDir2, this.schemaRoot);
|
|
75
|
+
yield this.walk(path.join(rootDir1, relPath), path.join(rootDir2, relPath));
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
// remove tmp files
|
|
79
|
+
gitTmp.cleanUp();
|
|
80
|
+
}
|
|
81
|
+
// check results
|
|
82
|
+
const totalFiles = this.results.skipped +
|
|
83
|
+
this.results.same +
|
|
84
|
+
this.results.changed +
|
|
85
|
+
this.results.breaking;
|
|
86
|
+
if (totalFiles === 0) {
|
|
87
|
+
throw `No files found matching the given arguments`;
|
|
88
|
+
}
|
|
89
|
+
const color = this.results.breaking > 0
|
|
90
|
+
? chalk_1.red
|
|
91
|
+
: this.results.skipped > 0
|
|
92
|
+
? chalk_1.white
|
|
93
|
+
: chalk_1.green;
|
|
94
|
+
console.log(color(`${totalFiles} file${totalFiles === 1 ? ' was' : 's were'} checked. ${this.results.skipped} ${this.results.skipped === 1 ? 'was' : 'were'} skipped. ${this.results.same} ${this.results.same === 1 ? 'is' : 'are'} the same. ${this.results.changed} ${this.results.changed === 1 ? 'has' : 'have'} non-breaking changes. ${this.results.breaking} ${this.results.breaking === 1 ? 'has' : 'have'} breaking changes.`));
|
|
95
|
+
if (this.results.breaking > 0) {
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Recursively walks a directory comparing matching files to another directory.
|
|
102
|
+
* @param dir1 - Root dir to scan for matching files.
|
|
103
|
+
* @param dir2 - Root dir for comparision.
|
|
104
|
+
*/
|
|
105
|
+
walk(dir1, dir2) {
|
|
106
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
107
|
+
const items = yield fs.promises.readdir(dir1);
|
|
108
|
+
const fullPathItems = items.map((i) => path.join(dir1, i));
|
|
109
|
+
const dirs = fullPathItems.filter((i) => fs.statSync(i).isDirectory());
|
|
110
|
+
const files = fullPathItems.filter((i) => fs.statSync(i).isFile() &&
|
|
111
|
+
this.filePattern.test(i) &&
|
|
112
|
+
(!this.excludePattern || !this.excludePattern.test(i)));
|
|
113
|
+
if ([...files, ...dirs].length === 0) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
for (const file1 of files) {
|
|
117
|
+
const file2 = path.join(dir2, path.relative(dir1, file1));
|
|
118
|
+
yield this.asyncApiDiff(file1, file2);
|
|
119
|
+
}
|
|
120
|
+
for (const subDir1 of dirs) {
|
|
121
|
+
const subDir2 = path.join(dir2, path.relative(dir1, subDir1));
|
|
122
|
+
yield this.walk(subDir1, subDir2);
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Full comparison of asyncapi documents. Each channel payload is also compared.
|
|
128
|
+
*/
|
|
129
|
+
asyncApiDiff(file1, file2) {
|
|
130
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
131
|
+
console.log(`Comparing asyncapi document '${file2}'. Changes from branch '${this.branch}':`);
|
|
132
|
+
let document1;
|
|
133
|
+
let document2;
|
|
134
|
+
// load asyncapi document from git
|
|
135
|
+
try {
|
|
136
|
+
const text = fs.readFileSync(file1, 'utf8');
|
|
137
|
+
document1 = yield (0, parser_1.parse)(text, { path: file1 });
|
|
138
|
+
}
|
|
139
|
+
catch (e) {
|
|
140
|
+
throw `Error reading ${file1}: ${e}`;
|
|
141
|
+
}
|
|
142
|
+
// load local asyncapi document
|
|
143
|
+
try {
|
|
144
|
+
if (!fs.existsSync(file2)) {
|
|
145
|
+
console.log((0, chalk_1.red)(`❌ File not found. This document may have been removed. Assuming this is a breaking change.`));
|
|
146
|
+
this.results.breaking++;
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const text = fs.readFileSync(file2, 'utf8');
|
|
150
|
+
document2 = yield (0, parser_1.parse)(text, { path: file2 });
|
|
151
|
+
}
|
|
152
|
+
catch (e) {
|
|
153
|
+
throw `Error reading ${file2}: ${e}`;
|
|
154
|
+
}
|
|
155
|
+
// diff document
|
|
156
|
+
const resultKey = yield this.documentDiff(document1, document2);
|
|
157
|
+
this.results[resultKey]++;
|
|
158
|
+
const channels1 = document1.channels();
|
|
159
|
+
const channels2 = document2.channels();
|
|
160
|
+
// diff payloads for channels which exist in both documents
|
|
161
|
+
// removed / renamed channels are already marked as breaking
|
|
162
|
+
for (const [k, channel1] of Object.entries(channels1)) {
|
|
163
|
+
if (!(k in channels2)) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
console.log(`Comparing payload for channel ${k} in document ${file2}. Changes from branch ${this.branch}`);
|
|
167
|
+
const channel2 = channels2[k];
|
|
168
|
+
const resultKey = yield this.payloadDiff(channel1, channel2);
|
|
169
|
+
this.results[resultKey]++;
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Compare asyncapi documents using AsyncAPI Diff: https://github.com/asyncapi/diff
|
|
175
|
+
* Note: non standard rules are defined in file: asyncapi-override.ts
|
|
176
|
+
*/
|
|
177
|
+
documentDiff(document1, document2) {
|
|
178
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
179
|
+
// generate diff
|
|
180
|
+
// overrides are applied through options here:
|
|
181
|
+
const output = (0, diff_1.diff)(document1.json(), document2.json(), { override: asyncapi_override_1.override });
|
|
182
|
+
const breaking = output.breaking();
|
|
183
|
+
const nonBreaking = output.nonBreaking();
|
|
184
|
+
const unclassified = output.unclassified();
|
|
185
|
+
// log full results if breaking changes were found or verbose is set
|
|
186
|
+
const itemMsg = (change) => typeof change === 'string' ? change : `${change.action} ${change.path}`;
|
|
187
|
+
if (this.verbose) {
|
|
188
|
+
for (const item of unclassified) {
|
|
189
|
+
console.log(` ? ${itemMsg(item)}`);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
if (breaking.length > 0 || this.verbose) {
|
|
193
|
+
for (const item of nonBreaking) {
|
|
194
|
+
console.log(` ✔ ${itemMsg(item)}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
for (const item of breaking) {
|
|
198
|
+
console.log(` ✖ ${itemMsg(item)}`);
|
|
199
|
+
}
|
|
200
|
+
// log summary
|
|
201
|
+
const color = breaking.length > 0 ? chalk_1.red : chalk_1.green;
|
|
202
|
+
console.log(color(`${breaking.length > 0 ? '❌ ' : ''}${nonBreaking.length} non-breaking change${nonBreaking.length === 1 ? '' : 's'}, ${breaking.length} breaking change${breaking.length === 1 ? '' : 's'} in asyncapi document`));
|
|
203
|
+
return breaking.length > 0
|
|
204
|
+
? 'breaking'
|
|
205
|
+
: nonBreaking.length > 0
|
|
206
|
+
? 'changed'
|
|
207
|
+
: 'same';
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Compare payload schemas using JsonSchema Diff: https://www.npmjs.com/package/json-schema-diff
|
|
212
|
+
* NOTE: It might be possible to define rules for asyncapi-diff to compare properties in message schemas but
|
|
213
|
+
* it would not have the ability to properly evaluate breaking changes as json-schema-diff does.
|
|
214
|
+
* e.g. adding an existing property to the list of required properties is a breaking change.
|
|
215
|
+
*
|
|
216
|
+
* Only schema version http://json-schema.org/draft-07/schema# is supported.
|
|
217
|
+
* If any other version is used (in local file or git) then the comparison result will be 'skipped'.
|
|
218
|
+
*/
|
|
219
|
+
payloadDiff(channel1, channel2) {
|
|
220
|
+
return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
|
|
221
|
+
const getChannelPayload = (channel) => {
|
|
222
|
+
var _a, _b, _c;
|
|
223
|
+
const json = channel.json();
|
|
224
|
+
return (_c = (_b = ((_a = json.subscribe) !== null && _a !== void 0 ? _a : json.publish)) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.payload;
|
|
225
|
+
};
|
|
226
|
+
const schema1 = getChannelPayload(channel1);
|
|
227
|
+
const schema2 = getChannelPayload(channel2);
|
|
228
|
+
if (schema1 === undefined) {
|
|
229
|
+
throw `Could not find payload schema in ${this.branch}`;
|
|
230
|
+
}
|
|
231
|
+
if (schema2 === undefined) {
|
|
232
|
+
throw `Could not find payload schema`;
|
|
233
|
+
}
|
|
234
|
+
let result;
|
|
235
|
+
try {
|
|
236
|
+
result = yield jsonSchemaDiff.diffSchemas({
|
|
237
|
+
sourceSchema: schema1,
|
|
238
|
+
destinationSchema: schema2,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
catch (e) {
|
|
242
|
+
// Skip if unsupported schema version is used by either payload
|
|
243
|
+
if (e instanceof Error &&
|
|
244
|
+
e.message.startsWith('no schema with key or ref')) {
|
|
245
|
+
console.log(`WARNING: Unsupported JsonSchema version. This payload will be skipped. Both versions of the file must use $schema: "http://json-schema.org/draft-07/schema#".`);
|
|
246
|
+
return 'skipped';
|
|
247
|
+
}
|
|
248
|
+
throw e;
|
|
249
|
+
}
|
|
250
|
+
if (result.removalsFound || this.verbose) {
|
|
251
|
+
// json-schema-diff does not give a useful report of what are the breaking changes. See:
|
|
252
|
+
// https://bitbucket.org/atlassian/json-schema-diff/issues/6/is-it-supposed-to-report-only-what-has
|
|
253
|
+
// So we display a line-by-line diff of the schemas..its not targeted to what is breaking, but its more useful
|
|
254
|
+
// than just logging both versions in full which is the observed behavior of json-schema-diff.
|
|
255
|
+
const diffResult = jsonDiff.diffJson(schema1, schema2);
|
|
256
|
+
diffResult.forEach((r) => {
|
|
257
|
+
for (const line of r.value.split(/\r?\n/)) {
|
|
258
|
+
// strip blank lines and annotations added by asyncapi parser
|
|
259
|
+
if (!line || line.match(/^\s+"x-parser-schema/)) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
console.log(`${r.removed ? ' -' : r.added ? ' +' : ' '} ${line}`);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
const color = result.removalsFound ? chalk_1.red : chalk_1.green;
|
|
267
|
+
console.log(color(result.removalsFound
|
|
268
|
+
? '❌ Breaking changes in payload'
|
|
269
|
+
: result.additionsFound
|
|
270
|
+
? 'No breaking changes in payload'
|
|
271
|
+
: 'No changes in payload'));
|
|
272
|
+
return result.removalsFound
|
|
273
|
+
? 'breaking'
|
|
274
|
+
: result.additionsFound
|
|
275
|
+
? 'changed'
|
|
276
|
+
: 'same';
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
exports.MessageDiff = MessageDiff;
|
|
281
|
+
//# sourceMappingURL=msg-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"msg-diff.js","sourceRoot":"","sources":["../../../src/commands/msg-diff/msg-diff.ts"],"names":[],"mappings":";;;;AAAA,uDAAuD;AACvD,+BAA+B;AAC/B,yCAAsD;AACtD,6CAAoE;AACpE,iCAA0C;AAC1C,iCAAiC;AACjC,yBAAyB;AACzB,mDAAmD;AACnD,6BAA6B;AAC7B,2DAA+C;AAC/C,yDAAoD;AAapD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAa,WAAW;IActB,YAAY,OAA2B;QAPvB,YAAO,GAAG;YACxB,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,CAAC;SACZ,CAAC;QAGA,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAA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|
+
"version": "0.10.0-rc.5",
|
|
4
4
|
"description": "The Axinom Mosaic CLI",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -26,10 +26,11 @@
|
|
|
26
26
|
"test:ci": "jest --reporters=default --reporters=jest-junit --coverage --coverageReporters=cobertura --coverageReporters=html"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
+
"@asyncapi/diff": "^0.4.0",
|
|
29
30
|
"@asyncapi/modelina": "^0.43.0",
|
|
30
|
-
"@asyncapi/parser": "^1.
|
|
31
|
-
"@axinom/mosaic-id-link-be": "^0.6.5-rc.
|
|
32
|
-
"@axinom/mosaic-service-common": "^0.19.0-rc.
|
|
31
|
+
"@asyncapi/parser": "^1.15.0",
|
|
32
|
+
"@axinom/mosaic-id-link-be": "^0.6.5-rc.11",
|
|
33
|
+
"@axinom/mosaic-service-common": "^0.19.0-rc.10",
|
|
33
34
|
"@graphql-inspector/core": "^3.1.2",
|
|
34
35
|
"@stoplight/spectral": "^5.9.1",
|
|
35
36
|
"chalk": "^4.1.0",
|
|
@@ -43,6 +44,7 @@
|
|
|
43
44
|
"graphile-utils": "^4.12.1",
|
|
44
45
|
"graphql": "^15.4.0",
|
|
45
46
|
"json-schema": "^0.3.0",
|
|
47
|
+
"json-schema-diff": "^0.17.1",
|
|
46
48
|
"json-schema-ref-parser": "^9.0.7",
|
|
47
49
|
"json5": "^2.2.0",
|
|
48
50
|
"pg": "^8.5.1",
|
|
@@ -61,5 +63,5 @@
|
|
|
61
63
|
"publishConfig": {
|
|
62
64
|
"access": "public"
|
|
63
65
|
},
|
|
64
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "5a247dfd8e95fa184022dd58409bbc08dfe0acd7"
|
|
65
67
|
}
|