Repository navigation
docs: CONTRIBUTING.mdの表記をブラッシュアップ+一部不備を修正 #18110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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. | ||
|
|
||
| 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. | ||
|
|
@@ -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). | ||
|
|
||
|
|
@@ -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. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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'; | ||
|
|
@@ -86,7 +95,7 @@ describe('test', () => { | |
| await fooService.onModuleInit(); | ||
| }); | ||
|
|
||
| test('nice', () => { | ||
| test('nice', async () => { | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. awaitつかってるのにasyncが無かったので |
||
| await fooService.niceMethod(); | ||
|
|
||
| expect(barService.incredibleMethod).toHaveBeenCalled(); | ||
|
|
@@ -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 なので両方のオプションが必要 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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`. | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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.** | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -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を使う場合はこの限りではない(リアクティブ化はマニュアルなため)。 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
見落とし防止