From 79a9defa0ce0d6f81ff919e76bceb7865d0273cd Mon Sep 17 00:00:00 2001 From: ikasoba <57828948+ikasoba@users.noreply.github.com> Date: Sun, 14 Jan 2024 15:30:21 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=20(#12980)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/check-misskey-js-autogen.yml | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 .github/workflows/check-misskey-js-autogen.yml diff --git a/.github/workflows/check-misskey-js-autogen.yml b/.github/workflows/check-misskey-js-autogen.yml new file mode 100644 index 0000000000..0b34cdc202 --- /dev/null +++ b/.github/workflows/check-misskey-js-autogen.yml @@ -0,0 +1,127 @@ +name: Check Misskey JS autogen + +on: + pull_request: + branches: + - master + - develop + paths: + - packages/backend/** + +jobs: + check-misskey-js-autogen: + runs-on: ubuntu-latest + permissions: + pull-requests: write + + env: + api_json_names: "api-base.json api-head.json" + + steps: + - name: checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: setup pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: setup node + id: setup-node + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + cache: pnpm + + - name: install dependencies + run: pnpm i --frozen-lockfile + + - name: wait get-api-diff + uses: lewagon/wait-on-check-action@v1.3.3 + with: + ref: ${{ github.event.pull_request.head.sha }} + check-regexp: get-from-misskey .+ + repo-token: ${{ secrets.GITHUB_TOKEN }} + wait-interval: 30 + + - name: Download artifact + uses: actions/github-script@v7 + with: + script: | + const fs = require('fs'); + + const workflows = await github.rest.actions.listWorkflowRunsForRepo({ + owner: context.repo.owner, + repo: context.repo.repo, + head_sha: `${{ github.event.pull_request.head.sha }}` + }).then(x => x.data.workflow_runs); + + console.log(workflows.map(x => ({name: x.name, title: x.display_title}))); + + const run_id = workflows.find(x => x.name.includes("Get api.json from Misskey")).id; + + let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: run_id, + }); + + let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => { + return artifact.name.startsWith("api-artifact-") || artifact.name == "api-artifact" + }); + + await Promise.all(matchArtifacts.map(async (artifact) => { + let download = await github.rest.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: artifact.id, + archive_format: 'zip', + }); + await fs.promises.writeFile(`${process.env.GITHUB_WORKSPACE}/${artifact.name}.zip`, Buffer.from(download.data)); + })); + + - name: unzip artifacts + run: |- + find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';' + ls -la + + - name: build autogen + run: |- + for name in $(echo $api_json_names) + do + checksum=$(mktemp) + mv $name packages/misskey-js/generator/api.json + + cd packages/misskey-js/generator + pnpm run generate + find built -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum + cd ../../.. + cp $checksum ${name}_checksum + done + + - name: check update for type definitions + run: diff $(echo -n ${api_json_names} | awk -v RS=" " '{ printf "%s_checksum ", $0 }') + + - name: send message + if: failure() + uses: thollander/actions-comment-pull-request@v2 + with: + comment_tag: check-misskey-js-autogen + message: |- + Thank you for sending us a great Pull Request! ๐Ÿ‘ + Please regenerate misskey-js type definitions! ๐Ÿ™ + + example: + ```sh + pnpm run build-misskey-js-with-types + ``` + + - name: send message + if: success() + uses: thollander/actions-comment-pull-request@v2 + with: + comment_tag: check-misskey-js-autogen + mode: delete + message: "Thank you!" From 12142a221a63d49a5d54c05975770be9b742d400 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: Sun, 14 Jan 2024 15:31:11 +0900 Subject: [PATCH 2/5] =?UTF-8?q?enhance(frontend):=20Play=E3=81=AE=E8=AA=AC?= =?UTF-8?q?=E6=98=8E=E6=AC=84=E3=81=ABMFM=E3=82=92=E4=BD=BF=E3=81=88?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#12899)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * (enhance) Playใฎ่ชฌๆ˜Žๆฌ„ใซMFMใ‚’ไฝฟใˆใ‚‹ใ‚ˆใ†ใซ * Update Changelog * use class for mfm component * Update packages/frontend/src/pages/flash/flash-edit.vue Co-authored-by: 1Step621 <86859447+1STEP621@users.noreply.github.com> * Update flash.vue * Update CHANGELOG.md --------- Co-authored-by: 1Step621 <86859447+1STEP621@users.noreply.github.com> --- CHANGELOG.md | 1 + packages/frontend/src/components/MkFlashPreview.vue | 10 +++++++++- packages/frontend/src/pages/flash/flash-edit.vue | 2 +- packages/frontend/src/pages/flash/flash.vue | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6747c9fce2..2518eebed2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Enhance: AiScriptใ‚’0.17.0ใซๆ›ดๆ–ฐใ€€[CHANGELOG](https://github.com/aiscript-dev/aiscript/blob/bb89d132b633a622d3cb0eff0d0cc7e476c0cfdd/CHANGELOG.md) - ้…ๅˆ—ใฎ็ฏ„ๅ›ฒๅค–ใƒป้žๆ•ดๆ•ฐใฎใ‚คใƒณใƒ‡ใƒƒใ‚ฏใ‚นใธใฎไปฃๅ…ฅใŒๅฎŒๅ…จ็ฆๆญขใซใชใ‚‹ใฎใงๆณจๆ„ - Enhance: ็ตตๆ–‡ๅญ—ใƒ”ใƒƒใ‚ซใƒผใƒปใ‚ชใƒผใƒˆใ‚ณใƒณใƒ—ใƒชใƒผใƒˆใงใ€ๅฎŒๅ…จไธ€่‡ดใ—ใŸ็ตตๆ–‡ๅญ—ใ‚’ๅ„ชๅ…ˆ็š„ใซ่กจ็คบใ™ใ‚‹ใ‚ˆใ†ใซ +- Enhance: Playใฎ่ชฌๆ˜Žๆฌ„ใซMFMใ‚’ไฝฟใˆใ‚‹ใ‚ˆใ†ใซ - Fix: ใƒใ‚คใƒ†ใ‚ฃใƒ–ใƒขใƒผใƒ‰ใฎ็ตตๆ–‡ๅญ—ใŒใƒขใƒŽใ‚ฏใƒญใซใชใ‚‰ใชใ„ใ‚ˆใ†ใซ - Fix: v2023.12.0ใง่ฟฝๅŠ ใ•ใ‚ŒใŸใ€Œใƒขใƒ‡ใƒฌใƒผใ‚ฟใƒผใŒใƒฆใƒผใ‚ถใƒผใฎใ‚ขใ‚คใ‚ณใƒณใ‚‚ใ—ใใฏใƒใƒŠใƒผ็”ปๅƒใ‚’ๆœช่จญๅฎš็Šถๆ…‹ใซใงใใ‚‹ๆฉŸ่ƒฝใ€ใŒ็ฎก็†็”ป้ขไธŠใงๆญฃใ—ใ่กจ็คบใ•ใ‚Œใฆใ„ใชใ„ๅ•้กŒใ‚’ไฟฎๆญฃ - Fix: AiScriptใฎ`readline`้–ขๆ•ฐใŒไธๆญฃใชๅ€คใ‚’่ฟ”ใ™ใ“ใจใŒใ‚ใ‚‹ๅ•้กŒใฎv2023.12.0ๆ™‚็‚นใงใฎไฟฎๆญฃใŒPlayไปฅๅค–ใซ้ฉ็”จใ•ใ‚Œใฆใ„ใชใ„ใฎใ‚’ไฟฎๆญฃ diff --git a/packages/frontend/src/components/MkFlashPreview.vue b/packages/frontend/src/components/MkFlashPreview.vue index ab435585d9..1be8a6d8f7 100644 --- a/packages/frontend/src/components/MkFlashPreview.vue +++ b/packages/frontend/src/components/MkFlashPreview.vue @@ -9,7 +9,9 @@ SPDX-License-Identifier: AGPL-3.0-only

{{ flash.title }}

-

{{ flash.summary.length > 85 ? flash.summary.slice(0, 85) + 'โ€ฆ' : flash.summary }}

+

+ +