Skip to content

Modify an internal package ​

Publishing and consuming a new package version ​

Given you have already made changes in the relevant package for a feature branch (Branch A):

  1. In the package.json file (inside the directory of the package you have changed) update the package version in whichever may makes the most sense for the change being implemented (full guide for package versioning here)
  2. Deploy the package changes to a lower env/* environment, e.g. env/polaris (see Deploying and Testing your code)
  3. Once the package changes are pushed/deployed and the pipeline has passed, go to the package registry on GitLab where you should see a newly published env-specific version of the package (for env/polaris it will look something like <new-package-version>-env-polaris.<id>)
  4. Checkout or create a separate branch (Branch B)
  5. On this new branch, modify the package version and reference the env-specific version from the GitLab package registry to consume the newly-deployed version (e.g in clients/luna-front-end/package.json or in whichever client/service needs the package updates)
  6. Run yarn install in the client/service directory to install the new version of the package
  7. Continue with development as normal on Branch B using this new package version

Merging changes into main ​

Once you have finished development for the new feature and are ready for review, raise separate MRs for the changes:

  1. One for Branch A (contains the package changes)
  2. One for Branch B (contains the remaining changes/consumes the new package version)
  3. The MR for Branch A should be merged into main first, doing this will publish a 'prod' version of the new package (also viewable from the GitLab package registry)
  4. Once the MR for Branch A has been merged/deployed, the code for Branch B should be updated to use the 'prod' version of the package instead of the lower environment-specific version (i.e. instead of 2.2.1-env-polaris.<id> the version will now just be 2.2.1)
  5. The MR for Branch B can now be merged when ready

Made with ❤️ by the Luna team