Adding useClickOutsideCallback hook from 2u#50
Conversation
🚧 (@hzcore/hook-click-outside-callback) more docz, spiffy stylez pretty much done with this one, two snazzy examples and some prose, but need a little more work documenting proper typescript usage 🚧 (@hzcore/hook-click-outside-callback) polish wip fighting commitizen
| @@ -0,0 +1,23 @@ | |||
| { | |||
| "name": "@hzcore/hook-click-outside-callback", | |||
| "version": "0.0.1", | |||
There was a problem hiding this comment.
Maybe a short description from the README could be added here in a "description" field.
| ], | ||
| "dependencies": { | ||
| "mini-svg-data-uri": "^1.1.3" | ||
| } |
There was a problem hiding this comment.
I think we should add react to "peerDependencies", and "@babel/runtime" to dependencies, like:
| } | |
| }, | |
| "peerDependencies": { | |
| "react": "^16.8.0" | |
| }, | |
| "dependencies": { | |
| "@babel/runtime": "^7.4.4" | |
| } |
Rationale
React as a peer dependency because we depend on react, but we don't want to implicitly choose the version of React for the user's application by forcing install (nor do we want to risk introducing duplicate versions of React to the dependency tree!)
@babel/runtime as a dependency because we use @babel/plugin-transform-runtime when building hzcore packages, which will introduce the runtime as a dependency as part of the transform.
| @@ -0,0 +1,23 @@ | |||
| { | |||
| "name": "@hzcore/hook-click-outside-callback", | |||
| "version": "0.0.1", | |||
There was a problem hiding this comment.
One thing i've been doing to prep new packages for their first publish is to set the version to a major alpha, like:
| "version": "0.0.1", | |
| "version": "1.0.0-alpha.0", |
This results in lerna rolling us up to 1.0.0 automatically on first publish.
| "module": "es/index.js", | ||
| "typings": "src/index.tsx", | ||
| "license": "MIT", | ||
| "private": true, |
There was a problem hiding this comment.
We'll need to make the package 'public', even though we'll be publishing to a private registry:
| "private": true, |
| "!**/examples", | ||
| "!**/__test*" | ||
| ], | ||
| "dependencies": { |
There was a problem hiding this comment.
Looks likemini-svg-data-uri is only used in the example, which I think means it should be in "devDependencies":
| "dependencies": { | |
| "devDependencies": { |
| import Styles from './ReadmeStyles.tsx'; | ||
|
|
||
| # useClickOutsideCallback | ||
|
|
There was a problem hiding this comment.
I like to add a little description sentence here, like A react hook for <insert reason to use this package here>
|
|
||
| test('clickOutsideCallback is implemented', () => { | ||
| expect(() => clickOutsideCallback()).not.toThrow(); | ||
| throw new Error('implement clickOutsideCallback and write some tests!'); |
There was a problem hiding this comment.
We'll have to make this test pass before we publish. Nice to have: some more tests!
There was a problem hiding this comment.
I don't want to merge without tests, unless we have a pressing need for this component.
lettertwo
left a comment
There was a problem hiding this comment.
Looks like .DS_Store files have infected the branch. We should strip them from the repo (optionally, from the history entirely) and add them to the .gitignore:
https://stackoverflow.com/questions/107701/how-can-i-remove-ds-store-files-from-a-git-repository
I'd also recommend adding them to your global .gitignore config, since these files are never useful on any other system.
🚧 progress on adding 2u useOutsideClickCallback
🚧 (@hzcore/hook-click-outside-callback) more docz, spiffy stylez
pretty much done with this one, two snazzy examples and some prose, but need a little more work
documenting proper typescript usage
🚧 (@hzcore/hook-click-outside-callback) polish
wip fighting commitizen