From e716c201c65128bb04299f509c5ccedbc7061a64 Mon Sep 17 00:00:00 2001 From: Kisaragi <48310258+KisaragiEffective@users.noreply.github.com> Date: Thu, 18 Jul 2024 08:57:02 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20=E9=96=8B=E7=99=BA=E7=92=B0=E5=A2=83?= =?UTF-8?q?=E3=81=AE=E3=82=BB=E3=83=83=E3=83=88=E3=82=A2=E3=83=83=E3=83=97?= =?UTF-8?q?=E6=89=8B=E9=A0=86=E3=82=92=E8=A9=B3=E7=B4=B0=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=20(#14235)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: mentioning Devcontainer fix #13753 * revise * revise 2 * Apply suggestions from code review per https://github.com/misskey-dev/misskey/pull/14235#discussion_r1680883942 Co-authored-by: anatawa12 * 下の方にあったDevcontainerのセクションをマージ * revise 3 * Update CONTRIBUTING.md https://github.com/misskey-dev/misskey/pull/14235#discussion_r1680928026 Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com> * mention Meilisearch * Update CONTRIBUTING.md --------- Co-authored-by: anatawa12 Co-authored-by: おさむのひと <46447427+samunohito@users.noreply.github.com> --- CONTRIBUTING.md | 52 ++++++++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 20 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 532a2dc66f69..9a56345e6e4c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 ``` @@ -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).