bits-to-dead-trees 2.22.0 → 2.23.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/eslint.config.js +1 -1
- package/package.json +12 -12
- package/pdf_request_body.json +13 -1
- package/test/smoke.test.js +26 -30
package/.node-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
22.
|
|
1
|
+
22.14.0
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# bits-to-dead-trees
|
|
2
2
|
|
|
3
|
+
## 2.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#491](https://github.com/rmehner/bits-to-dead-trees/pull/491) [`3fb6115`](https://github.com/rmehner/bits-to-dead-trees/commit/3fb611563421710f94dfecfc80ec20fb1cdb98f1) Thanks [@depfu](https://github.com/apps/depfu)! - Update to Playwright 1.51.0
|
|
8
|
+
|
|
9
|
+
## 2.22.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#468](https://github.com/rmehner/bits-to-dead-trees/pull/468) [`4d3b7a1`](https://github.com/rmehner/bits-to-dead-trees/commit/4d3b7a14723534a64ec4101c431ec2c129fba807) Thanks [@depfu](https://github.com/apps/depfu)! - Upgrade to Playwright 1.50.1
|
|
14
|
+
|
|
3
15
|
## 2.22.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/Dockerfile
CHANGED
package/README.md
CHANGED
package/eslint.config.js
CHANGED
|
@@ -5,7 +5,7 @@ import pluginJs from "@eslint/js";
|
|
|
5
5
|
import pluginPromise from "eslint-plugin-promise";
|
|
6
6
|
import nodePlugin from "eslint-plugin-n";
|
|
7
7
|
// @ts-ignore
|
|
8
|
-
import eslintConfigPrettier from "eslint-config-prettier";
|
|
8
|
+
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
9
9
|
|
|
10
10
|
export default [
|
|
11
11
|
{
|
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.23.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,24 +31,24 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"fastify": "^5.2.1",
|
|
34
|
-
"playwright-core": "^1.
|
|
34
|
+
"playwright-core": "^1.51.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@changesets/changelog-github": "^0.5.
|
|
38
|
-
"@changesets/cli": "^2.
|
|
39
|
-
"@eslint/js": "^9.
|
|
37
|
+
"@changesets/changelog-github": "^0.5.1",
|
|
38
|
+
"@changesets/cli": "^2.28.1",
|
|
39
|
+
"@eslint/js": "^9.22.0",
|
|
40
40
|
"@tsconfig/node20": "^20.1.4",
|
|
41
|
-
"@types/lodash": "^4.17.
|
|
41
|
+
"@types/lodash": "^4.17.16",
|
|
42
42
|
"@types/node": "22.10.7",
|
|
43
|
-
"eslint": "^9.
|
|
44
|
-
"eslint-config-prettier": "^10.
|
|
45
|
-
"eslint-plugin-n": "^17.
|
|
43
|
+
"eslint": "^9.22.0",
|
|
44
|
+
"eslint-config-prettier": "^10.1.1",
|
|
45
|
+
"eslint-plugin-n": "^17.16.2",
|
|
46
46
|
"eslint-plugin-promise": "^7.2.1",
|
|
47
|
-
"globals": "^15.
|
|
47
|
+
"globals": "^15.15.0",
|
|
48
48
|
"nodemon": "^3.1.9",
|
|
49
49
|
"pino-pretty": "^13.0.0",
|
|
50
|
-
"prettier": "^3.
|
|
50
|
+
"prettier": "^3.5.3",
|
|
51
51
|
"typescript-json-schema": "^0.65.1",
|
|
52
|
-
"vitest": "^3.0.
|
|
52
|
+
"vitest": "^3.0.8"
|
|
53
53
|
}
|
|
54
54
|
}
|
package/pdf_request_body.json
CHANGED
|
@@ -200,6 +200,18 @@
|
|
|
200
200
|
],
|
|
201
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
|
+
"contrast": {
|
|
204
|
+
"anyOf": [
|
|
205
|
+
{
|
|
206
|
+
"enum": ["more", "no-preference"],
|
|
207
|
+
"type": "string"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"type": "null"
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"description": "Emulates `'prefers-contrast'` media feature, supported values are `'no-preference'`, `'more'`. 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 `'no-preference'`."
|
|
214
|
+
},
|
|
203
215
|
"deviceScaleFactor": {
|
|
204
216
|
"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).",
|
|
205
217
|
"type": "number"
|
|
@@ -442,11 +454,11 @@
|
|
|
442
454
|
"type": "array"
|
|
443
455
|
},
|
|
444
456
|
"origins": {
|
|
445
|
-
"description": "localStorage to set for context",
|
|
446
457
|
"items": {
|
|
447
458
|
"additionalProperties": false,
|
|
448
459
|
"properties": {
|
|
449
460
|
"localStorage": {
|
|
461
|
+
"description": "localStorage to set for context",
|
|
450
462
|
"items": {
|
|
451
463
|
"additionalProperties": false,
|
|
452
464
|
"properties": {
|
package/test/smoke.test.js
CHANGED
|
@@ -3,38 +3,34 @@ import { describe, expect, it } from "vitest";
|
|
|
3
3
|
import build from "../app";
|
|
4
4
|
const app = build();
|
|
5
5
|
|
|
6
|
-
describe(
|
|
7
|
-
"
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
url: "/pdf",
|
|
13
|
-
payload: { url: "https://coding-robin.de" },
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
expect(response.payload.startsWith("%PDF")).toBeTruthy();
|
|
6
|
+
describe("Smoke tests", { timeout: 10_000, retry: 3 }, () => {
|
|
7
|
+
it("sends the PDF on the success case", async () => {
|
|
8
|
+
const response = await app.inject({
|
|
9
|
+
method: "POST",
|
|
10
|
+
url: "/pdf",
|
|
11
|
+
payload: { url: "https://coding-robin.de" },
|
|
17
12
|
});
|
|
18
13
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
expect(response.payload.startsWith("%PDF")).toBeTruthy();
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("returns an error object when the page could not be loaded", async () => {
|
|
18
|
+
const response = await app.inject({
|
|
19
|
+
method: "POST",
|
|
20
|
+
url: "/pdf",
|
|
21
|
+
payload: {
|
|
22
|
+
url: "https://httpstat.us/404",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
expect(response.statusCode).toEqual(404);
|
|
27
|
+
const error = JSON.parse(response.body);
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
});
|
|
29
|
+
expect(error).toMatchObject({
|
|
30
|
+
error: true,
|
|
31
|
+
status: 404,
|
|
32
|
+
statusText: "Not Found",
|
|
33
|
+
message: "404 ", // yup, the space at the end is intentional
|
|
37
34
|
});
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
);
|
|
35
|
+
});
|
|
36
|
+
});
|