Skip to content

CongenialData/cdab-utils

Repository files navigation

Introduction

Some handy utilities that could come in hand.

Getting started

  1. Clone your forked repository to your computer
git clone git@github.com:<your-github-username>/cdab-utils.git
  1. Keep your fork in sync to avoid merge conflics
git remote add upstream git@github.com:CongenialData/cdab-utils.git
git pull upstream main
  1. Install dependencies
npm install
  1. Validate and build the project
npm run validate

Develop instructions

1. Start working on a new feature

Make sure you have pulled the latest main branch and installed all the dependencies.

  1. git checkout -b feature/XXXXX
  2. Work in the src folder

2. Preparing build

Note: Try to only do one commit on each feature branch.

Build

Validate your changes and create the build before commiting.

npm run validate

This will save the build to the lib folder.

Test the changes

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.

  1. Create a global symlink with npm link
  2. Use a global symlink in your application with npm link @cdab/utils
cd ~/cdab-utils
npm link
cd ~/your-project
npm link @cdab/utils

3. Commit changes

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

4. Creating a release

Preparations

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 source code

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.

Publish release

npm publish

This will publish the code to the NPM Artifact Feed in DevOps. The feed is defined in .npmrc.

References

https://medium.com/tunaiku-tech/automate-javascript-project-versioning-with-commitizen-and-standard-version-6a967afae7

https://docs.npmjs.com/cli/link.html

http://commitizen.github.io/cz-cli/

About

Some handy utilities for TypeScript

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •