Giter Club home page Giter Club logo

component-library's Introduction

component-library

Build Status semantic-release

Living Styleguide by Grid Singularity

Licensed under GNU LESSER GENERAL PUBLIC LICENSE

Usage

For react based applications

Install the gsy component library package from npm

npm install -s gsy-component-library

Now you should have in your node modules a folder from gsy-component-library which contains a build folder. In this build folder are all ready to use pre-compiled components. If you want to use one of them in a react render function just import the component you want to use:

import Button from 'gsy-component-library/build/'

Every component comes with its own, already included, css. Check out the storybook demo of the component to see prop and theming options and how to set them.

For using a theme you have to wrap the components in the themeprovider component and set the name of the theme.

Contribute

This repository is published under GLGPL-3.0, you can fork it and create Pull Requests to participate in the development of this library. Feel free to check out existing issues or create new issues if you discover a bug or miss some functionality.

Use angular commit message format to commit. This allows the automatic versioning to pick the right versionnumber.

How to develop for this repository

Clone repository & install dependencies

git clone https://github.com/gridsingularity/component-library.git
cd component-library
npm install

Start the storybook demo

npm run storybook

The demo will reload if you make edits. You will see the build errors and lint warnings in the console

Create new component

Create a new folder in /lib/components/MyComponent and a MyComponent.js and MyComponent.scss file

There you write your react component and the styling.

Write CSS for the component

These components are themeable with scss. In the file /lib/styles/themes.scss you can enter the variables for a new theme or see the variables of the other themes.

When writing scss for your component you should use these variables so the component is themeable.

Publish new version

Versioning is handled via the package semantic-release

A new version gets published after successfully merging a pull request to master. It s important to use correct commit-message syntax.

Deploy to heroku

on your working branch run npm run build-storybook this will create the static files inside .out folder. Commit and push your changes to your branch. Otherwise git will respond with 'No new revisions were found'.

For the deployment to heroku it needs to be merged into the deploy branch. This branch is a subtree of the master branch. Therefore you have to subtree split the .out folder into a new branch with the updated version name. git subtree split --prefix=.out -b version-123

You now should have a new branch which contains the contents of .out inside its main folder.

Then switch to deploy branch. The deploy branch contains the files of the .out folder plus a gitignore file and a different package.json to run it as a static-page. Now all you have to do is merge your newly created version branch. git merge version-123 --allow-unrelated-histories

you can check if your changes applied when running npm install npm run start

When you pushed the deploy branch the heroku deploy pipeline will automatically deploy this version.

External Libraries and packages

The used Icons are from material.io

component-library's People

Contributors

lelith avatar cfleschhut avatar alonavns avatar eleventhirtyfour avatar

Stargazers

Sun avatar

Forkers

airnauts lelith

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.