Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

No information about how to use a forked version of this repo #1963

Open
1 task
chebykin opened this issue Apr 29, 2019 · 4 comments
Open
1 task

No information about how to use a forked version of this repo #1963

chebykin opened this issue Apr 29, 2019 · 4 comments

Comments

@chebykin
Copy link
Contributor


Issue

I've made some improvements to truffle-contract submodule and want to use them within my project and maybe will make a pull request later. Common patterns like hardcoding your github fork repo and branch don't work. How can I include my truffle fork into a custom project?

Steps to Reproduce

Fork the repo and try to include this modified codebase into your dApp project

Expected Behavior

I want to write something like

"truffle-core": "git+https://git@github.com/myGithubAccount/truffle.git/packages/truffle-core"

in my package.json file

Actual Results

It's not so easy to figure out how to do that.

@gnidan
Copy link
Contributor

gnidan commented Apr 30, 2019

Tricky! Let me see what I can find real fast: there's a yarn issue, which is still open, and it looks like the npm issue was closed as too heated? Eep! Alas, it's another tricky monorepo quirk.

Have you looked into using npm link or yarn link? This functionality might not meet your use case, but figured I'd offer the suggestion just in case.

In my experience, to really make something behave like an NPM package, you have publish it to NPM. I usually do this with an NPM org account. Might want to read the NPM org documentation, but it's relatively easy to set up and publish, once you get the hang of it.

The process is essentially:

  1. Set up the NPM org account. Note that your org name can't conflict with your username.
  2. Update the package.json to change the package name to @<org-name>/<package-name> (so, e.g., rename truffle-contract to @chebykin-forks/truffle-contract).
  3. Publish by running npm publish --access public. This last bit is necessary for org-scoped packages.

Note if you have changes that you're testing out, I recommend keeping your package name/version changes on a separate branch from the core code changes, to make it easier to pull your changes in should you decide to PR it.

Hope this helps. As for this issue, not sure if this belongs in Truffle's development documentation somewhere, but it could certainly be helpful. Especially if we can flesh out the steps a bit more to make it easier. I'll leave this open specifically for the task of adding the relevant contributor docs.

Thanks for raising this concern! Let me know if either of the suggestions work out for you.

@eggplantzzz
Copy link
Contributor

Do we want to add the above to the truffle-contract docs?

@chebykin
Copy link
Contributor Author

chebykin commented Jul 9, 2019

Sorry for the late response. I've successfully published several custom releases using the aforementioned workflow, thank you!

But it's still too complex for the ones who want to participate. Are there any plans for making this forking process more developer friendly? I mean plugging in a fork into your project without packing and releasing a group of npm packages?

@gnidan
Copy link
Contributor

gnidan commented Mar 25, 2020

But it's still too complex for the ones who want to participate. Are there any plans for making this forking process more developer friendly? I mean plugging in a fork into your project without packing and releasing a group of npm packages?

Hey @chebykin, apologies for the radio silence here. Happy to entertain any ideas on how to move this forward!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants
@gnidan @chebykin @eggplantzzz and others