style: linted files and added lint:fix
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
"lint:fix": "biome check --write .",
|
||||
"build:cleanup": "rm -rf ./dist"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
"lint:fix": "biome check --write .",
|
||||
"build:cleanup": "rm -rf ./dist"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@
|
||||
"lint": "biome lint --write .",
|
||||
"lint:fix": "biome check --write ."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
"@types/yauzl-promise": "^4.0.1",
|
||||
"@types/yazl": "^3.3.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,25 +89,36 @@ 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])
|
||||
if (!musicFileMapping[background]) {
|
||||
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.`
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
@@ -16,4 +16,4 @@
|
||||
"lint": "biome lint --write .",
|
||||
"lint:fix": "biome check --write ."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,9 +158,10 @@ const generateMapping = () => {
|
||||
: operatorInfo.skinName['en-US']
|
||||
const skinEntry = findSkinEntry(skinTable, name, type)
|
||||
operator.filename = skinEntry.dynIllustId.replace(/_2$/, '')
|
||||
operator.portrait_filename = type === 'skin'
|
||||
? skinEntry.skinId.replace(/@/, '_')
|
||||
: `${skinEntry.charId}_2`
|
||||
operator.portrait_filename =
|
||||
type === 'skin'
|
||||
? skinEntry.skinId.replace(/@/, '_')
|
||||
: `${skinEntry.charId}_2`
|
||||
operator.fallback_name = `${operator.portrait_filename}${operator.isSP ? '_sp' : ''}`
|
||||
|
||||
const regions = Object.keys(
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
@@ -25,4 +25,4 @@
|
||||
"devDependencies": {
|
||||
"@types/unidecode": "^1.1.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
"lint": "biome lint --write .",
|
||||
"lint:fix": "biome check --write ."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
"lint": "biome lint --write .",
|
||||
"lint:fix": "biome check --write ."
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user