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 validateMake sure you have pulled the latest main branch and installed all the dependencies.
git checkout -b feature/XXXXX- Work in the
srcfolder
Note: Try to only do one commit on each feature branch.
Validate your changes and create the build before commiting.
npm run validateThis 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/utilsWhen you are ready to commit your changes, run the following command:
npm run commitThis 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/XXXXXnpm run releaseThis 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 mainNow is the last moment to be able to review any changes before publishing the package.
npm publishThis will publish the code to the NPM Artifact Feed in DevOps. The feed is defined in .npmrc.