@planningcenter/tapestry-migration-cli 3.0.0-rc.8 → 3.0.0
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/README.md +5 -2
- package/dist/tapestry-react-shim.cjs +384 -318
- package/package.json +4 -3
- package/src/components/button/transforms/auditSpreadProps.ts +2 -16
- package/src/components/button/transforms/themeVariantToKind.test.ts +1 -1
- package/src/components/button/transforms/tooltipToWrapper.test.ts +5 -3
- package/src/components/button/transforms/unsupportedProps.test.ts +305 -0
- package/src/components/button/transforms/unsupportedProps.ts +5 -2
- package/src/components/checkbox/index.ts +2 -0
- package/src/components/checkbox/transforms/auditSpreadProps.test.ts +356 -0
- package/src/components/checkbox/transforms/auditSpreadProps.ts +10 -0
- package/src/components/checkbox/transforms/sizeMapping.test.ts +88 -9
- package/src/components/checkbox/transforms/sizeMapping.ts +7 -37
- package/src/components/checkbox/transforms/unsupportedProps.ts +6 -11
- package/src/components/link/transforms/auditSpreadProps.ts +2 -16
- package/src/components/link/transforms/tooltipToWrapper.test.ts +5 -3
- package/src/components/link/transforms/unsupportedProps.ts +2 -2
- package/src/components/radio/index.ts +38 -0
- package/src/components/radio/transforms/auditSpreadProps.test.ts +356 -0
- package/src/components/radio/transforms/auditSpreadProps.ts +10 -0
- package/src/components/radio/transforms/convertStyleProps.test.ts +161 -0
- package/src/components/radio/transforms/convertStyleProps.ts +10 -0
- package/src/components/radio/transforms/moveRadioImport.test.ts +152 -0
- package/src/components/radio/transforms/moveRadioImport.ts +13 -0
- package/src/components/radio/transforms/setDefaultSize.test.ts +287 -0
- package/src/components/radio/transforms/setDefaultSize.ts +29 -0
- package/src/components/radio/transforms/sizeMapping.test.ts +201 -0
- package/src/components/radio/transforms/sizeMapping.ts +15 -0
- package/src/components/radio/transforms/unsupportedProps.test.ts +241 -0
- package/src/components/radio/transforms/unsupportedProps.ts +35 -0
- package/src/components/shared/actions/getAttributeValue.test.ts +18 -0
- package/src/components/shared/actions/getAttributeValue.ts +18 -5
- package/src/components/shared/actions/getAttributeValueAsProps.ts +15 -0
- package/src/components/shared/conditions/notCondition.test.ts +35 -0
- package/src/components/shared/conditions/notCondition.ts +12 -0
- package/src/components/shared/helpers/unsupportedPropsHelpers.ts +26 -10
- package/src/components/shared/transformFactories/commentOnSpreadPropsFactory.test.ts +84 -0
- package/src/components/shared/transformFactories/commentOnSpreadPropsFactory.ts +26 -0
- package/src/components/shared/transformFactories/sizeMappingFactory.ts +56 -0
- package/src/components/toggle-switch/index.ts +40 -0
- package/src/components/toggle-switch/transforms/ariaLabelToLabel.test.ts +236 -0
- package/src/components/toggle-switch/transforms/ariaLabelToLabel.ts +35 -0
- package/src/components/toggle-switch/transforms/auditSpreadProps.test.ts +352 -0
- package/src/components/toggle-switch/transforms/auditSpreadProps.ts +10 -0
- package/src/components/toggle-switch/transforms/convertStyleProps.test.ts +161 -0
- package/src/components/toggle-switch/transforms/convertStyleProps.ts +10 -0
- package/src/components/toggle-switch/transforms/isCheckedToChecked.test.ts +175 -0
- package/src/components/toggle-switch/transforms/isCheckedToChecked.ts +18 -0
- package/src/components/toggle-switch/transforms/moveToggleSwitchImport.test.ts +192 -0
- package/src/components/toggle-switch/transforms/moveToggleSwitchImport.ts +13 -0
- package/src/components/toggle-switch/transforms/sizeMapping.test.ts +188 -0
- package/src/components/toggle-switch/transforms/sizeMapping.ts +13 -0
- package/src/components/toggle-switch/transforms/unsupportedProps.test.ts +241 -0
- package/src/components/toggle-switch/transforms/unsupportedProps.ts +42 -0
- package/src/index.ts +12 -5
- package/src/reportGenerator.ts +4 -0
- package/src/utils/componentNameNormalizer.test.ts +91 -0
- package/src/utils/componentNameNormalizer.ts +39 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/tapestry-migration-cli",
|
|
3
|
-
"version": "3.0.0
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "CLI tool for Tapestry migrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"author": "Planning Center",
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"engines": {
|
|
26
|
-
"node": ">=
|
|
26
|
+
"node": ">=20.0.0"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"commander": "^11.0.0",
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@emotion/react": "^11.14.0",
|
|
35
|
+
"@planningcenter/tapestry": "^3.0.0",
|
|
35
36
|
"@planningcenter/tapestry-react": "^4.11.5",
|
|
36
37
|
"@types/jscodeshift": "^17.3.0",
|
|
37
38
|
"@types/node": "^20.0.0",
|
|
@@ -51,5 +52,5 @@
|
|
|
51
52
|
"publishConfig": {
|
|
52
53
|
"access": "public"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "1168860ff16c9ebb3429e377890b2df78deeee2f"
|
|
55
56
|
}
|
|
@@ -1,24 +1,10 @@
|
|
|
1
1
|
import { Transform } from "jscodeshift"
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { getSpreadProps } from "../../shared/actions/getSpreadProps"
|
|
5
|
-
import { hasSpreadProps } from "../../shared/actions/hasSpreadProps"
|
|
6
|
-
import { attributeTransformFactory } from "../../shared/transformFactories/attributeTransformFactory"
|
|
3
|
+
import { commentOnSpreadPropsFactory } from "../../shared/transformFactories/commentOnSpreadPropsFactory"
|
|
7
4
|
|
|
8
|
-
const
|
|
9
|
-
"Spread props can contain unsupported props, please explore usages and migrate as needed."
|
|
10
|
-
|
|
11
|
-
const transform: Transform = attributeTransformFactory({
|
|
12
|
-
condition: hasSpreadProps,
|
|
5
|
+
const transform: Transform = commentOnSpreadPropsFactory({
|
|
13
6
|
targetComponent: "Button",
|
|
14
7
|
targetPackage: "@planningcenter/tapestry-react",
|
|
15
|
-
transform: (element, { j }) => {
|
|
16
|
-
const spreadProps = getSpreadProps(element)
|
|
17
|
-
spreadProps.forEach((prop) =>
|
|
18
|
-
addCommentToAttribute({ attribute: prop, j, text: COMMENT })
|
|
19
|
-
)
|
|
20
|
-
return spreadProps.length > 0
|
|
21
|
-
},
|
|
22
8
|
})
|
|
23
9
|
|
|
24
10
|
export default transform
|
|
@@ -253,7 +253,7 @@ describe("themeVariantToKind", () => {
|
|
|
253
253
|
expect(result).toContain(
|
|
254
254
|
"TODO: tapestry-migration (theme/variant): cannot be converted"
|
|
255
255
|
)
|
|
256
|
-
expect(result).toContain('
|
|
256
|
+
expect(result).toContain('theme="primary"')
|
|
257
257
|
})
|
|
258
258
|
})
|
|
259
259
|
|
|
@@ -311,10 +311,12 @@ export default function Test({ items }) {
|
|
|
311
311
|
}
|
|
312
312
|
`.trim()
|
|
313
313
|
|
|
314
|
-
const result = applyTransform(input)
|
|
314
|
+
const result = applyTransform(input)!
|
|
315
315
|
|
|
316
|
-
expect(result).toContain(
|
|
317
|
-
|
|
316
|
+
expect(result).toContain("<Tooltip")
|
|
317
|
+
expect(result).toContain("key={item.id}")
|
|
318
|
+
expect(result.replace(/\s+/g, " ")).toContain(
|
|
319
|
+
"{...{ title: `Save ${item.name}` }}"
|
|
318
320
|
)
|
|
319
321
|
expect(result).toContain("refAsInnerRef={false}")
|
|
320
322
|
expect(result).toContain("<Button onClick={() => save(item)}>")
|
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import jscodeshift from "jscodeshift"
|
|
2
|
+
import { describe, expect, it } from "vitest"
|
|
3
|
+
|
|
4
|
+
import transform from "./unsupportedProps"
|
|
5
|
+
|
|
6
|
+
const j = jscodeshift.withParser("tsx")
|
|
7
|
+
|
|
8
|
+
function applyTransform(source: string): string {
|
|
9
|
+
const fileInfo = { path: "test.tsx", source }
|
|
10
|
+
const result = transform(
|
|
11
|
+
fileInfo,
|
|
12
|
+
{ j, jscodeshift: j, report: () => {}, stats: () => {} },
|
|
13
|
+
{}
|
|
14
|
+
) as string | null
|
|
15
|
+
return result || source
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
describe("unsupportedProps transform", () => {
|
|
19
|
+
describe("unsupported prop detection", () => {
|
|
20
|
+
it("should add comment for css prop", () => {
|
|
21
|
+
const input = `
|
|
22
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
23
|
+
|
|
24
|
+
function Test() {
|
|
25
|
+
return <Button css={{ color: 'red' }} label="Test" />
|
|
26
|
+
}
|
|
27
|
+
`.trim()
|
|
28
|
+
|
|
29
|
+
const result = applyTransform(input)
|
|
30
|
+
expect(result).toContain(
|
|
31
|
+
"/* TODO: tapestry-migration (css): 'css' is not supported, please migrate as needed."
|
|
32
|
+
)
|
|
33
|
+
expect(result).toContain("css={{ color: 'red' }}")
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it("should add comment for custom unsupported prop", () => {
|
|
37
|
+
const input = `
|
|
38
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
39
|
+
|
|
40
|
+
function Test() {
|
|
41
|
+
return <Button customProp="value" label="Test" />
|
|
42
|
+
}
|
|
43
|
+
`.trim()
|
|
44
|
+
|
|
45
|
+
const result = applyTransform(input)
|
|
46
|
+
expect(result).toContain(
|
|
47
|
+
"/* TODO: tapestry-migration (customProp): 'customProp' is not supported, please migrate as needed."
|
|
48
|
+
)
|
|
49
|
+
expect(result).toContain('customProp="value"')
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
it("should add comments for multiple unsupported props", () => {
|
|
53
|
+
const input = `
|
|
54
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
55
|
+
|
|
56
|
+
function Test() {
|
|
57
|
+
return (
|
|
58
|
+
<Button
|
|
59
|
+
css={{ color: 'red' }}
|
|
60
|
+
ref={ref}
|
|
61
|
+
customProp="value"
|
|
62
|
+
label="Test"
|
|
63
|
+
/>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
66
|
+
`.trim()
|
|
67
|
+
|
|
68
|
+
const result = applyTransform(input)
|
|
69
|
+
expect(result).toContain("/* TODO: tapestry-migration (css):")
|
|
70
|
+
expect(result).toContain("/* TODO: tapestry-migration (customProp):")
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it("should add comment for mediaQueries prop with custom message", () => {
|
|
74
|
+
const input = `
|
|
75
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
76
|
+
|
|
77
|
+
function Test() {
|
|
78
|
+
return <Button mediaQueries={{ sm: { fontSize: "12px" } }} label="Test" />
|
|
79
|
+
}
|
|
80
|
+
`.trim()
|
|
81
|
+
|
|
82
|
+
const result = applyTransform(input)
|
|
83
|
+
expect(result).toContain("/* TODO: tapestry-migration (mediaQueries):")
|
|
84
|
+
expect(result).toContain("use CSS media queries in a class")
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
it("should add comment for hover prop with custom message", () => {
|
|
88
|
+
const input = `
|
|
89
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
90
|
+
|
|
91
|
+
function Test() {
|
|
92
|
+
return <Button hover={{ color: "blue" }} label="Test" />
|
|
93
|
+
}
|
|
94
|
+
`.trim()
|
|
95
|
+
|
|
96
|
+
const result = applyTransform(input)
|
|
97
|
+
expect(result).toContain("/* TODO: tapestry-migration (hover):")
|
|
98
|
+
expect(result).toContain("State-based styles (hover, focus, active)")
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
it("should add comment for focus prop with custom message", () => {
|
|
102
|
+
const input = `
|
|
103
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
104
|
+
|
|
105
|
+
function Test() {
|
|
106
|
+
return <Button focus={{ outline: "none" }} label="Test" />
|
|
107
|
+
}
|
|
108
|
+
`.trim()
|
|
109
|
+
|
|
110
|
+
const result = applyTransform(input)
|
|
111
|
+
expect(result).toContain("/* TODO: tapestry-migration (focus):")
|
|
112
|
+
expect(result).toContain("State-based styles (hover, focus, active)")
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
it("should add comment for active prop with custom message", () => {
|
|
116
|
+
const input = `
|
|
117
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
118
|
+
|
|
119
|
+
function Test() {
|
|
120
|
+
return <Button active={{ opacity: 0.8 }} label="Test" />
|
|
121
|
+
}
|
|
122
|
+
`.trim()
|
|
123
|
+
|
|
124
|
+
const result = applyTransform(input)
|
|
125
|
+
expect(result).toContain("/* TODO: tapestry-migration (active):")
|
|
126
|
+
expect(result).toContain("State-based styles (hover, focus, active)")
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
describe("supported props", () => {
|
|
131
|
+
it("should not add comments for supported button props", () => {
|
|
132
|
+
const input = `
|
|
133
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
134
|
+
|
|
135
|
+
function Test() {
|
|
136
|
+
const ref = React.useRef()
|
|
137
|
+
return (
|
|
138
|
+
<Button
|
|
139
|
+
disabled
|
|
140
|
+
fullWidth
|
|
141
|
+
loading
|
|
142
|
+
loadingAriaLabel="Loading"
|
|
143
|
+
name="submit"
|
|
144
|
+
type="button"
|
|
145
|
+
icon={<Icon />}
|
|
146
|
+
ref={ref}
|
|
147
|
+
label="Test"
|
|
148
|
+
kind="primary"
|
|
149
|
+
size="lg"
|
|
150
|
+
prefix={<Icon />}
|
|
151
|
+
suffix={<Icon />}
|
|
152
|
+
onClick={() => {}}
|
|
153
|
+
/>
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
`.trim()
|
|
157
|
+
|
|
158
|
+
const result = applyTransform(input)
|
|
159
|
+
expect(result).not.toContain("TODO: tapestry-migration")
|
|
160
|
+
expect(result).toContain("disabled")
|
|
161
|
+
expect(result).toContain("fullWidth")
|
|
162
|
+
expect(result).toContain("loading")
|
|
163
|
+
expect(result).toContain('loadingAriaLabel="Loading"')
|
|
164
|
+
expect(result).toContain('name="submit"')
|
|
165
|
+
expect(result).toContain('type="button"')
|
|
166
|
+
expect(result).toContain("icon={<Icon />}")
|
|
167
|
+
expect(result).toContain("ref={ref}")
|
|
168
|
+
expect(result).toContain('label="Test"')
|
|
169
|
+
expect(result).toContain('kind="primary"')
|
|
170
|
+
expect(result).toContain('size="lg"')
|
|
171
|
+
})
|
|
172
|
+
|
|
173
|
+
it("should not add comments for common props", () => {
|
|
174
|
+
const input = `
|
|
175
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
176
|
+
|
|
177
|
+
function Test() {
|
|
178
|
+
return (
|
|
179
|
+
<Button
|
|
180
|
+
className="test"
|
|
181
|
+
id="button"
|
|
182
|
+
key="key"
|
|
183
|
+
style={{ color: 'red' }}
|
|
184
|
+
tabIndex={0}
|
|
185
|
+
label="Test"
|
|
186
|
+
/>
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
`.trim()
|
|
190
|
+
|
|
191
|
+
const result = applyTransform(input)
|
|
192
|
+
expect(result).not.toContain("TODO: tapestry-migration")
|
|
193
|
+
expect(result).toContain('className="test"')
|
|
194
|
+
expect(result).toContain('id="button"')
|
|
195
|
+
expect(result).toContain('key="key"')
|
|
196
|
+
expect(result).toContain("style={{ color: 'red' }}")
|
|
197
|
+
expect(result).toContain("tabIndex={0}")
|
|
198
|
+
})
|
|
199
|
+
|
|
200
|
+
it("should not add comments for aria props", () => {
|
|
201
|
+
const input = `
|
|
202
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
203
|
+
|
|
204
|
+
function Test() {
|
|
205
|
+
return (
|
|
206
|
+
<Button
|
|
207
|
+
aria-label="Test button"
|
|
208
|
+
aria-describedby="description"
|
|
209
|
+
label="Test"
|
|
210
|
+
/>
|
|
211
|
+
)
|
|
212
|
+
}
|
|
213
|
+
`.trim()
|
|
214
|
+
|
|
215
|
+
const result = applyTransform(input)
|
|
216
|
+
expect(result).not.toContain("TODO: tapestry-migration")
|
|
217
|
+
expect(result).toContain('aria-label="Test button"')
|
|
218
|
+
expect(result).toContain('aria-describedby="description"')
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
it("should not add comments for data props", () => {
|
|
222
|
+
const input = `
|
|
223
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
224
|
+
|
|
225
|
+
function Test() {
|
|
226
|
+
return (
|
|
227
|
+
<Button
|
|
228
|
+
data-testid="button"
|
|
229
|
+
data-cy="test-button"
|
|
230
|
+
label="Test"
|
|
231
|
+
/>
|
|
232
|
+
)
|
|
233
|
+
}
|
|
234
|
+
`.trim()
|
|
235
|
+
|
|
236
|
+
const result = applyTransform(input)
|
|
237
|
+
expect(result).not.toContain("TODO: tapestry-migration")
|
|
238
|
+
expect(result).toContain('data-testid="button"')
|
|
239
|
+
expect(result).toContain('data-cy="test-button"')
|
|
240
|
+
})
|
|
241
|
+
})
|
|
242
|
+
|
|
243
|
+
describe("edge cases", () => {
|
|
244
|
+
it("should not affect button without unsupported props", () => {
|
|
245
|
+
const input = `
|
|
246
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
247
|
+
|
|
248
|
+
function Test() {
|
|
249
|
+
return <Button label="Test" />
|
|
250
|
+
}
|
|
251
|
+
`.trim()
|
|
252
|
+
|
|
253
|
+
const result = applyTransform(input)
|
|
254
|
+
expect(result).not.toContain("TODO: tapestry-migration")
|
|
255
|
+
expect(result).toBe(input)
|
|
256
|
+
})
|
|
257
|
+
|
|
258
|
+
it("should not affect other components", () => {
|
|
259
|
+
const input = `
|
|
260
|
+
import { Button, Link } from "@planningcenter/tapestry-react"
|
|
261
|
+
|
|
262
|
+
function Test() {
|
|
263
|
+
return (
|
|
264
|
+
<div>
|
|
265
|
+
<Link css={{ color: 'red' }}>Click me</Link>
|
|
266
|
+
<Button label="Test" />
|
|
267
|
+
</div>
|
|
268
|
+
)
|
|
269
|
+
}
|
|
270
|
+
`.trim()
|
|
271
|
+
|
|
272
|
+
const result = applyTransform(input)
|
|
273
|
+
expect(result).not.toContain("TODO: tapestry-migration")
|
|
274
|
+
expect(result).toContain("css={{ color: 'red' }}")
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
it("should handle mixed supported and unsupported props", () => {
|
|
278
|
+
const input = `
|
|
279
|
+
import { Button } from "@planningcenter/tapestry-react"
|
|
280
|
+
|
|
281
|
+
function Test() {
|
|
282
|
+
return (
|
|
283
|
+
<Button
|
|
284
|
+
disabled
|
|
285
|
+
css={{ color: 'red' }}
|
|
286
|
+
loading
|
|
287
|
+
customProp="value"
|
|
288
|
+
label="Test"
|
|
289
|
+
/>
|
|
290
|
+
)
|
|
291
|
+
}
|
|
292
|
+
`.trim()
|
|
293
|
+
|
|
294
|
+
const result = applyTransform(input)
|
|
295
|
+
expect(result).toContain("/* TODO: tapestry-migration (css):")
|
|
296
|
+
expect(result).toContain("/* TODO: tapestry-migration (customProp):")
|
|
297
|
+
expect(result).not.toContain("TODO: tapestry-migration.*disabled")
|
|
298
|
+
expect(result).not.toContain("TODO: tapestry-migration.*loading")
|
|
299
|
+
expect(result).not.toContain("TODO: tapestry-migration.*label")
|
|
300
|
+
expect(result).toContain("disabled")
|
|
301
|
+
expect(result).toContain("loading")
|
|
302
|
+
expect(result).toContain('label="Test"')
|
|
303
|
+
})
|
|
304
|
+
})
|
|
305
|
+
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSXAttribute, Transform } from "jscodeshift"
|
|
2
2
|
|
|
3
3
|
import { addCommentToUnsupportedProps } from "../../shared/actions/addCommentToUnsupportedProps"
|
|
4
|
-
import {
|
|
4
|
+
import { BUTTON_LINK_SUPPORTED_PROPS } from "../../shared/helpers/unsupportedPropsHelpers"
|
|
5
5
|
import { attributeTransformFactory } from "../../shared/transformFactories/attributeTransformFactory"
|
|
6
6
|
|
|
7
7
|
const BUTTON_SPECIFIC_PROPS = [
|
|
@@ -14,7 +14,10 @@ const BUTTON_SPECIFIC_PROPS = [
|
|
|
14
14
|
"icon",
|
|
15
15
|
]
|
|
16
16
|
|
|
17
|
-
const SUPPORTED_PROPS = [
|
|
17
|
+
const SUPPORTED_PROPS = [
|
|
18
|
+
...BUTTON_LINK_SUPPORTED_PROPS,
|
|
19
|
+
...BUTTON_SPECIFIC_PROPS,
|
|
20
|
+
]
|
|
18
21
|
|
|
19
22
|
const transform: Transform = attributeTransformFactory({
|
|
20
23
|
targetComponent: "Button",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Transform } from "jscodeshift"
|
|
2
2
|
|
|
3
|
+
import auditSpreadProps from "./transforms/auditSpreadProps"
|
|
3
4
|
import childrenToLabel from "./transforms/childrenToLabel"
|
|
4
5
|
import convertStyleProps from "./transforms/convertStyleProps"
|
|
5
6
|
import innerRefToRef from "./transforms/innerRefToRef"
|
|
@@ -12,6 +13,7 @@ const transform: Transform = (fileInfo, api, options) => {
|
|
|
12
13
|
let hasAnyChanges = false
|
|
13
14
|
|
|
14
15
|
const transforms = [
|
|
16
|
+
auditSpreadProps,
|
|
15
17
|
childrenToLabel,
|
|
16
18
|
sizeMapping,
|
|
17
19
|
innerRefToRef,
|