dabing-ph
v0.0.2
Published
Re-usable React components from the PH design system
Readme
PH-NPMLIB-UI
Setup and commands for developing
Install dependencies
yarn install
Run the project
yarn storybook
Build the package
yarn build
(Optional) Import the built components locally
Ref: Hook don't work with yarn link
- run
yarn buildto build the components - run
yarn linkto link this package locally, for other projects to use - navigate into
node_modules/reactin top root path, runyarn linkto link this package locally - navigate into
node_modules/react-domin top root path, runyarn linkto link this package locally - create a new React project with `antd` installed, or open a existing one
- run
yarn link @ph/uiin that React project - run
yarn link reactin that React project - run
yarn link react-domin that React project - import
antd/dist/antd.cssORantd/dist/antd.lessin that top level of React project - import
@ph/uiin consuming app, and if you still meet thehooks can only be called inside...error, please refer this solution
Pre-commit
The pre-commit hook is already set to run the tsc, lint, prettier and jest automatically, the settings are in `package.json` (husky & lint-staged).
You can run the eslint and the prettier manually with yarn lint, yarn prettier, and fix the errors by yarn prettier:fix.
Test
yarn test
Debug
see `debug-example.mp4`
Articles/Repo for reference
general
- https://medium.com/@dennisschneider/how-to-create-a-react-component-library-with-typescript-rollup-js-and-storybook-cc3fe95c9c44
- https://blog.harveydelaney.com/creating-your-own-react-component-library/#existing-component-libraries
- https://github.com/jaebradley/example-rollup-react-component-npm-package
- https://github.com/HarveyD/react-component-library
peer-dependencies
storybook
jest
