• Stars
    star
    357
  • Rank 119,149 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Boilerplate for React.js components (MIT)

build status Dependency Status

react-component-boilerplate - Boilerplate for React.js components

This is a simple boilerplate that has been developed to make it easier to develop React components and small projects.

Check out SurviveJS - Webpack and React to dig deeper into the topic.

Basic Usage

Clone the repo : git clone https://github.com/survivejs/react-component-boilerplate my-component.

To get started with fresh history, do this:

  1. cd my-component
  2. rm -rf .git (or in Windows rmdir .git /S /Q) - Remove Git database
  3. git init - Initialize a new Git repository
  4. git add . - Add all files to staging
  5. git commit -am "Initial commit" - Commit the files

After this you should push the project to some remote.

If you want to replace project meta information (author etc.), consider using a tool like replace-project-meta.

Common Tasks

  • Developing - npm start - Runs the development server at localhost:8080 and use Hot Module Replacement. You can override the default host and port through env (HOST, PORT).
  • Creating a version - npm version <x.y.z>.
  • Publishing a version - npm publish - Pushes a new version to npm and updates the project site.

Testing

The test setup is based on Jest. Code coverage report is generated to coverage/. The coverage information is also uploaded to codecov.io after a successful Travis build.

  • Running tests once - npm test
  • Running tests continuously - npm run test:watch
  • Running individual tests - npm test -- - Works with test:watch too.
  • Linting - npm run test:lint - Runs ESLint.

Documentation Site

The boilerplate includes a GitHub Pages specific portion for setting up a documentation site for the component. The main commands handle with the details for you. Sometimes you might want to generate and deploy it by hand, or just investigate the generated bundle.

  • Building - npm run gh-pages - Builds the documentation into ./gh-pages directory.
  • Deploying - npm run deploy-gh-pages - Deploys the contents of ./gh-pages to the gh-pages branch. GitHub will pick this up automatically. Your site will be available through *.github.io/`.
  • Generating stats - npm run stats - Generates stats that can be passed to webpack analyse tool. This is useful for investigating what the build consists of.

Highlighting Demo for the Site

var a = 5;
var b = 10;

// just trying out code highlighting feature here
console.log(a + b);

License

react-component-boilerplate is available under MIT. See LICENSE for more details.

More Repositories

1

webpack-merge

Merge designed for webpack
TypeScript
2,675
star
2

webpack-book

From apprentice to master (CC BY-NC-ND)
JavaScript
2,418
star
3

react-book

From apprentice to master (CC BY-NC-ND)
JavaScript
2,019
star
4

js_tricks_and_tips

JavaScript tricks and tips
JavaScript
121
star
5

maintenance-book

”SurviveJS — Maintenance” book
JavaScript
111
star
6

react-boilerplate

Boilerplate for the "SurviveJS - React" book
JavaScript
73
star
7

site

survivejs.com
JavaScript
68
star
8

sidewind

Tailwind but for state
TypeScript
67
star
9

audio-katas

Web Audio katas
TypeScript
53
star
10

webpack-presets

Shareable configuration presets for Webpack (MIT)
JavaScript
24
star
11

tailspin

Site generator and design system in one
TypeScript
20
star
12

ama

Ask me anything Webpack and React related at Issues
19
star
13

babel-preset-survivejs-kanban

Babel preset for SurviveJS Kanban application (MIT)
JavaScript
15
star
14

cycle-starter

Starting point for Cycle.js projects (MIT)
JavaScript
11
star
15

qwik-katas

A series of katas to learn Qwik quickly
TypeScript
8
star
16

react-for-awesome-people

React for awesome people presentation slides (MIT)
JavaScript
6
star
17

prism-languages

Prism languages in an easy to consume format (MIT)
JavaScript
6
star
18

leanpub

Simple Node.js client for Leanpub API (MIT)
JavaScript
4
star
19

leanpub-cli

CLI Client for Leanpub (MIT)
JavaScript
4
star
20

media

SurviveJS media files
3
star
21

website-v2

TypeScript
3
star
22

slides

SurviveJS slides
JavaScript
3
star
23

website-cf-assets

Cloudflare assets of the website
TypeScript
2
star
24

deno-katas

A series of katas to learn Deno quickly
TypeScript
2
star
25

javascript-quo-vadis

Redirect
JavaScript
1
star
26

how-to-write-a-book-and-survivejs-it

Redirect
HTML
1
star
27

javascript-in-2016

Redirect
HTML
1
star
28

styleguide

SurviveJS Writing Guidelines
1
star
29

state-management-in-react

Redirect
HTML
1
star