Skip to content

Commit 977cc25

Browse files
feat(Charts): Added lib export per chart (#66)
1 parent f8424cf commit 977cc25

File tree

24 files changed

+122
-92
lines changed

24 files changed

+122
-92
lines changed

config/paths.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ const root = path.resolve(__dirname, '..');
44
const PATHS = {
55
root,
66
src: path.join(root, 'src'),
7+
build: path.join(root, 'build'),
78
test: path.join(root, 'test'),
89
shared: path.join(root, 'shared'),
910
coverage: path.join(root, 'coverage'),

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"coveralls": "^3.0.3",
5555
"cross-env": "^5.2.0",
5656
"dedent": "^0.7.0",
57+
"deepmerge": "^4.0.0",
5758
"dotenv": "^8.0.0",
5859
"enzyme": "^3.9.0",
5960
"enzyme-adapter-react-16": "^1.12.1",

packages/base/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
"directory": "packages/base"
1212
},
1313
"author": "SAP SE (https://www.sap.com)",
14+
"scripts": {
15+
"postbuild": "tsc ./src/polyfill/*.ts --outDir ../../build/node_modules/base/polyfill --skipLibCheck"
16+
},
1417
"license": "Apache-2.0",
1518
"dependencies": {
1619
"core-js": "^3.1.4",
17-
"deepmerge": "^3.2.0",
1820
"hoist-non-react-statics": "^3.3.0",
1921
"react-jss": "10.0.0-alpha.21",
2022
"tslib": "^1.9.3"

packages/charts/package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@
1313
"author": "SAP SE (https://www.sap.com)",
1414
"license": "Apache-2.0",
1515
"private": false,
16+
"scripts": {
17+
"postbuild": "rollup -c"
18+
},
1619
"devDependencies": {
1720
"@types/chart.js": "^2.7.53"
1821
},
1922
"dependencies": {
2023
"@ui5/webcomponents-react-base": "0.4.2-rc.2",
2124
"chart.js": "^2.8.0",
2225
"chartjs-plugin-datalabels": "^0.6.0",
26+
"deepmerge": "^4.0.0",
2327
"get-best-contrast-color": "^0.3.1",
24-
"is-mergeable-object": "^1.1.0",
2528
"react-chartjs-2": "^2.7.6",
2629
"react-content-loader": "^4.2.1"
2730
}

packages/charts/rollup.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const rollupConfigFactory = require('../../shared/rollup/configFactory');
2+
3+
const config = rollupConfigFactory('charts');
4+
module.exports = config;

packages/charts/src/components/MicroBarChart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { CSSProperties, FC, forwardRef, Ref } from 'react';
1+
import React, { CSSProperties, forwardRef, Ref } from 'react';
22
// @ts-ignore
33
import { createUseStyles, useTheme } from 'react-jss';
44
import { CommonProps } from '../../interfaces/CommonProps';

packages/charts/src/components/RadarChart/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useConsolidatedRef } from '@ui5/webcomponents-react-base';
2-
import React, { FC, forwardRef, Ref, RefObject, useCallback, useEffect, useRef, useMemo } from 'react';
2+
import React, { forwardRef, Ref, RefObject, useCallback, useEffect, useRef, useMemo } from 'react';
33
import { Radar } from 'react-chartjs-2';
44
import { useTheme } from 'react-jss';
55
import { ChartBaseProps } from '../../interfaces/ChartBaseProps';

packages/charts/src/index.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Library Export
2-
import { ColumnChart } from './components/ColumnChart';
3-
import { DonutChart } from './components/DonutChart';
4-
import { BarChart } from './components/BarChart';
5-
import { LineChart } from './components/LineChart';
6-
import { PieChart } from './components/PieChart';
7-
import { RadarChart } from './components/RadarChart';
8-
import { RadialChart } from './components/RadialChart';
9-
import { MicroBarChart } from './components/MicroBarChart';
2+
import { BarChart } from './lib/BarChart';
3+
import { ColumnChart } from './lib/ColumnChart';
4+
import { DonutChart } from './lib/DonutChart';
5+
import { LineChart } from './lib/LineChart';
6+
import { MicroBarChart } from './lib/MicroBarChart';
7+
import { PieChart } from './lib/PieChart';
8+
import { RadarChart } from './lib/RadarChart';
9+
import { RadialChart } from './lib/RadialChart';
1010

1111
export { ColumnChart, DonutChart, BarChart, LineChart, PieChart, RadarChart, RadialChart, MicroBarChart };
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { BarChart } from '../components/BarChart';
2+
3+
export { BarChart };
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ColumnChart } from '../components/ColumnChart';
2+
3+
export { ColumnChart };

0 commit comments

Comments
 (0)