3.0.0 • Published 7 years ago

react-npm-component-boilerplate v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

Travis

Boilerplate for creating React-component npm package with ES2015

Starter point for creating React components that you can published on Npm.

Updated to use Webpack 3, Jest 21 and React 16!

Usage

  1. Install module as global

    yarn global add react-npm-component-boilerplate

  2. Create your template

    react-npm-component-boilerplate your-component-name

    • Or if you want to autoset links in package.json add username

      react-npm-component-boilerplate -u your-github-username your-component-name

  3. Step into your created template

    cd your-component-name

  4. Check package.json so that the information is correct.

  5. Install modules with

    yarn

  6. Start example and start coding!

    yarn start


Extra

  • If you want to run tests:

    yarn test

  • You need to write tests in __tests__ folder or as .test.js.
  • It you want to keep watch run:

    yarn test-watch

  • If you want coverage run:

    yarn test-coverage

  • If you want to run eslint:

    yarn lint

  • If you want to automatically fix lint problems run :

    yarn lint-fix

    Adjust your .eslintrc config file to your own preference.

NPM equivalent

yarnnpm
yarn global add react-npm-component-boilerplatenpm install -g react-npm-component-boilerplate
yarnnpm install
yarn testnpm run test.
yarn test-watchnpm run test-watch
yarn test-coveragenpm run test-coverage
yarn lintnpm run lint
yarn lint-fixnpm run lint-fix

To test your created component in another project

If you want to test if it works correctly in another project you can use npm npm install -S ../mytest-component Note the relative path and name of module E.g. this folder structure

    ./workspace/
        MyProject
        react-npm-boilerplate

License

MIT


Credit

Documentation is inspired by Julian Ćwirko and the https://github.com/juliancwirko/react-npm-boilerplate package.

3.0.0

7 years ago

2.4.4

7 years ago

2.4.3

7 years ago

2.4.2

7 years ago

2.4.1

7 years ago

2.4.0

7 years ago

2.3.0

7 years ago

2.2.1

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago