bits-to-dead-trees 2.19.2 → 2.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.node-version CHANGED
@@ -1 +1 @@
1
- 20.18.0
1
+ 22.12.0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # bits-to-dead-trees
2
2
 
3
+ ## 2.21.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#455](https://github.com/rmehner/bits-to-dead-trees/pull/455) [`ee7af32`](https://github.com/rmehner/bits-to-dead-trees/commit/ee7af32753f14a62f460631178f68992c28f8d6d) Thanks [@rmehner](https://github.com/rmehner)! - Removes tini from the Docker dependencies.
8
+
9
+ This reduces the image size by one layer and one dependency by handling the signals
10
+ ourselves. Fastify supports graceful shutdown, so it's pretty straightforward and
11
+ one thing less to keep in mind.
12
+
13
+ ## 2.20.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#441](https://github.com/rmehner/bits-to-dead-trees/pull/441) [`b44b6a8`](https://github.com/rmehner/bits-to-dead-trees/commit/b44b6a80c99c3c5c9c3003d95f14d6e8102dd654) Thanks [@depfu](https://github.com/apps/depfu)! - Upgrade to Playwright 1.49.1.
18
+
19
+ This will switch to the new headless mode, see https://github.com/microsoft/playwright/issues/33566
20
+ for some details on that.
21
+
3
22
  ## 2.19.2
4
23
 
5
24
  ### Patch Changes
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM mcr.microsoft.com/playwright:v1.48.2
1
+ FROM mcr.microsoft.com/playwright:v1.49.1
2
2
 
3
3
  ENV NODE_ENV=production
4
4
  ENV PORT=8000
@@ -6,16 +6,10 @@ ENV SERVER_ADDRESS=0.0.0.0
6
6
 
7
7
  WORKDIR /app
8
8
 
9
- RUN apt-get update -yqq && \
10
- apt-get install -yqq --no-install-recommends tini && \
11
- apt-get clean && \
12
- rm -rf /var/lib/apt/lists/*
13
-
14
9
  COPY ["package.json", "package-lock.json*", "./"]
15
10
 
16
11
  RUN npm install --omit=dev --ignore-scripts
17
12
 
18
13
  COPY ["server.js", "app.js", "pdf_request_body.json", "./"]
19
14
 
20
- ENTRYPOINT ["tini", "-v", "--"]
21
15
  CMD ["node", "server.js"]
package/README.md CHANGED
@@ -11,7 +11,7 @@ of that. It's using [Playwright](https://playwright.dev) in the background for t
11
11
 
12
12
  ### Requirements
13
13
 
14
- 1. Node 20+
14
+ 1. Node 22+
15
15
  2. npm
16
16
 
17
17
  ### Installation
@@ -57,7 +57,7 @@ If you want to use it internally with docker-compose, this should give you a goo
57
57
  ```yml
58
58
  services:
59
59
  pdf:
60
- image: ghcr.io/rmehner/bits-to-dead-trees:v2.19.1
60
+ image: ghcr.io/rmehner/bits-to-dead-trees:v2.20.0
61
61
  ports:
62
62
  - 8000:8000
63
63
  ```
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bits-to-dead-trees",
3
3
  "author": "Robin Mehner <robin@coding-robin.de>",
4
- "version": "2.19.2",
4
+ "version": "2.21.0",
5
5
  "description": "Turn HTML into PDF files",
6
6
  "repository": "github:rmehner/bits-to-dead-trees",
7
7
  "license": "Apache-2.0",
@@ -11,7 +11,7 @@
11
11
  "playwright"
12
12
  ],
13
13
  "engines": {
14
- "node": ">= 20"
14
+ "node": ">= 22"
15
15
  },
16
16
  "main": "server.js",
17
17
  "type": "module",
@@ -23,32 +23,32 @@
23
23
  "start:dev": "nodemon --inspect server.js",
24
24
  "dump-schemas": "typescript-json-schema --noExtraProps --required --strictNullChecks types/schemas.ts PdfRequestBody --out pdf_request_body.json",
25
25
  "update-schemas": "npm run dump-schemas && npm run format",
26
- "postinstall": "npx playwright-core install chromium",
26
+ "postinstall": "npx playwright-core install chromium --only-shell",
27
27
  "add-changeset": "changeset",
28
28
  "release": "changeset publish",
29
29
  "test": "vitest --reporter verbose",
30
30
  "ts-check": "npx tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
- "fastify": "^5.0.0",
34
- "playwright-core": "^1.48.2"
33
+ "fastify": "^5.2.1",
34
+ "playwright-core": "^1.49.1"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@changesets/changelog-github": "^0.5.0",
38
- "@changesets/cli": "^2.27.9",
39
- "@eslint/js": "^9.13.0",
38
+ "@changesets/cli": "^2.27.11",
39
+ "@eslint/js": "^9.17.0",
40
40
  "@tsconfig/node20": "^20.1.4",
41
- "@types/lodash": "^4.17.12",
42
- "@types/node": "20.11.22",
43
- "eslint": "^9.13.0",
41
+ "@types/lodash": "^4.17.14",
42
+ "@types/node": "22.10.5",
43
+ "eslint": "^9.17.0",
44
44
  "eslint-config-prettier": "^9.1.0",
45
- "eslint-plugin-n": "^17.11.1",
46
- "eslint-plugin-promise": "^7.1.0",
47
- "globals": "^15.11.0",
48
- "nodemon": "^3.1.7",
49
- "pino-pretty": "^11.3.0",
50
- "prettier": "^3.3.3",
45
+ "eslint-plugin-n": "^17.15.1",
46
+ "eslint-plugin-promise": "^7.2.1",
47
+ "globals": "^15.14.0",
48
+ "nodemon": "^3.1.9",
49
+ "pino-pretty": "^13.0.0",
50
+ "prettier": "^3.4.2",
51
51
  "typescript-json-schema": "^0.65.1",
52
- "vitest": "^2.1.3"
52
+ "vitest": "^2.1.8"
53
53
  }
54
54
  }
@@ -198,7 +198,7 @@
198
198
  "type": "null"
199
199
  }
200
200
  ],
201
- "description": "Emulates `'prefers-colors-scheme'` media feature, supported values are `'light'`, `'dark'`, `'no-preference'`. See\n[page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`."
201
+ "description": "Emulates [prefers-colors-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme)\nmedia feature, supported values are `'light'` and `'dark'`. See\n[page.emulateMedia([options])](https://playwright.dev/docs/api/class-page#page-emulate-media) for more details.\nPassing `null` resets emulation to system defaults. Defaults to `'light'`."
202
202
  },
203
203
  "deviceScaleFactor": {
204
204
  "description": "Specify device scale factor (can be thought of as dpr). Defaults to `1`. Learn more about\n[emulating devices with device scale factor](https://playwright.dev/docs/emulation#devices).",
package/server.js CHANGED
@@ -18,3 +18,13 @@ const server = app({
18
18
  });
19
19
 
20
20
  await server.listen({ port: +PORT, host: SERVER_ADDRESS });
21
+
22
+ const shutdown = async () => {
23
+ console.log("Shutting down server");
24
+ await server.close();
25
+ // eslint-disable-next-line n/no-process-exit
26
+ process.exit(1);
27
+ };
28
+
29
+ process.on("SIGTERM", shutdown);
30
+ process.on("SIGINT", shutdown);