Skip to content

Commit a3ee4b6

Browse files
authored
docs: update various documentation (#130)
1 parent 82c1917 commit a3ee4b6

File tree

8 files changed

+209
-2
lines changed

8 files changed

+209
-2
lines changed

CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @jonaslagoni @ALagoni97

CODE_OF_CONDUCT.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
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.
6+
7+
## Our Standards
8+
9+
Examples of behavior that contributes to creating a positive environment include:
10+
11+
- Using welcoming and inclusive language
12+
- Being respectful of differing viewpoints and experiences
13+
- Gracefully accepting constructive criticism
14+
- Focusing on what is best for the community
15+
- Showing empathy towards other community members
16+
17+
Examples of unacceptable behavior by participants include:
18+
19+
- The use of sexualized language or imagery and unwelcome sexual attention or advances
20+
- Trolling, insulting/derogatory comments, and personal or political attacks
21+
- Public or private harassment
22+
- Publishing others' private information, such as a physical or electronic address, without explicit permission
23+
- Other conduct which could reasonably be considered inappropriate in a professional setting
24+
25+
## Our Responsibilities
26+
27+
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.
28+
29+
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.
30+
31+
## Scope
32+
33+
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.
34+
35+
## Enforcement
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at [email protected]. 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 with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38+
39+
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.
40+
41+
## Attribution
42+
43+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44+
45+
[homepage]: http://contributor-covenant.org
46+
[version]: http://contributor-covenant.org/version/1/4/

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,10 @@ Besides the [milestones](https://github.com/the-codegen-project/cli/milestones),
234234
People who have been so kind to write or talk about The Codegen Project;
235235
- Write one!
236236

237+
# Contribution Guidelines
238+
239+
We have made quite a [comprehensive contribution guide](./docs/contributing.md) to give you a lending hand in how the project is structured and how to contribute to it.
240+
237241
## Contributors
238242

239243
Thanks go out to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):

SECURITY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In case you do not want to publicly report a security issue, write an email with a detailed description of the issue to [email protected].

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ sidebar_position: 1
99

1010
- [Configurations](#configurations)
1111
- [Getting Started](#getting-started)
12+
- [Contributing](#contributing)
1213
- [Usage](#usage)
1314
- [Generators](#generators)
1415
- [Architectural Decisions](#architectural-decisions)
@@ -25,6 +26,9 @@ Contains all the information about the how the configuration file works and how
2526
### [Getting Started](./getting-started.md)
2627
Get started in 5 minutes :fire:
2728

29+
### [Contributing](./contributing.md)
30+
Get an overview of how to contribute to the project
31+
2832
### [Usage](./usage.md)
2933
Contains all the information about what the CLI can do and how.
3034

@@ -43,3 +47,5 @@ Each input has its own limitations, corner cases, and features; thus, each has s
4347
Each protocol has its own limitations, corner cases, and features; thus, each has separate documentation.
4448
- [NATS](./protocols/nats.md)
4549

50+
51+

docs/contributing.md

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
# Contributing to The Codegen Project
5+
6+
<!-- toc is generated with GitHub Actions do not remove toc markers -->
7+
8+
<!-- toc -->
9+
10+
- [Acceptance criteria and process](#acceptance-criteria-and-process)
11+
* [Fixing bugs](#fixing-bugs)
12+
* [New features](#new-features)
13+
- [Repository Architecture](#repository-architecture)
14+
- [Getting started](#getting-started)
15+
- [Contribution recogniton](#contribution-recogniton)
16+
- [Summary of the contribution flow](#summary-of-the-contribution-flow)
17+
- [Code of Conduct](#code-of-conduct)
18+
- [Our Development Process](#our-development-process)
19+
- [Pull Requests](#pull-requests)
20+
- [Conventional commits](#conventional-commits)
21+
- [License](#license)
22+
23+
<!-- tocstop -->
24+
25+
First of all, thank you 🙇🏾‍♀️ for considering contributing to The Codegen Project
26+
27+
If you have any questions, are unsure how your use-case fits in, or want something clarified, don't hesitate to reach out, we are always happy to help out!
28+
29+
## Acceptance criteria and process
30+
31+
Even though we love contributions, we need to maintain a certain standard of what can be merged into the codebase.
32+
33+
The below sections provide information about our acceptance criteria, based on the type of contribution you make.
34+
35+
### Fixing bugs
36+
37+
The Acceptance Criteria for _fixing any bug_ means that you should be able to reproduce the error using tests that will fail, unless a fix is implemented.
38+
39+
### New features
40+
41+
The Acceptance Criteria for _adding new features_ requires a few things in order to be accepted. This ensures all features are well described and implemented before being released.
42+
43+
1. **Not all feature requests from the community (or maintainers!) are accepted:** Even though you are welcome to create a new feature without an issue, it might be rejected and turn out to be a waste of your time. We don't want that to happen, so make sure to create an issue first and wait to see if it's accepted after community discussion of the proposal.
44+
1. **When creating tests for your new feature, aim for as high coverage numbers as possible:** When you run the tests (`npm run test`), you should see a `./coverage/lcov-report/index.html` file being generated. Use this to see in depth where your tests are not covering your implementation.
45+
1. **No documentation, no feature:** If a user cannot understand a new feature, that feature basically doesn't exist! Remember to make sure that any and all relevant [documentation](./) is consistently updated.
46+
- New features such as new generators or inputs, etc, need associated use case documentation along side [examples](../examples).
47+
48+
## Repository Architecture
49+
50+
The repository is setup with multiple functions to keep it simple.
51+
- `src`; includes the CLI and library code both exposed through the same package.
52+
- `website`; is... Well the website.
53+
- `scripts`; includes helpfull scripts for the release flow such as for building JSON Schema files from the code for configuration validation and CLI release configurations
54+
- `test`; include all the testing done for the repository
55+
- `blackbox`; is a quick and dirt syntax testing of different configurations against different inputs to quickly detect problems
56+
- `runtime`; is sematic testing of the generated code in the corresponding languages they generate for, ensuring correct behaviour at runtime
57+
- The rest normal unit and integration testing of the actual CLI and library
58+
- `examples`; is the showcase of actual projects using the CLI to simplify the implementation phase of software development.
59+
- `schemas`; is the autogenerated JSON schemas for validating configurations.
60+
61+
## Getting started
62+
63+
Here is a quick litle get started quick tutorial;
64+
65+
1. Fork the repository
66+
2. Create a branch from the upstream repository
67+
3. Install the dependencies `npm install`
68+
4. Make sure test pass `npm run test`
69+
5. Adapt the source code as well as test and documentation
70+
6. Push the changes
71+
7. Create a PR with the proposed change
72+
8. Get the change reviewed and merged :tada:
73+
74+
Happy contributing :heart:
75+
76+
## Contribution recogniton
77+
78+
We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions.
79+
80+
## Summary of the contribution flow
81+
82+
The following is a summary of the ideal contribution flow. Please, note that Pull Requests can also be rejected by the maintainers when appropriate.
83+
84+
```
85+
┌───────────────────────┐
86+
│ │
87+
│ Open an issue │
88+
│ (a bug report or a │
89+
│ feature request) │
90+
│ │
91+
└───────────────────────┘
92+
93+
┌───────────────────────┐
94+
│ │
95+
│ Open a Pull Request │
96+
│ (only after issue │
97+
│ is approved) │
98+
│ │
99+
└───────────────────────┘
100+
101+
┌───────────────────────┐
102+
│ │
103+
│ Your changes will │
104+
│ be merged and │
105+
│ published on the next │
106+
│ release │
107+
│ │
108+
└───────────────────────┘
109+
```
110+
111+
## Code of Conduct
112+
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.
113+
114+
## Our Development Process
115+
We use Github to host code, to track issues and feature requests, as well as accept pull requests.
116+
117+
## Pull Requests
118+
119+
**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.
120+
121+
## Conventional commits
122+
123+
Our repositories follow [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/).
124+
125+
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 cheatsheet if you want:
126+
127+
- `fix: ` prefix in the title indicates that PR is a bug fix and PATCH release must be triggered.
128+
- `feat: ` prefix in the title indicates that PR is a feature and MINOR release must be triggered.
129+
- `docs: ` prefix in the title indicates that PR is only related to the documentation and there is no need to trigger release.
130+
- `chore: ` prefix in the title indicates that PR is only related to cleanup in the project and there is no need to trigger release.
131+
- `test: ` prefix in the title indicates that PR is only related to tests and there is no need to trigger release.
132+
- `refactor: ` prefix in the title indicates that PR is only related to refactoring and there is no need to trigger release.
133+
134+
What about MAJOR release? just add `!` to the prefix, like `fix!: ` or `refactor!: `
135+
136+
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).
137+
138+
## License
139+
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](../LICENSE) that covers the project.
140+

docs/usage.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@ USAGE
2020
## Table of contents
2121

2222
<!-- toc -->
23-
* [CLI Usage](#cli-usage)
23+
24+
- [Commands](#commands)
25+
- [`codegen autocomplete [SHELL]`](#codegen-autocomplete-shell)
26+
- [`codegen generate [FILE]`](#codegen-generate-file)
27+
- [`codegen help [COMMAND]`](#codegen-help-command)
28+
- [`codegen init`](#codegen-init)
29+
- [`codegen version`](#codegen-version)
30+
2431
<!-- tocstop -->
2532

2633
## Commands
@@ -159,3 +166,5 @@ FLAG DESCRIPTIONS
159166

160167
_See code: [@oclif/plugin-version](https://github.com/oclif/plugin-version/blob/v2.1.2/src/commands/version.ts)_
161168
<!-- commandsstop -->
169+
170+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
"generate:assets": "npm run generate:readme:toc && npm run generate:commands && npm run generate:schema && npm run format",
9898
"generate:schema": "node scripts/generateSchemaFiles.js",
9999
"generate:commands": "npm run generate:readme:commands",
100-
"generate:readme:toc": "markdown-toc -i README.md && markdown-toc -i ./docs/usage.md && markdown-toc -i ./docs/README.md",
100+
"generate:readme:toc": "markdown-toc -i README.md && markdown-toc -i ./docs/usage.md && markdown-toc -i ./docs/README.md && markdown-toc -i ./docs/contributing.md ",
101101
"lint": "eslint --max-warnings 0 --config .eslintrc .",
102102
"lint:fix": "npm run lint -- --fix",
103103
"format": "prettier \"./src/**/*.ts\" --write",

0 commit comments

Comments
 (0)