Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@
"esbuild": "0.27.4",
"execa": "9.6.1",
"ignore-walk": "8.0.0",
"js-yaml": "4.1.1",
"postcss": "8.5.8",
"tar": "7.5.13",
"terser": "5.46.1"
"terser": "5.46.1",
"yaml": "2.8.3"
},
"devDependencies": {
"@eslint/js": "9.39.4",
"@misskey-dev/eslint-plugin": "2.1.0",
"@types/js-yaml": "4.0.9",
"@types/node": "24.12.0",
"@typescript-eslint/eslint-plugin": "8.57.2",
"@typescript-eslint/parser": "8.57.2",
Expand Down
7 changes: 3 additions & 4 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@
"async-mutex": "0.5.0",
"bcryptjs": "3.0.3",
"blurhash": "2.0.5",
"body-parser": "2.2.2",
"bullmq": "5.71.0",
"cacheable-lookup": "7.0.0",
"chalk": "5.6.2",
Expand Down Expand Up @@ -134,6 +133,7 @@
"mime-types": "3.0.2",
"misskey-js": "workspace:*",
"misskey-reversi": "workspace:*",
"milliparsec": "5.1.1",
"ms": "3.0.0-canary.202508261828",
"nanoid": "5.1.7",
"nested-property": "4.0.0",
Expand Down Expand Up @@ -184,7 +184,6 @@
"@swc/jest": "0.2.39",
"@types/accepts": "1.3.7",
"@types/archiver": "7.0.0",
"@types/body-parser": "1.19.6",
"@types/color-convert": "2.0.4",
"@types/content-disposition": "0.5.9",
"@types/fluent-ffmpeg": "2.1.28",
Expand Down Expand Up @@ -223,11 +222,11 @@
"fkill": "10.0.3",
"jest": "29.7.0",
"jest-mock": "29.7.0",
"js-yaml": "4.1.1",
"nodemon": "3.1.14",
"pid-port": "2.1.0",
"simple-oauth2": "5.1.0",
"supertest": "7.2.2",
"vite": "8.0.7"
"vite": "8.0.7",
"yaml": "2.8.3"
}
}
6 changes: 3 additions & 3 deletions packages/backend/scripts/compile_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

/**
* YAMLファイルをJSONファイルに変換するスクリプト
* ビルド前に実行し、ランタイムにjs-yamlを含まないようにする
* ビルド前に実行し、ランタイムにyamlを含まないようにする
*/

import fs from 'node:fs';
import { resolve, dirname } from 'node:path';
import { fileURLToPath } from 'node:url';
import yaml from 'js-yaml';
import * as yaml from 'yaml';

