Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pkg-codemods.mdx #1722

Merged
merged 3 commits into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions website/packages/docs/src/pages/pkg-codemods.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ name: codemods

# @compiled/codemods

We provide a few codemods for migrating from styled components and emotion to Compiled. The codemods are implemented with [jscodeshift](https://github.com/facebook/jscodeshift). Compiled codemods are enrolled in the [CodeshiftCommunity](https://www.codeshiftcommunity.com/docs/) tooling for easy usage.
We provide a few codemods for migrating from styled-components and emotion to Compiled. The codemods are implemented with [jscodeshift](https://github.com/facebook/jscodeshift). Compiled codemods are enrolled in the [Hypermod CLI](https://www.hypermod.io/docs/tools/cli) tooling for easy usage.

## Codemods

```bash
# Transform single file
npx @codeshift/cli --packages @compiled/codemods /Project/path/to/file
npx @hypermod/cli --packages @compiled/codemods /Project/path/to/file

# Transform multiple files
npx @codeshift/cli --packages @compiled/codemods /Project/**/*.tsx
npx @hypermod/cli --packages @compiled/codemods /Project/**/*.tsx
```

Our codemods will transform the source code into code that utilises `@compiled/react`. Keep in mind that the change will happen in-place so make sure you're utilising version control or backup the original source.
Expand All @@ -24,10 +24,10 @@ Our codemods will transform the source code into code that utilises `@compiled/r

```bash
# Transform single file
npx @codeshift/cli --packages "@compiled/codemods#emotion-to-compiled" /Project/path/to/file
npx @hypermod/cli --packages "@compiled/codemods#emotion-to-compiled" /Project/path/to/file

# Transform multiple files
npx @codeshift/cli --packages "@compiled/codemods#emotion-to-compiled" /Project/**/*.tsx
npx @hypermod/cli --packages "@compiled/codemods#emotion-to-compiled" /Project/**/*.tsx
```

Will convert all usages of Emotion to Compiled.
Expand All @@ -37,10 +37,10 @@ For code that could not be automatically converted a `/** TODO(@compiled/react c

```bash
# Transform single file
npx @codeshift/cli --packages "@compiled/codemods#styled-components-inner-ref-to-ref" /Project/path/to/file
npx @hypermod/cli --packages "@compiled/codemods#styled-components-inner-ref-to-ref" /Project/path/to/file

# Transform multiple files
npx @codeshift/cli --packages "@compiled/codemods#styled-components-inner-ref-to-ref" /Project/**/*.tsx
npx @hypermod/cli --packages "@compiled/codemods#styled-components-inner-ref-to-ref" /Project/**/*.tsx
```

Will convert all usages of Styled Components to Compiled.
Expand Down
Loading