@reflexjs/codemod
v0.1.1
Published
Migration helpers for reflexjs
Downloads
2
Readme
@reflexjs/codemod
Provides Codemod transformations to help with code upgrade and migration.
Usage
npx @reflexjs/codemod <transform> <path
transform
- name of the transformpath
- files or directory to transform--dry
- Performs a dry-run, no code changes--print
- Prints the changes for comparison
Codemods
to-reflexjs
This Codemod migrates your @reflexjs/componens
code to reflexjs
code.
npx @reflexjs/codemod to-reflexjs
Example:
import { Div, H1, Button } from "@reflexjs/components"
export default function () {
return (
<Div d="flex">
<H1>This is a heading</H1>
<Button variant="primary lg">Button</Button>
</Div>
)
}
Will be transformed to:
export default function () {
return (
<div display="flex">
<h1 variant="heading.h1">This is a heading</h1>
<button variant="button.primary.lg">Button</button>
</div>
)
}