react-dark-mode-toggle
react-dark-mode-toggle copied to clipboard
TypeScript/Rollup Rewrite
TypeScript/Rollup Rewrite
- Rewrote library in TypeScript
- Changed from default-export syntax to named-export syntax
- Rewrote Storybook config & stories in TypeScript
- Added Storybook prop controls & more stories
- Switched to the Rollup bundler
- Allows us to output both a CJS and an ESM bundle
- Allows us to compile
animationData.jsondirectly into the code
- Resolved issue #17
- Integrated
parse-unitdirectly into the library - Added
jest,ts-jest, and associated configuration for running tests withyarn test - Updated
react-lottie-playerto the latest version - Added pre-commit git hook to format all changed files w/
prettierbefore committing- Ensures we never have to look at formatting changes in a git diff
- Added pre-commit git hook to compile the entire library before committing
- Makes it impossible to commit code that does not compile
- Updated
README.md - Removed a lot of unused dependencies
- Removed
yarn.lockfrom.gitignoreand committed it - Added
.storybookand.babelrcto.npmignore - Bumped to
1.0.0 - Moved
react-lottie-playertopeerDependencies - Added
reactandreact-domtopeerDependencies
Okay, I believe I'm done with my changes. Recent:
- All files are now TypeScript, even the config files
- Library also now requires all tests to pass before
git commitwill succeed
I'll be around this weekend if you have questions about any of these changes.
I've moved react and react-dom and react-lottie-player to peer-dependencies, reducing the bundle size. CJS bundle is less than 90 lines and ESM bundle is less than 60.
That's my final change, I swear 😄
Could someone create a canary/dev release so I can test?
@cawfree Any chance you could take a look at this? I can rebase if that helps.