Skip to content

Commit

Permalink
chore(deps): Bump deps to support node 17
Browse files Browse the repository at this point in the history
  • Loading branch information
ReidWeb committed Jan 17, 2022
1 parent 36c092e commit 136938b
Show file tree
Hide file tree
Showing 14 changed files with 11,395 additions and 12,299 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ module.exports = {
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:jsdoc/recommended',
'plugin:import/recommended',
'plugin:import/typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand All @@ -47,6 +49,7 @@ module.exports = {
mustMatch: 'MIT License',
},
],
'react/jsx-filename-extension': 'off',
},
overrides: [
{
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
14
16
23,507 changes: 11,316 additions & 12,191 deletions package-lock.json

Large diffs are not rendered by default.

50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,41 +72,41 @@
},
"homepage": "https://github.com/XIVStats/lodestone#readme",
"dependencies": {
"axios": "^0.21.1",
"axios": "^0.24.0",
"cheerio": "^1.0.0-rc.10",
"p-limit": "^3.1.0"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
"@commitlint/config-conventional": "^13.1.0",
"@semantic-release/changelog": "^5.0.1",
"@types/jest": "^26.0.24",
"@typescript-eslint/eslint-plugin": "^4.28.5",
"@typescript-eslint/parser": "^4.28.5",
"babel-jest": "^27.0.6",
"@commitlint/cli": "^16.0.2",
"@commitlint/config-conventional": "^16.0.0",
"@semantic-release/changelog": "^6.0.1",
"@types/jest": "^27.4.0",
"@typescript-eslint/eslint-plugin": "^5.10.0",
"@typescript-eslint/parser": "^5.10.0",
"babel-jest": "^27.4.6",
"commitizen": "^4.2.4",
"cz-conventional-changelog": "^3.3.0",
"eslint": "^7.32.0",
"eslint-config-airbnb-typescript": "^12.3.1",
"eslint": "^8.7.0",
"eslint-config-airbnb-typescript": "^16.1.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsdoc": "^37.0.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsdoc": "^37.6.1",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^7.0.1",
"jest": "^27.0.6",
"jest-junit": "^12.0.0",
"prettier": "^2.3.2",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"husky": "^7.0.4",
"jest": "^27.4.7",
"jest-junit": "^13.0.0",
"prettier": "^2.5.1",
"prettier-eslint": "^13.0.0",
"prettier-eslint-cli": "^5.0.1",
"semantic-release": "^18.0.0",
"ts-jest": "^27.0.4",
"typedoc": "^0.21.9",
"typedoc-plugin-markdown": "^3.10.4",
"typescript": "^4.3.5"
"semantic-release": "^18.0.1",
"ts-jest": "^27.1.3",
"typedoc": "^0.22.10",
"typedoc-plugin-markdown": "^3.11.11",
"typescript": "^4.5.4"
},
"husky": {
"hooks": {
Expand Down
6 changes: 4 additions & 2 deletions src/client/LodestoneClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ export default abstract class LodestoneClient implements IClientProps {
}
}

protected async getPath(path: string, language?: Language): Promise<AxiosResponse> {
const promises: Promise<AxiosResponse>[] = [this.parallelismLimit(() => this.getInstanceToUse(language).get(path))]
protected async getPath(path: string, language?: Language): Promise<AxiosResponse<string>> {
const promises: Promise<AxiosResponse>[] = [
this.parallelismLimit(() => this.getInstanceToUse(language).get<string>(path)),
]
const settledPromises = await Promise.all(promises)
return settledPromises[0]
}
Expand Down
8 changes: 5 additions & 3 deletions src/client/entity/CharacterClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ export default class CharacterClient extends LodestoneClient {
throw new CharacterFetchError(id, ae)
}
} else {
throw new CharacterFetchError(id, e)
if (e instanceof Error) {
throw new CharacterFetchError(id, e)
} else {
throw e
}
}
}
}
Expand All @@ -74,13 +78,11 @@ export default class CharacterClient extends LodestoneClient {
if (onSuccess) {
onSuccess(result.value.id, result.value)
}
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
} else if (result.status === 'rejected' && result.reason.code === 'ENOTFOUND') {
notFoundCharacters.push(result.reason.characterId)
if (onDeleted) {
onDeleted(result.reason.characterId)
}
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
} else if (result.status === 'rejected') {
failedCharacters.push(result.reason)
if (onError) {
Expand Down
2 changes: 1 addition & 1 deletion src/entity/character/Character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export default class Character implements ICharacter {
static fromPage(id: number, data: string, cheerio: CheerioAPI, language: Language, gearIdsOnly?: boolean): Character {
const $ = cheerio.load(data)

const character = new Character(id, $(CharacterDomConfig.name).text())
const character = new Character(id, $(<string>CharacterDomConfig.name).text())

Object.entries(CharacterDomConfig).forEach(([key, value]) => {
Object.assign(character, { [key]: Character.processAttribute($, value) })
Expand Down
33 changes: 33 additions & 0 deletions src/entity/character/MappableCharacter.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* MIT License
*
* Copyright (c) 2021 Peter Reid <peter@reidweb.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/

import ICharacter from './interface/ICharacter'
import IAttributeMapping from '../../parser/interface/IAttributeMapping'

type MappableCharacter = {
[key in keyof ICharacter]: string | IAttributeMapping
}

export default MappableCharacter
1 change: 1 addition & 0 deletions src/entity/character/__tests__/Character.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ describe('Character', () => {

if (objectAttributes.length > 0) {
describe.each(objectAttributes)('should evaluate %s as object', (key, value) => {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
describe.each(Object.entries(value))('with key %s, an object', (lowerKey, lowerValue) => {
if (!(lowerValue instanceof Object)) {
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('Class [integration]', () => {
let $: CheerioAPI
beforeAll(async () => {
const resp = await client?.axiosInstances?.en?.get(`/character/${testCharacterId}`)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
$ = client.cheerioInstance.load(resp?.data)
})

Expand All @@ -64,6 +65,7 @@ describe('Class [integration]', () => {
let $: CheerioAPI
beforeAll(async () => {
const resp = await client?.axiosInstances?.[languageUnderTest]?.get(`/character/${testCharacterId}`)
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
$ = client.cheerioInstance.load(resp?.data)
})

Expand Down
5 changes: 2 additions & 3 deletions src/entity/character/config/CharacterDomConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
*
*/

import { IMappableCharacter } from '../interface/IMappableCharacter'
import Class from '../attribute/class/Class'
import MappableCharacter from '../MappableCharacter'

const CharacterDomConfig: IMappableCharacter = {
const CharacterDomConfig: MappableCharacter = {
name: '#character > div.frame__chara.js__toggle_wrapper > a > div.frame__chara__box > p.frame__chara__name',
activeClass: {
selector:
Expand Down Expand Up @@ -60,7 +60,6 @@ const CharacterDomConfig: IMappableCharacter = {
selector: 'div.character__pvpteam__name > h4',
isGroupLink: true,
},
gear: {},
gender: {
selector:
'#character > div.character__content.selected > div.character__profile.clearfix > div.character__profile__data > div:nth-child(1) > div > div:nth-child(1) > div > p.character-block__name',
Expand Down
3 changes: 1 addition & 2 deletions src/entity/character/interface/ICharacter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
*/

import IGearSet from '../attribute/gear/IGearSet'
import { IMappableCharacter } from './IMappableCharacter'
import ClassAbbreviation from '../attribute/class/category/ClassAbbreviation'
import IItem from '../../item/interface/IItem'
import IPlayerGroup from '../attribute/group/IPlayerGroup'
import ClassLevels from '../attribute/class/ClassLevels'

export default interface ICharacter extends IMappableCharacter {
export default interface ICharacter {
readonly name: string

readonly homeWorld?: string
Expand Down
71 changes: 0 additions & 71 deletions src/entity/character/interface/IMappableCharacter.ts

This file was deleted.

1 change: 1 addition & 0 deletions src/entity/creature/__tests__/Creature.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ describe('Creature', () => {
if (objectAttributes.length > 0) {
describe.each(objectAttributes)('should evaluate %s as object', (key, value) => {
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
it.each(Object.entries(value))("with key %s equal to '%s'", (lowerKey, lowerValue) => {
// @ts-ignore
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
Expand Down

0 comments on commit 136938b

Please sign in to comment.