Files
WebSpeak-client-for-TeamSpeak/web/scripts/build-classic-skin.mjs
T
OddTurtleHead 25b0a01ae7 feat(skins): bundle the Classic 4.1.16 skin with the client
Add Classic (community.ts3-classic-console) as a bundled skin next to KAAK: example sources under docs/examples/ts3-classic-console, a reproducible skin:classic:build script that also packs chrome.json and writes identical archives to docs/examples/ and web/public/skins/, a built-in catalog entry and bundled package URL, and admin registry protection against replace, disable and delete. Classic stays outside the official consent-free skin list, so visitors without instance consent still see only Day, Night and ILLUSIA.
2026-12-04 13:43:49 +08:00

23 lines
1.2 KiB
JavaScript

import { readFile, writeFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { zipSync } from "fflate";
// Classic release 4.1.16 layout: the five package files sit at the ZIP root,
// in this order, and the archive also carries the skin's chrome.json.
const sourceDirectory = new URL("../../docs/examples/ts3-classic-console/", import.meta.url);
const sourceFiles = ["manifest.json", "skin.css", "content.json", "components.json", "chrome.json"];
const files = Object.fromEntries(await Promise.all(sourceFiles.map(async (name) => [
name,
await readFile(new URL(name, sourceDirectory)),
])));
// Fixed ZIP timestamp (local-component constructor, independent of the build
// machine's time zone) so rebuilding reproduces the published 4.1.16 archive
// byte for byte instead of stamping the current time.
const releaseTimestamp = new Date(2026, 11, 4, 13, 10, 52);
const archive = zipSync(files, { level: 9, mtime: releaseTimestamp });
await Promise.all([
writeFile(fileURLToPath(new URL("../../docs/examples/ts3-classic-console.wskin", import.meta.url)), archive),
writeFile(fileURLToPath(new URL("../public/skins/ts3-classic-console.wskin", import.meta.url)), archive),
]);