From fe7bc174fbb9ea0f367a61eca388da5ae56a12c0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 24 Aug 2021 14:39:42 +0900 Subject: [PATCH 01/20] Fix #7689 --- CHANGELOG.md | 5 +++++ src/server/web/boot.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e8add521b..205c780c2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ --> +## 12.89.2 (2021/08/24) + +### Bugfixes +- カスタムCSSを有効にしているとエラーになる問題を修正 + ## 12.89.1 (2021/08/24) ### Improvements diff --git a/src/server/web/boot.js b/src/server/web/boot.js index 7a41ae2555..a3a0685669 100644 --- a/src/server/web/boot.js +++ b/src/server/web/boot.js @@ -109,7 +109,7 @@ if (customCss && customCss.length > 0) { const style = document.createElement('style'); style.innerHTML = customCss; - head.appendChild(style); + document.head.appendChild(style); } // eslint-disable-next-line no-inner-declarations From f84483896edeb1f8655175b77d35ecd49f6e1985 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 24 Aug 2021 14:40:01 +0900 Subject: [PATCH 02/20] 12.89.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b085bf1c8c..1f9baa3ca2 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "misskey", "author": "syuilo ", - "version": "12.89.1", + "version": "12.89.2", "codename": "indigo", "repository": { "type": "git", From 2af158be264974b28b04a36e911a175510d3f504 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 24 Aug 2021 13:52:33 +0200 Subject: [PATCH 03/20] add setting to keep content warning (#7682) --- locales/en-US.yml | 1 + locales/ja-JP.yml | 1 + src/client/pages/settings/privacy.vue | 2 ++ 3 files changed, 4 insertions(+) diff --git a/locales/en-US.yml b/locales/en-US.yml index 9565e62038..5a0ebd366c 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -779,6 +779,7 @@ translate: "Translate" translatedFrom: "Translated from {x}" accountDeletionInProgress: "Account deletion is currently in progress" usernameInfo: "A name that identifies your account from others on this server. You can use the alphabet (a~z, A~Z), digits (0~9) or underscores (_). Usernames can not be changed later." +keepCw: "Keep Content Warning" _accountDelete: accountDelete: "Delete Account" mayTakeTime: "As account deletion is a resource-heavy process, it may take some time to complete depending on how much content you have created and how many files you have uploaded." diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 0c78ea1492..b456f7b1d4 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -779,6 +779,7 @@ translate: "翻訳" translatedFrom: "{x}から翻訳" accountDeletionInProgress: "アカウントの削除が進行中です" usernameInfo: "サーバー上であなたのアカウントを一意に識別するための名前。アルファベット(a~z, A~Z)、数字(0~9)、およびアンダーバー(_)が使用できます。ユーザー名は後から変更することは出来ません。" +keepCw: "CWを維持する" _accountDelete: accountDelete: "アカウントの削除" diff --git a/src/client/pages/settings/privacy.vue b/src/client/pages/settings/privacy.vue index 4095e744c2..46d8c17ca2 100644 --- a/src/client/pages/settings/privacy.vue +++ b/src/client/pages/settings/privacy.vue @@ -28,6 +28,7 @@ {{ $ts._visibility.localOnly }} + {{ $ts.keepCw }} @@ -69,6 +70,7 @@ export default defineComponent({ defaultNoteVisibility: defaultStore.makeGetterSetter('defaultNoteVisibility'), defaultNoteLocalOnly: defaultStore.makeGetterSetter('defaultNoteLocalOnly'), rememberNoteVisibility: defaultStore.makeGetterSetter('rememberNoteVisibility'), + keepCw: defaultStore.makeGetterSetter('keepCw'), }, created() { From c86720a33120d420ccc32549c6550d349fdaf5b2 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 24 Aug 2021 20:53:18 +0900 Subject: [PATCH 04/20] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 205c780c2c..4d027c00c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ --> +## 12.x.x (unreleased) + +### Improvements + +### Bugfixes +- CWを維持する設定を復活 + ## 12.89.2 (2021/08/24) ### Bugfixes From db1fde2956eae8ff4d5b92c4fdfb11c2c9d402b6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 26 Aug 2021 14:56:47 +0900 Subject: [PATCH 05/20] Update PULL_REQUEST_TEMPLATE.md --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 30b804f0b5..a1b9f8ad10 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -25,6 +25,10 @@ Thank you for your PR! Before creating a PR, please check the following: - You can run it with `npm run test` and `npm run lint`. - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 + +Important: If your language is not Japanese, you do not need to translate and write the description in Japanese. +The accuracy of translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language. +It will also allow the reader to use the translation tool of their preference if necessary. --> # What From 6384d0708dfbc3d432703077be5afe866177f453 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 28 Aug 2021 15:42:27 +0900 Subject: [PATCH 06/20] update contribution guides --- .github/PULL_REQUEST_TEMPLATE.md | 32 ++++------------------------ CONTRIBUTING.md | 36 ++++++++++++++++++++++++-------- docs/CONTRIBUTING.en.md | 29 +++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 37 deletions(-) create mode 100644 docs/CONTRIBUTING.en.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index a1b9f8ad10..1de4615f59 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,34 +1,10 @@ # What diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b3c67ff4d7..144efb87f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,17 +1,35 @@ # Contribution guide -:v: Thanks for your contributions :v: +**[✨ English version available](/docs/CONTRIBUTING.en.md)** -## When you contribute... -- 任意のIssueについて、せっかく実装してくださっても、実装方法や設計の認識が揃ってないとマージできない/しないことになりかねないので、初めにそのIssue上で着手することを宣言し、必要に応じて他メンバーと実装方法や設計のすり合わせを行ってください。宣言することは作業が他の人と被るのを防止する効果もあります。 - - 設計に迷った時はプロジェクトリーダーの判断を仰いでください。 -- 時間や優先度の都合上、提出してくださったPRが長期間放置されることもありますがご理解ください。 - - 温度感高めで見てほしいものは責付いてください。 +プロジェクトに興味を持っていただきありがとうございます! このドキュメントでは、プロジェクトに貢献する際に必要な情報をまとめています。 + +## 実装をする前に +機能追加やバグ修正をしたいときは、まずIssueなどで設計、方針をレビューしてもらいましょう(無い場合は作ってください)。このステップがないと、せっかく実装してもPRがマージされない可能性が高くなります。 + +また、実装に取り掛かるときは当該Issueに自分をアサインしてください(自分でできない場合は他メンバーに自分をアサインしてもらうようお願いしてください)。 +自分が実装するという意思表示をすることで、作業がバッティングするのを防ぎます。 ## Issues -Feature suggestions and bug reports are filed in https://github.com/misskey-dev/misskey/issues . +Issueを作成する前に、以下をご確認ください: +- 重複を防ぐため、既に同様の内容のIssueが作成されていないか検索してから新しいIssueを作ってください。 +- Issueを質問に使わないでください。 + - Issueは、要望、提案、問題の報告にのみ使用してください。 + - 質問は、[Misskey Forum](https://forum.misskey.io/)や[Discord](https://discord.gg/Wp8gVStHW3)でお願いします。 -* Please search existing issues to avoid duplication. If your issue is already filed, please add your reaction or comment to the existing one. -* If you have multiple independent issues, please submit them separately. +## PRの作成 +PRありがとうございます! PRを作成する前に、以下をご確認ください: +- 可能であればタイトルに、以下で示すようなPRの種類が分かるキーワードをプリフィクスしてください。 + - fix / refactor / feat / enhance / perf / chore + - また、PRの粒度が適切であることを確認してください。ひとつのPRに複数の種類の変更や関心を含めることは避けてください。 +- このPRによって解決されるIssueがある場合は、そのIssueへの参照を本文内に含めてください。 +- [`CHANGELOG.md`](/CHANGELOG.md)に変更点を追記してください。リファクタリングなど、利用者に影響を与えない変更についてはこの限りではありません。 +- この変更により新たに作成、もしくは更新すべきドキュメントがないか確認してください。 +- 機能追加やバグ修正をした場合は、可能であればテストケースを追加してください。 +- テスト、Lintが通っていることを予め確認してください。 + - `npm run test`、`npm run lint`でぞれぞれ実施可能です +- UIに変更がある場合はスクリーンショットを本文内に添付してください。 + +ご協力ありがとうございます🤗 ## Branches * **master** branch is tracking the latest release and used for production purposes. diff --git a/docs/CONTRIBUTING.en.md b/docs/CONTRIBUTING.en.md new file mode 100644 index 0000000000..3b83abe142 --- /dev/null +++ b/docs/CONTRIBUTING.en.md @@ -0,0 +1,29 @@ +# Contribution guide +:v: Thanks for your contributions :v: + +**ℹ️ Important:** This project uses Japanese as its major language, **but you do not need to translate and write the Issues/PRs in Japanese.** +Also, you might receive comments on your Issue/PR in Japanese, but you do not need to reply to them in Japanese as well.\ +The accuracy of translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language. +It will also allow the reader to use the translation tool of their preference if necessary. + +## Issues +Before creating an issue, please check the following: +- To avoid duplication, please search for similar issues before creating a new issue. +- Do not use Issues as a question. + - Issues should only be used to feature requests, suggestions, and report problems. + - Please ask questions in the [Misskey Forum](https://forum.misskey.io/) or [Discord](https://discord.gg/Wp8gVStHW3). + +## Creating a PR +Thank you for your PR! Before creating a PR, please check the following: +- If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. + - fix / refactor / feat / enhance / perf / chore + - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. +- If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. +- Please add the summary of the changes to [`CHANGELOG.md`](/CHANGELOG.md). However, this is not necessary for changes that do not affect the users, such as refactoring. +- Check if there are any documents that need to be created or updated due to this change. +- If you have added a feature or fixed a bug, please add a test case if possible. +- Please make sure that tests and Lint are passed in advance. + - You can run it with `npm run test` and `npm run lint`. +- If this PR includes UI changes, please attach a screenshot in the text. + +Thanks for your cooperation 🤗 From 6490a9829bafac248b578c76b7b39b8b95a766a9 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 29 Aug 2021 16:44:15 +0900 Subject: [PATCH 07/20] fix(client): fix button style --- CHANGELOG.md | 1 + src/client/style.scss | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d027c00c8..7674dcd042 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ### Bugfixes - CWを維持する設定を復活 +- クライアントの表示を修正 ## 12.89.2 (2021/08/24) diff --git a/src/client/style.scss b/src/client/style.scss index 269cf88939..6ab5e796bd 100644 --- a/src/client/style.scss +++ b/src/client/style.scss @@ -159,7 +159,6 @@ hr { display: inline-block; padding: 0; margin: 0; // for Safari - width: max-content; background: none; border: none; cursor: pointer; From 229780f6ff35d05051bfc1cd98f6afa14fbbcd2b Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 19:50:50 +0900 Subject: [PATCH 08/20] Update CONTRIBUTING.en.md --- docs/CONTRIBUTING.en.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/CONTRIBUTING.en.md b/docs/CONTRIBUTING.en.md index 3b83abe142..ac81a5e017 100644 --- a/docs/CONTRIBUTING.en.md +++ b/docs/CONTRIBUTING.en.md @@ -13,6 +13,12 @@ Before creating an issue, please check the following: - Issues should only be used to feature requests, suggestions, and report problems. - Please ask questions in the [Misskey Forum](https://forum.misskey.io/) or [Discord](https://discord.gg/Wp8gVStHW3). +## Before implementation + +When you want to add a feature or fix a bug, first have the design and policy reviewed in an Issue or something similar (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. + +Also, when you start implementation, assign yourself to the issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the issue, you can prevent conflicts in the work. + ## Creating a PR Thank you for your PR! Before creating a PR, please check the following: - If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. From e210ec782a9ad918783eb7ebc63ce2bd3faa4bec Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 19:53:51 +0900 Subject: [PATCH 09/20] Update CONTRIBUTING.en.md --- docs/CONTRIBUTING.en.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/CONTRIBUTING.en.md b/docs/CONTRIBUTING.en.md index ac81a5e017..e92547abb0 100644 --- a/docs/CONTRIBUTING.en.md +++ b/docs/CONTRIBUTING.en.md @@ -14,10 +14,9 @@ Before creating an issue, please check the following: - Please ask questions in the [Misskey Forum](https://forum.misskey.io/) or [Discord](https://discord.gg/Wp8gVStHW3). ## Before implementation +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. -When you want to add a feature or fix a bug, first have the design and policy reviewed in an Issue or something similar (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. - -Also, when you start implementation, assign yourself to the issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the issue, you can prevent conflicts in the work. +Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. ## Creating a PR Thank you for your PR! Before creating a PR, please check the following: From 5719c623a4cb1e170176930040b693028d756136 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 19:56:28 +0900 Subject: [PATCH 10/20] Update CONTRIBUTING.md --- CONTRIBUTING.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 144efb87f4..4e898c7acf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,12 +3,6 @@ プロジェクトに興味を持っていただきありがとうございます! このドキュメントでは、プロジェクトに貢献する際に必要な情報をまとめています。 -## 実装をする前に -機能追加やバグ修正をしたいときは、まずIssueなどで設計、方針をレビューしてもらいましょう(無い場合は作ってください)。このステップがないと、せっかく実装してもPRがマージされない可能性が高くなります。 - -また、実装に取り掛かるときは当該Issueに自分をアサインしてください(自分でできない場合は他メンバーに自分をアサインしてもらうようお願いしてください)。 -自分が実装するという意思表示をすることで、作業がバッティングするのを防ぎます。 - ## Issues Issueを作成する前に、以下をご確認ください: - 重複を防ぐため、既に同様の内容のIssueが作成されていないか検索してから新しいIssueを作ってください。 @@ -16,6 +10,12 @@ Issueを作成する前に、以下をご確認ください: - Issueは、要望、提案、問題の報告にのみ使用してください。 - 質問は、[Misskey Forum](https://forum.misskey.io/)や[Discord](https://discord.gg/Wp8gVStHW3)でお願いします。 +## 実装をする前に +機能追加やバグ修正をしたいときは、まずIssueで設計、方針をレビューしてもらいましょう(無い場合は作ってください)。このステップがないと、せっかく実装してもPRがマージされない可能性が高くなります。 + +また、実装に取り掛かるときは当該Issueに自分をアサインしてください(自分でできない場合は他メンバーに自分をアサインしてもらうようお願いしてください)。 +自分が実装するという意思表示をすることで、作業がバッティングするのを防ぎます。 + ## PRの作成 PRありがとうございます! PRを作成する前に、以下をご確認ください: - 可能であればタイトルに、以下で示すようなPRの種類が分かるキーワードをプリフィクスしてください。 From 90411967d6fdd56147b358cd0f12af3d5781fb84 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 20:00:31 +0900 Subject: [PATCH 11/20] Update CONTRIBUTING.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit linterで担保させれば済むため、コーディングスタイルなどのセクションを削除 --- CONTRIBUTING.md | 107 +----------------------------------------------- 1 file changed, 1 insertion(+), 106 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4e898c7acf..841036e2e1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -73,116 +73,11 @@ Configuration files are located in [`/.github/workflows`](/.github/workflows). If you have no experience on 3D modeling, we suggest to use the free 3DCG software [Blender](https://www.blender.org/). You can find information on glTF 2.0 at [glTF 2.0 — Blender Manual]( https://docs.blender.org/manual/en/dev/addons/io_scene_gltf2.html). -## FAQ +## Notes ### How to resolve conflictions occurred at yarn.lock? Just execute `yarn` to fix it. -## Glossary -### AP -Stands for _**A**ctivity**P**ub_. - -### MFM -Stands for _**M**isskey **F**lavored **M**arkdown_. - -### Mk -Stands for _**M**iss**k**ey_. - -### SW -Stands for _**S**ervice**W**orker_. - -### Nyaize -Convert な(na) to にゃ(nya) - -#### Denyaize -Revert Nyaize - -## TypeScript Coding Style -### Do not omit semicolons -This is to avoid Automatic Semicolon Insertion (ASI) hazard. - -Ref: -* https://www.ecma-international.org/ecma-262/#sec-automatic-semicolon-insertion -* https://github.com/tc39/ecma262/pull/1062 - -### Do not omit curly brackets -Bad: -``` ts -if (foo) - bar; -else - baz; -``` - -Good: -``` ts -if (foo) { - bar; -} else { - baz; -} -``` - -As a special case, you can omit the curly brackets if - -* the body of the `if`-statement have only one statement and, -* the `if`-statement does not have `else`-clause. - -Good: -``` ts -if (foo) bar; -``` - -Make sure that the condition and the body statement are on the same line. - -### Do not use `==` when it can simply be replaced with `===`. -🥰 - -### Use only boolean (or null related) values in the condition of an `if`-statement. -Bad: -``` ts -if (foo.length) -``` - -Good: -``` ts -if (foo.length > 0) -``` - -### Do not use `export default` -This is because the current language support does not work well with `export default`. - -Ref: -* https://basarat.gitbooks.io/typescript/docs/tips/defaultIsBad.html -* https://gfx.hatenablog.com/entry/2017/11/24/135343 - -Bad: -``` ts -export default function(foo: string): string { -``` - -Good: -``` ts -export function something(foo: string): string { -``` - -## Directory structure -``` -src ... Source code - @types ... Type definitions - prelude ... Independence utils for coding JavaScript without side effects - misc ... Independence utils for Misskey without side effects - service ... Common functions with side effects - queue ... Job queues and Jobs - server ... Web Server - client ... Client - mfm ... MFM - -test ... Test code - -``` - -## Notes ### placeholder SQLをクエリビルダで組み立てる際、使用するプレースホルダは重複してはならない 例えば From b1f94c7bc6c67a3bd961160be90277bb6e54b95b Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 20:04:59 +0900 Subject: [PATCH 12/20] Update CONTRIBUTING.en.md --- docs/CONTRIBUTING.en.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/CONTRIBUTING.en.md b/docs/CONTRIBUTING.en.md index e92547abb0..ea590a7139 100644 --- a/docs/CONTRIBUTING.en.md +++ b/docs/CONTRIBUTING.en.md @@ -18,6 +18,12 @@ When you want to add a feature or fix a bug, first have the design and policy re Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. +## Well-known branches +- **master** branch is tracking the latest release and used for production purposes. +- **develop** branch is where we work for the next release. + - When you create a PR, basically target it to this branch. +- **l10n_develop** branch is reserved for localization management. + ## Creating a PR Thank you for your PR! Before creating a PR, please check the following: - If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. @@ -32,3 +38,13 @@ Thank you for your PR! Before creating a PR, please check the following: - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 + +## Localization (l10n) +Misskey uses [Crowdin](https://crowdin.com/project/misskey) for localization management. +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. + +If your language is not listed in Crowdin, please open an issue. + +![Crowdin](https://d322cqt584bo4o.cloudfront.net/misskey/localized.svg) From 7fbee704ec4eb0139673a6f4440f181521f6f9e5 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 20:09:26 +0900 Subject: [PATCH 13/20] Update CONTRIBUTING.en.md --- docs/CONTRIBUTING.en.md | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/CONTRIBUTING.en.md b/docs/CONTRIBUTING.en.md index ea590a7139..21f2b591f3 100644 --- a/docs/CONTRIBUTING.en.md +++ b/docs/CONTRIBUTING.en.md @@ -19,22 +19,22 @@ When you want to add a feature or fix a bug, first have the design and policy re Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask another member to assign you). By expressing your intention to work the Issue, you can prevent conflicts in the work. ## Well-known branches -- **master** branch is tracking the latest release and used for production purposes. -- **develop** branch is where we work for the next release. +- **`master`** branch is tracking the latest release and used for production purposes. +- **`develop`** branch is where we work for the next release. - When you create a PR, basically target it to this branch. -- **l10n_develop** branch is reserved for localization management. +- **`l10n_develop`** branch is reserved for localization management. ## Creating a PR Thank you for your PR! Before creating a PR, please check the following: - If possible, prefix the title with a keyword that identifies the type of this PR, as shown below. - - fix / refactor / feat / enhance / perf / chore + - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` etc - Also, make sure that the granularity of this PR is appropriate. Please do not include more than one type of change or interest in a single PR. - If there is an Issue which will be resolved by this PR, please include a reference to the Issue in the text. - Please add the summary of the changes to [`CHANGELOG.md`](/CHANGELOG.md). However, this is not necessary for changes that do not affect the users, such as refactoring. - Check if there are any documents that need to be created or updated due to this change. - If you have added a feature or fixed a bug, please add a test case if possible. - Please make sure that tests and Lint are passed in advance. - - You can run it with `npm run test` and `npm run lint`. + - You can run it with `npm run test` and `npm run lint`. [See more info](#testing) - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 @@ -48,3 +48,19 @@ The owner [@syuilo](https://github.com/syuilo) merges the PR into the develop br If your language is not listed in Crowdin, please open an issue. ![Crowdin](https://d322cqt584bo4o.cloudfront.net/misskey/localized.svg) + +## Testing +- Test codes are located in [`/test`](/test). + +### Run test +``` +npm run test +``` + +#### Run specify test +``` +npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" npx mocha test/foo.ts --require ts-node/register +``` + +### e2e tests +TODO From 7e30910ab84e1bec6779b5d4b89db02274768b18 Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 30 Aug 2021 20:11:22 +0900 Subject: [PATCH 14/20] Update CONTRIBUTING.md --- CONTRIBUTING.md | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 841036e2e1..ca0a841ccf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,22 +19,23 @@ Issueを作成する前に、以下をご確認ください: ## PRの作成 PRありがとうございます! PRを作成する前に、以下をご確認ください: - 可能であればタイトルに、以下で示すようなPRの種類が分かるキーワードをプリフィクスしてください。 - - fix / refactor / feat / enhance / perf / chore + - `fix` / `refactor` / `feat` / `enhance` / `perf` / `chore` など - また、PRの粒度が適切であることを確認してください。ひとつのPRに複数の種類の変更や関心を含めることは避けてください。 - このPRによって解決されるIssueがある場合は、そのIssueへの参照を本文内に含めてください。 - [`CHANGELOG.md`](/CHANGELOG.md)に変更点を追記してください。リファクタリングなど、利用者に影響を与えない変更についてはこの限りではありません。 - この変更により新たに作成、もしくは更新すべきドキュメントがないか確認してください。 - 機能追加やバグ修正をした場合は、可能であればテストケースを追加してください。 - テスト、Lintが通っていることを予め確認してください。 - - `npm run test`、`npm run lint`でぞれぞれ実施可能です + - `npm run test`、`npm run lint`でぞれぞれ実施可能です。[詳細](#testing) - UIに変更がある場合はスクリーンショットを本文内に添付してください。 ご協力ありがとうございます🤗 -## Branches -* **master** branch is tracking the latest release and used for production purposes. -* **develop** branch is where we work for the next release. -* **l10n_develop** branch is reserved for localization management. +## ブランチ +- **`master`** branch is tracking the latest release and used for production purposes. +- **`develop`** branch is where we work for the next release. + - PRを作成するときは、基本的にこのブランチに向けてください。 +- **`l10n_develop`** branch is reserved for localization management. ## Localization (l10n) Misskey uses [Crowdin](https://crowdin.com/project/misskey) for localization management. @@ -50,14 +51,22 @@ If your language is not listed in Crowdin, please open an issue. * Documents for instance admins are located in [`/docs`](/docs). * Documents for end users are located in [`/src/docs`](/src/docs). -## Test -* Test codes are located in [`/test`](/test). +## Testing +- Test codes are located in [`/test`](/test). -### Run specify test +### Run test +``` +npm run test +``` + +#### Run specify test ``` npx cross-env TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT="./test/tsconfig.json" npx mocha test/foo.ts --require ts-node/register ``` +### e2e tests +TODO + ## Continuous integration Misskey uses GitHub Actions for executing automated tests. Configuration files are located in [`/.github/workflows`](/.github/workflows). From de69cab2399037eacc1ecfd0151508a5cd14a81e Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 20:31:09 +0900 Subject: [PATCH 15/20] fix #7749 --- lib/CubismWebFramework | 1 + misskey-assets | 1 + src/client/components/signin.vue | 6 ++++-- src/client/components/signup.vue | 4 ++-- src/client/pages/welcome.setup.vue | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) create mode 160000 lib/CubismWebFramework create mode 160000 misskey-assets diff --git a/lib/CubismWebFramework b/lib/CubismWebFramework new file mode 160000 index 0000000000..85b4313dbe --- /dev/null +++ b/lib/CubismWebFramework @@ -0,0 +1 @@ +Subproject commit 85b4313dbea6b9765aec2f865977bb7fe8750bab diff --git a/misskey-assets b/misskey-assets new file mode 160000 index 0000000000..0179793ec8 --- /dev/null +++ b/misskey-assets @@ -0,0 +1 @@ +Subproject commit 0179793ec891856d6f37a3be16ba4c22f67a81b5 diff --git a/src/client/components/signin.vue b/src/client/components/signin.vue index 0094038fb6..c051288d0a 100755 --- a/src/client/components/signin.vue +++ b/src/client/components/signin.vue @@ -111,7 +111,9 @@ export default defineComponent({ onLogin(res) { if (this.autoSet) { - login(res.i); + return login(res.i); + } else { + return; } }, @@ -144,7 +146,7 @@ export default defineComponent({ }); }).then(res => { this.$emit('login', res); - this.onLogin(res); + return this.onLogin(res); }).catch(err => { if (err === null) return; os.dialog({ diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue index d584b97209..b53eb6f64a 100644 --- a/src/client/components/signup.vue +++ b/src/client/components/signup.vue @@ -178,14 +178,14 @@ export default defineComponent({ 'hcaptcha-response': this.hCaptchaResponse, 'g-recaptcha-response': this.reCaptchaResponse, }).then(() => { - os.api('signin', { + return os.api('signin', { username: this.username, password: this.password }).then(res => { this.$emit('signup', res); if (this.autoSet) { - login(res.i); + return login(res.token); } }); }).catch(() => { diff --git a/src/client/pages/welcome.setup.vue b/src/client/pages/welcome.setup.vue index de844ece1c..d0091bef67 100644 --- a/src/client/pages/welcome.setup.vue +++ b/src/client/pages/welcome.setup.vue @@ -53,7 +53,7 @@ export default defineComponent({ username: this.username, password: this.password, }).then(res => { - login(res.i); + return login(res.token); }).catch(() => { this.submitting = false; From 2f3a942583f1cc1f469f3fe9266ae781308003f6 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 20:47:39 +0900 Subject: [PATCH 16/20] fix --- src/client/account.ts | 6 ++++-- src/client/components/signup.vue | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/client/account.ts b/src/client/account.ts index ee1d845493..69755819fe 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -1,4 +1,4 @@ -import { get, set } from '@client/scripts/idb-proxy'; +import { del, get, set } from '@client/scripts/idb-proxy'; import { reactive } from 'vue'; import { apiUrl } from '@client/config'; import { waiting } from '@client/os'; @@ -26,7 +26,9 @@ export async function signout() { //#region Remove account const accounts = await getAccounts(); accounts.splice(accounts.findIndex(x => x.id === $i.id), 1); - set('accounts', accounts); + + if (accounts.length > 0) await set('accounts', accounts); + else await del('accounts'); //#endregion //#region Remove push notification registration diff --git a/src/client/components/signup.vue b/src/client/components/signup.vue index b53eb6f64a..d332274111 100644 --- a/src/client/components/signup.vue +++ b/src/client/components/signup.vue @@ -185,7 +185,7 @@ export default defineComponent({ this.$emit('signup', res); if (this.autoSet) { - return login(res.token); + return login(res.i); } }); }).catch(() => { From f6d8867df2b4db81cb8cca33aa1e54e4c72cae31 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 20:56:01 +0900 Subject: [PATCH 17/20] fix logout behavior when there is no push subscription --- src/client/account.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/client/account.ts b/src/client/account.ts index 69755819fe..97085aca47 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -35,14 +35,15 @@ export async function signout() { try { const registration = await navigator.serviceWorker.ready; const push = await registration.pushManager.getSubscription(); - if (!push) return; - await fetch(`${apiUrl}/sw/unregister`, { - method: 'POST', - body: JSON.stringify({ - i: $i.token, - endpoint: push.endpoint, - }), - }); + if (push) { + await fetch(`${apiUrl}/sw/unregister`, { + method: 'POST', + body: JSON.stringify({ + i: $i.token, + endpoint: push.endpoint, + }), + }); + } } catch (e) {} //#endregion From b2e21db0b3a71ff9d277109db3d6b3221731b39f Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 21:07:39 +0900 Subject: [PATCH 18/20] fix logout behavior when there is no push subscription 2 --- src/client/account.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/client/account.ts b/src/client/account.ts index 97085aca47..efe9f19527 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -33,16 +33,18 @@ export async function signout() { //#region Remove push notification registration try { - const registration = await navigator.serviceWorker.ready; - const push = await registration.pushManager.getSubscription(); - if (push) { - await fetch(`${apiUrl}/sw/unregister`, { - method: 'POST', - body: JSON.stringify({ - i: $i.token, - endpoint: push.endpoint, - }), - }); + if (navigator.serviceWorker.controller) { + const registration = await navigator.serviceWorker.ready; + const push = await registration.pushManager.getSubscription(); + if (push) { + await fetch(`${apiUrl}/sw/unregister`, { + method: 'POST', + body: JSON.stringify({ + i: $i.token, + endpoint: push.endpoint, + }), + }); + } } } catch (e) {} //#endregion From 106a0226321533fd131a9bc9193bd3128b417828 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 21:42:13 +0900 Subject: [PATCH 19/20] clean up service worker registration --- src/client/account.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/account.ts b/src/client/account.ts index efe9f19527..50eb7ecba3 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -31,7 +31,7 @@ export async function signout() { else await del('accounts'); //#endregion - //#region Remove push notification registration + //#region Remove service worker registration try { if (navigator.serviceWorker.controller) { const registration = await navigator.serviceWorker.ready; @@ -46,6 +46,13 @@ export async function signout() { }); } } + + if (accounts.length === 0) { + await navigator.serviceWorker.getRegistrations() + .then(registrations => { + return Promise.all(registrations.map(registration => registration.unregister())); + }) + } } catch (e) {} //#endregion From 5f2236e6fa22f0531efc4bbafcc13ae57138dfa0 Mon Sep 17 00:00:00 2001 From: tamaina Date: Tue, 31 Aug 2021 21:42:26 +0900 Subject: [PATCH 20/20] fix lint --- src/client/account.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/account.ts b/src/client/account.ts index 50eb7ecba3..e469bae5a2 100644 --- a/src/client/account.ts +++ b/src/client/account.ts @@ -51,7 +51,7 @@ export async function signout() { await navigator.serviceWorker.getRegistrations() .then(registrations => { return Promise.all(registrations.map(registration => registration.unregister())); - }) + }); } } catch (e) {} //#endregion