@planningcenter/tapestry-migration-cli 2.4.0-rc.9 → 2.4.1-rc.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.
Files changed (42) hide show
  1. package/README.md +100 -6
  2. package/dist/tapestry-react-shim.cjs +1 -1
  3. package/package.json +2 -2
  4. package/src/components/button/index.ts +3 -3
  5. package/src/components/button/transforms/innerRefToRef.test.ts +170 -0
  6. package/src/components/button/transforms/innerRefToRef.ts +14 -0
  7. package/src/components/button/transforms/unsupportedProps.ts +8 -31
  8. package/src/components/checkbox/index.ts +38 -0
  9. package/src/components/checkbox/transforms/childrenToLabel.test.ts +146 -0
  10. package/src/components/checkbox/transforms/childrenToLabel.ts +54 -0
  11. package/src/components/checkbox/transforms/convertStyleProps.test.ts +161 -0
  12. package/src/components/checkbox/transforms/convertStyleProps.ts +10 -0
  13. package/src/components/checkbox/transforms/innerRefToRef.test.ts +161 -0
  14. package/src/components/checkbox/transforms/innerRefToRef.ts +14 -0
  15. package/src/components/checkbox/transforms/moveCheckboxImport.test.ts +182 -0
  16. package/src/components/checkbox/transforms/moveCheckboxImport.ts +13 -0
  17. package/src/components/checkbox/transforms/sizeMapping.test.ts +193 -0
  18. package/src/components/checkbox/transforms/sizeMapping.ts +45 -0
  19. package/src/components/checkbox/transforms/unsupportedProps.test.ts +243 -0
  20. package/src/components/checkbox/transforms/unsupportedProps.ts +47 -0
  21. package/src/components/link/index.ts +14 -4
  22. package/src/components/link/transforms/auditSpreadProps.test.ts +351 -0
  23. package/src/components/link/transforms/auditSpreadProps.ts +24 -0
  24. package/src/components/link/transforms/innerRefToRef.test.ts +170 -0
  25. package/src/components/link/transforms/innerRefToRef.ts +14 -0
  26. package/src/components/link/transforms/moveLinkImport.test.ts +295 -0
  27. package/src/components/{button/transforms/linkToButton.ts → link/transforms/moveLinkImport.ts} +4 -5
  28. package/src/components/link/transforms/{inlineMemberToKind.test.ts → removeInlineMember.test.ts} +13 -28
  29. package/src/components/link/transforms/removeInlineMember.ts +11 -0
  30. package/src/components/link/transforms/{inlinePropToKind.test.ts → removeInlineProp.test.ts} +12 -29
  31. package/src/components/link/transforms/{inlinePropToKind.ts → removeInlineProp.ts} +0 -9
  32. package/src/components/link/transforms/tooltipToWrapper.test.ts +392 -0
  33. package/src/components/link/transforms/tooltipToWrapper.ts +35 -0
  34. package/src/components/link/transforms/unsupportedProps.test.ts +265 -0
  35. package/src/components/link/transforms/unsupportedProps.ts +58 -0
  36. package/src/components/shared/helpers/unsupportedPropsHelpers.ts +35 -0
  37. package/src/components/shared/transformFactories/stylePropTransformFactory.ts +1 -0
  38. package/src/index.ts +18 -7
  39. package/src/jscodeshiftRunner.ts +9 -1
  40. package/src/reportGenerator.ts +23 -2
  41. package/src/components/button/transforms/linkToButton.test.ts +0 -426
  42. package/src/components/link/transforms/inlineMemberToKind.ts +0 -49
@@ -1,49 +0,0 @@
1
- import { Transform } from "jscodeshift"
2
-
3
- import { addAttribute } from "../../shared/actions/addAttribute"
4
- import { attributeTransformFactory } from "../../shared/transformFactories/attributeTransformFactory"
5
- import { componentTransformFactory } from "../../shared/transformFactories/componentTransformFactory"
6
-
7
- const addKindAttribute = attributeTransformFactory({
8
- condition: () => true, // Add to all Link.Inline elements
9
- targetComponent: "Link.Inline",
10
- targetPackage: "@planningcenter/tapestry-react",
11
- transform: (element, { j }) => {
12
- addAttribute({
13
- element,
14
- j,
15
- name: "kind",
16
- value: "inline-text",
17
- })
18
- return true
19
- },
20
- })
21
-
22
- const transformComponent = componentTransformFactory({
23
- condition: () => true, // Transform all Link.Inline elements
24
- fromComponent: "Link.Inline",
25
- fromPackage: "@planningcenter/tapestry-react",
26
- toComponent: "Link",
27
- toPackage: "@planningcenter/tapestry-react",
28
- })
29
-
30
- // Combined transform that runs both steps
31
- const transform: Transform = (fileInfo, api, options) => {
32
- // Step 1: Add kind attribute to Link.Inline elements
33
- const result1 = addKindAttribute(fileInfo, api, options)
34
-
35
- if (!result1) {
36
- return null
37
- }
38
-
39
- // Step 2: Transform Link.Inline to Link
40
- const result2 = transformComponent(
41
- { ...fileInfo, source: result1 as string },
42
- api,
43
- options
44
- )
45
-
46
- return result2 || result1
47
- }
48
-
49
- export default transform