Skip to content

Commit

Permalink
Revert "2024.5월 업데이트 분 (#3)"
Browse files Browse the repository at this point in the history
This reverts commit a953dcf.
  • Loading branch information
jbblily committed Jun 7, 2024
1 parent a953dcf commit e40be41
Show file tree
Hide file tree
Showing 497 changed files with 16,497 additions and 28,889 deletions.
19 changes: 2 additions & 17 deletions .config/docker_example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ redis:
# ┌───────────────────────────┐
#───┘ MeiliSearch configuration └─────────────────────────────

# You can set scope to local (default value) or global
# You can set scope to local (default value) or global
# (include notes from remote).

#meilisearch:
Expand Down Expand Up @@ -136,21 +136,6 @@ redis:

id: 'aidx'

# ┌────────────────┐
#───┘ Error tracking └──────────────────────────────────────────

# Sentry is available for error tracking.
# See the Sentry documentation for more details on options.

#sentryForBackend:
# enableNodeProfiling: true
# options:
# dsn: 'https://[email protected]/0'

#sentryForFrontend:
# options:
# dsn: 'https://[email protected]/0'

# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

Expand Down Expand Up @@ -200,7 +185,7 @@ proxyRemoteFiles: true
signToActivityPubGet: true

# For security reasons, uploading attachments from the intranet is prohibited,
# but exceptions can be made from the following settings. Default value is "undefined".
# but exceptions can be made from the following settings. Default value is "undefined".
# Read changelog to learn more (Improvements of 12.90.0 (2021/09/04)).
#allowedPrivateNetworks: [
# '127.0.0.1/32'
Expand Down
17 changes: 1 addition & 16 deletions .config/example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
# Option 3: If neither of the above applies to you.
# (In this case, the source code should be published
# on the Misskey interface. IT IS NOT ENOUGH TO
# DISCLOSE THE SOURCE CODE WHEN A USER REQUESTS IT BY
# DISCLOSE THE SOURCE CODE WEHN A USER REQUESTS IT BY
# E-MAIL OR OTHER MEANS. If you are not satisfied
# with this, it is recommended that you read the
# license again carefully. Anyway, enabling this
Expand Down Expand Up @@ -205,21 +205,6 @@ redis:

id: 'aidx'

# ┌────────────────┐
#───┘ Error tracking └──────────────────────────────────────────

# Sentry is available for error tracking.
# See the Sentry documentation for more details on options.

#sentryForBackend:
# enableNodeProfiling: true
# options:
# dsn: 'https://[email protected]/0'

#sentryForFrontend:
# options:
# dsn: 'https://[email protected]/0'

# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

Expand Down
9 changes: 6 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"service": "app",
"workspaceFolder": "/workspace",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "20.12.2"
"ghcr.io/devcontainers-contrib/features/pnpm:2": {
"version": "8.9.2"
},
"ghcr.io/devcontainers-contrib/features/corepack:1": {}
"ghcr.io/devcontainers/features/node:1": {
"version": "20.10.0"
}
},
"forwardPorts": [3000],
"postCreateCommand": "sudo chmod 755 .devcontainer/init.sh && .devcontainer/init.sh",
Expand All @@ -17,6 +19,7 @@
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"Vue.volar",
"Vue.vscode-typescript-vue-plugin",
"Orta.vscode-jest",
"dbaeumer.vscode-eslint",
"mrmlnc.vscode-json5"
Expand Down
15 changes: 0 additions & 15 deletions .devcontainer/devcontainer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,21 +132,6 @@ redis:

id: 'aidx'

# ┌────────────────┐
#───┘ Error tracking └──────────────────────────────────────────

# Sentry is available for error tracking.
# See the Sentry documentation for more details on options.

#sentryForBackend:
# enableNodeProfiling: true
# options:
# dsn: 'https://[email protected]/0'

#sentryForFrontend:
# options:
# dsn: 'https://[email protected]/0'

# ┌─────────────────────┐
#───┘ Other configuration └─────────────────────────────────────

Expand Down
2 changes: 0 additions & 2 deletions .devcontainer/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ set -xe

