1
0
mirror of https://git.sr.ht/~cadence/bibliogram synced 2024-11-24 17:07:31 +00:00

Add screenshot tester

This commit is contained in:
Cadence Ember 2020-06-21 04:09:36 +12:00
parent b439158cbc
commit ee2626924a
No known key found for this signature in database
GPG Key ID: 128B99B1B74A6412
17 changed files with 860 additions and 12 deletions

2
.gitignore vendored
View File

@ -15,3 +15,5 @@ users_export.json
# Test stuff
/coverage
/.nyc_output
/test/screenshots/diff
/test/screenshots/staging

1
.taprc
View File

@ -1,2 +1,3 @@
coverage-report: "lcov"
no-browser: true
test-ignore: "^test/screenshots/commands\\.js"

707
package-lock.json generated
View File

@ -264,6 +264,366 @@
"rimraf": "^2.6.3"
}
},
"@jimp/bmp": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/bmp/-/bmp-0.13.0.tgz",
"integrity": "sha512-7i/XZLoK5JETBKO0VL7qjnr6WDVl1X8mmaUk6Lzq06/veMPC5IwUIZi1JRVAXPEwTf5uUegq0WFnmUS0lVYzFw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"bmp-js": "^0.1.0"
}
},
"@jimp/core": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/core/-/core-0.13.0.tgz",
"integrity": "sha512-BMFEUm5HbRP4yCo4Q23CJFx/v6Yr3trw7rERmS1GKUEooDq9ktApZWWTvWq/vggKyysKX0nQ+KT+FaFD/75Q+Q==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"any-base": "^1.1.0",
"buffer": "^5.2.0",
"exif-parser": "^0.1.12",
"file-type": "^9.0.0",
"load-bmfont": "^1.3.1",
"mkdirp": "^0.5.1",
"phin": "^2.9.1",
"pixelmatch": "^4.0.2",
"tinycolor2": "^1.4.1"
}
},
"@jimp/custom": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/custom/-/custom-0.13.0.tgz",
"integrity": "sha512-Zir/CHoLRhQDGfPWueCIQbVjVUlayNIUch9fulq4M9V2S+ynHx9BqRn58z8wy+mk8jm1WlpRVhvZ8QUenbL0vg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/core": "^0.13.0"
}
},
"@jimp/gif": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/gif/-/gif-0.13.0.tgz",
"integrity": "sha512-7FO2Fa9FZluqGt1MM/L8s6P5UEedxrIQT2eBAxzB8Z82YTTSWQXw4bdrZWCwiQjBFZwKTIaULIfw6+TxA/Q2XA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"gifwrap": "^0.9.2",
"omggif": "^1.0.9"
}
},
"@jimp/jpeg": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/jpeg/-/jpeg-0.13.0.tgz",
"integrity": "sha512-Fol/DxA1lnIzCsNx/CckIEoyWImQHiWPgFAWL5s7VIVaJrEFnnbRqfOxmvr8yWg8mh3hWLeXNcxqA82CKXgg+Q==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"jpeg-js": "^0.4.0"
}
},
"@jimp/plugin-blit": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.13.0.tgz",
"integrity": "sha512-roCShFZosJgRMLCLzuOT1pRZysQF/p3avQieZiu9pfg2F9X09f91OauU2Lf3/yOp0TZCWbheqbem9MPlhyED8w==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-blur": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.13.0.tgz",
"integrity": "sha512-LeBhQe72bRk2fe2AftcqcDaWgSu6vFD0fxiAYYMy3pHa8pnPAwnw2W3u4bV/gc5XJt6AJzoRyc7WVG2pE4A3gg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-circle": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-circle/-/plugin-circle-0.13.0.tgz",
"integrity": "sha512-INwIl8zgWnJYXxYkNhIjG8TXg2Q1nh008SDKyC+Pug4ce/XRJC8w/Gk6HS+U9Z2tIO2/zXv473k/JaiwvDMu1w==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-color": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.13.0.tgz",
"integrity": "sha512-e71UDivZdZGOhQRLjDo4a0BKgrH858HJ7zFk7/Yti58LwgeIGjYHhuYc+xQOdnBWPzGSD47TuFX5GXmf/x1nmg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"tinycolor2": "^1.4.1"
}
},
"@jimp/plugin-contain": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-contain/-/plugin-contain-0.13.0.tgz",
"integrity": "sha512-qPYS+ccMP4mEnf7BB0bcaszUTth8OxeRX0MdMvU6PDEI0nIvVVNwmuI6YtNqqs12PwuYxgPkq6AFenyLyoNP1g==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-cover": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-cover/-/plugin-cover-0.13.0.tgz",
"integrity": "sha512-S2GkbXNgIb0afof/NLLq9IJDZPOcFtu1mc32ngt9S8HzXsNHgRAzONW7cg56bwQ6p0+sz/dS5tB4ctOW/pu/Dw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-crop": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.13.0.tgz",
"integrity": "sha512-Y1Ug3kOzsq72EjLiWQlwkHuvUvdSmFUDtxpyOXh3RxeWF7wmdjH8FvdhPj8hWvFLsDYFgWGaLI4Z6SXOr+N8nA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-displace": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-displace/-/plugin-displace-0.13.0.tgz",
"integrity": "sha512-c80VIUjIqQoavafthLpYRZdzANCxbOCHzqkFVbZ0kNKJnDDk6fW55mvVW4TJLDToDU81WMlttCmNV0oXcX93gQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-dither": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-dither/-/plugin-dither-0.13.0.tgz",
"integrity": "sha512-EUz/y/AaQ00TnaiVLVAXLz8n8Nx7S36lKi4VXPeYy5a5FyzBimxNiKxdITVe9zooN7+H4FP++/xGFGFMpfWtRg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-fisheye": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-fisheye/-/plugin-fisheye-0.13.0.tgz",
"integrity": "sha512-O7h5pNTk2sYcTKxLvV6+zzUpLx8qzdNl6qiP9x1S0CKy64oZ9IwtK1eR1eLom0YA8tUR7rX5Ra4pB8bhq8Oyqw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-flip": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-flip/-/plugin-flip-0.13.0.tgz",
"integrity": "sha512-gWk+Q0LmCvupUuWRfoGyETmH/+lJKZuPCeA9K6UHJldq5Cdg/3MrlKUNS1HcPCDXjw+dWDGC8QnNslvMTaY5VQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-gaussian": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-gaussian/-/plugin-gaussian-0.13.0.tgz",
"integrity": "sha512-0ctRqbCcLdy8y9IrSIH2McWNPLnEwjoe8qxtqoi51zRsM3z3mwjiTC2q8AWeF0SdIdWwV+YV/eP0494AJqjTsg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-invert": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-invert/-/plugin-invert-0.13.0.tgz",
"integrity": "sha512-k7TWx/la0MrTcT1dMtncV6I9IuGToRm9Q0ekzfb3k8bHzWRYX4SUtt/WrZ/I+/znD/fGorLtFI057v7mcLJc5A==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-mask": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-mask/-/plugin-mask-0.13.0.tgz",
"integrity": "sha512-U3OdsgtMNpbCYc1lzzu96zdSgyz7BK9eD8IoFHdw4Ma8gCuM8kp9gdBJlKnzOh8eyYvssdCMZOWz9Xbxc5xH9A==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-normalize": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-normalize/-/plugin-normalize-0.13.0.tgz",
"integrity": "sha512-yKOgZSvOxSHNlh+U9NOQH4Drgca0Dwb7DQRk3vj67gvHQC96JafIpGwN+9V4fP89lA3rkItbw6xgN6C/28HEUQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-print": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-print/-/plugin-print-0.13.0.tgz",
"integrity": "sha512-Tv7r/1t7z63oLeRuEWw9xbm0G5uuBE54986+BOu8OFaHBpV/BbVHrE7ouApA0mKVZqMZCVjhO6Ph8+uFzRjdOw==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"load-bmfont": "^1.4.0"
}
},
"@jimp/plugin-resize": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.13.0.tgz",
"integrity": "sha512-XOo0Skn7aq/aGxV9czFx6EaBUbAsAGCVbAS26fMM0AZ4YAWWUEleKTpHunEo92giIPhvlxeFFjQR2jQ9UcB3uQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-rotate": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.13.0.tgz",
"integrity": "sha512-BaNeh655kF9Rz01ZV+Bkc8hLsHpNu3QnzigruVDjGt9Paoig0EBr+Dgyjje+7eTLu20kyuyxwPUAxLSOiPiraQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-scale": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.13.0.tgz",
"integrity": "sha512-e/f7lvii+DmRMgYF+uBKQy437f+J66WbL0FcFEataCF/W9UkTIQGeXdECwJSPfqr81SxC5mGbSBbsdbMKChzAQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-shadow": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-shadow/-/plugin-shadow-0.13.0.tgz",
"integrity": "sha512-qObtH63dmfPLze5wE8XDRjDsBOUnAfEWib4YbjPXGBZVxeKD7+2oPGemsK56HqC/+rYzIynkbi4MUIV1Q0dGjA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugin-threshold": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugin-threshold/-/plugin-threshold-0.13.0.tgz",
"integrity": "sha512-ACF7jk0ogso+2RK+0EsvBupVfE3IMq39wGFQWgpnHR9Tj12mSO279f6i/H8bcj1ZXmHot22nwLOG0wO4AlAaRg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0"
}
},
"@jimp/plugins": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/plugins/-/plugins-0.13.0.tgz",
"integrity": "sha512-onu8GnSnFjLFuFVFq8+aTYFIDfH8kwZuBHeGaDyScPFFn6QMKsPl4TeLzQ5vwIPvcpkADuFFfuAshE4peutjjA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/plugin-blit": "^0.13.0",
"@jimp/plugin-blur": "^0.13.0",
"@jimp/plugin-circle": "^0.13.0",
"@jimp/plugin-color": "^0.13.0",
"@jimp/plugin-contain": "^0.13.0",
"@jimp/plugin-cover": "^0.13.0",
"@jimp/plugin-crop": "^0.13.0",
"@jimp/plugin-displace": "^0.13.0",
"@jimp/plugin-dither": "^0.13.0",
"@jimp/plugin-fisheye": "^0.13.0",
"@jimp/plugin-flip": "^0.13.0",
"@jimp/plugin-gaussian": "^0.13.0",
"@jimp/plugin-invert": "^0.13.0",
"@jimp/plugin-mask": "^0.13.0",
"@jimp/plugin-normalize": "^0.13.0",
"@jimp/plugin-print": "^0.13.0",
"@jimp/plugin-resize": "^0.13.0",
"@jimp/plugin-rotate": "^0.13.0",
"@jimp/plugin-scale": "^0.13.0",
"@jimp/plugin-shadow": "^0.13.0",
"@jimp/plugin-threshold": "^0.13.0",
"timm": "^1.6.1"
}
},
"@jimp/png": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/png/-/png-0.13.0.tgz",
"integrity": "sha512-9MVU0BLMQKJ6Kaiwjrq6dLDnDktZzeHtxz4qthRHaGOyHLx3RpxmbhaDuK9dDg6NASX3JuXznEhaOP4lqQODpQ==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/utils": "^0.13.0",
"pngjs": "^3.3.3"
}
},
"@jimp/tiff": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/tiff/-/tiff-0.13.0.tgz",
"integrity": "sha512-8lLGgEmhVRRjzZfn/QgpM3+mijq5ORYqRHtLcqDgcQaUY/q/OU1CxLYX777pozyQ3KIq1O+jyyHZm2xu3RZkPA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"utif": "^2.0.1"
}
},
"@jimp/types": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/types/-/types-0.13.0.tgz",
"integrity": "sha512-qGq9qVHiRTgtIy061FSBr9l7OFrSiFLkKyQVnOBndEjwls2XLBKXkMmSD2U3oiHcNuf3ACsDSTIzK3KX/hDHvg==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/bmp": "^0.13.0",
"@jimp/gif": "^0.13.0",
"@jimp/jpeg": "^0.13.0",
"@jimp/png": "^0.13.0",
"@jimp/tiff": "^0.13.0",
"timm": "^1.6.1"
}
},
"@jimp/utils": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/@jimp/utils/-/utils-0.13.0.tgz",
"integrity": "sha512-zA4573jE4FIpBKiYpPGo66JOAGdv/FS/N9fW9GpkbwJeTu12fV+r4R1ARSyt8UEKdE4DMBatBmQC0U2FGZijOA==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"regenerator-runtime": "^0.13.3"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
}
}
},
"@outtacontrol/socks": {
"version": "github:phoenix344/socksv5#dbdecf75be849337a31e78ba14d316deed43287f",
"from": "github:phoenix344/socksv5#dbdecf75be849337a31e78ba14d316deed43287f",
@ -396,6 +756,12 @@
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
},
"any-base": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz",
"integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==",
"dev": true
},
"anymatch": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz",
@ -655,6 +1021,12 @@
}
}
},
"bmp-js": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/bmp-js/-/bmp-js-0.1.0.tgz",
"integrity": "sha1-4Fpj95amwf8l9Hcex62twUjAcjM=",
"dev": true
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@ -693,6 +1065,12 @@
"ieee754": "^1.1.4"
}
},
"buffer-equal": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
"integrity": "sha1-kbx0sR6kBbyRa8aqkI+q+ltKrEs=",
"dev": true
},
"buffer-from": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz",
@ -1100,6 +1478,12 @@
"entities": "^1.1.1"
}
},
"dom-walk": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/dom-walk/-/dom-walk-0.1.2.tgz",
"integrity": "sha512-6QvTW9mrGeIegrFXdtQi9pk7O/nSK6lSdXW2eqUspN5LWD7UTji2Fqw5V2YLjBpHEoU9Xl/eUWNpDeZvoyOv2w==",
"dev": true
},
"domelementtype": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz",
@ -1205,6 +1589,12 @@
"integrity": "sha1-LUH1Y+H+QA7Uli/hpNXGp1Od9/Y=",
"dev": true
},
"exif-parser": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz",
"integrity": "sha1-WKnS1ywCwfbwKg70qRZicrd2CSI=",
"dev": true
},
"expand-template": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
@ -1241,6 +1631,12 @@
"xml-js": "^1.6.11"
}
},
"file-type": {
"version": "9.0.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-9.0.0.tgz",
"integrity": "sha512-Qe/5NJrgIOlwijpq3B7BEpzPFcgzggOTagZmkXQY4LA6bsXKTUstK7Wp12lEJ/mLKTpvIZxmIuRcLYWT6ov9lw==",
"dev": true
},
"file-uri-to-path": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
@ -1421,6 +1817,16 @@
"assert-plus": "^1.0.0"
}
},
"gifwrap": {
"version": "0.9.2",
"resolved": "https://registry.npmjs.org/gifwrap/-/gifwrap-0.9.2.tgz",
"integrity": "sha512-fcIswrPaiCDAyO8xnWvHSZdWChjKXUanKKpAiWWJ/UTkEi/aYKn5+90e7DE820zbEaVR9CE2y4z9bzhQijZ0BA==",
"dev": true,
"requires": {
"image-q": "^1.1.1",
"omggif": "^1.0.10"
}
},
"github-from-package": {
"version": "0.0.0",
"resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
@ -1447,6 +1853,16 @@
"is-glob": "^4.0.1"
}
},
"global": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/global/-/global-4.3.2.tgz",
"integrity": "sha1-52mJJopsdMOJCLEwWxD8DjlOnQ8=",
"dev": true,
"requires": {
"min-document": "^2.19.0",
"process": "~0.5.1"
}
},
"globals": {
"version": "11.12.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
@ -1604,6 +2020,18 @@
"resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",
"integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="
},
"image-q": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/image-q/-/image-q-1.1.1.tgz",
"integrity": "sha1-/IQJlmRGC5DKhi2TALa/u7+/gFY=",
"dev": true
},
"immediate": {
"version": "3.0.6",
"resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz",
"integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=",
"dev": true
},
"imurmurhash": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
@ -1708,6 +2136,12 @@
"number-is-nan": "^1.0.0"
}
},
"is-function": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/is-function/-/is-function-1.0.2.tgz",
"integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==",
"dev": true
},
"is-glob": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
@ -1932,6 +2366,33 @@
}
}
},
"jimp": {
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/jimp/-/jimp-0.13.0.tgz",
"integrity": "sha512-N/iG8L7Qe+AcHhrgcL0m7PTP/14iybmSIuOqCDvuel9gcIKEzxbbGuPCJVMchwXzusc2E7h9UjO9LZDfXb/09w==",
"dev": true,
"requires": {
"@babel/runtime": "^7.7.2",
"@jimp/custom": "^0.13.0",
"@jimp/plugins": "^0.13.0",
"@jimp/types": "^0.13.0",
"regenerator-runtime": "^0.13.3"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.13.5",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.5.tgz",
"integrity": "sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==",
"dev": true
}
}
},
"jpeg-js": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/jpeg-js/-/jpeg-js-0.4.0.tgz",
"integrity": "sha512-960VHmtN1vTpasX/1LupLohdP5odwAT7oK/VSm6mW0M58LbrBnowLAPWAZhWGhDAGjzbMnPXZxzB/QYgBwkN0w==",
"dev": true
},
"js-stringify": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz",
@ -2016,6 +2477,18 @@
"promise": "^7.0.1"
}
},
"jszip": {
"version": "3.5.0",
"resolved": "https://registry.npmjs.org/jszip/-/jszip-3.5.0.tgz",
"integrity": "sha512-WRtu7TPCmYePR1nazfrtuF216cIVon/3GWOvHS9QR5bIwSbnxtdpma6un3jyGGNhHsKCSzn5Ypk+EkDRvTGiFA==",
"dev": true,
"requires": {
"lie": "~3.3.0",
"pako": "~1.0.2",
"readable-stream": "~2.3.6",
"set-immediate-shim": "~1.0.1"
}
},
"keyv": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/keyv/-/keyv-4.0.0.tgz",
@ -2064,6 +2537,31 @@
"integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=",
"dev": true
},
"lie": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz",
"integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==",
"dev": true,
"requires": {
"immediate": "~3.0.5"
}
},
"load-bmfont": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/load-bmfont/-/load-bmfont-1.4.0.tgz",
"integrity": "sha512-kT63aTAlNhZARowaNYcY29Fn/QYkc52M3l6V1ifRcPewg2lvUZDAj7R6dXjOL9D0sict76op3T5+odumDSF81g==",
"dev": true,
"requires": {
"buffer-equal": "0.0.1",
"mime": "^1.3.4",
"parse-bmfont-ascii": "^1.0.3",
"parse-bmfont-binary": "^1.0.5",
"parse-bmfont-xml": "^1.1.4",
"phin": "^2.9.1",
"xhr": "^2.0.1",
"xtend": "^4.0.0"
}
},
"locate-path": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
@ -2175,9 +2673,10 @@
}
},
"mime": {
"version": "2.4.6",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
"dev": true
},
"mime-db": {
"version": "1.43.0",
@ -2199,6 +2698,15 @@
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz",
"integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA=="
},
"min-document": {
"version": "2.19.0",
"resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz",
"integrity": "sha1-e9KC4/WELtKVu3SM3Z8f+iyCRoU=",
"dev": true,
"requires": {
"dom-walk": "^0.1.0"
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@ -2600,6 +3108,12 @@
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"omggif": {
"version": "1.0.10",
"resolved": "https://registry.npmjs.org/omggif/-/omggif-1.0.10.tgz",
"integrity": "sha512-LMJTtvgc/nugXj0Vcrrs68Mn2D1r0zf630VNtqtpI1FEO7e+O9FP4gqs9AcnBaSEeoHIPm28u6qgPR0oyEpGSw==",
"dev": true
},
"once": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@ -2620,6 +3134,12 @@
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"dev": true
},
"os-tmpdir": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"dev": true
},
"own-or": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/own-or/-/own-or-1.0.0.tgz",
@ -2701,6 +3221,40 @@
"release-zalgo": "^1.0.0"
}
},
"pako": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
"integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
"dev": true
},
"parse-bmfont-ascii": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/parse-bmfont-ascii/-/parse-bmfont-ascii-1.0.6.tgz",
"integrity": "sha1-Eaw8P/WPfCAgqyJ2kHkQjU36AoU=",
"dev": true
},
"parse-bmfont-binary": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/parse-bmfont-binary/-/parse-bmfont-binary-1.0.6.tgz",
"integrity": "sha1-0Di0dtPp3Z2x4RoLDlOiJ5K2kAY=",
"dev": true
},
"parse-bmfont-xml": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/parse-bmfont-xml/-/parse-bmfont-xml-1.1.4.tgz",
"integrity": "sha512-bjnliEOmGv3y1aMEfREMBJ9tfL3WR0i0CKPj61DnSLaoxWR3nLrsQrEbCId/8rF4NyRF0cCqisSVXyQYWM+mCQ==",
"dev": true,
"requires": {
"xml-parse-from-string": "^1.0.0",
"xml2js": "^0.4.5"
}
},
"parse-headers": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz",
"integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==",
"dev": true
},
"parse5": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/parse5/-/parse5-3.0.3.tgz",
@ -2732,19 +3286,32 @@
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=",
"dev": true
},
"phin": {
"version": "2.9.3",
"resolved": "https://registry.npmjs.org/phin/-/phin-2.9.3.tgz",
"integrity": "sha512-CzFr90qM24ju5f88quFC/6qohjC144rehe5n6DH900lgXmUe86+xCKc10ev56gRKC4/BkHUoG4uSiQgBiIXwDA==",
"dev": true
},
"picomatch": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
"integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg=="
},
"pinski": {
"version": "github:cloudrac3r/pinski#7152d86dbf40d8dd9448f9a918d3e6fb76428c6a",
"from": "github:cloudrac3r/pinski#7152d86dbf40d8dd9448f9a918d3e6fb76428c6a",
"version": "github:cloudrac3r/pinski#ffa2f36eee807a13dd1090717045f945a5d5e3d2",
"from": "github:cloudrac3r/pinski#ffa2f36eee807a13dd1090717045f945a5d5e3d2",
"requires": {
"mime": "^2.4.4",
"pug": "^2.0.3",
"sass": "^1.26.5",
"ws": "^7.1.1"
},
"dependencies": {
"mime": {
"version": "2.4.6",
"resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz",
"integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA=="
}
}
},
"pirates": {
@ -2756,6 +3323,15 @@
"node-modules-regexp": "^1.0.0"
}
},
"pixelmatch": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/pixelmatch/-/pixelmatch-4.0.2.tgz",
"integrity": "sha1-j0fc7FARtHe2fbA8JDvB8wheiFQ=",
"dev": true,
"requires": {
"pngjs": "^3.0.0"
}
},
"pkg-dir": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
@ -2776,6 +3352,12 @@
}
}
},
"pngjs": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/pngjs/-/pngjs-3.4.0.tgz",
"integrity": "sha512-NCrCHhWmnQklfH4MtJMRjZ2a8c80qXeMlQMv2uVp9ISJMTt562SbGd6n2oq0PaPgKm7Z6pL9E2UlLIhC+SHL3w==",
"dev": true
},
"prebuild-install": {
"version": "5.3.3",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.3.tgz",
@ -2798,6 +3380,12 @@
"which-pm-runs": "^1.0.0"
}
},
"process": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/process/-/process-0.5.2.tgz",
"integrity": "sha1-FjjYqONML0QKkduVq5rrZ3/Bhc8=",
"dev": true
},
"process-nextick-args": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
@ -3141,6 +3729,17 @@
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"selenium-webdriver": {
"version": "4.0.0-alpha.7",
"resolved": "https://registry.npmjs.org/selenium-webdriver/-/selenium-webdriver-4.0.0-alpha.7.tgz",
"integrity": "sha512-D4qnTsyTr91jT8f7MfN+OwY0IlU5+5FmlO5xlgRUV6hDEV8JyYx2NerdTEqDDkNq7RZDYc4VoPALk8l578RBHw==",
"dev": true,
"requires": {
"jszip": "^3.2.2",
"rimraf": "^2.7.1",
"tmp": "0.0.30"
}
},
"semver": {
"version": "7.2.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.2.1.tgz",
@ -3151,6 +3750,12 @@
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
},
"set-immediate-shim": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz",
"integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=",
"dev": true
},
"sharp": {
"version": "0.25.2",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.25.2.tgz",
@ -3207,6 +3812,12 @@
"integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=",
"dev": true
},
"siginfo": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz",
"integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==",
"dev": true
},
"signal-exit": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
@ -3354,6 +3965,12 @@
"integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==",
"dev": true
},
"stackback": {
"version": "0.0.2",
"resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz",
"integrity": "sha1-Gsig2Ug4SNFpXkGLbQMaPDzmjjs=",
"dev": true
},
"string-width": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
@ -4659,6 +5276,27 @@
}
}
},
"timm": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/timm/-/timm-1.6.2.tgz",
"integrity": "sha512-IH3DYDL1wMUwmIlVmMrmesw5lZD6N+ZOAFWEyLrtpoL9Bcrs9u7M/vyOnHzDD2SMs4irLkVjqxZbHrXStS/Nmw==",
"dev": true
},
"tinycolor2": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/tinycolor2/-/tinycolor2-1.4.1.tgz",
"integrity": "sha1-9PrTM0R7wLB9TcjpIJ2POaisd+g=",
"dev": true
},
"tmp": {
"version": "0.0.30",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.30.tgz",
"integrity": "sha1-ckGdSovn1s51FI/YsyTlk6cRwu0=",
"dev": true,
"requires": {
"os-tmpdir": "~1.0.1"
}
},
"to-fast-properties": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz",
@ -4797,6 +5435,15 @@
"punycode": "^2.1.0"
}
},
"utif": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/utif/-/utif-2.0.1.tgz",
"integrity": "sha512-Z/S1fNKCicQTf375lIP9G8Sa1H/phcysstNrrSdZKj1f9g58J4NMgb5IgiEZN9/nLMPDwF0W7hdOe9Qq2IYoLg==",
"dev": true,
"requires": {
"pako": "^1.0.5"
}
},
"util-deprecate": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
@ -4854,6 +5501,16 @@
"resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",
"integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs="
},
"why-is-node-running": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.0.tgz",
"integrity": "sha512-rxtN9D0lJaYyP92BR5yoyWecK2txBKmBIuS7GRbOPP5bXsT37/hBqcmTrlrt25DBr9p4WJb6c9LuYSJd89vHRQ==",
"dev": true,
"requires": {
"siginfo": "^2.0.0",
"stackback": "0.0.2"
}
},
"wide-align": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",
@ -4913,6 +5570,18 @@
"resolved": "https://registry.npmjs.org/ws/-/ws-7.3.0.tgz",
"integrity": "sha512-iFtXzngZVXPGgpTlP1rBqsUK82p9tKqsWRPg5L56egiljujJT3vGAYnHANvFxBieXrTFavhzhxW52jnaWV+w2w=="
},
"xhr": {
"version": "2.5.0",
"resolved": "https://registry.npmjs.org/xhr/-/xhr-2.5.0.tgz",
"integrity": "sha512-4nlO/14t3BNUZRXIXfXe+3N6w3s1KoxcJUUURctd64BLRe67E4gRwp4PjywtDY72fXpZ1y6Ch0VZQRY/gMPzzQ==",
"dev": true,
"requires": {
"global": "~4.3.0",
"is-function": "^1.0.1",
"parse-headers": "^2.0.0",
"xtend": "^4.0.0"
}
},
"xml-js": {
"version": "1.6.11",
"resolved": "https://registry.npmjs.org/xml-js/-/xml-js-1.6.11.tgz",
@ -4921,6 +5590,34 @@
"sax": "^1.2.4"
}
},
"xml-parse-from-string": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/xml-parse-from-string/-/xml-parse-from-string-1.0.1.tgz",
"integrity": "sha1-qQKekp09vN7RafPG4oI42VpdWig=",
"dev": true
},
"xml2js": {
"version": "0.4.23",
"resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz",
"integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==",
"dev": true,
"requires": {
"sax": ">=0.6.0",
"xmlbuilder": "~11.0.0"
}
},
"xmlbuilder": {
"version": "11.0.1",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",
"integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",
"dev": true
},
"xtend": {
"version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true
},
"yallist": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",

