提交 c77450f8 编写于 作者: A arcthur

chore: update test config and webpack, etc

上级 1ea7df62
......@@ -99,6 +99,7 @@ We are looking for like-minded people who share the same idea about Recharts. Th
<a href="https://opencollective.com/recharts/backer/3/website?requireActive=false" target="_blank"><img src="https://opencollective.com/recharts/backer/3/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/recharts/backer/4/website?requireActive=false" target="_blank"><img src="https://opencollective.com/recharts/backer/4/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/recharts/backer/5/website?requireActive=false" target="_blank"><img src="https://opencollective.com/recharts/backer/5/avatar.svg?requireActive=false"></a>
<a href="https://opencollective.com/recharts/backer/6/website?requireActive=false" target="_blank"><img src="https://opencollective.com/recharts/backer/5/avatar.svg?requireActive=false"></a>
## Sponsoring
......@@ -108,4 +109,4 @@ Most of the core team members do this open source work in their free time. If yo
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2015-2020 Recharts Group.
Copyright (c) 2015-2021 Recharts Group.
此差异已折叠。
......@@ -26,9 +26,9 @@
"build": "rimraf types && npm run build-cjs && npm run build-es6 && rimraf umd && npm run build-umd && npm run build-min",
"build-cjs": "rimraf lib && cross-env NODE_ENV=commonjs babel ./src -d lib --extensions '.js,.ts,.tsx'",
"build-es6": "rimraf es6 && cross-env NODE_ENV=es6 babel ./src -d es6 --extensions '.js,.ts,.tsx'",
"build-umd": "cross-env NODE_ENV=development webpack src/index.ts -o umd/Recharts.js",
"build-min": "cross-env NODE_ENV=production webpack src/index.ts -o umd/Recharts.min.js",
"demo": "webpack-dev-server --progress --port 3000 --host 127.0.0.1 --content-base demo --inline --config demo/webpack.config.js",
"build-umd": "cross-env NODE_ENV=development BABEL_ENV=commonjs webpack --entry ./src/index.js -o umd",
"build-min": "cross-env NODE_ENV=production BABEL_ENV=commonjs webpack --entry ./src/index.js -o umd",
"demo": "webpack serve --config demo/webpack.config.js --port 3000 --host 127.0.0.1 --progress --profile --content-base demo/",
"test": "cross-env NODE_ENV=test karma start test/karma.conf.js",
"lint": "eslint './src/**/*.?(ts|tsx)'",
"autofix": "eslint './src/**/*.?(ts|tsx)' --fix",
......@@ -83,8 +83,8 @@
"@babel/runtime": "^7.6.3",
"@types/classnames": "^2.2.9",
"@types/lodash": "^4.14.144",
"@types/react": "^16.9.9",
"@types/react-dom": "^16.9.2",
"@types/react": "^16.0.0",
"@types/react-dom": "^16.0.0",
"@types/react-is": "^17.0.0",
"@types/react-router-dom": "^5.1.7",
"@typescript-eslint/eslint-plugin": "^4.11.0",
......@@ -99,7 +99,7 @@
"cross-env": "^7.0.3",
"d3-scale-chromatic": "^2.0.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.15.1",
"enzyme-adapter-react-16": "^1.15.6",
"eslint": "^7.16.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^7.1.0",
......@@ -108,7 +108,7 @@
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.19.0",
"json-loader": "^0.5.7",
"karma": "^5.2.3",
"karma": "^6.0.0",
"karma-chai": "^0.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-coverage": "^2.0.2",
......@@ -116,21 +116,21 @@
"karma-firefox-launcher": "^2.1.0",
"karma-mocha": "^2.0.1",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^4.0.0-rc.2",
"karma-webpack": "^5.0.0",
"mocha": "^8.2.1",
"pre-commit": "^1.1.3",
"prettier": "^2.2.1",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react": "^16.0.0",
"react-dom": "^16.0.0",
"react-router-dom": "^5.1.2",
"react-test-renderer": "^16.12.0",
"rimraf": "^3.0.2",
"sinon": "^9.2.2",
"ts-loader": "^8.0.12",
"typescript": "^4.1.3",
"webpack": "^4.41.2",
"webpack-bundle-analyzer": "^3.6.0",
"webpack-cli": "^3.3.9",
"webpack": "^5.0.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-cli": "^4.5.0",
"webpack-dev-server": "^3.11.0"
},
"license": "MIT"
......
......@@ -32,8 +32,8 @@ require('./specs/numberAxis/FunnelSpec');
// chart
require('./specs/chart/AreaChartSpec');
require('./specs/chart/BarChartSpec');
require('./specs/chart/LineChartSpec');
require('./specs/chart/BarchartSpec');
require('./specs/chart/LinechartSpec');
require('./specs/chart/PieChartSpec');
require('./specs/chart/RadarChartSpec');
require('./specs/chart/ScatterChartSpec');
......
......@@ -38,22 +38,40 @@ module.exports = function config(config) {
webpack: {
devtool: 'inline-source-map',
module: {
noParse: [
/node_modules\/sinon\//,
],
rules: [{
test: /\.(js|ts|tsx)$/,
exclude: [
path.resolve('node_modules/'),
use: {
loader: 'babel-loader',
options: {
presets: [
'@babel/preset-env',
'@babel/preset-react'
],
plugins: [
'@babel/transform-runtime'
]
}
},
exclude: /node_modules/,
include: [
__dirname,
path.join(__dirname, '..', 'src'),
path.resolve(__dirname, '/node_modules/d3-scale'),
path.resolve(__dirname, '/node_modules/d3-array'),
path.resolve(__dirname, '/node_modules/d3-format'),
path.resolve(__dirname, '/node_modules/d3-time-format'),
path.resolve(__dirname, '/node_modules/d3-time'),
path.resolve(__dirname, '/node_modules/d3-shape'),
path.resolve(__dirname, '/node_modules/d3-color'),
path.resolve(__dirname, '/node_modules/d3-interpolate'),
path.resolve(__dirname, '/node_modules/d3-path'),
],
loader: 'babel-loader',
}, {
type: 'javascript/auto',
test: /\.json$/,
loader: 'json-loader',
}, {
test: /\.(ts|tsx)$/,
exclude: /node_modules/,
include: [
path.resolve(__dirname, 'src'),
],
use: {
loader: 'ts-loader',
}
......
......@@ -524,9 +524,9 @@ describe("<LineChart /> - Rendering two line charts with syncId", () => {
{ name: 'Page A', uv: 230, pv: 2400, amt: 2400 },
];
const runAllPromises = () => new Promise(setImmediate);
const runAllPromises = () => new Promise(resolve => setTimeout(resolve));
it("should show tooltips for both charts synced by index on MouseEnter and hide on MouseLeave", async() => {
it("should show tooltips for both charts synced by index on MouseEnter and hide on MouseLeave", async() => {
const ActiveDot = ({ cx, cy }) =>
<circle cx={cx} cy={cy} r={10} className="customized-active-dot" />;
......@@ -585,7 +585,7 @@ describe("<LineChart /> - Rendering two line charts with syncId", () => {
const activeDotWrapper = wrapper.find(ActiveDot);
expect(activeDotWrapper.at(0).props().value).to.equal(400);
expect(activeDotWrapper.at(1).props().value).to.equal(500);
// simulate leaving the area
wrapper.find(LineChart).at(0).simulate("mouseLeave");
expect(wrapper.find(".recharts-tooltip-cursor").hostNodes.length).to.equal(0);
......
......@@ -8,9 +8,7 @@ const config = {
entry: './src/index.ts',
output: {
path: path.resolve(__dirname, 'umd'),
library: 'Recharts',
libraryTarget: 'umd',
filename: `Recharts${env === 'production' ? '.min' : ''}.js`,
},
module: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册