bits-to-dead-trees 2.20.0 → 2.22.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/.github/bin/sync-node-version-from-playwright +10 -0
- package/.github/workflows/keep-dockerfile-in-sync.yml +1 -1
- package/.github/workflows/keep-node-version-in-sync.yml +25 -0
- package/.node-version +1 -1
- package/CHANGELOG.md +16 -0
- package/Dockerfile +1 -7
- package/README.md +2 -2
- package/package.json +6 -6
- package/server.js +10 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -o nounset
|
|
4
|
+
|
|
5
|
+
PATH_TO_SCRIPT=$(dirname $(realpath $0))
|
|
6
|
+
|
|
7
|
+
cd "${PATH_TO_SCRIPT}/../.." || exit 1
|
|
8
|
+
|
|
9
|
+
PLAYWRIGHT_VERSION=$(cat package-lock.json | jq -r '.dependencies."playwright-core".version')
|
|
10
|
+
docker run mcr.microsoft.com/playwright:v${PLAYWRIGHT_VERSION} sh -c "node -v | sed 's/^v//'" > .node-version
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
name: Keep node version in sync with the one the Playwright version is using
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- "depfu/update/npm/playwright-core-**"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
sync-node-version:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout Repo
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
with:
|
|
17
|
+
ref: ${{ github.head_ref }}
|
|
18
|
+
|
|
19
|
+
- name: Update .node-version
|
|
20
|
+
run: .github/bin/sync-node-version-from-playwright
|
|
21
|
+
|
|
22
|
+
- name: Commit changes
|
|
23
|
+
uses: stefanzweifel/git-auto-commit-action@v5
|
|
24
|
+
with:
|
|
25
|
+
commit_message: "🤖 Update .node-version after playwright update"
|
package/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
22.
|
|
1
|
+
22.13.1
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# bits-to-dead-trees
|
|
2
2
|
|
|
3
|
+
## 2.22.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#460](https://github.com/rmehner/bits-to-dead-trees/pull/460) [`02f8515`](https://github.com/rmehner/bits-to-dead-trees/commit/02f851538680cbf7e9abff2fc59b097863b34749) Thanks [@depfu](https://github.com/apps/depfu)! - Upgrade to PlayWright 1.50.0
|
|
8
|
+
|
|
9
|
+
## 2.21.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [#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.
|
|
14
|
+
|
|
15
|
+
This reduces the image size by one layer and one dependency by handling the signals
|
|
16
|
+
ourselves. Fastify supports graceful shutdown, so it's pretty straightforward and
|
|
17
|
+
one thing less to keep in mind.
|
|
18
|
+
|
|
3
19
|
## 2.20.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/Dockerfile
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
FROM mcr.microsoft.com/playwright:v1.
|
|
1
|
+
FROM mcr.microsoft.com/playwright:v1.50.0
|
|
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
|
|
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.
|
|
60
|
+
image: ghcr.io/rmehner/bits-to-dead-trees:v2.21.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.
|
|
4
|
+
"version": "2.22.0",
|
|
5
5
|
"description": "Turn HTML into PDF files",
|
|
6
6
|
"repository": "github:rmehner/bits-to-dead-trees",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"fastify": "^5.2.1",
|
|
34
|
-
"playwright-core": "^1.
|
|
34
|
+
"playwright-core": "^1.50.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@changesets/changelog-github": "^0.5.0",
|
|
@@ -39,9 +39,9 @@
|
|
|
39
39
|
"@eslint/js": "^9.17.0",
|
|
40
40
|
"@tsconfig/node20": "^20.1.4",
|
|
41
41
|
"@types/lodash": "^4.17.14",
|
|
42
|
-
"@types/node": "22.10.
|
|
43
|
-
"eslint": "^9.
|
|
44
|
-
"eslint-config-prettier": "^
|
|
42
|
+
"@types/node": "22.10.7",
|
|
43
|
+
"eslint": "^9.19.0",
|
|
44
|
+
"eslint-config-prettier": "^10.0.1",
|
|
45
45
|
"eslint-plugin-n": "^17.15.1",
|
|
46
46
|
"eslint-plugin-promise": "^7.2.1",
|
|
47
47
|
"globals": "^15.14.0",
|
|
@@ -49,6 +49,6 @@
|
|
|
49
49
|
"pino-pretty": "^13.0.0",
|
|
50
50
|
"prettier": "^3.4.2",
|
|
51
51
|
"typescript-json-schema": "^0.65.1",
|
|
52
|
-
"vitest": "^
|
|
52
|
+
"vitest": "^3.0.4"
|
|
53
53
|
}
|
|
54
54
|
}
|
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);
|