Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies to fix vulnerabilities #479

Merged
merged 1 commit into from
Feb 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
{
"presets": [
"es2015",
"es2016",
"es2017",
"stage-2"
[
"@babel/preset-env",
{
"targets": "node 12.0"
}
]
],
"plugins": [
"babel-plugin-transform-flow-strip-types",
"@babel/plugin-transform-flow-strip-types",
[
"transform-es2015-block-scoping",
"@babel/plugin-transform-block-scoping",
{
"throwIfClosureRequired": true
}
Expand Down
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"reg": "node dist/cli.js ./sample/actual ./sample/expected ./sample/diff -I -R ./sample/index.html -T 0.01 -X client",
"reg:from": "node dist/cli.js -F ./sample/reg.json -R ./sample/index.html",
"screenshot": "node test/screenshot.js",
"test:cli": "chmod +x dist/cli.js && ava test/cli.test.js",
"test:cli": "chmod +x dist/cli.js && ava test/cli.test.mjs",
"test:screenshot": "npm run build:report && npm run reg && npm run screenshot",
"test": "cross-env NODE_ENV=\"debug\" npm run build:report && npm run build && npm run test:cli && npm run test:screenshot"
},
Expand Down Expand Up @@ -48,7 +48,8 @@
"**/serialize-javascript": "^6.0.0",
"**/y18n": "^5.0.0",
"**/braces": "^3.0.0",
"**/trim-newlines": "^3.0.1"
"**/trim-newlines": "^3.0.1",
"**/debug": "^4.3.4"
},
"dependencies": {
"bluebird": "3.7.2",
Expand All @@ -58,31 +59,29 @@
"del": "6.1.1",
"glob": "7.2.3",
"img-diff-js": "0.5.2",
"jpeg-js": "^0.4.0",
"jpeg-js": "^0.4.4",
"lodash": "4.17.21",
"make-dir": "3.1.0",
"md5-file": "4.0.0",
"meow": "3.7.0",
"meow": "^9.0.0",
"mustache": "4.2.0",
"x-img-diff-js": "0.3.5",
"xmlbuilder2": "^3.1.1",
"yargs-parser": "^21.0.1"
},
"devDependencies": {
"ava": "0.25.0",
"babel-cli": "6.26.0",
"babel-loader": "8.3.0",
"babel-plugin-transform-es2015-block-scoping": "6.26.0",
"babel-plugin-transform-flow-strip-types": "6.22.0",
"babel-preset-es2015": "6.24.1",
"babel-preset-es2016": "6.24.1",
"babel-preset-es2017": "6.24.1",
"babel-preset-stage-2": "6.24.1",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.7",
"@babel/plugin-transform-block-scoping": "^7.23.4",
"@babel/preset-env": "^7.23.8",
"@babel/preset-flow": "^7.23.3",
"@babel/preset-stage-2": "^7.8.3",
"ava": "6.1.0",
"copyfiles": "2.4.1",
"cross-env": "7.0.3",
"finalhandler": "1.2.0",
"flow-bin": "0.77.0",
"flow-typed": "3.7.0",
"flow-typed": "3.9.0",
"puppeteer": "13.7.0",
"rimraf": "3.0.2",
"serve-static": "1.15.0"
Expand Down
2 changes: 1 addition & 1 deletion sample/worker.js

Large diffs are not rendered by default.

87 changes: 70 additions & 17 deletions src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,72 @@ const cli = meow(
$ reg-cli /path/to/actual-dir /path/to/expected-dir /path/to/diff-dir -U -D ./reg.json
`,
{
alias: {
U: 'update',
J: 'json',
I: 'ignoreChange',
E: 'extendedErrors',
R: 'report',
P: 'urlPrefix',
M: 'matchingThreshold',
T: 'thresholdRate',
S: 'thresholdPixel',
C: 'concurrency',
A: 'enableAntialias',
X: 'additionalDetection',
F: 'from',
D: 'customDiffMessage'
flags: {
update: {
type: 'boolean',
alias: 'U',
},
json: {
type: 'string',
alias: 'J',
default: './reg.json',
},
ignoreChange: {
type: 'boolean',
alias: 'I',
},
extendedErrors: {
type: 'boolean',
alias: 'E',
default: false,
},
report: {
type: 'string',
alias: 'R',
},
junit: {
type: 'string',
},
urlPrefix: {
type: 'string',
alias: 'P',
},
matchingThreshold: {
type: 'number',
alias: 'M',
default: 0,
},
thresholdRate: {
type: 'number',
alias: 'T',
},
thresholdPixel: {
type: 'number',
alias: 'S',
},
concurrency: {
type: 'number',
alias: 'C',
default: 4,
},
enableAntialias: {
type: 'boolean',
alias: 'A',
default: false,
},
additionalDetection: {
type: 'string',
alias: 'X',
default: 'none',
},
from: {
type: 'string',
alias: 'F',
},
customDiffMessage: {
type: 'string',
alias: 'D',
},
},
},
);
Expand All @@ -80,11 +131,13 @@ const extendedErrors = !!cli.flags.extendedErrors;
const ignoreChange = !!cli.flags.ignoreChange;
const enableClientAdditionalDetection = cli.flags.additionalDetection === 'client';
const from = String(cli.flags.from || '');
const customDiffMessage = String(cli.flags.customDiffMessage || `\nInspect your code changes, re-run with \`-U\` to update them. `);
const customDiffMessage = String(
cli.flags.customDiffMessage || `\nInspect your code changes, re-run with \`-U\` to update them. `,
);

// If from option specified, generate report from json and exit.
if (from) {
let json: string = '';
let json = '';
try {
json = fs.readFileSync(from, { encoding: 'utf8' });
} catch (e) {
Expand Down
File renamed without changes.
Loading
Loading