A boilerplate for all the mdo react components
All operations is to publish mdo-react-components
- git checkout develop in local
- git pull (updated develop)
- git checkout -b
- git checkout master
- git pull (updated master)
- git checkout
- git rebase master (merged master to )
- if there is conflict, solve it
- increase one version patch(third number) number in package.json
- git push
- compare with develop in remote(github web page)
- After approval, merge to develop in remote
- create new pr to compare master with develop in remote. This step shouldn't have any conflict because we already solved it.
- After two approvals, merge develop to master.
> yarn install
After each change to this repository, please rebuild the boilerplate to make the changes effective using below command
> yarn build
https://github.com/whitecolor/yalc
> yalc publish
> cd example && yalc add mdo-react-components
> yarn test
Here is the default folder and files structure for each component:
- components
-- Example
--- Example.js - this is component implementation
--- styled.js - styles are here, we are using
styled-components
library --- index.js - import Example.js and maybe other components in this folder and then export them --- tests - folder with tests ---- Example.spec.js - tests for the component
When developing components follow the guideliens outlined here:
- https://docs.google.com/document/d/1vs0f9hTi0FQxebNZmcGE6bM4SgQcSUvr4yff-kCnWjM/edit?usp=sharing
- https://docs.google.com/document/d/1OeltaBvGRRV5f7z9Oe_rQt65NMqS3TYSfzAO3aDgIF4/edit?usp=sharing
Quick component example is below.
import React, { memo } from "react";
import PropTypes from 'prop-types';
const Example = memo((props) => {
const { prop1, prop2 } = props;
return (
<div>
Something Here
</div>
)
});
Example.displayName = 'Example';
Example.propTypes = {
prop1: PropTypes.number.isRequired, // try to limit the number of required props
prop2: PropTypes.string
...
};
Example.defaultProps = {
prop2: 'Default', // Default props only for not required props
}
import Example from 'Example';
export default Example;
In your application just import the components:
import { DataTable, CheckBox, /* other components */ } from "mdo-react-components";
Follow the guidelines outlined here: https://docs.google.com/document/d/1xZEeuOBfb6nFdhGzNyCuOPrT2CLTZiskRSKaIbD71ys/edit?usp=sharing
As soon as you Each pull request must pass a review from another contributor and also pass the automated tests.
- NPM Modules
- Yarn
- Yalc
- React
- Jest
- React Testing Library
- Styled-Components
- Styled-System
- Material UI
- CircleCI
This repository is protected under the MIT License