sudo chown -R node /workspace
git submodule update --init
corepack install
corepack enable
pnpm config set store-dir /home/node/.local/share/pnpm/store
pnpm install --frozen-lockfile
cp .devcontainer/devcontainer.yml .config/default.yml
Expand Down
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

patreon: syuilo
147 changes: 74 additions & 73 deletions .github/workflows/check-misskey-js-autogen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,29 @@ on:
branches:
- master
- develop
- improve-misskey-js-autogen-check
paths:
- packages/backend/**

jobs:
# pull_request_target safety: permissions: read-all, and there are no secrets used in this job
generate-misskey-js:
check-misskey-js-autogen:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }}
pull-requests: write

env:
api_json_name: "api-head.json"

steps:
- name: checkout
uses: actions/[email protected]
with:
submodules: true
ref: refs/pull/${{ github.event.pull_request.number }}/merge
ref: ${{ github.event.pull_request.head.sha }}

- name: setup pnpm
uses: pnpm/action-setup@v4
uses: pnpm/action-setup@v3
with:
version: 8

- name: setup node
id: setup-node
Expand All @@ -36,81 +39,79 @@ jobs:
- name: install dependencies
run: pnpm i --frozen-lockfile

# generate api.json
- name: Copy Config
run: cp .config/example.yml .config/default.yml
- name: Build
run: pnpm build
- name: Generate API JSON
run: pnpm --filter backend generate-api-json

# build misskey js
- name: Build misskey-js
run: |-
cp packages/backend/built/api.json packages/misskey-js/generator/api.json
pnpm run --filter misskey-js-type-generator generate
# packages/misskey-js/generator/built/autogen
- name: Upload Generated
uses: actions/upload-artifact@v4
with:
name: generated-misskey-js
path: packages/misskey-js/generator/built/autogen

# pull_request_target safety: permissions: read-all, and there are no secrets used in this job
get-actual-misskey-js:
runs-on: ubuntu-latest
permissions:
contents: read
if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }}
steps:
- name: checkout
uses: actions/[email protected]
- name: wait get-api-diff
uses: lewagon/[email protected]
with:
submodules: true
ref: refs/pull/${{ github.event.pull_request.number }}/merge
ref: ${{ github.event.pull_request.head.sha }}
check-regexp: get-from-misskey .+
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30

- name: Upload From Merged
uses: actions/upload-artifact@v4
- name: Download artifact
uses: actions/[email protected]
with:
name: actual-misskey-js
path: packages/misskey-js/src/autogen
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
# pull_request_target safety: nothing is cloned from repository
comment-misskey-js-autogen:
runs-on: ubuntu-latest
needs: [generate-misskey-js, get-actual-misskey-js]
permissions:
pull-requests: write
steps:
- name: download generated-misskey-js
uses: actions/download-artifact@v4
with:
name: generated-misskey-js
path: misskey-js-generated
- name: get head checksum
run: |-
checksum=$(realpath head_checksum)
- name: download actual-misskey-js
uses: actions/download-artifact@v4
with:
name: actual-misskey-js
path: misskey-js-actual
cd packages/misskey-js/src
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
cd ../../..
- name: check misskey-js changes
id: check-changes
run: |
diff -r -u --label=generated --label=on-tree ./misskey-js-generated ./misskey-js-actual > misskey-js.diff || true
- name: build autogen
run: |-
checksum=$(realpath ${api_json_name}_checksum)
mv $api_json_name packages/misskey-js/generator/api.json
if [ -s misskey-js.diff ]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
cd packages/misskey-js/generator
pnpm run generate
cd built
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum
cd ../../../..
- name: Print full diff
run: cat ./misskey-js.diff
- name: check update for type definitions
run: diff head_checksum ${api_json_name}_checksum

- name: send message
if: steps.check-changes.outputs.changes == 'true'
if: failure()
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: check-misskey-js-autogen
Expand All @@ -124,7 +125,7 @@ jobs:
```
- name: send message
if: steps.check-changes.outputs.changes == 'false'
if: success()
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: check-misskey-js-autogen
Expand Down
75 changes: 0 additions & 75 deletions .github/workflows/check-spdx-license-id.yml

This file was deleted.

Loading

0 comments on commit e40be41

Please sign in to comment.