Merge branch 'develop' into iceshrimp_mastodon

This commit is contained in:
naskya 2024-06-29 10:36:27 +09:00
commit 783ad8012d
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
10 changed files with 425 additions and 2471 deletions

View file

@ -40,10 +40,8 @@ packages/backend/assets/instance.css
.gitattributes
.weblate
animated.svg
cliff.toml
docker-compose.yml
docker-compose.example.yml
firefish.nginx.conf
title.svg
/.gitlab
/ci
@ -55,7 +53,6 @@ biome.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
Dockerfile
Procfile
Makefile
README.md
SECURITY.md

View file

@ -1,28 +1,400 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
"organizeImports": {
"enabled": false
},
"organizeImports": { "enabled": false },
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"recommended": false,
"complexity": {
"noBannedTypes": "error",
"noExtraBooleanCast": "error",
"noMultipleSpacesInRegularExpressionLiterals": "error",
"noUselessCatch": "error",
"noUselessConstructor": "off",
"noUselessLoneBlockStatements": "error",
"noUselessRename": "error",
"noUselessTernary": "error",
"noUselessThisAlias": "error",
"noUselessTypeConstraint": "error",
"noVoid": "error",
"noWith": "error",
"useLiteralKeys": "error",
"useRegexLiterals": "error"
},
"correctness": {
"noConstAssign": "error",
"noConstantCondition": "error",
"noEmptyCharacterClassInRegex": "error",
"noEmptyPattern": "error",
"noGlobalObjectCalls": "error",
"noInvalidConstructorSuper": "error",
"noInvalidUseBeforeDeclaration": "error",
"noNewSymbol": "error",
"noPrecisionLoss": "error",
"noSelfAssign": "error",
"noSwitchDeclarations": "error",
"noUndeclaredVariables": "error",
"noUnreachable": "error",
"noUnreachableSuper": "error",
"noUnsafeFinally": "error",
"noUnusedVariables": "off",
"useArrayLiterals": "off",
"useIsNan": "error"
},
"security": { "noGlobalEval": "error" },
"style": {
"noUselessElse": "off"
"noCommaOperator": "error",
"noInferrableTypes": "error",
"noNamespace": "error",
"noNonNullAssertion": "warn",
"noUselessElse": "off",
"noVar": "error",
"useAsConstAssertion": "error",
"useBlockStatements": "off",
"useConst": "error",
"useImportType": "error",
"useSingleVarDeclarator": "warn"
},
"suspicious": {
"noAssignInExpressions": "error",
"noAsyncPromiseExecutor": "error",
"noCatchAssign": "error",
"noClassAssign": "error",
"noCompareNegZero": "error",
"noConfusingLabels": "off",
"noConsoleLog": "warn",
"noControlCharactersInRegex": "error",
"noDebugger": "warn",
"noDoubleEquals": "error",
"noDuplicateCase": "error",
"noDuplicateClassMembers": "error",
"noDuplicateObjectKeys": "error",
"noDuplicateParameters": "error",
"noEmptyBlockStatements": "error",
"noEmptyInterface": "error",
"noExplicitAny": "warn",
"noExtraNonNullAssertion": "error",
"noFallthroughSwitchClause": "error",
"noFunctionAssign": "error",
"noGlobalAssign": "error",
"noImportAssign": "error",
"noMisleadingCharacterClass": "error",
"noMisleadingInstantiator": "error",
"noPrototypeBuiltins": "off",
"noRedeclare": "error",
"noSelfCompare": "error",
"noShadowRestrictedNames": "error",
"noUnsafeNegation": "error",
"useAwait": "off",
"useDefaultSwitchClauseLast": "error",
"useNamespaceKeyword": "error",
"useValidTypeof": "error"
}
}
},
"ignore": [
"**/*.json5",
"**/*.min.*",
"**/dist",
"**/LICENSE*",
"**/output",
"**/coverage",
"**/public",
"**/temp",
"**/packages-lock.json",
"**/pnpm-lock.yaml",
"**/yarn.lock",
"**/__snapshots__"
]
},
"javascript": {
"globals": [
"jest",
"withDefaults",
"$computed",
"$shallowRef",
"defineExpose",
"$toRef",
"h",
"$customRef",
"navigator",
"window",
"defineEmits",
"$ref",
"defineProps",
"document"
]
},
"overrides": [
{
"include": ["*.vue", "packages/client/*.ts"],
"include": ["**/__tests__/*.{j,t}s?(x)", "**/*.spec.{j,t}s?(x)"],
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
},
{
"include": ["*.vue"],
"linter": { "rules": { "correctness": { "noUnusedVariables": "off" } } }
},
{
"include": ["**/__tests__/*.{j,t}s?(x)", "**/*.spec.{j,t}s?(x)"],
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
},
{ "include": ["*.vue"], "linter": { "rules": {} } },
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
{ "include": ["package.json"], "linter": { "rules": {} } },
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
{ "include": ["*.js"] },
{
"include": ["scripts/**/*.*", "cli.*"],
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
},
{
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
"linter": { "rules": {} }
},
{
"include": ["**/*.md/*.*"],
"linter": {
"rules": {
"correctness": {
"noUndeclaredVariables": "off",
"noUnusedVariables": "off"
},
"suspicious": { "noConsoleLog": "off" }
}
}
},
{ "include": ["*.js"], "linter": { "rules": {} } },
{
"include": ["**/*.md/*.*"],
"linter": {
"rules": {
"correctness": {
"noInvalidUseBeforeDeclaration": "off",
"noUnusedVariables": "off"
},
"suspicious": { "noRedeclare": "off" }
}
}
},
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
{ "include": ["package.json"], "linter": { "rules": {} } },
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
{ "include": ["*.js"] },
{
"include": ["scripts/**/*.*", "cli.*"],
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
},
{
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
"linter": { "rules": {} }
},
{
"include": ["**/*.md/*.*"],
"linter": {
"rules": {
"correctness": {
"noUndeclaredVariables": "off",
"noUnusedVariables": "off"
},
"suspicious": { "noConsoleLog": "off" }
}
}
},
{ "include": ["*.js"], "linter": { "rules": {} } },
{
"include": ["**/*.md/*.*"],
"linter": {
"rules": {
"correctness": {
"noInvalidUseBeforeDeclaration": "off",
"noUnusedVariables": "off"
},
"suspicious": { "noRedeclare": "off" }
}
}
},
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"useImportType": "warn",
"useShorthandFunctionType": "warn",
"useTemplate": "warn",
"noNonNullAssertion": "off",
"useNodejsImportProtocol": "off"
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off",
"useValidTypeof": "off"
}
}
}
},
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
{ "include": ["package.json"], "linter": { "rules": {} } },
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
{ "include": ["*.js"], "linter": { "rules": {} } },
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": { "rules": { "complexity": { "noVoid": "error" } } }
},
{
"include": ["script/**/*.*", "scripts/**/*.*", "cli.*"],
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
},
{
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
"linter": { "rules": {} }
},
{
"include": ["**/*.md/*.*"],
"linter": {
"rules": {
"correctness": {
"noInvalidUseBeforeDeclaration": "off",
"noUndeclaredVariables": "off",
"noUnusedVariables": "off"
},
"style": { "useImportType": "off" },
"suspicious": { "noConsoleLog": "off", "noRedeclare": "off" }
}
}
},
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
{ "include": ["package.json"], "linter": { "rules": {} } },
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
{ "include": ["*.js"], "linter": { "rules": {} } },
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": { "rules": { "complexity": { "noVoid": "error" } } }
},
{
"include": ["script/**/*.*", "scripts/**/*.*", "cli.*"],
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
},
{
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
"linter": { "rules": {} }
},
{
"include": ["**/*.md/*.*"],
"linter": {
"rules": {
"correctness": {
"noInvalidUseBeforeDeclaration": "off",
"noUndeclaredVariables": "off",
"noUnusedVariables": "off"
},
"style": { "useImportType": "off" },
"suspicious": { "noConsoleLog": "off", "noRedeclare": "off" }
}
}
},
{ "include": ["*.md"] },
{
"include": ["**/*.md/**"],
"linter": {
"rules": {
"correctness": {
"noUndeclaredVariables": "off",
"noUnusedVariables": "off"
}
}
}
},
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off",
"useValidTypeof": "off"
}
}
}
},
{ "include": ["*.md"] },
{
"include": ["**/*.md/**"],
"linter": {
"rules": {
"correctness": {
"noUndeclaredVariables": "off",
"noUnusedVariables": "off"
}
}
}
},
{
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
"linter": {
"rules": {
"correctness": {
"noConstAssign": "off",
"noGlobalObjectCalls": "off",
"noInvalidConstructorSuper": "off",
"noNewSymbol": "off",
"noSetterReturn": "off",
"noUndeclaredVariables": "off",
"noUnreachable": "off",
"noUnreachableSuper": "off"
},
"style": {
"noArguments": "error",
"noVar": "error",
"useConst": "error"
},
"suspicious": {
"noDuplicateClassMembers": "off",
"noDuplicateObjectKeys": "off",
"noDuplicateParameters": "off",
"noFunctionAssign": "off",
"noImportAssign": "off",
"noRedeclare": "off",
"noUnsafeNegation": "off",
"useGetterReturn": "off",
"useValidTypeof": "off"
}
}
}

View file

@ -27,10 +27,10 @@ services:
interval: 5s
timeout: 5s
retries: 5
deploy:
resources:
limits:
memory: 4096M
# deploy:
# resources:
# limits:
# memory: 2048M
redis:
restart: unless-stopped
@ -45,11 +45,10 @@ services:
interval: 5s
timeout: 5s
retries: 5
# deploy:
# resources:
# limits:
# memory: 200M
# deploy:
# resources:
# limits:
# memory: 256M
db:
restart: unless-stopped
@ -66,10 +65,10 @@ services:
interval: 5s
timeout: 5s
retries: 5
# deploy:
# resources:
# limits:
# memory: 200M
# deploy:
# resources:
# limits:
# memory: 2048M
networks:
calcnet:

View file

@ -22,7 +22,7 @@
"dev": "pnpm node ./scripts/dev.mjs",
"dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start",
"lint": "pnpm run lint:ts; pnpm run lint:rs",
"lint:ts": "pnpm --filter !firefish-js -r --parallel run lint",
"lint:ts": "pnpm --filter !firefish-js --recursive run lint ; pnpm run format:ts",
"lint:rs": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt --all --",
"debug": "pnpm run build:debug && pnpm run start",
"mocha": "pnpm --filter backend run mocha",

View file

@ -13,7 +13,7 @@
"build": "pnpm tsc --project tsconfig.json ; pnpm tsc-alias --project tsconfig.json",
"build:debug": "pnpm tsc --sourceMap --project tsconfig.json ; pnpm tsc-alias --project tsconfig.json",
"watch": "pnpm tsc --project tsconfig.json --watch ; pnpm tsc-alias --project tsconfig.json --watch",
"lint": "pnpm biome check --apply **/*.ts ; pnpm run format",
"lint": "pnpm biome check --write **/*.ts",
"mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
"test": "pnpm run mocha",
"format": "pnpm biome format * --write"
@ -35,7 +35,7 @@
"archiver": "7.0.1",
"async-lock": "1.4.0",
"async-mutex": "0.5.0",
"aws-sdk": "2.1650.0",
"aws-sdk": "2.1651.0",
"axios": "1.7.2",
"backend-rs": "workspace:*",
"blurhash": "2.0.5",
@ -60,7 +60,7 @@
"gunzip-maybe": "1.4.2",
"hpagent": "1.2.0",
"ioredis": "5.4.1",
"ip-cidr": "4.0.0",
"ip-cidr": "4.0.1",
"is-svg": "5.0.1",
"jsdom": "24.1.0",
"json5": "2.2.3",
@ -164,7 +164,6 @@
"@types/websocket": "1.0.10",
"@types/ws": "8.5.10",
"cross-env": "7.0.3",
"eslint": "9.5.0",
"mocha": "10.5.2",
"pug": "3.0.3",
"strict-event-emitter-types": "2.0.0",

View file

@ -1,6 +1,5 @@
{
"compilerOptions": {
"allowJs": true,
"noEmitOnError": false,
"noImplicitAny": true,
"noImplicitReturns": true,

View file

@ -1,20 +0,0 @@
{
"extends": ["@eslint-sets/vue3", "@eslint-sets/vue3-ts"],
"plugins": ["file-progress"],
"ignorePatterns": ["**/*.json5"],
"rules": {
"file-progress/activate": 1,
"prettier/prettier": "off",
"one-var": ["warn", "never"],
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_"
}
],
"vue/no-setup-props-destructure": "off"
}
}

View file

@ -6,14 +6,13 @@
"watch": "pnpm vite build --watch --mode development",
"build": "pnpm vite build",
"build:debug": "pnpm run build",
"lint": "pnpm biome check **/*.ts --apply ; pnpm run lint:vue",
"lint:vue": "pnpm eslint src --fix '**/*.vue' --cache ; pnpm run format",
"lint": "pnpm run lint:ts ; pnpm run lint:vue",
"lint:ts": "pnpm biome check **/*.ts --write",
"lint:vue": "pnpm biome check **/*.vue --write",
"types:check": "pnpm vue-tsc --noEmit",
"format": "pnpm biome format * --write"
},
"devDependencies": {
"@eslint-sets/eslint-config-vue3": "5.13.0",
"@eslint-sets/eslint-config-vue3-ts": "3.3.0",
"@phosphor-icons/web": "2.1.1",
"@rollup/plugin-alias": "5.1.0",
"@rollup/plugin-json": "6.1.0",
@ -49,7 +48,6 @@
"cropperjs": "2.0.0-rc.0",
"date-fns": "3.6.0",
"emojilib": "3.0.12",
"eslint-plugin-file-progress": "1.4.0",
"eventemitter3": "5.0.1",
"fast-blurhash": "1.1.2",
"firefish-js": "workspace:*",

View file

@ -10,7 +10,7 @@
"build": "pnpm tsc --project tsconfig.json ; pnpm tsc-alias --project tsconfig.json",
"build:debug": "pnpm tsc --sourceMap --project tsconfig.json ; pnpm tsc-alias --project tsconfig.json",
"watch": "pnpm tsc --project tsconfig.json --watch ; pnpm tsc-alias --project tsconfig.json --watch",
"lint": "pnpm biome check --apply src",
"lint": "pnpm biome check --write src",
"format": "pnpm biome format --write src",
"jest": "jest --coverage --detectOpenHandles",
"test": "pnpm jest && pnpm tsd"

File diff suppressed because it is too large Load diff