mirror of https://github.com/artf/grapesjs.git
1 changed files with 64 additions and 45 deletions
@ -1,75 +1,94 @@ |
|||
# Contribute |
|||
# Contribute to GrapesJS |
|||
|
|||
## Introduction |
|||
Thank you for your interest in contributing to GrapesJS! We welcome all types of contributions, including bug reports, feature suggestions, documentation improvements, and code contributions. |
|||
|
|||
First of all, thank you for considering contributing to GrapesJS! |
|||
## Quick Start |
|||
|
|||
We welcome any type of contribution, not only code. Like for example: |
|||
### Prerequisites |
|||
|
|||
- **QA**: file bug reports, the more details you can give the better (e.g. screenshots with the console open) |
|||
- **Marketing**: writing blog posts, howto's, tutorials, etc. |
|||
- **Community**: presenting the project at meetups, organizing a dedicated meetup for the local community, etc. |
|||
- **Money**: We welcome financial contributions in full transparency on our [Open Collective]. |
|||
- Node.js (version 20 LTS) |
|||
- pnpm (version 8.6.3 or later) |
|||
|
|||
## Setting up the repository |
|||
### Setup |
|||
|
|||
This is a Node.js project and you need to have Node.js installed on your machine. You can download it from [here](https://nodejs.org/). We test versions 14 and 16 of Node in the CI, so it's recommended to use one of these versions, or the latest of: 16.20.2 |
|||
1. Install Node.js 20 LTS: |
|||
```bash |
|||
nvm install 20 |
|||
nvm use 20 |
|||
``` |
|||
|
|||
```bash |
|||
nvm use 16.20.2 |
|||
``` |
|||
2. Install pnpm globally: |
|||
```bash |
|||
npm install -g pnpm@8.6.3 |
|||
``` |
|||
|
|||
You will then use `yarn` to manage the dependencies and run the scripts. You can install it by running: |
|||
3. Clone the repository: |
|||
```bash |
|||
git clone https://github.com/GrapesJS/grapesjs.git |
|||
cd grapesjs |
|||
``` |
|||
|
|||
```bash |
|||
npm install -g yarn |
|||
``` |
|||
4. Install dependencies: |
|||
```bash |
|||
pnpm install |
|||
``` |
|||
|
|||
Then you can clone the repository and install the dependencies: |
|||
5. Start the development server: |
|||
```bash |
|||
pnpm start |
|||
``` |
|||
|
|||
```bash |
|||
git clone __YOUR_FORK__ |
|||
cd grapesjs |
|||
yarn |
|||
``` |
|||
6. Open `http://localhost:8080/` in your browser to see the editor in action. |
|||
|
|||
Finally, you can run the development server: |
|||
## Development Workflow |
|||
|
|||
```bash |
|||
yarn start |
|||
``` |
|||
- **Linting**: `pnpm lint` |
|||
- **Formatting**: `pnpm format` |
|||
- **Checking format**: `pnpm format:check` |
|||
- **Building**: `pnpm build` |
|||
- **Testing**: `pnpm test` |
|||
|
|||
Navigate to `http://localhost:8080/` to see the editor in action. The development server will watch for changes in the code and automatically reload the page. |
|||
### Code Style |
|||
|
|||
## Your First Contribution |
|||
We use ESLint for linting and Prettier for code formatting. While we don't have pre-commit hooks, we strongly recommend using these tools before submitting your changes: |
|||
|
|||
Working on your first Pull Request? You can learn how from this **free** series, [How to Contribute to an Open Source Project on GitHub](https://app.egghead.io/playlists/how-to-contribute-to-an-open-source-project-on-github). |
|||
- Run `pnpm lint` to check for linting errors. |
|||
- Run `pnpm format` to automatically format your code. |
|||
- Run `pnpm format:check` to check if your code is formatted correctly. |
|||
|
|||
## Submitting code |
|||
Code style is enforced at the CI level. We recommend using Prettier extensions in your editor for real-time formatting. |
|||
|
|||
Any code change should be submitted as a pull request. Before start working on something make always a search in opened issues and pull requests, this might help you to avoid wasting time. |
|||
### Documentation |
|||
|
|||
A pull request could be a bug fix, new feature and much more, but in all cases, **open a new issue** and talk about what you want to do. Often happens to work on something already fixed (ready to release) or in progress. |
|||
To generate and view the documentation: |
|||
|
|||
The title should be brief but comprehensive, the description contains a link to the opened issue and the proposed solution. The pull request should contain tests whenever possible. Keep in mind that the bigger is the pull request, the longer it will take to review and merge. Try to break down large pull requests in smaller chunks that are easier to review and merge. |
|||
1. Generate API documentation: |
|||
```bash |
|||
pnpm run docs:api |
|||
``` |
|||
|
|||
## Styleguide |
|||
2. Run the VuePress documentation server: |
|||
```bash |
|||
pnpm run docs |
|||
``` |
|||
|
|||
The code is auto formatted with [prettier](https://github.com/prettier/prettier) on any commit, therefore you can write in any style you prefer |
|||
3. Open `http://localhost:8080/` to view the documentation. |
|||
|
|||
## Expenses |
|||
## Pull Requests |
|||
|
|||
Anyone can file an expense (code, marketing, etc.) via our [Open Collective]. If the expense makes sense for the development of the community, it will be "merged" in the ledger of our open collective by the core contributors and the person who filed the expense will be reimbursed. |
|||
When submitting a pull request: |
|||
|
|||
Before submitting an expense contact core contributors via the current active chat room ([Discord](https://discord.gg/QAbgGXq)) and explain your intents |
|||
- Target your PR to the `dev` branch. |
|||
- Clearly describe the problem and solution. |
|||
- Include the relevant issue number if applicable. |
|||
- Add tests for new features or bug fixes. |
|||
|
|||
## Questions |
|||
If you're a first-time contributor, consider starting a discussion or opening an issue related to your changes before submitting a PR. This helps with collaboration and prevents duplicate work. |
|||
|
|||
If you have any questions, create an [issue](https://github.com/GrapesJS/grapesjs/issues) (protip: do a quick search first to see if someone else didn't ask the same question before!). |
|||
## Questions? |
|||
|
|||
## Credits |
|||
If you have any questions, please [open an issue](https://github.com/GrapesJS/grapesjs/issues) or start a [discussion](https://github.com/GrapesJS/grapesjs/discussions). Search existing issues and discussions first to avoid duplicates. |
|||
|
|||
Thank you to all the people who have already contributed to GrapesJS! |
|||
<a href="/GrapesJS/grapesjs/graphs/contributors"><img src="https://opencollective.com/grapesjs/contributors.svg?width=890" /></a> |
|||
## Thank You |
|||
|
|||
[Open Collective]: https://opencollective.com/grapesjs |
|||
Your contributions to open source, no matter how small, make projects like GrapesJS possible. Thank you for taking the time to contribute. |
|||
Loading…
Reference in new issue