@asyncapi/cli 0.12.7 → 0.12.11

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.
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: AnyOf example
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Application Headers example
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Correlation ID Example
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  id: 'urn:com:gitter:streaming:api'
3
3
  info:
4
4
  title: Gitter Streaming API
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Mercure Hub Example
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Not example
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: OneOf example
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  id: 'urn:rpc:example:client'
3
3
  defaultContentType: application/json
4
4
 
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  id: 'urn:rpc:example:server'
3
3
  defaultContentType: application/json
4
4
 
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Account Service
4
4
  version: 1.0.0
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  id: 'urn:com:slack:rtm:api'
3
3
  info:
4
4
  title: Slack Real Time Messaging API
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Streetlights Kafka API
4
4
  version: '1.0.0'
@@ -1,4 +1,4 @@
1
- asyncapi: '2.2.0'
1
+ asyncapi: '2.3.0'
2
2
  info:
3
3
  title: Streetlights MQTT API
4
4
  version: '1.0.0'
@@ -12,7 +12,7 @@
12
12
  # - Live stream about topics mentioned in part 1 and 2 articles: https://www.youtube.com/watch?v=8tFBcf31e_c
13
13
  #
14
14
 
15
- asyncapi: '2.2.0'
15
+ asyncapi: '2.3.0'
16
16
 
17
17
  #
18
18
  # Overal information for users of the application
