Skip to content

Commit

Permalink
Merge pull request #24 from fahimahammed/develop
Browse files Browse the repository at this point in the history
updated
  • Loading branch information
fahimahammed authored Sep 29, 2024
2 parents 841a4de + 7c6e447 commit 62d2293
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 60 deletions.
103 changes: 103 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Contributing to prismadocify

We welcome contributions of all types to `prismadocify`! Whether you're fixing bugs, implementing new features, or improving documentation, we encourage you to get involved.

## How to Contribute

### 1. Fork the Repository

- Fork the repository to your own GitHub account.

### 2. Create a New Branch

- Create a new branch for your work:
```bash
git checkout -b my-new-feature
```

### 3. Make Your Changes

- Make your code changes in the new branch.
- Write clear, concise, and meaningful commit messages.
- Ensure that the code follows the project's coding style.

### 4. Run Tests

- Ensure that your changes do not break existing functionality.
- Run any existing tests to verify everything is working.

### 5. Submit a Pull Request

- Submit a pull request (PR) to the main repository:
- Describe the changes you've made.
- Reference any issue number if applicable (e.g., "Fixes #42").

## Guidelines

### Reporting Bugs

If you find a bug, please open an issue with:

- A clear title.
- Steps to reproduce the bug.
- Expected behavior vs. actual behavior.
- Screenshots or error messages, if available.

### Requesting Features

If you have an idea for a new feature, open an issue and describe:

- The feature in detail.
- Why it would be useful.
- Any potential implementation details.

### Pull Request Guidelines

- Fork the repo and create a new branch for your changes.
- Commit and push your changes to your fork.
- Submit a pull request from your fork to the main repository.
- Provide a clear explanation of your changes.

---

## Examples of Features to Contribute

Here are some features or enhancements you could work on:

### 1. Custom Paths for Schema and Output Files
Allow users to specify custom paths for both the input schema file and the output markdown documentation file.

- **Issue**: `#12`
- **Expected Feature**: Add a flag to specify the paths in the CLI command.

### 2. Support for Relations in Models
Improve the tool to document relationships between Prisma models, like `@relation` fields.

- **Issue**: `#15`
- **Expected Feature**: Generate documentation that describes model relations, such as one-to-many or many-to-many relationships.

### 3. Add Table of Contents to the Markdown Output
Automatically generate a table of contents at the top of the markdown file, linking to the sections for each model and enum.

- **Issue**: `#18`
- **Expected Feature**: Add a table of contents section that links to different models and enums within the documentation.

### 4. Improve Markdown Formatting Options
Allow users to customize the format of the generated markdown file, including table styles and enum formats.

- **Issue**: `#20`
- **Expected Feature**: Provide additional CLI options to control the markdown formatting.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.

---

### Key Points to Remember

1. **Hacktoberfest Participation**: Make it clear that the project is participating in Hacktoberfest and highlight how contributors can get involved.
2. **Well-Defined Issues**: Provide examples of potential contributions (features, bugs, or enhancements).
3. **Clear Contribution Process**: Detail how contributors should fork, make changes, and submit pull requests.

This setup will help attract contributors and provide them with a smooth experience in your project!
94 changes: 34 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<p align="center">
<img src="./assets/logo.png" width="200" alt="Logo">
</p>
Expand All @@ -13,22 +14,15 @@
<a href="https://github.com/fahimahammed/prismadocify/pulls">
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome">
</a>
<!-- <a href="https://www.npmjs.com/package/prismadocify">
<img src="https://img.shields.io/npm/dm/prismadocify.svg" alt="npm downloads">
</a> -->
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT">
</a>
</a>
<a href="https://github.com/fahimahammed/prismadocify">
<img src="https://img.shields.io/github/stars/fahimahammed/prismadocify.svg" alt="GitHub stars">
</a>
<a href="https://github.com/fahimahammed/prismadocify/issues">
<img src="https://img.shields.io/github/issues/fahimahammed/prismadocify.svg" alt="GitHub issues">
</a>
<a href="https://github.com/fahimahammed/prismadocify">
<img src="https://img.shields.io/github/contributors/fahimahammed/prismadocify.svg" alt="GitHub contributors">
</a>
<a href="https://github.com/fahimahammed/prismadocify">
<img src="https://img.shields.io/github/last-commit/fahimahammed/prismadocify.svg" alt="GitHub last commit">
</a>
Expand All @@ -37,11 +31,35 @@
</a>
</div>


