@mui/x-codemod 9.0.0-alpha.1 → 9.0.0-alpha.3
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/CHANGELOG.md +240 -0
- package/README.md +68 -5
- package/codemod.js +1 -1
- package/package.json +2 -2
- package/util/removeProps.js +2 -1
- package/v9.0.0/charts/preset-safe/index.js +6 -1
- package/v9.0.0/charts/remove-enable-keyboard-navigation/index.js +49 -0
- package/v9.0.0/charts/rename-chart-api-import/index.js +7 -0
- package/v9.0.0/charts/rename-chart-container/index.js +78 -0
- package/v9.0.0/charts/rename-chart-data-provider/index.js +78 -0
- package/v9.0.0/charts/rename-chart-zoom-slider/index.js +49 -0
- package/v9.0.0/charts/rename-sankey-chart/index.js +40 -0
- package/v9.0.0/charts/replace-show-mark-default/index.js +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,245 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.0-alpha.3
|
|
4
|
+
|
|
5
|
+
_Mar 12, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 13 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- 🐞 Bugfixes and internal improvements
|
|
10
|
+
|
|
11
|
+
The following team members contributed to this release:
|
|
12
|
+
@aemartos, @alexfauquette, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @MBilalShafi, @michelengelen, @rita-codes, @sai6855, @siriwatknp
|
|
13
|
+
|
|
14
|
+
### Data Grid
|
|
15
|
+
|
|
16
|
+
#### `@mui/x-data-grid@9.0.0-alpha.3`
|
|
17
|
+
|
|
18
|
+
- [DataGrid] Fix crash when `rows` and `rowModesModel` are updated simultaneously (#21265) @michelengelen
|
|
19
|
+
- [DataGrid] Add missing `resizablePanelHandle` classes to `gridClasses` object (#21538) @sai6855
|
|
20
|
+
- [DataGrid] Refactor `headerAlign` style calls (#21541) @sai6855
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
23
|
+
|
|
24
|
+
Same changes as in `@mui/x-data-grid@9.0.0-alpha.3`, plus:
|
|
25
|
+
|
|
26
|
+
- [DataGridPro] Add `role="presentation"` to detail panel toggle header content (#21634) @michelengelen
|
|
27
|
+
- [DataGridPro] Fix sorting not reflected in nested server-side data (#21619) @MBilalShafi
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-premium@9.0.0-alpha.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid-pro@9.0.0-alpha.3`.
|
|
32
|
+
|
|
33
|
+
### Date and Time Pickers
|
|
34
|
+
|
|
35
|
+
#### `@mui/x-date-pickers@9.0.0-alpha.3`
|
|
36
|
+
|
|
37
|
+
- [pickers] Refactor `DateRangePickerDay` overrides to use a centralized `elementOverrides` object (#21426) @sai6855
|
|
38
|
+
- [pickers] Migrate from deprecated props for `PickersModalDialog` (#21702) @siriwatknp
|
|
39
|
+
|
|
40
|
+
#### `@mui/x-date-pickers-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
41
|
+
|
|
42
|
+
Same changes as in `@mui/x-date-pickers@9.0.0-alpha.3`.
|
|
43
|
+
|
|
44
|
+
### Charts
|
|
45
|
+
|
|
46
|
+
#### `@mui/x-charts@9.0.0-alpha.3`
|
|
47
|
+
|
|
48
|
+
- [charts] Differentiate Line Plot roots classes (#21679) @JCQuintas
|
|
49
|
+
- [charts] Enable keyboard navigation by default (#21675) @alexfauquette
|
|
50
|
+
- [charts] Fix keyboard tooltip radar (#21667) @alexfauquette
|
|
51
|
+
- [charts] Fix selector default parameter (#21638) @JCQuintas
|
|
52
|
+
- [charts] Fix tooltip blink between node and pointer anchor (#21611) @alexfauquette
|
|
53
|
+
- [charts] Let tooltip and legend reflect the line shape (#21475) @alexfauquette
|
|
54
|
+
- [charts] Refactor `BarChart` classes structure (#21601) @JCQuintas
|
|
55
|
+
- [charts] Refactor `LineChart` classes structure (#21648) @JCQuintas
|
|
56
|
+
- [charts] Refactor `ScatterChart` classes structure (#21651) @JCQuintas
|
|
57
|
+
- [charts] Refactor `PieChart` classes structure (#21649) @JCQuintas
|
|
58
|
+
- [charts] Remove batch rendering checks in highlight selectors (#21646) @bernardobelchior
|
|
59
|
+
- [charts] Standardize generic arg names to `SeriesType` (#21694) @alexfauquette
|
|
60
|
+
- [charts] Simplify highlight hooks return types (#21695) @alexfauquette
|
|
61
|
+
|
|
62
|
+
#### `@mui/x-charts-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
63
|
+
|
|
64
|
+
Same changes as in `@mui/x-charts@9.0.0-alpha.3`, plus:
|
|
65
|
+
|
|
66
|
+
- [charts-pro] Fix heatmap style override from `arc` to `cell` (#21693) @Copilot
|
|
67
|
+
- [charts-pro] Fix image export truncated when page is zoomed out (#21685) @bernardobelchior
|
|
68
|
+
- [charts-pro] Speed-up heatmap cell search with an index lookup (#21130) @alexfauquette
|
|
69
|
+
- [charts-pro] Fix heatmap highlight not working (#21710) @Copilot
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts-premium@9.0.0-alpha.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
72
|
+
|
|
73
|
+
Same changes as in `@mui/x-charts-pro@9.0.0-alpha.3`, plus:
|
|
74
|
+
|
|
75
|
+
- [charts-premium] Re-enable WebGL tests (#21708) @bernardobelchior
|
|
76
|
+
|
|
77
|
+
### Tree View
|
|
78
|
+
|
|
79
|
+
#### Breaking changes
|
|
80
|
+
|
|
81
|
+
- Remove `TreeViewBaseItem` type (use `TreeViewDefaultItemModelProperties` or a custom interface)
|
|
82
|
+
- Remove `useTreeViewApiRef` hook (use `useRichTreeViewApiRef`, `useSimpleTreeViewApiRef`, or `useRichTreeViewProApiRef`)
|
|
83
|
+
- Remove `status` from content slot props returned by `getContentProps()` (use `data-*` attributes; `status` on `useTreeItem` return value is unchanged)
|
|
84
|
+
- Remove deprecated CSS state classes from `treeItemClasses`: `expanded`, `selected`, `focused`, `disabled`, `editable`, `editing` (use `[data-expanded]`, `[data-selected]`, etc.)
|
|
85
|
+
- The `<RichTreeViewPro />` component has now virtualization enabled by default.
|
|
86
|
+
- The items used inside the `<RichTreeViewPro />` now have a default height of `32px`.
|
|
87
|
+
- The events of the `<RichTreeViewPro />` are now rendered as a flat list instead of a nested tree.
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-tree-view@9.0.0-alpha.3`
|
|
90
|
+
|
|
91
|
+
- [tree view] Remove deprecated APIs (#21591) @flaviendelangle
|
|
92
|
+
- [tree view] Fix collapsed children not selected with `selectionPropagation.descendants` in `SimpleTreeView` (#21253) @flaviendelangle
|
|
93
|
+
|
|
94
|
+
#### `@mui/x-tree-view-pro@9.0.0-alpha.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
95
|
+
|
|
96
|
+
Same changes as in `@mui/x-tree-view@9.0.0-alpha.3`, plus:
|
|
97
|
+
|
|
98
|
+
- [RichTreeViewPro] Make the virtualization opt-out and port the layout doc from the data grid (#21461) @flaviendelangle
|
|
99
|
+
|
|
100
|
+
### Codemod
|
|
101
|
+
|
|
102
|
+
#### `@mui/x-codemod@9.0.0-alpha.3`
|
|
103
|
+
|
|
104
|
+
Internal changes.
|
|
105
|
+
|
|
106
|
+
### Docs
|
|
107
|
+
|
|
108
|
+
- [docs] Fix `AssistantWithDataSource` demo crashing (#21555) @sai6855
|
|
109
|
+
- [docs] Remove `Preview` pill from Sankey (#21623) @bernardobelchior
|
|
110
|
+
- [docs] Migrate internal Material UI deprecated APIs (#21680) @siriwatknp
|
|
111
|
+
- [docs] Remove `New` flag on Tree View and Date and Time Pickers features released before v9 alpha (#21585) @flaviendelangle
|
|
112
|
+
|
|
113
|
+
### Core
|
|
114
|
+
|
|
115
|
+
- [code-infra] Remove checkout step (#21688) @Janpot
|
|
116
|
+
- [code-infra] Fix contributor generation in changelog (#21718) @brijeshb42
|
|
117
|
+
- [docs-infra] Do not point to non-existent v8 subdomain (#21640) @cherniavskii
|
|
118
|
+
|
|
119
|
+
### Miscellaneous
|
|
120
|
+
|
|
121
|
+
- [test] Add missing tests for forwarding props to filter operators in DataGrid (#21441) @siriwatknp
|
|
122
|
+
- [x-license] Export additional license types and constants (#21625) @aemartos
|
|
123
|
+
- [x-license] Refactor license verification to accept package info object and add v9 version gating (#21690) @aemartos
|
|
124
|
+
|
|
125
|
+
## 9.0.0-alpha.2
|
|
126
|
+
|
|
127
|
+
_Mar 5, 2026_
|
|
128
|
+
|
|
129
|
+
We'd like to extend a big thank you to the 12 contributors who made this release possible. Here are some highlights ✨:
|
|
130
|
+
|
|
131
|
+
- ✅ Stabilize Sankey chart
|
|
132
|
+
- 🐞 Bugfixes and internal improvements
|
|
133
|
+
|
|
134
|
+
The following team members contributed to this release:
|
|
135
|
+
@aemartos, @alelthomas, @alexfauquette, @arminmeh, @bernardobelchior, @brijeshb42, @Janpot, @JCQuintas, @mapache-salvaje, @michelengelen, @mj12albert, @sai6855, @siriwatknp
|
|
136
|
+
|
|
137
|
+
### Data Grid
|
|
138
|
+
|
|
139
|
+
#### `@mui/x-data-grid@9.0.0-alpha.2`
|
|
140
|
+
|
|
141
|
+
- [dataGrid] Fix keyboard nav with single-row checkbox selection (#21149) @mj12albert
|
|
142
|
+
- [DataGrid] Add `checkboxColDef` prop to customize the selection column (#21331) @michelengelen
|
|
143
|
+
- [DataGrid] Format pagination numbers by default (#21117) @siriwatknp
|
|
144
|
+
- [DataGrid] Prevent unnecessary row selection checkbox rerendering (#21570) @arminmeh
|
|
145
|
+
- [DataGrid] Make GridScrollArea overrides resolver dynamic (#21532) @sai6855
|
|
146
|
+
|
|
147
|
+
#### `@mui/x-data-grid-pro@9.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
148
|
+
|
|
149
|
+
Same changes as in `@mui/x-data-grid@9.0.0-alpha.2`, plus:
|
|
150
|
+
|
|
151
|
+
- [DataGridPro] Use `getRowId` prop to calculate the tree data row update (#21540) @arminmeh
|
|
152
|
+
|
|
153
|
+
#### `@mui/x-data-grid-premium@9.0.0-alpha.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
154
|
+
|
|
155
|
+
Same changes as in `@mui/x-data-grid-pro@9.0.0-alpha.2`.
|
|
156
|
+
|
|
157
|
+
### Date and Time Pickers
|
|
158
|
+
|
|
159
|
+
#### `@mui/x-date-pickers@9.0.0-alpha.2`
|
|
160
|
+
|
|
161
|
+
- [pickers] Add `keepOpenDuringFieldFocus` prop (#20782) @michelengelen
|
|
162
|
+
|
|
163
|
+
#### `@mui/x-date-pickers-pro@9.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
164
|
+
|
|
165
|
+
Same changes as in `@mui/x-date-pickers@9.0.0-alpha.2`.
|
|
166
|
+
|
|
167
|
+
### Charts
|
|
168
|
+
|
|
169
|
+
#### `@mui/x-charts@9.0.0-alpha.2`
|
|
170
|
+
|
|
171
|
+
- [charts] Add `ChartsLayerContainer` component (#21264) @bernardobelchior
|
|
172
|
+
- [charts] Add codemod for `ChartsContainer` rename (#21504) @JCQuintas
|
|
173
|
+
- [charts] Add codemod for `ChartsDataProvider` rename (#21552) @JCQuintas
|
|
174
|
+
- [charts] Add codemod for `ChartsZoomSlider` rename (#21597) @JCQuintas
|
|
175
|
+
- [charts] Base the highlight items on the item identifiers (#21161) @alexfauquette
|
|
176
|
+
- [charts] Deprecate `ChartDataProvider` in favour of `ChartsDataProvider` (#21191) @JCQuintas
|
|
177
|
+
- [charts] Deprecate `highlighted` and `faded` classes (#21476) @alexfauquette
|
|
178
|
+
- [charts] Migrate to latest v8 warning (#21518) @JCQuintas
|
|
179
|
+
- [charts] Rename `ChartZoomSlider` to `ChartsZoomSlider` (#21553) @JCQuintas
|
|
180
|
+
- [charts] Rename `WebGl` to `WebGL` (#21524) @JCQuintas
|
|
181
|
+
- [charts] Rename `useSvgRef()` by `useChartsLayerContainerRef()` (#21494) @alexfauquette
|
|
182
|
+
- [charts] Restore focus on last focused item (#21522) @alexfauquette
|
|
183
|
+
- [charts] Warn users when controlled tooltip state does not match the trigger (#21520) @Copilot
|
|
184
|
+
- [charts] Fix controlled tooltip position (#21603) @bernardobelchior
|
|
185
|
+
|
|
186
|
+
#### `@mui/x-charts-pro@9.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
187
|
+
|
|
188
|
+
Same changes as in `@mui/x-charts@9.0.0-alpha.2`, plus:
|
|
189
|
+
|
|
190
|
+
- [charts-pro] Center the watermark (#21550) @alexfauquette
|
|
191
|
+
- [charts-pro] Stabilize `SankeyChart` API (#21133) @Copilot
|
|
192
|
+
|
|
193
|
+
#### `@mui/x-charts-premium@9.0.0-alpha.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
194
|
+
|
|
195
|
+
Same changes as in `@mui/x-charts-pro@9.0.0-alpha.2`.
|
|
196
|
+
|
|
197
|
+
### Tree View
|
|
198
|
+
|
|
199
|
+
#### `@mui/x-tree-view@9.0.0-alpha.2`
|
|
200
|
+
|
|
201
|
+
Internal changes.
|
|
202
|
+
|
|
203
|
+
#### `@mui/x-tree-view-pro@9.0.0-alpha.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
204
|
+
|
|
205
|
+
Same changes as in `@mui/x-tree-view@9.0.0-alpha.2`.
|
|
206
|
+
|
|
207
|
+
### Codemod
|
|
208
|
+
|
|
209
|
+
#### `@mui/x-codemod@9.0.0-alpha.2`
|
|
210
|
+
|
|
211
|
+
Internal changes.
|
|
212
|
+
|
|
213
|
+
### Docs
|
|
214
|
+
|
|
215
|
+
- [docs] Add backticks and parentheses to all functions and hooks (DX-173) (#21496) @mapache-salvaje
|
|
216
|
+
- [docs] Remove mentions of `mySvgRef` (#21559) @bernardobelchior
|
|
217
|
+
- [docs] Update Roadmap section in the docs (#20892) @alelthomas
|
|
218
|
+
- [docs] Add tutorial and example app for aggregation with row grouping (DX-162) (#21102) @mapache-salvaje
|
|
219
|
+
- [docs] Fix missing codemod docs (#21604) @JCQuintas
|
|
220
|
+
|
|
221
|
+
### Core
|
|
222
|
+
|
|
223
|
+
- [code-infra] Add eslint rule to prevent `Math.random` in docs (#21505) @JCQuintas
|
|
224
|
+
- [code-infra] Avoid static props for pageContent (#21038) @Janpot
|
|
225
|
+
- [code-infra] Isolate `date-pickers-pro` in the browser tests (#21383) @Janpot
|
|
226
|
+
- [code-infra] Remove `--coverage` (#21410) @Janpot
|
|
227
|
+
- [code-infra] Remove unneeded `skipIf`s (#21569) @JCQuintas
|
|
228
|
+
- [code-infra] Remove vale as a workspace dependency (#21489) @brijeshb42
|
|
229
|
+
- [code-infra] Remove x-charts-vendor from nextjs processing (#21534) @brijeshb42
|
|
230
|
+
- [code-infra] Set BASE_BRANCH env var in CircleCI config (#21548) @brijeshb42
|
|
231
|
+
- [code-infra] Setup error code extraction (#21469) @brijeshb42
|
|
232
|
+
- [code-infra] Setup flat build for packages (#21029) @brijeshb42
|
|
233
|
+
- [code-infra] Upgrade test_unit to large resource class (#21558) @Janpot
|
|
234
|
+
- [code-infra] Removed getTeamMembers function and usage from release script (#21605) @michelengelen
|
|
235
|
+
|
|
236
|
+
### Miscellaneous
|
|
237
|
+
|
|
238
|
+
- [x-license] Add Q1-2026 plan version with quantity and appType support (#21574) @aemartos
|
|
239
|
+
- [x-license] Add v3 key format support, centralize test keys, and trim public API (#21485) @aemartos
|
|
240
|
+
- [x-telemetry] telemetry opt-out by default, remove conf dependency (#21470) @aemartos
|
|
241
|
+
- [x-telemetry] test: mock context module directly in sender tests (#21546) @aemartos
|
|
242
|
+
|
|
3
243
|
## 9.0.0-alpha.1
|
|
4
244
|
|
|
5
245
|
_Feb 26, 2026_
|
package/README.md
CHANGED
|
@@ -95,11 +95,16 @@ npx @mui/x-codemod@next v9.0.0/charts/preset-safe <path|folder>
|
|
|
95
95
|
The list includes these transformers
|
|
96
96
|
|
|
97
97
|
- [`replace-heatmap-hide-legend-false`](#replace-heatmap-hide-legend-false)
|
|
98
|
-
- [`rename-chart-api-import`](#rename-chart-api-import)
|
|
99
|
-
- [`rename-id-to-series-id`](#rename-id-to-series-id)
|
|
100
98
|
- [`replace-show-mark-default`](#replace-show-mark-default)
|
|
99
|
+
- [`rename-id-to-series-id`](#rename-id-to-series-id)
|
|
100
|
+
- [`rename-chart-api-import`](#rename-chart-api-import)
|
|
101
|
+
- [`rename-sankey-chart`](#rename-sankey-chart)
|
|
102
|
+
- [`rename-chart-container`](#rename-chart-container)
|
|
103
|
+
- [`rename-chart-data-provider`](#rename-chart-data-provider)
|
|
104
|
+
- [`rename-chart-zoom-slider`](#rename-chart-zoom-slider)
|
|
105
|
+
- [`remove-enable-keyboard-navigation`](#remove-enable-keyboard-navigation)
|
|
101
106
|
|
|
102
|
-
|
|
107
|
+
#### `replace-heatmap-hide-legend-false`
|
|
103
108
|
|
|
104
109
|
The default value of the `hideLegend` prop in the `Heatmap` component has changed from `true` to `false` in v9. This improves consistency across chart components and developer experience.
|
|
105
110
|
|
|
@@ -109,7 +114,7 @@ The default value of the `hideLegend` prop in the `Heatmap` component has change
|
|
|
109
114
|
/>
|
|
110
115
|
```
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
#### `rename-axis-tooltip-hook`
|
|
113
118
|
|
|
114
119
|
The `useAxisTooltip()` hook has been renamed to `useAxesTooltip()` to better reflect its functionality of handling multiple axes.
|
|
115
120
|
|
|
@@ -134,7 +139,7 @@ After running the codemod to do the renaming make sure to adapt the hook returne
|
|
|
134
139
|
}
|
|
135
140
|
```
|
|
136
141
|
|
|
137
|
-
|
|
142
|
+
#### `rename-chart-api-import`
|
|
138
143
|
|
|
139
144
|
Moves the `ChartApi` type import from `@mui/x-charts/ChartContainer` to `@mui/x-charts/context`.
|
|
140
145
|
|
|
@@ -177,6 +182,64 @@ Add `showMark: true` to line series when not defined to keep the same default be
|
|
|
177
182
|
+ <ChartDataProvider series={[{ type: 'line', data: [/* ... */] showMark: true }]} />
|
|
178
183
|
```
|
|
179
184
|
|
|
185
|
+
#### `rename-chart-zoom-slider`
|
|
186
|
+
|
|
187
|
+
Renames the `ChartZoomSlider` component and related exports to `ChartsZoomSlider` (with an S) to align with other components.
|
|
188
|
+
|
|
189
|
+
```diff
|
|
190
|
+
-import { ChartZoomSlider } from '@mui/x-charts-pro';
|
|
191
|
+
+import { ChartsZoomSlider } from '@mui/x-charts-pro';
|
|
192
|
+
|
|
193
|
+
-import { ChartZoomSlider } from '@mui/x-charts-pro/ChartZoomSlider';
|
|
194
|
+
+import { ChartsZoomSlider } from '@mui/x-charts-pro/ChartsZoomSlider';
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
#### `rename-sankey-chart`
|
|
198
|
+
|
|
199
|
+
Stabilizes the `Unstable_SankeyChart` export by renaming it to `SankeyChart`.
|
|
200
|
+
|
|
201
|
+
```diff
|
|
202
|
+
-import { Unstable_SankeyChart } from '@mui/x-charts-pro';
|
|
203
|
+
+import { SankeyChart } from '@mui/x-charts-pro';
|
|
204
|
+
|
|
205
|
+
-import { Unstable_SankeyChart } from '@mui/x-charts-pro/SankeyChart';
|
|
206
|
+
+import { SankeyChart } from '@mui/x-charts-pro/SankeyChart';
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
#### `rename-chart-container`
|
|
210
|
+
|
|
211
|
+
Renames the `ChartContainer` component and related exports to `ChartsContainer` (with an S) to align with other components.
|
|
212
|
+
|
|
213
|
+
```diff
|
|
214
|
+
-import { ChartContainer } from '@mui/x-charts/ChartContainer';
|
|
215
|
+
+import { ChartsContainer } from '@mui/x-charts/ChartsContainer';
|
|
216
|
+
|
|
217
|
+
-import { ChartContainerPro } from '@mui/x-charts-pro/ChartContainerPro';
|
|
218
|
+
+import { ChartsContainerPro } from '@mui/x-charts-pro/ChartsContainerPro';
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
#### `rename-chart-data-provider`
|
|
222
|
+
|
|
223
|
+
Renames the `ChartDataProvider` component and related exports to `ChartsDataProvider` (with an S) to align with other components.
|
|
224
|
+
|
|
225
|
+
```diff
|
|
226
|
+
-import { ChartDataProvider } from '@mui/x-charts/ChartDataProvider';
|
|
227
|
+
+import { ChartsDataProvider } from '@mui/x-charts/ChartsDataProvider';
|
|
228
|
+
|
|
229
|
+
-import { ChartDataProviderPro } from '@mui/x-charts-pro/ChartDataProviderPro';
|
|
230
|
+
+import { ChartsDataProviderPro } from '@mui/x-charts-pro/ChartsDataProviderPro';
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
#### `remove-enable-keyboard-navigation`
|
|
234
|
+
|
|
235
|
+
Removes the `enableKeyboardNavigation` props set to `true` since it's now the default behavior.
|
|
236
|
+
|
|
237
|
+
```diff
|
|
238
|
+
<LineChart
|
|
239
|
+
- enableKeyboardNavigation
|
|
240
|
+
/>
|
|
241
|
+
```
|
|
242
|
+
|
|
180
243
|
## v8.0.0
|
|
181
244
|
|
|
182
245
|
### 🚀 `preset-safe` for v8.0.0
|
package/codemod.js
CHANGED
|
@@ -20,7 +20,7 @@ async function runTransform(transform, files, flags, codemodFlags) {
|
|
|
20
20
|
transformerPath = transformerBuildPath;
|
|
21
21
|
} catch (buildPathError) {
|
|
22
22
|
if (buildPathError.code === 'ENOENT') {
|
|
23
|
-
throw new Error(`Transform '${transform}' not found. Check out ${_path.default.resolve(__dirname, './README.md for a list of available codemods.')}`);
|
|
23
|
+
throw /* FIXME (minify-errors-in-prod): Unminified error message in production build! */new Error(`Transform '${transform}' not found. Check out ${_path.default.resolve(__dirname, './README.md for a list of available codemods.')}`);
|
|
24
24
|
}
|
|
25
25
|
throw buildPathError;
|
|
26
26
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-codemod",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.3",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "Codemod scripts for MUI X.",
|
|
6
6
|
"keywords": [
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@babel/traverse": "^7.29.0",
|
|
29
29
|
"jscodeshift": "17.3.0",
|
|
30
30
|
"yargs": "^18.0.0",
|
|
31
|
-
"@mui/x-internals": "9.0.0-alpha.
|
|
31
|
+
"@mui/x-internals": "9.0.0-alpha.2"
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"publishConfig": {
|
package/util/removeProps.js
CHANGED
|
@@ -11,6 +11,7 @@ function removeProps({
|
|
|
11
11
|
root,
|
|
12
12
|
componentNames,
|
|
13
13
|
props,
|
|
14
|
+
shouldRemove,
|
|
14
15
|
j
|
|
15
16
|
}) {
|
|
16
17
|
return root.find(j.JSXElement).filter(path => {
|
|
@@ -18,7 +19,7 @@ function removeProps({
|
|
|
18
19
|
}).find(j.JSXAttribute).filter(attribute => props.includes(attribute.node.name.name)).forEach(attribute => {
|
|
19
20
|
// Only remove props from components in componentNames. Not nested ones.
|
|
20
21
|
const attributeParent = attribute.parentPath.parentPath;
|
|
21
|
-
if (attributeParent.value.type === 'JSXOpeningElement' && componentNames.includes(attributeParent.value.name.name)) {
|
|
22
|
+
if (attributeParent.value.type === 'JSXOpeningElement' && componentNames.includes(attributeParent.value.name.name) && (!shouldRemove || shouldRemove(attribute.node))) {
|
|
22
23
|
j(attribute).remove();
|
|
23
24
|
}
|
|
24
25
|
});
|
|
@@ -8,11 +8,16 @@ exports.default = transformer;
|
|
|
8
8
|
exports.testConfig = void 0;
|
|
9
9
|
var renameIdToSeriesId = _interopRequireWildcard(require("../rename-id-to-series-id"));
|
|
10
10
|
var renameChartApiImport = _interopRequireWildcard(require("../rename-chart-api-import"));
|
|
11
|
+
var renameChartContainer = _interopRequireWildcard(require("../rename-chart-container"));
|
|
12
|
+
var renameChartDataProvider = _interopRequireWildcard(require("../rename-chart-data-provider"));
|
|
13
|
+
var renameChartZoomSlider = _interopRequireWildcard(require("../rename-chart-zoom-slider"));
|
|
11
14
|
var replaceHeatmapHideLegend = _interopRequireWildcard(require("../replace-heatmap-hide-legend-false"));
|
|
15
|
+
var renameSankeyChart = _interopRequireWildcard(require("../rename-sankey-chart"));
|
|
12
16
|
var replaceShowMarkDefault = _interopRequireWildcard(require("../replace-show-mark-default"));
|
|
17
|
+
var removeEnableKeyboardNavigation = _interopRequireWildcard(require("../remove-enable-keyboard-navigation"));
|
|
13
18
|
const allModules = [
|
|
14
19
|
// Add other transforms here as they are created
|
|
15
|
-
replaceHeatmapHideLegend, replaceShowMarkDefault, renameIdToSeriesId, renameChartApiImport];
|
|
20
|
+
replaceHeatmapHideLegend, replaceShowMarkDefault, removeEnableKeyboardNavigation, renameIdToSeriesId, renameChartApiImport, renameSankeyChart, renameChartContainer, renameChartDataProvider, renameChartZoomSlider];
|
|
16
21
|
function transformer(file, api, options) {
|
|
17
22
|
allModules.forEach(module => {
|
|
18
23
|
file.source = module.default(file, api, options);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
exports.testConfig = void 0;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _removeProps = _interopRequireDefault(require("../../../util/removeProps"));
|
|
11
|
+
var _readFile = _interopRequireDefault(require("../../../util/readFile"));
|
|
12
|
+
const componentNames = ['BarChart', 'LineChart', 'PieChart', 'ScatterChart', 'SparkLineChart', 'RadarChart', 'ChartsContainer', 'BarChartPro', 'LineChartPro', 'PieChartPro', 'ScatterChartPro', 'RadarChartPro', 'FunnelChart', 'Heatmap', 'SankeyChart', 'BarChartPremium', 'HeatmapPremium', 'ChartDataProvider', 'ChartDataProviderPro'];
|
|
13
|
+
function transformer(file, api, options) {
|
|
14
|
+
const j = api.jscodeshift;
|
|
15
|
+
const root = j(file.source);
|
|
16
|
+
const printOptions = options.printOptions || {
|
|
17
|
+
quote: 'single',
|
|
18
|
+
trailingComma: true
|
|
19
|
+
};
|
|
20
|
+
(0, _removeProps.default)({
|
|
21
|
+
root,
|
|
22
|
+
componentNames,
|
|
23
|
+
props: ['enableKeyboardNavigation'],
|
|
24
|
+
shouldRemove: attribute => {
|
|
25
|
+
// Only remove the prop if it's not explicitly set to false or a variable that could be false.
|
|
26
|
+
if (attribute.value === null) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (attribute.value?.type === 'JSXExpressionContainer') {
|
|
30
|
+
if (attribute.value.expression.type === 'BooleanLiteral') {
|
|
31
|
+
return attribute.value.expression.value !== false;
|
|
32
|
+
}
|
|
33
|
+
// If it's an expression, we can't be sure of its value, so we keep it.
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
},
|
|
37
|
+
j
|
|
38
|
+
});
|
|
39
|
+
return root.toSource(printOptions);
|
|
40
|
+
}
|
|
41
|
+
const testConfig = () => ({
|
|
42
|
+
name: 'remove-enable-keyboard-navigation',
|
|
43
|
+
specFiles: [{
|
|
44
|
+
name: 'remove enableKeyboardNavigation prop',
|
|
45
|
+
actual: (0, _readFile.default)(_path.default.join(__dirname, 'actual.spec.tsx')),
|
|
46
|
+
expected: (0, _readFile.default)(_path.default.join(__dirname, 'expected.spec.tsx'))
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
49
|
+
exports.testConfig = testConfig;
|
|
@@ -27,6 +27,13 @@ function transformer(file, api, options) {
|
|
|
27
27
|
ChartApi: 'ChartApi'
|
|
28
28
|
},
|
|
29
29
|
splitUnmatchedSpecifiers: true
|
|
30
|
+
}, {
|
|
31
|
+
oldEndpoint: 'ChartsContainer',
|
|
32
|
+
newEndpoint: 'context',
|
|
33
|
+
importsMapping: {
|
|
34
|
+
ChartApi: 'ChartApi'
|
|
35
|
+
},
|
|
36
|
+
splitUnmatchedSpecifiers: true
|
|
30
37
|
}]
|
|
31
38
|
});
|
|
32
39
|
return root.toSource(printOptions);
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
exports.testConfig = void 0;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _readFile = _interopRequireDefault(require("../../../util/readFile"));
|
|
11
|
+
var _renameImports = require("../../../util/renameImports");
|
|
12
|
+
function transformer(file, api, options) {
|
|
13
|
+
const j = api.jscodeshift;
|
|
14
|
+
const root = j(file.source);
|
|
15
|
+
const printOptions = options.printOptions || {
|
|
16
|
+
quote: 'single',
|
|
17
|
+
trailingComma: true
|
|
18
|
+
};
|
|
19
|
+
(0, _renameImports.renameImports)({
|
|
20
|
+
j,
|
|
21
|
+
root,
|
|
22
|
+
packageNames: ['@mui/x-charts', '@mui/x-charts-pro', '@mui/x-charts-premium'],
|
|
23
|
+
imports: [
|
|
24
|
+
// ChartContainer → ChartsContainer
|
|
25
|
+
{
|
|
26
|
+
oldEndpoint: 'ChartContainer',
|
|
27
|
+
newEndpoint: 'ChartsContainer',
|
|
28
|
+
importsMapping: {
|
|
29
|
+
ChartContainer: 'ChartsContainer',
|
|
30
|
+
ChartContainerProps: 'ChartsContainerProps',
|
|
31
|
+
ChartContainerSlots: 'ChartsContainerSlots',
|
|
32
|
+
ChartContainerSlotProps: 'ChartsContainerSlotProps'
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
// ChartContainerPro → ChartsContainerPro
|
|
36
|
+
{
|
|
37
|
+
oldEndpoint: 'ChartContainerPro',
|
|
38
|
+
newEndpoint: 'ChartsContainerPro',
|
|
39
|
+
importsMapping: {
|
|
40
|
+
ChartContainerPro: 'ChartsContainerPro',
|
|
41
|
+
ChartContainerProProps: 'ChartsContainerProProps',
|
|
42
|
+
ChartContainerProSlots: 'ChartsContainerProSlots',
|
|
43
|
+
ChartContainerProSlotProps: 'ChartsContainerProSlotProps'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
// ChartContainerPremium → ChartsContainerPremium
|
|
47
|
+
{
|
|
48
|
+
oldEndpoint: 'ChartContainerPremium',
|
|
49
|
+
newEndpoint: 'ChartsContainerPremium',
|
|
50
|
+
importsMapping: {
|
|
51
|
+
ChartContainerPremium: 'ChartsContainerPremium',
|
|
52
|
+
ChartContainerPremiumProps: 'ChartsContainerPremiumProps',
|
|
53
|
+
ChartContainerPremiumSlots: 'ChartsContainerPremiumSlots',
|
|
54
|
+
ChartContainerPremiumSlotProps: 'ChartsContainerPremiumSlotProps'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
// Hooks from internals
|
|
58
|
+
{
|
|
59
|
+
oldEndpoint: 'internals',
|
|
60
|
+
importsMapping: {
|
|
61
|
+
useChartContainerProps: 'useChartsContainerProps',
|
|
62
|
+
UseChartContainerPropsReturnValue: 'UseChartsContainerPropsReturnValue',
|
|
63
|
+
useChartContainerProProps: 'useChartsContainerProProps',
|
|
64
|
+
UseChartContainerProPropsReturnValue: 'UseChartsContainerProPropsReturnValue'
|
|
65
|
+
}
|
|
66
|
+
}]
|
|
67
|
+
});
|
|
68
|
+
return root.toSource(printOptions);
|
|
69
|
+
}
|
|
70
|
+
const testConfig = () => ({
|
|
71
|
+
name: 'rename-chart-container',
|
|
72
|
+
specFiles: [{
|
|
73
|
+
name: 'imports',
|
|
74
|
+
actual: (0, _readFile.default)(_path.default.join(__dirname, 'actual-imports.spec.tsx')),
|
|
75
|
+
expected: (0, _readFile.default)(_path.default.join(__dirname, 'expected-imports.spec.tsx'))
|
|
76
|
+
}]
|
|
77
|
+
});
|
|
78
|
+
exports.testConfig = testConfig;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
exports.testConfig = void 0;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _readFile = _interopRequireDefault(require("../../../util/readFile"));
|
|
11
|
+
var _renameImports = require("../../../util/renameImports");
|
|
12
|
+
function transformer(file, api, options) {
|
|
13
|
+
const j = api.jscodeshift;
|
|
14
|
+
const root = j(file.source);
|
|
15
|
+
const printOptions = options.printOptions || {
|
|
16
|
+
quote: 'single',
|
|
17
|
+
trailingComma: true
|
|
18
|
+
};
|
|
19
|
+
(0, _renameImports.renameImports)({
|
|
20
|
+
j,
|
|
21
|
+
root,
|
|
22
|
+
packageNames: ['@mui/x-charts', '@mui/x-charts-pro', '@mui/x-charts-premium'],
|
|
23
|
+
imports: [{
|
|
24
|
+
oldEndpoint: 'ChartDataProvider',
|
|
25
|
+
newEndpoint: 'ChartsDataProvider',
|
|
26
|
+
importsMapping: {
|
|
27
|
+
ChartDataProvider: 'ChartsDataProvider',
|
|
28
|
+
ChartDataProviderProps: 'ChartsDataProviderProps',
|
|
29
|
+
ChartDataProviderSlots: 'ChartsDataProviderSlots',
|
|
30
|
+
ChartDataProviderSlotProps: 'ChartsDataProviderSlotProps'
|
|
31
|
+
}
|
|
32
|
+
}]
|
|
33
|
+
});
|
|
34
|
+
(0, _renameImports.renameImports)({
|
|
35
|
+
j,
|
|
36
|
+
root,
|
|
37
|
+
packageNames: ['@mui/x-charts-pro', '@mui/x-charts-premium'],
|
|
38
|
+
imports: [{
|
|
39
|
+
oldEndpoint: 'ChartDataProviderPro',
|
|
40
|
+
newEndpoint: 'ChartsDataProviderPro',
|
|
41
|
+
importsMapping: {
|
|
42
|
+
ChartDataProviderPro: 'ChartsDataProviderPro',
|
|
43
|
+
ChartDataProviderProProps: 'ChartsDataProviderProProps',
|
|
44
|
+
ChartDataProviderProSlots: 'ChartsDataProviderProSlots',
|
|
45
|
+
ChartDataProviderProSlotProps: 'ChartsDataProviderProSlotProps'
|
|
46
|
+
}
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
49
|
+
(0, _renameImports.renameImports)({
|
|
50
|
+
j,
|
|
51
|
+
root,
|
|
52
|
+
packageNames: ['@mui/x-charts-premium'],
|
|
53
|
+
imports: [{
|
|
54
|
+
oldEndpoint: 'ChartDataProviderPremium',
|
|
55
|
+
newEndpoint: 'ChartsDataProviderPremium',
|
|
56
|
+
importsMapping: {
|
|
57
|
+
ChartDataProviderPremium: 'ChartsDataProviderPremium',
|
|
58
|
+
ChartDataProviderPremiumProps: 'ChartsDataProviderPremiumProps',
|
|
59
|
+
ChartDataProviderPremiumSlots: 'ChartsDataProviderPremiumSlots',
|
|
60
|
+
ChartDataProviderPremiumSlotProps: 'ChartsDataProviderPremiumSlotProps'
|
|
61
|
+
}
|
|
62
|
+
}]
|
|
63
|
+
});
|
|
64
|
+
return root.toSource(printOptions);
|
|
65
|
+
}
|
|
66
|
+
const testConfig = () => ({
|
|
67
|
+
name: 'rename-chart-data-provider',
|
|
68
|
+
specFiles: [{
|
|
69
|
+
name: 'nested-imports',
|
|
70
|
+
actual: (0, _readFile.default)(_path.default.join(__dirname, 'actual-nested-imports.spec.tsx')),
|
|
71
|
+
expected: (0, _readFile.default)(_path.default.join(__dirname, 'expected-nested-imports.spec.tsx'))
|
|
72
|
+
}, {
|
|
73
|
+
name: 'root-imports',
|
|
74
|
+
actual: (0, _readFile.default)(_path.default.join(__dirname, 'actual-root-imports.spec.tsx')),
|
|
75
|
+
expected: (0, _readFile.default)(_path.default.join(__dirname, 'expected-root-imports.spec.tsx'))
|
|
76
|
+
}]
|
|
77
|
+
});
|
|
78
|
+
exports.testConfig = testConfig;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
exports.testConfig = void 0;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _readFile = _interopRequireDefault(require("../../../util/readFile"));
|
|
11
|
+
var _renameImports = require("../../../util/renameImports");
|
|
12
|
+
function transformer(file, api, options) {
|
|
13
|
+
const j = api.jscodeshift;
|
|
14
|
+
const root = j(file.source);
|
|
15
|
+
const printOptions = options.printOptions || {
|
|
16
|
+
quote: 'single',
|
|
17
|
+
trailingComma: true
|
|
18
|
+
};
|
|
19
|
+
(0, _renameImports.renameImports)({
|
|
20
|
+
j,
|
|
21
|
+
root,
|
|
22
|
+
packageNames: ['@mui/x-charts-pro', '@mui/x-charts-premium'],
|
|
23
|
+
imports: [
|
|
24
|
+
// ChartZoomSlider → ChartsZoomSlider
|
|
25
|
+
{
|
|
26
|
+
oldEndpoint: 'ChartZoomSlider',
|
|
27
|
+
newEndpoint: 'ChartsZoomSlider',
|
|
28
|
+
importsMapping: {
|
|
29
|
+
ChartZoomSlider: 'ChartsZoomSlider',
|
|
30
|
+
ChartAxisZoomSliderThumbClasses: 'ChartsAxisZoomSliderThumbClasses',
|
|
31
|
+
ChartAxisZoomSliderThumbClassKey: 'ChartsAxisZoomSliderThumbClassKey',
|
|
32
|
+
chartAxisZoomSliderThumbClasses: 'chartsAxisZoomSliderThumbClasses',
|
|
33
|
+
ChartAxisZoomSliderTrackClasses: 'ChartsAxisZoomSliderTrackClasses',
|
|
34
|
+
ChartAxisZoomSliderTrackClassKey: 'ChartsAxisZoomSliderTrackClassKey',
|
|
35
|
+
chartAxisZoomSliderTrackClasses: 'chartsAxisZoomSliderTrackClasses'
|
|
36
|
+
}
|
|
37
|
+
}]
|
|
38
|
+
});
|
|
39
|
+
return root.toSource(printOptions);
|
|
40
|
+
}
|
|
41
|
+
const testConfig = () => ({
|
|
42
|
+
name: 'rename-chart-zoom-slider',
|
|
43
|
+
specFiles: [{
|
|
44
|
+
name: 'imports',
|
|
45
|
+
actual: (0, _readFile.default)(_path.default.join(__dirname, 'actual-imports.spec.tsx')),
|
|
46
|
+
expected: (0, _readFile.default)(_path.default.join(__dirname, 'expected-imports.spec.tsx'))
|
|
47
|
+
}]
|
|
48
|
+
});
|
|
49
|
+
exports.testConfig = testConfig;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = transformer;
|
|
8
|
+
exports.testConfig = void 0;
|
|
9
|
+
var _path = _interopRequireDefault(require("path"));
|
|
10
|
+
var _readFile = _interopRequireDefault(require("../../../util/readFile"));
|
|
11
|
+
var _renameImports = require("../../../util/renameImports");
|
|
12
|
+
function transformer(file, api, options) {
|
|
13
|
+
const j = api.jscodeshift;
|
|
14
|
+
const root = j(file.source);
|
|
15
|
+
const printOptions = options.printOptions || {
|
|
16
|
+
quote: 'single',
|
|
17
|
+
trailingComma: true
|
|
18
|
+
};
|
|
19
|
+
(0, _renameImports.renameImports)({
|
|
20
|
+
j,
|
|
21
|
+
root,
|
|
22
|
+
packageNames: ['@mui/x-charts-pro', '@mui/x-charts-premium'],
|
|
23
|
+
imports: [{
|
|
24
|
+
oldEndpoint: 'SankeyChart',
|
|
25
|
+
importsMapping: {
|
|
26
|
+
Unstable_SankeyChart: 'SankeyChart'
|
|
27
|
+
}
|
|
28
|
+
}]
|
|
29
|
+
});
|
|
30
|
+
return root.toSource(printOptions);
|
|
31
|
+
}
|
|
32
|
+
const testConfig = () => ({
|
|
33
|
+
name: 'rename-sankey-chart',
|
|
34
|
+
specFiles: [{
|
|
35
|
+
name: 'imports',
|
|
36
|
+
actual: (0, _readFile.default)(_path.default.join(__dirname, 'actual-imports.spec.tsx')),
|
|
37
|
+
expected: (0, _readFile.default)(_path.default.join(__dirname, 'expected-imports.spec.tsx'))
|
|
38
|
+
}]
|
|
39
|
+
});
|
|
40
|
+
exports.testConfig = testConfig;
|
|
@@ -13,16 +13,18 @@ const PROVIDER_NAMES = ['ChartDataProvider', 'ChartDataProviderPro', 'ChartDataP
|
|
|
13
13
|
// With the new naming to be sure codemod order does not matter
|
|
14
14
|
'ChartsDataProvider', 'ChartsDataProviderPro', 'ChartsDataProviderPremium',
|
|
15
15
|
// The component that includes the data provider.
|
|
16
|
-
'ChartsContainer', 'ChartsContainerPro', 'ChartsContainerPremium'
|
|
16
|
+
'ChartsContainer', 'ChartsContainerPro', 'ChartsContainerPremium',
|
|
17
|
+
// Old naming to be sure codemod order does not matter
|
|
18
|
+
'ChartContainer', 'ChartContainerPro', 'ChartContainerPremium'];
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Codemod for v9.0.0: Updates line series objects to preserve v8 behavior after the `showMark` default changes from true to false.
|
|
20
22
|
*
|
|
21
23
|
* If `showMark` is not defined, adds `showMark: true` to preserve v8 behavior.
|
|
22
24
|
*
|
|
23
|
-
* The `
|
|
25
|
+
* The `showMark: false` cases are left unchanged to stay idempotent.
|
|
24
26
|
*
|
|
25
|
-
*
|
|
27
|
+
* This codemod applies on LineChart components and providers when series type is set to 'line'.
|
|
26
28
|
*/
|
|
27
29
|
function transformer(file, api, options) {
|
|
28
30
|
const j = api.jscodeshift;
|