chart-services 1.14.1 → 1.15.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.
package/package.json CHANGED
@@ -1,49 +1,65 @@
1
1
  {
2
2
  "name": "chart-services",
3
- "version": "1.14.1",
3
+ "version": "1.15.1",
4
4
  "description": "",
5
5
  "types": "types/index.d.ts",
6
6
  "main": "dist/chart-services.js",
7
7
  "scripts": {
8
- "install-npm-link-dep": "npm install && npm link cboard-chart ee-library cboard-common",
9
- "pub-link": "npm link && npm run install-npm-link-dep",
10
- "npm-install": "npm install && npm run install-npm-link-dep",
11
- "dev-build": "webpack --env.development",
12
- "prd-build": "webpack --env.production",
13
- "run-publish": "webpack --env.production && npm publish"
8
+ "install-npx-link-dep": "npx link ../ee-library ../cboard-chart ../cboard-common",
9
+ "rollup-build:dev": "rollup -c rollup.config.js --environment mode:development",
10
+ "rollup-build:prod": "rollup -c rollup.config.js --environment mode:production",
11
+ "webpack-build:dev": "webpack --env development",
12
+ "webpack-build:prod": "webpack --env production",
13
+ "run-publish": "npm run rollup-build:prod && npm publish"
14
14
  },
15
15
  "keywords": [],
16
16
  "author": "peter",
17
17
  "license": "Apache-2.0",
18
18
  "dependencies": {
19
+ "@tweenjs/tween.js": "^23.1.2",
19
20
  "axios": "^0.26.1",
20
21
  "countup.js": "^2.0.4",
22
+ "d3-geo": "^3.1.1",
21
23
  "exceljs": "^4.2.1",
22
24
  "file-saver": "^2.0.0-rc.3",
23
25
  "lodash": "^4.16.6",
24
- "tippy.js": "^6.3.1",
25
- "numbro": "^1.11.1"
26
+ "numbro": "^1.11.1",
27
+ "three": "^0.162.0",
28
+ "tippy.js": "^6.3.1"
26
29
  },
27
30
  "devDependencies": {
28
- "ee-library": "1.9.2",
29
- "cboard-chart": "^1.9.0",
30
- "cboard-common": "^1.9.3",
31
31
  "@babel/core": "^7.17.10",
32
32
  "@babel/preset-env": "^7.17.10",
33
+ "@babel/register": "^7.24.6",
34
+ "@rollup-extras/plugin-clean": "^1.3.9",
35
+ "@rollup/plugin-alias": "^5.1.0",
36
+ "@rollup/plugin-terser": "^0.4.4",
37
+ "@rollup/plugin-typescript": "^11.1.6",
33
38
  "babel-loader": "^8.2.5",
34
- "clean-webpack-plugin": "^0.1.19",
39
+ "cboard-chart": "^1.9.0",
40
+ "cboard-common": "^1.9.3",
35
41
  "css-loader": "^5.2.7",
42
+ "ee-library": "1.9.2",
36
43
  "eslint": "^3.9.1",
37
44
  "eslint-loader": "^1.6.1",
38
45
  "jquery": "^3.3.1",
39
- "less": "^3.0.4",
40
- "less-loader": "^4.1.0",
46
+ "less": "^4.1.2",
47
+ "less-loader": "^10.2.0",
41
48
  "mini-css-extract-plugin": "^1.6.0",
49
+ "raw-loader": "^4.0.2",
50
+ "rollup": "^2.79.1",
51
+ "rollup-plugin-babel": "^4.4.0",
52
+ "rollup-plugin-commonjs": "^10.1.0",
53
+ "rollup-plugin-node-resolve": "^5.2.0",
54
+ "rollup-plugin-postcss": "^4.0.2",
55
+ "rollup-plugin-string": "^3.0.0",
42
56
  "source-map-loader": "^0.2.3",
43
57
  "style-loader": "^2.0.0",
44
- "uglifyjs-webpack-plugin": "^1.2.5",
45
- "webpack": "^4.46.0",
46
- "webpack-bundle-analyzer": "^2.13.1",
47
- "webpack-cli": "^3.3.12"
58
+ "terser-webpack-plugin": "^5.3.10",
59
+ "ts-loader": "^9.2.6",
60
+ "typescript": "^4.5.4",
61
+ "webpack": "^5.66.0",
62
+ "webpack-cli": "^4.9.1",
63
+ "webpack-dev-server": "^4.7.3"
48
64
  }
49
65
  }
