pdf-visual-compare 3.4.0 → 4.0.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.
Files changed (58) hide show
  1. package/README.md +326 -72
  2. package/out/comparePdf.d.ts +48 -6
  3. package/out/comparePdf.js +44 -78
  4. package/out/const.d.ts +2 -2
  5. package/out/const.js +5 -3
  6. package/out/errors/ComparePdfComparisonError.d.ts +6 -0
  7. package/out/errors/ComparePdfComparisonError.js +10 -0
  8. package/out/errors/ComparePdfConfigurationError.d.ts +6 -0
  9. package/out/errors/ComparePdfConfigurationError.js +10 -0
  10. package/out/errors/ComparePdfError.d.ts +6 -0
  11. package/out/errors/ComparePdfError.js +13 -0
  12. package/out/errors/ComparePdfInputError.d.ts +6 -0
  13. package/out/errors/ComparePdfInputError.js +10 -0
  14. package/out/errors/ComparePdfRenderingError.d.ts +6 -0
  15. package/out/errors/ComparePdfRenderingError.js +10 -0
  16. package/out/index.d.ts +16 -2
  17. package/out/index.js +14 -2
  18. package/out/internal/adapters/comparePngOptions.d.ts +3 -0
  19. package/out/internal/adapters/comparePngOptions.js +41 -0
  20. package/out/internal/adapters/pdfRenderOptions.d.ts +3 -0
  21. package/out/internal/adapters/pdfRenderOptions.js +19 -0
  22. package/out/internal/comparePlannedPage.d.ts +3 -0
  23. package/out/internal/comparePlannedPage.js +72 -0
  24. package/out/internal/diffOutputGuards.d.ts +56 -0
  25. package/out/internal/diffOutputGuards.js +176 -0
  26. package/out/internal/normalizeComparisonOptions.d.ts +2 -0
  27. package/out/internal/normalizeComparisonOptions.js +104 -0
  28. package/out/internal/normalizePdfInput.d.ts +13 -0
  29. package/out/internal/normalizePdfInput.js +110 -0
  30. package/out/internal/pageComparisonPlan.d.ts +4 -0
  31. package/out/internal/pageComparisonPlan.js +35 -0
  32. package/out/internal/renderOutputFolderGuards.d.ts +22 -0
  33. package/out/internal/renderOutputFolderGuards.js +70 -0
  34. package/out/internal/renderPdfPages.d.ts +10 -0
  35. package/out/internal/renderPdfPages.js +105 -0
  36. package/out/internal/securePath.d.ts +34 -0
  37. package/out/internal/securePath.js +75 -0
  38. package/out/internal/types.d.ts +26 -0
  39. package/out/internal/types.js +2 -0
  40. package/out/types/ComparePdfDetailedResult.d.ts +35 -0
  41. package/out/types/ComparePdfDetailedResult.js +2 -0
  42. package/out/types/ComparePdfOptions.d.ts +33 -11
  43. package/out/types/ComparePdfPageResult.d.ts +42 -0
  44. package/out/types/ComparePdfPageResult.js +2 -0
  45. package/out/types/ComparePdfPageStatus.d.ts +4 -0
  46. package/out/types/ComparePdfPageStatus.js +2 -0
  47. package/out/types/ExcludedPageArea.d.ts +3 -33
  48. package/out/types/PageArea.d.ts +13 -0
  49. package/out/types/PageArea.js +2 -0
  50. package/out/types/PageExclusion.d.ts +46 -0
  51. package/out/types/PageExclusion.js +2 -0
  52. package/out/types/PdfInput.d.ts +11 -0
  53. package/out/types/PdfInput.js +2 -0
  54. package/out/types/PdfRenderOptions.d.ts +51 -0
  55. package/out/types/PdfRenderOptions.js +2 -0
  56. package/out/types/RgbColor.d.ts +11 -0
  57. package/out/types/RgbColor.js +2 -0
  58. package/package.json +86 -74
