2023-08-02 13:28:18 +03:00
|
|
|
import process from 'node:process'
|
2023-01-16 13:26:19 +03:00
|
|
|
import fs from 'fs-extra'
|
2023-01-02 07:53:53 +03:00
|
|
|
import { emojiPrefix, iconifyEmojiPackage } from '../config/emojis'
|
2023-01-16 13:26:19 +03:00
|
|
|
import { colorsMap } from './generate-themes'
|
2022-11-24 06:42:03 +03:00
|
|
|
|
|
|
|
const dereference = process.platform === 'win32' ? true : undefined
|
|
|
|
|
2023-01-16 13:26:19 +03:00
|
|
|
await fs.copy(`node_modules/${iconifyEmojiPackage}/icons`, `public/emojis/${emojiPrefix}`, { overwrite: true, dereference })
|
|
|
|
|
|
|
|
await fs.writeJSON('constants/themes.json', colorsMap, { spaces: 2, EOL: '\n' })
|
|
|
|
await fs.writeFile('styles/default-theme.css', `:root {\n${Object.entries(colorsMap[0][1]).map(([k, v]) => ` ${k}: ${v};`).join('\n')}\n}\n`, { encoding: 'utf-8' })
|