npm package: @laborit-dev/sunrise
Description: Sunrise Design System
Author: Laborit Brasil
Latest version: 0.0.1

Sunrise
===================

<img src="https://gitlab.com/uploads/-/system/project/avatar/18400728/sunrise.png?width=88" />

---

:rocket: Builds Status
=============

## Master:
[![pipeline status](https://gitlab.com/laborit/sunrise/badges/master/pipeline.svg)](https://gitlab.com/laborit/sunrise/commits/master)

## Development:
[![pipeline status](https://gitlab.com/laborit/sunrise/badges/development/pipeline.svg)](https://gitlab.com/laborit/sunrise/commits/development)

:nail_care: Test Coverage
=============

## Master:
[![coverage report](https://gitlab.com/laborit/sunrise/badges/master/coverage.svg)](https://gitlab.com/laborit/sunrise/commits/master)

## Development:
[![coverage report](https://gitlab.com/laborit/sunrise/badges/development/coverage.svg)](https://gitlab.com/laborit/sunrise/commits/development)

---

:memo: Documentation
=============

## Requirements
- nvm v0.34.0 ([install details](https://github.com/nvm-sh/nvm#installation-and-update))
- Node v12.16.1 ([install details](https://github.com/nvm-sh/nvm#nvmrc))
- npm v5.6.0

## Stack

- [Node](https://nodejs.org/en/) ([12.16.1](https://github.com/nodejs/node/blob/master/CHANGELOG.md))


- [Webpack](https://webpack.js.org/) ([^4.42.0](https://github.com/webpack/webpack/releases))

- [Rollup](https://rollupjs.org/guide/en/) ([^2.3.2](https://github.com/rollup/rollup/blob/master/CHANGELOG.md))

- [Storybook](https://storybook.js.org/) ([^5.3.17](https://github.com/storybookjs/storybook/blob/next/CHANGELOG.md))

- [ES6](https://babeljs.io/) ([^7.8.4](https://github.com/babel/babel/blob/master/CHANGELOG.md))

- [React](https://reactjs.org/) ([^16.13.0](https://github.com/facebook/react/blob/master/CHANGELOG.md))

- [SASS](https://sass-guidelin.es/pt/) ([^4.13.1](https://github.com/sass/node-sass/blob/master/CHANGELOG.md))

- [Jest](https://jestjs.io/en/) ([^25.1.0](https://github.com/facebook/jest/blob/master/CHANGELOG.md))

- [Enzyme](https://enzymejs.github.io/enzyme/) ([^3.11.0](https://github.com/enzymejs/enzyme/blob/master/CHANGELOG.md))

- [Prettier](https://prettier.io) ([2.0.2](https://github.com/prettier/prettier/blob/master/CHANGELOG.md))


---

## Environment Variables

### Application variables
Set Application variables in the .env file
- NODE_ENV
- ENV
- DEV (changes the development mode for the use of the library) 
- NPM_TOKEN (token do publish in npm)

## Initialization

```bash
git clone git@gitlab.com:laborit/sunrise.git
cd sunrise/
cp .env.sample .env
npm i
npm run dev
```

### Testing library to localhost
#### Changes the development mode for the use of the library

```bash
npm run build:lib
npm run dev:browser
```

---


## Build

### Build library to production

```bash
npm run build:lib
```
output path `/lib`

### Build client to production

```bash
npm run build:dist
```
output path `/dist`

## Storybook

Use storybook to document library components
see more details in [storybook documentation](https://storybook.js.org/docs/basics/introduction/)

### Initialize storybook server

```bash
npm run storybook
```

### build storybook static

```bash
npm run build-storybook
```
output path `/storybook-static`

---

## Testing

### Using jest with enzyme and chai (see examples on `./src/**/*.spec.js`)

```bash
npm test
npm run test:coverage
```

---

## Linting

### Using eslint

```bash
npm run lint
```

---

## Deploy

### NPM package

#### Locally

Logged in at NPM with your user

Build the library

```bash
npm run build:lib
```

Update package version:

```bash
npm version major | minor | patch
```
see more details in [npm-version](https://docs.npmjs.com/cli/version)

Publish the package

```bash
npm publish --access public
```

#### With Gitlab CI

Set the npm token on gitlab ci environment variable `NPM_TOKEN`

Before commit, update package version:

```bash
npm version major | minor | patch
```
see more details in [npm-version](https://docs.npmjs.com/cli/version)

After than, commit to branch master:

```
git push origin master
```


### Prettier

- https://prettier.io/ (Supports VSCode, Sublime Text, Vim, Atom and others)

**Why?**

It removes all original styling and ensures that all outputted code conforms to a consistent style.


As you can see, these two tools we make sure our codebase is consistent across all developers, IDE's and operating systems. Make sure you have them properly configurated on your IDE before starting writing code.



### Useful references & links

- [Trello board](https://trello.com/b/4pgwZvWc/lab-product-site)

- [Design System Sunrise](https://www.figma.com/proto/hguSTj8W8tZvRDnul9S7yW/Product-Lab?node-id=171%3A0)