package/package.json CHANGED
@@ -1,75 +1,87 @@
1
1
  {
2
- "name": "pdf-visual-compare",
3
- "version": "3.4.0",
4
- "description": "Visual regression testing library for PDFs in Js/Ts without binary and OS dependencies.",
5
- "keywords": [
6
- "pdf",
7
- "pdf regression",
8
- "pdf test",
9
- "pdf compare",
10
- "compare pdf",
11
- "pdf diff",
12
- "visual regression"
13
- ],
14
- "homepage": "https://github.com/dichovsky/pdf-visual-compare#readme",
15
- "bugs": {
16
- "url": "https://github.com/dichovsky/pdf-visual-compare/issues"
17
- },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/dichovsky/pdf-visual-compare.git"
21
- },
22
- "funding": {
23
- "type": "buymeacoffee",
24
- "url": "https://buymeacoffee.com/dichovsky"
25
- },
26
- "license": "MIT",
27
- "author": "Igor Magdich <magdich.igor@gmail.com>",
28
- "main": "./out/index.js",
29
- "types": "./out/index.d.ts",
30
- "exports": {
31
- ".": {
32
- "require": "./out/index.js",
33
- "types": "./out/index.d.ts",
34
- "default": "./out/index.js"
35
- }
36
- },
37
- "files": [
38
- "./out"
39
- ],
40
- "scripts": {
41
- "prebuild": "npm run clean",
42
- "build": "tsc --pretty",
43
- "clean": "rimraf ./out ./coverage ./test-results ./comparePdfOutput",
44
- "docker:build": "docker build --compress -t test-pdf-visual-compare .",
45
- "predocker:run": "npm run clean",
46
- "docker:run": "docker run --rm -it -v $PWD/test-results:/usr/pkg/test-results test-pdf-visual-compare",
47
- "docker:test": "vitest run",
48
- "lint": "eslint .",
49
- "lint:fix": "npm run lint -- --fix",
50
- "pretest": "npm run clean && npm run lint && npm run test:license && npm run build",
51
- "test": "vitest run --coverage",
52
- "test:docker": "npm run docker:build && npm run docker:run",
53
- "test:license": "npx --yes license-checker --production --onlyAllow \"ISC; MIT; MIT OR X11; BSD; Apache-2.0; Unlicense\""
54
- },
55
- "dependencies": {
56
- "pdf-to-png-converter": "~3.14.0",
57
- "png-visual-compare": "~4.1.0"
58
- },
59
- "devDependencies": {
60
- "@types/node": "^25.3.2",
61
- "@types/pngjs": "^6.0.5",
62
- "@vitest/coverage-v8": "^4.0.18",
63
- "eslint": "^10.0.2",
64
- "jiti": "^2.6.1",
65
- "rimraf": "^6.1.3",
66
- "ts-node": "^10.9.2",
67
- "typescript": "^5.9.3",
68
- "typescript-eslint": "^8.56.1",
69
- "vitest": "^4.0.18"
70
- },
71
- "engines": {
72
- "node": ">=20",
73
- "yarn": "please-use-npm"
74
- }
75
- }
2
+ "name": "pdf-visual-compare",
3
+ "version": "4.0.0",
4
+ "description": "Visual regression testing library for PDFs in Js/Ts without external system package dependencies.",
5
+ "keywords": [
6
+ "pdf",
7
+ "pdf regression",
8
+ "pdf test",
9
+ "pdf compare",
10
+ "compare pdf",
11
+ "pdf diff",
12
+ "visual regression",
13
+ "pdf testing",
14
+ "visual-diff"
15
+ ],
16
+ "homepage": "https://github.com/dichovsky/pdf-visual-compare#readme",
17
+ "bugs": {
18
+ "url": "https://github.com/dichovsky/pdf-visual-compare/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/dichovsky/pdf-visual-compare.git"
23
+ },
24
+ "funding": {
25
+ "type": "buymeacoffee",
26
+ "url": "https://buymeacoffee.com/dichovsky"
27
+ },
28
+ "license": "MIT",
29
+ "author": "Igor Magdich <magdich.igor@gmail.com>",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./out/index.d.ts",
33
+ "require": "./out/index.js",
34
+ "default": "./out/index.js"
35
+ }
36
+ },
37
+ "main": "./out/index.js",
38
+ "types": "./out/index.d.ts",
39
+ "files": [
40
+ "./out"
41
+ ],
42
+ "scripts": {
43
+ "prebuild": "npm run clean",
44
+ "build": "tsc --pretty -p ./tsconfig.prod.json",
45
+ "clean": "rimraf ./out ./coverage ./test-results ./comparePdfOutput",
46
+ "codemap": "node --disable-warning=ExperimentalWarning --experimental-strip-types scripts/generate-codemap.ts",
47
+ "codemap:check": "node --disable-warning=ExperimentalWarning --experimental-strip-types scripts/generate-codemap.ts --check",
48
+ "docker:build": "docker build --compress -t test-pdf-visual-compare .",
49
+ "predocker:run": "npm run clean && mkdir -p ./test-results && chmod 777 ./test-results",
50
+ "docker:run": "docker run --rm -it -v \"$PWD/test-results:/usr/pkg/test-results\" test-pdf-visual-compare",
51
+ "docker:test": "vitest run",
52
+ "format": "prettier --write .",
53
+ "format:check": "prettier --check .",
54
+ "lint": "eslint .",
55
+ "lint:fix": "npm run lint -- --fix",
56
+ "prepublishOnly": "npm test",
57
+ "pretest": "npm run clean && npm run lint && npm run codemap:check && npm run test:license && npm run build && npm run test:types && npm run test:artifacts",
58
+ "test": "vitest run --coverage",
59
+ "test:artifacts": "node ./__tests__/published-artifacts/verify-built-package.mjs",
60
+ "test:docker": "npm run docker:build && npm run docker:run",
61
+ "test:license": "npx --yes license-checker --production --onlyAllow \"ISC; MIT; MIT OR X11; BSD; Apache-2.0; Unlicense; MPL-2.0\"",
62
+ "test:types": "tsc --pretty -p ./tsconfig.json"
63
+ },
64
+ "dependencies": {
65
+ "pdf-to-png-converter": "~4.1.1",
66
+ "png-visual-compare": "~6.2.0"
67
+ },
68
+ "devDependencies": {
69
+ "@types/node": "^26.0.0",
70
+ "@types/pngjs": "^6.0.5",
71
+ "@vitest/coverage-v8": "^4.1.9",
72
+ "eslint": "^10.5.0",
73
+ "jiti": "^2.7.0",
74
+ "prettier": "~3.8.4",
75
+ "rimraf": "^6.1.3",
76
+ "typescript": "^6.0.3",
77
+ "typescript-eslint": "^8.61.1",
78
+ "vitest": "^4.1.9"
79
+ },
80
+ "engines": {
81
+ "node": ">=24"
82
+ },
83
+ "os": [
84
+ "darwin",
85
+ "linux"
86
+ ]
87
+ }