How to test github package locally OR publish developer versions

Hi there,

I’m trying to test my changes to a component library (comp_lib) with a consuming application (app) before I publish the changes to the Github Package Repo.

A bit of background, here is what our architecture looks like:

  • comp_lib: a React component library that has common components for all our company products. This is published to Github Package Repo.
  • app: Our main app that consumes some components from comp_lib. This installs the comp_lib from our private Github Private Repo.
  • app2: Another app that consumes components from comp_lib in the same way app does.

When modifying anything in comp_lib it’s important that app and app2 are tested locally somehow before publishing.

There are two ways I’m thinking of doing this:

  1. Run my comp_lib in a local server (ngrok?) and have my app point to that server. I have no experience with this, has anyone done this?

  2. The second way I’m thinking of doing this is simply publishing comp_lib to a second repository that’s meant for developing. I change the app to consume that package when testing my changes temporarily. This doesn’t seem like a good long term solution once I have a bigger team modifying the same repo.

Would love to hear about best practices around this.

You could publish your work-in-progress versions with a SemVer pre-release version string that includes the commit SHA. For example, this might look like 1.2.3-g${{ github.sha }}.

I like to use Nerdbank.GitVersioning to manage my versions automatically, see here:

I hope that helps!


Thanks for the tip @jcansdale! Will take a look and see if this works for me.