From 338d631481c4bd4eed05bccfa591b80c72ff6145 Mon Sep 17 00:00:00 2001 From: thepassle Date: Wed, 17 Jul 2024 19:19:51 +0200 Subject: [PATCH] chore: docs --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65eea9c..4a257ef 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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. \ No newline at end of file