Skip to content

Commit

Permalink
Update dependency puppeteer to v15 (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrossetie authored Jul 22, 2022
1 parent 0a27de7 commit 2e3e488
Show file tree
Hide file tree
Showing 29 changed files with 102 additions and 58 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
build/
test/output
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
*_temp.html
test/reference/output/
/test/output/*.pdf
/test/fixtures/*.html
!/test/fixtures/*docinfo*-pdf.html
Expand Down
127 changes: 72 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"test:smoke": "./bin/asciidoctor-pdf --version",
"test:js": "mocha test/**_test.js",
"lint": "standard lib/**.js test/**.js tasks/**js",
"publish": "node tasks/publish.js"
"publish": "node tasks/publish.js",
"test:update-reference": "docker build -f test/Dockerfile -t asciidoctor-web-pdf/test . && docker run --name asciidoctorwebpdftest asciidoctor-web-pdf/test:latest && docker cp asciidoctorwebpdftest:/app/test/output ./test/reference/"
},
"repository": {
"type": "git",
Expand All @@ -55,7 +56,7 @@
"html-entities": "^2.1.0",
"mathjax": "3.2.0",
"pdf-lib": "^1.2.1",
"puppeteer": "11.0.0",
"puppeteer": "15.4.0",
"yargs": "17.3.1"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tasks/prepare-binaries.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ async function getBrowsers (platforms, showProgress) {
platform: puppeteerPlatform, // one of: linux, mac, win32 or win64
path: path.resolve(path.join(buildDirPath, name, 'chromium'))
})
.download(puppeteer._preferredRevision, function (downloadBytes, totalBytes) {
.download(puppeteer.default._preferredRevision, function (downloadBytes, totalBytes) {
if (showProgress) {
downloadProgress[name] = Math.round(downloadBytes / totalBytes * 100)
const entries = Object.entries(downloadProgress)
Expand Down
22 changes: 22 additions & 0 deletions test/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM node:16.16.0-bullseye-slim

RUN addgroup --gid 1001 asciidoc && adduser --disabled-password --ingroup asciidoc -u 1001 asciidoc

RUN apt-get update \
&& apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libgbm-dev libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libnss3 lsb-release xdg-utils poppler-utils wget \
&& rm -rf /var/lib/apt/lists/*

USER asciidoc
WORKDIR /app

COPY --chown=asciidoc:asciidoc lib ./lib
COPY --chown=asciidoc:asciidoc bin ./bin
COPY --chown=asciidoc:asciidoc css ./css
COPY --chown=asciidoc:asciidoc fonts ./fonts
COPY --chown=asciidoc:asciidoc test ./test

COPY --chown=asciidoc:asciidoc package.json package-lock.json ./
RUN npm ci

ENV DEBUG=1
CMD npm t
Binary file modified test/reference/document-with-counters.pdf
Binary file not shown.
Binary file modified test/reference/document-with-left-toc.pdf
Binary file not shown.
Binary file modified test/reference/document-with-stem.pdf
Binary file not shown.
Binary file modified test/reference/list.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified test/reference/repeat-table-elements.pdf
Binary file not shown.
Binary file modified test/reference/title-page-background-color.pdf
Binary file not shown.

0 comments on commit 2e3e488

Please sign in to comment.