@@ -0,0 +1,105 @@
1
+ import path from 'path';
2
+ import resolve from 'rollup-plugin-node-resolve';
3
+ import commonjs from 'rollup-plugin-commonjs';
4
+ import babel from 'rollup-plugin-babel';
5
+ import terser from '@rollup/plugin-terser';
6
+ import postcss from 'rollup-plugin-postcss';
7
+ import { string } from "rollup-plugin-string";
8
+ import alias from '@rollup/plugin-alias';
9
+ import clean from '@rollup-extras/plugin-clean';
10
+
11
+ const externals = [
12
+ 'lodash',
13
+ 'ieee754',
14
+ 'isarray',
15
+ 'three',
16
+ /^three.*/,
17
+ /tween/,
18
+ 'd3-geo',
19
+ 'moment',
20
+ 'axios',
21
+ 'object-hash',
22
+ 'numbro',
23
+ 'ohm-js',
24
+ 'html2canvas',
25
+ /tippy/,
26
+ 'countup.js',
27
+ 'base64-js',
28
+ 'file-saver',
29
+ 'exceljs/dist/exceljs',
30
+ 'ee-library',
31
+ 'cboard-chart',
32
+ 'cboard-common',
33
+ 'cboard-earth',
34
+ ];
35
+
36
+ export default commandLineArgs => {
37
+ const isProduction = process.env.mode === 'production';
38
+ console.log('isProduction', isProduction)
39
+
40
+ return {
41
+ input: './src/index.js',
42
+ output: {
43
+ file: './dist/chart-services.js',
44
+ format: 'umd',
45
+ name: 'chart-services',
46
+ sourcemap: !isProduction, // Enable sourcemap only in development mode
47
+ globals: {
48
+ lodash: '_',
49
+ ieee754: 'ieee754',
50
+ isarray: 'isarray',
51
+ three: 'THREE',
52
+ 'd3-geo': 'd3Geo',
53
+ moment: 'moment',
54
+ axios: 'axios',
55
+ '@tweenjs/tween.js': 'TWEEN',
56
+ 'object-hash': 'objectHash',
57
+ numbro: 'numbro',
58
+ 'ohm-js': 'ohm',
59
+ html2canvas: 'html2canvas',
60
+ 'countup.js': 'CountUp',
61
+ 'base64-js': 'base64js',
62
+ 'file-saver': 'FileSaver',
63
+ 'exceljs/dist/exceljs': 'exceljs',
64
+ 'ee-library': 'eeLibrary',
65
+ 'cboard-chart': 'cboard-chart',
66
+ 'cboard-common': 'cboard-common',
67
+ 'three/examples/jsm/controls/OrbitControls.js': 'OrbitControls_js'
68
+ },
69
+ },
70
+ external: externals,
71
+ plugins: [
72
+ clean('dist'),
73
+ alias({
74
+ entries: [
75
+ { find: '@', replacement: path.resolve(__dirname, 'src') }
76
+ ]
77
+ }),
78
+ resolve({
79
+ extensions: ['.js', '.vue', '.json'],
80
+ }),
81
+ commonjs(),
82
+ babel({
83
+ exclude: 'node_modules/**',
84
+ presets: ['@babel/preset-env'],
85
+ }),
86
+ postcss({
87
+ extract: true,
88
+ minimize: isProduction,
89
+ use: [
90
+ ['less', { javascriptEnabled: true }]
91
+ ]
92
+ }),
93
+ string({
94
+ include: ["**/*.txt", "**/*.glsl"]
95
+ }),
96
+ isProduction && terser(),
97
+ ],
98
+ onwarn(warning, warn) {
99
+ // Ignore eval warnings
100
+ if (warning.code === 'EVAL') return;
101
+ // Use default for everything else
102
+ warn(warning);
103
+ },
104
+ };
105
+ };
package/types/index.d.ts CHANGED
@@ -2,12 +2,8 @@
2
2
  declare module 'chart-services' {
3
3
  export const
4
4
  chartService,
5
- chartTableService, chartKpiService, echartsService,
6
- chartConf, baseValueTypes, advanceValueTypes, geoValTypes, mapStypes, tableCellStyles,
7
- CBCrossTable, PIVOT_CONST,
8
- BaseRender, linkPopup,
9
- drawSparkline,
10
- echartsBasicOption, CBoardEChartRender
5
+ echartsBasicOption, CBCrossTable, BaseRender, linkPopup,
6
+ drawSparkline, ThreeMapOption, EarthOption, PIVOT_CONST
11
7
  }
