Skip to content

Commit

Permalink
docs: updating the readme (#65)
Browse files Browse the repository at this point in the history
* doc: updating the readme

* feat: added contributing.md and code_of_conduct.md files.

* feat: made requested changes

Still figuring out the TOC generator.

* feat: added script to generate markdown-toc

* feat: updated CONTRIBUTING.md for UX requirements

* feat: updated Contributing.md

* Revert "feat: updated Contributing.md"

This reverts commit 0ee4c6e.

* Revert "feat: updated CONTRIBUTING.md for UX requirements"

This reverts commit 5fe710e.

* feat: extended reademe.md
  • Loading branch information
Souvikns authored Sep 16, 2021
1 parent 0a8cd16 commit d79b98e
Show file tree
Hide file tree
Showing 5 changed files with 14,789 additions and 88 deletions.
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

You may report instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at fmvilas@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality concerning the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
79 changes: 79 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Contributing to AsyncAPI
We love your input! We want to make contributing to this project as easy and transparent as possible.

## Contribution recogniton

We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions. For more details read [this](recognize-contributors.md) document.

## Summary of the contribution flow

The following is a summary of the ideal contribution flow. Please note that Pull Requests can also be rejected by maintainers when appropriate.

```
┌───────────────────────┐
│ │
│ Open an issue │
│ (a bug report or a │
│ feature request) │
│ │
└───────────────────────┘
┌───────────────────────┐
│ │
│ Open a Pull Request │
│ (only after issue │
│ is approved) │
│ │
└───────────────────────┘
┌───────────────────────┐
│ │
│ Your changes will │
│ be merged and │
│ published on the next │
│ release │
│ │
└───────────────────────┘
```

## Code of Conduct
AsyncAPI has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](./CODE_OF_CONDUCT.md) so that you can understand what sort of behaviour is expected.

## Our Development Process
We use Github to host code, to track issues and feature requests, as well as accept pull requests.

## Issues
[Open an issue](https://github.com/asyncapi/asyncapi/issues/new) **only** if you want to report a bug or a feature. Don't open issues for questions or support, instead join our [Slack workspace](https://www.asyncapi.com/slack-invite) and ask there. It's more likely you'll get help, and much faster!

## Bug Reports and Feature Requests

Please use our issues templates that provide you with hints on what information we need from you to help you out.

## Pull Requests

**Please make sure you open an issue before starting with a Pull Request, unless it's a typo or a really obvious error.** Pull requests are the best way to propose changes to the specification. Get familiar with our document that explains [Git workflow](git-workflow.md) used in our repositories.

## Conventional commits

Our repositories follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/).

Pull requests should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification simply ask maintainers to modify. You can also use this cheat sheet if you want:

- `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered.
- `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered.
- `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release.
- `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release.
- `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release.
- `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release.

What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: `

Prefix that follows specification is not enough though. Remember that the title must be clear and descriptive with usage of [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).

Happy contributing :heart:

## License
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](https://github.com/asyncapi/asyncapi/blob/master/LICENSE) that covers the project. Feel free to [contact the maintainers](https://www.asyncapi.com/slack-invite) if that's a concern.

## References
This document was adapted from the open-source contribution guidelines of [Facebook's Draft](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md).
143 changes: 104 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,69 +8,134 @@
<em>CLI to work with your AsyncAPI files. Currently supports validation, but it is under development for more features.</em>
</p>

### Install
```bash
$ npm install --global @asyncapi/cli
<p align="center">
<a href="https://github.com/asyncapi/cli/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/asyncapi/cli"></a>
<a href="https://github.com/asyncapi/cli/actions/workflows/if-nodejs-pr-testing.yml">
<img src="https://github.com/asyncapi/cli/actions/workflows/if-nodejs-pr-testing.yml/badge.svg" alt="PR testing - if Node project" />
</a>
<a href="https://www.npmjs.com/package/@asyncapi/cli">
<img alt="npm" src="https://img.shields.io/npm/dw/@asyncapi/cli">
</a>

