Skip to content

Commit a72027d

Browse files
authoredFeb 8, 2020
Merge pull request #4 from eug-vs/develop
Release 3.0.0
2 parents d246305 + ac6f957 commit a72027d

25 files changed

+4916
-2256
lines changed
 

‎.babelrc

-5
This file was deleted.

‎.circleci/config.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
version: 2
2+
3+
defaults: &defaults
4+
working_directory: ~/repo
5+
docker:
6+
- image: circleci/node:12-stretch
7+
8+
jobs:
9+
checkout_and_test:
10+
<<: *defaults
11+
steps:
12+
- checkout
13+
- restore_cache:
14+
keys:
15+
- v1-dependencies-{{ checksum "package.json" }}
16+
# fallback to using the latest cache if no exact match is found
17+
- v1-dependencies-
18+
19+
- run:
20+
name: Install NPM dependencies
21+
command: npm install
22+
23+
- save_cache:
24+
paths:
25+
- node_modules
26+
key: v1-dependencies-{{ checksum "package.json" }}
27+
28+
- run:
29+
name: Test syntax and perform type checking
30+
command: npm test
31+
32+
deploy:
33+
<<: *defaults
34+
steps:
35+
- checkout
36+
- restore_cache:
37+
keys:
38+
- v1-dependencies-{{ checksum "package.json" }}
39+
# fallback to using the latest cache if no exact match is found
40+
- v1-dependencies-
41+
42+
- run:
43+
name: Authenticate with registry
44+
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
45+
- run:
46+
name: Deploy package
47+
command: npm run deploy
48+
49+
50+
workflows:
51+
version: 2
52+
53+
test:
54+
jobs:
55+
- checkout_and_test
56+
57+
deploy:
58+
jobs:
59+
- checkout_and_test:
60+
filters:
61+
branches:
62+
ignore: /.*/
63+
tags:
64+
only: /^v.*/
65+
- deploy:
66+
filters:
67+
branches:
68+
ignore: /.*/
69+
tags:
70+
only: /^v.*/
71+
requires:
72+
- checkout_and_test
73+

‎.eslintrc.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
2-
"extends": "react-app",
2+
"parser": "@typescript-eslint/parser",
3+
"extends": [
4+
"react-app",
5+
"plugin:@typescript-eslint/recommended"
6+
],
37
"rules": {
48
"jsx-quotes": ["error", "prefer-double"],
59
"quotes": ["error", "single"]

‎README.md

+61-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1-
# Benzin
1+
<p align="center"><img src="src/assets/icon.svg" /></p>
2+
<h1 align="center"> BENZIN </h1>
23

3-
A powerful React Material components library.
4+
[React](https://reactjs.org/) Material components library. It supplies you with cool pre-defined style, while assuring that your project will follow all [Material Design guidelines](https://material.io/).
5+
6+
[![](https://img.shields.io/npm/v/react-benzin?logo=npm)](https://github.com/eug-vs/react-benzin/releases)
7+
[![](https://img.shields.io/circleci/build/github/eug-vs/react-benzin?logo=circleci)](https://github.com/eug-vs/react-benzin/commits/develop)
8+
[![](https://img.shields.io/david/eug-vs/react-benzin)](https://github.com/eug-vs/react-benzin/network/dependencies)
9+
[![](https://img.shields.io/github/languages/code-size/eug-vs/react-benzin)](https://github.com/eug-vs/react-benzin/releases)
10+
[![](https://img.shields.io/npm/l/react-benzin)](https://github.com/eug-vs/react-benzin/blob/develop/LICENSE.md)
11+
12+
13+
# Getting started
14+
## Installation
15+
You can easily add **BENZIN** to your project with `npm`:
16+
```bash
17+
$ npm install react-benzin
18+
```
19+
**BENZIN** works best in kick-starting new projects and allows you to focus on the functionality, while all the beauty will be maintained by our library.
20+
21+
**TIP:** *Create-React-App with Typescript* is your GO-TO in most of the cases. [Learn more.](https://create-react-app.dev/docs/adding-typescript/)
22+
23+
![Preview screenshot](https://user-images.githubusercontent.com/51545008/73991116-46b04f00-495c-11ea-9733-865bcc6c8807.png)
24+
25+
You can find a minimal usage example [here](src/index.tsx).
26+
27+
## Functionality
28+
**BENZIN** provides you with a bunch of cool components that greatly integrate with each other.
29+
30+
[Explore](src/lib) `src/lib/` folder to see what's available. Documentation is yet to come, but for now you can enjoy type definitons.
31+
32+
[Chrono-Cube](https://github.com/eug-vs/chrono-cube/) will also be a great example of usage, since it's the actual project which inspired us to create **BENZIN**.
33+
34+
35+
# Explore NPM package online
36+
https://www.npmjs.com/package/react-benzin
37+
38+
39+
# Development
40+
## Running live demo
41+
To run a live example, clone a repo and execute following commands:
42+
```bash
43+
$ npm i
44+
$ npm start
45+
```
46+
It's worth noticing that presence of React-App in this repo forces us to split some configurations. For example, we have 2 `Typescript` configs: one for `react-scripts` to run live-demo, and the other one to build *distribution files*.
47+
48+
## Running tests
49+
```bash
50+
$ npm test
51+
```
52+
**NOTE**: this command assures that `ESlint` does not throw any warnings and exits with a *non-zero status code* otherwise. That means `CircleCI` tests would fail *even if a single warning is present*. Therefore, you should always locally test your changes before publishing them.
53+
54+
## Building
55+
We've decided to use `Typescript compiler` to transpile our code, since we think `Babel` is a bit of an overkill here.
56+
```bash
57+
$ npm run build
58+
```
59+
This command will generate `dist/` folder ready for distribution, which you of course can explore. Note that `tsc` creates type definitions (`.d.ts`) for every corresponding `.js` file. It's very useful because consumers also get access to them.
60+
61+
## Deploying
62+
Deploying to `npm` is fully automated through **CircleCI**: simply tag a commit as a Release and it will do the job.

0 commit comments

Comments
 (0)
Please sign in to comment.