Skip to content

Commit

Permalink
docs: 開発環境のセットアップ手順を詳細にする (#14235)
Browse files Browse the repository at this point in the history
* docs: mentioning Devcontainer

fix #13753

* revise

* revise 2

* Apply suggestions from code review
per #14235 (comment)

Co-authored-by: anatawa12 <[email protected]>

* 下の方にあったDevcontainerのセクションをマージ

* revise 3

* Update CONTRIBUTING.md

#14235 (comment)

Co-authored-by: おさむのひと <[email protected]>

* mention Meilisearch

* Update CONTRIBUTING.md

---------

Co-authored-by: anatawa12 <[email protected]>
Co-authored-by: おさむのひと <[email protected]>
  • Loading branch information
3 people authored Jul 17, 2024
1 parent de166a8 commit e716c20
Showing 1 changed file with 32 additions and 20 deletions.
52 changes: 32 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,38 @@ If your language is not listed in Crowdin, please open an issue.
![Crowdin](https://d322cqt584bo4o.cloudfront.net/misskey/localized.svg)

## Development
### Setup
Before developing, you have to set up environment. Misskey requires Redis, PostgreSQL, and FFmpeg.

You would want to install Meilisearch to experiment related features. Technically, meilisearch is not strict requirement, but some features and tests require it.

There are a few ways to proceed.

#### Use system-wide software
You could install them in system-wide (such as from package manager).

#### Use `docker compose`
You could obtain middleware container by typing `docker compose -f $PROJECT_ROOT/compose.local-db.yml up -d`.

#### Use Devcontainer
Devcontainer also has necessary setting. This method can be done by connecting from VSCode.

Instead of running `pnpm` locally, you can use Dev Container to set up your development environment.
To use Dev Container, open the project directory on VSCode with Dev Containers installed.
**Note:** If you are using Windows, please clone the repository with WSL. Using Git for Windows will result in broken files due to the difference in how newlines are handled.

It will run the following command automatically inside the container.
``` bash
git submodule update --init
pnpm install --frozen-lockfile
cp .devcontainer/devcontainer.yml .config/default.yml
pnpm build
pnpm migrate
```

After finishing the migration, you can proceed.

### Start developing
During development, it is useful to use the

```
Expand Down Expand Up @@ -135,26 +167,6 @@ MK_DEV_PREFER=backend pnpm dev
- To change the port of Vite, specify with `VITE_PORT` environment variable.
- HMR may not work in some environments such as Windows.

### Dev Container
Instead of running `pnpm` locally, you can use Dev Container to set up your development environment.
To use Dev Container, open the project directory on VSCode with Dev Containers installed.
**Note:** If you are using Windows, please clone the repository with WSL. Using Git for Windows will result in broken files due to the difference in how newlines are handled.

It will run the following command automatically inside the container.
``` bash
git submodule update --init
pnpm install --frozen-lockfile
cp .devcontainer/devcontainer.yml .config/default.yml
pnpm build
pnpm migrate
```

After finishing the migration, run the `pnpm dev` command to start the development server.

``` bash
pnpm dev
```

## Testing
- Test codes are located in [`/packages/backend/test`](/packages/backend/test).

Expand Down

0 comments on commit e716c20

Please sign in to comment.