mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 02:15:01 +00:00
Revive compile skin script and convert to typescript
This commit is contained in:
parent
51859506db
commit
15b15d081a
3 changed files with 357 additions and 357 deletions
File diff suppressed because one or more lines are too long
|
|
@ -49,7 +49,7 @@
|
|||
"format": "prettier --write \"**/*.{js,ts,tsx,d.ts,css}\"",
|
||||
"integration-tests": "jest --config=config/jest.integration.js --runInBand",
|
||||
"build-skin": "rm assets/skins/base-2.91.wsz && cd assets/skins/base-2.91 && zip -x .* -x 'Skining Updates.txt' -r ../base-2.91.wsz .",
|
||||
"compile-skin": "node scripts/compileSkin.js > css/base-skin.css",
|
||||
"compile-skin": "npx tsx scripts/compileSkin.ts > css/base-skin.css",
|
||||
"skin-info": "unzip -vl assets/skins/base-2.91.wsz",
|
||||
"build-presets": "node scripts/parsePresetFiles.js > presets/builtin.json"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
const puppeteer = require("puppeteer");
|
||||
import puppeteer from "puppeteer";
|
||||
|
||||
// const DATA_URI = /url\([^)]+\)/g;
|
||||
|
||||
(async () => {
|
||||
(async (): Promise<void> => {
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
// TODO: allow the skin to be passed in via the CLI.
|
||||
|
|
@ -12,7 +12,7 @@ const puppeteer = require("puppeteer");
|
|||
);
|
||||
} catch (e) {
|
||||
console.error(
|
||||
"Error connecting to localhost:8080. Are you running the dev server?",
|
||||
"Error connecting to localhost:5173. Are you running the dev server?",
|
||||
"\n\n",
|
||||
e
|
||||
);
|
||||
|
|
@ -22,13 +22,13 @@ const puppeteer = require("puppeteer");
|
|||
// TODO: Wait for node to be ready
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
try {
|
||||
const css = await page.evaluate(
|
||||
() => document.getElementById("webamp-skin").innerText
|
||||
const css: string = await page.evaluate(
|
||||
() => document.getElementById("webamp-skin")?.innerText || ""
|
||||
);
|
||||
console.log(css);
|
||||
} catch (e) {
|
||||
console.error("Hit an error, putting a screenshot in ./error.png");
|
||||
page.screenshot({ path: "./error.png" });
|
||||
await page.screenshot({ path: "./error.png" });
|
||||
throw e;
|
||||
} finally {
|
||||
await browser.close();
|
||||
Loading…
Add table
Add a link
Reference in a new issue