style: linted files and added lint:fix
This commit is contained in:
@@ -196,9 +196,7 @@ export default function Home() {
|
||||
key={index}
|
||||
>
|
||||
<section
|
||||
className={
|
||||
classes.content
|
||||
}
|
||||
className={classes.content}
|
||||
>
|
||||
<section
|
||||
className={
|
||||
@@ -239,7 +237,8 @@ export default function Home() {
|
||||
'zh-CN'
|
||||
? entry.type ===
|
||||
'skin'
|
||||
? `${entry
|
||||
? `${
|
||||
entry
|
||||
.skinName[
|
||||
'zh-CN'
|
||||
]
|
||||
|
||||
@@ -24,7 +24,9 @@ export function useConfig() {
|
||||
const compiledIds = operators.map((item) => item.official_id.toString())
|
||||
const updatedIds = data.info.map((item) => item.id.toString())
|
||||
const newIds = difference(updatedIds, compiledIds)
|
||||
setNewOperators(data.info.filter((item) => newIds.includes(item.id.toString())))
|
||||
setNewOperators(
|
||||
data.info.filter((item) => newIds.includes(item.id.toString()))
|
||||
)
|
||||
}, [])
|
||||
|
||||
return { config, operators, newOperators, fetchOfficialUpdate }
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"preview:directory": "turbo run preview:directory --ui tui",
|
||||
"preview": "http-server ./dist",
|
||||
"lint": "turbo run lint",
|
||||
"lint:fix": "turbo run lint:fix",
|
||||
"update": "turbo run update",
|
||||
"init": "turbo run init",
|
||||
"download:game": "turbo run download:game",
|
||||
|
||||
@@ -48,7 +48,9 @@ const download = async (
|
||||
})
|
||||
mapping.musicFiles.map((item) => {
|
||||
if (!file.exists(path.join(item.source, item.filename))) {
|
||||
const filename = item.filename.replace('.ogg', '').replace(/_(intro|loop)/, "")
|
||||
const filename = item.filename
|
||||
.replace('.ogg', '')
|
||||
.replace(/_(intro|loop)/, '')
|
||||
itemToDownload.add(filename)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import path from 'node:path'
|
||||
import { files as backgroundFiles } from '@aklive2d/background'
|
||||
import config from '@aklive2d/config'
|
||||
import { githubDownload } from '@aklive2d/downloader'
|
||||
import {files as backgroundFiles} from "@aklive2d/background"
|
||||
import { file } from '@aklive2d/libs'
|
||||
import type {
|
||||
AudioDataTable,
|
||||
@@ -89,23 +89,34 @@ const generateMapping = () => {
|
||||
for (const e of musicFiles) {
|
||||
const musicPath = path.join(e.source, e.filename)
|
||||
if (!file.exists(musicPath)) {
|
||||
throw new Error(`Music file ${e.filename} is not found in music folder.`)
|
||||
throw new Error(
|
||||
`Music file ${e.filename} is not found in music folder.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for (const e of Object.keys(musicFileMapping)) {
|
||||
if (!backgroundFiles.includes(e)) {
|
||||
throw new Error(`Background file ${e} is not found in background folder.`)
|
||||
throw new Error(
|
||||
`Background file ${e} is not found in background folder.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
for (const background of backgroundFiles) {
|
||||
if (!musicFileMapping[background]) {
|
||||
const alternativeMatch = background.replace(/_(form)(.*)(\.png)$/, "$3")
|
||||
if (musicFileMapping[alternativeMatch]){
|
||||
musicFileMapping[background] = structuredClone(musicFileMapping[alternativeMatch])
|
||||
const alternativeMatch = background.replace(
|
||||
/_(form)(.*)(\.png)$/,
|
||||
'$3'
|
||||
)
|
||||
if (musicFileMapping[alternativeMatch]) {
|
||||
musicFileMapping[background] = structuredClone(
|
||||
musicFileMapping[alternativeMatch]
|
||||
)
|
||||
} else {
|
||||
throw new Error(`Music mapping for background file ${background} is not found in music mapping.`)
|
||||
throw new Error(
|
||||
`Music mapping for background file ${background} is not found in music mapping.`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +158,8 @@ const generateMapping = () => {
|
||||
: operatorInfo.skinName['en-US']
|
||||
const skinEntry = findSkinEntry(skinTable, name, type)
|
||||
operator.filename = skinEntry.dynIllustId.replace(/_2$/, '')
|
||||
operator.portrait_filename = type === 'skin'
|
||||
operator.portrait_filename =
|
||||
type === 'skin'
|
||||
? skinEntry.skinId.replace(/@/, '_')
|
||||
: `${skinEntry.charId}_2`
|
||||
operator.fallback_name = `${operator.portrait_filename}${operator.isSP ? '_sp' : ''}`
|
||||
|
||||
@@ -73,7 +73,8 @@ const generateAssets = async (name: string) => {
|
||||
) as string
|
||||
if (!portraitHubContent) throw new Error('portrait_hub.json not found')
|
||||
const portraitHub: PortraitHub = JSON.parse(portraitHubContent)
|
||||
const portrait_filename_lowerCase = operators[name].portrait_filename.toLowerCase()
|
||||
const portrait_filename_lowerCase =
|
||||
operators[name].portrait_filename.toLowerCase()
|
||||
const portraitItem = portraitHub._sprites.find(
|
||||
(item) => item.name.toLowerCase() === portrait_filename_lowerCase
|
||||
)
|
||||
|
||||
196
turbo.json
196
turbo.json
@@ -8,7 +8,9 @@
|
||||
"../../packages/assets/dist/**",
|
||||
"src/**"
|
||||
],
|
||||
"dependsOn": ["@aklive2d/showcase#build:directory"],
|
||||
"dependsOn": [
|
||||
"@aklive2d/showcase#build:directory"
|
||||
],
|
||||
"persistent": true
|
||||
},
|
||||
"@aklive2d/directory#build:directory": {
|
||||
@@ -18,59 +20,97 @@
|
||||
"../../packages/assets/dist/**",
|
||||
"src/**"
|
||||
],
|
||||
"outputs": ["../../dist/index.html", "../../dist/_assets/**"],
|
||||
"dependsOn": ["@aklive2d/showcase#build:directory"]
|
||||
"outputs": [
|
||||
"../../dist/index.html",
|
||||
"../../dist/_assets/**"
|
||||
],
|
||||
"dependsOn": [
|
||||
"@aklive2d/showcase#build:directory"
|
||||
]
|
||||
},
|
||||
"@aklive2d/showcase#build:directory": {
|
||||
"env": ["name"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$",
|
||||
"../../packages/assets/dist/**",
|
||||
"src/**"
|
||||
],
|
||||
"outputs": ["../../release/**"],
|
||||
"dependsOn": ["@aklive2d/assets#build"]
|
||||
"outputs": [
|
||||
"../../release/**"
|
||||
],
|
||||
"dependsOn": [
|
||||
"@aklive2d/assets#build"
|
||||
]
|
||||
},
|
||||
"@aklive2d/showcase#build": {
|
||||
"env": ["name"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$",
|
||||
"../../packages/assets/dist/**",
|
||||
"src/**"
|
||||
],
|
||||
"outputs": ["../../release/**"],
|
||||
"dependsOn": ["@aklive2d/assets#build"]
|
||||
"outputs": [
|
||||
"../../release/**"
|
||||
],
|
||||
"dependsOn": [
|
||||
"@aklive2d/assets#build"
|
||||
]
|
||||
},
|
||||
"@aklive2d/background#build": {
|
||||
"inputs": ["../music/auto_update/music_table.json"],
|
||||
"outputs": ["dist/bg_*.png", "dist/operator_bg.png"]
|
||||
"inputs": [
|
||||
"../music/auto_update/music_table.json"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/bg_*.png",
|
||||
"dist/operator_bg.png"
|
||||
]
|
||||
},
|
||||
"@aklive2d/charword-table#build": {
|
||||
"env": ["name"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"inputs": [
|
||||
"../official-info/auto_update/official_info.json",
|
||||
"../operator/operators.yaml"
|
||||
],
|
||||
"outputs": ["dist/**/charword_table.json"]
|
||||
"outputs": [
|
||||
"dist/**/charword_table.json"
|
||||
]
|
||||
},
|
||||
"@aklive2d/operator#build": {
|
||||
"env": ["name"],
|
||||
"dependsOn": ["@aklive2d/charword-table#build"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"@aklive2d/charword-table#build"
|
||||
],
|
||||
"inputs": [
|
||||
"../official-info/auto_update/official_info.json",
|
||||
"operators.yaml"
|
||||
],
|
||||
"outputs": ["dist/**"]
|
||||
"outputs": [
|
||||
"dist/**"
|
||||
]
|
||||
},
|
||||
"@aklive2d/project-json#build": {
|
||||
"env": ["name"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"@aklive2d/background#build",
|
||||
"@aklive2d/charword-table#build",
|
||||
"@aklive2d/music#build"
|
||||
],
|
||||
"inputs": ["../operator/operators.yaml"],
|
||||
"outputs": ["dist/**"]
|
||||
"inputs": [
|
||||
"../operator/operators.yaml"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/**"
|
||||
]
|
||||
},
|
||||
"@aklive2d/assets#build": {
|
||||
"dependsOn": [
|
||||
@@ -79,22 +119,40 @@
|
||||
"@aklive2d/operator#build",
|
||||
"@aklive2d/project-json#build"
|
||||
],
|
||||
"outputs": ["dist/**"]
|
||||
"outputs": [
|
||||
"dist/**"
|
||||
]
|
||||
},
|
||||
"build": {
|
||||
"env": ["name"],
|
||||
"dependsOn": ["^build"],
|
||||
"inputs": ["$TURBO_DEFAULT$"],
|
||||
"outputs": ["release/**"]
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$"
|
||||
],
|
||||
"outputs": [
|
||||
"release/**"
|
||||
]
|
||||
},
|
||||
"build:directory": {
|
||||
"env": ["name"],
|
||||
"inputs": ["$TURBO_DEFAULT$"],
|
||||
"outputs": ["dist/**"]
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"inputs": [
|
||||
"$TURBO_DEFAULT$"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/**"
|
||||
]
|
||||
},
|
||||
"@aklive2d/charword-table#update": {
|
||||
"cache": false,
|
||||
"outputs": ["auto_update/charword_table*.json"]
|
||||
"outputs": [
|
||||
"auto_update/charword_table*.json"
|
||||
]
|
||||
},
|
||||
"@aklive2d/music#update": {
|
||||
"cache": false,
|
||||
@@ -106,74 +164,118 @@
|
||||
},
|
||||
"@aklive2d/official-info#update": {
|
||||
"cache": false,
|
||||
"outputs": ["auto_update/official_info.json"]
|
||||
"outputs": [
|
||||
"auto_update/official_info.json"
|
||||
]
|
||||
},
|
||||
"update": {
|
||||
"cache": false
|
||||
},
|
||||
"@aklive2d/operator#init": {
|
||||
"env": ["name", "id"],
|
||||
"env": [
|
||||
"name",
|
||||
"id"
|
||||
],
|
||||
"cache": false,
|
||||
"inputs": ["../official-info/auto_update/official_info.json"],
|
||||
"outputs": ["config/*.yaml", "config.yaml"]
|
||||
"inputs": [
|
||||
"../official-info/auto_update/official_info.json"
|
||||
],
|
||||
"outputs": [
|
||||
"config/*.yaml",
|
||||
"config.yaml"
|
||||
]
|
||||
},
|
||||
"init": {
|
||||
"env": ["name", "id"],
|
||||
"env": [
|
||||
"name",
|
||||
"id"
|
||||
],
|
||||
"cache": false
|
||||
},
|
||||
"lint": {
|
||||
"cache": false
|
||||
},
|
||||
"lint:fix": {
|
||||
"cache": false
|
||||
},
|
||||
"dev:directory": {
|
||||
"env": ["name"],
|
||||
"dependsOn": ["^@aklive2d/assets#build"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"^@aklive2d/assets#build"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"preview:directory": {
|
||||
"env": ["name"],
|
||||
"dependsOn": ["^@aklive2d/assets#build"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"^@aklive2d/assets#build"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"dev:showcase": {
|
||||
"env": ["name"],
|
||||
"dependsOn": ["^@aklive2d/assets#build"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"^@aklive2d/assets#build"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"preview:showcase": {
|
||||
"env": ["name"],
|
||||
"dependsOn": ["^@aklive2d/showcase#build"],
|
||||
"env": [
|
||||
"name"
|
||||
],
|
||||
"dependsOn": [
|
||||
"^@aklive2d/showcase#build"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
},
|
||||
"@aklive2d/assets#download:game": {
|
||||
"cache": false,
|
||||
"outputs": ["data/**"]
|
||||
"outputs": [
|
||||
"data/**"
|
||||
]
|
||||
},
|
||||
"download:game": {
|
||||
"cache": false
|
||||
},
|
||||
"@aklive2d/assets#build:cleanup": {
|
||||
"cache": false,
|
||||
"dependsOn": ["@aklive2d/directory#build"]
|
||||
"dependsOn": [
|
||||
"@aklive2d/directory#build"
|
||||
]
|
||||
},
|
||||
"@aklive2d/background#build:cleanup": {
|
||||
"cache": false,
|
||||
"dependsOn": ["@aklive2d/directory#build"]
|
||||
"dependsOn": [
|
||||
"@aklive2d/directory#build"
|
||||
]
|
||||
},
|
||||
"@aklive2d/charword-table#build:cleanup": {
|
||||
"cache": false,
|
||||
"dependsOn": ["@aklive2d/directory#build"]
|
||||
"dependsOn": [
|
||||
"@aklive2d/directory#build"
|
||||
]
|
||||
},
|
||||
"@aklive2d/music#build:cleanup": {
|
||||
"cache": false,
|
||||
"dependsOn": ["@aklive2d/directory#build"]
|
||||
"dependsOn": [
|
||||
"@aklive2d/directory#build"
|
||||
]
|
||||
},
|
||||
"@aklive2d/operator#build:cleanup": {
|
||||
"cache": false,
|
||||
"dependsOn": ["@aklive2d/directory#build"]
|
||||
"dependsOn": [
|
||||
"@aklive2d/directory#build"
|
||||
]
|
||||
},
|
||||
"build:cleanup": {
|
||||
"cache": false
|
||||
|
||||
Reference in New Issue
Block a user