mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-08-03 13:56:07 +00:00
b51d5ba0a0
* refactor(gh): unify frontend diagnostics * refactor(gh): unify frontend diagnostics markdown rendering * docs(gh): restore frontend diagnostics comments * wip * fix * refactor: 呼称をbase/headに統一 * tweak * Update types.ts * fix
27 lines
939 B
TypeScript
27 lines
939 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
import { resolve } from 'node:path';
|
|
import { renderBrowserDiagnosticsHtml } from './browser/report/html';
|
|
import type { BrowserMetricsReport } from './browser/types';
|
|
|
|
async function main() {
|
|
const [baseFileArg, headFileArg, outputFileArg] = process.argv.slice(2);
|
|
if (baseFileArg == null || headFileArg == null || outputFileArg == null) {
|
|
throw new Error('Usage: render-browser-html <baseJson> <headJson> <outHtml>');
|
|
}
|
|
|
|
const base = JSON.parse(await readFile(resolve(baseFileArg), 'utf8')) as BrowserMetricsReport;
|
|
const head = JSON.parse(await readFile(resolve(headFileArg), 'utf8')) as BrowserMetricsReport;
|
|
|
|
await writeFile(resolve(outputFileArg), renderBrowserDiagnosticsHtml(base, head));
|
|
}
|
|
|
|
await main().catch(err => {
|
|
console.error(err);
|
|
process.exit(1);
|
|
});
|