Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
Merge pull request #4 from questbeat/update-packages
Browse files Browse the repository at this point in the history
Update packages
  • Loading branch information
nek023 committed May 5, 2020
2 parents 5fb224e + 27e644b commit f2611e6
Show file tree
Hide file tree
Showing 16 changed files with 698 additions and 579 deletions.
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

24 changes: 24 additions & 0 deletions .eslintrc.json
@@ -0,0 +1,24 @@
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended",
"prettier/@typescript-eslint",
"prettier/react",
"react-app"
],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-empty-function": "off",
"prettier/prettier": [
"error",
{
"semi": false,
"singleQuote": true
}
],
"sort-imports": ["warn", { "ignoreDeclarationSort": true }],
"sort-vars": "warn"
}
}
5 changes: 2 additions & 3 deletions .gitignore
Expand Up @@ -2,8 +2,7 @@
/build
/node_modules

npm-debug.log*
yarn-debug.log*
yarn-error.log*
npm-*.log
yarn-*.log

/data/regalia.xlsx
22 changes: 17 additions & 5 deletions LICENSE
@@ -1,9 +1,21 @@
The MIT License (MIT)
MIT License

Copyright © Katsuma Tanaka
Copyright (c) Katsuma Tanaka

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:
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 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.
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.
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -10,8 +10,8 @@ help:
definitions: ## Generate regalia definitions
@$(TS_NODE) scripts/definitions.ts

.PHONY: download
download: ## Download spreadsheet
.PHONY: sheet
sheet: ## Download spreadsheet
@curl -L -o data/regalia.xlsx https://docs.google.com/spreadsheets/d/18hSvxSKns_Y3dlqBs-kzaiILYCy9cSU6IjJzUFucgIs/export?format=xlsx

.PHONY: test
Expand Down
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -20,7 +20,7 @@ https://last-period.netlify.app/
git clone git@github.com:questbeat/last-period-tools.git
cd last-period-tools

