Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Making changes to the Climate Change Components library

Andrew Fink edited this page Oct 29, 2018 · 1 revision

Using Climate Change Components in Temperate

Publishing climate-change-components

In the climate-change-components repo, create a new git flow release and update the package.json and CHANGELOG.md with the new version number.

Then build and pack the library:

yarn run build:library
npm pack

Ensure you are logged in to npm via the CLI to the @azavea account (credentials on LastPass):

# Follow the prompts
npm login

Publish the new version of the library:

npm publish ./climate-change-components-x.y.z.tgz

Once published, clean up the git flow release and push tags:

git flow release finish
git push develop master && git push --tags

Installing dev components library into Temperate Angular container

cd to the climate-change-components repo directory. Make any appropriate changes to the climate-change-components lib. Then build and pack the library:

yarn run build:library
npm pack

Copy the npm package file to the root of your Temperate repo (assuming Temperate and climate-change-components repos are in the same folder on your machine):

cp ./climate-change-components-x.y.z.tgz ../temperate/

Change to the directory you just copied the climate-change-components package to. All of the following commands will be run from this new directory.

Checkout develop and start your dev server with ./scripts/server. Then SSH into your VM with vagrant ssh.

Next, we're going to copy the npm package into the running container and trigger a rebuild. To do so, we'll need the running container ID of the Angular docker container. Find it with docker ps | grep planit-spa.

Copy the package into the container:

docker cp ./climate-change-components-x.y.z.tgz <container id>:/opt/planit/angular/planit/climate-change-components-x.y.z.tgz

Install the components package in the container:

docker exec -it <container ID> /bin/bash

npm install ./climate-change-components-x.y.z.tgz

Exit so that you're back at the prompt on your host machine. If the server doesn't pick up on the changes and auto-recompile, you can do so manually by saving some file within the Angular project or restarting the dev server.