Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade everything #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"format:fix": "prettier --write '**/*.{ts,tsx,js,json,md,gql}'",
"test": "mocha --require ts-node/register test/**/*.ts --recursive",
"tslint": "tslint --project ./tsconfig.json --format stylish",
"start": "webpack-dev-server --open --config ./webpack/webpack.config.dev.js"
"start": "webpack serve --open --config ./webpack/webpack.config.dev.js"
},
"husky": {
"hooks": {
Expand All @@ -27,23 +27,23 @@
"@types/reactstrap": "^6.4.2",
"awesome-typescript-loader": "^5.2.1",
"chai": "^4.2.0",
"clean-webpack-plugin": "^0.1.19",
"copy-webpack-plugin": "^4.6.0",
"css-loader": "^1.0.1",
"html-webpack-plugin": "^3.2.0",
"clean-webpack-plugin": "^3.0.0",
"copy-webpack-plugin": "^8.1.1",
"css-loader": "^5.2.2",
"html-webpack-plugin": "^5.3.1",
"husky": "^1.2.0",
"mocha": "^5.2.0",
"prettier": "^1.15.1",
"source-map-loader": "^0.2.4",
"style-loader": "^0.23.1",
"ts-node": "^7.0.1",
"prettier": "^2.2.1",
"source-map-loader": "^2.0.1",
"style-loader": "^2.0.0",
"ts-node": "^9.1.1",
"tslint": "^5.11.0",
"typescript": "^3.1.6",
"typescript": "^4.2.0",
"typestrict": "^1.0.1",
"webpack": "^4.20.2",
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.11",
"webpack-merge": "^4.1.5"
"webpack": "^5.4.0",
"webpack-cli": "^4.2.0",
"webpack-dev-server": "^3.11.0",
"webpack-merge": "^5.7.3"
},
"dependencies": {
"bootstrap": "^4.3.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChainGearboxComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class ChainGearboxComponent extends React.Component<ChainGearboxProps, Ch
<Col>
<ListWithActionOnSide
header="Ratios"
arrayToDisplay={this.state.chainGearbox.gears.map(gear => `${gear[0]} - ${gear[2].toFixed(2)}`)}
arrayToDisplay={this.state.chainGearbox.gears.map((gear) => `${gear[0]} - ${gear[2].toFixed(2)}`)}
clickHandlerGenerator={this.ratiosClickHandlerGenerator}
side="left"
/>
Expand Down
6 changes: 3 additions & 3 deletions src/models/ChainGearbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export class ChainGearbox implements IGearbox {
}

[Symbol.iterator](): Iterator<number> {
return this.gears.map(gear => gear[2])[Symbol.iterator]();
return this.gears.map((gear) => gear[2])[Symbol.iterator]();
}

getRatio(index: number): number {
Expand All @@ -39,8 +39,8 @@ export class ChainGearbox implements IGearbox {

// TODO: could use some tests here?
private forbiddenGearsSorter = (gear1: string, gear2: string) => {
const gear1Indexes = gear1.split("-").map(index => Number.parseInt(index, 10));
const gear2Indexes = gear2.split("-").map(index => Number.parseInt(index, 10));
const gear1Indexes = gear1.split("-").map((index) => Number.parseInt(index, 10));
const gear2Indexes = gear2.split("-").map((index) => Number.parseInt(index, 10));

const res1 = gear1Indexes[0] - gear2Indexes[0];
if (res1 !== 0) {
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@
"sourceMap": true,
"module": "commonjs",
"target": "es2016",
"jsx": "react"
"jsx": "react",
"skipLibCheck": true
},

"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["node_modules", "**/*.spec.ts"]
}
16 changes: 7 additions & 9 deletions webpack/webpack.config.common.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
const path = require("path");
const CleanWebpackPlugin = require("clean-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
const HtmlWebpackPlugin = require("html-webpack-plugin");

module.exports = {
entry: "./src/index.tsx",
devtool: "source-map",
plugins: [
new CleanWebpackPlugin(["dist"], { root: path.resolve(__dirname, "..") }),
new CleanWebpackPlugin({
cleanAfterEveryBuildPatterns: ["dist"],
}),
new HtmlWebpackPlugin({
template: "src/index.template",
title: "Bike gears",
}),
new CopyWebpackPlugin([{ from: "src/favicon", to: "favicon" }]),
new CopyWebpackPlugin({
patterns: [{ from: "src/favicon", to: "favicon" }],
}),
],
resolve: {
extensions: [".ts", ".tsx", ".js", ".json"],
Expand All @@ -33,12 +37,6 @@ module.exports = {
},
{
loader: "css-loader",
options: {
importLoaders: 1,
modules: false,
localIdentName: "[name]__[local]___[hash:base64:5]",
camelCase: "dashesOnly",
},
},
],
},
Expand Down
2 changes: 1 addition & 1 deletion webpack/webpack.config.dev.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const merge = require("webpack-merge");
const { merge } = require("webpack-merge");

const configCommon = require("./webpack.config.common");

Expand Down
2 changes: 1 addition & 1 deletion webpack/webpack.config.prod.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const merge = require("webpack-merge");
const { merge } = require("webpack-merge");

const configCommon = require("./webpack.config.common");

Expand Down
Loading