New code changes should always be introduced via a Pull Request branch:
-
Pull latest
master
branch then create new branch off frommaster
and make the changes there. (Note that you should not change theversion
number inpackage.json
because that is automatically managed via the release process below.) -
On that new branch, if there have been any changes to
package.json
that require a freshnpm install
(e.g. updating a dependency version) then do that first. When you runnpm install
it should update thepackage-lock.json
file -- make sure those updates are committed to the code as well. -
Otherwise, run
sbt fullOptJS
and thennpm run build:prod
and make sure those complete with no errors. If there are errors, resolve those before continuing. -
Ensure your Javascript code passes lints and adheres to our style guide. If you are not running a plugin in your editor that does this for you automatically, you can run
npm run lint:fix
andnpm run style:fix
respectively to automatically resolve any issues. -
Submit PR for merging that new branch into
master
. GitHub Actions will automatically attempt a build and run linter checks, which you can see under Actions. If the build and all checks are passing, the PR can be merged to master.
New releases are always cut from the master
branch, and managed via GitHub Releases with Semantic Versioning formatted tags. As a developer, this process is largely automated for you. Just make sure you are a collaborator of openlaw-client and you have installed the npm ci
and npm np
packages. To make a release of the current status of master, follow these steps:
-
Switch to
master
and pull the latest. -
Run
npm run release
to start the release process. -
A prompt will appear in your console allowing you to pick what sort of Semantic Version increment to pick. In most cases, you will be selecting a
patch
release. (Note: you can skip the interactive prompt for a patch by substitutingnpm run release:patch
in the step above.) -
You'll see the release steps going through in your console.§ When that's done the
openlaw-client
repo should open in your web browser with a draft release. All you have to do there is verify the release notes and click publish.§: Behind the scenes, the
package*.json
files will be updated with the new version, a new git commit and tag will be made and pushed to GitHub, and your web browser will be automatically opened to a draft release page for making a "release" of that tag. -
Once a GitHub Release is published, our CI system (currently GitHub Actions) will automatically start the process to publish the package to NPM. You can monitor the progress for that action under Actions.
-
You will see multiple identical actions of
Build and publish
. One will eventually successfully publish the package while the other will fail. Don't worry that is expected right now and it is a TODO to clean that up. -
Confirm that the package was successfully published with the latest version number by checking the NPM listing.