Skip to content

Commit c7828a1

Browse files
authored
Merge pull request #348 from nginformatica/chore/optimize
chore/optimize
2 parents c0244b4 + b57778b commit c7828a1

File tree

77 files changed

+1896
-2723
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1896
-2723
lines changed

.babelrc.js

Lines changed: 46 additions & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,6 @@
1-
const toKebabCase = str =>
2-
str.replace(
3-
/([a-z])?([A-Z])/g,
4-
(m, g1, g2) => (g1 ? g1 + '-' : '') + g2.toLowerCase()
5-
)
6-
7-
const reactVisModules = {
8-
AbstractSeries: 'plot/series/abstract-series',
9-
ArcSeries: 'plot/series/arc-series',
10-
AreaSeries: 'plot/series/area-series',
11-
Borders: 'plot/borders',
12-
ChartLabel: 'plot/chart-label',
13-
CircularGridLines: 'plot/circular-grid-lines',
14-
ContourSeries: 'plot/series/contour-series',
15-
Crosshair: 'plot/crosshair',
16-
CustomSVGSeries: 'plot/series/custom-svg-series',
17-
DecorativeAxis: 'plot/axis/decorative-axis',
18-
GradientDefs: 'plot/gradient-defs',
19-
GridLines: 'plot/grid-lines',
20-
HeatmapSeries: 'plot/series/heatmap-series',
21-
HexbinSeries: 'plot/series/hexbin-series',
22-
Highlight: 'plot/highlight',
23-
Hint: 'plot/hint',
24-
HorizontalBarSeries: 'plot/series/horizontal-bar-series',
25-
HorizontalBarSeriesCanvas: 'plot/series/horizontal-bar-series-canvas',
26-
HorizontalGridLines: 'plot/horizontal-grid-lines',
27-
HorizontalRectSeries: 'plot/series/horizontal-rect-series',
28-
HorizontalRectSeriesCanvas: 'plot/series/horizontal-rect-series-canvas',
29-
LabelSeries: 'plot/series/label-series',
30-
LineMarkSeries: 'plot/series/line-mark-series',
31-
LineMarkSeriesCanvas: 'plot/series/line-mark-series-canvas',
32-
LineSeries: 'plot/series/line-series',
33-
LineSeriesCanvas: 'plot/series/line-series-canvas',
34-
MarkSeries: 'plot/series/mark-series',
35-
MarkSeriesCanvas: 'plot/series/mark-series-canvas',
36-
PolygonSeries: 'plot/series/polygon-series',
37-
VerticalBarSeries: 'plot/series/vertical-bar-series',
38-
VerticalBarSeriesCanvas: 'plot/series/vertical-bar-series-canvas',
39-
VerticalGridLines: 'plot/vertical-grid-lines',
40-
VerticalRectSeries: 'plot/series/vertical-rect-series',
41-
VerticalRectSeriesCanvas: 'plot/series/vertical-rect-series-canvas',
42-
Voronoi: 'plot/voronoi',
43-
RectSeries: 'plot/series/rect-series',
44-
RectSeriesCanvas: 'plot/series/rect-series-canvas',
45-
WhiskerSeries: 'plot/series/whisker-series',
46-
XYPlot: 'plot/xy-plot',
47-
XAxis: 'plot/axis/x-axis',
48-
YAxis: 'plot/axis/y-axis',
49-
ContinuousColorLegend: 'legends/continuous-color-legend',
50-
ContinuousSizeLegend: 'legends/continuous-size-legend',
51-
DiscreteColorLegend: 'legends/discrete-color-legend',
52-
SearchableDiscreteColorLegend: 'legends/searchable-discrete-color-legend',
53-
ParallelCoordinates: 'parallel-coordinates',
54-
RadarChart: 'radar-chart',
55-
RadialChart: 'radial-chart',
56-
Sankey: 'sankey',
57-
Sunburst: 'sunburst',
58-
Treemap: 'treemap',
59-
makeHeightFlexible: 'make-vis-flexible',
60-
makeVisFlexible: 'make-vis-flexible',
61-
makeWidthFlexible: 'make-vis-flexible',
62-
FlexibleXYPlot: 'make-vis-flexible',
63-
FlexibleWidthXYPlot: 'make-vis-flexible',
64-
FlexibleHeightXYPlot: 'make-vis-flexible',
65-
AxisUtils: 'utils/axis-utils',
66-
ScaleUtils: 'utils/scales-utils'
67-
}
68-
691
module.exports = {
702
plugins: [
71-
[
72-
'transform-imports',
73-
{
74-
'@': {
75-
transform: './src',
76-
preventFullImport: true
77-
},
78-
'@mui/icons-material': {
79-
transform: '@mui/icons-material/${member}',
80-
preventFullImport: true
81-
},
82-
'@material-ui/core': {
83-
transform: '@material-ui/core/${member}',
84-
preventFullImport: true
85-
},
86-
'@material-ui/styles': {
87-
transform: '@material-ui/styles/${member}',
88-
preventFullImport: true
89-
},
90-
'../icons': {
91-
transform: '@mui/icons-material/${member}',
92-
preventFullImport: true
93-
},
94-
'../charts': {
95-
transform: 'flipper-ui/charts/${member}',
96-
preventFullImport: true
97-
},
98-
'react-vis': {
99-
transform: importName =>
100-
`react-vis/es/${reactVisModules[importName]}`,
101-
preventFullImport: true
102-
},
103-
'date-fns/locale': {
104-
transform: importName =>
105-
`date-fns/locale/${toKebabCase(importName)}`,
106-
preventFullImport: true
107-
},
108-
'date-fns': {
109-
transform: 'date-fns/${member}',
110-
preventFullImport: true
111-
},
112-
ramda: {
113-
transform: 'ramda/es/${member}',
114-
preventFullImport: true
115-
}
116-
}
117-
],
3+
'@babel/plugin-transform-runtime',
1184
[
1195
'module-resolver',
1206
{
@@ -123,8 +9,51 @@ module.exports = {
1239
}
12410
}
12511
],
126-
'@babel/plugin-transform-runtime',
127-
'transform-class-properties'
12+
[
13+
'import',
14+
{
15+
libraryName: 'ramda',
16+
libraryDirectory: 'es',
17+
camel2DashComponentName: false
18+
},
19+
'ramda'
20+
],
21+
[
22+
'import',
23+
{
24+
libraryName: 'date-fns',
25+
libraryDirectory: '',
26+
camel2DashComponentName: false
27+
},
28+
'date-fns'
29+
],
30+
[
31+
'import',
32+
{
33+
libraryName: '@material-ui/core',
34+
libraryDirectory: '',
35+
camel2DashComponentName: false
36+
},
37+
'material'
38+
],
39+
[
40+
'import',
41+
{
42+
libraryName: '@mui/material',
43+
libraryDirectory: '',
44+
camel2DashComponentName: false
45+
},
46+
'mui'
47+
],
48+
[
49+
'import',
50+
{
51+
libraryName: '@mui/icons-material',
52+
libraryDirectory: '',
53+
camel2DashComponentName: false
54+
},
55+
'icons'
56+
]
12857
],
12958
presets: [
13059
'@babel/preset-env',

.eslintrc.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,6 @@ const rulesImport = {
112112
group: 'index',
113113
position: 'after'
114114
},
115-
{
116-
pattern: '@/icons',
117-
group: 'index',
118-
position: 'after'
119-
},
120115
{
121116
pattern: '@/theme',
122117
group: 'index',
@@ -203,5 +198,5 @@ module.exports = {
203198
'import',
204199
'@stylistic'
205200
],
206-
ignorePatterns: ['.eslintrc.js']
201+
ignorePatterns: ['.eslintrc.js', 'pre-publish.js', 'jest.config.js']
207202
}

.npmignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
src
22
docs
3-
.docz
4-
doczrc.js
53
.gitignore

package.json

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "flipper-ui",
3-
"version": "0.31.6",
3+
"version": "0.31.7",
44
"description": "",
55
"main": "dist/index.js",
66
"homepage": "https://flipper-ui.ngi.com.br/",
@@ -28,8 +28,6 @@
2828
"type-check": "tsc --noEmit",
2929
"copy:package": "cp package.json dist/",
3030
"publish:yalc": "cd dist/ && yalc publish && cd ..",
31-
"predeploy": "yarn build && yarn storybook:build",
32-
"deploy": "gh-pages -d docs",
3331
"release": "yarn build && node pre-publish.js && npm publish ./dist --access public",
3432
"test:ci": "yarn test --coverage",
3533
"test": "jest --verbose --silent --passWithNoTests --noStackTrace --runInBand"
@@ -39,12 +37,10 @@
3937
"@emotion/react": "11.11.4",
4038
"@emotion/styled": "11.11.0",
4139
"@material-ui/core": "4.12.4",
42-
"@material-ui/icons": "4.11.3",
4340
"@material-ui/lab": "4.0.0-alpha.61",
4441
"@material-ui/pickers": "3.3.11",
45-
"@mui/icons-material": "5.15.13",
46-
"@mui/material": "5.15.13",
47-
"@mui/styles": "5.15.13",
42+
"@mui/icons-material": "5.15.17",
43+
"@mui/material": "5.15.17",
4844
"date-fns": "2.30.0",
4945
"faker": "5.5.3",
5046
"material-table": "1.69.3",
@@ -53,45 +49,43 @@
5349
"react-loading-skeleton": "3.4.0",
5450
"react-number-format": "4.4.1",
5551
"sprintf-js": "1.1.3",
56-
"stylis": "4.3.1",
52+
"stylis": "4.3.2",
5753
"uuid": "9.0.1"
5854
},
5955
"devDependencies": {
60-
"@babel/cli": "7.23.9",
61-
"@babel/core": "7.24.0",
62-
"@babel/plugin-transform-runtime": "7.24.0",
63-
"@babel/preset-env": "7.24.0",
64-
"@babel/preset-typescript": "7.23.3",
56+
"@babel/cli": "7.24.5",
57+
"@babel/core": "7.24.5",
58+
"@babel/plugin-transform-runtime": "7.24.3",
59+
"@babel/preset-env": "7.24.5",
60+
"@babel/preset-typescript": "7.24.1",
6561
"@storybook/addon-essentials": "7.6.17",
6662
"@storybook/addon-styling-webpack": "0.0.6",
6763
"@storybook/react": "7.6.17",
6864
"@storybook/react-webpack5": "7.6.17",
6965
"@stylistic/eslint-plugin": "1.5.4",
70-
"@testing-library/jest-dom": "6.4.2",
71-
"@testing-library/react": "14.2.1",
66+
"@testing-library/dom": "10.1.0",
67+
"@testing-library/jest-dom": "6.4.5",
68+
"@testing-library/react": "15.0.7",
7269
"@testing-library/user-event": "14.5.2",
7370
"@types/faker": "5.5.3",
74-
"@types/history": "5.0.0",
7571
"@types/jest": "29.5.12",
76-
"@types/node": "20.11.28",
72+
"@types/node": "20.12.11",
7773
"@types/ramda": "0.25.36",
7874
"@types/react": "18.2.66",
7975
"@types/sprintf-js": "1.1.4",
80-
"@types/styled-components": "5.1.34",
8176
"@types/uuid": "9.0.8",
8277
"@typescript-eslint/eslint-plugin": "7.2.0",
8378
"@typescript-eslint/parser": "7.2.0",
8479
"babel-loader": "9.1.3",
85-
"babel-plugin-module-resolver": "5.0.0",
86-
"babel-plugin-transform-class-properties": "6.24.1",
87-
"babel-plugin-transform-imports": "2.0.0",
80+
"babel-plugin-import": "1.13.8",
81+
"babel-plugin-module-resolver": "5.0.2",
8882
"eslint": "8.57.0",
8983
"eslint-config-prettier": "9.1.0",
9084
"eslint-import-resolver-typescript": "3.6.1",
9185
"eslint-plugin-import": "2.29.1",
9286
"eslint-plugin-prettier": "5.1.3",
93-
"eslint-plugin-react": "7.34.0",
94-
"eslint-plugin-react-hooks": "4.6.0",
87+
"eslint-plugin-react": "7.34.1",
88+
"eslint-plugin-react-hooks": "4.6.2",
9589
"fs-extra": "11.2.0",
9690
"identity-obj-proxy": "3.0.0",
9791
"jest": "29.7.0",
@@ -101,16 +95,16 @@
10195
"react": "18.2.0",
10296
"react-dom": "18.2.0",
10397
"storybook": "7.6.17",
104-
"styled-components": "6.1.8",
98+
"styled-components": "6.1.11",
10599
"ts-jest": "29.1.2",
106100
"ts-loader": "9.5.1",
107-
"typescript": "5.4.2",
108-
"webpack": "5.90.3"
101+
"typescript": "5.4.5",
102+
"webpack": "5.91.0"
109103
},
110104
"peerDependencies": {
111-
"date-fns": "^2.30.0",
112-
"react": "16.x || 17.x || 18.x",
113-
"styled-components": "5.x || 6.x"
105+
"react": ">=17.0.0",
106+
"react-dom": ">=17.0.0",
107+
"styled-components": ">=5.0.0"
114108
},
115109
"publishConfig": {
116110
"ignore": [

src/core/data-display/advertise/__snapshots__/advertise.spec.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
exports[`Advertise should match snapshot 1`] = `
44
<div>
55
<div
6-
class="MuiPaper-root sc-guDLey eZPlpZ MuiPaper-elevation1 MuiPaper-rounded"
6+
class="MuiPaper-root sc-gEvDqW gPmBbd MuiPaper-elevation1 MuiPaper-rounded"
77
role="mui-paper-container"
88
style="padding: 4px;"
99
>
1010
<p
11-
class="MuiTypography-root sc-beySPh fcGFSo MuiTypography-body2"
11+
class="MuiTypography-root sc-aYaIB ikghlf MuiTypography-body2"
1212
style="margin: 0px 12px; padding: 6px 18px;"
1313
>
1414
comment
1515
</p>
1616
<span
17-
class="MuiTypography-root sc-beySPh fcGFSo MuiTypography-caption"
17+
class="MuiTypography-root sc-aYaIB ikghlf MuiTypography-caption"
1818
style="margin: 0px 12px; padding: 6px 18px;"
1919
>
2020
author

src/core/data-display/chapter/__snapshots__/chapter.spec.tsx.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
exports[`Chapter should match snapshot 1`] = `
44
<div>
55
<div
6-
class="sc-guDLey wpcEU"
6+
class="sc-gEvDqW geoBRc"
77
>
88
<div
9-
class="sc-beySPh bYMaWh"
9+
class="sc-aYaIB jcOBwW"
1010
/>
1111
<p
1212
class="MuiTypography-root MuiTypography-body2"
1313
>
1414
Chapter
1515
</p>
1616
<div
17-
class="sc-beySPh bYMaWh"
17+
class="sc-aYaIB jcOBwW"
1818
/>
1919
</div>
2020
</div>

src/core/data-display/chip/chip.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react'
2+
import { Face } from '@mui/icons-material'
23
import type { Meta, StoryFn } from '@storybook/react'
34
import { Avatar } from '@/core/data-display/avatar'
45
import Chip from '.'
5-
import { Face } from '@/icons'
66

77
export default {
88
title: 'DataDisplay/Chip',

src/core/data-display/data-table/data-table-pagination-actions.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react'
22
import type { MouseEvent } from 'react'
3-
import IconButton from '@/core/inputs/icon-button'
4-
import { PaginationWrapper } from './styles'
53
import {
64
FirstPage,
75
LastPage,
86
KeyboardArrowLeft,
97
KeyboardArrowRight
10-
} from '@/icons'
8+
} from '@mui/icons-material'
9+
import IconButton from '@/core/inputs/icon-button'
10+
import { PaginationWrapper } from './styles'
1111

1212
interface DataTablePaginationActionsProps {
1313
count: number

0 commit comments

Comments
 (0)