Skip to content

Commit 0af74eb

Browse files
fmvilasSouviknsmagicmatatjahu
authored
feat: add "new" command and connect with Studio (#102)
* feat: added oclif (#93) * feat: added oclif * feat: fixed lint issues * chore: added readme command to script in package.json * feat: fixed package.json as per review * refactor: ported validate and context commands to oclif * refactor: ported logic for auto detecting spec path * feat: created custom base command class for handing errors * fix: issues with context service saving relative path rather than complete path * refactor: porting logic from ink routers to oclif routers. (#95) * refactor: ported validate and context commands to oclif * refactor: ported logic for auto detecting spec path * feat: created custom base command class for handing errors * fix: issues with context service saving relative path rather than complete path * refactor: deleted ink logic from * test: having issue setting up tests with jest. * refactor: removed jest and setup mocha Having issue with setting up mocha with typescript * test: fixed issue with setup but still tests not running as intended * test: trying to setup tests * test: reverting back to jest * test: reverting back to jest * feat: setup command testing with jest * test: added tests for CLI commands * test: fixed tests * fix: cleaning the .test.asyncapi file * test: should fix the tests * test: removed the breaking test * refactor: changed console.log to console.error * test: trying which tests are casing problem * test: checking which tests are causing problem * Migrate to new architecture * Add package-lock.json back * Add missing eslint packages * Fix linting * Ignore warnings * Add missing deps * Add conventional-changelog-conventionalcommits dep * Increase tests timeout * Change order of npm test args * Remove old test file * Use double quotes on mocha cli * Fix title in README * Use .test.asyncapi for testing * Use cross-env to set environment variable on Windows too * feat: add support for studio and new command * add bidirectional communication * Add asyncapi start studio command * remove blockUpdate variable * Make received events contain a type field * Add ability to customize port * Add port flag to asyncapi new too * Remove asyncapi.yaml and prevent we push it again * Fix tests * Update README Co-authored-by: souvik <souvikde.ns@gmail.com> Co-authored-by: Matatjahu <urbanczyk.maciej.95@gmail.com>
1 parent 4bebb6c commit 0af74eb

File tree

11 files changed

+2328
-1454
lines changed

11 files changed

+2328
-1454
lines changed

.gitignore

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

README.md

Lines changed: 13 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,13 @@
2323

2424
<!-- toc -->
2525

26+
- [Table of contents](#table-of-contents)
2627
- [Requirements](#requirements)
27-
* [Installation](#installation)
28+
- [Installation](#installation)
2829
- [Usage](#usage)
29-
- [API Reference](#api-reference)
30-
* [`validate`](#validate)
31-
* [`context`](#context)
3230
- [Contributing](#contributing)
33-
* [Set up development environment](#set-up-development-environment)
34-
* [Command Structure and Patterns](#command-structure-and-patterns)
31+
- [Set up development environment](#set-up-development-environment)
32+
- [Command Structure and Patterns](#command-structure-and-patterns)
3533

3634
<!-- tocstop -->
3735

@@ -69,57 +67,19 @@ We have well-documented help commands so just run:
6967
asyncapi --help
7068
```
7169

70+
It should print something like:
7271

73-
74-
75-
## API Reference
76-
77-
### `validate`
78-
79-
**USAGE**
80-
81-
```
82-
asyncapi validate <spcPath | context-name> [options]
83-
```
84-
85-
If you already have your current context set, run the following command:
86-
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]
10772
```
73+
All in one CLI for all AsyncAPI tools
10874
109-
**COMMANDS**
75+
USAGE
76+
$ asyncapi [COMMAND]
11077
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
78+
COMMANDS
79+
config access configs
80+
help display help for asyncapi
81+
new creates a new asyncapi file
82+
validate validate asyncapi file
12383
```
12484

12585

assets/asyncapi.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
asyncapi: '2.2.0'
2+
info:
3+
title: Account Service
4+
version: 1.0.0
5+
description: This service is in charge of processing user signups
6+
channels:
7+
user/signedup:
8+
subscribe:
9+
message:
10+
$ref: '#/components/messages/UserSignedUp'
11+
components:
12+
messages:
13+
UserSignedUp:
14+
payload:
15+
type: object
16+
properties:
17+
displayName:
18+
type: string
19+
description: Name of the user
20+
email:
21+
type: string
22+
format: email
23+
description: Email of the user

0 commit comments

Comments
 (0)