#

## Prismadocify

`prismadocify` is a command-line tool that generates markdown documentation for Prisma schemas. It reads your Prisma schema file, parses the models and enums, and outputs a markdown file documenting the schema.

## Hacktoberfest 2024 🎃🍂

**This project is participating in [Hacktoberfest 2024](https://hacktoberfest.com/)!**

We welcome contributions from the open-source community, whether it's bug fixes, feature implementations, or documentation improvements. Every contribution counts toward your Hacktoberfest goal.

### How to Contribute
1. **Fork this repository** and create a new branch.
2. **Find an issue** to work on, or propose a new feature by opening an issue.
3. **Submit your pull request** before October 31st to make it count for Hacktoberfest!

Check out our [CONTRIBUTING.md](./CONTRIBUTING.md) for detailed guidelines.

---

## Features

Here are some of the key features of `prismadocify`:

- **Markdown Documentation Generation**: Automatically generates well-structured markdown documentation for your Prisma schemas.
- **Support for Models and Enums**: Document your Prisma models and enums with table-formatted output.
- **Customizable Paths** (coming soon): Specify custom paths for schema input and output documentation.

## Installation

### Prerequisites
Expand Down Expand Up @@ -73,43 +91,18 @@ prismadocify

By default, `prismadocify` looks for the Prisma schema file at `./prisma/schema.prisma` and generates the documentation in `./prisma-docs.md`.

### Guideline

1. Make sure your Prisma schema file is located at `./prisma/schema.prisma`.

2. Run the `prismadocify` command:

```bash
prismadocify
```

3. Check the generated `prisma-docs.md` file in the root directory of your project.

### Example

Here is an example of a simple Prisma schema and the generated documentation:

**Prisma Schema (`schema.prisma`)**

```prisma
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model User {
id String @id @default(uuid())
email String @unique
name String?
role UserRole @default(USER)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@map("users")
}
enum UserRole {
Expand All @@ -125,50 +118,31 @@ enum UserRole {

## User

| Field | Type | List | Required | Unique |
|-----------|-----------|------|----------|--------|
| id | String | No | Yes | No |
| email | String | No | Yes | Yes |
| name | String? | No | No | No |
| role | UserRole | No | Yes | No |
| createdAt | DateTime | No | Yes | No |
| updatedAt | DateTime | No | Yes | No |
| Field | Type | List | Required | Unique |
| --------- | -------- | ---- | -------- | ------ |
| id | String | No | Yes | Yes |
| email | String | No | Yes | Yes |
| name | String? | No | No | No |
| createdAt | DateTime | No | Yes | No |

## Enums

### UserRole

---
ADMIN, USER
```

### Options

Currently, `prismadocify` does not support additional options. It follows the convention of looking for the Prisma schema file at the default location (`./prisma/schema.prisma`). Future versions may include support for specifying custom paths and other options.

---

## Contributing

Contributions are welcome! Please open an issue or submit a pull request to contribute.

### Creating Issues

If you encounter a bug or have a feature request, please create an issue on GitHub.

- **Bug Reports**: Include as much detail as possible about the issue, including steps to reproduce, expected behavior, and screenshots if applicable.
- **Feature Requests**: Describe the feature you would like to see, the problem it solves, and any potential implementation details.

To create an issue, go to the [issues page](https://github.com/fahimahammed/prismadocify/issues) and click on the "New issue" button.

We welcome contributions of all kinds! To get started, please see the [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on how to contribute to the project.

## License

This project is licensed under the [MIT License](./LICENSE).


## Acknowledgements

Thanks to the [Prisma](https://github.com/prisma/prisma) team for their awesome ORM and inspiration for this tool.



0 comments on commit 62d2293

Please sign in to comment.