View File

@ -19,7 +19,7 @@
"mixin-deep": "^2.0.1",
"node-dir": "^0.1.17",
"node-fetch": "^2.6.0",
"pinski": "github:cloudrac3r/pinski#7152d86dbf40d8dd9448f9a918d3e6fb76428c6a",
"pinski": "github:cloudrac3r/pinski#ffa2f36eee807a13dd1090717045f945a5d5e3d2",
"pug": "^2.0.4",
"semver": "^7.2.1",
"sharp": "^0.25.2",
@ -30,6 +30,9 @@
"got": "^10.6.0"
},
"devDependencies": {
"tap": "^14.10.7"
"jimp": "^0.13.0",
"selenium-webdriver": "^4.0.0-alpha.7",
"tap": "^14.10.7",
"why-is-node-running": "^2.2.0"
}
}

View File

@ -14,6 +14,7 @@ class TtlCache {
this.sweepInterval = setInterval(() => {
this.clean()
}, constants.caching.cache_sweep_interval)
this.sweepInterval.unref()
}
clean() {

View File

@ -13,7 +13,7 @@ setInterval((new (function() {
for (const waiter of waiters.values()) {
waiter.stream.push(payload)
}
})).constructor, 50000)
})).constructor, 50000).unref()
class Waiter {
constructor(username) {

View File

@ -7,7 +7,7 @@ setInterval((new (function() {
for (const stream of streams.values()) {
stream.push(payload)
}
})).constructor, 50000)
})).constructor, 50000).unref()
module.exports = [
{

View File

@ -60,7 +60,7 @@ function cleanCSRF() {
db.prepare("DELETE FROM CSRFTokens WHERE expires <= ?").run(Date.now())
}
cleanCSRF()
setInterval(cleanCSRF, constants.caching.csrf_time)
setInterval(cleanCSRF, constants.caching.csrf_time).unref()
module.exports.getToken = getToken
module.exports.getSettings = getSettings

View File

@ -26,6 +26,8 @@ const pinski = new Pinski({
onionLocation: constants.onion_location
})
pinski.startServer()
subdirs("pug", async (err, dirs) => {
if (err) throw err
@ -60,8 +62,6 @@ subdirs("pug", async (err, dirs) => {
pinski.addAPIDir("assistant_api")
}
pinski.startServer()
require("pinski/plugins").setInstance(pinski)
Object.assign(passthrough, pinski.getExports())
@ -74,3 +74,5 @@ subdirs("pug", async (err, dirs) => {
})
}
})
module.exports = pinski

105
test/screenshot.js Normal file
View File

@ -0,0 +1,105 @@
const tap = require("tap")
const se = require("selenium-webdriver")
const fs = require("fs").promises
const Jimp = require("jimp")
const commands = require("./screenshots/commands")
const child_process = require("child_process")
const browser = "firefox"
const origin = "http://localhost:10407"
const dimensions = new Map([
["firefox", {
scrollbar: 12,
heightDifference: 74,
widthDifference: 0
}],
["chrome", {
scrollbar: 15,
heightDifference: 128,
widthDifference: 8
}]
])
const browserDimensions = dimensions.get(browser)
process.chdir("src/site")
const server = require("../src/site/server")
function exec(command) {
return new Promise((resolve, reject) => {
child_process.exec(command, (error, stdout, stderr) => {
resolve({stdout, stderr})
})
})
}
;(async () => {
await fs.mkdir("../../test/screenshots/diff", {recursive: true})
await fs.mkdir("../../test/screenshots/staging", {recursive: true})
const [driver] = await Promise.all([
new se.Builder().forBrowser(browser).build(),
server.waitForFirstCompile()
])
server.muteLogsStartingWith("/") // we don't need webserver stuff in our test logs
function setSize(size) {
return driver.manage().window().setRect({
width: size.width + browserDimensions.widthDifference + browserDimensions.scrollbar,
height: size.height + browserDimensions.heightDifference
})
}
await driver.get(origin)
for (const command of commands) {
function screenPath(dir) {
return `../../test/screenshots/${dir}/${command.filename}.png`
}
await Promise.all(Object.keys(command.cookies).map(cookieName =>
driver.manage().addCookie({
name: cookieName,
value: command.cookies[cookieName]
})
))
await Promise.all([
setSize(command.size),
driver.get(origin + command.url)
])
const finalExists = await fs.access(screenPath("final")).then(() => true).catch(() => false)
const screenshot = Buffer.from(await driver.takeScreenshot(), "base64")
const message = `equal screens: ${command.filename}`
tap.test(message, async childTest => {
const image = await Jimp.read(screenshot)
image.crop(0, 0, command.size.width, command.size.height) // crop out page scrollbar
if (finalExists) {
await image.writeAsync(screenPath("staging"))
const message = `screen: ${command.filename}`
const result = await exec(`compare -metric AE ${screenPath("staging")} ${screenPath("final")} ${screenPath("diff")}`)
const diff = +result.stderr
childTest.ok(diff === 0, message)
if (diff === 0) { // it worked, so we don't need the files anymore
fs.unlink(screenPath("staging"))
fs.unlink(screenPath("diff"))
}
} else {
image.writeAsync(screenPath("final"))
console.log(`note: creating new screenshot ${command.filename}`)
}
})
}
tap.teardown(() => {
driver.close()
server.shutdown()
})
})()

View File

@ -0,0 +1,37 @@
const sizes = {
laptop: {
width: 1366,
height: 768
},
phone: {
width: 450,
height: 828
}
}
const cookies = {
default: {
settings: "d8f3967f153a5422ba8bd068da4dca5f"
},
ptc: {
settings: "a513b2b80db331a60f875bc2679ee35e"
}
}
function generateSetup(pageName, url, sizeName, cookiesName) {
return {
url: url,
filename: `${pageName}-${sizeName}-${cookiesName}`,
size: sizes[sizeName],
cookies: cookies[cookiesName]
}
}
module.exports = [
generateSetup("home", "/", "laptop", "default"),
generateSetup("settings", "/settings", "laptop", "default"),
generateSetup("home", "/", "phone", "default"),
generateSetup("home", "/", "laptop", "ptc"),
generateSetup("settings", "/settings", "laptop", "ptc"),
generateSetup("home", "/", "phone", "ptc"),
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB