Skip to content

konturio/ui

Repository files navigation

Packages version management with Lerna.js

📖 Docs

Settled to use independent mode to projects to increment package versions independently. Lerna allows target versions of local dependent packages to be written as a git remote url, this allows packages to be distributed via git repositories

Version track starts from v1.0.0 at main branch.

Local Development

  • npm run bootstrap
  • npm run build
  • npm run dev for running local dev server

Setup

Package management

To add dependency to all packages.

$ lerna add @konturio/module3

To add module3 as dependency to module2.

$ lerna add @konturio/module3 --scope=@konturio/module2

Git branch naming

For every feature you must create new branch in format

{fibery-task-id}-{tas-title}

Currently correct branch name generated in fibery

Commit naming

To build automation on top of lerna and packages version management we have to follow Conventional commits specification.

Commit message format:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Must be one of the following:

  • build: Changes that affect the build system or external dependencies (example scopes: webpack, babel, npm)
  • ci: Changes to our CI configuration files and scripts (example scopes: .env, Docker, Ansible, configs)
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

Version release

After you have finished working with the branch:

  1. Push and publish it into the git: git push --set-upstream origin <branch_name>

  2. Open Merge Request (MR) into dev

  • Select Delete source branch
  • Select Squash commits
  • Write changelog in description of MR (it will be added in change log of all modules that depend on your MR)
  1. Make sure that all CI pipelines passed successfully and reviewer was assigned

  2. Make sure that all issues identified in the review process closed, and request have at least one :like: (not yours). If CI/CD pipeline without errors - accept MR.

If you need release modules in NPM nexus repo, you need some extra steps:

  1. Clone fresh main branch with merged request
  2. npm run release 6.1 for Windows OS: powershell terminal may not let you log in and push new versions. Try using git bash terminal
  3. Wait until pipeline task 'release' was success
  4. Rebuild the app where you want to use the new modules

is something wrong in CI as workaround you can run npm run publish manually

Major version release

If you need to release major version of module:

  1. Create new branch from the current vN branch, where N is the current major version
  2. Change the version num from vN to vN+1 in leran.json and .github/workflows/deploy.yml files
  3. Push the branch
  4. Run npm run release