refactor: trim PR debloat and fix transformers build

Extract shared helpers for home notices, timetable subtitles, and theme images; dedupe global search, Select, and build scripts while preserving behaviour.

Add @huggingface/transformers as a direct dependency and resolve ORT WASM paths via require.resolve so pnpm postinstall and Vite can bundle vector search.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-28 10:30:25 +09:30
parent dcb4dd2f5e
commit 4fda63dedd
76 changed files with 2003 additions and 4149 deletions
+20 -35
View File
@@ -1,15 +1,8 @@
/**
* Package Chrome/Firefox build folders into zip files Windows Explorer can open.
* Git Bash `tar -a` on CI often produces zips that fail to unzip on Windows.
* Package Chrome/Firefox build folders into Windows-friendly zip files.
*/
import { execFileSync } from "node:child_process";
import {
appendFileSync,
existsSync,
mkdirSync,
readFileSync,
unlinkSync,
} from "node:fs";
import { appendFileSync, existsSync, mkdirSync, readFileSync, unlinkSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
@@ -18,29 +11,27 @@ const root = join(dirname(fileURLToPath(import.meta.url)), "..");
function zipDirectory(sourceRel, outRel) {
const sourceDir = join(root, sourceRel);
const outZip = join(root, outRel);
if (!existsSync(sourceDir)) {
throw new Error(`Missing build output: ${sourceRel}`);
}
if (!existsSync(sourceDir)) throw new Error(`Missing build output: ${sourceRel}`);
mkdirSync(dirname(outZip), { recursive: true });
if (existsSync(outZip)) {
unlinkSync(outZip);
}
if (existsSync(outZip)) unlinkSync(outZip);
if (process.platform === "win32") {
const ps = [
"Add-Type -AssemblyName System.IO.Compression.FileSystem",
`[IO.Compression.ZipFile]::CreateFromDirectory('${sourceDir.replace(/'/g, "''")}', '${outZip.replace(/'/g, "''")}')`,
].join("; ");
execFileSync("powershell", ["-NoProfile", "-Command", ps], {
stdio: "inherit",
});
const esc = (s) => s.replace(/'/g, "''");
execFileSync(
"powershell",
[
"-NoProfile",
"-Command",
[
"Add-Type -AssemblyName System.IO.Compression.FileSystem",
`[IO.Compression.ZipFile]::CreateFromDirectory('${esc(sourceDir)}', '${esc(outZip)}')`,
].join("; "),
],
{ stdio: "inherit" },
);
} else {
execFileSync("zip", ["-r", "-q", outZip, "."], {
cwd: sourceDir,
stdio: "inherit",
});
execFileSync("zip", ["-r", "-q", outZip, "."], { cwd: sourceDir, stdio: "inherit" });
}
}
@@ -48,7 +39,6 @@ const pkg = JSON.parse(readFileSync(join(root, "package.json"), "utf8"));
const version = process.argv[2] || pkg.version;
const updateChannel = process.env.UPDATE_CHANNEL || "stable";
const buildLabel = process.env.BUILD_LABEL || "";
const base =
updateChannel === "nightly" && buildLabel
? `betterseqtaplus-nightly-${buildLabel}`
@@ -59,13 +49,8 @@ const firefoxZip = `dist/${base}-firefox.zip`;
zipDirectory("dist/chrome", chromeZip);
zipDirectory("dist/firefox", firefoxZip);
console.log(`Packaged ${chromeZip}`);
console.log(`Packaged ${firefoxZip}`);
console.log(`Packaged ${chromeZip}\nPackaged ${firefoxZip}`);
if (process.env.GITHUB_OUTPUT) {
appendFileSync(
process.env.GITHUB_OUTPUT,
`chrome_zip=${chromeZip}\nfirefox_zip=${firefoxZip}\n`,
);
appendFileSync(process.env.GITHUB_OUTPUT, `chrome_zip=${chromeZip}\nfirefox_zip=${firefoxZip}\n`);
}