@asyncapi/cli 0.19.5 → 0.20.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/README.md +33 -13
- package/oclif.manifest.json +1 -1
- package/package.json +12 -2
package/README.md
CHANGED
|
@@ -12,8 +12,11 @@ CLI to work with your AsyncAPI files. Currently supports validation, but it is u
|
|
|
12
12
|
|
|
13
13
|
<!-- toc -->
|
|
14
14
|
|
|
15
|
-
- [
|
|
16
|
-
* [
|
|
15
|
+
- [Installation](#installation)
|
|
16
|
+
* [Using NPM and Node](#using-npm-and-node)
|
|
17
|
+
* [MacOS](#macos)
|
|
18
|
+
+ [Using brew](#using-brew)
|
|
19
|
+
+ [Using pkg](#using-pkg)
|
|
17
20
|
- [Usage](#usage)
|
|
18
21
|
- [Contributing](#contributing)
|
|
19
22
|
* [Set up development environment](#set-up-development-environment)
|
|
@@ -22,7 +25,10 @@ CLI to work with your AsyncAPI files. Currently supports validation, but it is u
|
|
|
22
25
|
|
|
23
26
|
<!-- tocstop -->
|
|
24
27
|
|
|
25
|
-
##
|
|
28
|
+
## Installation
|
|
29
|
+
|
|
30
|
+
### Using NPM and Node
|
|
31
|
+
|
|
26
32
|
To run `@asyncapi/cli`, you'll need Node.js >=v10
|
|
27
33
|
|
|
28
34
|
Run this terminal command to check your Node.js version:
|
|
@@ -30,21 +36,36 @@ Run this terminal command to check your Node.js version:
|
|
|
30
36
|
node -v
|
|
31
37
|
```
|
|
32
38
|
|
|
33
|
-
If you don't have Node.js installed or NPM, simply [install both via package manager](https://nodejs.org/en/download/package-manager/)
|
|
34
|
-
|
|
35
|
-
### Installation
|
|
36
|
-
|
|
37
|
-
Run this command to install the CLI globally on your system:
|
|
39
|
+
> If you don't have Node.js installed or NPM, simply [install both via package manager](https://nodejs.org/en/download/package-manager/)
|
|
38
40
|
|
|
41
|
+
Install the CLI globaly on your system run CLI it from anywhere:
|
|
39
42
|
```
|
|
40
43
|
npm install -g @asyncapi/cli
|
|
41
44
|
```
|
|
42
45
|
|
|
43
|
-
|
|
46
|
+
### MacOS
|
|
47
|
+
|
|
48
|
+
#### Using brew
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
You can install this CLI using [`brew`](https://brew.sh/) package manager.
|
|
46
51
|
|
|
52
|
+
```bash
|
|
53
|
+
# Install brew
|
|
54
|
+
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
55
|
+
# Install AsyncAPI CLI
|
|
56
|
+
brew install asyncapi
|
|
57
|
+
```
|
|
47
58
|
|
|
59
|
+
#### Using pkg
|
|
60
|
+
|
|
61
|
+
Each release of CLI produces a MacOS dedicated `pkg` file that enables you to install this CLI as MacOS application.
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Download latest release. To download specific release, your link should look similar to https://github.com/asyncapi/cli/releases/download/v0.13.0/asyncapi.pkg. All releases are listed in https://github.com/asyncapi/cli/releases
|
|
65
|
+
curl -OL https://github.com/asyncapi/cli/releases/latest/download/asyncapi.pkg
|
|
66
|
+
# Install AsyncAPI CLI
|
|
67
|
+
sudo installer -pkg asyncapi.pkg -target /
|
|
68
|
+
```
|
|
48
69
|
|
|
49
70
|
## Usage
|
|
50
71
|
|
|
@@ -72,8 +93,6 @@ COMMANDS
|
|
|
72
93
|
validate validate asyncapi file
|
|
73
94
|
```
|
|
74
95
|
|
|
75
|
-
|
|
76
|
-
|
|
77
96
|
## Contributing
|
|
78
97
|
|
|
79
98
|
Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING.md) guide.
|
|
@@ -83,7 +102,8 @@ Read [CONTRIBUTING](https://github.com/asyncapi/.github/blob/master/CONTRIBUTING
|
|
|
83
102
|
Follow these steps:
|
|
84
103
|
- Clone the repo.
|
|
85
104
|
- Run `npm install` to install all the required dependencies
|
|
86
|
-
- Run `npm run test` to make sure everything is properly set up
|
|
105
|
+
- Run `npm run test` to make sure everything is properly set up
|
|
106
|
+
- Run `npm run build` and then `bin/run` to try new CLI locally
|
|
87
107
|
|
|
88
108
|
UX developed for the CLI should be compliant with [Command Line Interface Guideline](https://clig.dev/)
|
|
89
109
|
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"0.
|
|
1
|
+
{"version":"0.20.0","commands":{"convert":{"id":"convert","description":"convert asyncapi documents older to newer versions","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"output":{"name":"output","type":"option","char":"o","description":"path to the file where the result is saved","multiple":false},"target-version":{"name":"target-version","type":"option","char":"t","description":"asyncapi version to convert to","multiple":false,"default":"2.4.0"}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}],"_globalFlags":{}},"diff":{"id":"diff","description":"find diff between two asyncapi files","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"format":{"name":"format","type":"option","char":"f","description":"format of the output","multiple":false,"options":["json","yaml","yml"],"default":"yaml"},"type":{"name":"type","type":"option","char":"t","description":"type of the output","multiple":false,"options":["breaking","non-breaking","unclassified","all"],"default":"all"},"overrides":{"name":"overrides","type":"option","char":"o","description":"path to JSON file containing the override properties","multiple":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Enable watch mode","allowNo":false}},"args":[{"name":"old","description":"old spec path, URL or context-name","required":true},{"name":"new","description":"new spec path, URL or context-name","required":true}],"_globalFlags":{}},"new":{"id":"new","description":"creates a new asyncapi file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@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","multiple":false},"example":{"name":"example","type":"option","char":"e","description":"name of the example to use","multiple":false},"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","multiple":false},"no-tty":{"name":"no-tty","type":"boolean","description":"do not use an interactive terminal","allowNo":false}},"args":[],"_globalFlags":{}},"validate":{"id":"validate","description":"validate asyncapi file","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Enable watch mode","allowNo":false}},"args":[{"name":"spec-file","description":"spec path, url, or context-name","required":false}],"_globalFlags":{}},"config":{"id":"config","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"start":{"id":"start","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"start:studio":{"id":"start:studio","description":"starts a new local instance of Studio","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@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","multiple":false},"port":{"name":"port","type":"option","char":"p","description":"port in which to start Studio","multiple":false}},"args":[],"_globalFlags":{}},"config:context:add":{"id":"config:context:add","description":"Add or modify a context in the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@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}],"_globalFlags":{}},"config:context:current":{"id":"config:context:current","description":"Shows the current context that is being used","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[],"_globalFlags":{}},"config:context":{"id":"config:context","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"config:context:list":{"id":"config:context:list","description":"List all the stored context in the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@asyncapi/cli","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"Show CLI help.","allowNo":false}},"args":[],"_globalFlags":{}},"config:context:remove":{"id":"config:context:remove","description":"Delete a context from the store","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@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}],"_globalFlags":{}},"config:context:use":{"id":"config:context:use","description":"Set a context as current","strict":true,"pluginName":"@asyncapi/cli","pluginAlias":"@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}],"_globalFlags":{}}}}
|
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.20.0",
|
|
5
5
|
"author": "@asyncapi",
|
|
6
6
|
"bin": {
|
|
7
7
|
"asyncapi": "./bin/run"
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
"rimraf": "^3.0.2",
|
|
64
64
|
"semantic-release": "^17.4.3",
|
|
65
65
|
"souvikns-oclif": "^2.5.0",
|
|
66
|
+
"simple-git": "^2.48.0",
|
|
66
67
|
"ts-node": "^10.4.0",
|
|
67
68
|
"tslib": "^2.3.1",
|
|
68
69
|
"typescript": "^4.4.3"
|
|
@@ -89,6 +90,9 @@
|
|
|
89
90
|
"plugins": [
|
|
90
91
|
"@oclif/plugin-not-found"
|
|
91
92
|
],
|
|
93
|
+
"macos": {
|
|
94
|
+
"identifier": "com.asyncapi.cli"
|
|
95
|
+
},
|
|
92
96
|
"topicSeparator": " ",
|
|
93
97
|
"topics": {
|
|
94
98
|
"config:context": {},
|
|
@@ -131,12 +135,18 @@
|
|
|
131
135
|
"generate:readme:toc": "markdown-toc -i README.md",
|
|
132
136
|
"lint": "eslint --max-warnings 0 --config .eslintrc .",
|
|
133
137
|
"lint:fix": "eslint --max-warnings 5 --config .eslintrc . --fix",
|
|
138
|
+
"pack:macos": "oclif pack:macos && npm run pack:macos:rename",
|
|
139
|
+
"pack:linux": "oclif pack:deb",
|
|
140
|
+
"pack:windows": "oclif pack:win",
|
|
141
|
+
"pack:macos:rename": "node scripts/macosPackRename.js",
|
|
134
142
|
"postpack": "rimraf oclif.manifest.json",
|
|
143
|
+
"postpublish": "npm run pack:macos",
|
|
135
144
|
"prepublishOnly": "npm run build && oclif manifest",
|
|
136
145
|
"pretest": "npm run build",
|
|
137
146
|
"pretest:coverage": "npm run build",
|
|
138
147
|
"release": "semantic-release",
|
|
139
|
-
"test": "cross-env TEST=1 CONTEXT_FILENAME=\"./test.asyncapi\" CONTEXT_FILE_PATH=\"./\" nyc --extension .ts mocha --require ts-node/register --require test/helpers/init.js --reporter spec --timeout 10000 \"test/**/*.test.ts\""
|
|
148
|
+
"test": "cross-env TEST=1 CONTEXT_FILENAME=\"./test.asyncapi\" CONTEXT_FILE_PATH=\"./\" nyc --extension .ts mocha --require ts-node/register --require test/helpers/init.js --reporter spec --timeout 10000 \"test/**/*.test.ts\"",
|
|
149
|
+
"get-version": "echo $npm_package_version"
|
|
140
150
|
},
|
|
141
151
|
"types": "lib/index.d.ts"
|
|
142
152
|
}
|