bits-to-dead-trees 2.19.0 → 2.19.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # bits-to-dead-trees
2
2
 
3
+ ## 2.19.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#411](https://github.com/rmehner/bits-to-dead-trees/pull/411) [`00d47af`](https://github.com/rmehner/bits-to-dead-trees/commit/00d47afb549cb1c6ff09ff1b1f9c41074d130912) Thanks [@depfu](https://github.com/apps/depfu)! - Upgrade to Playwright 1.48.2
8
+
9
+ ## 2.19.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#407](https://github.com/rmehner/bits-to-dead-trees/pull/407) [`1533530`](https://github.com/rmehner/bits-to-dead-trees/commit/1533530758577e7e0ed8673a185b8f4795b7c191) Thanks [@dependabot](https://github.com/apps/dependabot)! - Upgrade to Playwright 1.48.1
14
+
3
15
  ## 2.19.0
4
16
 
5
17
  ### Minor Changes
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM mcr.microsoft.com/playwright:v1.48.0
1
+ FROM mcr.microsoft.com/playwright:v1.48.2
2
2
 
3
3
  ENV NODE_ENV=production
4
4
  ENV PORT=8000
package/README.md CHANGED
@@ -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.18.2
60
+ image: ghcr.io/rmehner/bits-to-dead-trees:v2.19.1
61
61
  ports:
62
62
  - 8000:8000
