Skip to content

Commit 6099147

Browse files
authored
feat: creating custom help string (#103)
* feat: creating custom help string * feat: removed topic and changed to flag * test: removing code smells * test:fixing issues with test * test: fixing lint issues * refactor: extended the library intead * refactor: lint fixes * Revert "Merge remote-tracking branch 'upstream/master' into new-help-string" This reverts commit 8993abb, reversing changes made to e3debf2.
1 parent ad48ab8 commit 6099147

File tree

17 files changed

+22136
-5046
lines changed

17 files changed

+22136
-5046
lines changed

.eslintrc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
},
185185
"overrides": [
186186
{
187-
"files": ["*.spec.ts", "*.spec.tsx"],
187+
"files": ["*.spec.ts", "*.spec.tsx", "src/help/command.ts"],
188188
"rules": {
189189
"no-undef": "off",
190190
"security/detect-non-literal-fs-filename": "off",
@@ -194,7 +194,8 @@
194194
"sonarjs/no-identical-functions": "off",
195195
"@typescript-eslint/no-non-null-assertion": "off",
196196
"@typescript-eslint/no-unused-vars": "off",
197-
"no-use-before-define": "off"
197+
"no-use-before-define": "off",
198+
"sonarjs/cognitive-complexity": "off"
198199
}
199200
}
200201
]

.github/workflows/automerge.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
pull_request_review:
1818
types:
1919
- submitted
20-
20+
2121
jobs:
2222

2323
autoapprove:
@@ -44,16 +44,4 @@ jobs:
4444
MERGE_METHOD: "squash"
4545
MERGE_COMMIT_MESSAGE: "pull-request-title"
4646
MERGE_RETRIES: "20"
47-
MERGE_RETRY_SLEEP: "30000"
48-
49-
labelWhenApproved:
50-
needs: [autoapprove]
51-
name: Label when approved
52-
runs-on: ubuntu-latest
53-
steps:
54-
- name: Label when approved
55-
uses: pullreminders/label-when-approved-action@v1.0.7
56-
env:
57-
APPROVALS: "1"
58-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59-
ADD_LABEL: "autoapproved"
47+
MERGE_RETRY_SLEEP: "30000"

.github/workflows/autoupdate.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,3 @@
1010
/tmp
1111
/yarn.lock
1212
node_modules
13-
14-
asyncapi.json
15-
asyncapi.yaml
16-
asyncapi.yml

.sonarcloud.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sonar.exclusions=src/commands/**,src/models/SpecificationFile.ts
1+
sonar.exclusions=src/commands/**,src/models/SpecificationFile.ts,src/help/**

README.md

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@
2323

2424
<!-- toc -->
2525

26+
- [Requirements](#requirements)
27+
* [Installation](#installation)
28+
- [Usage](#usage)
29+
- [API Reference](#api-reference)
30+
* [`validate`](#validate)
31+
* [`context`](#context)
32+
- [Contributing](#contributing)
33+
* [Set up development environment](#set-up-development-environment)
34+
* [Command Structure and Patterns](#command-structure-and-patterns)
35+
2636
<!-- tocstop -->
2737

2838
## Requirements
@@ -59,19 +69,57 @@ We have well-documented help commands so just run:
5969
asyncapi --help
6070
```
6171

62-
It should print something like:
6372

73+
74+
75+
## API Reference
76+
77+
### `validate`
78+
79+
**USAGE**
80+
81+
```
82+
asyncapi validate <spcPath | context-name> [options]
6483
```
65-
All in one CLI for all AsyncAPI tools
6684

67-
USAGE
68-
$ asyncapi [COMMAND]
85+
If you already have your current context set, run the following command:
6986

70-
COMMANDS
71-
config access configs
72-
help display help for asyncapi
73-
new creates a new asyncapi file
74-
validate validate asyncapi file
87+
```
88+
asyncapi validate
89+
```
90+
91+
**OPTIONS**
92+
93+
```
94+
-h, --help Display help for command
95+
-w, --watch Enable watch mode (not implemented yet)
96+
```
97+
98+
99+
### `context`
100+
101+
**Context** makes it easier for you to work with multiple AsyncAPI Files. You can add multiple different files to a context so that you don't have to pass the file as an input every time you use any command. You can also set a default context so that you don't have to pass in either file paths or context names as an input.
102+
103+
**USAGE**
104+
105+
```
106+
asyncapi context [options] [command]
107+
```
108+
109+
**COMMANDS**
110+
111+
|command|arguments|description|example|
112+
|-------|---------|-----------|-------|
113+
|`list`|`none` |lists all saved context|`asyncapi context list`|
114+
|`current`|`none`|set current context|`asyncapi context current`|
115+
|`use` | `<context-name>`| set any context from the list as current|`asyncapi context use test`|
116+
|`add`|`<context-name> <spec-file-path>`|add/update a context|`asyncapi context add root ./asyncapi.yml`|
117+
|`remove`|`<context-name>`|remove a context from the list|`asyncapi context remove root`|
118+
119+
**OPTIONS**
120+
121+
```
122+
-h, --help display help for command
75123
```
76124

77125

assets/asyncapi.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)