@asyncapi/cli 3.1.0 → 3.1.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/assets/create-glee-app/templates/tutorial/package-lock.json +38 -117
- package/lib/commands/start/studio.d.ts +2 -0
- package/lib/commands/start/studio.js +46 -2
- package/lib/core/flags/start/studio.flags.d.ts +1 -0
- package/lib/core/flags/start/studio.flags.js +5 -0
- package/oclif.manifest.json +8 -1
- package/package.json +1 -1
|
@@ -451,11 +451,13 @@
|
|
|
451
451
|
}
|
|
452
452
|
},
|
|
453
453
|
"node_modules/@babel/code-frame": {
|
|
454
|
-
"version": "7.
|
|
455
|
-
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.
|
|
456
|
-
"integrity": "sha512-
|
|
454
|
+
"version": "7.26.2",
|
|
455
|
+
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
|
|
456
|
+
"integrity": "sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==",
|
|
457
|
+
"license": "MIT",
|
|
457
458
|
"dependencies": {
|
|
458
|
-
"@babel/
|
|
459
|
+
"@babel/helper-validator-identifier": "^7.25.9",
|
|
460
|
+
"js-tokens": "^4.0.0",
|
|
459
461
|
"picocolors": "^1.0.0"
|
|
460
462
|
},
|
|
461
463
|
"engines": {
|
|
@@ -753,17 +755,19 @@
|
|
|
753
755
|
}
|
|
754
756
|
},
|
|
755
757
|
"node_modules/@babel/helper-string-parser": {
|
|
756
|
-
"version": "7.
|
|
757
|
-
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.
|
|
758
|
-
"integrity": "sha512-
|
|
758
|
+
"version": "7.25.9",
|
|
759
|
+
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.25.9.tgz",
|
|
760
|
+
"integrity": "sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==",
|
|
761
|
+
"license": "MIT",
|
|
759
762
|
"engines": {
|
|
760
763
|
"node": ">=6.9.0"
|
|
761
764
|
}
|
|
762
765
|
},
|
|
763
766
|
"node_modules/@babel/helper-validator-identifier": {
|
|
764
|
-
"version": "7.
|
|
765
|
-
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.
|
|
766
|
-
"integrity": "sha512-
|
|
767
|
+
"version": "7.25.9",
|
|
768
|
+
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.9.tgz",
|
|
769
|
+
"integrity": "sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==",
|
|
770
|
+
"license": "MIT",
|
|
767
771
|
"engines": {
|
|
768
772
|
"node": ">=6.9.0"
|
|
769
773
|
}
|
|
@@ -790,101 +794,25 @@
|
|
|
790
794
|
}
|
|
791
795
|
},
|
|
792
796
|
"node_modules/@babel/helpers": {
|
|
793
|
-
"version": "7.
|
|
794
|
-
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.
|
|
795
|
-
"integrity": "sha512-
|
|
796
|
-
"
|
|
797
|
-
"@babel/template": "^7.25.0",
|
|
798
|
-
"@babel/types": "^7.25.6"
|
|
799
|
-
},
|
|
800
|
-
"engines": {
|
|
801
|
-
"node": ">=6.9.0"
|
|
802
|
-
}
|
|
803
|
-
},
|
|
804
|
-
"node_modules/@babel/highlight": {
|
|
805
|
-
"version": "7.24.7",
|
|
806
|
-
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz",
|
|
807
|
-
"integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==",
|
|
797
|
+
"version": "7.26.10",
|
|
798
|
+
"resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.26.10.tgz",
|
|
799
|
+
"integrity": "sha512-UPYc3SauzZ3JGgj87GgZ89JVdC5dj0AoetR5Bw6wj4niittNyFh6+eOGonYvJ1ao6B8lEa3Q3klS7ADZ53bc5g==",
|
|
800
|
+
"license": "MIT",
|
|
808
801
|
"dependencies": {
|
|
809
|
-
"@babel/
|
|
810
|
-
"
|
|
811
|
-
"js-tokens": "^4.0.0",
|
|
812
|
-
"picocolors": "^1.0.0"
|
|
802
|
+
"@babel/template": "^7.26.9",
|
|
803
|
+
"@babel/types": "^7.26.10"
|
|
813
804
|
},
|
|
814
805
|
"engines": {
|
|
815
806
|
"node": ">=6.9.0"
|
|
816
807
|
}
|
|
817
808
|
},
|
|
818
|
-
"node_modules/@babel/highlight/node_modules/ansi-styles": {
|
|
819
|
-
"version": "3.2.1",
|
|
820
|
-
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
|
|
821
|
-
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
|
|
822
|
-
"dependencies": {
|
|
823
|
-
"color-convert": "^1.9.0"
|
|
824
|
-
},
|
|
825
|
-
"engines": {
|
|
826
|
-
"node": ">=4"
|
|
827
|
-
}
|
|
828
|
-
},
|
|
829
|
-
"node_modules/@babel/highlight/node_modules/chalk": {
|
|
830
|
-
"version": "2.4.2",
|
|
831
|
-
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
|
832
|
-
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
|
|
833
|
-
"dependencies": {
|
|
834
|
-
"ansi-styles": "^3.2.1",
|
|
835
|
-
"escape-string-regexp": "^1.0.5",
|
|
836
|
-
"supports-color": "^5.3.0"
|
|
837
|
-
},
|
|
838
|
-
"engines": {
|
|
839
|
-
"node": ">=4"
|
|
840
|
-
}
|
|
841
|
-
},
|
|
842
|
-
"node_modules/@babel/highlight/node_modules/color-convert": {
|
|
843
|
-
"version": "1.9.3",
|
|
844
|
-
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
|
|
845
|
-
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
|
|
846
|
-
"dependencies": {
|
|
847
|
-
"color-name": "1.1.3"
|
|
848
|
-
}
|
|
849
|
-
},
|
|
850
|
-
"node_modules/@babel/highlight/node_modules/color-name": {
|
|
851
|
-
"version": "1.1.3",
|
|
852
|
-
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
|
|
853
|
-
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw=="
|
|
854
|
-
},
|
|
855
|
-
"node_modules/@babel/highlight/node_modules/escape-string-regexp": {
|
|
856
|
-
"version": "1.0.5",
|
|
857
|
-
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
|
|
858
|
-
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
|
|
859
|
-
"engines": {
|
|
860
|
-
"node": ">=0.8.0"
|
|
861
|
-
}
|
|
862
|
-
},
|
|
863
|
-
"node_modules/@babel/highlight/node_modules/has-flag": {
|
|
864
|
-
"version": "3.0.0",
|
|
865
|
-
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
|
|
866
|
-
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
|
|
867
|
-
"engines": {
|
|
868
|
-
"node": ">=4"
|
|
869
|
-
}
|
|
870
|
-
},
|
|
871
|
-
"node_modules/@babel/highlight/node_modules/supports-color": {
|
|
872
|
-
"version": "5.5.0",
|
|
873
|
-
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
|
|
874
|
-
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
|
|
875
|
-
"dependencies": {
|
|
876
|
-
"has-flag": "^3.0.0"
|
|
877
|
-
},
|
|
878
|
-
"engines": {
|
|
879
|
-
"node": ">=4"
|
|
880
|
-
}
|
|
881
|
-
},
|
|
882
809
|
"node_modules/@babel/parser": {
|
|
883
|
-
"version": "7.
|
|
884
|
-
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.
|
|
885
|
-
"integrity": "sha512-
|
|
810
|
+
"version": "7.26.10",
|
|
811
|
+
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.26.10.tgz",
|
|
812
|
+
"integrity": "sha512-6aQR2zGE/QFi8JpDLjUZEPYOs7+mhKXm86VaKFiLP35JQwQb6bwUE+XbvkH0EptsYhbNBSUGaUBLKqxH1xSgsA==",
|
|
813
|
+
"license": "MIT",
|
|
886
814
|
"dependencies": {
|
|
887
|
-
"@babel/types": "^7.
|
|
815
|
+
"@babel/types": "^7.26.10"
|
|
888
816
|
},
|
|
889
817
|
"bin": {
|
|
890
818
|
"parser": "bin/babel-parser.js"
|
|
@@ -2160,13 +2088,14 @@
|
|
|
2160
2088
|
}
|
|
2161
2089
|
},
|
|
2162
2090
|
"node_modules/@babel/template": {
|
|
2163
|
-
"version": "7.
|
|
2164
|
-
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.
|
|
2165
|
-
"integrity": "sha512-
|
|
2091
|
+
"version": "7.26.9",
|
|
2092
|
+
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.26.9.tgz",
|
|
2093
|
+
"integrity": "sha512-qyRplbeIpNZhmzOysF/wFMuP9sctmh2cFzRAZOn1YapxBsE1i9bJIY586R/WBLfLcmcBlM8ROBiQURnnNy+zfA==",
|
|
2094
|
+
"license": "MIT",
|
|
2166
2095
|
"dependencies": {
|
|
2167
|
-
"@babel/code-frame": "^7.
|
|
2168
|
-
"@babel/parser": "^7.
|
|
2169
|
-
"@babel/types": "^7.
|
|
2096
|
+
"@babel/code-frame": "^7.26.2",
|
|
2097
|
+
"@babel/parser": "^7.26.9",
|
|
2098
|
+
"@babel/types": "^7.26.9"
|
|
2170
2099
|
},
|
|
2171
2100
|
"engines": {
|
|
2172
2101
|
"node": ">=6.9.0"
|
|
@@ -2190,13 +2119,13 @@
|
|
|
2190
2119
|
}
|
|
2191
2120
|
},
|
|
2192
2121
|
"node_modules/@babel/types": {
|
|
2193
|
-
"version": "7.
|
|
2194
|
-
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.
|
|
2195
|
-
"integrity": "sha512
|
|
2122
|
+
"version": "7.26.10",
|
|
2123
|
+
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.26.10.tgz",
|
|
2124
|
+
"integrity": "sha512-emqcG3vHrpxUKTrxcblR36dcrcoRDvKmnL/dCL6ZsHaShW80qxCAcNhzQZrpeM765VzEos+xOi4s+r4IXzTwdQ==",
|
|
2125
|
+
"license": "MIT",
|
|
2196
2126
|
"dependencies": {
|
|
2197
|
-
"@babel/helper-string-parser": "^7.
|
|
2198
|
-
"@babel/helper-validator-identifier": "^7.
|
|
2199
|
-
"to-fast-properties": "^2.0.0"
|
|
2127
|
+
"@babel/helper-string-parser": "^7.25.9",
|
|
2128
|
+
"@babel/helper-validator-identifier": "^7.25.9"
|
|
2200
2129
|
},
|
|
2201
2130
|
"engines": {
|
|
2202
2131
|
"node": ">=6.9.0"
|
|
@@ -12340,14 +12269,6 @@
|
|
|
12340
12269
|
"resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.6.0.tgz",
|
|
12341
12270
|
"integrity": "sha512-XPaBkWQJdsf3pLKJV9p4qN/S+fm2Oj8AIPo1BTUhg5oxkvm9+SVEGFdhyOz7tTdUTfvxMiAs4sp6/eZO2Ew+pw=="
|
|
12342
12271
|
},
|
|
12343
|
-
"node_modules/to-fast-properties": {
|
|
12344
|
-
"version": "2.0.0",
|
|
12345
|
-
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
|
12346
|
-
"integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
|
|
12347
|
-
"engines": {
|
|
12348
|
-
"node": ">=4"
|
|
12349
|
-
}
|
|
12350
|
-
},
|
|
12351
12272
|
"node_modules/to-regex-range": {
|
|
12352
12273
|
"version": "5.0.1",
|
|
12353
12274
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
|
@@ -5,9 +5,11 @@ export default class StartStudio extends Command {
|
|
|
5
5
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
6
6
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
7
7
|
port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
8
|
+
'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
};
|
|
9
10
|
static readonly args: {
|
|
10
11
|
'spec-file': import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
11
12
|
};
|
|
12
13
|
run(): Promise<void>;
|
|
14
|
+
private parseArgs;
|
|
13
15
|
}
|
|
@@ -6,16 +6,23 @@ const Studio_1 = require("../../core/models/Studio");
|
|
|
6
6
|
const SpecificationFile_1 = require("../../core/models/SpecificationFile");
|
|
7
7
|
const studio_flags_1 = require("../../core/flags/start/studio.flags");
|
|
8
8
|
const core_1 = require("@oclif/core");
|
|
9
|
+
const prompts_1 = require("@clack/prompts");
|
|
9
10
|
class StartStudio extends base_1.default {
|
|
10
11
|
run() {
|
|
11
12
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
12
13
|
var _a;
|
|
13
14
|
const { args, flags } = yield this.parse(StartStudio);
|
|
15
|
+
let filePath = (_a = args['spec-file']) !== null && _a !== void 0 ? _a : flags.file;
|
|
16
|
+
let port = flags.port;
|
|
14
17
|
if (flags.file) {
|
|
15
18
|
this.warn('The file flag has been removed and is being replaced by the argument spec-file. Please pass the filename directly like `asyncapi start studio asyncapi.yml`');
|
|
16
19
|
}
|
|
17
|
-
|
|
18
|
-
|
|
20
|
+
const isInteractive = !flags['no-interactive'];
|
|
21
|
+
if (isInteractive && !filePath) {
|
|
22
|
+
const parsedArgs = yield this.parseArgs({ filePath }, port === null || port === void 0 ? void 0 : port.toString());
|
|
23
|
+
filePath = parsedArgs.filePath;
|
|
24
|
+
port = parseInt(parsedArgs.port, 10);
|
|
25
|
+
}
|
|
19
26
|
if (!filePath) {
|
|
20
27
|
try {
|
|
21
28
|
filePath = ((yield (0, SpecificationFile_1.load)()).getFilePath());
|
|
@@ -38,6 +45,43 @@ class StartStudio extends base_1.default {
|
|
|
38
45
|
(0, Studio_1.start)(filePath, port);
|
|
39
46
|
});
|
|
40
47
|
}
|
|
48
|
+
parseArgs(args, port) {
|
|
49
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const operationCancelled = 'Operation cancelled by the user.';
|
|
51
|
+
let askForPort = false;
|
|
52
|
+
let { filePath } = args;
|
|
53
|
+
if (!filePath) {
|
|
54
|
+
filePath = yield (0, prompts_1.text)({
|
|
55
|
+
message: 'Enter the path to the AsyncAPI document',
|
|
56
|
+
defaultValue: 'asyncapi.yaml',
|
|
57
|
+
placeholder: 'asyncapi.yaml',
|
|
58
|
+
validate: (value) => {
|
|
59
|
+
if (!value) {
|
|
60
|
+
return 'The path to the AsyncAPI document is required';
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
askForPort = true;
|
|
65
|
+
}
|
|
66
|
+
if ((0, prompts_1.isCancel)(filePath)) {
|
|
67
|
+
(0, prompts_1.cancel)(operationCancelled);
|
|
68
|
+
this.exit();
|
|
69
|
+
}
|
|
70
|
+
if (!port && askForPort) {
|
|
71
|
+
port = (yield (0, prompts_1.text)({
|
|
72
|
+
message: 'Enter the port in which to start Studio',
|
|
73
|
+
defaultValue: '3210',
|
|
74
|
+
placeholder: '3210',
|
|
75
|
+
validate: (value) => (!value ? 'The port number is required' : undefined),
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
if ((0, prompts_1.isCancel)(port)) {
|
|
79
|
+
(0, prompts_1.cancel)(operationCancelled);
|
|
80
|
+
this.exit();
|
|
81
|
+
}
|
|
82
|
+
return { filePath, port: port !== null && port !== void 0 ? port : '3210' };
|
|
83
|
+
});
|
|
84
|
+
}
|
|
41
85
|
}
|
|
42
86
|
StartStudio.description = 'starts a new local instance of Studio';
|
|
43
87
|
StartStudio.flags = (0, studio_flags_1.studioFlags)();
|
|
@@ -2,4 +2,5 @@ export declare const studioFlags: () => {
|
|
|
2
2
|
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
3
3
|
file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
4
4
|
port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
5
|
+
'no-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
6
|
};
|
|
@@ -7,6 +7,11 @@ const studioFlags = () => {
|
|
|
7
7
|
help: core_1.Flags.help({ char: 'h' }),
|
|
8
8
|
file: core_1.Flags.string({ char: 'f', description: 'path to the AsyncAPI file to link with Studio', deprecated: true }),
|
|
9
9
|
port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
|
|
10
|
+
'no-interactive': core_1.Flags.boolean({
|
|
11
|
+
description: 'disable prompts for this command which asks for file path if not passed via the arguments.',
|
|
12
|
+
required: false,
|
|
13
|
+
default: false,
|
|
14
|
+
}),
|
|
10
15
|
};
|
|
11
16
|
};
|
|
12
17
|
exports.studioFlags = studioFlags;
|
package/oclif.manifest.json
CHANGED
|
@@ -1557,6 +1557,13 @@
|
|
|
1557
1557
|
"hasDynamicHelp": false,
|
|
1558
1558
|
"multiple": false,
|
|
1559
1559
|
"type": "option"
|
|
1560
|
+
},
|
|
1561
|
+
"no-interactive": {
|
|
1562
|
+
"description": "disable prompts for this command which asks for file path if not passed via the arguments.",
|
|
1563
|
+
"name": "no-interactive",
|
|
1564
|
+
"required": false,
|
|
1565
|
+
"allowNo": false,
|
|
1566
|
+
"type": "boolean"
|
|
1560
1567
|
}
|
|
1561
1568
|
},
|
|
1562
1569
|
"hasDynamicHelp": false,
|
|
@@ -1848,5 +1855,5 @@
|
|
|
1848
1855
|
]
|
|
1849
1856
|
}
|
|
1850
1857
|
},
|
|
1851
|
-
"version": "3.1.
|
|
1858
|
+
"version": "3.1.1"
|
|
1852
1859
|
}
|