Skip to content

Commit

Permalink
use node 22, update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
u1-liquid committed Nov 22, 2024
1 parent 1bad669 commit 643019b
Show file tree
Hide file tree
Showing 18 changed files with 2,487 additions and 2,375 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/01_bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ body:
Examples:
* Installation Method or Hosting Service: docker compose, k8s/docker, systemd, "Misskey install shell script", development environment
* Misskey: 13.x.x
* Node: 20.x.x
* Node: 22.x.x
* PostgreSQL: 15.x.x
* Redis: 7.x.x
* OS and Architecture: Ubuntu 22.04.2 LTS aarch64
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

services:
postgres:
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

services:
postgres:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-misskey-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validate-api-json.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [22.x]

steps:
- uses: actions/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20
22
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax = docker/dockerfile:1.4

ARG NODE_VERSION=20
ARG NODE_VERSION=22

# build assets & compile TypeScript

Expand Down Expand Up @@ -75,7 +75,7 @@ ARG GID="991"

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ffmpeg tini curl libjemalloc-dev libjemalloc2 \
curl ffmpeg libjemalloc-dev libjemalloc2 tini \
&& ln -s /usr/lib/$(uname -m)-linux-gnu/libjemalloc.so.2 /usr/local/lib/libjemalloc.so \
&& corepack enable \
&& groupadd -g "${GID}" misskey \
Expand All @@ -101,7 +101,8 @@ COPY --chown=misskey:misskey --from=native-builder /misskey/packages/backend/bui
COPY --chown=misskey:misskey --from=native-builder /misskey/fluent-emojis /misskey/fluent-emojis
COPY --chown=misskey:misskey . ./

