viture-kit
v0.0.1
Published
## Table of contents
Readme
⛑️ Virture-kit 💼
Table of contents
- Description
- Prerequisites
- Installation steps
- Test
- Conventional Commits
- Conventionnal branch name
- Use virture-kit
Description
Prerequisites
Installation steps
[!IMPORTANT]
- The nvm use command may give an error. If so, just run the
nvm installcommand and then thenvm usecommand.
$ nvm use$ npm installTest
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:covConventional 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-4Graph 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:packagesand Read scope box. (After that,read:packagesshould be checked by default as well as all thereposcopes.) - After that, click either
Generate TokenorUpdate Tokendepending 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 typingcode ~/.npmrc(You can use your prefered editor, Vim, nano, etc). - Inside that file, copy and paste this line
//npm.pkg.github.com/:_authToken=TOKENand replaceTOKENwith your personal access token from Github.
Add GitHub registry to npm
- Create a
.npmrcfile in your project root. - Add the following line to the file:
@viture-io:registry=https://npm.pkg.github.comInstall virture-kit
$ npm install @viture-io/viture-kit