mirror of
https://github.com/misskey-dev/misskey
synced 2025-09-05 19:02:51 +02:00
* feat: split entry file by locale name * chore: とりあえず transform hook で雑に分割 * chore: とりあえず transform 結果をいい感じに * chore: concurrent buildで高速化 * chore: vite ではローケルのないものをビルドして後処理でどうにかするように * chore: 後処理のためにi18n.jを単体になるように切り出す * chore: use typescript * chore: remove unref(i18n) in vite build process * chore: inline variable * fix: build error * fix: i18n.ts.something.replaceAll() become error * chore: ignore export specifier from error * chore: support i18n.tsx as object * chore: process literal for all files * chore: split config and locale * chore: inline locale name * chore: remove updating locale in boot common * chore: use top-level await to load locales * chore: inline locale * chore: remove loading locale from boot.js * chore: remove loading locale from boot.js * コメント追加 * fix test; fetchに失敗する * import削除ログをdebugレベルに * fix: watch pug * chore: use hash for entry files * chore: remove es-module-lexer from dependencies * chore: move to frontend-builder * chore: use inline locale in embed * chore: refetch json on hot reload * feat: store localization related to boot.js in backend in bootloaderLocales localstorage * 応急処置を戻す * fix spex * fix `Using i18n identifier "e" directly. Skipping inlining.` warning * refactor: use scriptsDir parameter * chore: remove i18n from depmap * chore: make build crash if errors * error -> warn few conditions * use inline object * update localstorage keys * remove accessing locale localstorage * fix: failed to process i18n.tsx.aaa({x:i18n.bbb})
63 lines
1.8 KiB
JavaScript
63 lines
1.8 KiB
JavaScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { execa, execaNode } from 'execa';
|
|
|
|
/** @type {import('execa').ExecaChildProcess | undefined} */
|
|
let backendProcess;
|
|
|
|
async function execBuildAssets() {
|
|
await execa('pnpm', ['run', 'build-assets'], {
|
|
cwd: '../../',
|
|
stdout: process.stdout,
|
|
stderr: process.stderr,
|
|
})
|
|
}
|
|
|
|
function execStart() {
|
|
// pnpm run start を呼び出したいが、windowsだとプロセスグループ単位でのkillが出来ずゾンビプロセス化するので
|
|
// 上記と同等の動きをするコマンドで子・孫プロセスを作らないようにしたい
|
|
backendProcess = execaNode('./built/boot/entry.js', [], {
|
|
stdout: process.stdout,
|
|
stderr: process.stderr,
|
|
env: {
|
|
'NODE_ENV': 'development',
|
|
},
|
|
});
|
|
}
|
|
|
|
async function killProc() {
|
|
if (backendProcess) {
|
|
backendProcess.catch(() => {}); // backendProcess.kill()によって発生する例外を無視するためにcatch()を呼び出す
|
|
backendProcess.kill();
|
|
await new Promise(resolve => backendProcess.on('exit', resolve));
|
|
backendProcess = undefined;
|
|
}
|
|
}
|
|
|
|
(async () => {
|
|
execaNode(
|
|
'./node_modules/nodemon/bin/nodemon.js',
|
|
[
|
|
'-w', 'src',
|
|
'-e', 'ts,js,mjs,cjs,json,pug',
|
|
'--exec', 'pnpm', 'run', 'build',
|
|
],
|
|
{
|
|
stdio: [process.stdin, process.stdout, process.stderr, 'ipc'],
|
|
serialization: "json",
|
|
})
|
|
.on('message', async (message) => {
|
|
if (message.type === 'exit') {
|
|
// かならずbuild->build-assetsの順番で呼び出したいので、
|
|
// 少々トリッキーだがnodemonからのexitイベントを利用してbuild-assets->startを行う。
|
|
// pnpm restartをbuildが終わる前にbuild-assetsが動いてしまうので、バラバラに呼び出す必要がある
|
|
|
|
await killProc();
|
|
await execBuildAssets();
|
|
execStart();
|
|
}
|
|
})
|
|
})();
|