# @atlaskit/codemod-utils

> jscodeshift-compatible codemod utilities

Latest version **5.2.0** (published 2026-11-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @atlaskit/codemod-utils
pnpm add @atlaskit/codemod-utils
yarn add @atlaskit/codemod-utils
bun add @atlaskit/codemod-utils
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.2.0 |
| Published | 2026-11-06 |
| First published | 2020-12-08 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 103.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Atlassian Pty Ltd |
| Maintainers | atlassianartifactteam |

## Links

- npm: https://www.npmjs.com/package/@atlaskit/codemod-utils
- Repository: https://bitbucket.org/atlassian/atlassian-frontend-mirror
- Homepage: https://bitbucket.org/atlassian/atlassian-frontend-mirror#readme
- Issues: https://bitbucket.org/atlassian/atlassian-frontend-mirror/issues
- npm.io page: https://npm.io/package/@atlaskit/codemod-utils

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.0.0

## Recent versions

- 5.2.0 (latest) — 2026-11-06
- 4.2.2 (next) — 2023-05-17
- 5.1.0 — 2026-08-29
- 5.0.0 — 2026-06-16
- 4.3.0 — 2026-05-20
- 4.2.5 — 2025-03-24
- 4.2.4 — 2024-03-20
- 4.2.3 — 2023-05-31
- 4.2.1 — 2023-05-15
- 4.2.0 — 2023-05-08
- 4.1.3 — 2022-10-04
- 4.1.2 — 2022-08-25
- 4.1.1 — 2022-08-05
- 4.1.0 — 2022-05-31
- 4.0.2 — 2022-05-05
- … 16 more at https://npm.io/package/@atlaskit/codemod-utils/versions

## README

## Home for codemods

As part of lite mode conversion for components in atlaskit, we found `codemods` with [jscodeshift](https://github.com/facebook/jscodeshift) are extremely helpful for migrating some breaking changes for our consumers. However, one pain point for us who need to write and maintain them is that we have to copy-paste the code snippet in many places.

So the purpose of this package is to relief that pain and centric all reusable `codemods` snippets into a single place, and all the further changes should happen in this repo only.

The goal is to release this repo as a npm package, so our users can simply introduce those generic functions and compose in their codebase.

### Examples

For example, when you want to depracate a prop called `isLoading` from your consumer's codebase, you can introduce some helper function into a file `transformer.ts` from `@atlaskit/codemod-utils`:

```js
import {
  createRemoveFuncFor,
  createTransformer,
} from '@atlaskit/codemod-utils';

const removeIsLoading = createRemoveFuncFor(
  '@atlaskit/fancycomponent',
  'ComponentName',
  'isLoading',
);

const transformer = createTransformer([removeIsLoading]);

export default transformer;
```

And then run the `transformer` like:

```sh
npx jscodeshift -t transformer.ts  --ignore-pattern node_modules --parser babel --extensions ts path/to/your/codebase
```

### Advanced usage

If you need more than one mutation against your codebase and want to apply all of them in one go, it's recommended to structure them properly into a separate folder.

For example, if you need 3 separate steps:

- remove `isLoading` prop
- rename `isDefaultChecked` to `defaultChecked`
- add a new prop `title`

then you can have a folder called `migrates` that contains:

- remove-isLoading.ts
- rename-isDefaultChecked-to-defaultChecked.ts
- add-title.ts

and for each file, you can have some code like:

```js
import { createAddingPropFor } from '@atlaskit/codemod-utils';

export const addTitle = createAddingPropFor('@atlaskit/fancycomponent', {
  prop: 'title',
  defaultValue: '',
});
```

and in your entrypoint for `jscodeshift` to pick up, you can introduce all those migrates:

```js
import { addTitle } from './migrates/add-title';
import { removeIsLoading } from './migrates/remove-isLoading';
import { renameDefaultChecked } from './migrates/rename-isDefaultChecked-to-defaultChecked.ts';

import { createTransformer } from './utils';

const transformer = createTransformer([
  renameDefaultChecked,
  removeIsLoading,
  addTitle,
]);

export default transformer;
```

This way, you can easily test those migrates separately with all the possible scenario, and compose them freely as well to see if they can work together to make the whole transform.

---
_Source: https://npm.io/package/@atlaskit/codemod-utils · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
