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

docgen-components

v0.0.29

Published

A collection of components for building UIs

Downloads

347

Readme

Docgen Components

A collection of components for building UIs

Local Development

npm run dev

Running Tests

npm run test

Running Storybook

npm run storybook

Local testing

Testing docgen-components

This guide provides step-by-step instructions for testing the docgen-components library in the portal-ui project using npm link and pnpm.

Steps

1. Prepare docgen-components (Component Library)

Open a terminal and navigate to your docgen-components directory:

cd /path/to/docgen-components

Build the library:

npm run build

Create a global link for the package:

npm link

2. Prepare portal-ui (Project)

Open a terminal and navigate to your portal-ui directory:

cd /path/to/portal-ui

Note: If the server is already running, you need to restart it.

Link the docgen-components package:

pnpm link /path/to/docgen-components

Note: Replace /path/to/docgen-components with the relative or absolute path to your docgen-components directory.

Example:

pnpm link /Users/alejandroortiz/Sideko/docgen-components

3. Update portal-ui's package.json

{
  "dependencies": {
    "docgen-components": "link:/path/to/docgen-components"
  }
}

Note: Replace /path/to/docgen-components with the relative or absolute path to your docgen-components directory.

4. Install dependencies in portal-ui

 pnpm install

5. Configure Tailwind CSS (if used)

Update portal-ui's tailwind.config.js:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    // ... other content configurations
    "./node_modules/docgen-components/**/*.{js,ts,jsx,tsx}",
  ],
  // ... rest of the config
};

6. Test and Verify

Open the portal-ui application in a browser and verify that the docgen-components are rendering correctly.

7.Making changes to docgen-components

When you make changes to docgen-components:

a. Build the library again:

npm run build

b. Restart the portal-ui development server to see the changes

8. Unlinking (when finished testing)

Run the following command in the terminal in the portal-ui directory:

  pnpm unlink docgen-components

Remove the link from the package.json file and replace it with the original docgen-components dependency:

{
  "dependencies": {
    "docgen-components": "current version example: 0.10.0"
  }
}

delete the pnpm-lock.yaml file to force the package to be reinstalled and then reinstall the dependencies:

rm pnpm-lock.yaml
pnpm install

In the docgen-components directory to unlink the package, run the following command in the terminal in the docgen-components directory:

npm unlink

This will remove the global link and allow you to install the package again.

Additional Tips

  • Ensure that both projects use compatible versions of React and other shared dependencies.
  • If you encounter any issues with hot reloading, you might need to restart the portal-ui development server after making changes to docgen-components.
  • For TypeScript projects, ensure that type definitions are correctly generated and included in the docgen-components build.

Publishing a new version

Once you have made changes, you can publish a new version of the package by merging your changes into the main branch