Skip to content

Commit

Permalink
chore(packages): upate deps and migrate rollup related plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
neighborhood999 committed Feb 4, 2020
1 parent 5bf7901 commit a33dda1
Show file tree
Hide file tree
Showing 8 changed files with 2,041 additions and 2,198 deletions.
12 changes: 11 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
"node": true,
"es6": true
},
"extends": ["prettier", "prettier/react"],
"extends": [
"prettier",
"prettier/react",
"plugin:react/recommended"
],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": [
Expand All @@ -15,5 +19,11 @@
"singleQuote": true
}
]
},
"settings": {
"react": {
"pragma": "React",
"version": "detect"
}
}
}
7 changes: 0 additions & 7 deletions .huskyrc.json

This file was deleted.

22 changes: 11 additions & 11 deletions .size-snapshot.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"lib/react-gh-like-diff.cjs.js": {
"bundled": 14802,
"minified": 8054,
"gzipped": 2951
"bundled": 13641,
"minified": 7356,
"gzipped": 2759
},
"es/react-gh-like-diff.esm.js": {
"bundled": 14521,
"minified": 7820,
"gzipped": 2893,
"bundled": 13360,
"minified": 7126,
"gzipped": 2694,
"treeshaked": {
"rollup": {
"code": 6559,
"code": 5938,
"import_statements": 211
},
"webpack": {
"code": 7691
"code": 7085
}
}
},
"dist/react-gh-like-diff.umd.js": {
"bundled": 16189,
"minified": 7003,
"gzipped": 2810
"bundled": 14962,
"minified": 6382,
"gzipped": 2628
}
}
61 changes: 31 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,8 @@
]
},
"lint-staged": {
"*.js": [
"eslint --fix",
"git add"
"*.{js}": [
"npm run lint"
]
},
"author": "Peng-Jie <bivinity.pengzjie@gmail.com>",
Expand All @@ -56,47 +55,48 @@
"bugs": {
"url": "https://github.com/neighborhood999/react-gh-like-diff/issues"
},
"license": "MIT",
"husky": {
"hooks": {
"pre-commit": "lint-staged",
"pre-push": "npm run test",
"pre-publish": "npm run build"
}
},
"dependencies": {
"@rollup/plugin-buble": "^0.21.1",
"@rollup/plugin-commonjs": "^11.0.2",
"diff2html": "^2.9.0",
"difflib": "^0.2.4",
"prop-types": "^15.7.2",
"recompose": "^0.30.0"
},
"devDependencies": {
"@babel/cli": "7.7.0",
"@babel/core": "7.7.2",
"@babel/plugin-proposal-object-rest-spread": "7.6.2",
"@babel/preset-env": "7.7.1",
"@babel/preset-react": "7.7.0",
"babel-core": "7.0.0-bridge.0",
"@babel/core": "7.8.4",
"@babel/plugin-proposal-object-rest-spread": "7.8.3",
"@babel/preset-env": "7.8.4",
"@babel/preset-react": "7.8.3",
"@rollup/plugin-node-resolve": "^7.1.1",
"babel-eslint": "10.0.3",
"babel-jest": "24.9.0",
"babel-preset-minify": "0.5.1",
"bundlesize": "0.18.0",
"codecov": "3.6.1",
"enzyme": "3.10.0",
"codecov": "3.6.4",
"enzyme": "3.11.0",
"enzyme-adapter-react-16": "1.15.2",
"eslint": "6.8.0",
"eslint-config-prettier": "6.9.0",
"eslint-config-prettier": "6.10.0",
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "7.17.0",
"husky": "4.0.9",
"jest": "24.9.0",
"lint-staged": "9.5.0",
"npm-run-all": "4.1.5",
"prettier": "1.18.2",
"react": "16.11.0",
"react-dom": "16.11.0",
"react-test-renderer": "16.11.0",
"eslint-plugin-react": "7.18.3",
"husky": "4.2.1",
"jest": "25.1.0",
"lint-staged": "10.0.7",
"prettier": "1.19.1",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-test-renderer": "16.12.0",
"rimraf": "3.0.1",
"rollup": "1.26.3",
"rollup-plugin-babel": "4.3.3",
"rollup-plugin-commonjs": "10.1.0",
"rollup": "1.31.0",
"rollup-plugin-css-porter": "1.0.2",
"rollup-plugin-node-builtins": "2.1.2",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-size-snapshot": "0.10.0"
"rollup-plugin-size-snapshot": "0.11.0"
},
"peerDependencies": {
"react": "^15.0.0 || ^16.0.0",
Expand All @@ -112,5 +112,6 @@
"path": "./lib/react-gh-like-diff.cjs.js",
"maxSize": "5.0 kB"
}
]
],
"license": "MIT"
}
11 changes: 6 additions & 5 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import pkg from './package.json';
import babel from 'rollup-plugin-babel';
import buble from '@rollup/plugin-buble';
import builtins from 'rollup-plugin-node-builtins';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import nodeResolve from '@rollup/plugin-node-resolve';
import css from 'rollup-plugin-css-porter';
import { sizeSnapshot } from 'rollup-plugin-size-snapshot';

Expand All @@ -18,8 +18,9 @@ const baseConfig = {
input: 'src/index.js',
external: ['react', 'prop-types', 'recompose', 'difflib'],
plugins: [
babel({
exclude: 'node_modules/**'
buble({
exclude: 'node_modules/**',
objectAssign: true
}),
builtins(),
nodeResolve({ jsnext: true }),
Expand Down
10 changes: 8 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import {
} from 'recompose';
import 'diff2html/dist/diff2html.css';

export const RenderDiffResult = ({ genDiffHTML }) => (
const RenderDiffResult = ({ genDiffHTML }) => (
<div dangerouslySetInnerHTML={{ __html: genDiffHTML }} />
);

export const ReactGhLikeDiff = compose(
const ReactGhLikeDiff = compose(
defaultProps({
diffString: '',
past: '',
Expand All @@ -37,3 +37,9 @@ export const ReactGhLikeDiff = compose(
}))
)
)(RenderDiffResult);

RenderDiffResult.propTypes = {
genDiffHTML: PropTypes.string
};

export { RenderDiffResult, ReactGhLikeDiff };
5 changes: 1 addition & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,4 @@ const compare = ({ past, current, options }) => {
export const genPrettyHtml = ({ diffString, options }) =>
getPrettyHtml(diffString, options);

export default compose(
genPrettyHtml,
compare
);
export default compose(genPrettyHtml, compare);

0 comments on commit a33dda1

Please sign in to comment.