template for npm package using typescript and react
stack | category | description |
---|---|---|
typescript | dev | for typescript, not javascript |
react | dev | for react, not vue angular... |
story book | test | for test on browser. builder is webpack |
jest | test | for unit test |
testing-library | test | for unit test of react |
eslint | static check | for lint |
prettier | static check | fix style automatically |
husky | static check | prevent to commit non checked code |
rollup | release | module bundler |
- update
xxx
on package.json - check your test targets. template has two jest config which are
jest.jsdom.config.js
andjest.node.config.js
. if you need both config you don't need to fix anything. but you need only one, you should delete another config and fixtest
script command on package.json.jest.jsdom.config.js
: for react componentjest.node.config.js
: for typescript library which run on node module
- delete sample code on
./src
./src/components/Button
: sample react component and test code../src/lib/script
: sample typescript library and test code.
If you release to npm, you should run below commands
yarn rollup
yarn login
yarn publish --access=public