Skip to content

Commit

Permalink
build(deps):️ upgrading dependencies (#65)
Browse files Browse the repository at this point in the history
* build(deps): update dependency axios to ^0.21.0 (#64)
* build(deps): bump npm-user-validate from 1.0.0 to 1.0.1 (#63)
* build(deps): update dependency eslint to v7 (#38)
* build(deps): update dependency typescript to v4 (#62)
* build(deps): update eslint related deps
* build(tests): fix mocha config for v8
* build(deps): update dependency mocha to v8
  • Loading branch information
Roguyt committed Oct 27, 2020
1 parent 3ace47f commit e6bdf3f
Show file tree
Hide file tree
Showing 11 changed files with 491 additions and 435 deletions.
29 changes: 12 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
"name": "node-epicsgg",
"version": "2.3.5",
"description": "An interface to communicate with Epics.gg API",
"keywords": [
"epics.gg",
"epics"
],
"keywords": ["epics.gg", "epics"],
"author": {
"url": "https://clmntw.fr",
"email": "git@clmntw.fr",
Expand All @@ -31,7 +28,7 @@
"node": ">=8.0.0"
},
"scripts": {
"test": "mocha --opts tests/mocha.opts tests/**/*-test.{ts,tsx}",
"test": "mocha --config tests/.mocharc.js tests/**/*-test.{ts,tsx}",
"lint": "eslint 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}'",
"format": "prettier --write 'src/**/*.{ts,tsx}' 'tests/**/*.{ts,tsx}'",
"build": "tsc -p tsconfig.json",
Expand All @@ -43,9 +40,7 @@
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"license": "MIT",
"files": [
"lib/"
],
"files": ["lib/"],
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged --pattern '**/*'"
Expand All @@ -61,34 +56,34 @@
"@semantic-release/release-notes-generator": "^9.0.1",
"@types/chai": "^4.1.7",
"@types/jsonwebtoken": "^8.3.9",
"@types/mocha": "^7.0.0",
"@types/mocha": "^8.0.0",
"@types/node": "^12.0.12",
"@types/socket.io": "^2.1.2",
"@typescript-eslint/eslint-plugin": "^2.30.0",
"@typescript-eslint/parser": "^2.30.0",
"@typescript-eslint/eslint-plugin": "^4.0.0",
"@typescript-eslint/parser": "^4.0.0",
"chai": "^4.2.0",
"conventional-changelog-insurgent": "^6.1.1",
"eslint": "^6.0.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint": "^7.2.0",
"eslint-config-airbnb-base": "^14.2.0",
"eslint-config-prettier": "^6.0.0",
"eslint-config-typescript": "^3.0.0",
"eslint-formatter-pretty": "^4.0.0",
"eslint-import-resolver-typescript": "^2.0.0",
"eslint-plugin-import": "^2.18.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-prettier": "^3.1.0",
"husky": "^4.2.5",
"mocha": "^7.0.0",
"mocha": "^8.0.0",
"mocha-clean": "^1.0.0",
"prettier": "^2.0.5",
"pretty-quick": "^3.0.0",
"resolve": "^1.11.1",
"semantic-release": "^17.0.7",
"ts-node": "^9.0.0",
"typedoc": "^0.19.0",
"typescript": "^3.5.2"
"typescript": "^4.0.0"
},
"dependencies": {
"axios": "^0.20.0",
"axios": "^0.21.0",
"https-proxy-agent": "^5.0.0",
"jsonwebtoken": "^8.5.1",
"socket.io-client": "^2.2.0"
Expand Down
1 change: 1 addition & 0 deletions src/client/SocketClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { PackOpenedFeed } from '../interfaces/PackOpenedFeed';
import { PackPurchasedFeed } from '../interfaces/PackPurchasedFeed';
import { SpinnerFeed } from '../interfaces/SpinnerFeed';

// eslint-disable-next-line import/order
import SocketIO = require('socket.io');

/**
Expand Down
2 changes: 2 additions & 0 deletions src/client/utils/Card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import DateUtils from './Date';
* @hidden
*/
export default class CardUtils {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public static createCard(data: any): Card {
return {
id: data.id,
Expand All @@ -27,6 +28,7 @@ export default class CardUtils {
};
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public static createCardTemplate(data: any): CardTemplate {
const cardTemplate: CardTemplate = {
id: data.id,
Expand Down
25 changes: 13 additions & 12 deletions src/client/utils/Market.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,30 @@ import { MarketListing } from '../../interfaces/MarketListing';
* @hidden
*/
export default class MarketUtils {
public static createMarketListing(listing: any): MarketListing {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public static createMarketListing(data: any): MarketListing {
const marketListing: MarketListing = {
marketId: listing.marketId,
marketId: data.marketId,

price: listing.price,
price: data.price,
previousAvgPrice: {
value: listing.previousAvgPrice?.statValue ?? null,
date: DateUtils.convertToDate(listing.previousAvgPrice?.statDate ?? null),
value: data.previousAvgPrice?.statValue ?? null,
date: DateUtils.convertToDate(data.previousAvgPrice?.statDate ?? null),
},
// @TODO rename to currentHourPrice to stick to the API contract
currentAvgHourPrice: {
value: listing.currentHourPrice?.statValue ?? null,
date: DateUtils.convertToDate(listing.currentHourPrice?.statDate ?? null),
value: data.currentHourPrice?.statValue ?? null,
date: DateUtils.convertToDate(data.currentHourPrice?.statDate ?? null),
},

createdAt: new Date(listing.created),
createdAt: new Date(data.created),

type: listing.type,
type: data.type,
};

if (listing.card) marketListing.card = CardUtils.createCard(listing.card);
if (listing.pack) marketListing.pack = PackUtils.createPack(listing.pack.packTemplate);
if (listing.sticker) marketListing.sticker = StickerUtils.createSticker(listing.sticker);
if (data.card) marketListing.card = CardUtils.createCard(data.card);
if (data.pack) marketListing.pack = PackUtils.createPack(data.pack.packTemplate);
if (data.sticker) marketListing.sticker = StickerUtils.createSticker(data.sticker);

return marketListing;
}
Expand Down
1 change: 1 addition & 0 deletions src/client/utils/Pack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Pack } from '../../interfaces/Pack';
* @hidden
*/
export default class PackUtils {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public static createPack(data: any): Pack {
const pack: Pack = {
id: data.id,
Expand Down
2 changes: 2 additions & 0 deletions src/client/utils/Sticker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { StickerTemplate } from '../../interfaces/StickerTemplate';
* @hidden
*/
export default class StickerUtils {
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public static createSticker(data: any): Sticker {
return {
id: data.id,
Expand All @@ -22,6 +23,7 @@ export default class StickerUtils {
};
}

// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
public static createStickerTemplate(data: any): StickerTemplate {
return {
id: data.id,
Expand Down
2 changes: 1 addition & 1 deletion src/interfaces/CurrentUser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ export interface CurrentUser {
profileUrl: string;
avatar: string;
} | null;
opskins: {} | null;
opskins: Record<string, unknown> | null;
}
7 changes: 7 additions & 0 deletions tests/.mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
'use strict';

module.exports = {
recursive: true,
reporter: 'min',
require: ['mocha-clean', 'ts-node/register'],
};
2 changes: 1 addition & 1 deletion tests/index-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import obj = require('../src/index');
const { describe, it } = global;

describe('obj', (): void => {
it('works', (): Chai.Assertion => expect(obj).to.be.ok);
it('works', () => expect(obj).to.be.ok);
});
4 changes: 0 additions & 4 deletions tests/mocha.opts

This file was deleted.

0 comments on commit e6bdf3f

Please sign in to comment.