Skip to content

Commit a4cdf1c

Browse files
committed
docs: update and add new project docs
1 parent 47bc1a9 commit a4cdf1c

File tree

6 files changed

+265
-14
lines changed

6 files changed

+265
-14
lines changed

.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ vitest.config.ts
1616

1717
src
1818
tmp
19-
test-output
19+
test-output
20+
21+
CODE_OF_CONDUCT.md
22+
CONTRIBUTING.md
23+
SECURITY.md

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

CONTRIBUTING.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributing to `commitfy`
2+
3+
Thank you for considering contributing to `commitfy`! This document provides guidelines and an overview of the project structure to help you contribute effectively.
4+
5+
## Project Structure
6+
7+
The project is organized as follows:
8+
9+
- **`src/`**: Contains the main source code, divided into the following subdirectories:
10+
- **`commands/`**: Contains the command implementations that define the functionalities of `commitfy`. Each command is responsible for a specific task, such as generating a commit message, setting up the environment, or displaying help information.
11+
- **`interfaces/`**: Defines TypeScript interfaces and types used throughout the project. This directory helps ensure type safety and consistency across different parts of the codebase.
12+
- **`providers/`**: Contains the implementations of the AI providers supported by `commitfy`. This includes setting up connections, handling API requests, and processing responses from AI services like OpenAI.
13+
- **`utils/`**: Includes utility functions and helpers that are used across the project. These utilities perform common tasks such as environment management, input validation, and process handling.
14+
- **`container.ts`**: Manages dependency injection, allowing for loose coupling between components and making the system more modular and testable.
15+
- **`constants.ts`**: Stores constant values used across the project, such as default settings or configuration keys.
16+
- **`index.ts`**: The entry point of the application that ties together different components and initializes the command-line interface.
17+
18+
- **`bin/`**: Contains executable scripts that are used to run the application from the command line. This typically includes the entry point script that initializes and launches the `commitfy` CLI.
19+
- **`tests/`**: Includes supporting files for tests. The tests themselves are located alongside the original files (e.g., `./src/utils/env.utils.ts`, `./src/utils/env.utils.spec.ts`), ensuring that each module is thoroughly tested.
20+
- **`lib/`**: Contains the compiled version of the source code, generated after the build process. This directory is what gets executed when you run the tool in production.
21+
- **`tmp/`**: A temporary folder used during development and testing. It may hold temporary files, logs, or other data generated during runtime.
22+
23+
## Labels
24+
25+
To help manage issues and pull requests, we use a set of labels. You can view and understand the purpose of each label by visiting the [labels page on GitHub](https://github.com/ribeirogab/commitfy/labels).
26+
27+
## Running Tests
28+
29+
To run the project's tests, use the following command:
30+
31+
```bash
32+
npm test
33+
```
34+
35+
## Contribution Workflow
36+
37+
1. **Fork the Repository**: Click the "Fork" button on the top right corner of the repository page to create a copy of the repository under your GitHub account.
38+
39+
2. **Create a Branch**: Create a new branch for your contribution using the following command:
40+
41+
```bash
42+
git checkout -b feature/your-feature-name
43+
```
44+
45+
3. **Make Changes**: Implement your changes in the newly created branch.
46+
47+
4. **Commit Your Changes**: Use `cfy` to generate a commit message, and then commit your changes:
48+
49+
```bash
50+
git add .
51+
cfy
52+
```
53+
54+
5. **Push to Your Fork**: Push your changes to your forked repository:
55+
56+
```bash
57+
git push origin feature/your-feature-name
58+
```
59+
60+
6. **Open a Pull Request**: Go to the original repository and open a pull request. Be sure to include a detailed description of the changes you have made.
61+
62+
## Code Style and Guidelines
63+
64+
- Follow the existing coding style and conventions in the project.
65+
- Ensure that your changes do not break any existing functionality or tests.
66+
- Write clear and concise commit messages using `cfy`.
67+
68+
## Issues and Bugs
69+
70+
If you encounter any issues or bugs, feel free to [open an issue](https://github.com/ribeirogab/commitfy/issues) on GitHub. Please provide as much detail as possible to help us resolve the issue quickly.
71+
72+
## Thank You!
73+
74+
Your contributions are valuable, and we appreciate your effort in improving `commitfy`. Thank you for taking the time to contribute!

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# commitfy
22

3-
> Make commits easier and faster using AI.
3+
> Make commit messages easier and faster using AI.
4+
5+
## Description
6+
7+
`commitfy` is a tool designed to help developers generate efficient and consistent commit messages using artificial intelligence. `commitfy` ensures that your commit messages follow established standards and are clear and informative.
48

59
## Installation
610

7-
Install `commitfy` globally (to use in any repository) using npm:
11+
Install `commitfy` globally to use in any repository using npm:
812

913
```bash
1014
npm install -g commitfy
@@ -16,15 +20,17 @@ Once installed, you can use the `commitfy` command or its alias `cfy` to interac
1620

1721
### Commands
1822

19-
#### Setup
23+
#### Initial Setup
2024

21-
To perform initial setup configuration, run:
25+
To perform the initial setup configuration, run:
2226

2327
```bash
2428
cfy setup
2529
```
2630

27-
#### Generate Commit
31+
This command will guide you through the necessary setup to use `commitfy`, such as choosing the AI provider and configuring API keys.
32+
33+
#### Generate Commit Message
2834

2935
To generate a commit message using AI, simply run:
3036

@@ -42,16 +48,22 @@ If you need assistance or want to see the available commands, run:
4248
commitfy --help
4349
```
4450

45-
## AI Providers
51+
This command will display a list of all available commands along with detailed descriptions.
4652

47-
`commitfy` supports the following AI providers for generating commit messages:
53+
## Configuration
4854

49-
- **OpenAI**
55+
### Configuration Files
5056

51-
> **Note:** Currently, we support the above providers, but we may implement more in the future. If you have a suggestion for an AI provider, please [open an issue](https://github.com/ribeirogab/commitfy/issues).
57+
`commitfy` uses configuration files located in the `~/.commitfy` directory to manage its settings and behavior:
5258

53-
## Support
59+
- **`.env`**: This file contains all the necessary configurations for the app, such as API keys and other environment variables. You can edit this file to update your settings as needed.
60+
61+
- **`.commitfyignore`**: This file functions similarly to a `.gitignore` file. It is used to specify files and directories that should be ignored when generating commit messages. By customizing this file, you can control which changes are considered when `commitfy` creates a commit message.
5462

55-
Contact me!
63+
## AI Providers
64+
65+
`commitfy` supports the following AI providers for generating commit messages:
66+
67+
- **OpenAI**
5668

57-
- E-mail <a href="mailto:ribeirogabx@gmail.com" target="_blank">`[email protected]`</a>
69+
> **Note:** Currently, we only support OpenAI, but we plan to add more providers in the future. If you have a suggestion for an AI provider, please [open an issue](https://github.com/ribeirogab/commitfy/issues).

SECURITY.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We take security seriously and aim to ensure that `commitfy` is safe and secure for all users. Below is a list of versions of `commitfy` that are currently supported with security updates:
6+
7+
| Version | Supported |
8+
| --------- | ------------------ |
9+
| 0.2.x | :white_check_mark: |
10+
| < 0.1.x | :x: |
11+
12+
## Reporting a Vulnerability
13+
14+
If you discover a security vulnerability within `commitfy`, we encourage you to report it as soon as possible. Please follow the steps below to report the issue:
15+
16+
1. **Do not** open a public issue on the repository or discuss the vulnerability in public forums.
17+
2. Contact us directly at [[email protected]](mailto:[email protected]) with the details of the vulnerability.
18+
3. Provide as much information as possible to help us understand and replicate the issue. This may include:
19+
- A description of the vulnerability and its potential impact.
20+
- Steps to reproduce the vulnerability.
21+
- Any proof of concept code.
22+
- Your recommendations for mitigation or remediation.
23+
24+
We will acknowledge receipt of your report within 48 hours and work to resolve the issue promptly. We will keep you informed of the progress and may reach out to you for further information or clarification if needed.
25+
26+
## Responsible Disclosure
27+
28+
To ensure the safety of our users, we follow a responsible disclosure process. This means that we will not disclose the details of a security vulnerability until we have had the opportunity to investigate, develop, and release a fix. We appreciate your cooperation in helping us maintain the security and integrity of `commitfy`.
29+
30+
## Security Updates
31+
32+
We will release security updates as necessary to address vulnerabilities. If a fix requires a new version of `commitfy`, we will communicate this through our regular release channels, including the project's GitHub releases page.
33+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "commitfy",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"main": "lib/index.js",
55
"repository": "https://github.com/ribeirogab/commitfy.git",
66
"author": "ribeirogab <[email protected]>",

0 commit comments

Comments
 (0)