Powerful library template for enhancing React applications with pre-configured components and utilities.
Streamline your React development with a suite of tools and components. Focus on crafting your applications while this library handles intricacies with features like FontAwesome icons, headless UI components, heroicons, and more.
- FontAwesome Integration: Embed FontAwesome icons with ease.
- Headless UI & Heroicons: Upgrade your apps with adaptable UI components and icons.
- CSS Management: Seamlessly style with PostCSS and TailwindCSS.
- Testing & Linting: Adopt Jest and ESLint for top-tier testing and pristine code quality.
npm install @jonmatum/my-react-library
Incorporate components and utilities effortlessly:
import { SomeComponent, SomeUtility } from "@jonmatum/my-react-library";
Detailed documentation on components and utilities is on its way. Stay tuned!
npm run release
: Version management withstandard-version
.npm run build
: Library bundling via Rollup.npm run build:css
: Generate CSS using PostCSS.npm run watch:css
: Continuous CSS builds on changes.npm run test
: Test suites execution with Jest.
Alter styles in src/styles.css
for personalization.
Ready to be published on GitHub's npm registry. Verify your permissions and credentials beforehand.
Maintain the highest quality and consistency using Husky for git hooks. The pre-commit
hook plays a vital role, ensuring linting and formatting precede every commit.
-
Install:
npm install husky --save-dev
-
Configuration:
Located in
package.json
:"lint-staged": { "*.ts": [ "eslint --fix", "prettier --write" ] }
-
Activation:
With configurations in place, Husky activates the
pre-commit
hook automatically.
- Commit Process: Address any ESLint or Prettier errors that halt commits.
- Bypassing: In special cases, use the
--no-verify
flag to skip checks. Use sparingly!
For optimal results, keep Husky configurations updated. Refer to the Husky documentation for the latest best practices.
Ensuring resilience and dependability is paramount. Our commitment to rigorous testing ensures this library's excellence.
- Primarily powered by Jest.
- Complemented with @testing-library/react and @testing-library/user-event for genuine user interactions.
- Tests for every component/utility are mandatory.
- Strive for extensive coverage, considering all potential scenarios.
- Isolate tests by mocking unrelated external functionalities or dependencies.
npm run test
Consider CI for extensive changes to automate testing with every push.
Ensure all new or altered components are thoroughly tested before proposing.
Testing goes beyond mere code coverage. It's about reliability. Value it!
Essential dependencies:
- FontAwesome for icons.
@headlessui/react
&@heroicons/react
for UI tools.- The foundational React & ReactDOM.
For a full list, see package.json
.
ISC License.
Open to contributions and suggestions! Report issues or propose enhancements.
Crafted with ❤️ by Jonatan Mata.