echarts-for-react 2.0.16 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/LICENSE +3 -3
  2. package/README.md +165 -90
  3. package/esm/core.d.ts +39 -0
  4. package/esm/core.js +157 -0
  5. package/esm/core.js.map +1 -0
  6. package/esm/helper/is-equal.d.ts +2 -0
  7. package/esm/helper/is-equal.js +3 -0
  8. package/esm/helper/is-equal.js.map +1 -0
  9. package/esm/helper/is-function.d.ts +1 -0
  10. package/esm/helper/is-function.js +4 -0
  11. package/esm/helper/is-function.js.map +1 -0
  12. package/esm/helper/is-string.d.ts +1 -0
  13. package/esm/helper/is-string.js +4 -0
  14. package/esm/helper/is-string.js.map +1 -0
  15. package/esm/helper/pick.d.ts +6 -0
  16. package/esm/helper/pick.js +13 -0
  17. package/esm/helper/pick.js.map +1 -0
  18. package/esm/index.d.ts +6 -0
  19. package/esm/index.js +16 -0
  20. package/esm/index.js.map +1 -0
  21. package/esm/types.d.ts +66 -0
  22. package/esm/types.js +2 -0
  23. package/esm/types.js.map +1 -0
  24. package/lib/core.d.ts +38 -10
  25. package/lib/core.js +151 -242
  26. package/lib/core.js.map +1 -0
  27. package/lib/helper/is-equal.d.ts +2 -0
  28. package/lib/helper/is-equal.js +7 -0
  29. package/lib/helper/is-equal.js.map +1 -0
  30. package/lib/helper/is-function.d.ts +1 -0
  31. package/lib/helper/is-function.js +8 -0
  32. package/lib/helper/is-function.js.map +1 -0
  33. package/lib/helper/is-string.d.ts +1 -0
  34. package/lib/helper/is-string.js +8 -0
  35. package/lib/helper/is-string.js.map +1 -0
  36. package/lib/helper/pick.d.ts +6 -0
  37. package/lib/helper/pick.js +17 -0
  38. package/lib/helper/pick.js.map +1 -0
  39. package/lib/index.d.ts +5 -100
  40. package/lib/index.js +17 -39
  41. package/lib/index.js.map +1 -0
  42. package/lib/types.d.ts +66 -0
  43. package/lib/types.js +3 -0
  44. package/lib/types.js.map +1 -0
  45. package/package.json +72 -77
  46. package/src/core.tsx +185 -0
  47. package/src/helper/is-equal.ts +3 -0
  48. package/src/helper/is-function.ts +3 -0
  49. package/src/helper/is-string.ts +3 -0
  50. package/src/helper/pick.ts +12 -0
  51. package/src/index.ts +15 -0
  52. package/src/types.ts +70 -0
  53. package/lib/.DS_Store +0 -0
  54. package/lib/utils.js +0 -14
  55. package/src/core.jsx +0 -194
  56. package/src/index.js +0 -10
  57. package/src/utils.js +0 -10
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isFunction = void 0;
4
+ function isFunction(v) {
5
+ return typeof v === 'function';
6
+ }
7
+ exports.isFunction = isFunction;
8
+ //# sourceMappingURL=is-function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-function.js","sourceRoot":"","sources":["../../src/helper/is-function.ts"],"names":[],"mappings":";;;AAAA,SAAgB,UAAU,CAAC,CAAM;IAC/B,OAAO,OAAO,CAAC,KAAK,UAAU,CAAC;AACjC,CAAC;AAFD,gCAEC","sourcesContent":["export function isFunction(v: any): boolean {\n return typeof v === 'function';\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function isString(v: any): boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isString = void 0;
4
+ function isString(v) {
5
+ return typeof v === 'string';
6
+ }
7
+ exports.isString = isString;
8
+ //# sourceMappingURL=is-string.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"is-string.js","sourceRoot":"","sources":["../../src/helper/is-string.ts"],"names":[],"mappings":";;;AAAA,SAAgB,QAAQ,CAAC,CAAM;IAC7B,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC;AAC/B,CAAC;AAFD,4BAEC","sourcesContent":["export function isString(v: any): boolean {\n return typeof v === 'string';\n}\n"]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 保留 object 中的部分内容
3
+ * @param obj
4
+ * @param keys
5
+ */
6
+ export declare function pick(obj: Record<string, unknown>, keys: string[]): Record<string, unknown>;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pick = void 0;
4
+ /**
5
+ * 保留 object 中的部分内容
6
+ * @param obj
7
+ * @param keys
8
+ */
9
+ function pick(obj, keys) {
10
+ var r = {};
11
+ keys.forEach(function (key) {
12
+ r[key] = obj[key];
13
+ });
14
+ return r;
15
+ }
16
+ exports.pick = pick;
17
+ //# sourceMappingURL=pick.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pick.js","sourceRoot":"","sources":["../../src/helper/pick.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,SAAgB,IAAI,CAAC,GAA4B,EAAE,IAAc;IAC/D,IAAM,CAAC,GAAG,EAAE,CAAC;IACb,IAAI,CAAC,OAAO,CAAC,UAAC,GAAG;QACf,CAAC,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,CAAC;AACX,CAAC;AAND,oBAMC","sourcesContent":["/**\n * 保留 object 中的部分内容\n * @param obj\n * @param keys\n */\nexport function pick(obj: Record<string, unknown>, keys: string[]): Record<string, unknown> {\n const r = {};\n keys.forEach((key) => {\n r[key] = obj[key];\n });\n return r;\n}\n"]}
package/lib/index.d.ts CHANGED
@@ -1,101 +1,6 @@
1
- /// <reference types="react" />
2
-
3
- import * as React from 'react';
4
- import { EChartOption, EChartsLoadingOption, ECharts } from 'echarts';
5
-
6
- type Func = (...args: any[]) => any;
7
-
8
- interface EventMap {
9
- [key: string]: Func,
1
+ import { EChartsReactProps, EChartsOption, EChartsInstance } from './types';
2
+ import EChartsReactCore from './core';
3
+ export { EChartsReactProps, EChartsOption, EChartsInstance };
4
+ export default class EChartsReact extends EChartsReactCore {
5
+ constructor(props: EChartsReactProps);
10
6
  }
11
-
12
- interface ObjectMap {
13
- [key: string]: any,
14
- }
15
-
16
- interface optsMap {
17
- devicePixelRatio?: number,
18
- renderer?: 'canvas' | 'svg',
19
- width?: number | null | undefined | 'auto',
20
- height?: number | null | undefined | 'auto',
21
- }
22
-
23
- // Index
24
- export interface ReactEchartsPropsTypes {
25
- /**
26
- * the echarts option config
27
- * @see http://echarts.baidu.com/option.html#title
28
- */
29
- option: EChartOption;
30
- /**
31
- * when `setOption`, not merge the data.
32
- * @default false
33
- * @see http://echarts.baidu.com/api.html#echartsInstance.setOption
34
- */
35
- notMerge?: boolean;
36
- /**
37
- * when `setOption`, lazy update the data.
38
- * @default false
39
- * @see http://echarts.baidu.com/api.html#echartsInstance.setOption
40
- */
41
- lazyUpdate?: boolean;
42
- /**
43
- * the `style` of echarts div.
44
- * @default {height: '300px'}
45
- */
46
- style?: React.CSSProperties;
47
- /**
48
- * the `class` of echarts div. you can setting the css style of charts by class name.
49
- */
50
- className?: string;
51
- /**
52
- * the `theme` of echarts. should `registerTheme` before use it.
53
- * @see https://github.com/ecomfe/echarts/blob/master/theme/dark.js)
54
- * @example
55
- * ```
56
- // register theme object
57
- echarts.registerTheme('my_theme', { backgroundColor: '#f4cccc' });
58
- // render the echarts use option `theme`
59
- <ReactEcharts option={this.getOption()} theme='my_theme' />
60
- * ```
61
- */
62
- theme?: string | null | ObjectMap;
63
- /**
64
- * when the chart is ready, will callback the function with the `echarts object` as it's paramter.
65
- */
66
- onChartReady?: Func;
67
- /**
68
- * when the chart is rendering, show the loading mask.
69
- */
70
- showLoading?: boolean;
71
- /**
72
- * the echarts loading option config.
73
- * @see http://echarts.baidu.com/api.html#echartsInstance.showLoading
74
- */
75
- loadingOption?: EChartsLoadingOption;
76
- /**
77
- * binding the echarts event, will callback with the `echarts event object`, and the `echart object` as it's paramters.
78
- * @example
79
- * ```
80
- let onEvents = {
81
- 'click': this.onChartClick,
82
- 'legendselectchanged': this.onChartLegendselectchanged
83
- }
84
- <ReactEcharts onEvents={onEvents} />
85
- * ```
86
- * @see: http://echarts.baidu.com/api.html#events
87
- */
88
- onEvents?: EventMap;
89
- /**
90
- * the `opts` of echarts. will be used when initial echarts instance by `echarts.init`.
91
- * @see http://echarts.baidu.com/api.html#echarts.init
92
- */
93
- opts?: optsMap;
94
- shouldSetOption?: Func;
95
- }
96
-
97
- declare class ReactEcharts extends React.Component<ReactEchartsPropsTypes, any>{
98
- getEchartsInstance(): ECharts;
99
- }
100
-
101
- export default ReactEcharts;
package/lib/index.js CHANGED
@@ -1,40 +1,18 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports['default'] = undefined;
7
-
8
- var _echarts = require('echarts');
9
-
10
- var _echarts2 = _interopRequireDefault(_echarts);
11
-
12
- var _core = require('./core');
13
-
14
- var _core2 = _interopRequireDefault(_core);
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
17
-
18
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
19
-
20
- function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
21
-
22
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
23
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var tslib_1 = require("tslib");
4
+ var echarts = tslib_1.__importStar(require("echarts"));
5
+ var core_1 = tslib_1.__importDefault(require("./core"));
24
6
  // export the Component the echarts Object.
25
- var EchartsReact = function (_EchartsReactCore) {
26
- _inherits(EchartsReact, _EchartsReactCore);
27
-
28
- function EchartsReact(props) {
29
- _classCallCheck(this, EchartsReact);
30
-
31
- var _this = _possibleConstructorReturn(this, (EchartsReact.__proto__ || Object.getPrototypeOf(EchartsReact)).call(this, props));
32
-
33
- _this.echartsLib = _echarts2['default'];
34
- return _this;
35
- }
36
-
37
- return EchartsReact;
38
- }(_core2['default']);
39
-
40
- exports['default'] = EchartsReact;
7
+ var EChartsReact = /** @class */ (function (_super) {
8
+ tslib_1.__extends(EChartsReact, _super);
9
+ function EChartsReact(props) {
10
+ var _this = _super.call(this, props) || this;
11
+ // 初始化为 echarts 整个包
12
+ _this.echarts = echarts;
13
+ return _this;
14
+ }
15
+ return EChartsReact;
16
+ }(core_1.default));
17
+ exports.default = EChartsReact;
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,uDAAmC;AAEnC,wDAAsC;AAItC,2CAA2C;AAC3C;IAA0C,wCAAgB;IACxD,sBAAY,KAAwB;QAApC,YACE,kBAAM,KAAK,CAAC,SAIb;QAFC,mBAAmB;QACnB,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;;IACzB,CAAC;IACH,mBAAC;AAAD,CAAC,AAPD,CAA0C,cAAgB,GAOzD","sourcesContent":["import * as echarts from 'echarts';\nimport { EChartsReactProps, EChartsOption, EChartsInstance } from './types';\nimport EChartsReactCore from './core';\n\nexport { EChartsReactProps, EChartsOption, EChartsInstance };\n\n// export the Component the echarts Object.\nexport default class EChartsReact extends EChartsReactCore {\n constructor(props: EChartsReactProps) {\n super(props);\n\n // 初始化为 echarts 整个包\n this.echarts = echarts;\n }\n}\n"]}
package/lib/types.d.ts ADDED
@@ -0,0 +1,66 @@
1
+ import { CSSProperties } from 'react';
2
+ export declare type EChartsOption = any;
3
+ export declare type EChartsInstance = any;
4
+ export declare type Opts = {
5
+ readonly devicePixelRatio?: number;
6
+ readonly renderer?: 'canvas' | 'svg';
7
+ readonly width?: number | null | undefined | 'auto';
8
+ readonly height?: number | null | undefined | 'auto';
9
+ readonly locale?: string;
10
+ };
11
+ export declare type EChartsReactProps = {
12
+ /**
13
+ * echarts library entry, use it for import necessary.
14
+ */
15
+ readonly echarts?: any;
16
+ /**
17
+ * `className` for container
18
+ */
19
+ readonly className?: string;
20
+ /**
21
+ * `style` for container
22
+ */
23
+ readonly style?: CSSProperties;
24
+ /**
25
+ * echarts option
26
+ */
27
+ readonly option: EChartsOption;
28
+ /**
29
+ * echarts theme config, can be:
30
+ * 1. theme name string
31
+ * 2. theme object
32
+ */
33
+ readonly theme?: string | Record<string, any>;
34
+ /**
35
+ * notMerge config for echarts, default is `false`
36
+ */
37
+ readonly notMerge?: boolean;
38
+ /**
39
+ * lazyUpdate config for echarts, default is `false`
40
+ */
41
+ readonly lazyUpdate?: boolean;
42
+ /**
43
+ * showLoading config for echarts, default is `false`
44
+ */
45
+ readonly showLoading?: boolean;
46
+ /**
47
+ * loadingOption config for echarts, default is `null`
48
+ */
49
+ readonly loadingOption?: any;
50
+ /**
51
+ * echarts opts config, default is `{}`
52
+ */
53
+ readonly opts?: Opts;
54
+ /**
55
+ * when after chart reander, do the callback widht echarts instance
56
+ */
57
+ readonly onChartReady?: (instance: EChartsInstance) => void;
58
+ /**
59
+ * bind events, default is `{}`
60
+ */
61
+ readonly onEvents?: Record<string, Function>;
62
+ /**
63
+ * should update echarts options
64
+ */
65
+ readonly shouldSetOption?: (prevProps: EChartsReactProps, props: EChartsReactProps) => boolean;
66
+ };
package/lib/types.js ADDED
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import { CSSProperties } from 'react';\n\nexport type EChartsOption = any;\n\nexport type EChartsInstance = any;\n\nexport type Opts = {\n readonly devicePixelRatio?: number;\n readonly renderer?: 'canvas' | 'svg';\n readonly width?: number | null | undefined | 'auto';\n readonly height?: number | null | undefined | 'auto';\n readonly locale?: string;\n};\n\nexport type EChartsReactProps = {\n /**\n * echarts library entry, use it for import necessary.\n */\n readonly echarts?: any;\n /**\n * `className` for container\n */\n readonly className?: string;\n /**\n * `style` for container\n */\n readonly style?: CSSProperties;\n /**\n * echarts option\n */\n readonly option: EChartsOption;\n /**\n * echarts theme config, can be:\n * 1. theme name string\n * 2. theme object\n */\n readonly theme?: string | Record<string, any>;\n /**\n * notMerge config for echarts, default is `false`\n */\n readonly notMerge?: boolean;\n /**\n * lazyUpdate config for echarts, default is `false`\n */\n readonly lazyUpdate?: boolean;\n /**\n * showLoading config for echarts, default is `false`\n */\n readonly showLoading?: boolean;\n /**\n * loadingOption config for echarts, default is `null`\n */\n readonly loadingOption?: any;\n /**\n * echarts opts config, default is `{}`\n */\n readonly opts?: Opts;\n /**\n * when after chart reander, do the callback widht echarts instance\n */\n readonly onChartReady?: (instance: EChartsInstance) => void;\n /**\n * bind events, default is `{}`\n */\n readonly onEvents?: Record<string, Function>;\n /**\n * should update echarts options\n */\n readonly shouldSetOption?: (prevProps: EChartsReactProps, props: EChartsReactProps) => boolean;\n};\n"]}
package/package.json CHANGED
@@ -1,23 +1,28 @@
1
1
  {
2
2
  "name": "echarts-for-react",
3
- "version": "2.0.16",
4
- "description": "baidu Echarts(v3.x & v4.x) components for react.",
3
+ "version": "3.0.1",
4
+ "description": " Apache Echarts components for React.",
5
5
  "main": "lib/index.js",
6
+ "module": "esm/index.js",
6
7
  "types": "lib/index.d.ts",
7
8
  "files": [
8
- "src",
9
- "lib"
9
+ "lib",
10
+ "esm",
11
+ "src"
10
12
  ],
11
13
  "scripts": {
12
- "start": "webpack-dev-server --watch",
13
- "lint": "eslint src && eslint __tests__ && eslint demo/src",
14
- "clean": "rimraf lib/core.js && rimraf lib/index.js",
15
- "test": "npm run lint && npm run cover",
16
- "demo": "webpack",
17
- "dev": "webpack --watch",
18
- "build": "npm run test && npm run clean && cross-env NODE_ENV=production babel src -d lib && npm run demo",
19
- "cover": "jest --coverage",
20
- "coveralls": "cat ./coverage/lcov.info | coveralls"
14
+ "docs:dev": "NODE_ENV=development dumi dev",
15
+ "docs:build": "NODE_ENV=production dumi build",
16
+ "docs:deploy": "rimraf dist && npm run docs:build && gh-pages -d dist",
17
+ "start": "npm run docs:dev",
18
+ "lint": "eslint src __tests__ && prettier src __tests__ --check",
19
+ "fix": "eslint src __tests__ --fix && prettier src __tests__ --write",
20
+ "clean": "rimraf lib esm dist",
21
+ "test": "jest",
22
+ "lib": "run-p lib:*",
23
+ "lib:cjs": "tsc -p tsconfig.json --target ES5 --module commonjs --outDir lib",
24
+ "lib:esm": "tsc -p tsconfig.json --target ES5 --module ESNext --outDir esm",
25
+ "build": "npm run clean && npm run test && npm run lib"
21
26
  },
22
27
  "repository": {
23
28
  "type": "git",
@@ -41,81 +46,71 @@
41
46
  },
42
47
  "homepage": "https://github.com/hustcc/echarts-for-react",
43
48
  "devDependencies": {
44
- "76": "^0.0.4",
45
- "babel-cli": "^6.26.0",
46
- "babel-core": "^6.26.0",
47
- "babel-eslint": "^8.0.3",
48
- "babel-jest": "^22.4.1",
49
- "babel-loader": "^7.1.2",
50
- "babel-plugin-transform-class-properties": "^6.24.1",
51
- "babel-plugin-transform-decorators-legacy": "^1.3.4",
52
- "babel-plugin-transform-es3-member-expression-literals": "^6.22.0",
53
- "babel-plugin-transform-es3-property-literals": "^6.22.0",
54
- "babel-plugin-transform-export-extensions": "^6.22.0",
55
- "babel-plugin-transform-object-rest-spread": "^6.26.0",
56
- "babel-polyfill": "^6.26.0",
57
- "babel-preset-env": "^1.6.1",
58
- "babel-preset-react": "^6.24.1",
59
- "coveralls": "^3.0.0",
60
- "cross-env": "^5.1.3",
61
- "css-loader": "^0.28.7",
62
- "echarts": "4.0.4",
63
- "echarts-gl": "^1.1.0",
64
- "enzyme": "^3.2.0",
65
- "enzyme-adapter-react-15": "^1.0.5",
66
- "eslint": "^4.13.1",
67
- "eslint-config-airbnb": "^16.1.0",
68
- "eslint-config-airbnb-base": "^12.1.0",
69
- "eslint-plugin-babel": "^4.1.2",
70
- "eslint-plugin-import": "^2.8.0",
71
- "eslint-plugin-jsx-a11y": "^6.0.3",
72
- "eslint-plugin-react": "^7.5.1",
73
- "file-loader": "^1.1.6",
74
- "jest": "^22.4.2",
75
- "jest-canvas-mock": "^2.0.0-alpha.0",
76
- "jest-electron": "^0.1.7",
77
- "jsx-loader": "^0.13.2",
49
+ "@commitlint/cli": "^12.0.0",
50
+ "@commitlint/config-angular": "^12.0.0",
51
+ "@types/jest": "^26.0.20",
52
+ "@types/node": "^14.14.31",
53
+ "@types/react": "^17.0.2",
54
+ "@typescript-eslint/eslint-plugin": "^4.15.2",
55
+ "@typescript-eslint/parser": "^4.15.2",
56
+ "cross-env": "^7.0.3",
57
+ "dumi": "^1.1.6",
58
+ "dumi-theme-default": "^1.0.6",
59
+ "echarts": "^5.0.2",
60
+ "echarts-gl": "^2.0.2",
61
+ "eslint": "^7.20.0",
62
+ "eslint-config-prettier": "^8.1.0",
63
+ "eslint-plugin-import": "^2.22.1",
64
+ "eslint-plugin-prettier": "^3.3.1",
65
+ "gh-pages": "^3.1.0",
66
+ "husky": "^5.1.1",
67
+ "jest": "^26.6.3",
68
+ "jest-canvas-mock": "^2.3.1",
69
+ "jest-electron": "^0.1.11",
70
+ "lint-md-cli": "^0.1.2",
71
+ "lint-staged": "^10.5.4",
78
72
  "lodash.clonedeep": "^4.5.0",
79
- "react": "^15.5.0",
80
- "react-adsense": "^0.0.3",
81
- "react-dom": "^15.5.0",
82
- "react-router": "^2.0.0",
83
- "react-test-renderer": "^15.6.2",
84
- "rimraf": "^2.6.2",
85
- "style-loader": "^0.19.1",
86
- "webpack": "^3.10.0",
87
- "webpack-dev-server": "^2.9.7"
73
+ "miz": "^1.0.1",
74
+ "npm-run-all": "^4.1.5",
75
+ "prettier": "^2.2.1",
76
+ "rimraf": "^3.0.2",
77
+ "ts-jest": "^26.5.2",
78
+ "ts-loader": "^8.0.17",
79
+ "typescript": "^4.2.2"
88
80
  },
89
81
  "dependencies": {
90
- "fast-deep-equal": "^2.0.1",
91
- "size-sensor": "^1.0.0"
82
+ "size-sensor": "^1.0.1",
83
+ "fast-deep-equal": "^3.1.3"
92
84
  },
93
85
  "peerDependencies": {
94
- "react": ">=0.13.2 || ^0.14 || ^15.0.0 || >=16.0.0",
95
- "prop-types": "^15.5.7",
96
- "echarts": "^3.0.0 || ^4.0.0"
86
+ "react": "^15.0.0 || >=16.0.0",
87
+ "echarts": "^3.0.0 || ^4.0.0 || ^5.0.0"
97
88
  },
98
89
  "jest": {
99
- "testRegex": "(/__tests__/.*\\.spec)\\.(js|jsx)$",
100
- "testURL": "https://atool.vip/",
101
- "moduleFileExtensions": [
102
- "js",
103
- "jsx",
104
- "json"
105
- ],
106
- "setupFiles": [
107
- "./__tests__/setup.js",
108
- "jest-canvas-mock"
109
- ],
110
- "transform": {
111
- "^.+\\.js[x]?$": "babel-jest"
112
- },
113
- "moduleNameMapper": {},
90
+ "runner": "jest-electron/runner",
91
+ "testEnvironment": "jest-electron/environment",
92
+ "preset": "ts-jest",
114
93
  "collectCoverage": true,
115
94
  "collectCoverageFrom": [
116
- "src/*.{js,jsx}",
95
+ "src/**/*.ts",
117
96
  "!**/node_modules/**",
118
97
  "!**/vendor/**"
98
+ ],
99
+ "testRegex": "/__tests__/.*-spec\\.tsx?$"
100
+ },
101
+ "husky": {
102
+ "hooks": {
103
+ "pre-commit": "lint-staged",
104
+ "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
105
+ }
106
+ },
107
+ "lint-staged": {
108
+ "*.ts": [
109
+ "eslint --fix",
110
+ "prettier --write"
111
+ ],
112
+ "*.md": [
113
+ "lint-md --fix"
119
114
  ]
120
115
  }
121
116
  }