const _filename = fileURLToPath(import.meta.url);
const _dirname = dirname(_filename);
Expand All @@ -34,7 +34,7 @@ function yamlToJson(ymlPath) {
console.log(`${ymlPath} → ${OUTPUT_PATH}`);

const yamlContent = fs.readFileSync(ymlPath, 'utf-8');
const jsonContent = yaml.load(yamlContent);
const jsonContent = yaml.parse(yamlContent);
if (!fs.existsSync(dirname(OUTPUT_PATH))) {
fs.mkdirSync(dirname(OUTPUT_PATH), { recursive: true });
}
Expand Down
8 changes: 4 additions & 4 deletions packages/backend/src/server/oauth/OAuth2ProviderService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import ipaddr from 'ipaddr.js';
import oauth2orize, { type OAuth2, AuthorizationError, ValidateFunctionArity2, OAuth2Req, MiddlewareRequest } from 'oauth2orize';
import oauth2Pkce from 'oauth2orize-pkce';
import fastifyCors from '@fastify/cors';
import bodyParser from 'body-parser';
import { json as parseBodyJson, urlencoded as parseBodyUrlEncoded } from 'milliparsec';
import fastifyExpress from '@fastify/express';
import { verifyChallenge } from 'pkce-challenge';
import { permissions as kinds } from 'misskey-js';
Expand Down Expand Up @@ -525,7 +525,7 @@ export class OAuth2ProviderService {
}));
fastify.use('/authorize', this.#server.errorHandler());

fastify.use('/decision', bodyParser.urlencoded({ extended: false }));
fastify.use('/decision', parseBodyUrlEncoded());
fastify.use('/decision', this.#server.decision((req, done) => {
const { body } = req as OAuth2DecisionRequest;
this.#logger.info(`Received the decision. Cancel: ${!!body.cancel}`);
Expand Down Expand Up @@ -556,8 +556,8 @@ export class OAuth2ProviderService {

await fastify.register(fastifyExpress);
// Clients may use JSON or urlencoded
fastify.use('', bodyParser.urlencoded({ extended: false }));
fastify.use('', bodyParser.json({ strict: true }));
fastify.use('', parseBodyUrlEncoded());
fastify.use('', parseBodyJson());
fastify.use('', this.#server.token());
fastify.use('', this.#server.errorHandler());
}
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend-embed/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path from 'path';
import pluginVue from '@vitejs/plugin-vue';
import { defineConfig, type UserConfig } from 'vite';
import * as yaml from 'js-yaml';
import * as yaml from 'yaml';
import { promises as fsp } from 'fs';

import locales from 'i18n';
Expand All @@ -10,7 +10,7 @@ import packageInfo from './package.json' with { type: 'json' };
import pluginJson5 from './lib/vite-plugin-json5.js';
import { pluginRemoveUnrefI18n } from '../frontend-builder/rollup-plugin-remove-unref-i18n';

const url = process.env.NODE_ENV === 'development' ? (yaml.load(await fsp.readFile('../../.config/default.yml', 'utf-8')) as any).url : null;
const url = process.env.NODE_ENV === 'development' ? (yaml.parse(await fsp.readFile('../../.config/default.yml', 'utf-8')) as any).url : null;
const host = url ? (new URL(url)).hostname : undefined;

const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue'];
Expand Down
4 changes: 2 additions & 2 deletions packages/frontend/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import pluginGlsl from 'vite-plugin-glsl';
import { replacePlugin } from 'rolldown/plugins';
import type { UserConfig } from 'vite';
import { defineConfig } from 'vite';
import * as yaml from 'js-yaml';
import * as yaml from 'yaml';
import { promises as fsp } from 'fs';

import locales from 'i18n';
Expand All @@ -17,7 +17,7 @@ import pluginCreateSearchIndex from './lib/vite-plugin-create-search-index.js';
import pluginWatchLocales from './lib/vite-plugin-watch-locales.js';
import { pluginRemoveUnrefI18n } from '../frontend-builder/rollup-plugin-remove-unref-i18n.js';

const url = process.env.NODE_ENV === 'development' ? (yaml.load(await fsp.readFile('../../.config/default.yml', 'utf-8')) as any).url : null;
const url = process.env.NODE_ENV === 'development' ? (yaml.parse(await fsp.readFile('../../.config/default.yml', 'utf-8')) as any).url : null;
const host = url ? (new URL(url)).hostname : undefined;

const extensions = ['.ts', '.tsx', '.js', '.jsx', '.mjs', '.json', '.json5', '.svg', '.sass', '.scss', '.css', '.vue'];
Expand Down
3 changes: 1 addition & 2 deletions packages/i18n/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"built"
],
"devDependencies": {
"@types/js-yaml": "4.0.9",
"@types/node": "24.12.0",
"@typescript-eslint/eslint-plugin": "8.57.2",
"@typescript-eslint/parser": "8.57.2",
Expand All @@ -39,6 +38,6 @@
"tsx": "4.21.0"
},
"dependencies": {
"js-yaml": "4.1.1"
"yaml": "2.8.3"
}
}
6 changes: 3 additions & 3 deletions packages/i18n/scripts/generateLocaleInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import * as fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, resolve } from 'node:path';
import * as yaml from 'js-yaml';
import * as yaml from 'yaml';
import ts from 'typescript';

const __filename = fileURLToPath(import.meta.url);
Expand Down Expand Up @@ -62,14 +62,14 @@ function createMembers(record: LocaleRecord): ts.TypeElement[] {
}

export async function generateLocaleInterface(localesDir: string): Promise<void> {
const locale = yaml.load(fs.readFileSync(`${localesDir}/ja-JP.yml`, 'utf-8').toString()) as LocaleRecord;
const locale = yaml.parse(fs.readFileSync(`${localesDir}/ja-JP.yml`, 'utf-8').toString()) as LocaleRecord;
const members = createMembers(locale);

const elements: ts.Statement[] = [
ts.factory.createImportDeclaration(
undefined,
ts.factory.createImportClause(
false,
undefined,
undefined,
ts.factory.createNamedImports([
ts.factory.createImportSpecifier(
Expand Down
4 changes: 2 additions & 2 deletions packages/i18n/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import * as fs from 'node:fs';
import * as yaml from 'js-yaml';
import * as yaml from 'yaml';
import { languages, primaries } from './const.js';
import type { Locale } from './autogen/locale.js';
import type { ILocale, ParameterizedString } from './types.js';
Expand Down Expand Up @@ -62,7 +62,7 @@ function build(): Record<Language, Locale> {
// https://github.com/misskey-dev/misskey/pull/14057#issuecomment-2192833785
const metaUrl = import.meta.url;
const locales = languages.reduce<Locales>((a, lang) => {
a[lang] = (yaml.load(clean(fs.readFileSync(new URL(`./locales/${lang}.yml`, metaUrl), 'utf-8'))) ?? {}) as ILocale;
a[lang] = (yaml.parse(clean(fs.readFileSync(new URL(`./locales/${lang}.yml`, metaUrl), 'utf-8'))) ?? {}) as ILocale;
return a;
}, {} as Locales);

Expand Down
Loading
Loading