</p>

## Table of contents

<!-- toc -->

- [Requirements](#requirements)
* [Installation](#installation)
- [Usage](#usage)
- [API Reference](#api-reference)
* [`validate`](#validate)
* [`context`](#context)
- [Contributing](#contributing)
* [Set up development enviornment](#set-up-development-enviornment)

<!-- tocstop -->

## Requirements
To run `@asyncapi/cli`, you'll need Node.js >=v10

Run this terminal command to check your Node.js version:
```
node -v
```

If you don't have Node.js installed or NPM, simply [install both via package manager](https://nodejs.org/en/download/package-manager/)

### Getting Started
Go ahead and run command `asyncapi --help` to get complete help for using CLI. If having doubt about any particular command do run `asyncapi <command> --help` to get help for that command.
### Installation

### CLI
Help string for all the supported commands
Run this command to install the CLI globally on your system:

- #### `asyncapi --help`
```
USAGE
npm install -g @asyncapi/cli
```

asyncapi [options] [command]
This installs the cli globaly on your system allowing you to run it from anywhere. If you want to install it locally, just remove the `-g` flag.

OPTIONS
> Cli will be available for installation brew and other app managers for other systems.
-h, --help display help for command
-v, --version output the version number

COMMANDS

validate validate asyncapi file
context Manage contexts
```
## Usage

- #### `asyncapi validate --help`
As of now, the `@asyncapi/cli` only supports validation of the specification file. (This is still under development for more features.)

We have well-documented help commands so just run:

```
asyncapi --help
```
USAGE

asyncapi validate <spec-file-path | context-name> [options]

OPTIONS

-h, --help display help for command
-w, --watch Enable Watch Mode (not implemented yet)

## API Reference

### `validate`

**USAGE**

```
asyncapi validate <spcPath | context-name> [options]
```

If you already have your current context set, run the following command:

- #### `asyncapi context --help`
```
USAGE
asyncapi validate
```

asyncapi context [options] [command]
**OPTIONS**

```
-h, --help Display help for command
-w, --watch Enable watch mode (not implemented yet)
```

Context is what makes it easier for you to work with multiple AsyncAPI files.
You can add multiple different files to a contextThis way you do not have to pass
--file flag with path to the file every time but just --context flag with reference name
You can also set a default context, so neither --file nor --context flags are needed.

OPTIONS
### `context`

**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.

**USAGE**

```
asyncapi context [options] [command]
```

-h, --help display help for command
**COMMANDS**

COMMANDS
|command|arguments|description|example|
|-------|---------|-----------|-------|
|`list`|`none` |lists all saved context|`asyncapi context list`|
|`current`|`none`|set current context|`asyncapi context current`|
|`use` | `<context-name>`| set any context from the list as current|`asyncapi context use test`|
|`add`|`<context-name> <spec-file-path>`|add/update a context|`asyncapi context add root ./asyncapi.yml`|
|`remove`|`<context-name>`|remove a context from the list|`asyncapi context remove root`|

list list of all saved contexts
current see current context
use <context-name> set given context as default/current
add <context-name> <spec-file-path> add/update context
remove <context-name> remove a context
**OPTIONS**

```
-h, --help display help for command
```



## Contributing

Read [CONTRIBUTING](https://github.com/asyncapi/CLI/blob/master/CONTRIBUTING.md) guide.

### Set up development enviornment

Follow these steps:
- Clone the repo.
- Run `npm install` to install all the required dependencies
- Run `npm run test` to make sure everything is properly set up.

UX developed for the CLI should be compliant with [Command Line Interface Guideline](https://clig.dev/)

### Command Structure and Patterns

> For now --context flag is requried to run validate command
We are following `verb + noun` and `namespace + noun + [verb]` pattern for making our commands and arguments. For example `asyncapi validate <spec-file-path>` and `asyncapi config context add <context-name> <spec-file-path>`.
Loading

0 comments on commit d79b98e

Please sign in to comment.