@reflexjs/codemod
v0.1.1
Published
Migration helpers for reflexjs
Downloads
12
Readme
@reflexjs/codemod
Provides Codemod transformations to help with code upgrade and migration.
Usage
npx @reflexjs/codemod <transform> <pathtransform- 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-reflexjsExample:
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>
)
}