Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ Before creating an issue, please check the following:
### Recommended discussing before implementation
We welcome your proposal.

For security-related reports, follow [SECURITY.md](SECURITY.md) instead of the general process below.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

見落とし防止


When you want to add a feature or fix a bug, **first have the design and policy reviewed in an Issue** (if it is not there, please make one). Without this step, there is a high possibility that the PR will not be merged even if it is implemented.

At this point, you also need to clarify the goals of the PR you will create, and make sure that the other members of the team are aware of them.
Expand Down Expand Up @@ -71,12 +73,7 @@ For ActivityPub payload changes, see [additional requirements](docs/contributing
## Security Advisory

### For reporter
Thank you for your reporting!

If you can also create a patch to fix the vulnerability, please create a PR on the private fork.

> [!note]
> There is a GitHub bug that prevents merging if a PR not following the develop branch of upstream, so please keep follow the develop branch.
Please follow [SECURITY.md](SECURITY.md) for reporting security issues and submitting patches.

For maintainers: [handling advisories](docs/contributing/maintainer-guide.md#security-advisory).

Expand All @@ -86,6 +83,8 @@ You can improve our translations with your Crowdin account.
Your changes in Crowdin are automatically submitted as a PR (with the title "New Crowdin translations") to the repository.
The owner [@syuilo](https://github.com/syuilo) merges the PR into the develop branch before the next release.

For Japanese source strings, edit [`locales/ja-JP.yml`](locales/ja-JP.yml). Do not edit other locale YAML files directly; submit translations through Crowdin. See [locales/README.md](locales/README.md) for the locale editing rules.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

見落とし防止


If your language is not listed in Crowdin, please open an issue. We will add it to Crowdin.
For newly added languages, once the translation progress per language exceeds 70%, it will be officially introduced into Misskey and made available to users.

Expand Down
17 changes: 13 additions & 4 deletions docs/contributing/backend.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ export class FooService {
#### OnModuleInit
できなければ`OnModuleInit`を使う

`moduleRef.get(BarService.name)` は文字列トークンで解決するため、`BarService` の通常の登録に加え、同じモジュールの `providers` に alias を登録する必要がある。Misskey では [CoreModule](../../packages/backend/src/core/CoreModule.ts) に登録している。

```typescript
providers: [
BarService,
{ provide: BarService.name, useExisting: BarService },
],
```

Comment on lines +27 to +35

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moduleRefを使うパターンの場合、文字列トークンのエイリアスが必要になるのでやり方を案内

```typescript
import { Injectable, OnModuleInit } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core';
Expand Down Expand Up @@ -86,7 +95,7 @@ describe('test', () => {
await fooService.onModuleInit();
});

test('nice', () => {
test('nice', async () => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awaitつかってるのにasyncが無かったので

await fooService.niceMethod();

expect(barService.incredibleMethod).toHaveBeenCalled();
Expand Down Expand Up @@ -186,11 +195,11 @@ enumの列挙の内容の削除は、その値をもつレコードを全て削
削除が重たかったり不可能だったりする場合は、削除しないでおく

## Migration作成方法
packages/backendで:
リポジトリルートから:
```sh
pnpm dlx typeorm migration:generate -d ormconfig.js -o --esm <migration name>
pnpm --filter backend exec typeorm migration:generate -d ormconfig.js -o --esm migration/<PascalName>
```

- 生成後、ファイルをmigration下に移してください
- ワークスペースにインストール済みの TypeORM CLI を使う。設定ファイルと出力先は `packages/backend/` 基準で解決され、生成ファイルは `packages/backend/migration/` に配置される
- 作成されたスクリプトは不必要な変更を含むため除去してください
- `-o` (`--outputJs`) で JS 形式、`--esm` で ESM 形式に生成する。Misskey の既存 migration はすべて ESM JS なので両方のオプションが必要
2 changes: 1 addition & 1 deletion docs/contributing/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ There are a few ways to proceed.
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`.
From the repository root, you could obtain middleware containers by typing `docker compose -f compose.local-db.yml up -d`.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

見て分からなくもないが、より直接的な表現に変更


### Use Devcontainer
Devcontainer also has necessary setting. This method can be done by connecting from VSCode.
Expand Down
7 changes: 4 additions & 3 deletions docs/contributing/frontend.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
## Vue
Misskey uses Vue(v3) as its front-end framework.
- Use TypeScript.
- **When creating a new component, please use the Composition API (with [setup sugar](https://v3.vuejs.org/api/sfc-script-setup.html) and [ref sugar](https://github.com/vuejs/rfcs/discussions/369)) instead of the Options API.**
- **When creating a new component, please use the Composition API (with [`<script setup>`](https://vuejs.org/api/sfc-script-setup.html), [`ref`](https://vuejs.org/guide/essentials/reactivity-fundamentals.html), and [`computed`](https://vuejs.org/guide/essentials/computed.html)) instead of the Options API.**

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

参照が古かったので公式ドキュメントに変更

- Some of the existing components are implemented in the Options API, but it is an old implementation. Refactors that migrate those components to the Composition API are also welcome.

## Tabler Icons
Expand Down Expand Up @@ -63,7 +63,8 @@ pnpm --filter frontend storybook-dev

### Usage

When you create a new component (in this example, `MyComponent.vue`), the story file (`MyComponent.stories.ts`) will be automatically generated by the `.storybook/generate.js` script.
For components matched by the glob allowlist in [`packages/frontend/.storybook/generate.tsx`](../../packages/frontend/.storybook/generate.tsx), the story file (for example, `MyComponent.stories.ts` for `MyComponent.vue`) will be automatically generated by the compiled `.storybook/generate.js` script.
If your new component is not matched by the allowlist, add it to the `components` list in `generate.tsx`. Creating a `.stories.impl.ts` file alone does not add a component to the generation targets.
Comment on lines +66 to +67

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MyComponent.vueを置いてgenerate.jsを実行すると勝手に生成されるような記述だったが、現状は違うようで…いまの動きに即した記述に変更

You can override the default story by creating a impl story file (`MyComponent.stories.impl.ts`).

```ts
Expand Down Expand Up @@ -132,7 +133,7 @@ export const handlers = [
];
```

Don't forget to re-run the `.storybook/generate.js` script after adding, editing, or removing the above files.
After changing the allowlist or adding, editing, or removing the above files, run `pnpm --filter frontend build-storybook-pre` from the repository root to compile and run the generator again.

## コネクションには`markRaw`せよ
**Vueのコンポーネントのdataオプションとして**misskey.jsのコネクションを設定するとき、必ず`markRaw`でラップしてください。インスタンスが不必要にリアクティブ化されることで、misskey.js内の処理で不具合が発生するとともに、パフォーマンス上の問題にも繋がる。なお、Composition APIを使う場合はこの限りではない(リアクティブ化はマニュアルなため)。
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/maintainer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Be willing to comment on the good points and not just the things you want fixed

## Security Advisory

報告者向けの案内は [Contribution guide](../../CONTRIBUTING.md#security-advisory) を参照。
報告者向けの案内は [SECURITY.md](../../SECURITY.md) を参照。

### For misskey-dev member
修正PRがdevelopに追従されていないとマージできないので、マージできなかったら
Expand Down
Loading