Initial rearrangment of vuetom site source
This commit is contained in:
8
packages/docs/.vitepress/utils/lang.ts
Normal file
8
packages/docs/.vitepress/utils/lang.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import fs from 'fs'
|
||||
import path from 'path'
|
||||
|
||||
export const languages = fs.readdirSync(
|
||||
path.resolve(__dirname, '../crowdin')
|
||||
)
|
||||
|
||||
export const changeLang = (lang: string) => `/${lang}`
|
23
packages/docs/.vitepress/utils/log.ts
Normal file
23
packages/docs/.vitepress/utils/log.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import process from 'process'
|
||||
import chalk from 'chalk'
|
||||
|
||||
export function cyan(str: string) {
|
||||
console.log(chalk.cyan(str))
|
||||
}
|
||||
|
||||
export function yellow(str: string) {
|
||||
console.log(chalk.yellow(str))
|
||||
}
|
||||
|
||||
export function green(str: string) {
|
||||
console.log(chalk.green(str))
|
||||
}
|
||||
|
||||
export function red(str: string) {
|
||||
console.error(chalk.red(str))
|
||||
}
|
||||
|
||||
export function errorAndExit(e: Error): never {
|
||||
red(e.stack ?? e.message)
|
||||
process.exit(1)
|
||||
}
|
6
packages/docs/.vitepress/utils/paths.ts
Normal file
6
packages/docs/.vitepress/utils/paths.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import path from 'path'
|
||||
|
||||
export const vpRoot = path.resolve(__dirname, '..')
|
||||
export const docRoot = path.resolve(vpRoot, '..')
|
||||
export const pkgsRoot = path.resolve(docRoot, '..')
|
||||
export const projRoot = path.resolve(pkgsRoot, '..')
|
Reference in New Issue
Block a user