RUN corepack pack
RUN corepack install \
&& corepack pack

ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so
ENV MALLOC_CONF=background_thread:true,metadata_thp:auto,dirty_decay_ms:30000,muzzy_decay_ms:30000
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@
"cssnano": "7.0.6",
"execa": "9.5.1",
"js-yaml": "4.1.0",
"postcss": "8.4.47",
"postcss": "8.4.49",
"terser": "5.36.0",
"typescript": "5.6.3"
},
"devDependencies": {
"@types/node": "22.9.0",
"@types/node": "22.9.1",
"@typescript-eslint/eslint-plugin": "7.10.0",
"@typescript-eslint/parser": "7.10.0",
"cross-env": "7.0.3",
"cypress": "13.15.2",
"cypress": "13.16.0",
"eslint": "8.57.1",
"ncp": "2.0.0",
"start-server-and-test": "2.0.8"
Expand Down
64 changes: 32 additions & 32 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@
"generate-api-json": "pnpm build && node ./scripts/generate_api_json.js"
},
"optionalDependencies": {
"@swc/core-darwin-arm64": "1.9.1",
"@swc/core-darwin-x64": "1.9.1",
"@swc/core-linux-arm-gnueabihf": "1.9.1",
"@swc/core-linux-arm64-gnu": "1.9.1",
"@swc/core-linux-arm64-musl": "1.9.1",
"@swc/core-linux-x64-gnu": "1.9.1",
"@swc/core-linux-x64-musl": "1.9.1",
"@swc/core-win32-arm64-msvc": "1.9.1",
"@swc/core-win32-ia32-msvc": "1.9.1",
"@swc/core-win32-x64-msvc": "1.9.1",
"@swc/core-darwin-arm64": "1.9.3",
"@swc/core-darwin-x64": "1.9.3",
"@swc/core-linux-arm-gnueabihf": "1.9.3",
"@swc/core-linux-arm64-gnu": "1.9.3",
"@swc/core-linux-arm64-musl": "1.9.3",
"@swc/core-linux-x64-gnu": "1.9.3",
"@swc/core-linux-x64-musl": "1.9.3",
"@swc/core-win32-arm64-msvc": "1.9.3",
"@swc/core-win32-ia32-msvc": "1.9.3",
"@swc/core-win32-x64-msvc": "1.9.3",
"@tensorflow/tfjs": "4.22.0",
"@tensorflow/tfjs-node": "4.22.0",
"bufferutil": "4.0.8",
Expand All @@ -64,34 +64,34 @@
},
"dependencies": {
"@authenio/samlify-node-xmllint": "2.0.0",
"@aws-sdk/client-s3": "3.687.0",
"@aws-sdk/lib-storage": "3.687.0",
"@bull-board/api": "6.3.3",
"@bull-board/fastify": "6.3.3",
"@bull-board/ui": "6.3.3",
"@aws-sdk/client-s3": "3.698.0",
"@aws-sdk/lib-storage": "3.698.0",
"@bull-board/api": "6.5.3",
"@bull-board/fastify": "6.5.3",
"@bull-board/ui": "6.5.3",
"@discordapp/twemoji": "15.1.0",
"@elastic/elasticsearch": "8.15.1",
"@elastic/elasticsearch": "8.16.2",
"@fastify/accepts": "5.0.1",
"@fastify/cookie": "11.0.1",
"@fastify/cors": "10.0.1",
"@fastify/express": "4.0.1",
"@fastify/formbody": "8.0.1",
"@fastify/http-proxy": "10.0.1",
"@fastify/multipart": "9.0.1",
"@fastify/static": "8.0.2",
"@fastify/static": "8.0.3",
"@fastify/view": "10.0.1",
"@misskey-dev/sharp-read-bmp": "1.2.0",
"@misskey-dev/summaly": "MisskeyIO/summaly#5.1.1",
"@napi-rs/canvas": "0.1.60",
"@nestjs/common": "10.4.7",
"@nestjs/core": "10.4.7",
"@nestjs/testing": "10.4.7",
"@napi-rs/canvas": "0.1.62",
"@nestjs/common": "10.4.8",
"@nestjs/core": "10.4.8",
"@nestjs/testing": "10.4.8",
"@peertube/http-signature": "1.7.0",
"@simplewebauthn/server": "11.0.0",
"@sinonjs/fake-timers": "11.3.1",
"@smithy/node-http-handler": "3.2.5",
"@swc/cli": "0.5.0",
"@swc/core": "1.9.1",
"@smithy/node-http-handler": "3.3.1",
"@swc/cli": "0.5.1",
"@swc/core": "1.9.3",
"@twemoji/parser": "15.1.1",
"accepts": "1.3.8",
"ajv": "8.17.1",
Expand All @@ -100,7 +100,7 @@
"bcryptjs": "2.4.3",
"blurhash": "2.0.5",
"body-parser": "1.20.3",
"bullmq": "5.25.2",
"bullmq": "5.29.0",
"cacheable-lookup": "7.0.0",
"cbor": "10.0.3",
"chalk": "5.3.0",
Expand All @@ -119,7 +119,7 @@
"fluent-ffmpeg": "2.1.3",
"form-data": "4.0.1",
"got": "14.4.4",
"happy-dom": "15.11.0",
"happy-dom": "15.11.6",
"hpagent": "1.2.0",
"htmlescape": "1.1.1",
"http-link-header": "1.1.3",
Expand Down Expand Up @@ -150,11 +150,11 @@
"oauth2orize": "1.12.0",
"oauth2orize-pkce": "0.1.2",
"os-utils": "0.0.14",
"otpauth": "9.3.4",
"otpauth": "9.3.5",
"parse5": "7.2.1",
"pg": "8.13.1",
"pino": "9.5.0",
"pino-pretty": "12.0.0",
"pino-pretty": "13.0.0",
"pkce-challenge": "4.1.0",
"probe-image-size": "7.2.3",
"promise-limit": "2.7.0",
Expand All @@ -171,7 +171,7 @@
"rxjs": "7.8.1",
"samlify": "2.8.11",
"sanitize-html": "2.13.1",
"secure-json-parse": "2.7.0",
"secure-json-parse": "3.0.1",
"sharp": "0.33.5",
"slacc": "0.0.10",
"strict-event-emitter-types": "2.0.0",
Expand All @@ -193,7 +193,7 @@
"devDependencies": {
"@jest/globals": "29.7.0",
"@misskey-dev/eslint-plugin": "1.0.0",
"@nestjs/platform-express": "10.4.7",
"@nestjs/platform-express": "10.4.8",
"@simplewebauthn/types": "11.0.0",
"@swc/jest": "0.2.37",
"@types/accepts": "1.3.7",
Expand All @@ -212,9 +212,9 @@
"@types/jsrsasign": "10.5.14",
"@types/mime-types": "2.1.4",
"@types/ms": "0.7.34",
"@types/node": "22.9.0",
"@types/node": "22.9.1",
"@types/node-forge": "1.3.11",
"@types/nodemailer": "6.4.16",
"@types/nodemailer": "6.4.17",
"@types/oauth": "0.9.6",
"@types/oauth2orize": "1.11.5",
"@types/oauth2orize-pkce": "0.1.2",
Expand Down
10 changes: 5 additions & 5 deletions packages/backend/src/misc/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ export class Queues<DataType = any, ResultType = any, NameType extends string =
this.queues = queues;
}

getRandomQueue(): Bull.Queue<DataType, ResultType, NameType> {
get randomQueue(): Bull.Queue<DataType, ResultType, NameType> {
return this.queues[Math.floor(Math.random() * this.queues.length)];
}

add(name: NameType, data: DataType, opts?: Bull.JobsOptions): Promise<Bull.Job<DataType, ResultType, NameType>> {
return this.getRandomQueue().add(name, data, opts);
return this.randomQueue.add(name, data, opts);
}

async addBulk(jobs: { name: NameType; data: DataType; opts?: Bull.BulkJobOptions }[]): Promise<Bull.Job<DataType, ResultType, NameType>[]> {
Expand All @@ -30,7 +30,7 @@ export class Queues<DataType = any, ResultType = any, NameType extends string =
}

async getDelayed(start?: number, end?: number): Promise<Bull.Job<DataType, ResultType, NameType>[]> {
return (await Promise.allSettled(this.queues.map(queue => queue.getDelayed(start, end))))
return (await Promise.allSettled(this.queues.map(queue => queue.getDelayed(start, end) as Promise<Bull.Job<DataType, ResultType, NameType>[]>)))
.filter((value): value is PromiseFulfilledResult<Bull.Job<DataType, ResultType, NameType>[]> => value.status === 'fulfilled')
.flatMap(value => value.value);
}
Expand All @@ -46,7 +46,7 @@ export class Queues<DataType = any, ResultType = any, NameType extends string =
}, {} as Record<string, number>);
}

