bits-to-dead-trees 2.25.1 → 2.26.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 +1 -1
- package/CHANGELOG.md +12 -0
- package/Dockerfile +1 -1
- package/README.md +1 -1
- package/package.json +10 -10
- package/test/smoke.test.js +40 -3
package/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
22.
|
|
1
|
+
22.17.0
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# bits-to-dead-trees
|
|
2
2
|
|
|
3
|
+
## 2.26.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#563](https://github.com/rmehner/bits-to-dead-trees/pull/563) [`87a1580`](https://github.com/rmehner/bits-to-dead-trees/commit/87a15807350d1f7a31e4be14a941a15fa1328f07) Thanks [@depfu](https://github.com/apps/depfu)! - Upgrade to Playwright 1.54.1
|
|
8
|
+
|
|
9
|
+
## 2.25.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`fb6003d`](https://github.com/rmehner/bits-to-dead-trees/commit/fb6003dab4774bb9d771f90d762b312081c94ca0) Thanks [@rmehner](https://github.com/rmehner)! - Upgrade to Playwright 1.53.2
|
|
14
|
+
|
|
3
15
|
## 2.25.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/Dockerfile
CHANGED
package/README.md
CHANGED
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.26.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,23 +31,23 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"fastify": "^5.4.0",
|
|
34
|
-
"playwright-core": "^1.
|
|
34
|
+
"playwright-core": "^1.54.1"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@changesets/changelog-github": "^0.5.1",
|
|
38
38
|
"@changesets/cli": "^2.29.5",
|
|
39
|
-
"@eslint/js": "^9.
|
|
39
|
+
"@eslint/js": "^9.32.0",
|
|
40
40
|
"@tsconfig/node20": "^20.1.6",
|
|
41
|
-
"@types/lodash": "^4.17.
|
|
42
|
-
"@types/node": "22.
|
|
43
|
-
"eslint": "^9.
|
|
44
|
-
"eslint-config-prettier": "^10.1.
|
|
45
|
-
"eslint-plugin-n": "^17.
|
|
41
|
+
"@types/lodash": "^4.17.20",
|
|
42
|
+
"@types/node": "22.16.5",
|
|
43
|
+
"eslint": "^9.32.0",
|
|
44
|
+
"eslint-config-prettier": "^10.1.8",
|
|
45
|
+
"eslint-plugin-n": "^17.21.3",
|
|
46
46
|
"eslint-plugin-promise": "^7.2.1",
|
|
47
|
-
"globals": "^
|
|
47
|
+
"globals": "^16.3.0",
|
|
48
48
|
"nodemon": "^3.1.10",
|
|
49
49
|
"pino-pretty": "^13.0.0",
|
|
50
|
-
"prettier": "^3.6.
|
|
50
|
+
"prettier": "^3.6.2",
|
|
51
51
|
"typescript-json-schema": "^0.65.1",
|
|
52
52
|
"vitest": "^3.2.4"
|
|
53
53
|
}
|
package/test/smoke.test.js
CHANGED
|
@@ -1,14 +1,51 @@
|
|
|
1
|
-
import { describe, expect, it } from "vitest";
|
|
1
|
+
import { describe, expect, it, beforeAll, afterAll } from "vitest";
|
|
2
|
+
import { createServer } from "node:http";
|
|
2
3
|
|
|
3
4
|
import build from "../app";
|
|
4
5
|
const app = build();
|
|
5
6
|
|
|
7
|
+
const startServer = async () => {
|
|
8
|
+
const server = createServer((req, res) => {
|
|
9
|
+
if (req.url.endsWith("success")) {
|
|
10
|
+
res.writeHead(200, { "Content-Type": "text/html" });
|
|
11
|
+
res.end(`
|
|
12
|
+
<!DOCTYPE html>
|
|
13
|
+
<html>
|
|
14
|
+
<body>
|
|
15
|
+
<h1>All local servers are beautiful</h1>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
18
|
+
`);
|
|
19
|
+
} else {
|
|
20
|
+
res.writeHead(404, { "Content-Type": "text/plain" });
|
|
21
|
+
res.end("Not Found");
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
await new Promise((resolve) => {
|
|
26
|
+
server.listen(0, "127.0.0.1", resolve);
|
|
27
|
+
});
|
|
28
|
+
return server;
|
|
29
|
+
};
|
|
30
|
+
|
|
6
31
|
describe("Smoke tests", { timeout: 10_000, retry: 3 }, () => {
|
|
32
|
+
let server;
|
|
33
|
+
let baseUrl = "";
|
|
34
|
+
|
|
35
|
+
beforeAll(async () => {
|
|
36
|
+
server = await startServer();
|
|
37
|
+
baseUrl = `http://127.0.0.1:${server.address().port}`;
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
afterAll(() => {
|
|
41
|
+
server?.close();
|
|
42
|
+
});
|
|
43
|
+
|
|
7
44
|
it("sends the PDF on the success case", async () => {
|
|
8
45
|
const response = await app.inject({
|
|
9
46
|
method: "POST",
|
|
10
47
|
url: "/pdf",
|
|
11
|
-
payload: { url:
|
|
48
|
+
payload: { url: `${baseUrl}/success` },
|
|
12
49
|
});
|
|
13
50
|
|
|
14
51
|
expect(response.payload.startsWith("%PDF")).toBeTruthy();
|
|
@@ -19,7 +56,7 @@ describe("Smoke tests", { timeout: 10_000, retry: 3 }, () => {
|
|
|
19
56
|
method: "POST",
|
|
20
57
|
url: "/pdf",
|
|
21
58
|
payload: {
|
|
22
|
-
url:
|
|
59
|
+
url: `${baseUrl}/404`,
|
|
23
60
|
},
|
|
24
61
|
});
|
|
25
62
|
|