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

@viestimedia/clib

v1.4.4

Published

Component library boilerplate using [Vite](https://vitejs.dev/) as a build system.

Downloads

181

Readme

Viestimedia Component library

Component library boilerplate using Vite as a build system.

Confirmed to work with Remix 1.19 and Next 12

Local development

To link the library to a project locally, run the following commands:

npm install
npm run build
npm link

Then, in the project you want to use the library in, run:

npm link @viestimedia/clib

Now, when you build the library (npm run build), it should automatically update in the project you linked it to.

There's also a npm run build:watch option. So you don't have to manually run npm run build every time you make a change just to see it in the project you linked it to.

You can also work on the components in isolation by running npm run dev. Include your components in App.tsx to see them in action.

If npm link is giving you more trouble than it's worth, you can also just copy the library to the project you want to use it in.

# Assuming the library and the project are in sibling folders and you're at the root of the project

rsync -av --exclude .git --exclude node_modules ../clib node_modules/@viestimedia

# Next.js? May have to delete the .next cache / folder to see changes.
# Restarting the server might not be enough.

Troubleshooting

Chances are you will run into errors when npm linking the library to a project.

Changes not showing up in the project

If your changes aren't showing up, run npm run build in the library, and restart / rebuild the project you linked it to.

You might need to trigger a rebuild in the project you linked to to sync the changes.

Uncaught TypeError: Cannot read properties of null (reading 'useContext')

This is accompanied by https://react.dev/warnings/invalid-hook-call-warning

Most likely the library's React is not the same as the project's React.

Assuming the library and the project are in sibling folders, linking the project's React to the library should fix the problem:

npm link ../libraryconsumerproject/node_modules/react

Publishing

This library is automatically published on NPM by a GitHub action that creates a version tag and a new release based on that tag.

Easiest way to generate a tag is to navigate to https://github.com/viestimedia/clib/actions/workflows/generate-tag-and-release.yml, and click "Run workflow". Choose the version type (major, minor, patch). If the workflow is successful, it will release a new version to NPM after first creating a tag and a release with release notes.