Implement big text view and preliminary i18n
This commit is contained in:
21
packages/web/scripts/build-i18n-yml-typedef.js
Executable file
21
packages/web/scripts/build-i18n-yml-typedef.js
Executable file
@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
const fs = require("fs")
|
||||
const { resolve } = require("path")
|
||||
const { load } = require("js-yaml")
|
||||
|
||||
const ymlPath = resolve(__dirname, "../src/i18n/texts.yml")
|
||||
const json = load(fs.readFileSync(ymlPath, "utf-8"))
|
||||
|
||||
const dtsPath = ymlPath + ".d.ts"
|
||||
fs.writeFileSync(
|
||||
dtsPath,
|
||||
`type Translation = Record<string, string>;
|
||||
declare const exportee: {
|
||||
${Object.keys(json)
|
||||
.map(x => `${x}: Translation;`)
|
||||
.join("\n ")}
|
||||
};
|
||||
export default exportee;
|
||||
`
|
||||
)
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
yarn build
|
||||
npx vite build
|
||||
NODE_ENV=production ./esbuild.js
|
||||
./scripts/build-package-json.js
|
||||
./node_modules/.bin/electron-builder build
|
Reference in New Issue
Block a user