Some handy utilities that could come in hand.
- Clone your forked repository to your computer
git clone git@github.com:<your-github-username>/cdab-utils.git
- Keep your fork in sync to avoid merge conflics
git remote add upstream git@github.com:CongenialData/cdab-utils.git
git pull upstream main
- Install dependencies
npm install
- Validate and build the project
npm run validate
Make sure you have pulled the latest main
branch and installed all the dependencies.
git checkout -b feature/XXXXX
- Work in the
src
folder
Note: Try to only do one commit on each feature branch.
Validate your changes and create the build before commiting.
npm run validate
This will save the build to the lib
folder.
You can now test the changes. How you would do this depends on what type of changes you are developing. One way would be to linking the local package to a project on your computer and use it.
- Create a global symlink with
npm link
- Use a global symlink in your application with
npm link @cdab/utils
cd ~/cdab-utils
npm link
cd ~/your-project
npm link @cdab/utils
When you are ready to commit your changes, run the following command:
npm run commit
This will use Commitizen to create the commit.
If you want someone to review your changes, please create a pull request to the main
branch. Otherwise you can merge
your changes directly to main
locally.
git checkout main
git merge FEATURE/XXXXX
npm run release
This will bump versions based on commit types, add commit descriptions to CHANGELOG.md, and create git tags according to the current version).
Push changes and git tags to main branch using:
git push --follow-tags origin main
Now is the last moment to be able to review any changes before publishing the package.
npm publish
This will publish the code to the NPM Artifact Feed in DevOps. The feed is defined in .npmrc
.