| 1 | # Contributing |
| 2 | |
| 3 | Excited to hear that you are interested in contributing to this project! Thanks! |
| 4 | |
| 5 | ## Documentation |
| 6 | |
| 7 | Documentation is now being synced from the [`/docs`](https://github.com/slidevjs/slidev/tree/main/docs) folder to the [`slidevjs/docs`](https://github.com/slidevjs/docs) repo. |
| 8 | |
| 9 | All Pull Requests for documentation changes should still be made to this repository. Any merged changes will be automatically mirrored to the new documentation repo. |
| 10 | |
| 11 | The easiest way to contribute documentation to this project is to follow these steps: |
| 12 | |
| 13 | 1. [Fork the repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo), for example to `https://github.com/octocat/slidev`, where `octocat` is your GitHub username. |
| 14 | 2. Clone the newly forked repo from your GitHub account |
| 15 | 3. Create a new branch to add your work to, i.e. `git checkout -b docs/update-contributing-guidelines` |
| 16 | 4. Make your changes and commit them |
| 17 | 5. Push the branch to your fork |
| 18 | 6. Go to [https://github.com/slidevjs/slidev/pulls](https://github.com/slidevjs/slidev/pulls), there should be a "Compare & Pull Request" button, where you can create a PR. |
| 19 | |
| 20 | ## Setup (in your browser) |
| 21 | |
| 22 | You can contribute through a development environment in your browser by clicking the following button: |
| 23 | |
| 24 | [](https://gitpod.io/#https://github.com/slidevjs/slidev) |
| 25 | |
| 26 | ## Setup (locally) |
| 27 | |
| 28 | This project uses [`pnpm`](https://pnpm.io/) to manage the dependencies, install it if you haven't via |
| 29 | |
| 30 | ```bash |
| 31 | npm i -g pnpm |
| 32 | ``` |
| 33 | |
| 34 | Clone this repo to your local machine and install the dependencies. |
| 35 | |
| 36 | ```bash |
| 37 | pnpm install |
| 38 | ``` |
| 39 | |
| 40 | ## Development |
| 41 | |
| 42 | To build all the packages at once, run the following command on the project root |
| 43 | |
| 44 | ```bash |
| 45 | pnpm build |
| 46 | ``` |
| 47 | |
| 48 | Build with watch mode |
| 49 | |
| 50 | ```bash |
| 51 | pnpm dev |
| 52 | ``` |
| 53 | |
| 54 | ### Run Demo |
| 55 | |
| 56 | To run Slidev locally, you can run |
| 57 | |
| 58 | ```bash |
| 59 | pnpm demo:dev |
| 60 | ``` |
| 61 | |
| 62 | Or with the real-world example `Composable Vue`: |
| 63 | |
| 64 | ```bash |
| 65 | pnpm demo:composable-vue |
| 66 | ``` |
| 67 | |
| 68 | The server will restart automatically every time the builds get updated. |
| 69 | |
| 70 | ### Before you open a PR |
| 71 | |
| 72 | Run the full local gate: |
| 73 | |
| 74 | ```bash |
| 75 | pnpm verify # build → typecheck → lint → test |
| 76 | ``` |
| 77 | |
| 78 | Note: tests require a prior build, because workspace packages resolve to their |
| 79 | built `dist/`. `pnpm verify` handles this ordering for you. |
| 80 | |
| 81 | ## Project Structure |
| 82 | |
| 83 | ### Monorepo |
| 84 | |
| 85 | We use monorepo to manage multiple packages |
| 86 | |
| 87 | ``` |
| 88 | packages |
| 89 | slidev/ - main package entry, holds the code on Node.js side |
| 90 | client/ - main frontend app |
| 91 | parser/ - parser for Slidev's extended Markdown format |
| 92 | create-app/ - scripts and template for `npm init slidev` |
| 93 | create-theme/ - scripts and template for `npm init slidev-theme` |
| 94 | vscode/ - the VSCode extension |
| 95 | ``` |
| 96 | |
| 97 | ## Code Style |
| 98 | |
| 99 | Don't worry about the code style as long as you install the dev dependencies. Git hooks will format and fix them for you on committing. |
| 100 | |
| 101 | ## Thanks |
| 102 | |
| 103 | Thank you again for being interested in this project! You are awesome! |
| 104 |