Skip to content

Commit

Permalink
開発ドキュメントを更新
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Feb 13, 2024
1 parent 04104c4 commit 02592a1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 36 deletions.
23 changes: 1 addition & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,4 @@ If you find the existing issue, please add your reaction or comment to the issue

## Tips

### ローカルでテストを動かす方法
```
cp test/test.yml .config/
```

```
docker-compose -f test/docker-compose.yml up
```
でテスト用のDBとRedisを上げる。
または、空の (データが消去されてもいい) DBを準備して`.config/test.yml`を調整する。

```
pnpm test
```

### API endpointを追加削除したら

以下のコマンドでインデックスを更新する必要があります。

```
npx ts-node --swc src/tools/dev/gen-api-endpoints.ts
```
開発手順は [docs/development.ja.md](docs/development.ja.md) を参照してください
35 changes: 21 additions & 14 deletions docs/development.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,39 @@ pnpm start
## コードを変更した後に変更を確認する方法

バージョンを変更する必要がありますが、developmentの場合は自動的にバージョンが設定されます。
ビルド後に5秒開けて2回リロードすれば必ずクライアントが更新されます。 ※このフォークは
なお、右下に「新しいバージョンが利用可能です」と出ている場合は1回リロードするだけで済みます。

## 変更したコードを公開インスタンスで動かす場合

`package.json``version`を変更する必要があります。

また、ソース公開用に公開インスタンスで表示されるリポジトリURLを変更したい場合は`src/const.json`から設定が出来ます。

## テストを動かす方法

1. テスト用configをコピー
### ローカルでテストを動かす方法
```
cp test/test.yml .config/
```

`cp -i test/test.yml .config/test.yml`
```
docker-compose -f test/docker-compose.yml up
```
でテスト用のDBとRedisを上げる。
または、空の (データが消去されてもいい) DBを準備して`.config/test.yml`を調整する。

2. DBを準備
```
pnpm test
```

`docker run --rm -p 57010:27017 mongo:4.4-bionic` などで上げてしまうと楽

他のDBを使う場合は適宜`.config/test.yml`を変更してください
その場合、DB内のデータは削除されてしまうため専用のDBを使用してください
※ build後に実行する必要があります

3. テストを実行
### API endpointを追加削除したら

`pnpm test`
以下のコマンドでインデックスを更新する必要があります。

※ build後に実行する必要があります
```
npx ts-node --swc src/tools/dev/gen-api-endpoints.ts
```

### ソースコードの公開

Misskey及びMeisskeyは、AGPLなので改修した場合ソースコードは (少なくともインスタンスを公開していて要求されれば) 公開する必要があります。
GitHub等のリポジトリで公開して、[src/const.json](src/const.json)`repositoryUrl` にURLを設定して、ビルド等を行った上で公開すると便利です。

0 comments on commit 02592a1

Please sign in to comment.