From 29f6ba6310e162d6e24c9075ddd6176c155a10e7 Mon Sep 17 00:00:00 2001 From: zyoshoka <107108195+zyoshoka@users.noreply.github.com> Date: Wed, 13 Mar 2024 22:37:18 +0900 Subject: chore: add missing SPDX ID and workflow check (#13570) * chore: add workflow which checks if SPDX ID exists * chore: add missing SPDX ID in some files * chore: change trigger condition * chore: trigger on push * lint --- scripts/changelog-checker/src/checker.ts | 5 +++++ scripts/changelog-checker/src/index.ts | 5 +++++ scripts/changelog-checker/src/parser.ts | 5 +++++ scripts/changelog-checker/test/checker.test.ts | 7 ++++++- scripts/tarball.mjs | 5 +++++ 5 files changed, 26 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/changelog-checker/src/checker.ts b/scripts/changelog-checker/src/checker.ts index bbd5b2270a..8fd6ff5629 100644 --- a/scripts/changelog-checker/src/checker.ts +++ b/scripts/changelog-checker/src/checker.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Release } from './parser.js'; export class Result { diff --git a/scripts/changelog-checker/src/index.ts b/scripts/changelog-checker/src/index.ts index 8cbeb297d9..0e2c5ce057 100644 --- a/scripts/changelog-checker/src/index.ts +++ b/scripts/changelog-checker/src/index.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + import * as process from 'process'; import * as fs from 'fs'; import { parseChangeLog } from './parser.js'; diff --git a/scripts/changelog-checker/src/parser.ts b/scripts/changelog-checker/src/parser.ts index d6a9ddeda8..894d60d6af 100644 --- a/scripts/changelog-checker/src/parser.ts +++ b/scripts/changelog-checker/src/parser.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + import * as fs from 'node:fs'; import { unified } from 'unified'; import remarkParse from 'remark-parse'; diff --git a/scripts/changelog-checker/test/checker.test.ts b/scripts/changelog-checker/test/checker.test.ts index bc73e5622b..9ca8fa85f2 100644 --- a/scripts/changelog-checker/test/checker.test.ts +++ b/scripts/changelog-checker/test/checker.test.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + import {expect, suite, test} from "vitest"; import {Release, ReleaseCategory} from "../src/parser"; import {checkNewRelease, checkNewTopic} from "../src/checker"; @@ -411,4 +416,4 @@ suite('checkNewTopic', () => { console.log(result.message) expect(result.success).toBe(false) }) -}) \ No newline at end of file +}) diff --git a/scripts/tarball.mjs b/scripts/tarball.mjs index 936a43d270..b1862ad289 100644 --- a/scripts/tarball.mjs +++ b/scripts/tarball.mjs @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: syuilo and misskey-project + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { createWriteStream } from 'node:fs'; import { mkdir } from 'node:fs/promises'; import { resolve } from 'node:path'; -- cgit v1.2.3-freya From 2a851437ffcd8778d157a6841875f03330c994b5 Mon Sep 17 00:00:00 2001 From: おさむのひと <46447427+samunohito@users.noreply.github.com> Date: Sat, 30 Mar 2024 15:28:19 +0900 Subject: fix: misskey-js、bubble-game、reversiのビルドをesbuildに統合する (#13600) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: ビルドが遅いパッケージのビルド速度を改善 * dependenciesの整理 * fix ci * ビルド開始時に古いファイルを消す * fix ci * fix ci --- .github/workflows/lint.yml | 2 +- package.json | 4 +- packages/backend/.swcrc | 3 +- packages/misskey-bubble-game/.eslintignore | 1 + packages/misskey-bubble-game/build.js | 114 ++++++++++++++--- packages/misskey-bubble-game/package.json | 26 ++-- packages/misskey-bubble-game/src/index.ts | 6 +- packages/misskey-bubble-game/tsconfig.json | 2 +- packages/misskey-js/.eslintignore | 1 + packages/misskey-js/api-extractor.json | 2 +- packages/misskey-js/build.js | 105 ++++++++++++++++ packages/misskey-js/package.json | 29 ++--- packages/misskey-js/src/api.ts | 2 +- packages/misskey-js/src/index.ts | 15 ++- packages/misskey-js/tsconfig.json | 2 +- packages/misskey-reversi/.eslintignore | 1 + packages/misskey-reversi/build.js | 114 ++++++++++++++--- packages/misskey-reversi/package.json | 26 ++-- packages/misskey-reversi/tsconfig.json | 2 +- pnpm-lock.yaml | 188 ++++++----------------------- scripts/dev.mjs | 59 ++++----- 21 files changed, 422 insertions(+), 282 deletions(-) create mode 100644 packages/misskey-js/build.js (limited to 'scripts') diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 31e974edaa..9b3f85fe1d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -92,6 +92,6 @@ jobs: - run: pnpm i --frozen-lockfile - run: pnpm --filter misskey-js run build if: ${{ matrix.workspace == 'backend' }} - - run: pnpm --filter misskey-reversi run build:tsc + - run: pnpm --filter misskey-reversi run build if: ${{ matrix.workspace == 'backend' }} - run: pnpm --filter ${{ matrix.workspace }} run typecheck diff --git a/package.json b/package.json index 8f5ab0b124..84d6db5124 100644 --- a/package.json +++ b/package.json @@ -56,7 +56,9 @@ "postcss": "8.4.35", "tar": "6.2.0", "terser": "5.28.1", - "typescript": "5.3.3" + "typescript": "5.3.3", + "esbuild": "0.19.11", + "glob": "10.3.10" }, "devDependencies": { "@types/node": "^20.11.28", diff --git a/packages/backend/.swcrc b/packages/backend/.swcrc index 0504a2d389..845190b5f4 100644 --- a/packages/backend/.swcrc +++ b/packages/backend/.swcrc @@ -19,5 +19,6 @@ }, "target": "es2022" }, - "minify": false + "minify": false, + "sourceMaps": "inline" } diff --git a/packages/misskey-bubble-game/.eslintignore b/packages/misskey-bubble-game/.eslintignore index f22128f047..52ea8b3362 100644 --- a/packages/misskey-bubble-game/.eslintignore +++ b/packages/misskey-bubble-game/.eslintignore @@ -5,3 +5,4 @@ node_modules /jest.config.ts /test /test-d +build.js diff --git a/packages/misskey-bubble-game/build.js b/packages/misskey-bubble-game/build.js index 4744dfaf7b..0b79f4b915 100644 --- a/packages/misskey-bubble-game/build.js +++ b/packages/misskey-bubble-game/build.js @@ -1,31 +1,105 @@ +import * as esbuild from "esbuild"; import { build } from "esbuild"; import { globSync } from "glob"; +import { execa } from "execa"; +import fs from "node:fs"; +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const _filename = fileURLToPath(import.meta.url); +const _dirname = dirname(_filename); +const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); const entryPoints = globSync("./src/**/**.{ts,tsx}"); /** @type {import('esbuild').BuildOptions} */ const options = { - entryPoints, - minify: true, - outdir: "./built/esm", - target: "es2022", - platform: "browser", - format: "esm", + entryPoints, + minify: process.env.NODE_ENV === 'production', + outdir: "./built", + target: "es2022", + platform: "browser", + format: "esm", + sourcemap: 'linked', }; -if (process.env.WATCH === "true") { - options.watch = { - onRebuild(error, result) { - if (error) { - console.error("watch build failed:", error); - } else { - console.log("watch build succeeded:", result); - } - }, - }; +// built配下をすべて削除する +fs.rmSync('./built', { recursive: true, force: true }); + +if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) { + await watchSrc(); +} else { + await buildSrc(); +} + +async function buildSrc() { + console.log(`[${_package.name}] start building...`); + + await build(options) + .then(it => { + console.log(`[${_package.name}] build succeeded.`); + }) + .catch((err) => { + process.stderr.write(err.stderr); + process.exit(1); + }); + + if (process.env.NODE_ENV === 'production') { + console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); + } else { + await buildDts(); + } + + console.log(`[${_package.name}] finish building.`); } -build(options).catch((err) => { - process.stderr.write(err.stderr); - process.exit(1); -}); +function buildDts() { + return execa( + 'tsc', + [ + '--project', 'tsconfig.json', + '--outDir', 'built', + '--declaration', 'true', + '--emitDeclarationOnly', 'true', + ], + { + stdout: process.stdout, + stderr: process.stderr, + } + ); +} + +async function watchSrc() { + const plugins = [{ + name: 'gen-dts', + setup(build) { + build.onStart(() => { + console.log(`[${_package.name}] detect changed...`); + }); + build.onEnd(async result => { + if (result.errors.length > 0) { + console.error(`[${_package.name}] watch build failed:`, result); + return; + } + await buildDts(); + }); + }, + }]; + + console.log(`[${_package.name}] start watching...`) + + const context = await esbuild.context({ ...options, plugins }); + await context.watch(); + + await new Promise((resolve, reject) => { + process.on('SIGHUP', resolve); + process.on('SIGINT', resolve); + process.on('SIGTERM', resolve); + process.on('SIGKILL', resolve); + process.on('uncaughtException', reject); + process.on('exit', resolve); + }).finally(async () => { + await context.dispose(); + console.log(`[${_package.name}] finish watching.`); + }); +} diff --git a/packages/misskey-bubble-game/package.json b/packages/misskey-bubble-game/package.json index ddc4c2134b..a3aad147a9 100644 --- a/packages/misskey-bubble-game/package.json +++ b/packages/misskey-bubble-game/package.json @@ -2,24 +2,21 @@ "type": "module", "name": "misskey-bubble-game", "version": "0.0.1", - "types": "./built/dts/index.d.ts", + "main": "./built/index.js", + "types": "./built/index.d.ts", "exports": { ".": { - "import": "./built/esm/index.js", - "types": "./built/dts/index.d.ts" + "import": "./built/index.js", + "types": "./built/index.d.ts" }, "./*": { - "import": "./built/esm/*", - "types": "./built/dts/*" + "import": "./built/*", + "types": "./built/*" } }, "scripts": { "build": "node ./build.js", - "build:tsc": "npm run tsc", - "tsc": "npm run tsc-esm && npm run tsc-dts", - "tsc-esm": "tsc --outDir built/esm", - "tsc-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", - "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build:tsc\"", + "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" @@ -27,21 +24,22 @@ "devDependencies": { "@misskey-dev/eslint-plugin": "1.0.0", "@types/matter-js": "0.19.6", - "@types/node": "20.11.5", "@types/seedrandom": "3.0.8", + "@types/node": "20.11.5", "@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/parser": "7.1.0", "eslint": "8.57.0", "nodemon": "3.0.2", - "typescript": "5.3.3" + "execa": "8.0.1", + "typescript": "5.3.3", + "esbuild": "0.19.11", + "glob": "10.3.10" }, "files": [ "built" ], "dependencies": { - "esbuild": "0.19.11", "eventemitter3": "5.0.1", - "glob": "^10.3.10", "matter-js": "0.19.0", "seedrandom": "3.0.5" } diff --git a/packages/misskey-bubble-game/src/index.ts b/packages/misskey-bubble-game/src/index.ts index 004a7d008e..c5f1f68062 100644 --- a/packages/misskey-bubble-game/src/index.ts +++ b/packages/misskey-bubble-game/src/index.ts @@ -6,5 +6,9 @@ import { DropAndFusionGame, Mono } from './game.js'; export { - DropAndFusionGame, Mono, + DropAndFusionGame, +}; + +export type { + Mono, }; diff --git a/packages/misskey-bubble-game/tsconfig.json b/packages/misskey-bubble-game/tsconfig.json index f56b65e868..6e34e332e0 100644 --- a/packages/misskey-bubble-game/tsconfig.json +++ b/packages/misskey-bubble-game/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, - "sourceMap": true, + "sourceMap": false, "outDir": "./built/", "removeComments": true, "strict": true, diff --git a/packages/misskey-js/.eslintignore b/packages/misskey-js/.eslintignore index f22128f047..52ea8b3362 100644 --- a/packages/misskey-js/.eslintignore +++ b/packages/misskey-js/.eslintignore @@ -5,3 +5,4 @@ node_modules /jest.config.ts /test /test-d +build.js diff --git a/packages/misskey-js/api-extractor.json b/packages/misskey-js/api-extractor.json index f80d0f20a8..a95281a6d5 100644 --- a/packages/misskey-js/api-extractor.json +++ b/packages/misskey-js/api-extractor.json @@ -45,7 +45,7 @@ * * SUPPORTED TOKENS: , , */ - "mainEntryPointFilePath": "/built/dts/index.d.ts", + "mainEntryPointFilePath": "/built/index.d.ts", /** * A list of NPM package names whose exports should be treated as part of this package. diff --git a/packages/misskey-js/build.js b/packages/misskey-js/build.js new file mode 100644 index 0000000000..0b79f4b915 --- /dev/null +++ b/packages/misskey-js/build.js @@ -0,0 +1,105 @@ +import * as esbuild from "esbuild"; +import { build } from "esbuild"; +import { globSync } from "glob"; +import { execa } from "execa"; +import fs from "node:fs"; +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const _filename = fileURLToPath(import.meta.url); +const _dirname = dirname(_filename); +const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); + +const entryPoints = globSync("./src/**/**.{ts,tsx}"); + +/** @type {import('esbuild').BuildOptions} */ +const options = { + entryPoints, + minify: process.env.NODE_ENV === 'production', + outdir: "./built", + target: "es2022", + platform: "browser", + format: "esm", + sourcemap: 'linked', +}; + +// built配下をすべて削除する +fs.rmSync('./built', { recursive: true, force: true }); + +if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) { + await watchSrc(); +} else { + await buildSrc(); +} + +async function buildSrc() { + console.log(`[${_package.name}] start building...`); + + await build(options) + .then(it => { + console.log(`[${_package.name}] build succeeded.`); + }) + .catch((err) => { + process.stderr.write(err.stderr); + process.exit(1); + }); + + if (process.env.NODE_ENV === 'production') { + console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); + } else { + await buildDts(); + } + + console.log(`[${_package.name}] finish building.`); +} + +function buildDts() { + return execa( + 'tsc', + [ + '--project', 'tsconfig.json', + '--outDir', 'built', + '--declaration', 'true', + '--emitDeclarationOnly', 'true', + ], + { + stdout: process.stdout, + stderr: process.stderr, + } + ); +} + +async function watchSrc() { + const plugins = [{ + name: 'gen-dts', + setup(build) { + build.onStart(() => { + console.log(`[${_package.name}] detect changed...`); + }); + build.onEnd(async result => { + if (result.errors.length > 0) { + console.error(`[${_package.name}] watch build failed:`, result); + return; + } + await buildDts(); + }); + }, + }]; + + console.log(`[${_package.name}] start watching...`) + + const context = await esbuild.context({ ...options, plugins }); + await context.watch(); + + await new Promise((resolve, reject) => { + process.on('SIGHUP', resolve); + process.on('SIGINT', resolve); + process.on('SIGTERM', resolve); + process.on('SIGKILL', resolve); + process.on('uncaughtException', reject); + process.on('exit', resolve); + }).finally(async () => { + await context.dispose(); + console.log(`[${_package.name}] finish watching.`); + }); +} diff --git a/packages/misskey-js/package.json b/packages/misskey-js/package.json index 772f001c07..a9c75c95c2 100644 --- a/packages/misskey-js/package.json +++ b/packages/misskey-js/package.json @@ -3,23 +3,21 @@ "name": "misskey-js", "version": "2024.3.1", "description": "Misskey SDK for JavaScript", - "types": "./built/dts/index.d.ts", + "main": "./built/index.js", + "types": "./built/index.d.ts", "exports": { ".": { - "import": "./built/esm/index.js", - "types": "./built/dts/index.d.ts" + "import": "./built/index.js", + "types": "./built/index.d.ts" }, "./*": { - "import": "./built/esm/*", - "types": "./built/dts/*" + "import": "./built/*", + "types": "./built/*" } }, "scripts": { - "build": "npm run ts", - "ts": "npm run ts-esm && npm run ts-dts", - "ts-esm": "tsc --outDir built/esm", - "ts-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", - "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run ts\"", + "build": "node ./build.js", + "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", "tsd": "tsd", "api": "pnpm api-extractor run --local --verbose", "api-prod": "pnpm api-extractor run --verbose", @@ -49,17 +47,16 @@ "mock-socket": "9.3.1", "ncp": "2.0.0", "nodemon": "3.1.0", + "execa": "8.0.1", "tsd": "0.30.7", - "typescript": "5.3.3" + "typescript": "5.3.3", + "esbuild": "0.19.11", + "glob": "10.3.10" }, "files": [ - "built", - "built/esm", - "built/dts" + "built" ], "dependencies": { - "@swc/cli": "0.1.63", - "@swc/core": "1.3.105", "eventemitter3": "5.0.1", "reconnecting-websocket": "4.4.0" } diff --git a/packages/misskey-js/src/api.ts b/packages/misskey-js/src/api.ts index 134ead0d79..959a634a74 100644 --- a/packages/misskey-js/src/api.ts +++ b/packages/misskey-js/src/api.ts @@ -3,7 +3,7 @@ import './autogen/apiClientJSDoc.js'; import { SwitchCaseResponseType } from './api.types.js'; import type { Endpoints } from './api.types.js'; -export { +export type { SwitchCaseResponseType, } from './api.types.js'; diff --git a/packages/misskey-js/src/index.ts b/packages/misskey-js/src/index.ts index 54cae8ec03..28007a8ade 100644 --- a/packages/misskey-js/src/index.ts +++ b/packages/misskey-js/src/index.ts @@ -1,17 +1,20 @@ -import { Endpoints } from './api.types.js'; +import { type Endpoints } from './api.types.js'; import Stream, { Connection } from './streaming.js'; -import { Channels } from './streaming.types.js'; -import { Acct } from './acct.js'; +import { type Channels } from './streaming.types.js'; +import { type Acct } from './acct.js'; import * as consts from './consts.js'; -export { +export type { Endpoints, - Stream, - Connection as ChannelConnection, Channels, Acct, }; +export { + Stream, + Connection as ChannelConnection, +}; + export const permissions = consts.permissions; export const notificationTypes = consts.notificationTypes; export const noteVisibilities = consts.noteVisibilities; diff --git a/packages/misskey-js/tsconfig.json b/packages/misskey-js/tsconfig.json index f56b65e868..6e34e332e0 100644 --- a/packages/misskey-js/tsconfig.json +++ b/packages/misskey-js/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, - "sourceMap": true, + "sourceMap": false, "outDir": "./built/", "removeComments": true, "strict": true, diff --git a/packages/misskey-reversi/.eslintignore b/packages/misskey-reversi/.eslintignore index f22128f047..52ea8b3362 100644 --- a/packages/misskey-reversi/.eslintignore +++ b/packages/misskey-reversi/.eslintignore @@ -5,3 +5,4 @@ node_modules /jest.config.ts /test /test-d +build.js diff --git a/packages/misskey-reversi/build.js b/packages/misskey-reversi/build.js index 4744dfaf7b..0b79f4b915 100644 --- a/packages/misskey-reversi/build.js +++ b/packages/misskey-reversi/build.js @@ -1,31 +1,105 @@ +import * as esbuild from "esbuild"; import { build } from "esbuild"; import { globSync } from "glob"; +import { execa } from "execa"; +import fs from "node:fs"; +import { fileURLToPath } from "node:url"; +import { dirname } from "node:path"; + +const _filename = fileURLToPath(import.meta.url); +const _dirname = dirname(_filename); +const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8')); const entryPoints = globSync("./src/**/**.{ts,tsx}"); /** @type {import('esbuild').BuildOptions} */ const options = { - entryPoints, - minify: true, - outdir: "./built/esm", - target: "es2022", - platform: "browser", - format: "esm", + entryPoints, + minify: process.env.NODE_ENV === 'production', + outdir: "./built", + target: "es2022", + platform: "browser", + format: "esm", + sourcemap: 'linked', }; -if (process.env.WATCH === "true") { - options.watch = { - onRebuild(error, result) { - if (error) { - console.error("watch build failed:", error); - } else { - console.log("watch build succeeded:", result); - } - }, - }; +// built配下をすべて削除する +fs.rmSync('./built', { recursive: true, force: true }); + +if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) { + await watchSrc(); +} else { + await buildSrc(); +} + +async function buildSrc() { + console.log(`[${_package.name}] start building...`); + + await build(options) + .then(it => { + console.log(`[${_package.name}] build succeeded.`); + }) + .catch((err) => { + process.stderr.write(err.stderr); + process.exit(1); + }); + + if (process.env.NODE_ENV === 'production') { + console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`); + } else { + await buildDts(); + } + + console.log(`[${_package.name}] finish building.`); } -build(options).catch((err) => { - process.stderr.write(err.stderr); - process.exit(1); -}); +function buildDts() { + return execa( + 'tsc', + [ + '--project', 'tsconfig.json', + '--outDir', 'built', + '--declaration', 'true', + '--emitDeclarationOnly', 'true', + ], + { + stdout: process.stdout, + stderr: process.stderr, + } + ); +} + +async function watchSrc() { + const plugins = [{ + name: 'gen-dts', + setup(build) { + build.onStart(() => { + console.log(`[${_package.name}] detect changed...`); + }); + build.onEnd(async result => { + if (result.errors.length > 0) { + console.error(`[${_package.name}] watch build failed:`, result); + return; + } + await buildDts(); + }); + }, + }]; + + console.log(`[${_package.name}] start watching...`) + + const context = await esbuild.context({ ...options, plugins }); + await context.watch(); + + await new Promise((resolve, reject) => { + process.on('SIGHUP', resolve); + process.on('SIGINT', resolve); + process.on('SIGTERM', resolve); + process.on('SIGKILL', resolve); + process.on('uncaughtException', reject); + process.on('exit', resolve); + }).finally(async () => { + await context.dispose(); + console.log(`[${_package.name}] finish watching.`); + }); +} diff --git a/packages/misskey-reversi/package.json b/packages/misskey-reversi/package.json index 7bfc890fef..45a6120861 100644 --- a/packages/misskey-reversi/package.json +++ b/packages/misskey-reversi/package.json @@ -2,24 +2,21 @@ "type": "module", "name": "misskey-reversi", "version": "0.0.1", - "types": "./built/dts/index.d.ts", + "main": "./built/index.js", + "types": "./built/index.d.ts", "exports": { ".": { - "import": "./built/esm/index.js", - "types": "./built/dts/index.d.ts" + "import": "./built/index.js", + "types": "./built/index.d.ts" }, "./*": { - "import": "./built/esm/*", - "types": "./built/dts/*" + "import": "./built/*", + "types": "./built/*" } }, "scripts": { "build": "node ./build.js", - "build:tsc": "npm run tsc", - "tsc": "npm run tsc-esm && npm run tsc-dts", - "tsc-esm": "tsc --outDir built/esm", - "tsc-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true", - "watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run build:tsc\"", + "watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"", "eslint": "eslint . --ext .js,.jsx,.ts,.tsx", "typecheck": "tsc --noEmit", "lint": "pnpm typecheck && pnpm eslint" @@ -30,15 +27,16 @@ "@typescript-eslint/eslint-plugin": "7.1.0", "@typescript-eslint/parser": "7.1.0", "eslint": "8.57.0", + "execa": "8.0.1", "nodemon": "3.0.2", - "typescript": "5.3.3" + "typescript": "5.3.3", + "esbuild": "0.19.11", + "glob": "10.3.10" }, "files": [ "built" ], "dependencies": { - "crc-32": "1.2.2", - "esbuild": "0.19.11", - "glob": "10.3.10" + "crc-32": "1.2.2" } } diff --git a/packages/misskey-reversi/tsconfig.json b/packages/misskey-reversi/tsconfig.json index f56b65e868..6e34e332e0 100644 --- a/packages/misskey-reversi/tsconfig.json +++ b/packages/misskey-reversi/tsconfig.json @@ -6,7 +6,7 @@ "moduleResolution": "nodenext", "declaration": true, "declarationMap": true, - "sourceMap": true, + "sourceMap": false, "outDir": "./built/", "removeComments": true, "strict": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 383b31b1f3..46512784c3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -15,12 +15,18 @@ importers: cssnano: specifier: 6.0.5 version: 6.0.5(postcss@8.4.35) + esbuild: + specifier: 0.19.11 + version: 0.19.11 execa: specifier: 8.0.1 version: 8.0.1 fast-glob: specifier: 3.3.2 version: 3.3.2 + glob: + specifier: 10.3.10 + version: 10.3.10 ignore-walk: specifier: 6.0.4 version: 6.0.4 @@ -1037,15 +1043,9 @@ importers: packages/misskey-bubble-game: dependencies: - esbuild: - specifier: 0.19.11 - version: 0.19.11 eventemitter3: specifier: 5.0.1 version: 5.0.1 - glob: - specifier: ^10.3.10 - version: 10.3.10 matter-js: specifier: 0.19.0 version: 0.19.0 @@ -1071,9 +1071,18 @@ importers: '@typescript-eslint/parser': specifier: 7.1.0 version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) + esbuild: + specifier: 0.19.11 + version: 0.19.11 eslint: specifier: 8.57.0 version: 8.57.0 + execa: + specifier: 8.0.1 + version: 8.0.1 + glob: + specifier: 10.3.10 + version: 10.3.10 nodemon: specifier: 3.0.2 version: 3.0.2 @@ -1083,12 +1092,6 @@ importers: packages/misskey-js: dependencies: - '@swc/cli': - specifier: 0.1.63 - version: 0.1.63(@swc/core@1.3.105) - '@swc/core': - specifier: 1.3.105 - version: 1.3.105 eventemitter3: specifier: 5.0.1 version: 5.0.1 @@ -1104,7 +1107,7 @@ importers: version: 1.0.0(@typescript-eslint/eslint-plugin@7.1.0)(@typescript-eslint/parser@7.1.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) '@swc/jest': specifier: 0.2.31 - version: 0.2.31(@swc/core@1.3.105) + version: 0.2.31(@swc/core@1.3.107) '@types/jest': specifier: 29.5.12 version: 29.5.12 @@ -1117,9 +1120,18 @@ importers: '@typescript-eslint/parser': specifier: 7.1.0 version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) + esbuild: + specifier: 0.19.11 + version: 0.19.11 eslint: specifier: 8.57.0 version: 8.57.0 + execa: + specifier: 8.0.1 + version: 8.0.1 + glob: + specifier: 10.3.10 + version: 10.3.10 jest: specifier: 29.7.0 version: 29.7.0(@types/node@20.11.22) @@ -1186,12 +1198,6 @@ importers: crc-32: specifier: 1.2.2 version: 1.2.2 - esbuild: - specifier: 0.19.11 - version: 0.19.11 - glob: - specifier: 10.3.10 - version: 10.3.10 devDependencies: '@misskey-dev/eslint-plugin': specifier: 1.0.0 @@ -1205,9 +1211,18 @@ importers: '@typescript-eslint/parser': specifier: 7.1.0 version: 7.1.0(eslint@8.57.0)(typescript@5.3.3) + esbuild: + specifier: 0.19.11 + version: 0.19.11 eslint: specifier: 8.57.0 version: 8.57.0 + execa: + specifier: 8.0.1 + version: 8.0.1 + glob: + specifier: 10.3.10 + version: 10.3.10 nodemon: specifier: 3.0.2 version: 3.0.2 @@ -6669,26 +6684,6 @@ packages: - supports-color dev: true - /@swc/cli@0.1.63(@swc/core@1.3.105): - resolution: {integrity: sha512-EM9oxxHzmmsprYRbGqsS2M4M/Gr5Gkcl0ROYYIdlUyTkhOiX822EQiRCpPCwdutdnzH2GyaTN7wc6i0Y+CKd3A==} - engines: {node: '>= 12.13'} - hasBin: true - peerDependencies: - '@swc/core': ^1.2.66 - chokidar: 3.5.3 - peerDependenciesMeta: - chokidar: - optional: true - dependencies: - '@mole-inc/bin-wrapper': 8.0.1 - '@swc/core': 1.3.105 - commander: 7.2.0 - fast-glob: 3.3.2 - semver: 7.5.4 - slash: 3.0.0 - source-map: 0.7.4 - dev: false - /@swc/cli@0.1.63(@swc/core@1.3.107)(chokidar@3.5.3): resolution: {integrity: sha512-EM9oxxHzmmsprYRbGqsS2M4M/Gr5Gkcl0ROYYIdlUyTkhOiX822EQiRCpPCwdutdnzH2GyaTN7wc6i0Y+CKd3A==} engines: {node: '>= 12.13'} @@ -6721,14 +6716,6 @@ packages: dev: false optional: true - /@swc/core-darwin-arm64@1.3.105: - resolution: {integrity: sha512-buWeweLVDXXmcnfIemH4PGnpjwsDTUGitnPchdftb0u1FU8zSSP/lw/pUCBDG/XvWAp7c/aFxgN4CyG0j7eayA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - optional: true - /@swc/core-darwin-arm64@1.3.107: resolution: {integrity: sha512-47tD/5vSXWxPd0j/ZllyQUg4bqalbQTsmqSw0J4dDdS82MWqCAwUErUrAZPRjBkjNQ6Kmrf5rpCWaGTtPw+ngw==} engines: {node: '>=10'} @@ -6746,14 +6733,6 @@ packages: dev: false optional: true - /@swc/core-darwin-x64@1.3.105: - resolution: {integrity: sha512-hFmXPApqjA/8sy/9NpljHVaKi1OvL9QkJ2MbbTCCbJERuHMpMUeMBUWipHRfepGHFhU+9B9zkEup/qJaJR4XIg==} - engines: {node: '>=10'} - cpu: [x64] - os: [darwin] - requiresBuild: true - optional: true - /@swc/core-darwin-x64@1.3.107: resolution: {integrity: sha512-hwiLJ2ulNkBGAh1m1eTfeY1417OAYbRGcb/iGsJ+LuVLvKAhU/itzsl535CvcwAlt2LayeCFfcI8gdeOLeZa9A==} engines: {node: '>=10'} @@ -6782,14 +6761,6 @@ packages: dev: false optional: true - /@swc/core-linux-arm-gnueabihf@1.3.105: - resolution: {integrity: sha512-mwXyMC41oMKkKrPpL8uJpOxw7fyfQoVtIw3Y5p0Blabk+espNYqix0E8VymHdRKuLmM//z5wVmMsuHdGBHvZeg==} - engines: {node: '>=10'} - cpu: [arm] - os: [linux] - requiresBuild: true - optional: true - /@swc/core-linux-arm-gnueabihf@1.3.107: resolution: {integrity: sha512-I2wzcC0KXqh0OwymCmYwNRgZ9nxX7DWnOOStJXV3pS0uB83TXAkmqd7wvMBuIl9qu4Hfomi9aDM7IlEEn9tumQ==} engines: {node: '>=10'} @@ -6807,14 +6778,6 @@ packages: dev: false optional: true - /@swc/core-linux-arm64-gnu@1.3.105: - resolution: {integrity: sha512-H7yEIVydnUtqBSUxwmO6vpIQn7j+Rr0DF6ZOORPyd/SFzQJK9cJRtmJQ3ZMzlJ1Bb+1gr3MvjgLEnmyCYEm2Hg==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - optional: true - /@swc/core-linux-arm64-gnu@1.3.107: resolution: {integrity: sha512-HWgnn7JORYlOYnGsdunpSF8A+BCZKPLzLtEUA27/M/ZuANcMZabKL9Zurt7XQXq888uJFAt98Gy+59PU90aHKg==} engines: {node: '>=10'} @@ -6832,14 +6795,6 @@ packages: dev: false optional: true - /@swc/core-linux-arm64-musl@1.3.105: - resolution: {integrity: sha512-Jg7RTFT3pGFdGt5elPV6oDkinRy7q9cXpenjXnJnM2uvx3jOwnsAhexPyCDHom8SHL0j+9kaLLC66T3Gz1E4UA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [linux] - requiresBuild: true - optional: true - /@swc/core-linux-arm64-musl@1.3.107: resolution: {integrity: sha512-vfPF74cWfAm8hyhS8yvYI94ucMHIo8xIYU+oFOW9uvDlGQRgnUf/6DEVbLyt/3yfX5723Ln57U8uiMALbX5Pyw==} engines: {node: '>=10'} @@ -6857,14 +6812,6 @@ packages: dev: false optional: true - /@swc/core-linux-x64-gnu@1.3.105: - resolution: {integrity: sha512-DJghplpyusAmp1X5pW/y93MmS/u83Sx5GrpJxI6KLPa82+NItTgMcl8KBQmW5GYAJpVKZyaIvBanS5TdR8aN2w==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true - optional: true - /@swc/core-linux-x64-gnu@1.3.107: resolution: {integrity: sha512-uBVNhIg0ip8rH9OnOsCARUFZ3Mq3tbPHxtmWk9uAa5u8jQwGWeBx5+nTHpDOVd3YxKb6+5xDEI/edeeLpha/9g==} engines: {node: '>=10'} @@ -6882,14 +6829,6 @@ packages: dev: false optional: true - /@swc/core-linux-x64-musl@1.3.105: - resolution: {integrity: sha512-wD5jL2dZH/5nPNssBo6jhOvkI0lmWnVR4vnOXWjuXgjq1S0AJpO5jdre/6pYLmf26hft3M42bteDnjR4AAZ38w==} - engines: {node: '>=10'} - cpu: [x64] - os: [linux] - requiresBuild: true - optional: true - /@swc/core-linux-x64-musl@1.3.107: resolution: {integrity: sha512-mvACkUvzSIB12q1H5JtabWATbk3AG+pQgXEN95AmEX2ZA5gbP9+B+mijsg7Sd/3tboHr7ZHLz/q3SHTvdFJrEw==} engines: {node: '>=10'} @@ -6907,14 +6846,6 @@ packages: dev: false optional: true - /@swc/core-win32-arm64-msvc@1.3.105: - resolution: {integrity: sha512-UqJtwILUHRw2+3UTPnRkZrzM/bGdQtbR4UFdp79mZQYfryeOUVNg7aJj/bWUTkKtLiZ3o+FBNrM/x2X1mJX5bA==} - engines: {node: '>=10'} - cpu: [arm64] - os: [win32] - requiresBuild: true - optional: true - /@swc/core-win32-arm64-msvc@1.3.107: resolution: {integrity: sha512-J3P14Ngy/1qtapzbguEH41kY109t6DFxfbK4Ntz9dOWNuVY3o9/RTB841ctnJk0ZHEG+BjfCJjsD2n8H5HcaOA==} engines: {node: '>=10'} @@ -6932,14 +6863,6 @@ packages: dev: false optional: true - /@swc/core-win32-ia32-msvc@1.3.105: - resolution: {integrity: sha512-Z95C6vZgBEJ1snidYyjVKnVWiy/ZpPiIFIXGWkDr4ZyBgL3eZX12M6LzZ+NApHKffrbO4enbFyFomueBQgS2oA==} - engines: {node: '>=10'} - cpu: [ia32] - os: [win32] - requiresBuild: true - optional: true - /@swc/core-win32-ia32-msvc@1.3.107: resolution: {integrity: sha512-ZBUtgyjTHlz8TPJh7kfwwwFma+ktr6OccB1oXC8fMSopD0AxVnQasgun3l3099wIsAB9eEsJDQ/3lDkOLs1gBA==} engines: {node: '>=10'} @@ -6957,14 +6880,6 @@ packages: dev: false optional: true - /@swc/core-win32-x64-msvc@1.3.105: - resolution: {integrity: sha512-3J8fkyDPFsS3mszuYUY4Wfk7/B2oio9qXUwF3DzOs2MK+XgdyMLIptIxL7gdfitXJBH8k39uVjrIw1JGJDjyFA==} - engines: {node: '>=10'} - cpu: [x64] - os: [win32] - requiresBuild: true - optional: true - /@swc/core-win32-x64-msvc@1.3.107: resolution: {integrity: sha512-Eyzo2XRqWOxqhE1gk9h7LWmUf4Bp4Xn2Ttb0ayAXFp6YSTxQIThXcT9kipXZqcpxcmDwoq8iWbbf2P8XL743EA==} engines: {node: '>=10'} @@ -6982,30 +6897,6 @@ packages: dev: false optional: true - /@swc/core@1.3.105: - resolution: {integrity: sha512-me2VZyr3OjqRpFrYQJJYy7x/zbFSl9nt+MAGnIcBtjDsN00iTVqEaKxBjPBFQV9BDAgPz2SRWes/DhhVm5SmMw==} - engines: {node: '>=10'} - requiresBuild: true - peerDependencies: - '@swc/helpers': ^0.5.0 - peerDependenciesMeta: - '@swc/helpers': - optional: true - dependencies: - '@swc/counter': 0.1.1 - '@swc/types': 0.1.5 - optionalDependencies: - '@swc/core-darwin-arm64': 1.3.105 - '@swc/core-darwin-x64': 1.3.105 - '@swc/core-linux-arm-gnueabihf': 1.3.105 - '@swc/core-linux-arm64-gnu': 1.3.105 - '@swc/core-linux-arm64-musl': 1.3.105 - '@swc/core-linux-x64-gnu': 1.3.105 - '@swc/core-linux-x64-musl': 1.3.105 - '@swc/core-win32-arm64-msvc': 1.3.105 - '@swc/core-win32-ia32-msvc': 1.3.105 - '@swc/core-win32-x64-msvc': 1.3.105 - /@swc/core@1.3.107: resolution: {integrity: sha512-zKhqDyFcTsyLIYK1iEmavljZnf4CCor5pF52UzLAz4B6Nu/4GLU+2LQVAf+oRHjusG39PTPjd2AlRT3f3QWfsQ==} engines: {node: '>=10'} @@ -7033,17 +6924,6 @@ packages: /@swc/counter@0.1.1: resolution: {integrity: sha512-xVRaR4u9hcYjFvcSg71Lz5Bo4//CyjAAfMxa7UsaDSYxAshflUkVJWiyVWrfxC59z2kP1IzI4/1BEpnhI9o3Mw==} - /@swc/jest@0.2.31(@swc/core@1.3.105): - resolution: {integrity: sha512-Gh0Ste380O8KUY1IqsKr+aOvqqs2Loa+WcWWVNwl+lhXqOWK1iTFAP1K0IDfLqAuFP68+D/PxcpBJn21e6Quvw==} - engines: {npm: '>= 7.0.0'} - peerDependencies: - '@swc/core': '*' - dependencies: - '@jest/create-cache-key-function': 29.7.0 - '@swc/core': 1.3.105 - jsonc-parser: 3.2.0 - dev: true - /@swc/jest@0.2.31(@swc/core@1.3.107): resolution: {integrity: sha512-Gh0Ste380O8KUY1IqsKr+aOvqqs2Loa+WcWWVNwl+lhXqOWK1iTFAP1K0IDfLqAuFP68+D/PxcpBJn21e6Quvw==} engines: {npm: '>= 7.0.0'} diff --git a/scripts/dev.mjs b/scripts/dev.mjs index 1ca2c6c2ea..bbb2547758 100644 --- a/scripts/dev.mjs +++ b/scripts/dev.mjs @@ -16,35 +16,36 @@ await execa('pnpm', ['clean'], { stderr: process.stderr, }); -await execa('pnpm', ['build-pre'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, -}); - -await execa('pnpm', ['build-assets'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, -}); - -await execa('pnpm', ['--filter', 'misskey-js', 'ts'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, -}); - -await execa('pnpm', ['--filter', 'misskey-reversi', 'build:tsc'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, -}); - -await execa('pnpm', ['--filter', 'misskey-bubble-game', 'build:tsc'], { - cwd: _dirname + '/../', - stdout: process.stdout, - stderr: process.stderr, -}); +await Promise.all([ + execa('pnpm', ['build-pre'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, + }), + execa('pnpm', ['build-assets'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, + }), + execa('pnpm', ['--filter', 'misskey-js', 'build'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, + }), +]); + +await Promise.all([ + execa('pnpm', ['--filter', 'misskey-reversi', 'build'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, + }), + execa('pnpm', ['--filter', 'misskey-bubble-game', 'build'], { + cwd: _dirname + '/../', + stdout: process.stdout, + stderr: process.stderr, + }), +]); execa('pnpm', ['build-pre', '--watch'], { cwd: _dirname + '/../', -- cgit v1.2.3-freya From b525c5887f1a81a4a88257f7750b22e882dbf4c9 Mon Sep 17 00:00:00 2001 From: dakkar Date: Sat, 15 Jun 2024 11:36:55 +0100 Subject: add copyright text to all our files --- .../1680969937000-larger-image-comment.js | 5 ++++ .../backend/migration/1682753227899-NoteEdit.js | 5 ++++ .../migration/1691264431000-add-lb-to-user.js | 7 +++++- .../migration/1695937489995-enableAchievements.js | 7 +++++- .../backend/migration/1696386694000-speakAsCat.js | 5 ++++ .../backend/migration/1696548899000-background.js | 7 +++++- .../migration/1697580470000-approvalSignup.js | 2 +- .../backend/migration/1697603945000-BotTrending.js | 2 +- .../backend/migration/1697624010000-isSilenced.js | 2 +- .../migration/1697970083000-alterNoteEdit.js | 5 ++++ .../migration/1697970083001-oldDateNoteEdit.js | 5 ++++ .../backend/migration/1699376974000-isIndexable.js | 5 ++++ .../backend/migration/1699819257000-defaultLike.js | 5 ++++ .../migration/1700228972000-update-indexable.js | 5 ++++ .../migration/1701647674000-BubbleInstances.js | 5 ++++ .../migration/1701809447000-NSFW-Instance.js | 5 ++++ .../migration/1704744370000-add-donation-url.js | 5 ++++ packages/backend/migration/1706232992000-deeplx.js | 2 +- packages/backend/src/models/NoteEdit.ts | 5 ++++ .../backend/src/models/json-schema/note-edit.ts | 5 ++++ .../ExportAccountDataProcessorService.ts | 5 ++++ .../processors/ImportNotesProcessorService.ts | 5 ++++ .../src/server/api/endpoints/admin/nsfw-user.ts | 5 ++++ .../src/server/api/endpoints/admin/silence-user.ts | 5 ++++ .../src/server/api/endpoints/admin/unnsfw-user.ts | 5 ++++ .../server/api/endpoints/admin/unsilence-user.ts | 5 ++++ .../src/server/api/endpoints/i/import-notes.ts | 7 +++++- .../api/endpoints/i/registry/get-unsecure.ts | 5 ++++ .../backend/src/server/api/endpoints/sponsors.ts | 5 ++++ .../api/mastodon/MastodonApiServerService.ts | 27 +++++++++++++--------- .../backend/src/server/api/mastodon/converters.ts | 5 ++++ .../backend/src/server/api/mastodon/endpoints.ts | 5 ++++ .../src/server/api/mastodon/endpoints/account.ts | 9 ++++++-- .../src/server/api/mastodon/endpoints/auth.ts | 7 +++++- .../src/server/api/mastodon/endpoints/filter.ts | 5 ++++ .../src/server/api/mastodon/endpoints/meta.ts | 5 ++++ .../server/api/mastodon/endpoints/notifications.ts | 5 ++++ .../src/server/api/mastodon/endpoints/search.ts | 5 ++++ .../src/server/api/mastodon/endpoints/status.ts | 5 ++++ .../src/server/api/mastodon/endpoints/timeline.ts | 5 ++++ packages/frontend/src/components/CkFollowMouse.vue | 5 ++++ packages/frontend/src/components/MkMfmWindow.vue | 5 ++++ packages/frontend/src/components/MkModPlayer.vue | 5 ++++ .../frontend/src/components/SkApprovalUser.vue | 5 ++++ packages/frontend/src/components/SkNoteHeader.vue | 2 +- packages/frontend/src/components/SkNoteSub.vue | 2 +- .../frontend/src/components/SkOldNoteWindow.vue | 5 ++++ packages/frontend/src/components/SkOneko.vue | 5 ++++ .../src/components/SkSearchResultWindow.vue | 5 ++++ packages/frontend/src/pages/admin/approvals.vue | 5 ++++ .../frontend/src/pages/user/index.listenbrainz.vue | 5 ++++ .../frontend/src/scripts/check-animated-mfm.ts | 13 +++++++---- packages/frontend/src/scripts/chiptune2.ts | 5 ++++ packages/frontend/src/scripts/favicon-dot.ts | 13 +++++++---- .../frontend/src/scripts/get-note-versions-menu.ts | 5 ++++ packages/frontend/src/scripts/search-engine-map.ts | 5 ++++ packages/frontend/src/widgets/WidgetSearch.vue | 2 +- packages/frontend/test/nyaize.test.ts | 5 ++++ scripts/trim-deps.mjs | 5 ++++ 59 files changed, 293 insertions(+), 33 deletions(-) (limited to 'scripts') diff --git a/packages/backend/migration/1680969937000-larger-image-comment.js b/packages/backend/migration/1680969937000-larger-image-comment.js index b6b4f90913..2645b12630 100644 --- a/packages/backend/migration/1680969937000-larger-image-comment.js +++ b/packages/backend/migration/1680969937000-larger-image-comment.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: dakkar and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class largerImageComment1680969937000 { name = 'largerImageComment1680969937000'; diff --git a/packages/backend/migration/1682753227899-NoteEdit.js b/packages/backend/migration/1682753227899-NoteEdit.js index 55a0de0206..e67b1c566d 100644 --- a/packages/backend/migration/1682753227899-NoteEdit.js +++ b/packages/backend/migration/1682753227899-NoteEdit.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class NoteEdit1682753227899 { name = "NoteEdit1682753227899"; diff --git a/packages/backend/migration/1691264431000-add-lb-to-user.js b/packages/backend/migration/1691264431000-add-lb-to-user.js index fe6265e3f5..f06017468a 100644 --- a/packages/backend/migration/1691264431000-add-lb-to-user.js +++ b/packages/backend/migration/1691264431000-add-lb-to-user.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: amelia and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class AddLbToUser1691264431000 { name = "AddLbToUser1691264431000"; @@ -17,4 +22,4 @@ export class AddLbToUser1691264431000 { ALTER TABLE "user_profile" DROP COLUMN "listenbrainz" `); } -} \ No newline at end of file +} diff --git a/packages/backend/migration/1695937489995-enableAchievements.js b/packages/backend/migration/1695937489995-enableAchievements.js index 2c20971ff5..1ee08de146 100644 --- a/packages/backend/migration/1695937489995-enableAchievements.js +++ b/packages/backend/migration/1695937489995-enableAchievements.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class EnableAchievements1695937489995 { name = 'EnableAchievements1695937489995' @@ -8,4 +13,4 @@ export class EnableAchievements1695937489995 { async down(queryRunner) { await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "enableAchievements"`); } -} \ No newline at end of file +} diff --git a/packages/backend/migration/1696386694000-speakAsCat.js b/packages/backend/migration/1696386694000-speakAsCat.js index d68b9401bf..b9ba95e2fa 100644 --- a/packages/backend/migration/1696386694000-speakAsCat.js +++ b/packages/backend/migration/1696386694000-speakAsCat.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class SpeakAsCat1696386694000 { name = "SpeakAsCat1696386694000"; diff --git a/packages/backend/migration/1696548899000-background.js b/packages/backend/migration/1696548899000-background.js index 59309b98c2..f1c0b5a4a5 100644 --- a/packages/backend/migration/1696548899000-background.js +++ b/packages/backend/migration/1696548899000-background.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class Background1696548899000 { name = 'Background1696548899000' @@ -16,4 +21,4 @@ export class Background1696548899000 { await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "backgroundUrl"`); await queryRunner.query(`ALTER TABLE "user" DROP COLUMN "backgroundBlurhash"`); } -} \ No newline at end of file +} diff --git a/packages/backend/migration/1697580470000-approvalSignup.js b/packages/backend/migration/1697580470000-approvalSignup.js index c5f8255d49..cc53a6bb5c 100644 --- a/packages/backend/migration/1697580470000-approvalSignup.js +++ b/packages/backend/migration/1697580470000-approvalSignup.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697603945000-BotTrending.js b/packages/backend/migration/1697603945000-BotTrending.js index 73f1f598ed..d59f1b0552 100644 --- a/packages/backend/migration/1697603945000-BotTrending.js +++ b/packages/backend/migration/1697603945000-BotTrending.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697624010000-isSilenced.js b/packages/backend/migration/1697624010000-isSilenced.js index 98b5e8c55c..16749b54cf 100644 --- a/packages/backend/migration/1697624010000-isSilenced.js +++ b/packages/backend/migration/1697624010000-isSilenced.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/migration/1697970083000-alterNoteEdit.js b/packages/backend/migration/1697970083000-alterNoteEdit.js index 11accb3c54..0aa4f8fa9c 100644 --- a/packages/backend/migration/1697970083000-alterNoteEdit.js +++ b/packages/backend/migration/1697970083000-alterNoteEdit.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class AlterNoteEdit1697970083000 { name = "AlterNoteEdit1697970083000"; diff --git a/packages/backend/migration/1697970083001-oldDateNoteEdit.js b/packages/backend/migration/1697970083001-oldDateNoteEdit.js index 17565a0914..c21f62c486 100644 --- a/packages/backend/migration/1697970083001-oldDateNoteEdit.js +++ b/packages/backend/migration/1697970083001-oldDateNoteEdit.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class OldDateNoteEdit1697970083001 { name = "OldDateNoteEdit1697970083001"; diff --git a/packages/backend/migration/1699376974000-isIndexable.js b/packages/backend/migration/1699376974000-isIndexable.js index ae826924a8..7919b36c5d 100644 --- a/packages/backend/migration/1699376974000-isIndexable.js +++ b/packages/backend/migration/1699376974000-isIndexable.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class IsIndexable1699376974000 { name = 'IsIndexable1699376974000' diff --git a/packages/backend/migration/1699819257000-defaultLike.js b/packages/backend/migration/1699819257000-defaultLike.js index 45492fa6c6..a91926698a 100644 --- a/packages/backend/migration/1699819257000-defaultLike.js +++ b/packages/backend/migration/1699819257000-defaultLike.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class instanceDefaultLike1699819257000 { name = 'instanceDefaultLike1699819257000' diff --git a/packages/backend/migration/1700228972000-update-indexable.js b/packages/backend/migration/1700228972000-update-indexable.js index e724e2ec7e..1d46fd08fd 100644 --- a/packages/backend/migration/1700228972000-update-indexable.js +++ b/packages/backend/migration/1700228972000-update-indexable.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class UpdateIndexable1700228972000 { name = 'UpdateIndexable1700228972000' diff --git a/packages/backend/migration/1701647674000-BubbleInstances.js b/packages/backend/migration/1701647674000-BubbleInstances.js index 9928b4c36e..f048f521b0 100644 --- a/packages/backend/migration/1701647674000-BubbleInstances.js +++ b/packages/backend/migration/1701647674000-BubbleInstances.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class BubbleInstances1701647674000 { name = 'BubbleInstances1701647674000' diff --git a/packages/backend/migration/1701809447000-NSFW-Instance.js b/packages/backend/migration/1701809447000-NSFW-Instance.js index 882aa9865d..51075517b0 100644 --- a/packages/backend/migration/1701809447000-NSFW-Instance.js +++ b/packages/backend/migration/1701809447000-NSFW-Instance.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class NSFWInstance1701809447000 { name = 'NSFWInstance1701809447000' diff --git a/packages/backend/migration/1704744370000-add-donation-url.js b/packages/backend/migration/1704744370000-add-donation-url.js index c953b13cc9..ead22c6a95 100644 --- a/packages/backend/migration/1704744370000-add-donation-url.js +++ b/packages/backend/migration/1704744370000-add-donation-url.js @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: nila and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export class AddDonationUrl1704744370000 { name = 'AddDonationUrl1704744370000' diff --git a/packages/backend/migration/1706232992000-deeplx.js b/packages/backend/migration/1706232992000-deeplx.js index 5c763dbf8b..17ddbef26a 100644 --- a/packages/backend/migration/1706232992000-deeplx.js +++ b/packages/backend/migration/1706232992000-deeplx.js @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: syuilo and other misskey contributors + * SPDX-FileCopyrightText: marie and other Sharkey contributors * SPDX-License-Identifier: AGPL-3.0-only */ diff --git a/packages/backend/src/models/NoteEdit.ts b/packages/backend/src/models/NoteEdit.ts index 9ec989dd50..cfd9ad748e 100644 --- a/packages/backend/src/models/NoteEdit.ts +++ b/packages/backend/src/models/NoteEdit.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Entity, JoinColumn, Column, ManyToOne, PrimaryColumn, Index } from "typeorm"; import { id } from './util/id.js'; import { MiNote } from './Note.js'; diff --git a/packages/backend/src/models/json-schema/note-edit.ts b/packages/backend/src/models/json-schema/note-edit.ts index a58e2aa1de..ba936f866b 100644 --- a/packages/backend/src/models/json-schema/note-edit.ts +++ b/packages/backend/src/models/json-schema/note-edit.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + export const packedNoteEdit = { type: "object", properties: { diff --git a/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts b/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts index a6892134bc..33a2362c4a 100644 --- a/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts +++ b/packages/backend/src/queue/processors/ExportAccountDataProcessorService.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import * as fs from 'node:fs'; import { Inject, Injectable } from '@nestjs/common'; import { In, IsNull, MoreThan, Not } from 'typeorm'; diff --git a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts index 58a0ea10ad..f89dc46722 100644 --- a/packages/backend/src/queue/processors/ImportNotesProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportNotesProcessorService.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import * as fs from 'node:fs'; import * as fsp from 'node:fs/promises'; import * as crypto from 'node:crypto'; diff --git a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts index 2a47abe03c..d3fa4251dd 100644 --- a/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/nsfw-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/silence-user.ts b/packages/backend/src/server/api/endpoints/admin/silence-user.ts index 007bed5c03..7e6045049a 100644 --- a/packages/backend/src/server/api/endpoints/admin/silence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/silence-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts index 013e7771ba..26588365e1 100644 --- a/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unnsfw-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository, UserProfilesRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts index 5e514ccda6..f92be0d8e0 100644 --- a/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts +++ b/packages/backend/src/server/api/endpoints/admin/unsilence-user.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { UsersRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/i/import-notes.ts b/packages/backend/src/server/api/endpoints/i/import-notes.ts index 4e00163550..91ef12c3e3 100644 --- a/packages/backend/src/server/api/endpoints/i/import-notes.ts +++ b/packages/backend/src/server/api/endpoints/i/import-notes.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import ms from 'ms'; import { Endpoint } from '@/server/api/endpoint-base.js'; @@ -59,7 +64,7 @@ export default class extends Endpoint { // eslint- const file = await this.driveFilesRepository.findOneBy({ id: ps.fileId }); if (file == null) throw new ApiError(meta.errors.noSuchFile); - + if (file.size === 0) throw new ApiError(meta.errors.emptyFile); if ((await this.roleService.getUserPolicies(me.id)).canImportNotes === false) { diff --git a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts index bb471284c9..3aa256077e 100644 --- a/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts +++ b/packages/backend/src/server/api/endpoints/i/registry/get-unsecure.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Endpoint } from '@/server/api/endpoint-base.js'; import type { RegistryItemsRepository } from '@/models/_.js'; diff --git a/packages/backend/src/server/api/endpoints/sponsors.ts b/packages/backend/src/server/api/endpoints/sponsors.ts index 50e1c594f2..b6ccb9b2f9 100644 --- a/packages/backend/src/server/api/endpoints/sponsors.ts +++ b/packages/backend/src/server/api/endpoints/sponsors.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import * as Redis from 'ioredis'; import { Endpoint } from '@/server/api/endpoint-base.js'; diff --git a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts index 5706a17786..8c9cca1730 100644 --- a/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts +++ b/packages/backend/src/server/api/mastodon/MastodonApiServerService.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import megalodon, { Entity, MegalodonInterface } from 'megalodon'; import querystring from 'querystring'; @@ -89,7 +94,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/instance', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -113,7 +118,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/announcements', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -126,7 +131,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.post<{ Body: { id: string } }>('/v1/announcements/:id/dismiss', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -177,8 +182,8 @@ export class MastodonApiServerService { /* console.error(e); */ reply.code(401).send(e.response.data); } - }); - + }); + fastify.get('/v1/filters', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -192,7 +197,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/trends', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -238,7 +243,7 @@ export class MastodonApiServerService { reply.code(401).send(e.response.data); } }); - + fastify.get('/v1/preferences', async (_request, reply) => { const BASE_URL = `${_request.protocol}://${_request.hostname}`; const accessTokens = _request.headers.authorization; @@ -291,18 +296,18 @@ export class MastodonApiServerService { user: { id: tokeninfo.userId, host: null }, path: avatar.path, name: avatar.originalname !== null && avatar.originalname !== 'file' ? avatar.originalname : undefined, - sensitive: false, + sensitive: false, }); if (upload.type.startsWith('image/')) { // eslint-disable-next-line @typescript-eslint/no-explicit-any (_request.body as any).avatar = upload.id; } - } else if (tokeninfo && header) { + } else if (tokeninfo && header) { const upload = await this.driveService.addFile({ user: { id: tokeninfo.userId, host: null }, path: header.path, name: header.originalname !== null && header.originalname !== 'file' ? header.originalname : undefined, - sensitive: false, + sensitive: false, }); if (upload.type.startsWith('image/')) { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -324,7 +329,7 @@ export class MastodonApiServerService { }; }); // eslint-disable-next-line @typescript-eslint/no-explicit-any - (_request.body as any).fields_attributes = fields.filter((field: any) => field.name.trim().length > 0 && field.value.length > 0); + (_request.body as any).fields_attributes = fields.filter((field: any) => field.name.trim().length > 0 && field.value.length > 0); } const data = await client.updateCredentials(_request.body!); diff --git a/packages/backend/src/server/api/mastodon/converters.ts b/packages/backend/src/server/api/mastodon/converters.ts index cca9505846..405701e826 100644 --- a/packages/backend/src/server/api/mastodon/converters.ts +++ b/packages/backend/src/server/api/mastodon/converters.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Inject, Injectable } from '@nestjs/common'; import { Entity } from 'megalodon'; import mfm from '@transfem-org/sfm-js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints.ts b/packages/backend/src/server/api/mastodon/endpoints.ts index 5a75823891..085314059b 100644 --- a/packages/backend/src/server/api/mastodon/endpoints.ts +++ b/packages/backend/src/server/api/mastodon/endpoints.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { ApiAuthMastodon } from './endpoints/auth.js'; import { ApiAccountMastodon } from './endpoints/account.js'; import { ApiSearchMastodon } from './endpoints/search.js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/account.ts b/packages/backend/src/server/api/mastodon/endpoints/account.ts index 07d9efb8c1..6fcfb0019c 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/account.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/account.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { MastoConverters, convertRelationship } from '../converters.js'; import { argsToBools, limitToInt } from './timeline.js'; import type { MegalodonInterface } from 'megalodon'; @@ -104,7 +109,7 @@ export class ApiAccountMastodon { public async getFollowers() { try { const data = await this.client.getAccountFollowers( - (this.request.params as any).id, + (this.request.params as any).id, limitToInt(this.request.query as any), ); return await Promise.all(data.data.map(async (account) => await this.mastoconverter.convertAccount(account))); @@ -118,7 +123,7 @@ export class ApiAccountMastodon { public async getFollowing() { try { const data = await this.client.getAccountFollowing( - (this.request.params as any).id, + (this.request.params as any).id, limitToInt(this.request.query as any), ); return await Promise.all(data.data.map(async (account) => await this.mastoconverter.convertAccount(account))); diff --git a/packages/backend/src/server/api/mastodon/endpoints/auth.ts b/packages/backend/src/server/api/mastodon/endpoints/auth.ts index 80a5e89ca3..a447bdb1b7 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/auth.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/auth.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import type { MegalodonInterface } from 'megalodon'; import type { FastifyRequest } from 'fastify'; @@ -65,7 +70,7 @@ export async function ApiAuthMastodon(request: FastifyRequest, client: Megalodon client_id: Buffer.from(appData.url || '').toString('base64'), client_secret: appData.clientSecret, }; - + return returns; } catch (e: any) { console.error(e); diff --git a/packages/backend/src/server/api/mastodon/endpoints/filter.ts b/packages/backend/src/server/api/mastodon/endpoints/filter.ts index 212c79b251..ce6809d230 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/filter.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/filter.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { convertFilter } from '../converters.js'; import type { MegalodonInterface } from 'megalodon'; import type { FastifyRequest } from 'fastify'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/meta.ts b/packages/backend/src/server/api/mastodon/endpoints/meta.ts index efb39ef939..79d2c62a24 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/meta.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/meta.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { Entity } from 'megalodon'; import { FILE_TYPE_BROWSERSAFE } from '@/const.js'; import type { Config } from '@/config.js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts index c4628b58c4..0eefb5894c 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/notifications.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/notifications.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { convertNotification } from '../converters.js'; import type { MegalodonInterface, Entity } from 'megalodon'; import type { FastifyRequest } from 'fastify'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/search.ts b/packages/backend/src/server/api/mastodon/endpoints/search.ts index 500129c901..946e796e2a 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/search.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/search.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { MastoConverters } from '../converters.js'; import { limitToInt } from './timeline.js'; import type { MegalodonInterface } from 'megalodon'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/status.ts b/packages/backend/src/server/api/mastodon/endpoints/status.ts index fe77646af4..ddc99639fa 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/status.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/status.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import querystring from 'querystring'; import { emojiRegexAtStartToEnd } from '@/misc/emoji-regex.js'; import { convertAttachment, convertPoll, convertStatusSource, MastoConverters } from '../converters.js'; diff --git a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts index f81b63b9ac..3eb4898713 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/timeline.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/timeline.ts @@ -1,3 +1,8 @@ +/* + * SPDX-FileCopyrightText: marie and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + import { ParsedUrlQuery } from 'querystring'; import { convertConversation, convertList, MastoConverters } from '../converters.js'; import { getClient } from '../MastodonApiServerService.js'; diff --git a/packages/frontend/src/components/CkFollowMouse.vue b/packages/frontend/src/components/CkFollowMouse.vue index b55a577b3f..ce7e3c79a8 100644 --- a/packages/frontend/src/components/CkFollowMouse.vue +++ b/packages/frontend/src/components/CkFollowMouse.vue @@ -1,3 +1,8 @@ + +