Giter Club home page Giter Club logo

react-workshop-component's Introduction

react-workshop-component

Component for React.js Workshop.

Table of Contents

  1. Installation
  2. Develop
  3. Demo
  4. Testing
  5. Build bundles
  6. Create Version
  7. License

1. Installation

Install all the dependencies for the project.

npm install

2. Develop

Runs a development server at https://localhost:8080 and use Hot Module Replacement. To override the default host and port through env (HOST, PORT)

npm start

3. Demo

Runs a server to show the library demo at https://localhost:8080. To override the default host and port through env (HOST, PORT)

npm run demo

4. Testing

Using Karma as test runner, mocha as test library and chai as assertions library.

To run test once:

npm test

To run tests with watcher:

npm run test:tdd

To run both:

npm run test:all

5. Build bundles

Generate library bundles without minification

npm run dist:normal

Generate library bundles minificated

npm run dist:min

Generate both, minificated and normal, library bundles

npm run dist

6. Create Version

Updates /dist and package.json with the new package version and create a version tag to Git

npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]

Example:

npm version patch -m "Upgrade to %s for reasons"

Important: Change package.json info to you own and change Library config at webpack.config.babel.js:

const config = {
  paths: {
    dist: path.join(ROOT_PATH, 'dist'),
    src: path.join(ROOT_PATH, 'src'),
    demo: path.join(ROOT_PATH, 'demo'),
    dev: path.join(ROOT_PATH, 'src/app.js'),
  },
  filename: pkg.name,
  library: 'DumbComponent',
};

Important: If you are using external dependencies, you will need to include them into webpack externals. Like the example below:

var webpackConfig = {
  // Other options ...
  externals: {
    react: {
      commonjs: 'react',
      commonjs2: 'react',
      amd: 'React',
      root: 'React',
    },
  }
  // ... Other options
}

7. License

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

react-workshop-component's People

Contributors

asdelday avatar

Watchers

 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.