63
63
  ```
@@ -0,0 +1,27 @@
1
+ import globals from "globals";
2
+ // @ts-ignore
3
+ import pluginJs from "@eslint/js";
4
+ // @ts-ignore
5
+ import pluginPromise from "eslint-plugin-promise";
6
+ import nodePlugin from "eslint-plugin-n";
7
+ // @ts-ignore
8
+ import eslintConfigPrettier from "eslint-config-prettier";
9
+
10
+ export default [
11
+ {
12
+ languageOptions: {
13
+ globals: globals.node,
14
+ sourceType: "module",
15
+ ecmaVersion: 2024,
16
+ },
17
+ },
18
+ pluginJs.configs.recommended,
19
+ nodePlugin.configs["flat/recommended-module"],
20
+ {
21
+ rules: {
22
+ "n/no-unpublished-import": "off",
23
+ },
24
+ },
25
+ pluginPromise.configs["flat/recommended"],
26
+ eslintConfigPrettier,
27
+ ];
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.0",
4
+ "version": "2.19.2",
5
5
  "description": "Turn HTML into PDF files",
6
6
  "repository": "github:rmehner/bits-to-dead-trees",
7
7
  "license": "Apache-2.0",
@@ -16,9 +16,9 @@
16
16
  "main": "server.js",
17
17
  "type": "module",
18
18
  "scripts": {
19
- "check-format": "prettier --check '**/*.{js,ts,json,md}'",
19
+ "check-format": "prettier --check '**/*.{js,ts,cjs,mjs,json,md}'",
20
20
  "lint": "eslint *.js",
21
- "format": "prettier --write '**/*.{js,ts,json,md}'",
21
+ "format": "prettier --write '**/*.{js,ts,cjs,mjs,json,md}'",
22
22
  "start": "node server.js",
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",
@@ -30,20 +30,25 @@
30
30
  "ts-check": "npx tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
- "fastify": "^4.28.1",
34
- "playwright-core": "^1.48.0"
33
+ "fastify": "^5.0.0",
34
+ "playwright-core": "^1.48.2"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@changesets/changelog-github": "^0.5.0",
38
38
  "@changesets/cli": "^2.27.9",
39
- "@types/lodash": "^4.17.10",
39
+ "@eslint/js": "^9.13.0",
40
+ "@tsconfig/node20": "^20.1.4",
41
+ "@types/lodash": "^4.17.12",
40
42
  "@types/node": "20.11.22",
41
- "eslint": "^8.57.0",
43
+ "eslint": "^9.13.0",
42
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",
43
48
  "nodemon": "^3.1.7",
44
- "pino-pretty": "^10.3.1",
49
+ "pino-pretty": "^11.3.0",
45
50
  "prettier": "^3.3.3",
46
- "typescript-json-schema": "^0.63.0",
47
- "vitest": "^1.6.0"
51
+ "typescript-json-schema": "^0.65.1",
52
+ "vitest": "^2.1.3"
48
53
  }
49
54
  }
@@ -618,7 +618,7 @@
618
618
  "SharedArrayBuffer": {
619
619
  "additionalProperties": false,
620
620
  "properties": {
621
- "__@species@474": {
621
+ "__@species@472": {
622
622
  "$ref": "#/definitions/SharedArrayBuffer"
623
623
  },
624
624
  "__@toStringTag@25": {
@@ -629,7 +629,7 @@
629
629
  "type": "number"
630
630
  }
631
631
  },
632
- "required": ["__@species@474", "__@toStringTag@25", "byteLength"],
632
+ "required": ["__@species@472", "__@toStringTag@25", "byteLength"],
633
633
  "type": "object"
634
634
  },
635
635
  "ViewportSize": {
package/server.js CHANGED
@@ -17,13 +17,4 @@ const server = app({
17
17
  },
18
18
  });
19
19
 
20
- const startServer = async () => {
21
- try {
22
- await server.listen({ port: +PORT, host: SERVER_ADDRESS });
23
- } catch (error) {
24
- console.error(error);
25
- process.exit(1);
26
- }
27
- };
28
-
29
- startServer();
20
+ await server.listen({ port: +PORT, host: SERVER_ADDRESS });
package/test/app.test.ts CHANGED
@@ -4,7 +4,8 @@ import { afterEach, beforeEach, describe, expect, it, vi, Mock } from "vitest";
4
4
  import build, {
5
5
  defaultBrowserContextOptions,
6
6
  defaultGotoOptions,
7
- } from "../app";
7
+ // @ts-ignore
8
+ } from "../app.js";
8
9
  const app = build();
9
10
 
10
11
  describe("GET /health", () => {
@@ -51,7 +52,7 @@ describe("POST /pdf", () => {
51
52
  newPage = vi.fn().mockResolvedValue({ goto: gotoMethod, pdf });
52
53
  newContext = vi.fn().mockResolvedValue({ newPage });
53
54
 
54
- (chromium.launch as Mock<any[], any>).mockResolvedValue({
55
+ (chromium.launch as Mock).mockResolvedValue({
55
56
  newContext,
56
57
  close,
57
58
  });
@@ -244,6 +245,9 @@ describe("POST /pdf", () => {
244
245
  },
245
246
  });
246
247
 
247
- expect(pdf.mock.results[0].value).toBeLessThan(close.mock.results[0].value);
248
+ const callOrderForPdf = pdf.mock.invocationCallOrder[0];
249
+ const callOrderForClose = close.mock.invocationCallOrder[0];
250
+
251
+ expect(callOrderForPdf).toBeLessThan(callOrderForClose);
248
252
  });
249
253
  });
package/tsconfig.json CHANGED
@@ -1,15 +1,3 @@
1
1
  {
2
- "compilerOptions": {
3
- "lib": ["es2023"],
4
-
5
- "strict": true,
6
- "moduleResolution": "node",
7
- "skipLibCheck": true,
8
- "forceConsistentCasingInFileNames": true,
9
- "resolveJsonModule": true,
10
- "esModuleInterop": true,
11
- "module": "ESNext",
12
-
13
- "checkJs": true
14
- }
2
+ "extends": "@tsconfig/node20/tsconfig.json"
15
3
  }
package/.eslintrc.json DELETED
@@ -1,12 +0,0 @@
1
- {
2
- "env": {
3
- "es2021": true,
4
- "node": true
5
- },
6
- "extends": ["eslint:recommended", "prettier"],
7
- "parserOptions": {
8
- "ecmaVersion": "latest",
9
- "sourceType": "module"
10
- },
11
- "rules": {}
12
- }