Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @jonaslagoni @ALagoni97
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

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.

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/
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ Besides the [milestones](https://github.com/the-codegen-project/cli/milestones),
People who have been so kind to write or talk about The Codegen Project;
- Write one!

# Contribution Guidelines

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.

## Contributors

Thanks go out to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +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].
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ sidebar_position: 1

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

### [Contributing](./contributing.md)
Get an overview of how to contribute to the project

### [Usage](./usage.md)
Contains all the information about what the CLI can do and how.

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



140 changes: 140 additions & 0 deletions docs/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
sidebar_position: 5
---
# Contributing to The Codegen Project

<!-- toc is generated with GitHub Actions do not remove toc markers -->

<!-- toc -->

- [Acceptance criteria and process](#acceptance-criteria-and-process)
* [Fixing bugs](#fixing-bugs)
* [New features](#new-features)
- [Repository Architecture](#repository-architecture)
- [Getting started](#getting-started)
- [Contribution recogniton](#contribution-recogniton)
- [Summary of the contribution flow](#summary-of-the-contribution-flow)
- [Code of Conduct](#code-of-conduct)
- [Our Development Process](#our-development-process)
- [Pull Requests](#pull-requests)
- [Conventional commits](#conventional-commits)
- [License](#license)

<!-- tocstop -->

First of all, thank you 🙇🏾‍♀️ for considering contributing to The Codegen Project

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!

## Acceptance criteria and process

Even though we love contributions, we need to maintain a certain standard of what can be merged into the codebase.

The below sections provide information about our acceptance criteria, based on the type of contribution you make.

### Fixing bugs

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.

### New features

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.

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.
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.
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.
- New features such as new generators or inputs, etc, need associated use case documentation along side [examples](../examples).

## Repository Architecture

The repository is setup with multiple functions to keep it simple.
- `src`; includes the CLI and library code both exposed through the same package.
- `website`; is... Well the website.
- `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
- `test`; include all the testing done for the repository
- `blackbox`; is a quick and dirt syntax testing of different configurations against different inputs to quickly detect problems
- `runtime`; is sematic testing of the generated code in the corresponding languages they generate for, ensuring correct behaviour at runtime
- The rest normal unit and integration testing of the actual CLI and library
- `examples`; is the showcase of actual projects using the CLI to simplify the implementation phase of software development.
- `schemas`; is the autogenerated JSON schemas for validating configurations.

## Getting started

Here is a quick litle get started quick tutorial;

1. Fork the repository
2. Create a branch from the upstream repository
3. Install the dependencies `npm install`
4. Make sure test pass `npm run test`
5. Adapt the source code as well as test and documentation
6. Push the changes
7. Create a PR with the proposed change
8. Get the change reviewed and merged :tada:

Happy contributing :heart:

## Contribution recogniton

We use [All Contributors](https://allcontributors.org/docs/en/specification) specification to handle recognitions.

## 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 the 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.

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

## Conventional commits

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/).

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:

- `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).

## License
When you submit changes, your submissions are understood to be under the same [Apache 2.0 License](../LICENSE) that covers the project.

11 changes: 10 additions & 1 deletion docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,14 @@ USAGE
## Table of contents

<!-- toc -->
* [CLI Usage](#cli-usage)

- [Commands](#commands)
- [`codegen autocomplete [SHELL]`](#codegen-autocomplete-shell)
- [`codegen generate [FILE]`](#codegen-generate-file)
- [`codegen help [COMMAND]`](#codegen-help-command)
- [`codegen init`](#codegen-init)
- [`codegen version`](#codegen-version)

<!-- tocstop -->

## Commands
Expand Down Expand Up @@ -159,3 +166,5 @@ FLAG DESCRIPTIONS

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


2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"generate:assets": "npm run generate:readme:toc && npm run generate:commands && npm run generate:schema && npm run format",
"generate:schema": "node scripts/generateSchemaFiles.js",
"generate:commands": "npm run generate:readme:commands",
"generate:readme:toc": "markdown-toc -i README.md && markdown-toc -i ./docs/usage.md && markdown-toc -i ./docs/README.md",
"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 ",
"lint": "eslint --max-warnings 0 --config .eslintrc .",
"lint:fix": "npm run lint -- --fix",
"format": "prettier \"./src/**/*.ts\" --write",
Expand Down