build: update all deps and migrate to biome

This commit is contained in:
Haoyu Xu
2025-10-04 02:11:24 +08:00
parent 43850d47ea
commit 5c9e9eba84
133 changed files with 834 additions and 1962 deletions

View File

@@ -0,0 +1 @@
auto_update

View File

@@ -1,5 +0,0 @@
dist
data
auto_update
config
config.yaml

View File

@@ -1,27 +0,0 @@
import { tsConfig } from '@aklive2d/eslint-config'
import tseslint from 'typescript-eslint'
import globals from 'globals'
/** @type {import('eslint').Config} */
export default tseslint.config(
...tsConfig,
{
ignores: ['dist', 'data'],
},
{
files: ['**/*.js', '**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
globals: {
...globals.node,
},
},
rules: {
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
},
}
)

View File

@@ -1,21 +1,20 @@
import { TitleLanguages } from './../config/types'
import path from 'node:path'
import { yaml, file, alphaComposite } from '@aklive2d/libs'
import config from '@aklive2d/config'
import { envParser } from '@aklive2d/libs'
import { alphaComposite, envParser, file, yaml } from '@aklive2d/libs'
import { mapping as officialInfoMapping } from '@aklive2d/official-info'
import type {
Config,
AssetsJson,
CharacterTableJson,
SkinTableJson,
} from './types.ts'
import { TitleLanguages } from './../config/types'
import {
findLogo,
findSkinEntry,
findSkel,
findSkinEntry,
getActualFilename,
} from './libs/utils.ts'
import type {
AssetsJson,
CharacterTableJson,
Config,
SkinTableJson,
} from './types.ts'
export const AUTO_UPDATE_FOLDER = path.resolve(
import.meta.dirname,

View File

@@ -1,13 +1,13 @@
import path from 'node:path'
import config from '@aklive2d/config'
import { file, alphaComposite } from '@aklive2d/libs'
import { alphaComposite, file } from '@aklive2d/libs'
import operators, {
DIST_DIR,
OPERATOR_SOURCE_FOLDER,
generateAssetsJson,
OPERATOR_SOURCE_FOLDER,
} from '../index.ts'
import { getExtractedFolder, getDistFolder } from './utils.ts'
import type { PortraitHub, PortraitJson } from '../types.ts'
import { getDistFolder, getExtractedFolder } from './utils.ts'
export const build = async (namesToBuild: string[]) => {
const names = !namesToBuild.length ? Object.keys(operators) : namesToBuild

View File

@@ -1,14 +1,14 @@
import path from 'node:path'
import { stringify } from 'yaml'
import { yaml, file } from '@aklive2d/libs'
import config from '@aklive2d/config'
import { file, yaml } from '@aklive2d/libs'
import { mapping as officialInfoMapping } from '@aklive2d/official-info'
import { CONFIG_PATH, skinTable, CONFIG_FOLDER } from '../index.ts'
import { stringify } from 'yaml'
import { CONFIG_FOLDER, CONFIG_PATH, skinTable } from '../index.ts'
import {
getVoiceFolders,
getExtractedFolder,
findSkinEntry,
findCodename,
findSkinEntry,
getExtractedFolder,
getVoiceFolders,
} from './utils.ts'
export const init = (name: string, id: string) => {

View File

@@ -1,6 +1,6 @@
import path from 'node:path'
import { githubDownload } from '@aklive2d/downloader'
import config from '@aklive2d/config'
import { githubDownload } from '@aklive2d/downloader'
import { AUTO_UPDATE_FOLDER } from '../index.ts'
export const update = async () => {

View File

@@ -1,16 +1,16 @@
import path from 'node:path'
import unidecode from 'unidecode'
import config from '@aklive2d/config'
import { DIST_DIR, OPERATOR_SOURCE_FOLDER } from '../index.ts'
import { file } from '@aklive2d/libs'
import type { OfficialInfoOperatorConfigV2 } from '@aklive2d/official-info/types'
import unidecode from 'unidecode'
import { DIST_DIR, OPERATOR_SOURCE_FOLDER } from '../index.ts'
import {
CharacterTableJson,
SkinTableJson,
OperatorEntryType,
SkinTableJsonCharSkinEntry,
Codename,
OperatorEntryType,
SkinTableJson,
SkinTableJsonCharSkinEntry,
} from '../types.ts'
import type { OfficialInfoOperatorConfigV2 } from '@aklive2d/official-info/types'
export const getExtractedFolder = (name: string) => {
return path.join(OPERATOR_SOURCE_FOLDER, name, config.dir_name.extracted)

View File

@@ -6,26 +6,23 @@
"type": "module",
"dependencies": {
"@aklive2d/config": "workspace:*",
"@aklive2d/eslint-config": "workspace:*",
"@aklive2d/libs": "workspace:*",
"@aklive2d/official-info": "workspace:*",
"@aklive2d/prettier-config": "workspace:*",
"unidecode": "^1.1.0",
"yaml": "^2.7.0"
"yaml": "^2.8.1"
},
"peerDependencies": {
"globals": ">=16.0.0",
"typescript-eslint": ">=8.31.1",
"typescript": ">=5.8.2"
"typescript": ">=5.9.3"
},
"scripts": {
"update": "mode=update bun runner.ts",
"build": "mode=build bun runner.ts",
"init": "mode=init bun runner.ts",
"lint": "eslint && prettier --check .",
"lint": "biome lint --write .",
"lint:fix": "biome check --write .",
"build:cleanup": "rm -rf ./dist ./data"
},
"devDependencies": {
"@types/unidecode": "^1.1.0"
}
}
}

View File

@@ -1,11 +0,0 @@
import baseConfig from '@aklive2d/prettier-config'
/**
* @type {import("prettier").Config}
*/
const config = {
...baseConfig,
semi: false,
}
export default config

View File

@@ -1,6 +1,6 @@
import { envParser } from '@aklive2d/libs'
import { init } from './libs/initer.ts'
import { build } from './libs/builder.ts'
import { init } from './libs/initer.ts'
import { update } from './libs/updater.ts'
type Args = {