Skip to content

Commit 0475545

Browse files
authored
Merge pull request #363 from rtfpessoa/bump-dependencies
bump: Update dependencies
2 parents 006d82c + fb66c8f commit 0475545

File tree

7 files changed

+2051
-4041
lines changed

7 files changed

+2051
-4041
lines changed

.circleci/config.yml

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
paths:
3131
- '*'
3232

33-
build-common: &common-build
33+
build-common: &build-common
3434
docker:
3535
- image: node
3636
working_directory: ~/workdir
@@ -51,9 +51,14 @@ jobs:
5151
key: yarn-cache-{{ checksum "yarn.lock" }}
5252
paths:
5353
- /usr/local/share/.cache/yarn
54-
- run: yarn run build:templates && yarn run build
54+
- run:
55+
name: Build templates
56+
command: yarn run build:templates
57+
- run:
58+
name: Build library
59+
command: yarn run build
5560

56-
build-latest: &latest-build
61+
build-stable: &build-stable
5762
docker:
5863
- image: node
5964
working_directory: ~/workdir
@@ -74,7 +79,9 @@ jobs:
7479
key: yarn-cache-{{ checksum "yarn.lock" }}
7580
paths:
7681
- /usr/local/share/.cache/yarn
77-
- run: yarn run validate
82+
- run:
83+
name: Validate & Build
84+
command: yarn run validate
7885
- store_artifacts:
7986
path: coverage
8087
- store_test_results:
@@ -85,18 +92,18 @@ jobs:
8592
paths:
8693
- '*'
8794

88-
build-node-10:
89-
<<: *common-build
90-
docker:
91-
- image: node:11
92-
9395
build-node-12:
94-
<<: *common-build
96+
<<: *build-common
9597
docker:
9698
- image: node:12
9799

100+
build-node-15:
101+
<<: *build-common
102+
docker:
103+
- image: node:15
104+
98105
build-node-14:
99-
<<: *latest-build
106+
<<: *build-stable
100107
docker:
101108
- image: node:14
102109

@@ -175,7 +182,7 @@ jobs:
175182
176183
publish_website:
177184
machine:
178-
enabled: true
185+
image: ubuntu-1604:202004-01
179186
working_directory: ~/workdir
180187
steps:
181188
- attach_workspace:
@@ -191,21 +198,21 @@ workflows:
191198
validate-and-publish:
192199
jobs:
193200
- checkout-and-version
194-
- build-node-10:
195-
requires:
196-
- checkout-and-version
197201
- build-node-12:
198202
requires:
199203
- checkout-and-version
200204
- build-node-14:
201205
requires:
202206
- checkout-and-version
207+
- build-node-15:
208+
requires:
209+
- checkout-and-version
203210
- publish_approval:
204211
type: approval
205212
requires:
206-
- build-node-10
207213
- build-node-12
208214
- build-node-14
215+
- build-node-15
209216
- tag_version:
210217
requires:
211218
- publish_approval

.eslintrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ module.exports = {
3030
'plugin:jest/recommended',
3131
'plugin:jest/style',
3232
'prettier',
33-
'prettier/@typescript-eslint',
34-
'prettier/babel',
3533
],
3634
plugins: ['@typescript-eslint', 'json', 'promise', 'import', 'node', 'sonarjs', 'jest', 'optimize-regex'],
3735
rules: {

.husky/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn lint-staged

package.json

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"url": "https://www.github.com/rtfpessoa/diff2html/issues"
3333
},
3434
"engines": {
35-
"node": ">=10"
35+
"node": ">=12"
3636
},
3737
"scripts": {
3838
"eslint": "eslint --ignore-path .gitignore \"**/*.{js,jsx,ts,tsx,json}\"",
@@ -44,10 +44,10 @@
4444
"build": "yarn run build:css && yarn run build:templates && yarn run build:es5 && yarn run build:esm && yarn run build:bundles && yarn run build:website",
4545
"build:es5": "rm -rf lib; tsc -p tsconfig.json --outDir lib",
4646
"build:esm": "rm -rf lib-esm; tsc -p tsconfig.json -m es6 --outDir lib-esm",
47-
"build:bundles": "rm -rf ./bundles/js; webpack ---display-reasons --display-modules --mode production --config webpack.bundles.ts",
47+
"build:bundles": "rm -rf ./bundles/js; webpack --mode production --config webpack.bundles.ts",
4848
"build:css": "rm -rf ./bundles/css; postcss --config ./postcss.config.js --no-map -o ./bundles/css/diff2html.min.css ./src/ui/css/diff2html.css",
4949
"build:templates": "ts-node ./scripts/hulk.ts --wrapper ts --variable 'defaultTemplates' ./src/templates/*.mustache > ./src/diff2html-templates.ts",
50-
"build:website": "rm -rf docs; webpack ---display-reasons --display-modules --mode production --config webpack.website.ts",
50+
"build:website": "rm -rf docs; webpack --mode production --config webpack.website.ts",
5151
"gen": "yarn run gen:toc",
5252
"gen:toc-base": "markdown-toc --maxdepth 3 --bullets='-' -i",
5353
"gen:toc": "yarn run gen:toc-base README.md",
@@ -62,16 +62,14 @@
6262
"start": "yarn run start:website",
6363
"start:website": "webpack-dev-server --mode development --config webpack.website.ts",
6464
"preversion": "yarn run validate",
65-
"version": "git add -A package.json"
65+
"version": "git add -A package.json",
66+
"postinstall": "husky install",
67+
"prepublishOnly": "pinst --disable",
68+
"postpublish": "pinst --enable"
6669
},
6770
"main": "./lib/diff2html.js",
6871
"module": "./lib-esm/diff2html.js",
6972
"types": "./lib/diff2html.d.ts",
70-
"husky": {
71-
"hooks": {
72-
"pre-commit": "lint-staged"
73-
}
74-
},
7573
"lint-staged": {
7674
"**/*.+(js|jsx|ts|tsx|json)": [
7775
"prettier --write",
@@ -85,68 +83,67 @@
8583
]
8684
},
8785
"dependencies": {
88-
"diff": "4.0.2",
86+
"diff": "5.0.0",
8987
"hogan.js": "3.0.2"
9088
},
9189
"optionalDependencies": {
92-
"highlight.js": "10.4.1"
90+
"highlight.js": "10.7.1"
9391
},
9492
"devDependencies": {
9593
"@types/clipboard": "2.0.1",
96-
"@types/copy-webpack-plugin": "6.0.0",
97-
"@types/diff": "4.0.2",
94+
"@types/copy-webpack-plugin": "6.4.1",
95+
"@types/diff": "5.0.0",
9896
"@types/hogan.js": "3.0.0",
99-
"@types/html-webpack-plugin": "3.2.3",
100-
"@types/jest": "26.0.14",
101-
"@types/mini-css-extract-plugin": "0.9.1",
97+
"@types/jest": "26.0.22",
98+
"@types/mini-css-extract-plugin": "^1.2.2",
10299
"@types/mkdirp": "1.0.1",
103-
"@types/node": "14.11.10",
100+
"@types/node": "14.14.37",
104101
"@types/nopt": "3.0.29",
105-
"@typescript-eslint/eslint-plugin": "4.4.1",
106-
"@typescript-eslint/parser": "4.4.1",
107-
"autoprefixer": "10.0.1",
108-
"bulma": "^0.9.0",
109-
"clipboard": "2.0.6",
110-
"copy-webpack-plugin": "6.1.0",
111-
"css-loader": "5.0.0",
102+
"@typescript-eslint/eslint-plugin": "4.20.0",
103+
"@typescript-eslint/parser": "4.20.0",
104+
"autoprefixer": "10.2.5",
105+
"bulma": "^0.9.2",
106+
"clipboard": "2.0.8",
107+
"copy-webpack-plugin": "8.1.0",
108+
"css-loader": "5.2.0",
112109
"cssnano": "4.1.10",
113-
"eslint": "7.11.0",
114-
"eslint-config-prettier": "6.13.0",
110+
"eslint": "7.23.0",
111+
"eslint-config-prettier": "8.1.0",
115112
"eslint-plugin-import": "2.22.1",
116-
"eslint-plugin-jest": "24.1.0",
113+
"eslint-plugin-jest": "24.3.3",
117114
"eslint-plugin-json": "2.1.2",
118115
"eslint-plugin-node": "11.1.0",
119116
"eslint-plugin-optimize-regex": "1.2.0",
120-
"eslint-plugin-promise": "4.2.1",
121-
"eslint-plugin-sonarjs": "0.5.0",
122-
"file-loader": "6.1.1",
123-
"handlebars": "4.7.6",
117+
"eslint-plugin-promise": "4.3.1",
118+
"eslint-plugin-sonarjs": "0.6.0",
119+
"file-loader": "6.2.0",
120+
"handlebars": "4.7.7",
124121
"handlebars-loader": "1.7.1",
125-
"html-webpack-plugin": "4.4.1",
126-
"husky": "4.3.0",
127-
"image-webpack-loader": "6.0.0",
128-
"is-ci-cli": "2.1.2",
129-
"jest": "26.5.3",
130-
"lint-staged": "10.4.1",
122+
"html-webpack-plugin": "5.3.1",
123+
"husky": "^6.0.0",
124+
"image-webpack-loader": "7.0.1",
125+
"is-ci-cli": "2.2.0",
126+
"jest": "26.6.3",
127+
"lint-staged": "10.5.4",
131128
"markdown-toc": "^1.2.0",
132-
"mini-css-extract-plugin": "0.11.0",
129+
"mini-css-extract-plugin": "1.4.0",
133130
"mkdirp": "1.0.4",
134131
"nopt": "5.0.0",
135-
"postcss": "8.1.1",
136-
"postcss-cli": "8.1.0",
137-
"postcss-import": "12.0.1",
138-
"postcss-loader": "4.0.4",
132+
"pinst": "^2.1.4",
133+
"postcss": "8.2.9",
134+
"postcss-cli": "8.3.1",
135+
"postcss-import": "14.0.1",
136+
"postcss-loader": "5.2.0",
139137
"postcss-preset-env": "6.7.0",
140-
"prettier": "2.1.2",
141-
"ts-jest": "26.4.1",
142-
"ts-loader": "8.0.5",
143-
"ts-node": "9.0.0",
144-
"typescript": "4.0.3",
138+
"prettier": "2.2.1",
139+
"ts-jest": "26.5.4",
140+
"ts-loader": "8.1.0",
141+
"ts-node": "9.1.1",
142+
"typescript": "4.2.3",
145143
"url-loader": "4.1.1",
146-
"webpack": "4.44.1",
147-
"webpack-cli": "3.3.12",
148-
"webpack-dev-server": "3.11.0",
149-
"whatwg-fetch": "3.4.1"
144+
"webpack": "5.30.0",
145+
"webpack-cli": "4.6.0",
146+
"whatwg-fetch": "3.6.2"
150147
},
151148
"resolutions": {
152149
"lodash": ">=4.17.20",
@@ -155,7 +152,8 @@
155152
"autolinker": ">=3.14.1",
156153
"bl": ">=2.2.1",
157154
"decompress": ">=4.2.1",
158-
"node-forge": ">=0.10.0"
155+
"node-forge": ">=0.10.0",
156+
"@types/webpack": ">=5.28.0"
159157
},
160158
"license": "MIT",
161159
"files": [

webpack.website.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import CopyWebpackPlugin from 'copy-webpack-plugin';
77

88
const pages = ['index', 'demo'];
99

10-
function plugins(page: string): webpack.Plugin[] {
10+
function plugins(page: string): webpack.WebpackPluginInstance[] {
1111
return [
1212
new MiniCssExtractPlugin({
1313
filename: '[name].css',
@@ -47,11 +47,6 @@ function plugins(page: string): webpack.Plugin[] {
4747

4848
const config: webpack.Configuration[] = pages.map(page => {
4949
return {
50-
devServer: {
51-
port: 3000,
52-
open: true,
53-
contentBase: path.join(__dirname, './website'),
54-
},
5550
entry: {
5651
[page]: `./website/templates/pages/${page}/${page}.ts`,
5752
},

0 commit comments

Comments
 (0)