Skip to content

Commit 6bc3c51

Browse files
author
Andrei Arkhipov
authored
Merge pull request #7 from awibox/develop
#6: README.md was filled
2 parents b8124b7 + f735412 commit 6bc3c51

File tree

3 files changed

+102
-8
lines changed

3 files changed

+102
-8
lines changed

README.md

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,83 @@
1-
# react-npm-package-template
1+
![react-npm-package-template](https://repository-images.githubusercontent.com/236028186/e0034e00-3ee4-11ea-8676-b3f80c86678a)
2+
3+
<p align="center">
4+
<a href="https://www.npmjs.com/package/react-npm-package-template">
5+
<img src="https://img.shields.io/npm/v/react-npm-package-template" alt="npm version">
6+
</a>
7+
<a href="https://travis-ci.org/awibox/react-npm-package-template">
8+
<img src='https://travis-ci.org/awibox/react-npm-package-template.svg?branch=master' alt='Build' />
9+
</a>
10+
<a href='https://coveralls.io/github/awibox/react-npm-package-template?branch=master'>
11+
<img src='https://coveralls.io/repos/github/awibox/react-npm-package-template/badge.svg?branch=master' alt='Coverage Status' />
12+
</a>
13+
<a href="https://www.npmjs.com/package/react-npm-package-template">
14+
<img src="https://img.shields.io/npm/dm/react-npm-package-template" alt="Downloads">
15+
</a>
16+
<img src="https://img.shields.io/github/license/awibox/react-npm-package-template" alt="license">
17+
</p>
18+
19+
## Table of contents
20+
* [How to install](#howtoinstall)
21+
* [Initializing the package](#initializing)
22+
* [Rename a component](#rename)
23+
* [Build of the package](#build)
24+
* [Publishing a package](#publish)
25+
* [Travis CI](#travis)
26+
* [Coveralls](#coveralls)
27+
* [Badges in the readme](#badges)
28+
29+
<a name="howtoinstall"></a>
30+
## How to install
31+
You can use this project like template.
32+
To do this, you need press button "**Use this template**".
33+
34+
Or clone repository and go to the project folder.
35+
```bash
36+
git clone https://github.com/awibox/react-redux-app-boilerplate.git ProjectName
37+
cd ProjectName
38+
```
39+
Then you should install required dependencies.
40+
```bash
41+
yarn install
42+
```
43+
<a name="initializing"></a>
44+
## Initializing the package
45+
The first step is to initialize your package. You should execute following command:
46+
```bash
47+
npm init
48+
```
49+
And fill in the required fields (package name, version, license). You can correct the other fields manually in the **package.json**.
50+
51+
<a name="rename"></a>
52+
## Rename a component
53+
The next step is to replace the ```YourComponentName``` in the entire project with the one you need.
54+
55+
<a name="build"></a>
56+
## Build of the package
57+
After writing the code you need to build the package with the following command:
58+
```bash
59+
yarn build
60+
```
61+
62+
<a name="publish"></a>
63+
## Publishing a package
64+
To publish a package, run the command:
65+
```bash
66+
npm publish
67+
```
68+
If you are not logged in to npm you should run the command before publishing:
69+
```bash
70+
npm login
71+
```
72+
73+
<a name="travis"></a>
74+
## Travis CI
75+
For **Travis CI** to work you need to register on the [site](https://travis-ci.org/) and connect the repository.
76+
77+
<a name="coveralls"></a>
78+
## Coveralls
79+
For **Coveralls** to work you need to register on the [site](https://coveralls.io/) and connect the repository.
80+
81+
<a name="badges"></a>
82+
## Badges in the README.md
83+
For **badges** to work you need to change the repository name in the link and image paths.

package.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-npm-package-template",
33
"version": "1.0.0",
4-
"description": "",
4+
"description": "The template that will help you quickly start developing your NPM package for React",
55
"main": "./dist/index.js",
66
"scripts": {
77
"build": "webpack --mode production",
@@ -15,10 +15,16 @@
1515
"url": "https://github.com/awibox/react-npm-package-template.git"
1616
},
1717
"keywords": [
18-
"timeline",
19-
2018
"react-component",
21-
"npm-package"
19+
"npm-package",
20+
"template",
21+
"css-modules",
22+
"jest",
23+
"eslint",
24+
"travis-ci",
25+
"coveralls",
26+
"webpack",
27+
"scss"
2228
],
2329
"author": "awibox",
2430
"license": "MIT",
@@ -58,7 +64,10 @@
5864
"react-dom": "^16.12.0"
5965
},
6066
"jest": {
61-
"collectCoverageFrom": ["src/**/*.{js,jsx,mjs}", "!src/index.js"],
67+
"collectCoverageFrom": [
68+
"src/**/*.{js,jsx,mjs}",
69+
"!src/index.js"
70+
],
6271
"testEnvironment": "node",
6372
"moduleFileExtensions": [
6473
"js",

src/styles/YourComponentName.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
$fontSize: 14px;
2+
$color: #000;
3+
14
.text {
2-
color: black;
3-
font-size: 14px;
5+
color: $color;
6+
font-size: $fontSize;
47
}

0 commit comments

Comments
 (0)