@channel.io/bezier-codemod
Advanced tools
Comparing version 0.5.0-alpha.2 to 0.5.0-alpha.3
@@ -16,3 +16,3 @@ import React, { useCallback, useEffect, useState, } from 'react'; | ||
import inputInterpolationToCssVariable from './transforms/v2-input-interpolation-to-css-variable/transform.js'; | ||
import removeAlphaFromAlphaStack from './transforms/v2-remove-alpha-from-alpha-stack/transform.js'; | ||
import removeAlphaFromAlphaComponents from './transforms/v2-remove-alpha-from-alpha-components/transform.js'; | ||
import textComponentInterface from './transforms/v2-text-component-interface/transform.js'; | ||
@@ -41,3 +41,3 @@ import typographyInterpolationToCssVariable from './transforms/v2-typography-interpolation-to-css-variable/transform.js'; | ||
Option["V2TypographyInterpolationToCssVariable"] = "v2-typography-interpolation-to-css-variable"; | ||
Option["V2RemoveAlphaFromAlphaStack"] = "v2-remove-alpha-from-alpha-stack"; | ||
Option["V2RemoveAlphaFromAlphaComponents"] = "v2-remove-alpha-from-alpha-components"; | ||
Option["V2ZIndexInterpolationToCssVariable"] = "v2-z-index-interpolation-to-css-variable"; | ||
@@ -61,3 +61,3 @@ Option["V2TextComponentInterface"] = "v2-text-component-interface"; | ||
[Option.V2ImportFromBezierToStyledComponents]: importFromBezierToStyledComponents, | ||
[Option.V2RemoveAlphaFromAlphaStack]: removeAlphaFromAlphaStack, | ||
[Option.V2RemoveAlphaFromAlphaComponents]: removeAlphaFromAlphaComponents, | ||
[Option.V2ZIndexInterpolationToCssVariable]: zIndexInterpolationToCssVariable, | ||
@@ -64,0 +64,0 @@ [Option.V2TextComponentInterface]: textComponentInterface, |
@@ -5,9 +5,3 @@ import { changeAttrProperty, changeComponentProp, } from '../../utils/component.js'; | ||
keyMapper: { | ||
marginAll: 'm', | ||
marginTop: 'mt', | ||
marginRight: 'mr', | ||
marginBottom: 'mb', | ||
marginLeft: 'ml', | ||
marginHorizontal: 'mx', | ||
marginVertical: 'my', | ||
marginAll: 'margin', | ||
}, | ||
@@ -33,9 +27,3 @@ valueMapper: { | ||
keyMapper: { | ||
marginAll: 'm', | ||
marginTop: 'mt', | ||
marginRight: 'mr', | ||
marginBottom: 'mb', | ||
marginLeft: 'ml', | ||
marginHorizontal: 'mx', | ||
marginVertical: 'my', | ||
marginAll: 'margin', | ||
}, | ||
@@ -42,0 +30,0 @@ valueMapper: { |
{ | ||
"name": "@channel.io/bezier-codemod", | ||
"version": "0.5.0-alpha.2", | ||
"version": "0.5.0-alpha.3", | ||
"description": "Codemod transformations to help upgrade app using Bezier design system.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -236,12 +236,28 @@ # Bezier Codemod | ||
### Remove Alpha prefix from `AlphaStack` and add Legacy prefix to `Stack` | ||
### Add `Legacy` prefix to components to be deprecated and remove `Alpha` prefix from experimental components | ||
`v2-remove-alpha-from-alpha-stack` | ||
`v2-remove-alpha-from-alpha-components` | ||
Deprecates current `Stack`, `HStack`, `VStack`, `StackItem`, `Spacer` components and supports `AlphaStack` instead, removing "Alpha" prefix. | ||
Components to be deprecated | ||
- `Stack` | ||
- `HStack` | ||
- `VStack` | ||
- `StackItem` | ||
- `Spacer` | ||
Experimental components | ||
- `AlphaStack` | ||
- `AlphaCenter` | ||
For example: | ||
```tsx | ||
import { VStack, StackItem, AlphaStack } from "@channel.io/bezier-react"; | ||
import { | ||
VStack, | ||
StackItem, | ||
AlphaStack, | ||
AlphaCenter, | ||
} from "@channel.io/bezier-react"; | ||
@@ -269,2 +285,10 @@ function Foo() { | ||
} | ||
function Baz() { | ||
return ( | ||
<AlphaCenter> | ||
<div /> | ||
</AlphaCenter> | ||
); | ||
} | ||
``` | ||
@@ -275,3 +299,8 @@ | ||
```tsx | ||
import { LegacyVStack, LegacyStackItem, Stack } from "@channel.io/bezier-react"; | ||
import { | ||
LegacyVStack, | ||
LegacyStackItem, | ||
Stack, | ||
Center, | ||
} from "@channel.io/bezier-react"; | ||
@@ -299,2 +328,10 @@ function Foo() { | ||
} | ||
function Baz() { | ||
return ( | ||
<Center> | ||
<div /> | ||
</Center> | ||
); | ||
} | ||
``` | ||
@@ -306,3 +343,3 @@ | ||
Replace `Typography` enum with string literal and change properties related to margin to be shorthand. | ||
Replace `Typography` enum with string literal and change `marginAll` property to short. | ||
@@ -316,3 +353,3 @@ For example: | ||
return ( | ||
<Text typo={Typography.Size13} marginLeft={4}> | ||
<Text typo={Typography.Size13} marginAll={4}> | ||
title | ||
@@ -325,3 +362,3 @@ </Text> | ||
typo: Typography.Size13, | ||
marginLeft: 4, | ||
marginAll: 4, | ||
})``; | ||
@@ -337,3 +374,3 @@ ``` | ||
return ( | ||
<Text typo="13" ml={4}> | ||
<Text typo="13" margin={4}> | ||
title | ||
@@ -346,4 +383,4 @@ </Text> | ||
typo: "13", | ||
ml: 4, | ||
margin: 4, | ||
})``; | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
378
0
79280
1288