update deps (#14057)

* wip

* locales/index.jsのymlファイル取得ロジックを調節

* regenerate pnpm-lock.yaml

* fix(backend): typecheck fails

* chore(deps): bump ip-cidr from 4.0.0 to 4.0.1 in /packages/backend

* chore: migrate ESLint configs to flat config (#14094)

* chore: migrate ESLint configs to flat config

* fix: update paths

* fix: frontend lint fails

* refactor(misskey-js): lint build.js

* update deps

---------

Co-authored-by: samunohito <46447427+samunohito@users.noreply.github.com>
Co-authored-by: zyoshoka <root@zyoshoka.com>
Co-authored-by: zyoshoka <107108195+zyoshoka@users.noreply.github.com>
This commit is contained in:
syuilo 2024-07-02 11:38:34 +09:00 committed by GitHub
parent f1b1e2a7cc
commit 427648c4b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
40 changed files with 5556 additions and 4411 deletions

View file

@ -1,8 +0,0 @@
node_modules
/built
/coverage
/.eslintrc.js
/jest.config.ts
/test
/test-d
build.js

View file

@ -1,9 +0,0 @@
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: [
'../shared/.eslintrc.js',
],
};

View file

@ -1,32 +1,32 @@
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";
import fs from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname } from 'node:path';
import * as esbuild from 'esbuild';
import { build } from 'esbuild';
import { globSync } from 'glob';
import { execa } from 'execa';
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}");
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",
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")) {
if (process.argv.map(arg => arg.toLowerCase()).includes('--watch')) {
await watchSrc();
} else {
await buildSrc();
@ -36,7 +36,7 @@ async function buildSrc() {
console.log(`[${_package.name}] start building...`);
await build(options)
.then(it => {
.then(() => {
console.log(`[${_package.name}] build succeeded.`);
})
.catch((err) => {
@ -65,7 +65,7 @@ function buildDts() {
{
stdout: process.stdout,
stderr: process.stderr,
}
},
);
}
@ -86,7 +86,7 @@ async function watchSrc() {
},
}];
console.log(`[${_package.name}] start watching...`)
console.log(`[${_package.name}] start watching...`);
const context = await esbuild.context({ ...options, plugins });
await context.watch();

View file

@ -0,0 +1,28 @@
import tsParser from '@typescript-eslint/parser';
import sharedConfig from '../shared/eslint.config.js';
export default [
...sharedConfig,
{
ignores: [
'**/node_modules',
'built',
'coverage',
'jest.config.ts',
'test',
'test-d',
'generator',
],
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
parser: tsParser,
project: ['./tsconfig.json'],
sourceType: 'module',
tsconfigRootDir: import.meta.dirname,
},
},
},
];

View file

@ -1,9 +0,0 @@
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
extends: [
'../../shared/.eslintrc.js',
],
};

View file

@ -0,0 +1,17 @@
import tsParser from '@typescript-eslint/parser';
import sharedConfig from '../../shared/eslint.config.js';
export default [
...sharedConfig,
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parserOptions: {
parser: tsParser,
project: ['./tsconfig.json'],
sourceType: 'module',
tsconfigRootDir: import.meta.dirname,
},
},
},
];

View file

@ -4,15 +4,13 @@
"description": "Misskey TypeGenerator",
"type": "module",
"scripts": {
"generate": "tsx src/generator.ts && eslint ./built/**/* --ext .ts --fix"
"generate": "tsx src/generator.ts && eslint ./built/**/*.ts --fix"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "^1.0.0",
"@readme/openapi-parser": "2.5.0",
"@types/node": "20.9.1",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"eslint": "8.53.0",
"openapi-types": "12.1.3",
"openapi-typescript": "6.7.3",
"ts-case-convert": "2.0.2",

View file

@ -22,7 +22,7 @@
"tsd": "tsd",
"api": "pnpm api-extractor run --local --verbose",
"api-prod": "pnpm api-extractor run --verbose",
"eslint": "eslint . --ext .js,.jsx,.ts,.tsx",
"eslint": "eslint './**/*.{js,jsx,ts,tsx}'",
"typecheck": "tsc --noEmit",
"lint": "pnpm typecheck && pnpm eslint",
"jest": "jest --coverage --detectOpenHandles",
@ -35,25 +35,23 @@
"directory": "packages/misskey-js"
},
"devDependencies": {
"@microsoft/api-extractor": "7.43.1",
"@misskey-dev/eslint-plugin": "1.0.0",
"@microsoft/api-extractor": "7.47.0",
"@swc/jest": "0.2.36",
"@types/jest": "29.5.12",
"@types/node": "20.12.7",
"@typescript-eslint/eslint-plugin": "7.7.1",
"@typescript-eslint/parser": "7.7.1",
"eslint": "8.57.0",
"@types/node": "20.14.9",
"@typescript-eslint/eslint-plugin": "7.15.0",
"@typescript-eslint/parser": "7.15.0",
"jest": "29.7.0",
"jest-fetch-mock": "3.0.3",
"jest-websocket-mock": "2.5.0",
"mock-socket": "9.3.1",
"ncp": "2.0.0",
"nodemon": "3.1.0",
"execa": "8.0.1",
"tsd": "0.30.7",
"typescript": "5.5.2",
"esbuild": "0.19.11",
"glob": "10.3.12"
"nodemon": "3.1.4",
"execa": "9.2.0",
"tsd": "0.31.1",
"typescript": "5.5.3",
"esbuild": "0.22.0",
"glob": "10.4.2"
},
"files": [
"built"