From 908d3ecb5cb9e510e06818c145aaba6664829773 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 25 Jul 2024 12:02:12 +0000 Subject: [PATCH 01/18] Bump version to 2024.7.0-beta.2 --- package.json | 2 +- packages/misskey-js/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 44466aaae606..510b96aa0189 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "misskey", - "version": "2024.7.0-beta.1", + "version": "2024.7.0-beta.2", "codename": "nasubi", "repository": { "type": "git", diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index d494b6b58e1a..aa2e0e781b37 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -1,7 +1,7 @@ { "type": "module", "name": "misskey-js", - "version": "2024.7.0-beta.1", + "version": "2024.7.0-beta.2", "description": "Misskey SDK for JavaScript", "license": "MIT", "main": "./built/index.js", From 0d76842abefa32cb22ed2e224122337bccce693d Mon Sep 17 00:00:00 2001 From: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:16:27 +0900 Subject: [PATCH 02/18] docs: format `CONTRIBUTING.md` (#14302) * fix: correct typos * chore: convert indentation to tabs * fix: missing lang * chore: trim unnecessary whitespaces and newlines * chore: use local path * chore: use GFM alerts * fix: missing use GFM alerts --- CONTRIBUTING.md | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 784d56d08c4f..72c84c2f1845 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ # Contribution guide We're glad you're interested in contributing Misskey! In this document you will find the information you need to contribute to the project. -> **Note** +> [!NOTE] > 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 machine translation into Japanese is not high, so it will be easier for us to understand if you write it in the original language. @@ -17,32 +17,31 @@ Before creating an issue, please check the following: - Issues should only be used to feature requests, suggestions, and bug tracking. - Please ask questions or troubleshooting in [GitHub Discussions](https://github.com/misskey-dev/misskey/discussions) or [Discord](https://discord.gg/Wp8gVStHW3). -> **Warning** +> [!WARNING] > Do not close issues that are about to be resolved. It should remain open until a commit that actually resolves it is merged. - ### Recommended discussing before implementation -We welcome your purposal. +We welcome your proposal. 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. PRs that do not have a clear set of do's and don'ts tend to be bloated and difficult to review. -Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask Commiter to assign you). +Also, when you start implementation, assign yourself to the Issue (if you cannot do it yourself, ask Committer to assign you). By expressing your intention to work on the Issue, you can prevent conflicts in the work. To the Committers: you should not assign someone on it before the Final Decision. ### How issues are triaged -The Commiters may: +The Committers may: * close an issue that is not reproducible on latest stable release, * merge an issue into another issue, * split an issue into multiple issues, * or re-open that has been closed for some reason which is not applicable anymore. -@syuilo reserves the Final Desicion rights including whether the project will implement feature and how to implement, these rights are not always exercised. +@syuilo reserves the Final Decision rights including whether the project will implement feature and how to implement, these rights are not always exercised. ## Well-known branches - **`master`** branch is tracking the latest release and used for production purposes. @@ -53,14 +52,14 @@ The Commiters may: ## 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` 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. + - `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 `pnpm test` and `pnpm lint`. [See more info](#testing) + - You can run it with `pnpm test` and `pnpm lint`. [See more info](#testing) - If this PR includes UI changes, please attach a screenshot in the text. Thanks for your cooperation 🤗 @@ -70,8 +69,8 @@ Be willing to comment on the good points and not just the things you want fixed ### Review perspective - Scope - - Are the goals of the PR clear? - - Is the granularity of the PR appropriate? + - Are the goals of the PR clear? + - Is the granularity of the PR appropriate? - Security - Does merging this PR create a vulnerability? - Performance @@ -93,7 +92,7 @@ An actual domain will be assigned so you can test the federation. ## Release ### Release Instructions -1. Commit version changes in the `develop` branch ([package.json](https://github.com/misskey-dev/misskey/blob/develop/package.json)) +1. Commit version changes in the `develop` branch ([package.json](package.json)) 2. Create a release PR. - Into `master` from `develop` branch. - The title must be in the format `Release: x.y.z`. @@ -104,7 +103,7 @@ An actual domain will be assigned so you can test the federation. - The target branch must be `master` - The tag name must be the version -> **Note** +> [!NOTE] > Why this instruction is necessary: > - To perform final QA checks > - To distribute responsibility @@ -139,7 +138,7 @@ You could obtain middleware container by typing `docker compose -f $PROJECT_ROOT 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. +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. @@ -155,11 +154,9 @@ After finishing the migration, you can proceed. ### Start developing During development, it is useful to use the - ``` pnpm dev ``` - command. - Server-side source files and automatically builds them if they are modified. Automatically start the server process(es). @@ -232,7 +229,7 @@ niraxは、Misskeyで使用しているオリジナルのフロントエンド ### ルート定義 ルート定義は、以下の形式のオブジェクトの配列です。 -``` ts +```ts { name?: string; path: string; @@ -245,7 +242,7 @@ niraxは、Misskeyで使用しているオリジナルのフロントエンド } ``` -> **Warning** +> [!WARNING] > 現状、ルートは定義された順に評価されます。 > たとえば、`/foo/:id`ルート定義の次に`/foo/bar`ルート定義がされていた場合、後者がマッチすることはありません。 @@ -307,7 +304,7 @@ export const Default = { parameters: { layout: 'centered', }, -} satisfies StoryObj; +} satisfies StoryObj; ``` If you want to opt-out from the automatic generation, create a `MyComponent.stories.impl.ts` file and add the following line to the file. @@ -418,7 +415,7 @@ describe('test', () => { }) .useMocker(... .compile(); - + fooService = app.get(FooService); barService = app.get(BarService) as jest.Mocked; @@ -539,13 +536,13 @@ pnpm dlx typeorm migration:generate -d ormconfig.js -o - 作成されたスクリプトは不必要な変更を含むため除去してください ### JSON SchemaのobjectでanyOfを使うとき -JSON Schemaで、objectに対してanyOfを使う場合、anyOfの中でpropertiesを定義しないこと。 -バリデーションが効かないため。(SchemaTypeもそのように作られており、objectのanyOf内のpropertiesは捨てられます) +JSON Schemaで、objectに対してanyOfを使う場合、anyOfの中でpropertiesを定義しないこと。 +バリデーションが効かないため。(SchemaTypeもそのように作られており、objectのanyOf内のpropertiesは捨てられます) https://github.com/misskey-dev/misskey/pull/10082 テキストhogeおよびfugaについて、片方を必須としつつ両方の指定もありうる場合: -``` +```ts export const paramDef = { type: 'object', properties: { From 46d96c7412f85990d01006fbb548178c8cfdf827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 27 Jul 2024 18:09:15 +0900 Subject: [PATCH 03/18] =?UTF-8?q?fix(build):=20autogen=E7=94=9F=E6=88=90?= =?UTF-8?q?=E6=99=82=E3=81=ABbackend=E3=82=922=E5=BA=A6build=E3=81=97?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#14309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(build): autogen生成時にbackendを2度buildしているのを修正 * fix * fix --- package.json | 2 +- packages/backend/package.json | 2 +- packages/backend/scripts/generate_api_json.js | 35 +++++++++++++++---- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 510b96aa0189..ecf2de39d3dc 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "build-assets": "node ./scripts/build-assets.mjs", "build": "pnpm build-pre && pnpm -r build && pnpm build-assets", "build-storybook": "pnpm --filter frontend build-storybook", - "build-misskey-js-with-types": "pnpm build-pre && pnpm --filter backend... --filter=!misskey-js build && pnpm --filter backend generate-api-json && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", + "build-misskey-js-with-types": "pnpm build-pre && pnpm --filter backend... --filter=!misskey-js build && pnpm --filter backend generate-api-json --no-build && ncp packages/backend/built/api.json packages/misskey-js/generator/api.json && pnpm --filter misskey-js update-autogen-code && pnpm --filter misskey-js build && pnpm --filter misskey-js api", "start": "pnpm check:connect && cd packages/backend && node ./built/boot/entry.js", "start:test": "cd packages/backend && cross-env NODE_ENV=test node ./built/boot/entry.js", "init": "pnpm migrate", diff --git a/packages/backend/package.json b/packages/backend/package.json index 22fdc5cf1681..b99717d15cea 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -31,7 +31,7 @@ "test:e2e": "pnpm build && pnpm build:test && pnpm jest:e2e", "test-and-coverage": "pnpm jest-and-coverage", "test-and-coverage:e2e": "pnpm build && pnpm build:test && pnpm jest-and-coverage:e2e", - "generate-api-json": "pnpm build && node ./scripts/generate_api_json.js" + "generate-api-json": "node ./scripts/generate_api_json.js" }, "optionalDependencies": { "@swc/core-android-arm64": "1.3.11", diff --git a/packages/backend/scripts/generate_api_json.js b/packages/backend/scripts/generate_api_json.js index b4769ef8012e..798e2430040a 100644 --- a/packages/backend/scripts/generate_api_json.js +++ b/packages/backend/scripts/generate_api_json.js @@ -3,11 +3,34 @@ * SPDX-License-Identifier: AGPL-3.0-only */ -import { loadConfig } from '../built/config.js' -import { genOpenapiSpec } from '../built/server/api/openapi/gen-spec.js' -import { writeFileSync } from "node:fs"; +import { execa } from 'execa'; +import { writeFileSync, existsSync } from "node:fs"; -const config = loadConfig(); -const spec = genOpenapiSpec(config, true); +async function main() { + if (!process.argv.includes('--no-build')) { + await execa('pnpm', ['run', 'build'], { + stdout: process.stdout, + stderr: process.stderr, + }); + } -writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8'); + if (!existsSync('./built')) { + throw new Error('`built` directory does not exist.'); + } + + /** @type {import('../src/config.js')} */ + const { loadConfig } = await import('../built/config.js'); + + /** @type {import('../src/server/api/openapi/gen-spec.js')} */ + const { genOpenapiSpec } = await import('../built/server/api/openapi/gen-spec.js'); + + const config = loadConfig(); + const spec = genOpenapiSpec(config, true); + + writeFileSync('./built/api.json', JSON.stringify(spec), 'utf-8'); +} + +main().catch(e => { + console.error(e); + process.exit(1); +}); From 22c4e9d7ecf5a659832ea32244e46a40627bfc8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Sat, 27 Jul 2024 18:09:57 +0900 Subject: [PATCH 04/18] =?UTF-8?q?fix(frontend):=20modal=E3=81=8C=E6=AD=A3?= =?UTF-8?q?=E3=81=97=E3=81=8F=E9=96=89=E3=81=98=E3=82=89=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=20(#14307)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix(frontend): modalが正しく閉じられていないのを修正 * Update packages/frontend/src/components/MkSystemWebhookEditor.vue Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> --- .../components/MkSystemWebhookEditor.impl.ts | 13 +++++---- .../src/components/MkSystemWebhookEditor.vue | 22 +++++++++----- .../src/components/MkUserSelectDialog.vue | 8 ++--- .../notification-recipient.editor.vue | 29 ++++++++++++------- .../abuse-report/notification-recipient.vue | 15 +++++----- 5 files changed, 53 insertions(+), 34 deletions(-) diff --git a/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts b/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts index 76f54e8d374a..69b8edd85aec 100644 --- a/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts +++ b/packages/frontend/src/components/MkSystemWebhookEditor.impl.ts @@ -24,22 +24,23 @@ export type MkSystemWebhookResult = { }; export async function showSystemWebhookEditorDialog(props: MkSystemWebhookEditorProps): Promise { - const { dispose, result } = await new Promise<{ dispose: () => void, result: MkSystemWebhookResult | null }>(async resolve => { - const { dispose: _dispose } = os.popup( + const { result } = await new Promise<{ result: MkSystemWebhookResult | null }>(async resolve => { + const { dispose } = os.popup( defineAsyncComponent(() => import('@/components/MkSystemWebhookEditor.vue')), props, { submitted: (ev: MkSystemWebhookResult) => { - resolve({ dispose: _dispose, result: ev }); + resolve({ result: ev }); + }, + canceled: () => { + resolve({ result: null }); }, closed: () => { - resolve({ dispose: _dispose, result: null }); + dispose(); }, }, ); }); - dispose(); - return result; } diff --git a/packages/frontend/src/components/MkSystemWebhookEditor.vue b/packages/frontend/src/components/MkSystemWebhookEditor.vue index 007d841f001a..3e6a015018d9 100644 --- a/packages/frontend/src/components/MkSystemWebhookEditor.vue +++ b/packages/frontend/src/components/MkSystemWebhookEditor.vue @@ -5,6 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only