mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
feat: updates
This commit is contained in:
parent
ce757215a3
commit
c1cd31840e
86 changed files with 1048 additions and 778 deletions
|
|
@ -10,21 +10,13 @@ export type Conversion = {
|
|||
const filenamesToType = (conversions: Conversion[]): Plugin => {
|
||||
const generateTypes = async (conversion: Conversion) => {
|
||||
const filenames = await fs.readdir(conversion.dictionary).catch(reason => {
|
||||
console.error(
|
||||
'vite-plugin-filenames-to-type: unable to read directory. ',
|
||||
reason
|
||||
)
|
||||
console.error('vite-plugin-filenames-to-type: unable to read directory. ', reason)
|
||||
return []
|
||||
})
|
||||
if (!filenames.length) return
|
||||
|
||||
const iconNames = filenames.map(
|
||||
fileName => `'${fileName.replace(/\.[^.]+$/, '')}'`
|
||||
)
|
||||
await fs.writeFile(
|
||||
conversion.typeFile,
|
||||
`export type IconNames = ${iconNames.join(' | ')}`
|
||||
)
|
||||
const iconNames = filenames.map(fileName => `'${fileName.replace(/\.[^.]+$/, '')}'`)
|
||||
await fs.writeFile(conversion.typeFile, `export type IconNames = ${iconNames.join(' | ')}`)
|
||||
}
|
||||
|
||||
const findConversion = (filePath: string) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue