Skip to content

Commit 29679fa

Browse files
crutchcornhipstersmoothie
authored andcommitted
Upgrade nearly-all dev deps (#799)
* Upgrade nearly-all dev deps * Revert node8 breaking change dep upgrade * Fix issues with new `xo` version * Revert 'auto' due to failing release * 🙏 * run without cache
1 parent 3b58221 commit 29679fa

File tree

26 files changed

+4311
-3249
lines changed

26 files changed

+4311
-3249
lines changed

.circleci/config.yml

-10
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ jobs:
1010
<<: *defaults
1111
steps:
1212
- checkout
13-
- restore_cache:
14-
keys:
15-
# Find a cache corresponding to this specific package.json checksum
16-
# when this file is changed, this key will fail
17-
- jimp-{{ .Branch }}-{{ checksum "yarn.lock" }}-{{ checksum ".circleci/config.yml" }}
18-
- jimp-{{ .Branch }}-{{ checksum "yarn.lock" }}
19-
- jimp-{{ .Branch }}
20-
# Find the most recent cache used from any branch
21-
- jimp-master
22-
- jimp-
2313
- run:
2414
name: Install Dependencies
2515
command: yarn install --frozen-lockfile

package.json

+30-29
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,40 @@
2525
"tsTest:main": "dtslint packages/jimp/types --expectOnly"
2626
},
2727
"devDependencies": {
28-
"@babel/cli": "^7.1.0",
29-
"@babel/core": "^7.1.0",
30-
"@babel/plugin-proposal-class-properties": "^7.1.0",
31-
"@babel/plugin-syntax-object-rest-spread": "^7.0.0",
32-
"@babel/preset-env": "^7.1.0",
33-
"@babel/register": "^7.0.0",
34-
"auto": "^7.4.1",
35-
"babel-eslint": "^9.0.0",
36-
"babel-plugin-add-module-exports": "^1.0.0",
37-
"babel-plugin-istanbul": "^5.0.1",
38-
"babel-plugin-source-map-support": "^2.0.1",
28+
"@babel/cli": "^7.6.0",
29+
"@babel/core": "^7.6.0",
30+
"@babel/plugin-proposal-class-properties": "^7.5.5",
31+
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
32+
"@babel/preset-env": "^7.6.0",
33+
"@babel/register": "^7.6.0",
34+
"auto": "^7.6.0",
35+
"babel-eslint": "^10.0.3",
36+
"babel-plugin-add-module-exports": "^1.0.2",
37+
"babel-plugin-istanbul": "^5.2.0",
38+
"babel-plugin-source-map-support": "^2.1.1",
3939
"babel-plugin-transform-inline-environment-variables": "^0.4.3",
40-
"cross-env": "^5.2.0",
41-
"dtslint": "^0.9.6",
42-
"eslint-plugin-prettier": "^2.6.2",
43-
"express": "^4.16.3",
44-
"husky": "^1.0.0-rc.15",
45-
"karma": "^3.0.0",
46-
"karma-browserify": "^5.3.0",
47-
"karma-chrome-launcher": "^2.2.0",
48-
"karma-firefox-launcher": "^1.1.0",
40+
"cross-env": "^6.0.0",
41+
"dtslint": "^0.9.8",
42+
"eslint": "^6.4.0",
43+
"eslint-config-prettier": "^6.3.0",
44+
"express": "^4.17.1",
45+
"husky": "^3.0.5",
46+
"karma": "^4.3.0",
47+
"karma-browserify": "^6.1.0",
48+
"karma-chrome-launcher": "^3.1.0",
49+
"karma-firefox-launcher": "^1.2.0",
4950
"karma-mocha": "^1.3.0",
5051
"karma-mocha-reporter": "^2.2.5",
51-
"lerna": "^3.13.4",
52-
"lerna-changelog": "^0.8.0",
53-
"lint-staged": "^7.3.0",
54-
"mocha": "^5.2.0",
55-
"nyc": "^13.0.1",
56-
"prettier": "^1.14.3",
52+
"lerna": "^3.16.4",
53+
"lerna-changelog": "^0.8.2",
54+
"lint-staged": "^9.2.5",
55+
"mocha": "^6.2.0",
56+
"nyc": "^14.1.1",
57+
"prettier": "^1.18.2",
5758
"should": "^13.2.3",
58-
"source-map-support": "^0.5.9",
59-
"watchify": "^3.11.0",
60-
"xo": "^0.23.0"
59+
"source-map-support": "^0.5.13",
60+
"watchify": "^3.11.1",
61+
"xo": "^0.24.0"
6162
},
6263
"auto": {
6364
"plugins": [

packages/cli/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"devDependencies": {
3030
"@types/log-symbols": "^2.0.0",
31-
"@types/mocha": "^5.2.5",
31+
"@types/mocha": "^5.2.7",
3232
"@types/yargs": "^11.1.1",
3333
"ts-node": "^7.0.1",
3434
"typescript": "^3.1.3"

packages/core/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ export function jimpEvMethod(methodName, evName, method) {
11251125

11261126
cb.apply(this, args);
11271127
};
1128+
11281129
args[args.length - 1] = wrappedCb;
11291130
} else {
11301131
wrappedCb = false;

packages/core/src/modules/phash.js

+32-30
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,24 @@ ImagePHash.prototype.distance = function(s1, s2) {
4545
counter++;
4646
}
4747
}
48+
4849
return counter / s1.length;
4950
};
5051

5152
// Returns a 'binary string' (like. 001010111011100010) which is easy to do a hamming distance on.
5253
ImagePHash.prototype.getHash = function(img) {
5354
/* 1. Reduce size.
54-
* Like Average Hash, pHash starts with a small image.
55-
* However, the image is larger than 8x8; 32x32 is a good size.
56-
* This is really done to simplify the DCT computation and not
57-
* because it is needed to reduce the high frequencies.
58-
*/
55+
* Like Average Hash, pHash starts with a small image.
56+
* However, the image is larger than 8x8; 32x32 is a good size.
57+
* This is really done to simplify the DCT computation and not
58+
* because it is needed to reduce the high frequencies.
59+
*/
5960
img = img.clone().resize(this.size, this.size);
6061

6162
/* 2. Reduce color.
62-
* The image is reduced to a grayscale just to further simplify
63-
* the number of computations.
64-
*/
63+
* The image is reduced to a grayscale just to further simplify
64+
* the number of computations.
65+
*/
6566
img.grayscale();
6667

6768
const vals = [];
@@ -74,23 +75,23 @@ ImagePHash.prototype.getHash = function(img) {
7475
}
7576

7677
/* 3. Compute the DCT.
77-
* The DCT separates the image into a collection of frequencies
78-
* and scalars. While JPEG uses an 8x8 DCT, this algorithm uses
79-
* a 32x32 DCT.
80-
*/
78+
* The DCT separates the image into a collection of frequencies
79+
* and scalars. While JPEG uses an 8x8 DCT, this algorithm uses
80+
* a 32x32 DCT.
81+
*/
8182
const dctVals = applyDCT(vals, this.size);
8283

8384
/* 4. Reduce the DCT.
84-
* This is the magic step. While the DCT is 32x32, just keep the
85-
* top-left 8x8. Those represent the lowest frequencies in the
86-
* picture.
87-
*/
85+
* This is the magic step. While the DCT is 32x32, just keep the
86+
* top-left 8x8. Those represent the lowest frequencies in the
87+
* picture.
88+
*/
8889
/* 5. Compute the average value.
89-
* Like the Average Hash, compute the mean DCT value (using only
90-
* the 8x8 DCT low-frequency values and excluding the first term
91-
* since the DC coefficient can be significantly different from
92-
* the other values and will throw off the average).
93-
*/
90+
* Like the Average Hash, compute the mean DCT value (using only
91+
* the 8x8 DCT low-frequency values and excluding the first term
92+
* since the DC coefficient can be significantly different from
93+
* the other values and will throw off the average).
94+
*/
9495
let total = 0;
9596

9697
for (let x = 0; x < this.smallerSize; x++) {
@@ -102,15 +103,15 @@ ImagePHash.prototype.getHash = function(img) {
102103
const avg = total / (this.smallerSize * this.smallerSize);
103104

104105
/* 6. Further reduce the DCT.
105-
* This is the magic step. Set the 64 hash bits to 0 or 1
106-
* depending on whether each of the 64 DCT values is above or
107-
* below the average value. The result doesn't tell us the
108-
* actual low frequencies; it just tells us the very-rough
109-
* relative scale of the frequencies to the mean. The result
110-
* will not vary as long as the overall structure of the image
111-
* remains the same; this can survive gamma and color histogram
112-
* adjustments without a problem.
113-
*/
106+
* This is the magic step. Set the 64 hash bits to 0 or 1
107+
* depending on whether each of the 64 DCT values is above or
108+
* below the average value. The result doesn't tell us the
109+
* actual low frequencies; it just tells us the very-rough
110+
* relative scale of the frequencies to the mean. The result
111+
* will not vary as long as the overall structure of the image
112+
* remains the same; this can survive gamma and color histogram
113+
* adjustments without a problem.
114+
*/
114115
let hash = '';
115116

116117
for (let x = 0; x < this.smallerSize; x++) {
@@ -169,6 +170,7 @@ function applyDCT(f, size) {
169170
f[i][j];
170171
}
171172
}
173+
172174
sum *= (c[u] * c[v]) / 4;
173175
F[u][v] = sum;
174176
}

packages/jimp/package.json

+32-3
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,42 @@
6666
"regenerator-runtime": "^0.13.3"
6767
},
6868
"devDependencies": {
69+
"@babel/cli": "^7.6.0",
70+
"@babel/core": "^7.6.0",
71+
"@babel/plugin-proposal-class-properties": "^7.5.5",
72+
"@babel/plugin-syntax-object-rest-spread": "^7.2.0",
73+
"@babel/preset-env": "^7.6.0",
74+
"@babel/register": "^7.6.0",
6975
"@jimp/test-utils": "^0.8.4",
76+
"auto": "^7.6.0",
77+
"babel-eslint": "^10.0.3",
78+
"babel-plugin-add-module-exports": "^1.0.2",
79+
"babel-plugin-istanbul": "^5.2.0",
80+
"babel-plugin-source-map-support": "^2.1.1",
7081
"babelify": "^10.0.0",
71-
"browserify": "^16.2.2",
82+
"browserify": "^16.5.0",
83+
"cross-env": "^6.0.0",
84+
"dtslint": "^0.9.8",
7285
"envify": "^4.1.0",
73-
"express": "^4.16.3",
86+
"eslint": "^6.4.0",
87+
"eslint-plugin-prettier": "^3.1.1",
88+
"express": "^4.17.1",
89+
"husky": "^3.0.5",
90+
"karma": "^4.3.0",
91+
"karma-browserify": "^6.1.0",
92+
"karma-chrome-launcher": "^3.1.0",
93+
"karma-firefox-launcher": "^1.2.0",
94+
"lerna": "^3.16.4",
95+
"lerna-changelog": "^0.8.2",
96+
"lint-staged": "^9.2.5",
97+
"mocha": "^6.2.0",
98+
"nyc": "^14.1.1",
99+
"prettier": "^1.18.2",
100+
"source-map-support": "^0.5.13",
74101
"tfilter": "^1.0.1",
75-
"uglify-js": "^3.4.9"
102+
"uglify-js": "^3.6.0",
103+
"watchify": "^3.11.1",
104+
"xo": "^0.24.0"
76105
},
77106
"xo": false,
78107
"nyc": {

packages/jimp/test/callbacks.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ describe('Callbacks', () => {
279279
image.getJGDSync().should.be.sameJGD(result);
280280
done();
281281
}
282+
282283
targetImg.clone()[op](...args.concat(save));
283284
});
284285
}

packages/jimp/test/filetypes.test.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-control-regex */
2-
31
import fs from 'fs';
42
import should from 'should';
53
import { Jimp, getTestDir } from '@jimp/test-utils';

packages/jimp/test/hash.test.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-control-regex */
2-
31
import { Jimp, getTestDir } from '@jimp/test-utils';
42
import configure from '@jimp/custom';
53
import types from '@jimp/types';

packages/jimp/tools/browser-build.js

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ if (!module.parent) {
100100
config = {};
101101
baseFiles = process.argv.slice(3);
102102
}
103+
103104
if (baseFiles.length === 0) throw new Error('No file given.');
104105
bundle(baseFiles, config, (err, code) => {
105106
if (err) throw err;

packages/plugin-blit/test/blit.test.js

+1
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ describe('Blit over image', function() {
199199
imgHeight
200200
);
201201
}
202+
202203
newImage.blit(
203204
head,
204205
butt.bitmap.width + fuzz.bitmap.width * longCat,

packages/plugin-blur/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ export default () => ({
113113

114114
yi++;
115115
}
116+
116117
yw += this.bitmap.width << 2;
117118
}
118119

packages/plugin-color/src/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function applyKernel(im, kernel, x, y) {
1414
value[2] += im.bitmap.data[idx + 2] * kernel[kx][ky];
1515
}
1616
}
17+
1718
return value;
1819
}
1920

packages/plugin-crop/src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export default function pluginCrop(event) {
143143
break north;
144144
}
145145
}
146+
146147
// this row contains all pixels with the same color: increment this side pixels to crop
147148
northPixelsToCrop++;
148149
}
@@ -159,6 +160,7 @@ export default function pluginCrop(event) {
159160
break east;
160161
}
161162
}
163+
162164
// this column contains all pixels with the same color: increment this side pixels to crop
163165
eastPixelsToCrop++;
164166
}
@@ -179,6 +181,7 @@ export default function pluginCrop(event) {
179181
break south;
180182
}
181183
}
184+
182185
// this row contains all pixels with the same color: increment this side pixels to crop
183186
southPixelsToCrop++;
184187
}
@@ -199,6 +202,7 @@ export default function pluginCrop(event) {
199202
break west;
200203
}
201204
}
205+
202206
// this column contains all pixels with the same color: increment this side pixels to crop
203207
westPixelsToCrop++;
204208
}

