Giter Site home page Giter Site logo

icgc-argo / uikit Goto Github PK

View Code? Open in Web Editor NEW
1.0 10.0 2.0 14.69 MB

Re-usable React Components for ICGC-ARGO sites

License: GNU Affero General Public License v3.0

TypeScript 99.57% JavaScript 0.35% Handlebars 0.08%
hacktoberfest icgc icgc-argo react storybook typescript

uikit's Introduction

ARGO UIKit

Netlify Status Storybook npm version TypeScript

Reusable UI components for ARGO projects.

Development

Local Dev

UIKit:

  • Install dependencies: npm ci
  • Start watching: npm run watch

Consumer project:

  • npm i <root_path_to_uikit>/dist --legacy-peer-deps

Notes:

  • make sure to run watch first as dist folder is used
  • assets will require a restart of watcher
  • typescript changes often need vscode to restart the TS server
  • avoid default exports for anything that needs to be used by 3rd party

Testing

react-testing-lib with Jest test runner see Button.test.tsx for example

Storybook

  • npm run storybook
  • npm run build-storybook creates static storybook build in ./storybook-static

Component Boilerplate

  • creating a new component: npm run create-component

Type checking

  • npm run type-check: trigger TypeScript type check for whole repo
  • npm run type-check -- --watch: runs the above with watch mode
    • Any npm run type-check triggers tsc, so any flag layed out here can be used
  • If using vscode (recommended), tsc can also be run as a task in the editor:
    • Cmd+Shift+B, then select tsc:build - tsconfig.json
    • This will report errors in vscode's PROBLEMS tab

Publish to npm:

  1. Increase version under uikit/package.release.json
  • Automated process (recommended)

    1. Merge that change to develop, and let the Jenkins pipeline handle it
  • Manual process (discouraged, but available)

    1. Run npm run build-uikit which performs the following:
    2. Run npm run publish-uikit to publish latest version to npm

Dependencies

react/react-dom are needed as dependencies for storybook project does not work if they are just defined as peerDeps

Storybook

Stories are written in the older storiesOf style https://github.com/storybookjs/storybook/blob/master/lib/core/docs/storiesOf.md

  • No explicit export from module required
  • Use a constant string for story name
    • Stories can break easily when you use dynamic vars as story name ${__dirname} (too many '/', diff OS)

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.