# viture-kit

> ## Table of contents

Latest version **0.0.1** (published 2024-03-19) · UNLICENSED license · 0 weekly downloads

## Install

```sh
npm install viture-kit
pnpm add viture-kit
yarn add viture-kit
bun add viture-kit
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2024-03-19 |
| First published | 2024-03-19 |
| Weekly downloads | 0 |
| License | UNLICENSED |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 238 KB |
| Known vulnerabilities | 0 (+2 in 2 direct dependencies) |
| Install scripts | no |
| Author | Capital 28 |
| Maintainers | alex2117 |

## Links

- npm: https://www.npmjs.com/package/viture-kit
- Repository: https://github.com/virture-io/virturekit
- Homepage: https://github.com/virture-io/virturekit#readme
- Issues: https://github.com/virture-io/virturekit/issues
- npm.io page: https://npm.io/package/viture-kit

## Dependencies (9)

- [rxjs](https://npm.io/package/rxjs.md) 7.8.1
- [dotenv](https://npm.io/package/dotenv.md) 16.3.1
- [newrelic](https://npm.io/package/newrelic.md) 11.7.0
- [@nestjs/core](https://npm.io/package/@nestjs/core.md) 10.0.0
- [logzio-nodejs](https://npm.io/package/logzio-nodejs.md) 2.1.6
- [@nestjs/common](https://npm.io/package/@nestjs/common.md) 10.0.0
- [@nestjs/swagger](https://npm.io/package/@nestjs/swagger.md) 7.1.17
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) 0.1.13
- [@nestjs/platform-express](https://npm.io/package/@nestjs/platform-express.md) 10.0.0

## Recent versions

- 0.0.1 (latest) — 2024-03-19

## README

# ⛑️ Virture-kit 💼

## Table of contents

- [Description](#description)
- [Prerequisites](#prerequisites)
- [Installation steps](#installation-steps)
- [Test](#test)
- [Conventional Commits](#conventional-commits)
- [Conventionnal branch name](#conventionnal-branch-name)
- [Use virture-kit](#use-virture-kit)
  - [Install and configure virture-kit](#install-and-configure-virture-kit)
  - [Use middlewares](src/middleware/README.md)
  - [Use swagger](src/swagger/README.md)
  - [Use utils](src/utils/README.md)

## Description <a name="description"></a>

## Prerequisites <a name="prerequisites"></a>

- [Git](https://git-scm.com/downloads)
- [nvm](https://www.freecodecamp.org/news/node-version-manager-nvm-install-guide/)

## Installation steps <a name="installation-steps"></a>

> [!IMPORTANT]
> - The nvm use command may give an error. If so, just run the `nvm install` command and then the `nvm use` command.
```bash
$ nvm use
```

```bash
$ npm install
```

## Test <a name="test"></a>

```bash
# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov
```

## Conventional Commits <a name="conventional-commits"></a>

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

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

## Conventionnal branch name <a name="conventionnal-branch-name"></a>

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

```bash
git switch -c feat/VIRT-4
```


### Graph of branch names

```mermaid
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 <a name="use-virture-kit"></a>

### Install and configure virture-kit <a name="install-and-configure-virture-kit"></a>

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](https://github.com/settings)
- 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

```bash
$ npm install @viture-io/viture-kit
```

---
_Source: https://npm.io/package/viture-kit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