12
8
 
13
9
 
@@ -1,9 +1,8 @@
1
1
  const path = require('path');
2
- const CleanWebpackPlugin = require('clean-webpack-plugin');
3
2
  const MiniCssExtractPlugin = require("mini-css-extract-plugin")
4
- const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
5
- const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
3
+ // const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
6
4
  const webpack = require('webpack');
5
+ const TerserPlugin = require('terser-webpack-plugin');
7
6
 
8
7
  module.exports = (env) => {
9
8
  let mode, devtool;
@@ -30,13 +29,19 @@ module.exports = (env) => {
30
29
  root: '_'
31
30
  },
32
31
  },
32
+ 'ieee754',
33
+ 'isarray',
34
+ 'three',
35
+ /^three.*/,
36
+ /tween/,
37
+ 'd3-geo',
33
38
  'moment',
34
39
  'axios',
35
40
  'object-hash',
36
41
  'numbro',
37
42
  'ohm-js',
38
43
  'html2canvas',
39
- 'tippy.js',
44
+ /tippy/,
40
45
  'countup.js',
41
46
  'base64-js',
42
47
  'file-saver',
@@ -44,11 +49,12 @@ module.exports = (env) => {
44
49
  'ee-library',
45
50
  'cboard-chart',
46
51
  'cboard-common',
52
+ 'cboard-earth',
47
53
  ];
48
54
 
49
55
  if (env.production) {
50
56
  mode = 'production';
51
- devtool = 'none';
57
+ // devtool = 'none';
52
58
  } else {
53
59
  mode = 'development';
54
60
  devtool = 'cheap-module-source-map';
@@ -74,7 +80,31 @@ module.exports = (env) => {
74
80
  libraryTarget: 'umd',
75
81
  globalObject: 'this',
76
82
  // libraryExport: 'default',
77
- library: 'chart-services'
83
+ library: 'chart-services',
84
+ clean: true,
85
+ },
86
+ optimization: {
87
+ // splitChunks: {
88
+ // chunks: "all",
89
+ // cacheGroups: {
90
+ // threeMap: {
91
+ // name: 'three-map',
92
+ // test: /[\\/]three[\\/]/,
93
+ // // reuseExistingChunk: true,
94
+ // },
95
+ // }
96
+ // },
97
+ minimize: env.production,
98
+ minimizer: [
99
+ new TerserPlugin({
100
+ terserOptions: {
101
+ format: {
102
+ comments: false,
103
+ },
104
+ },
105
+ extractComments: false,
106
+ }),
107
+ ],
78
108
  },
79
109
  mode,
80
110
  devtool,
@@ -86,11 +116,19 @@ module.exports = (env) => {
86
116
  exclude: /(node_modules|bower_components)/,
87
117
  use: 'babel-loader'
88
118
  },
119
+ {
120
+ test: /\.(ts|tsx)$/i,
121
+ loader: 'ts-loader',
122
+ },
89
123
  {
90
124
  test: /\.(css|less)$/,
91
125
  // exclude: /(node_modules)/,
92
126
  use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader'],
93
127
  },
128
+ {
129
+ test: /\.(txt|glsl)$/i,
130
+ use: 'raw-loader',
131
+ },
94
132
  ]
95
133
  },
96
134
  plugins: [
@@ -98,9 +136,8 @@ module.exports = (env) => {
98
136
  filename: "[name].css",
99
137
  }),
100
138
  // new BundleAnalyzerPlugin({analyzerPort: 8883, openAnalyzer: false}),
101
- new CleanWebpackPlugin('dist'),
102
139
  // new UglifyJsPlugin({ sourceMap: true }),
103
140
  ]
104
141
  }
105
142
  ];
106
- };
143
+ };
package/.babelrc DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "presets": [
3
- "@babel/preset-env"
4
- ],
5
- "plugins": [
6
- ]
7
- }