@asyncapi/cli 2.12.1 → 2.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/README.md +3 -3
- package/lib/commands/diff.js +4 -12
- package/oclif.manifest.json +1 -1
- package/package.json +6 -7
package/README.md
CHANGED
|
@@ -32,10 +32,10 @@ Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING
|
|
|
32
32
|
|
|
33
33
|
### Set up development environment
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
Read [Development.md](/Development.md) file for development setup.
|
|
36
|
+
|
|
37
|
+
Additional steps:
|
|
36
38
|
|
|
37
|
-
- Clone the repo.
|
|
38
|
-
- Run `npm install` to install all the required dependencies
|
|
39
39
|
- Run `npm run test` to make sure everything is properly set up
|
|
40
40
|
- Run `npm run build` and then `bin/run` to try new CLI locally
|
|
41
41
|
|
package/lib/commands/diff.js
CHANGED
|
@@ -38,9 +38,6 @@ class Diff extends base_1.default {
|
|
|
38
38
|
}
|
|
39
39
|
try {
|
|
40
40
|
firstDocument = yield (0, SpecificationFile_1.load)(firstDocumentPath);
|
|
41
|
-
if (firstDocument.isAsyncAPI3()) {
|
|
42
|
-
this.error('Diff command does not support AsyncAPI v3 yet which was your first document, please checkout https://github.com/asyncapi/diff/issues/154');
|
|
43
|
-
}
|
|
44
41
|
enableWatch(watchMode, {
|
|
45
42
|
spec: firstDocument,
|
|
46
43
|
handler: this,
|
|
@@ -60,9 +57,6 @@ class Diff extends base_1.default {
|
|
|
60
57
|
}
|
|
61
58
|
try {
|
|
62
59
|
secondDocument = yield (0, SpecificationFile_1.load)(secondDocumentPath);
|
|
63
|
-
if (secondDocument.isAsyncAPI3()) {
|
|
64
|
-
this.error('Diff command does not support AsyncAPI v3 yet which was your second document, please checkout https://github.com/asyncapi/diff/issues/154');
|
|
65
|
-
}
|
|
66
60
|
enableWatch(watchMode, {
|
|
67
61
|
spec: secondDocument,
|
|
68
62
|
handler: this,
|
|
@@ -116,7 +110,7 @@ class Diff extends base_1.default {
|
|
|
116
110
|
}
|
|
117
111
|
}
|
|
118
112
|
catch (error) {
|
|
119
|
-
if (error instanceof diff_error_1.DiffBreakingChangeError) {
|
|
113
|
+
if (error instanceof diff_error_1.DiffBreakingChangeError || error instanceof TypeError) {
|
|
120
114
|
this.error(error);
|
|
121
115
|
}
|
|
122
116
|
throw new validation_error_1.ValidationError({
|
|
@@ -174,13 +168,11 @@ function genericOutput(diffOutput, outputType) {
|
|
|
174
168
|
}
|
|
175
169
|
function parseDocuments(command, firstDocument, secondDocument, flags) {
|
|
176
170
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
177
|
-
const { document:
|
|
178
|
-
const { document:
|
|
179
|
-
if (!
|
|
171
|
+
const { document: firstDocumentParsed, status: firstDocumentStatus } = yield (0, parser_1.parse)(command, firstDocument, flags);
|
|
172
|
+
const { document: secondDocumentParsed, status: secondDocumentStatus } = yield (0, parser_1.parse)(command, secondDocument, flags);
|
|
173
|
+
if (!firstDocumentParsed || !secondDocumentParsed || firstDocumentStatus === 'invalid' || secondDocumentStatus === 'invalid') {
|
|
180
174
|
return;
|
|
181
175
|
}
|
|
182
|
-
const firstDocumentParsed = (0, parser_1.convertToOldAPI)(newFirstDocumentParsed);
|
|
183
|
-
const secondDocumentParsed = (0, parser_1.convertToOldAPI)(newSecondDocumentParsed);
|
|
184
176
|
return { firstDocumentParsed, secondDocumentParsed };
|
|
185
177
|
});
|
|
186
178
|
}
|
package/oclif.manifest.json
CHANGED
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": "2.
|
|
4
|
+
"version": "2.13.1",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run_bin"
|
|
@@ -11,15 +11,16 @@
|
|
|
11
11
|
"@asyncapi/avro-schema-parser": "^3.0.23",
|
|
12
12
|
"@asyncapi/bundler": "^0.6.4",
|
|
13
13
|
"@asyncapi/converter": "^1.6.2",
|
|
14
|
-
"@asyncapi/diff": "^0.
|
|
14
|
+
"@asyncapi/diff": "^0.5.0",
|
|
15
15
|
"@asyncapi/generator": "^1.17.25",
|
|
16
16
|
"@asyncapi/modelina-cli": "^4.0.0-next.48",
|
|
17
17
|
"@asyncapi/openapi-schema-parser": "^3.0.24",
|
|
18
18
|
"@asyncapi/optimizer": "^1.0.4",
|
|
19
19
|
"@asyncapi/parser": "^3.3.0",
|
|
20
|
-
"@asyncapi/protobuf-schema-parser": "^3.
|
|
20
|
+
"@asyncapi/protobuf-schema-parser": "^3.4.0",
|
|
21
21
|
"@asyncapi/raml-dt-schema-parser": "^4.0.24",
|
|
22
22
|
"@asyncapi/studio": "^0.20.0",
|
|
23
|
+
"@changesets/changelog-git": "^0.2.0",
|
|
23
24
|
"@clack/prompts": "^0.7.0",
|
|
24
25
|
"@oclif/core": "^4.0.28",
|
|
25
26
|
"@smoya/asyncapi-adoption-metrics": "^2.4.9",
|
|
@@ -68,7 +69,6 @@
|
|
|
68
69
|
"@typescript-eslint/parser": "^5.38.1",
|
|
69
70
|
"acorn": "^8.5.0",
|
|
70
71
|
"chai": "^4.3.6",
|
|
71
|
-
"conventional-changelog-conventionalcommits": "^5.0.0",
|
|
72
72
|
"cross-env": "^7.0.3",
|
|
73
73
|
"eslint": "^8.24.0",
|
|
74
74
|
"eslint-config-oclif": "^4",
|
|
@@ -143,7 +143,8 @@
|
|
|
143
143
|
"repository": "asyncapi/cli",
|
|
144
144
|
"scripts": {
|
|
145
145
|
"build": "rimraf lib && node scripts/fetch-asyncapi-example.js && tsc && oclif manifest && echo \"Build Completed\"",
|
|
146
|
-
"bump:
|
|
146
|
+
"bump:github-action": "cd github-action/lib/ && node bump-action-version.js",
|
|
147
|
+
"bump:version": "npx -p @changesets/cli@2.27.7 changeset version && npm run bump:github-action",
|
|
147
148
|
"dev": "tsc --watch",
|
|
148
149
|
"docker:build": "docker build -t asyncapi/cli:latest .",
|
|
149
150
|
"generate:readme:create": "node -e \"const fs = require('fs'); fs.writeFileSync('scripts/README.md', '# Usage\\n\\n<!-- usage -->\\n\\n# Commands\\n\\n<!-- commands -->\\n');\"",
|
|
@@ -162,7 +163,6 @@
|
|
|
162
163
|
"pretest": "npm run build",
|
|
163
164
|
"pretest:coverage": "npm run build",
|
|
164
165
|
"posttest": "rimraf ./test.asyncapi-cli",
|
|
165
|
-
"release": "semantic-release",
|
|
166
166
|
"test": "npm run test:unit && npm run action:test",
|
|
167
167
|
"test:unit": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" nyc --extension .ts mocha --require ts-node/register --require test/helpers/init.js --reporter spec --timeout 100000 \"test/**/*.test.ts\"",
|
|
168
168
|
"test:one": "cross-env NODE_ENV=development TEST=1 CUSTOM_CONTEXT_FILENAME=\"test.asyncapi-cli\" CUSTOM_CONTEXT_FILE_LOCATION=\"\" nyc --extension .ts mocha --require ts-node/register --require test/helpers/init.js --reporter spec --timeout 100000",
|
|
@@ -170,7 +170,6 @@
|
|
|
170
170
|
"createhook": "oclif generate hook myhook --event=command_not_found",
|
|
171
171
|
"createhookinit": "oclif generate hook inithook --event=init",
|
|
172
172
|
"action:docker:build": "docker build -f github-action/Dockerfile -t asyncapi/github-action-for-cli:latest .",
|
|
173
|
-
"action:bump:version": "npm --no-git-tag-version --allow-same-version version $VERSION",
|
|
174
173
|
"action:test": "cd github-action && make test"
|
|
175
174
|
},
|
|
176
175
|
"types": "lib/index.d.ts"
|