@asyncapi/cli 0.10.2 → 0.12.0
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/examples/streetlights-kafka.yml +3 -1
- package/lib/commands/new.js +3 -2
- package/lib/commands/start/studio.js +1 -1
- package/lib/commands/start.d.ts +8 -0
- package/lib/commands/start.js +16 -0
- package/lib/commands/validate.js +9 -3
- package/lib/errors/specification-file.d.ts +3 -0
- package/lib/errors/specification-file.js +8 -1
- package/lib/help/CommandHelper.d.ts +5 -0
- package/lib/help/CommandHelper.js +59 -0
- package/lib/help/index.d.ts +8 -0
- package/lib/help/index.js +50 -0
- package/lib/models/SpecificationFile.d.ts +16 -1
- package/lib/models/SpecificationFile.js +52 -4
- package/oclif.manifest.json +1 -1
- package/package.json +18 -6
package/lib/commands/new.js
CHANGED
|
@@ -12,7 +12,7 @@ const DEFAULT_ASYNCAPI_FILE_NAME = 'asyncapi.yaml';
|
|
|
12
12
|
const DEFAULT_ASYNCAPI_TEMPLATE = 'default-example.yaml';
|
|
13
13
|
class New extends base_1.default {
|
|
14
14
|
async run() {
|
|
15
|
-
const { flags } = this.parse(New);
|
|
15
|
+
const { flags } = this.parse(New); // NOSONAR
|
|
16
16
|
const isTTY = process.stdout.isTTY;
|
|
17
17
|
if (!flags['no-tty'] && isTTY) {
|
|
18
18
|
return this.runInteractive();
|
|
@@ -29,8 +29,9 @@ class New extends base_1.default {
|
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
+
/* eslint-disable sonarjs/cognitive-complexity */
|
|
32
33
|
async runInteractive() {
|
|
33
|
-
const { flags } = this.parse(New);
|
|
34
|
+
const { flags } = this.parse(New); // NOSONAR
|
|
34
35
|
let fileName = flags['file-name'];
|
|
35
36
|
let selectedTemplate = flags['example'];
|
|
36
37
|
let openStudio = flags.studio;
|
|
@@ -8,7 +8,7 @@ const SpecificationFile_1 = require("../../models/SpecificationFile");
|
|
|
8
8
|
class StartStudio extends base_1.default {
|
|
9
9
|
async run() {
|
|
10
10
|
const { flags } = this.parse(StartStudio);
|
|
11
|
-
const filePath = flags.file || (await SpecificationFile_1.load()).
|
|
11
|
+
const filePath = flags.file || (await SpecificationFile_1.load()).getFilePath();
|
|
12
12
|
const port = flags.port;
|
|
13
13
|
Studio_1.start(filePath, port);
|
|
14
14
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Start = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const command_1 = require("@oclif/command");
|
|
6
|
+
const base_1 = tslib_1.__importDefault(require("../base"));
|
|
7
|
+
class Start extends base_1.default {
|
|
8
|
+
async run() {
|
|
9
|
+
this._help();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Start = Start;
|
|
13
|
+
Start.description = 'starts a new local instance of Studio';
|
|
14
|
+
Start.flags = {
|
|
15
|
+
help: command_1.flags.help({ char: 'h' })
|
|
16
|
+
};
|
package/lib/commands/validate.js
CHANGED
|
@@ -27,8 +27,14 @@ class Validate extends base_1.default {
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
try {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
if (specFile.getFilePath()) {
|
|
31
|
+
await parser.parse(specFile.text());
|
|
32
|
+
this.log(`File ${specFile.getFilePath()} successfully validated!`);
|
|
33
|
+
}
|
|
34
|
+
else if (specFile.getFileURL()) {
|
|
35
|
+
await parser.parse(specFile.text());
|
|
36
|
+
this.log(`URL ${specFile.getFileURL()} successfully validated`);
|
|
37
|
+
}
|
|
32
38
|
}
|
|
33
39
|
catch (error) {
|
|
34
40
|
throw new validation_error_1.ValidationError({
|
|
@@ -44,5 +50,5 @@ Validate.flags = {
|
|
|
44
50
|
help: command_1.flags.help({ char: 'h' })
|
|
45
51
|
};
|
|
46
52
|
Validate.args = [
|
|
47
|
-
{ name: 'spec-file', description: 'spec path or context-name', required: false },
|
|
53
|
+
{ name: 'spec-file', description: 'spec path, url, or context-name', required: false },
|
|
48
54
|
];
|
|
@@ -4,4 +4,7 @@ declare class SpecificationFileError extends Error {
|
|
|
4
4
|
export declare class SpecificationFileNotFound extends SpecificationFileError {
|
|
5
5
|
constructor(filePath?: string);
|
|
6
6
|
}
|
|
7
|
+
export declare class SpecificationURLNotFound extends SpecificationFileError {
|
|
8
|
+
constructor(URL: string);
|
|
9
|
+
}
|
|
7
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SpecificationFileNotFound = void 0;
|
|
3
|
+
exports.SpecificationURLNotFound = exports.SpecificationFileNotFound = void 0;
|
|
4
4
|
class SpecificationFileError extends Error {
|
|
5
5
|
constructor() {
|
|
6
6
|
super();
|
|
@@ -19,3 +19,10 @@ class SpecificationFileNotFound extends SpecificationFileError {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
exports.SpecificationFileNotFound = SpecificationFileNotFound;
|
|
22
|
+
class SpecificationURLNotFound extends SpecificationFileError {
|
|
23
|
+
constructor(URL) {
|
|
24
|
+
super();
|
|
25
|
+
this.message = `Unable to fetch specification file from url: ${URL}`;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.SpecificationURLNotFound = SpecificationURLNotFound;
|
|
@@ -0,0 +1,59 @@
|
|
|
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;
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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;
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
+
export declare class Specification {
|
|
2
|
+
private readonly spec;
|
|
3
|
+
private readonly filePath?;
|
|
4
|
+
private readonly fileURL?;
|
|
5
|
+
constructor(spec: string, options?: {
|
|
6
|
+
filepath?: string;
|
|
7
|
+
fileURL?: string;
|
|
8
|
+
});
|
|
9
|
+
text(): string;
|
|
10
|
+
getFilePath(): string | undefined;
|
|
11
|
+
getFileURL(): string | undefined;
|
|
12
|
+
static fromFile(filepath: string): Promise<Specification>;
|
|
13
|
+
static fromURL(URLpath: string): Promise<Specification>;
|
|
14
|
+
}
|
|
1
15
|
export default class SpecificationFile {
|
|
2
16
|
private readonly pathToFile;
|
|
3
17
|
constructor(filePath: string);
|
|
4
18
|
getPath(): string;
|
|
5
19
|
read(): Promise<string>;
|
|
6
20
|
}
|
|
7
|
-
export declare function load(filePathOrContextName?: string): Promise<
|
|
21
|
+
export declare function load(filePathOrContextName?: string): Promise<Specification>;
|
|
8
22
|
export declare function nameType(name: string): Promise<string>;
|
|
23
|
+
export declare function isURL(urlpath: string): Promise<boolean>;
|
|
9
24
|
export declare function fileExists(name: string): Promise<boolean>;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fileExists = exports.nameType = exports.load = void 0;
|
|
3
|
+
exports.fileExists = exports.isURL = exports.nameType = exports.load = exports.Specification = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
6
|
const path = tslib_1.__importStar(require("path"));
|
|
7
|
+
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
7
8
|
const Context_1 = require("./Context");
|
|
8
9
|
const specification_file_1 = require("../errors/specification-file");
|
|
9
10
|
const { readFile, lstat } = fs_1.promises;
|
|
@@ -14,6 +15,37 @@ const allowedFileNames = [
|
|
|
14
15
|
];
|
|
15
16
|
const TYPE_CONTEXT_NAME = 'context-name';
|
|
16
17
|
const TYPE_FILE_PATH = 'file-path';
|
|
18
|
+
const TYPE_URL = 'url-path';
|
|
19
|
+
class Specification {
|
|
20
|
+
constructor(spec, options) {
|
|
21
|
+
this.spec = spec;
|
|
22
|
+
this.filePath = options === null || options === void 0 ? void 0 : options.filepath;
|
|
23
|
+
this.fileURL = options === null || options === void 0 ? void 0 : options.fileURL;
|
|
24
|
+
}
|
|
25
|
+
text() {
|
|
26
|
+
return this.spec;
|
|
27
|
+
}
|
|
28
|
+
getFilePath() {
|
|
29
|
+
return this.filePath;
|
|
30
|
+
}
|
|
31
|
+
getFileURL() {
|
|
32
|
+
return this.fileURL;
|
|
33
|
+
}
|
|
34
|
+
static async fromFile(filepath) {
|
|
35
|
+
return new Specification(await readFile(filepath, { encoding: 'utf8' }), { filepath });
|
|
36
|
+
}
|
|
37
|
+
static async fromURL(URLpath) {
|
|
38
|
+
let response;
|
|
39
|
+
try {
|
|
40
|
+
response = await node_fetch_1.default(URLpath, { method: 'GET' });
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
throw new specification_file_1.SpecificationURLNotFound(URLpath);
|
|
44
|
+
}
|
|
45
|
+
return new Specification(await (response === null || response === void 0 ? void 0 : response.text()), { fileURL: URLpath });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.Specification = Specification;
|
|
17
49
|
class SpecificationFile {
|
|
18
50
|
constructor(filePath) {
|
|
19
51
|
this.pathToFile = filePath;
|
|
@@ -32,8 +64,11 @@ async function load(filePathOrContextName) {
|
|
|
32
64
|
if (type === TYPE_CONTEXT_NAME) {
|
|
33
65
|
return loadFromContext(filePathOrContextName);
|
|
34
66
|
}
|
|
67
|
+
if (type === TYPE_URL) {
|
|
68
|
+
return Specification.fromURL(filePathOrContextName);
|
|
69
|
+
}
|
|
35
70
|
await fileExists(filePathOrContextName);
|
|
36
|
-
return
|
|
71
|
+
return Specification.fromFile(filePathOrContextName);
|
|
37
72
|
}
|
|
38
73
|
try {
|
|
39
74
|
return await loadFromContext();
|
|
@@ -41,7 +76,7 @@ async function load(filePathOrContextName) {
|
|
|
41
76
|
catch (e) {
|
|
42
77
|
const autoDetectedSpecFile = await detectSpecFile();
|
|
43
78
|
if (autoDetectedSpecFile) {
|
|
44
|
-
return
|
|
79
|
+
return Specification.fromFile(autoDetectedSpecFile);
|
|
45
80
|
}
|
|
46
81
|
if (!filePathOrContextName || !autoDetectedSpecFile) {
|
|
47
82
|
throw e;
|
|
@@ -61,10 +96,23 @@ async function nameType(name) {
|
|
|
61
96
|
return TYPE_CONTEXT_NAME;
|
|
62
97
|
}
|
|
63
98
|
catch (e) {
|
|
99
|
+
if (await isURL(name)) {
|
|
100
|
+
return TYPE_URL;
|
|
101
|
+
}
|
|
64
102
|
return TYPE_CONTEXT_NAME;
|
|
65
103
|
}
|
|
66
104
|
}
|
|
67
105
|
exports.nameType = nameType;
|
|
106
|
+
async function isURL(urlpath) {
|
|
107
|
+
try {
|
|
108
|
+
const url = new URL(urlpath);
|
|
109
|
+
return url.protocol === 'http:' || url.protocol === 'https:';
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
exports.isURL = isURL;
|
|
68
116
|
async function fileExists(name) {
|
|
69
117
|
try {
|
|
70
118
|
if ((await lstat(name)).isFile()) {
|
|
@@ -79,7 +127,7 @@ async function fileExists(name) {
|
|
|
79
127
|
exports.fileExists = fileExists;
|
|
80
128
|
async function loadFromContext(contextName) {
|
|
81
129
|
const context = await Context_1.loadContext(contextName);
|
|
82
|
-
return
|
|
130
|
+
return Specification.fromFile(context);
|
|
83
131
|
}
|
|
84
132
|
async function detectSpecFile() {
|
|
85
133
|
const existingFileNames = await Promise.all(allowedFileNames.map(async (filename) => {
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.12.0","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.
|
|
4
|
+
"version": "0.12.0",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run"
|
|
@@ -9,21 +9,27 @@
|
|
|
9
9
|
"bugs": "https://github.com/asyncapi/cli/issues",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@asyncapi/parser": "^1.12.0",
|
|
12
|
-
"@asyncapi/studio": "^0.
|
|
12
|
+
"@asyncapi/studio": "^0.5.1",
|
|
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
16
|
"@oclif/plugin-help": "^3.2.3",
|
|
17
17
|
"@types/inquirer": "^8.1.3",
|
|
18
18
|
"@types/ws": "^8.2.0",
|
|
19
|
+
"node-fetch": "^2.0.0",
|
|
20
|
+
"chalk": "^4.1.0",
|
|
19
21
|
"chokidar": "^3.5.2",
|
|
22
|
+
"indent-string": "^4.0.0",
|
|
20
23
|
"inquirer": "^8.2.0",
|
|
24
|
+
"lodash.template": "^4.4.0",
|
|
21
25
|
"open": "^8.4.0",
|
|
22
26
|
"reflect-metadata": "^0.1.13",
|
|
23
27
|
"request": "^2.88.2",
|
|
24
28
|
"serve-handler": "^6.1.3",
|
|
29
|
+
"strip-ansi": "^6.0.0",
|
|
25
30
|
"tslib": "^1.14.1",
|
|
26
31
|
"unzipper": "^0.10.11",
|
|
32
|
+
"wrap-ansi": "^4.0.0",
|
|
27
33
|
"ws": "^8.2.3"
|
|
28
34
|
},
|
|
29
35
|
"devDependencies": {
|
|
@@ -34,9 +40,12 @@
|
|
|
34
40
|
"@semantic-release/npm": "^7.1.3",
|
|
35
41
|
"@semantic-release/release-notes-generator": "^9.0.2",
|
|
36
42
|
"@types/chai": "^4.2.21",
|
|
43
|
+
"@types/lodash.template": "^4.4.4",
|
|
37
44
|
"@types/mocha": "^5.2.7",
|
|
38
45
|
"@types/node": "^10.17.60",
|
|
46
|
+
"@types/node-fetch": "^2.0.2",
|
|
39
47
|
"@types/serve-handler": "^6.1.1",
|
|
48
|
+
"@types/wrap-ansi": "^8.0.1",
|
|
40
49
|
"@typescript-eslint/eslint-plugin": "^4.28.4",
|
|
41
50
|
"@typescript-eslint/parser": "^4.28.4",
|
|
42
51
|
"acorn": "^8.5.0",
|
|
@@ -79,9 +88,9 @@
|
|
|
79
88
|
"commands": "./lib/commands",
|
|
80
89
|
"bin": "asyncapi",
|
|
81
90
|
"plugins": [
|
|
82
|
-
"@oclif/plugin-help",
|
|
83
91
|
"@fmvilas/oclif-plugin-spaced-commands"
|
|
84
|
-
]
|
|
92
|
+
],
|
|
93
|
+
"helpClass": "./lib/help"
|
|
85
94
|
},
|
|
86
95
|
"publishConfig": {
|
|
87
96
|
"access": "public"
|
|
@@ -107,6 +116,9 @@
|
|
|
107
116
|
"@semantic-release/github"
|
|
108
117
|
]
|
|
109
118
|
},
|
|
119
|
+
"optionalDependencies": {
|
|
120
|
+
"fsevents": "^2.3.2"
|
|
121
|
+
},
|
|
110
122
|
"repository": "asyncapi/cli",
|
|
111
123
|
"scripts": {
|
|
112
124
|
"build": "node scripts/fetch-asyncapi-example.js && tsc",
|
|
@@ -114,7 +126,7 @@
|
|
|
114
126
|
"dev": "tsc --watch",
|
|
115
127
|
"generate:assets": "npm run generate:readme:toc",
|
|
116
128
|
"generate:readme:toc": "markdown-toc -i README.md",
|
|
117
|
-
"lint": "eslint --max-warnings
|
|
129
|
+
"lint": "eslint --max-warnings 0 --config .eslintrc .",
|
|
118
130
|
"lint:fix": "eslint --max-warnings 5 --config .eslintrc . --fix",
|
|
119
131
|
"postpack": "rimraf oclif.manifest.json",
|
|
120
132
|
"prepack": "rimraf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
|
|
@@ -123,7 +135,7 @@
|
|
|
123
135
|
"pretest:coverage": "npm run build",
|
|
124
136
|
"release": "semantic-release",
|
|
125
137
|
"start": "npm run build && node dist/cli.js",
|
|
126
|
-
"test": "cross-env TEST=1 nyc --extension .ts mocha --require ts-node/register --reporter spec --timeout
|
|
138
|
+
"test": "cross-env TEST=1 nyc --extension .ts mocha --require ts-node/register --reporter spec --timeout 10000 \"test/**/*.test.ts\"",
|
|
127
139
|
"version": "oclif-dev readme && git add README.md",
|
|
128
140
|
"readme": "oclif readme"
|
|
129
141
|
},
|