Giter Site home page Giter Site logo

davidctj / ui-react-module-typescript-storybook-jest Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 1.0 7 KB

Typescript, React, UI components module library, JEST tesing, Storybook rendering

Home Page: http://www.reactfrontend.com/build-react-ui-components-library-typescript-react-storybook-jest/

JavaScript 50.49% TypeScript 49.51%
storybook react jest javascript

ui-react-module-typescript-storybook-jest's Introduction

About

This project is an example for using Typescript, React to build UI components module, which could be used by other client typescript project.

This project will generate TypeDefinitions(*.d.ts) files for the UI components, thus providing code completion and type checking.

Libraries which used inside this project:

  • React
  • Typescript
  • Bootstrap@3
  • Storybook
  • Standard-version

Usage

  • Install dependencies
$ npm install -S bootstrap@3
$ npm i -S NPM-path/ui-widgets-ts
  • Import related assets in your project
// CSS Assets
import "bootstrap/dist/css/bootstrap.min.css";

// JS Assets
import "jquery";
import "bootstrap/dist/js/bootstrap.js";
  • Use components, e.g. Button
import { Button as MyTestBtn } from  "ui-widgets-ts";
or
import { Button as MyTestBtn } from  "ui-widgets-ts/dist/Button";

...
<MyTestBtn type="danger">My Test Button</MyTestBtn>
...

Development

  • Open first terminal
$ npm install
$ npm run watch
  • open second terminal
$ npm run build
$ npm run storybook

visit: http://localhost:9001/

Folder src is all the place we write our components

Folder storybook is the place we view/test our components. New component should always be added as stories in the react-storybook.

Test

JEST framework.

Create files *.(test|spec).tsx under src folder and then write test code. Code coverage must be fulfilled.

$ npm run test

Production build

  • npm run build This /dist folder could be used as the module dependency such as in NPM, or in Github Repo

ui-react-module-typescript-storybook-jest's People

Contributors

davidctj avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

tomjal

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.