Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to node 20 and other misc improvements #23

Merged
merged 1 commit into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: volta-cli/action@v1
with:
node-version: 18.x
node-version: 20.x
yarn-version: 1.x
- name: Install Dependencies
run: yarn install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"access": "public"
},
"volta": {
"node": "18.16.0",
"node": "20.9.0",
"yarn": "3.6.4"
}
}
8 changes: 5 additions & 3 deletions src/services/pdf-generation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { executablePath } from 'puppeteer';
import puppeteer, { PDFOptions } from 'puppeteer-core';
import report from 'puppeteer-report';

Expand Down Expand Up @@ -30,7 +31,7 @@
});
console.log(`Puppeteer visited page located at ${pdfGenerationRequest.url}`);
const options = { ...htmlToPdfPrintOptions, ...pdfGenerationRequest.pdfOptions };
await report.pdfPage(page as any, {

Check warning on line 34 in src/services/pdf-generation.ts

View workflow job for this annotation

GitHub Actions / Tests

Unexpected any. Specify a different type
path: pdfGenerationRequest.localFilePath,
...options
});
Expand All @@ -41,11 +42,12 @@
}

async launchBrowser(pdfGenerationRequest: PdfGenerationRequest) {
const chromiumPath = await chromium.executablePath();
const chromiumPath = process.env.IS_LOCAL ? executablePath() : await chromium.executablePath();
const options = {
args: chromium.args,
args: process.env.IS_LOCAL ? process.env.BROWSER_ARGS?.split(',') ?? ['--no-sandbox'] : chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: chromiumPath,
headless: !!process?.env?.BROWSER_HEADLESS === false ? false : true,
headless: chromium.headless as boolean,
...pdfGenerationRequest.browserOptions
};

Expand Down
Loading