mirror of
https://gh.catmak.name/https://github.com/mihomo-party-org/mihomo-party
synced 2025-12-27 05:00:30 +08:00
chore: Format language files and remove unused files
This commit is contained in:
parent
da3f3878f1
commit
bb6021877d
@ -16,7 +16,6 @@
|
|||||||
"checksum": "node scripts/checksum.mjs",
|
"checksum": "node scripts/checksum.mjs",
|
||||||
"telegram": "node scripts/telegram.mjs",
|
"telegram": "node scripts/telegram.mjs",
|
||||||
"artifact": "node scripts/artifact.mjs",
|
"artifact": "node scripts/artifact.mjs",
|
||||||
"migrate-ui": "tsx scripts/migrate-to-heroui.ts",
|
|
||||||
"dev": "electron-vite dev",
|
"dev": "electron-vite dev",
|
||||||
"postinstall": "electron-builder install-app-deps",
|
"postinstall": "electron-builder install-app-deps",
|
||||||
"build:win": "electron-vite build && electron-builder --publish never --win",
|
"build:win": "electron-vite build && electron-builder --publish never --win",
|
||||||
|
|||||||
@ -1,44 +0,0 @@
|
|||||||
import fs from 'fs'
|
|
||||||
import path from 'path'
|
|
||||||
import { fileURLToPath } from 'url'
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
|
||||||
const __dirname = path.dirname(__filename)
|
|
||||||
|
|
||||||
const srcDir = path.join(__dirname, '..', 'src')
|
|
||||||
|
|
||||||
function replaceInFile(filePath: string): void {
|
|
||||||
let content = fs.readFileSync(filePath, 'utf8')
|
|
||||||
|
|
||||||
// 替换导入语句
|
|
||||||
content = content.replace(
|
|
||||||
/@nextui-org\/react/g,
|
|
||||||
'@heroui/react'
|
|
||||||
)
|
|
||||||
|
|
||||||
// 替换 NextUIProvider
|
|
||||||
content = content.replace(
|
|
||||||
/NextUIProvider/g,
|
|
||||||
'HeroUIProvider'
|
|
||||||
)
|
|
||||||
|
|
||||||
fs.writeFileSync(filePath, content)
|
|
||||||
}
|
|
||||||
|
|
||||||
function walkDir(dir: string): void {
|
|
||||||
const files = fs.readdirSync(dir)
|
|
||||||
|
|
||||||
files.forEach(file => {
|
|
||||||
const filePath = path.join(dir, file)
|
|
||||||
const stat = fs.statSync(filePath)
|
|
||||||
|
|
||||||
if (stat.isDirectory()) {
|
|
||||||
walkDir(filePath)
|
|
||||||
} else if (file.endsWith('.tsx') || file.endsWith('.ts')) {
|
|
||||||
replaceInFile(filePath)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
walkDir(srcDir)
|
|
||||||
console.log('Migration completed!')
|
|
||||||
@ -1,44 +0,0 @@
|
|||||||
import fs from 'fs'
|
|
||||||
import path from 'path'
|
|
||||||
import { fileURLToPath } from 'url'
|
|
||||||
|
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
|
||||||
const __dirname = path.dirname(__filename)
|
|
||||||
|
|
||||||
const srcDir = path.join(__dirname, '..', 'src')
|
|
||||||
|
|
||||||
function replaceInFile(filePath: string): void {
|
|
||||||
let content = fs.readFileSync(filePath, 'utf8')
|
|
||||||
|
|
||||||
// 替换导入语句
|
|
||||||
content = content.replace(
|
|
||||||
/@nextui-org\/react/g,
|
|
||||||
'@heroui/react'
|
|
||||||
)
|
|
||||||
|
|
||||||
// 替换 NextUIProvider
|
|
||||||
content = content.replace(
|
|
||||||
/NextUIProvider/g,
|
|
||||||
'HeroUIProvider'
|
|
||||||
)
|
|
||||||
|
|
||||||
fs.writeFileSync(filePath, content)
|
|
||||||
}
|
|
||||||
|
|
||||||
function walkDir(dir: string): void {
|
|
||||||
const files = fs.readdirSync(dir)
|
|
||||||
|
|
||||||
files.forEach(file => {
|
|
||||||
const filePath = path.join(dir, file)
|
|
||||||
const stat = fs.statSync(filePath)
|
|
||||||
|
|
||||||
if (stat.isDirectory()) {
|
|
||||||
walkDir(filePath)
|
|
||||||
} else if (file.endsWith('.tsx') || file.endsWith('.ts')) {
|
|
||||||
replaceInFile(filePath)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
walkDir(srcDir)
|
|
||||||
console.log('Migration completed!')
|
|
||||||
@ -13,7 +13,9 @@ export const GroupsProvider: React.FC<{ children: ReactNode }> = ({ children })
|
|||||||
const { data: groups, mutate } = useSWR<IMihomoMixedGroup[]>('mihomoGroups', mihomoGroups, {
|
const { data: groups, mutate } = useSWR<IMihomoMixedGroup[]>('mihomoGroups', mihomoGroups, {
|
||||||
errorRetryInterval: 200,
|
errorRetryInterval: 200,
|
||||||
errorRetryCount: 10,
|
errorRetryCount: 10,
|
||||||
refreshInterval: 1000
|
refreshInterval: 2000,
|
||||||
|
dedupingInterval: 1000,
|
||||||
|
revalidateOnFocus: false
|
||||||
})
|
})
|
||||||
|
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user