user-mgmt-shared
v1.1.2
Published
Enhanced common components built with React and Material UI
Downloads
16
Readme
user-mgmt-shared
Enhanced common components built with React and Material UI
Develop
Need to use Node version 10+.
Put all component .js files under src.
Add component export to src/index.js, such as
export { default as SimpleTable } from './SimpleTable'
nvm install v12.18.3 // require Node v10+
npm run prepare // build the library components
npm start // continue watching and building for changes
Test
Testing scripts are located in jest/specs, using Jest and React Testing Library.
Following packages are used by testing scripts and should be excluded from build.
Put them to peerDependencies in package.json:
"peerDependencies": {
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"react-csv": "^2.0.3",
"react-tooltip": "^4.2.10"
},
npm run jest // run test using Jest
npm run jest -- --watchAll=true // run Jest under interactive mode
Publish to NPM
cd user-mgmt-shared
npm login
(Increase "version" in package.json to be higher than the latest npm package version)
npm publish
Install
npm install --save user-mgmt-shared
Usage
import { DatePicker, DropdownSelector, EnhancedButton, RadioGroup } from 'user-mgmt-shared'
import { SimpleTable, TaggedBorder } from 'user-mgmt-shared'
import { ConfirmationPopper, NotificationPopper } from 'user-mgmt-shared'
import 'user-mgmt-shared/dist/index.css'