Created
May 12, 2022 07:21
-
-
Save thmsobrmlr/92cf66a5a490edb58d23ffb4d85f4ad6 to your computer and use it in GitHub Desktop.
Revisions
-
thmsobrmlr created this gist
May 12, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ # How to fork a dependency and use it locally in a project 1. Clone the project ```sh [email protected]:author/my-dependency.git ``` 2. [Link the local fork into the project](https://classic.yarnpkg.com/en/docs/cli/link/) ```sh cd ../my-dependency # in package you want to link yarn link cd ../my-project # current project yarn link my-dependency ``` This will create a symlink named `my-project/node_modules/my-dependency` that links to your local copy of the `my-dependency` project. You can see all linked dependencies like this: ```sh find node_modules/ -type l -ls -maxdepth 1 ``` 3. Make the desire changes and build the project ```sh git checkout -b fixed-an-issue vim src/faulty_file.ts yarn build # or whatever the build command is ``` 4. Re-build your current project and test the changes 5. Submit a pull request for the dependency ```sh git add . git commit -m “fix: fixed an issue” git push ```