npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dogwood-components

v2.1.3

Published

Dogwood design systems

Downloads

8

Readme

# Essential Packages and Tools for Building a Reusable UI Component Library for Dogwood

When creating a reusable UI component library with TypeScript for Next.js, you might need to include and configure several essential packages and tools to ensure the library is well-documented, tested, and easily maintained. Here are some of the essential packages and tools you can consider adding:

## 1. Documentation and Type Declarations

```bash
npm install typedoc @types/react @types/node --save-dev
  • TypeDoc:

    • Purpose: To generate API documentation for your components.
    • Why: Clear and comprehensive documentation helps users understand how to use your components effectively.
  • @types/react:

    • Purpose: For TypeScript type declarations for React.
    • Why: TypeScript type declarations improve code quality, provide auto-completion, and catch type-related errors during development.
  • @types/node:

    • Purpose: For TypeScript type declarations for Node.js.
    • Why: Type declarations for Node.js enable type-safe interactions with server-side code in Next.js.

2. Testing and Development

npm install jest @testing-library/react @testing-library/react-hooks @testing-library/jest-dom --save-dev
  • Jest:

    • Purpose: A popular testing framework for JavaScript/TypeScript.
    • Why: Jest simplifies unit and integration testing, ensuring your components work as expected.
  • react-testing-library, @testing-library/react-hooks, @testing-library/jest-dom:

    • Purpose: For testing React components, hooks, and extending Jest matchers.
    • Why: These libraries enhance testing capabilities, making it easier to write effective tests for your components.

3. Build and Bundling

npm install @babel/core rollup @rollup/plugin-typescript @rollup/plugin-commonjs @rollup/plugin-node-resolve --save-dev
  • @babel/core:

    • Purpose: For transpiling TypeScript and JSX.
    • Why: Transpilation ensures compatibility across different JavaScript environments.
  • rollup:

    • Purpose: For bundling your library.
    • Why: Rollup bundles your components into a single file for efficient distribution.
  • @rollup/plugin-typescript, @rollup/plugin-commonjs, @rollup/plugin-node-resolve:

    • Purpose: These plugins provide TypeScript support, handle CommonJS modules, and resolve Node.js modules.
    • Why: They enable seamless integration and bundling of TypeScript code in your library.

4. Linting and Formatting

npm install eslint prettier --save-dev
  • ESLint:

    • Purpose: For linting TypeScript and JavaScript code.
    • Why: Linting enforces coding standards, improving code quality and readability.
  • Prettier:

    • Purpose: For code formatting.
    • Why: Code formatting ensures consistent and clean code style throughout your project.

5. Husky and lint-staged

npm install husky lint-staged --save-dev
  • Husky:

    • Purpose: For enforcing code quality and formatting on pre-commit.
    • Why: Husky prevents the commit of code that doesn't meet your defined standards.
  • lint-staged:

    • Purpose: Run linting and formatting checks on staged files before committing.
    • Why: Ensures that only properly formatted and linted code is committed.

6. Publishing and Versioning

npm install np --save-dev
  • np (Package Publisher):

    • Purpose: A tool for easy npm package publishing.
    • Why: Simplifies the process of releasing updates and versions of your library.
  • Semantic Versioning:

    • Purpose: Follow semantic versioning for your package versions.
    • Why: Semantic versioning provides clarity about the compatibility and impact of library updates.

7. Continuous Integration (CI)

  • Purpose: Configure CI tools like Travis CI or GitHub Actions to automate testing and deployment processes.
  • Why: CI ensures that your code is continuously tested and deployed, maintaining high quality and reliability.

8. Documentation Generation

  • Purpose: Configure TypeDoc to generate documentation for your components and use a tool like GitHub Pages to host it.
  • Why: Documentation is crucial for users to understand how to use your components effectively.

9. Peer Dependencies

  • Purpose: Define any peer dependencies that your library relies on, such as React.
  • Why: Specifying peer dependencies ensures compatibility and helps users understand which dependencies they need to install.

In addition to these essential packages and tools, you should also consider setting up a version control system (e.g