From 1bece34f7e9bd61fe2c4b8c9ccc6da3a494c60f9 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 16 Oct 2023 17:18:29 +0200 Subject: [PATCH] full --- package-lock.json | 8 ++++---- package.json | 2 +- website/post.js | 15 ++++++--------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 612bb110d..1f7533dea 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "devDependencies": { "@babel/core": "^7.0.0", "@node-loader/core": "^2.0.0", - "@sparticuz/chromium-min": "^117.0.0", + "@sparticuz/chromium": "^117.0.0", "@types/babel__core": "^7.0.0", "@types/dlv": "^1.0.0", "@types/mdx": "^2.0.0", @@ -1557,10 +1557,10 @@ "win32" ] }, - "node_modules/@sparticuz/chromium-min": { + "node_modules/@sparticuz/chromium": { "version": "117.0.0", - "resolved": "https://registry.npmjs.org/@sparticuz/chromium-min/-/chromium-min-117.0.0.tgz", - "integrity": "sha512-T4UvMm7Rw1puIhLxysnU1eLAcddtGswRqpIUVjXU1adXf5gR8a2ywD+HFo/J+ZEmdSgju3uT48pJqSqEywDdmg==", + "resolved": "https://registry.npmjs.org/@sparticuz/chromium/-/chromium-117.0.0.tgz", + "integrity": "sha512-MXvxLgGt7e1bjOu6AwpemRnhrF+wxLxsHpkiOuJOLsfHAtT0VNlsnhAULQZ7hNXGhr37cTM2sCifUHwgrVH+sA==", "dev": true, "dependencies": { "follow-redirects": "^1.15.2", diff --git a/package.json b/package.json index 7499f3b85..206416399 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "devDependencies": { "@babel/core": "^7.0.0", "@node-loader/core": "^2.0.0", - "@sparticuz/chromium-min": "^117.0.0", + "@sparticuz/chromium": "^117.0.0", "@types/babel__core": "^7.0.0", "@types/dlv": "^1.0.0", "@types/mdx": "^2.0.0", diff --git a/website/post.js b/website/post.js index bc589a64a..f497d1885 100644 --- a/website/post.js +++ b/website/post.js @@ -31,7 +31,7 @@ import rehypeParse from 'rehype-parse' import rehypeSanitize, {defaultSchema} from 'rehype-sanitize' import rehypeStringify from 'rehype-stringify' import puppeteer from 'puppeteer' -import chromium from '@sparticuz/chromium-min' +import chromium from '@sparticuz/chromium' import {config} from '../docs/_config.js' import {schema} from './schema-description.js' @@ -172,9 +172,7 @@ const browser = await puppeteer.launch( ? { args: chromium.args, defaultViewport: chromium.defaultViewport, - executablePath: await chromium.executablePath( - 'https://github.com/Sparticuz/chromium/releases/download/v117.0.0/chromium-v117.0.0-pack.tar' - ), + executablePath: await chromium.executablePath(), headless: chromium.headless } : {headless: 'new'} @@ -392,16 +390,15 @@ await pAll( await fs.mkdir(path.dirname(filePath), {recursive: true}) - await fs.writeFile(filePath, screenshot, { - flag: 'wx' - }) + await fs.writeFile(filePath, screenshot, {flag: 'wx'}) console.log('catured:', filePath) await page.close() console.log('OG image `%s`', info.meta.title) - }), - {concurrency: 1} + }) ) +await browser.close() + console.log('✔ OG images')