yarn
yarn install
```

### Run
Expand All @@ -46,10 +46,10 @@ yarn build
### Generate regalia data

```sh
make download definitions
make sheet definitions
```


## License

[MIT License](https://github.com/questbeat/last-period-tools/blob/master/LICENSE)
Last Period Tools is [MIT Licensed](LICENSE).
31 changes: 15 additions & 16 deletions package.json
Expand Up @@ -19,42 +19,41 @@
"build": "react-scripts build",
"eject": "react-scripts eject",
"lint": "eslint 'src/**/*.{ts,tsx}' 'scripts/**/*.{ts,tsx}'",
"lint:fix": "yarn lint -- --fix",
"start": "react-scripts start",
"test": "react-scripts test"
},
"dependencies": {
"@material-ui/core": "^4.9.7",
"@material-ui/core": "^4.9.13",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.46",
"@msgpack/msgpack": "^1.12.0",
"@material-ui/lab": "^4.0.0-alpha.52",
"@msgpack/msgpack": "^1.12.1",
"@types/base64-js": "^1.2.5",
"@types/js-yaml": "^3.12.3",
"@types/node": "^12.12.31",
"@types/react": "^16.9.25",
"@types/react-dom": "^16.9.5",
"@types/react-router-dom": "^5.1.3",
"@types/node": "^13.13.4",
"@types/react": "^16.9.34",
"@types/react-dom": "^16.9.7",
"@types/react-router-dom": "^5.1.5",
"@types/shortid": "^0.0.29",
"@typescript-eslint/eslint-plugin": "^2.25.0",
"@typescript-eslint/parser": "^2.25.0",
"@typescript-eslint/eslint-plugin": "^2.31.0",
"@typescript-eslint/parser": "^2.31.0",
"base64-js": "^1.3.1",
"bignumber.js": "^9.0.0",
"clipboard-copy": "^3.1.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.19.0",
"js-yaml": "^3.13.1",
"prettier": "^2.0.2",
"query-string": "^6.11.1",
"prettier": "^2.0.5",
"query-string": "^6.12.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.1",
"rimraf": "^3.0.2",
"shortid": "^2.2.15",
"ts-node": "^8.8.1",
"ts-node": "^8.10.1",
"typescript": "^3.8.3",
"xlsx": "^0.15.6"
"xlsx": "^0.16.0"
}
}
1 change: 0 additions & 1 deletion public/index.html
Expand Up @@ -7,7 +7,6 @@
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-29101083-5');
</script>

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/components/calculator/Calculator.tsx
Expand Up @@ -10,7 +10,7 @@ import { CalculatorTable } from './CalculatorTable'
import { CalculatorToolbar } from './CalculatorToolbar'
import { RouteComponentProps, withRouter } from 'react-router-dom'
import queryString from 'query-string'
import { decodeRegalias, encodeRegalias } from '../../utils/serialization'
import { decodeRegalias, encodeRegalias } from '../../serialization'
import copyToClipboard from 'clipboard-copy'
import { Notification } from './Notification'

Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/Main.tsx
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Container } from '@material-ui/core'
import { Theme, createStyles, makeStyles } from '@material-ui/core/styles'
import { Route, Switch } from 'react-router-dom'
import { About } from '../static/About'
import { About } from '../about/About'
import { Calculator } from '../calculator/Calculator'
import { Chart } from '../chart/Chart'

Expand Down
90 changes: 37 additions & 53 deletions src/modules/calculator.ts
Expand Up @@ -11,63 +11,47 @@ enum CalculatorActionType {
SetRegalias = 'CALC_SET_REGALIAS',
}

export function addRegalia() {
return {
type: CalculatorActionType.AddRegalia as const,
}
}
export const addRegalia = () => ({
type: CalculatorActionType.AddRegalia as const,
})

export function removeRegalia(id: string) {
return {
type: CalculatorActionType.RemoveRegalia as const,
payload: { id },
}
}
export const removeRegalia = (id: string) => ({
type: CalculatorActionType.RemoveRegalia as const,
payload: { id },
})

export function setRegaliaDefinition(
export const setRegaliaDefinition = (
id: string,
definition: Regalia.Definition
) {
return {
type: CalculatorActionType.SetRegaliaDefinition as const,
payload: { id, definition },
}
}

export function setRegaliaLevel(id: string, level: Regalia.Level) {
return {
type: CalculatorActionType.SetRegaliaLevel as const,
payload: { id, level },
}
}

export function setRegaliaRank(id: string, rank: Regalia.Rank) {
return {
type: CalculatorActionType.SetRegaliaRank as const,
payload: { id, rank },
}
}

export function setRegaliaRarity(id: string, rarity: Regalia.Rarity) {
return {
type: CalculatorActionType.SetRegaliaRarity as const,
payload: { id, rarity },
}
}

export function setRegaliaUpgrade(id: string, upgrade: Regalia.Upgrade) {
return {
type: CalculatorActionType.SetRegaliaUpgrade as const,
payload: { id, upgrade },
}
}

export function setRegalias(regalias: Regalia.Regalia[]) {
return {
type: CalculatorActionType.SetRegalias as const,
payload: { regalias },
}
}
) => ({
type: CalculatorActionType.SetRegaliaDefinition as const,
payload: { id, definition },
})

export const setRegaliaLevel = (id: string, level: Regalia.Level) => ({
type: CalculatorActionType.SetRegaliaLevel as const,
payload: { id, level },
})

export const setRegaliaRank = (id: string, rank: Regalia.Rank) => ({
type: CalculatorActionType.SetRegaliaRank as const,
payload: { id, rank },
})

export const setRegaliaRarity = (id: string, rarity: Regalia.Rarity) => ({
type: CalculatorActionType.SetRegaliaRarity as const,
payload: { id, rarity },
})

export const setRegaliaUpgrade = (id: string, upgrade: Regalia.Upgrade) => ({
type: CalculatorActionType.SetRegaliaUpgrade as const,
payload: { id, upgrade },
})

export const setRegalias = (regalias: Regalia.Regalia[]) => ({
type: CalculatorActionType.SetRegalias as const,
payload: { regalias },
})

export type CalculatorAction =
| ReturnType<typeof addRegalia>
Expand Down
22 changes: 9 additions & 13 deletions src/modules/chart.ts
Expand Up @@ -6,19 +6,15 @@ enum ChartActionType {
SetRank = 'CHART_SET_RANK',
}

export function setDefinition(definition: Regalia.Definition) {
return {
type: ChartActionType.SetDefinition as const,
payload: { definition },
}
}

export function setRank(rank: Regalia.Rank) {
return {
type: ChartActionType.SetRank as const,
payload: { rank },
}
}
export const setDefinition = (definition: Regalia.Definition) => ({
type: ChartActionType.SetDefinition as const,
payload: { definition },
})

export const setRank = (rank: Regalia.Rank) => ({
type: ChartActionType.SetRank as const,
payload: { rank },
})

export type ChartAction =
| ReturnType<typeof setDefinition>
Expand Down

0 comments on commit f2611e6

Please sign in to comment.