1.0.0 • Published 9 months ago

@cambly/syntax-codemods v1.0.0

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
9 months ago

Syntax Codemods

Codemods (short for "code modifications") are tools that assist in large-scale, partially automated codebase refactors. They are especially useful for migrating codebases between different versions of a library, or migrating codebases to a different library entirely.

Example

Let's say you want to convert all instances of the color prop on <Box /> to backgroundColor:

You could write a codemod that does the following:

  1. Find all instances of <Box color="red" />
  2. Replace them with <Box backgroundColor="red" />

Before

import { Box } from "@cambly/syntax-ui";

<Box color="red" />;

After

import { Box } from "@cambly/syntax-ui";

<Box backgroundColor="red" />;

Usage

Installation

npm install --save-dev @cambly/syntax-codemods

Running a codemod

npx @cambly/syntax-codemods -c={codemod id} -p=relative/path/to/code/to/modify
1.0.0

9 months ago

0.7.0

1 year ago

0.6.0

2 years ago

0.5.0

2 years ago

0.5.1

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago