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

adam-components-library-test

v0.1.29

Published

my comp library

Downloads

11

Readme

TVO Component Library

Run application: npm run dev

Rebuilding the library

OLD WAY Run npm run rebuild from root. build is the default command for Next.js, hence the use of rebuild

Rebuild works by leveraging webpack.config.js, which leverages a different sequence of build commands to produce the components-library in /dist.

NEW WAY The build process is likely NOT necessary. At the moment I am passing raw JSX in the components folder within the package. No webpack transpiling and bundling is required for this. Of course, this means we don't get a minified package. But the advantages are that the receiving Next.js app's build environment parses the file and builds it, meaning the components can leverage the native environment of the app they will be built on.

The package.json configuration "files": [] dictates what files will end up in the build. Note that the /dist folder is always included, be it specified or not.

Publishing the library

Be sure to increment the version value in package.json: "version": "0.1.17". Run npm publish to publish to NPM. We will be changing this soon!

Using the library

Consuming applications will have to run the npm i {package-name} to install the package. To get the latest, consuming applications should run npm i {package-name}@latest. The consuming app's package.json should display the latest version for the package under dependencies.

Troubleshooting

If the package does not increment, the consuming app might need to run npm cache clean --force, although this should be avoided when possible. If issues remain, uninstall and reinstall the package.

Husky

Official docs

Husky is completely optional. It can hook into git, to rum commands before certain actions like commits and pushes.

From root, run npx husky init

In ./.husky, copy files pre-commit and pre-push, and remove the ".example" from both of them. Feel free to modify these files to your heart's content, as they're not committed to version control.

If at any point Husky is getting in the way, simply add .off to your pre-commit and pre-push files, or comment out their contents, or delete the files entirely

(I have Husky setup to use lint-staged, so only staged files will be passed through Prettier and Next's linter)

Webpack + Babel vs SWC

SWC is now the default compiler and bundler for Next.js. However, introducing Webpack, like this project does, makes Webpack the default compiler and bundler.