SiteOne Frontend Hooks
What is inside
Install
$ yarn add @siteone/frontend-hooks
Testing
$ yarn test
Find more here
Publish
First, You need to have the rollup
$ npm install --global rollup
Then
- increment version in package.json
- push to gitlab
- run deploy:
$ yarn build
$ npm publish --access public
Contribution rules
Each hook must contain
- README.MD
- [hook].spec.js
- [hook].js file
then add to src/main.js
import [hook] from './[hook]/[hook].js
export {
...,
[hook]
}
Name conventions
The name of the hook must always start with "use" so that it can be seen at first glance that it is subject to [Hook's rules] (https://reactjs.org/docs/hooks-rules.html).