🔨 Refactor(custom): remove unused file

This commit is contained in:
Kuingsmile
2026-01-16 17:37:12 +08:00
parent 081f629c2b
commit 7f3f59c106
4 changed files with 1 additions and 105 deletions

View File

@@ -1,27 +0,0 @@
import { readFileSync, writeFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import yaml from 'yaml'
const languageFileName = 'zh-CN.yml'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const i18nFolder = join(__dirname, '../resources/i18n')
const typeFolder = join(__dirname, '../src/universal/types')
const languageFile = join(i18nFolder, languageFileName)
const langFile = readFileSync(languageFile, 'utf8')
const obj = yaml.parseDocument(langFile).toJSON()
const keys = Object.keys(obj)
const types = `export interface ILocales {
${keys.map(key => `${key}: string`).join('\n ')}
}
export type ILocalesKey = keyof ILocales
`
writeFileSync(join(typeFolder, 'i18n.ts'), types)