mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-11-25 16:37:32 +00:00
* revert(cli): hold the proxy fix and its Node floor for v0.10.0
This reverts commit 2960319749 (#8311), except a stale fallow-ignore line it had removed.
* chore(ci): allow the revert to delete the three files the proxy fix added
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import "./utils/hideChildConsoles.js";
|
|
import "./utils/windowsExeSearch.js";
|
|
import { injectDeterministicFontFaces } from "@hyperframes/producer";
|
|
import { runFontLocalize, stampFontVersions } from "./fontLocalize.js";
|
|
import { PRODUCER_VERSION, VERSION } from "./version.js";
|
|
|
|
async function readStdin(): Promise<string> {
|
|
const chunks: Buffer[] = [];
|
|
for await (const chunk of process.stdin) {
|
|
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
}
|
|
return Buffer.concat(chunks).toString("utf8");
|
|
}
|
|
|
|
/** Standalone-entry main; the bin wrapper owns the actual process exit code. */
|
|
export async function main(): Promise<number> {
|
|
return runFontLocalize(
|
|
{
|
|
readInput: readStdin,
|
|
writeOutput: (value) => process.stdout.write(value),
|
|
writeError: (value) => process.stderr.write(value),
|
|
},
|
|
async (html) => {
|
|
const localized = await injectDeterministicFontFaces(html, {
|
|
failClosedFontFetch: true,
|
|
allowSystemFontCapture: false,
|
|
});
|
|
return stampFontVersions(localized, {
|
|
producer: PRODUCER_VERSION,
|
|
localizer: VERSION,
|
|
});
|
|
},
|
|
);
|
|
}
|