@@ -1 +1 @@
1
- {"version":"0.12.7","commands":{"config":{"id":"config","description":"access configs","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"new":{"id":"new","description":"creates a new asyncapi file","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"file-name":{"name":"file-name","type":"option","char":"n","description":"name of the file"},"example":{"name":"example","type":"option","char":"e","description":"name of the example to use"},"studio":{"name":"studio","type":"boolean","char":"s","description":"open in Studio","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio"},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[]},"start":{"id":"start","description":"starts a new local instance of Studio","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"validate":{"id":"validate","description":"validate asyncapi file","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"config:context":{"id":"config:context","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start:studio":{"id":"start:studio","description":"starts a new local instance of Studio","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"file":{"name":"file","type":"option","char":"f","description":"path to the AsyncAPI file to link with Studio"},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio"}},"args":[]},"config:context:add":{"id":"config:context:add","description":"Add or modify a context in the store","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"context-name","description":"context name","required":true},{"name":"spec-file-path","description":"file path of the spec file","required":true}]},"config:context:current":{"id":"config:context:current","description":"Shows the current context that is being used","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"config:context:list":{"id":"config:context:list","description":"List all the stored context in the store","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"config:context:remove":{"id":"config:context:remove","description":"Delete a context from the store","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"context-name","description":"Name of the context to delete","required":true}]},"config:context:use":{"id":"config:context:use","description":"Set a context as current","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"context-name","description":"name of the saved context","required":true}]}}}
1
+ {"version":"0.12.11","commands":{"config":{"id":"config","description":"access configs","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"new":{"id":"new","description":"creates a new asyncapi file","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"file-name":{"name":"file-name","type":"option","char":"n","description":"name of the file"},"example":{"name":"example","type":"option","char":"e","description":"name of the example to use"},"studio":{"name":"studio","type":"boolean","char":"s","description":"open in Studio","allowNo":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio"},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[]},"start":{"id":"start","description":"starts a new local instance of Studio","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"validate":{"id":"validate","description":"validate asyncapi file","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}]},"config:context":{"id":"config:context","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"start:studio":{"id":"start:studio","description":"starts a new local instance of Studio","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false},"file":{"name":"file","type":"option","char":"f","description":"path to the AsyncAPI file to link with Studio"},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio"}},"args":[]},"config:context:add":{"id":"config:context:add","description":"Add or modify a context in the store","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"context-name","description":"context name","required":true},{"name":"spec-file-path","description":"file path of the spec file","required":true}]},"config:context:current":{"id":"config:context:current","description":"Shows the current context that is being used","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"config:context:list":{"id":"config:context:list","description":"List all the stored context in the store","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"config:context:remove":{"id":"config:context:remove","description":"Delete a context from the store","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"context-name","description":"Name of the context to delete","required":true}]},"config:context:use":{"id":"config:context:use","description":"Set a context as current","pluginName":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[{"name":"context-name","description":"name of the saved context","required":true}]}}}
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.12.7",
4
+ "version": "0.12.11",
5
5
  "author": "@asyncapi",
6
6
  "bin": {
7
7
  "asyncapi": "./bin/run"
@@ -9,11 +9,10 @@
9
9
  "bugs": "https://github.com/asyncapi/cli/issues",
10
10
  "dependencies": {
11
11
  "@asyncapi/parser": "^1.12.0",
12
- "@asyncapi/studio": "^0.6.1",
12
+ "@asyncapi/studio": "^0.9.0",
13
13
  "@fmvilas/oclif-plugin-spaced-commands": "^1.0.4",
14
14
  "@oclif/command": "^1.8.0",
15
15
  "@oclif/config": "^1.17.0",
16
- "@oclif/plugin-help": "^3.2.3",
17
16
  "@types/inquirer": "^8.1.3",
18
17
  "@types/ws": "^8.2.0",
19
18
  "chalk": "^4.1.0",
@@ -89,8 +88,7 @@
89
88
  "bin": "asyncapi",
90
89
  "plugins": [
91
90
  "@fmvilas/oclif-plugin-spaced-commands"
92
- ],
93
- "helpClass": "./lib/help"
91
+ ]
94
92
  },
95
93
  "publishConfig": {
96
94
  "access": "public"
@@ -1,5 +0,0 @@
1
- import CommandHelp from '@oclif/plugin-help/lib/command';
2
- import * as Config from '@oclif/config';
3
- export default class CommandHelper extends CommandHelp {
4
- flags(flags: Config.Command.Flag[]): string | undefined;
5
- }
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const command_1 = tslib_1.__importDefault(require("@oclif/plugin-help/lib/command"));
5
- const list_1 = require("@oclif/plugin-help/lib/list");
6
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
- const indent_string_1 = tslib_1.__importDefault(require("indent-string"));
8
- const { underline, bold, dim } = chalk_1.default;
9
- class CommandHelper extends command_1.default {
10
- /* eslint-disable sonarjs/cognitive-complexity */
11
- flags(flags) {
12
- if (flags.length === 0) {
13
- return;
14
- }
15
- const body = list_1.renderList(flags.map(flag => {
16
- var _a;
17
- let left = flag.helpLabel;
18
- if (!left) {
19
- const label = [];
20
- if (flag.char) {
21
- label.push(`-${flag.char[0]}`);
22
- }
23
- if (flag.name) {
24
- if (flag.type === 'boolean' && flag.allowNo) {
25
- label.push(`--[no-]${flag.name.trim()}`);
26
- }
27
- else {
28
- label.push(`--${flag.name.trim()}`);
29
- }
30
- }
31
- left = label.join(', ');
32
- }
33
- if (flag.type === 'option') {
34
- let value = flag.helpValue || flag.name;
35
- if (!flag.helpValue && flag.options) {
36
- value = flag.options.join('|');
37
- }
38
- if (!value.includes('|')) {
39
- value = underline(value);
40
- }
41
- left += `=${value}`;
42
- }
43
- let right = flag.description || '';
44
- // `flag.default` is not always a string (typing bug), hence `toString()`
45
- if (flag.type === 'option' && (flag.default || ((_a = flag.default) === null || _a === void 0 ? void 0 : _a.toString()) === '0')) {
46
- right = `[default: ${flag.default}] ${right}`;
47
- }
48
- if (flag.required) {
49
- right = `(required) ${right}`;
50
- }
51
- return [left, dim(right.trim())];
52
- }), { stripAnsi: this.opts.stripAnsi, maxWidth: this.opts.maxWidth - 2 });
53
- return [
54
- bold('FLAGS'),
55
- indent_string_1.default(body, 2),
56
- ].join('\n');
57
- }
58
- }
59
- exports.default = CommandHelper;
@@ -1,8 +0,0 @@
1
- import Help from '@oclif/plugin-help';
2
- import * as Config from '@oclif/config';
3
- export default class CustomHelp extends Help {
4
- showRootHelp(): void;
5
- showTopicHelp(topic: Config.Topic): void;
6
- showCommandHelp(command: Config.Command): void;
7
- formatCommand(command: Config.Command): string;
8
- }
package/lib/help/index.js DELETED
@@ -1,50 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const plugin_help_1 = tslib_1.__importDefault(require("@oclif/plugin-help"));
5
- const CommandHelper_1 = tslib_1.__importDefault(require("./CommandHelper"));
6
- class CustomHelp extends plugin_help_1.default {
7
- showRootHelp() {
8
- let rootCommands = this.sortedCommands;
9
- console.log(this.formatRoot());
10
- console.log('');
11
- if (!this.opts.all) {
12
- rootCommands = rootCommands.filter(c => !c.id.includes(':'));
13
- }
14
- if (rootCommands.length > 0) {
15
- rootCommands = rootCommands.filter(c => c.id);
16
- console.log(this.formatCommands(rootCommands));
17
- console.log('');
18
- }
19
- }
20
- showTopicHelp(topic) {
21
- const name = topic.name;
22
- const depth = name.split(':').length;
23
- const commands = this.sortedCommands.filter(c => c.id.startsWith(`${name}:`) && c.id.split(':').length === depth + 1);
24
- console.log(this.formatTopic(topic));
25
- if (commands.length > 0) {
26
- console.log(this.formatCommands(commands));
27
- console.log('');
28
- }
29
- }
30
- showCommandHelp(command) {
31
- const name = command.id;
32
- const depth = name.split(':').length;
33
- const subCommands = this.sortedCommands.filter(c => c.id.startsWith(`${name}:`) && c.id.split(':').length === depth + 1);
34
- const title = command.description && this.render(command.description).split('\n')[0];
35
- if (title) {
36
- console.log(`${title}\n`);
37
- }
38
- console.log(this.formatCommand(command));
39
- console.log('');
40
- if (subCommands.length > 0) {
41
- console.log(this.formatCommands(subCommands));
42
- console.log('');
43
- }
44
- }
45
- formatCommand(command) {
46
- const help = new CommandHelper_1.default(command, this.config, this.opts);
47
- return help.generate();
48
- }
49
- }
50
- exports.default = CustomHelp;