0.0.1 • Published 2 months ago

viture-kit v0.0.1

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
2 months ago

⛑️ Virture-kit 💼

Table of contents

Description

Prerequisites

Installation steps

!IMPORTANT

  • The nvm use command may give an error. If so, just run the nvm install command and then the nvm use command.
$ nvm use
$ npm install

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Conventional Commits

Structure of a commit message:

<type>(<scope>): <description>

Type

  • feat: A new feature.
  • fix: A bug fix.
  • bug: A bug fix.
  • docs: Documentation only changes. For example, README, CHANGELOG, etc...
  • refactor: A code change that neither fixes a bug nor adds a feature.
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation.
  • revert: Revert to a commit.
  • test: Adding missing tests or correcting existing tests.
  • ci: Changes to our CI configuration files and scripts.

Scope

The scope could be anything specifying place of the commit change. For example root, user, auth, login, logout, etc...

Description

The description must contain a clear description of the change.

Example

git commit -m "feat(user): add login feature"

Conventionnal branch name

Structure of a branch name:

<type>/<JIRA-KEY>

Type

  • feat: A new feature.
  • fix: A bug fix.
  • bug: A bug fix.
  • docs: Documentation only changes. For example, README, CHANGELOG, etc...
  • ref: A code change that neither fixes a bug nor adds a feature.
  • chore: Changes to the build process or auxiliary tools and libraries such as documentation generation.
  • revert: Revert to a commit.
  • test: Adding missing tests or correcting existing tests.
  • ci: Changes to our CI configuration files and scripts.

JIRA-KEY

!NOTE

  • If you don't have a Jira ticket, use a descriptive scope.
  • As short and understandable as possible.

The JIRA-KEY is the key of the task in JIRA.

Example

git switch -c feat/VIRT-4

Graph of branch names

gitGraph
  commit id: "Inital commit"
  commit id: "chore(root): config proyect"
  branch dev
  checkout dev
  commit
  branch feat/VIRT-4
  checkout feat/VIRT-4
  commit id: "feat(logger): create logger middleware"
  checkout main
  merge dev id: "ci(gha): create deploy.yml (#1)" tag: "v0.0.1"
  checkout feat/VIRT-4
  commit id: "dcos(use-logger): add example of use logger middleware"
  checkout dev
  commit id: "feat(VIRT-4): add DTO response swagger (#4)"
  merge feat/VIRT-4 id: "feat(VIRT-4): create logger middleware (#2)"
  commit id: "feat(VIRT-3): create schemas (#3)"
  commit id: "test(VIRT-7): create test for utils funtions (#5)"
  checkout main
  merge dev id: "feat(logger): logger for newrelic and logzio (#6)" tag: "v0.0.2"

Use virture-kit

Install and configure virture-kit

To use virture-kit we must first configure our access token, since virture-kit being a private package we need permissions and add the GitHub registry to npm 😅.

Configure access token

  • Go to your settings at GitHub setting
  • Go to Developer Settings -> Personal access tokens -> Generate New Token
  • Please check the write:packages and Read scope box. (After that, read:packages should be checked by default as well as all the repo scopes.)
  • After that, click either Generate Token or Update Token depending if you're doing this for the first time.
  • Copy the token and save it somewhere safe. You won't be able to see it again!

Add access token to global npmrc

  • Edit your global .npmrc. You can do this by typing code ~/.npmrc (You can use your prefered editor, Vim, nano, etc).
  • Inside that file, copy and paste this line //npm.pkg.github.com/:_authToken=TOKEN and replace TOKEN with your personal access token from Github.

Add GitHub registry to npm

  • Create a .npmrc file in your project root.
  • Add the following line to the file:
@viture-io:registry=https://npm.pkg.github.com

Install virture-kit

$ npm install @viture-io/viture-kit