create-react-library icon indicating copy to clipboard operation
create-react-library copied to clipboard

[INFO] How to rename the created library

Open alexnix opened this issue 4 years ago • 0 comments

This is not a question, it is just an info I find useful.

The following steps help to rename the library:

  1. Find all occurrences of the old name and replace with the new name. (/) $ rg old_name --files-with-matches | xargs sed -i 's/old_name/new_name/g' Note: rg (ripgrep) must be installed

  2. Delete the node_modules folder from the example/ (/) $ cd example && rm -rf node_modules

  3. Reinstall example dependencies (/example) $ yarn

I created two libraries using this tool, and 2/2 libraries I had to rename at some point, so maybe other people find this useful.

alexnix avatar Feb 05 '21 11:02 alexnix