@asyncapi/cli 0.53.0 → 0.54.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.
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"version": "0.1.0",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@asyncapi/glee": "^0.
|
|
12
|
+
"@asyncapi/glee": "^0.26.0"
|
|
13
13
|
},
|
|
14
14
|
"engines": {
|
|
15
15
|
"node": ">=14.15.1"
|
|
@@ -219,9 +219,9 @@
|
|
|
219
219
|
}
|
|
220
220
|
},
|
|
221
221
|
"node_modules/@asyncapi/glee": {
|
|
222
|
-
"version": "0.
|
|
223
|
-
"resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.
|
|
224
|
-
"integrity": "sha512-
|
|
222
|
+
"version": "0.26.0",
|
|
223
|
+
"resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.26.0.tgz",
|
|
224
|
+
"integrity": "sha512-uY5xqIVWruy4h228j1JKQ+Q0xeqJb7LvLi9fRTQViVmih2PaCV33P+2VMX4CEv4fLmWC2rPqSQ8yBfump2gg/Q==",
|
|
225
225
|
"dependencies": {
|
|
226
226
|
"@asyncapi/generator": "^1.9.18",
|
|
227
227
|
"@asyncapi/html-template": "^0.24.10",
|
|
@@ -11955,9 +11955,9 @@
|
|
|
11955
11955
|
}
|
|
11956
11956
|
},
|
|
11957
11957
|
"@asyncapi/glee": {
|
|
11958
|
-
"version": "0.
|
|
11959
|
-
"resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.
|
|
11960
|
-
"integrity": "sha512-
|
|
11958
|
+
"version": "0.26.0",
|
|
11959
|
+
"resolved": "https://registry.npmjs.org/@asyncapi/glee/-/glee-0.26.0.tgz",
|
|
11960
|
+
"integrity": "sha512-uY5xqIVWruy4h228j1JKQ+Q0xeqJb7LvLi9fRTQViVmih2PaCV33P+2VMX4CEv4fLmWC2rPqSQ8yBfump2gg/Q==",
|
|
11961
11961
|
"requires": {
|
|
11962
11962
|
"@asyncapi/generator": "^1.9.18",
|
|
11963
11963
|
"@asyncapi/html-template": "^0.24.10",
|
|
@@ -9,6 +9,7 @@ export default class NewFile extends Command {
|
|
|
9
9
|
port: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
10
10
|
'no-tty': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
11
11
|
};
|
|
12
|
+
static examples: string[];
|
|
12
13
|
run(): Promise<void>;
|
|
13
14
|
runInteractive(): Promise<void>;
|
|
14
15
|
createAsyncapiFile(fileName: string, selectedTemplate: string): Promise<void>;
|
package/lib/commands/new/file.js
CHANGED
|
@@ -10,6 +10,18 @@ const path_1 = require("path");
|
|
|
10
10
|
const { writeFile, readFile } = fs_1.promises;
|
|
11
11
|
const DEFAULT_ASYNCAPI_FILE_NAME = 'asyncapi.yaml';
|
|
12
12
|
const DEFAULT_ASYNCAPI_TEMPLATE = 'default-example.yaml';
|
|
13
|
+
function loadExampleFile() {
|
|
14
|
+
const exampleFiles = (0, fs_1.readFileSync)((0, path_1.resolve)(__dirname, '../../../assets/examples/examples.json'), { encoding: 'utf8' });
|
|
15
|
+
return JSON.parse(exampleFiles);
|
|
16
|
+
}
|
|
17
|
+
function getExamplesFlagDescription() {
|
|
18
|
+
const examples = loadExampleFile();
|
|
19
|
+
let description = 'name of the example to use. Available examples are:';
|
|
20
|
+
for (const example of examples) {
|
|
21
|
+
description += `\n\t - ${example.value}`;
|
|
22
|
+
}
|
|
23
|
+
return description;
|
|
24
|
+
}
|
|
13
25
|
class NewFile extends base_1.default {
|
|
14
26
|
run() {
|
|
15
27
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
@@ -125,8 +137,12 @@ NewFile.description = 'Creates a new asyncapi file';
|
|
|
125
137
|
NewFile.flags = {
|
|
126
138
|
help: core_1.Flags.help({ char: 'h' }),
|
|
127
139
|
'file-name': core_1.Flags.string({ char: 'n', description: 'name of the file' }),
|
|
128
|
-
example: core_1.Flags.string({ char: 'e', description:
|
|
140
|
+
example: core_1.Flags.string({ char: 'e', description: getExamplesFlagDescription() }),
|
|
129
141
|
studio: core_1.Flags.boolean({ char: 's', description: 'open in Studio' }),
|
|
130
142
|
port: core_1.Flags.integer({ char: 'p', description: 'port in which to start Studio' }),
|
|
131
143
|
'no-tty': core_1.Flags.boolean({ description: 'do not use an interactive terminal' }),
|
|
132
144
|
};
|
|
145
|
+
NewFile.examples = [
|
|
146
|
+
'asyncapi new\t - start creation of a file in interactive mode',
|
|
147
|
+
'asyncapi new --file-name=my-asyncapi.yml --example=default-example.yml --no-tty\t - create a new file with a specific name, using one of the examples and without interactive mode'
|
|
148
|
+
];
|
package/oclif.manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
2
|
+
"version": "0.54.1",
|
|
3
3
|
"commands": {
|
|
4
4
|
"bundle": {
|
|
5
5
|
"id": "bundle",
|
|
@@ -716,6 +716,10 @@
|
|
|
716
716
|
"pluginAlias": "@asyncapi/cli",
|
|
717
717
|
"pluginType": "core",
|
|
718
718
|
"aliases": [],
|
|
719
|
+
"examples": [
|
|
720
|
+
"asyncapi new\t - start creation of a file in interactive mode",
|
|
721
|
+
"asyncapi new --file-name=my-asyncapi.yml --example=default-example.yml --no-tty\t - create a new file with a specific name, using one of the examples and without interactive mode"
|
|
722
|
+
],
|
|
719
723
|
"flags": {
|
|
720
724
|
"help": {
|
|
721
725
|
"name": "help",
|
|
@@ -735,7 +739,7 @@
|
|
|
735
739
|
"name": "example",
|
|
736
740
|
"type": "option",
|
|
737
741
|
"char": "e",
|
|
738
|
-
"description": "name of the example to use",
|
|
742
|
+
"description": "name of the example to use. Available examples are:\n\t - simple.yml\n\t - anyof.yml\n\t - application-headers.yml\n\t - correlation-id.yml\n\t - websocket-gemini.yml\n\t - gitter-streaming.yml\n\t - mercure.yml\n\t - not.yml\n\t - operation-security.yml\n\t - oneof.yml\n\t - rpc-client.yml\n\t - rpc-server.yml\n\t - slack-rtm.yml\n\t - tutorial.yml\n\t - streetlights-kafka.yml\n\t - streetlights-operation-security.yml\n\t - streetlights-mqtt.yml",
|
|
739
743
|
"multiple": false
|
|
740
744
|
},
|
|
741
745
|
"studio": {
|
|
@@ -796,6 +800,10 @@
|
|
|
796
800
|
"pluginAlias": "@asyncapi/cli",
|
|
797
801
|
"pluginType": "core",
|
|
798
802
|
"aliases": [],
|
|
803
|
+
"examples": [
|
|
804
|
+
"asyncapi new\t - start creation of a file in interactive mode",
|
|
805
|
+
"asyncapi new --file-name=my-asyncapi.yml --example=default-example.yml --no-tty\t - create a new file with a specific name, using one of the examples and without interactive mode"
|
|
806
|
+
],
|
|
799
807
|
"flags": {
|
|
800
808
|
"help": {
|
|
801
809
|
"name": "help",
|
|
@@ -815,7 +823,7 @@
|
|
|
815
823
|
"name": "example",
|
|
816
824
|
"type": "option",
|
|
817
825
|
"char": "e",
|
|
818
|
-
"description": "name of the example to use",
|
|
826
|
+
"description": "name of the example to use. Available examples are:\n\t - simple.yml\n\t - anyof.yml\n\t - application-headers.yml\n\t - correlation-id.yml\n\t - websocket-gemini.yml\n\t - gitter-streaming.yml\n\t - mercure.yml\n\t - not.yml\n\t - operation-security.yml\n\t - oneof.yml\n\t - rpc-client.yml\n\t - rpc-server.yml\n\t - slack-rtm.yml\n\t - tutorial.yml\n\t - streetlights-kafka.yml\n\t - streetlights-operation-security.yml\n\t - streetlights-mqtt.yml",
|
|
819
827
|
"multiple": false
|
|
820
828
|
},
|
|
821
829
|
"studio": {
|