Skip to content

Commit

Permalink
Update most dependencies
Browse files Browse the repository at this point in the history
Left Rollup and friends at old versions for now due to rollup/plugins#1092
Left dateformat/chalk at old versions because they've turned ESM only, needs more digging to figure out what to do there

Signed-off-by: Liam McLoughlin <lmcloughlin@google.com>
  • Loading branch information
Hexxeh committed Jun 21, 2022
1 parent cabf0b7 commit 06f86cc
Show file tree
Hide file tree
Showing 16 changed files with 1,869 additions and 2,609 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = {
moduleFileExtensions: ['ts', 'js', 'json'],
testRegex: '.*\\.test\\.ts$',
coverageDirectory: '<rootDir>/../coverage',
collectCoverageFrom: ['**/*.ts', '!**/*.d.ts'],
collectCoverageFrom: ['**/*.ts', '!**/*.d.ts', '!**/__test__/**/*'],
clearMocks: true,
restoreMocks: true,
setupFilesAfterEnv: ['./setupTests.ts'],
Expand Down
70 changes: 35 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,86 +27,86 @@
"@types/fs-extra": "^9.0.13",
"@types/glob": "^7.2.0",
"@types/gulp-zip": "^4.0.2",
"@types/inquirer": "^8.2.0",
"@types/jest": "^26.0.24",
"@types/lodash": "^4.14.179",
"@types/inquirer": "^8.2.1",
"@types/jest": "^28.1.2",
"@types/lodash": "^4.14.182",
"@types/multipipe": "^3.0.0",
"@types/multistream": "^2.1.2",
"@types/multistream": "^4.1.0",
"@types/plugin-error": "^1.0.0",
"@types/semver": "^7.3.9",
"@types/semver": "^7.3.10",
"@types/update-notifier": "^5.1.0",
"@types/uuid": "^8.3.4",
"@types/validator": "^13.7.1",
"@types/validator": "^13.7.3",
"@types/vinyl": "^2.0.6",
"@types/vinyl-buffer": "^1.0.0",
"@types/vinyl-fs": "^2.4.12",
"@types/yargs": "^16.0.4",
"@types/yargs": "^17.0.10",
"concat-stream": "^2.0.0",
"coveralls": "^3.1.0",
"depcheck": "^1.4.0",
"coveralls": "^3.1.1",
"depcheck": "^1.4.3",
"event-stream": "^4.0.1",
"husky": "^6.0.0",
"jest": "^26.6.3",
"husky": "^8.0.1",
"jest": "^28.1.1",
"jest-date-mock": "^1.0.8",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"lint-staged": "^13.0.2",
"prettier": "^2.7.1",
"rimraf": "^3.0.2",
"ts-jest": "^26.5.6",
"ts-jest": "^28.0.5",
"tslint": "^6.1.3",
"tslint-config-airbnb": "^5.11.2",
"tslint-config-prettier": "^1.18.0",
"tslint-sonarts": "^1.9.0"
},
"dependencies": {
"@babel/core": "^7.13.16",
"@babel/core": "^7.18.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-transform-block-scoped-functions": "^7.12.13",
"@babel/plugin-transform-block-scoping": "^7.13.16",
"@babel/plugin-transform-block-scoped-functions": "^7.16.7",
"@babel/plugin-transform-block-scoping": "^7.18.4",
"@fitbit-sdk/companion-gettext": "^3.2.0",
"@fitbit/bison-i18n": "^1.1.0",
"@fitbit/image-codec-txi": "^1.1.6",
"@fitbit/pngjs": "^3.3.3-fitbit.4",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^18.0.0",
"@rollup/plugin-node-resolve": "^11.2.1",
"@rollup/pluginutils": "^4.1.0",
"@rollup/pluginutils": "^4.2.1",
"chalk": "^4.1.0",
"dateformat": "^4.5.1",
"dateformat": "^4.6.3",
"drop-stream": "^1.0.0",
"elfy": "^1.0.0",
"events-intercept": "^2.0.0",
"fp-ts": "^2.11.8",
"fs-extra": "^9.1.0",
"glob": "^7.1.6",
"fp-ts": "^2.12.1",
"fs-extra": "^10.1.0",
"glob": "^8.0.3",
"gulp-file": "^0.4.0",
"gulp-zip": "^5.1.0",
"humanize-list": "^1.0.1",
"inquirer": "^8.0.0",
"inquirer": "^9.0.0",
"io-ts": "2.2.16",
"jest-serializer-path": "^0.1.15",
"lazystream": "^1.0.0",
"lazystream": "^1.0.1",
"lodash": "^4.17.21",
"magic-string": "^0.25.7",
"magic-string": "^0.26.2",
"multipipe": "^4.0.0",
"multistream": "^4.1.0",
"playback-stream": "^1.0.0",
"plugin-error": "^1.0.1",
"pofile": "^1.1.0",
"rollup": "^2.36.2",
"semver": "^7.3.4",
"pofile": "^1.1.3",
"rollup": "^2.75.6",
"semver": "^7.3.7",
"simple-random": "^1.0.3",
"source-map": "^0.7.3",
"source-map": "^0.7.4",
"source-map-compactor": "^1.0.1",
"terser": "^5.6.1",
"tslib": "^2.3.1",
"typescript": "^4.5.5",
"terser": "^5.14.1",
"tslib": "^2.4.0",
"typescript": "^4.7.4",
"update-notifier": "^5.1.0",
"uuid": "^8.3.2",
"validator": "^13.6.0",
"validator": "^13.7.0",
"vinyl": "^2.2.1",
"vinyl-buffer": "^1.0.1",
"vinyl-fs": "^3.0.3",
"yargs": "^16.2.0"
"yargs": "^17.5.1"
},
"bin": {
"fitbit-build": "./bin/fitbit-build.js"
Expand Down
36 changes: 5 additions & 31 deletions src/__snapshots__/compile.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,8 @@ console.log(\\"hello world!\\")
exports[`build passes when compiles a JS file with tslib helpers imported 1`] = `
"\\"use strict\\"
;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED \\"AS IS\\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var t=function(o,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])})(o,n)};(new(function(o){!function(o,n){if(\\"function\\"!=typeof n&&null!==n)throw new TypeError(\\"Class extends value \\"+String(n)+\\" is not a constructor or null\\")
var t=function(o,n){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}
return t(o,n)};(new(function(o){!function(o,n){if(\\"function\\"!=typeof n&&null!==n)throw new TypeError(\\"Class extends value \\"+String(n)+\\" is not a constructor or null\\")
t(o,n)
function r(){this.constructor=o}o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}(n,o)
function n(){return null!==o&&o.apply(this,arguments)||this}n.prototype.doBar=function(){console.log(\\"foo\\")}
Expand All @@ -47,7 +34,8 @@ return t}()))).doBar()
exports[`build passes when compiles a JS file with tslib helpers inline 1`] = `
"\\"use strict\\"
var t,o=(t=function(o,n){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])})(o,n)},function(o,n){if(\\"function\\"!=typeof n&&null!==n)throw new TypeError(\\"Class extends value \\"+String(n)+\\" is not a constructor or null\\")
var t,o=(t=function(o,n){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,o){t.__proto__=o}||function(t,o){for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(t[n]=o[n])}
return t(o,n)},function(o,n){if(\\"function\\"!=typeof n&&null!==n)throw new TypeError(\\"Class extends value \\"+String(n)+\\" is not a constructor or null\\")
t(o,n)
function r(){this.constructor=o}o.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)});(new(function(t){o(n,t)
function n(){return null!==t&&t.apply(this,arguments)||this}n.prototype.doBar=function(){console.log(\\"foo\\")}
Expand All @@ -71,21 +59,7 @@ require(\\"./foo.js\\")()
exports[`build passes when tslib when imported 1`] = `
"\\"use strict\\"
;/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED \\"AS IS\\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */!function t(i){return this instanceof t?(this.v=i,this):new t(i)}()
!function t(i){return this instanceof t?(this.v=i,this):new t(i)}()
"
`;
Expand Down
10 changes: 2 additions & 8 deletions src/compile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,7 @@ it('allows importing image files when building settings', () =>
),
).resolves.toMatchSnapshot());

it.each([
ComponentType.DEVICE,
ComponentType.COMPANION,
])(
it.each([ComponentType.DEVICE, ComponentType.COMPANION])(
'allows importing image files when building %s',
(component: ComponentType) =>
expect(compileFile('importImage.js', { component })).rejects.toThrowError(),
Expand Down Expand Up @@ -132,10 +129,7 @@ it('emits ES5 code for device', () =>
),
).resolves.toMatchSnapshot());

it.each([
ComponentType.DEVICE,
ComponentType.COMPANION,
])(
it.each([ComponentType.DEVICE, ComponentType.COMPANION])(
'does not allow importing image files when building %s',
(component: ComponentType) =>
expect(compileFile('importImage.js', { component })).rejects.toBeDefined(),
Expand Down
20 changes: 7 additions & 13 deletions src/compileTranslations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function expectTranslationsForLanguages(
objectMode: true,
write(file: Vinyl, _, next) {
if (actual.has(file.translationLanguage)) {
done.fail(`Seen translations for ${file.translationLanguage} twice`);
done(`Seen translations for ${file.translationLanguage} twice`);
}
actual.add(file.translationLanguage);
next();
Expand Down Expand Up @@ -50,11 +50,7 @@ function translationFileSource(...paths: string[]) {

describe('when no files are piped', () => {
it('succeeds with empty output', (done) => {
compileTranslations('en')
.on('error', done.fail)
.resume()
.on('end', done)
.end();
compileTranslations('en').on('error', done).resume().on('end', done).end();
});
});

Expand All @@ -68,12 +64,10 @@ describe('when no .po files are piped in', () => {
const files = new Map<string, Vinyl>();

compileTranslations('en')
.on('error', done.fail)
.on('error', done)
.on('data', (file: Vinyl) => files.set(file.relative, file))
.on('end', () => {
expect(files).toEqual(
new Map<string, Vinyl>([['en.po.txt', file]]),
);
expect(files).toEqual(new Map<string, Vinyl>([['en.po.txt', file]]));
done();
})
.end(file);
Expand All @@ -83,13 +77,13 @@ describe('when no .po files are piped in', () => {
it('grabs .po files from any directory', (done) => {
translationFileSource('en-US.po', 'foo/es-ES.po', 'foo/bar/fr-FR.po')
.pipe(compileTranslations('en-US'))
.on('error', done.fail)
.on('error', done)
.pipe(expectTranslationsForLanguages(done, 'en-US', 'es-ES', 'fr-FR'));
});

function compileExpectError(defaultLanguage: string, done: jest.DoneCallback) {
return compileTranslations(defaultLanguage)
.on('data', () => done.fail('got unexpected data'))
.on('data', () => done('got unexpected data'))
.on('error', (error) => {
expect(error).toMatchSnapshot();
done();
Expand Down Expand Up @@ -147,5 +141,5 @@ it('renames the transformed file, replacing the whole relative path', (done) =>
expect(file.relative).toBe(path.normalize('l/en-US'));
done();
})
.on('error', done.fail);
.on('error', done);
});
2 changes: 1 addition & 1 deletion src/componentManifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('when there is a device entry point present', () => {
const files: string[] = [];

makeDeviceManifestStream()
.on('error', done.fail)
.on('error', done)
.on('data', (file: Vinyl) => files.push(file.relative))
.on('end', () => {
expect(files).toEqual([
Expand Down
24 changes: 12 additions & 12 deletions src/convertImageToTXI.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ it('passes through non-PNG files untouched', (done) => {

const converter = convertImageToTXI();
converter
.on('error', done.fail)
.on('error', done)
.on('data', handleData)
.on('end', () => {
expect(handleData).toHaveBeenCalledTimes(files.length);
Expand All @@ -64,7 +64,7 @@ describe('in streaming mode', () => {
if (shouldRead) {
done();
} else {
done.fail('Started reading too soon');
done('Started reading too soon');
}
},
});
Expand All @@ -74,7 +74,7 @@ describe('in streaming mode', () => {
process.nextTick(() => {
shouldRead = true;
if (!file.isStream()) {
done.fail('Got a non-stream file');
done('Got a non-stream file');
return;
}
file.contents.on('data', () => {});
Expand All @@ -101,7 +101,7 @@ describe('in streaming mode', () => {
converter
.on('data', (file: Vinyl) => {
if (!file.isStream()) {
done.fail('Got a non-stream file');
done('Got a non-stream file');
return;
}

Expand Down Expand Up @@ -134,7 +134,7 @@ describe('in streaming mode', () => {
})
.on('data', (file: Vinyl) => {
if (!file.isStream()) {
done.fail('Got a non-stream file');
done('Got a non-stream file');
return;
}

Expand Down Expand Up @@ -166,7 +166,7 @@ describe('in streaming mode', () => {
})
.on('data', (file: Vinyl) => {
if (!file.isStream()) {
done.fail('Got a non-stream file');
done('Got a non-stream file');
return;
}

Expand Down Expand Up @@ -200,7 +200,7 @@ describe('in streaming mode', () => {
vinylFS
.src(png, { buffer: false })
.pipe(convertImageToTXI())
.on('error', done.fail)
.on('error', done)
.on('data', (txi: Vinyl) => {
expect(txi.basename).toBe(`${filename}.txi`);
expect(txi.isStream()).toBe(true);
Expand Down Expand Up @@ -228,7 +228,7 @@ describe('in buffered mode', () => {
expect(error).toMatchSnapshot();
done();
})
.on('data', () => done.fail('Got an unexpected file'));
.on('data', () => done('Got an unexpected file'));
});

// FIXME: Jest typings are broken and can't deal with the done callback parameter properly
Expand All @@ -244,7 +244,7 @@ describe('in buffered mode', () => {
expect(error).toMatchSnapshot();
done();
})
.on('data', () => done.fail('Got an unexpected file'))
.on('data', () => done('Got an unexpected file'))
.end(
new Vinyl({
contents,
Expand All @@ -268,7 +268,7 @@ describe('in buffered mode', () => {
vinylFS
.src(png)
.pipe(convertImageToTXI())
.on('error', done.fail)
.on('error', done)
.on('data', (txi: Vinyl) => {
expect(txi.basename).toBe(`${filename}.txi`);
expect(txi.isBuffer()).toBe(true);
Expand All @@ -288,7 +288,7 @@ describe('RGBA output format for alpha channel images', () => {
vinylFS
.src(png)
.pipe(convertImageToTXI({ rgbaOutputFormat: TXIOutputFormat.RGBA6666 }))
.on('error', done.fail)
.on('error', done)
.on('data', (txi: Vinyl) => {
if (txi.isBuffer()) {
expect(
Expand All @@ -305,7 +305,7 @@ describe('RGBA output format for alpha channel images', () => {
vinylFS
.src(png)
.pipe(convertImageToTXI())
.on('error', done.fail)
.on('error', done)
.on('data', (txi: Vinyl) => {
if (txi.isBuffer()) {
expect(txi.contents.compare(readFileSync(`${png}.txi`))).toBe(0);
Expand Down

0 comments on commit 06f86cc

Please sign in to comment.