Coder Social home page Coder Social logo

react-color-picker-cra's Introduction

React Color Picker

A version of the React Color Picker that was bootstrapped with Create React App. Some built-in functionality of that skeleton was removed, specifically the offline caching.

This version demonstrates JSX, use of prop-types, testing with Jest/Enzyme, integrated ESLint, Continuous Integration via Travis-CI and deployment to Heroku.

Setup

Run npm install to install the dependencies.

Development

Testing

The tests use both Jest and Enzyme has described in the CRA documentation.

Enzyme was installed with:

npm install --save-dev enzyme enzyme-adapter-react-16 react-test-renderer

Linting with ESLint

The lint configuration built into CRA was extended with the AirBnB configuration based on this blog post. Using ESLint outside of react-scripts may not be supported, but appears to work.

The configuration was installed with:

npx install-peerdeps --dev eslint-config-airbnb

And the client .eslintrc.json file configured to use the AirBnB rules, and globally configured to allow JSX in .js files.

{
  "extends": "airbnb",
  "env": {
    "browser": true,
    "jest": true
  },
  "rules": {
    "react/jsx-filename-extension": [1, { "extensions": [".js", ".jsx"] }]
  }
}

The .eslintignore file is configured to exclude the CRA build directory.

Other rules are disabled in specific files.

The linter is run automatically by the CRA development server, or can be run manually with npx eslint . (or via npm run lint). Include the --fix option to eslint to automatically fix many formatting errors.

Deploying to Heroku

The color picker can be deployed to Heroku using the recommended BuildPack and process described here. Assuming you have already committed any changes, create and push the application to Heroku with:

heroku create --buildpack https://github.com/mars/create-react-app-buildpack.git
git push heroku master

To view the deployed application run heroku open.

react-color-picker-cra's People

Contributors

mlinderm avatar tpeterw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.