diff --git a/.eslintrc.cjs b/.eslintrc.cjs deleted file mode 100644 index daf8dd4..0000000 --- a/.eslintrc.cjs +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - extends: ['@ayuhito/eslint-config'], -}; diff --git a/bun.lockb b/bun.lockb index 7799fe1..c6bacdb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index d089a1f..fd05e8f 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "p-queue": "^7.4.1", "pathe": "^1.1.1", "picocolors": "^1.0.0", - "puppeteer": "^21.1.1", + "puppeteer": "^23.11.1", "stylis": "^4.3.0", "zod": "^3.22.2" }, diff --git a/src/license.ts b/src/license.ts index c1b24dd..c8a6dd4 100644 --- a/src/license.ts +++ b/src/license.ts @@ -112,7 +112,7 @@ const processTable = (tableHTML: string) => { * {@link https://fonts.google.com/attribution} */ export const parseLicenses = async () => { - const browser = await puppeteer.launch({ headless: 'new' }); + const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); // We only need html, skip css and font downloads await page.setRequestInterception(true); diff --git a/src/variable-gen.ts b/src/variable-gen.ts index a4ffabe..adfcafb 100644 --- a/src/variable-gen.ts +++ b/src/variable-gen.ts @@ -81,6 +81,10 @@ const processTable = (tableHTML: string) => { writeArray.push(results[key]); } + if (writeArray.length === 0) { + throw new Error('No variable font datapoints found.'); + } + fs.writeFileSync( join( dirname(fileURLToPath(import.meta.url)), @@ -101,7 +105,7 @@ const processTable = (tableHTML: string) => { */ export const fetchVariable = async () => { // Need to use Puppeteer to let JavaScript load page elements fully - const browser = await puppeteer.launch({ headless: 'new' }); + const browser = await puppeteer.launch({ headless: true }); const page = await browser.newPage(); await page.goto(url, { waitUntil: 'networkidle0' });