once<U extends keyof Bull.QueueListener<DataType, ResultType, NameType>>(event: U, listener: Bull.QueueListener<DataType, ResultType, NameType>[U]): void {
once<U extends keyof Bull.QueueListener<Bull.Job<DataType, ResultType, NameType>>>(event: U, listener: Bull.QueueListener<Bull.Job<DataType, ResultType, NameType>>[U]): void {
const e = new EventEmitter();
e.once(event, listener);

Expand All @@ -62,7 +62,7 @@ export class Queues<DataType = any, ResultType = any, NameType extends string =
}

async getJobs(types?: Bull.JobType[] | Bull.JobType, start?: number, end?: number, asc?: boolean): Promise<Bull.Job<DataType, ResultType, NameType>[]> {
return (await Promise.allSettled(this.queues.map(queue => queue.getJobs(types, start, end, asc))))
return (await Promise.allSettled(this.queues.map(queue => queue.getJobs(types, start, end, asc) as Promise<Bull.Job<DataType, ResultType, NameType>[]>)))
.filter((value): value is PromiseFulfilledResult<Bull.Job<DataType, ResultType, NameType>[]> => value.status === 'fulfilled')
.flatMap(value => value.value);
}
Expand Down
Loading

0 comments on commit 643019b

Please sign in to comment.