packages/plugin-normalize/src/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* eslint-disable no-labels */
2-
31
import { isNodePattern } from '@jimp/utils';
42

53
/**

packages/plugin-resize/src/modules/resize.js

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ function Resize(
1818
this.interpolationPass = Boolean(interpolationPass);
1919
this.resizeCallback =
2020
typeof resizeCallback === 'function' ? resizeCallback : function() {};
21+
2122
this.targetWidthMultipliedByChannels = this.targetWidth * this.colorChannels;
2223
this.originalWidthMultipliedByChannels =
2324
this.widthOriginal * this.colorChannels;
@@ -63,6 +64,7 @@ Resize.prototype.configurePasses = function() {
6364
this.colorChannels === 4 ? this.resizeWidthRGBA : this.resizeWidthRGB;
6465
}
6566
}
67+
6668
if (this.heightOriginal === this.targetHeight) {
6769
// Bypass the height resizer pass:
6870
this.resizeHeight = this.bypassResizer;
@@ -114,6 +116,7 @@ Resize.prototype._resizeWidthInterpolatedRGBChannels = function(
114116
outputBuffer[finalOffset + 3] = buffer[pixelOffset + 3];
115117
}
116118
}
119+
117120
// Adjust for overshoot of the last pass's counter:
118121
weight -= 1 / 3;
119122
let interpolationWidthSourceReadStop;
@@ -234,6 +237,7 @@ Resize.prototype._resizeWidthRGBChannels = function(buffer, fourthChannel) {
234237
trustworthyColorsCount[line / channelsNum - 1] += a ? multiplier : 0;
235238
}
236239
}
240+
237241
if (weight >= amountToNext) {
238242
actualPosition += channelsNum;
239243
currentPosition = actualPosition;
@@ -267,6 +271,7 @@ Resize.prototype._resizeWidthRGBChannels = function(buffer, fourthChannel) {
267271

268272
outputOffset += channelsNum;
269273
} while (outputOffset < this.targetWidthMultipliedByChannels);
274+
270275
return outputBuffer;
271276
};
272277

@@ -442,6 +447,7 @@ Resize.prototype.resizeHeightInterpolated = function(buffer) {
442447
);
443448
}
444449
}
450+
445451
// Handle for only one interpolation input being valid for end calculation:
446452
while (finalOffset < this.finalResultSize) {
447453
for (
@@ -457,6 +463,7 @@ Resize.prototype.resizeHeightInterpolated = function(buffer) {
457463
);
458464
}
459465
}
466+
460467
return outputBuffer;
461468
};
462469

0 commit comments

Comments
 (0)