Skip to content

Commit

Permalink
chore: docs
Browse files Browse the repository at this point in the history
  • Loading branch information
thepassle committed Jul 17, 2024
1 parent be5059f commit 338d631
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ And it will automatically clean up any unneeded dependencies.

## Contributing

If you would like to contribute a codemod for a module in [module replacements](https://github.com/es-tooling/module-replacements), please feel free to create a pull request! Pick any module from [module replacements](https://github.com/es-tooling/module-replacements), collect some before/after examples, and get started.
If you would like to contribute a codemod for a module in [module replacements](https://github.com/es-tooling/module-replacements) or [polyfills](https://github.com/esm-dev/esm.sh/tree/main/server/embed/polyfills/npm), please feel free to create a pull request! Pick any module from [module replacements](https://github.com/es-tooling/module-replacements) or [polyfills](https://github.com/esm-dev/esm.sh/tree/main/server/embed/polyfills/npm), collect some before/after examples, and get started.

> If you're interested in contributing a codemod, but don't have much experience with _writing_ codemods, take a look at [codemod.studio](https://codemod.com/studio), which makes it really easy.
Expand Down Expand Up @@ -52,6 +52,6 @@ export default function (options) {
}
```

The codemod's `name` should be equal to the name of the package that you're trying to replace (which should be a package from [module replacements](https://github.com/es-tooling/module-replacements)). So if you're writing a codemod for `is-array-buffer`, the `name` of the codemod should be `is-array-buffer`.
The codemod's `name` should be equal to the name of the package that you're trying to replace. So if you're writing a codemod for `is-array-buffer`, the `name` of the codemod should be `is-array-buffer`.

The `transform` function is where you can implement your codemod magic. Feel free to use whatever codemod tool you're comfortable with, [ast-grep](https://github.com/ast-grep/ast-grep), [jscodeshift](https://github.com/facebook/jscodeshift), etc. It gets passed the `file` with a `source` property which is a string containing the contents of the file, which you can use to perform transformations on. Make sure to return the changed file from the `transform` function.

0 comments on commit 338d631

Please sign in to comment.