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

@lolaihung/mh-ui-library

v2.1.1

Published

MH UI library for NPM or Github Packages

Downloads

36

Readme

MH-UI-LIBRARY

The objective of MH-UI-Library is to serve as a common component library to be consumed in all the admin portal projects.

Key benefits of this library :

  1. Efficieny : speed up development as it is now easily import as a library and ready to used
  2. Consistency : standardize all the components designs as per in figma
  3. Centralized Changes : Any updates on the components will need to be made on this library only

The library is adopting the Atomic Design methodology. This apporach will help in creating more modular, maintainable, and scalable components.

  1. Atoms : Basic components like input field, button, label etc
  2. Molecules : A group of atoms functioning together to build functionality. Eg, a form input with label and button
  3. Organisms : More complex components that are composed of molecules and/or atoms. Eg, navigation bar

Pre-requisites for Development

  • Node.js installed (version 18.x or higher)
  • npm account and npm CLI installed

Quick Start on Library Development

A. Setting up in your local

  1. Get the latest source code from Github and run pnpm i
  2. Execute pnpm storybook to view all the available components

B. Development Best Practises

  1. Make sure the components are flexible and customizable (eg, prepare className prop to enable customization)
  2. Make sure the components are behaving the same and have the same design as per the design figma
  3. Make sure every compoent has its own story to showcase in storybook
  4. Make sure the story created covers all the props and behaviours that would explain how it works, and how it is to be consumed

C. How to test in your local

There are 2 ways of testing in your local :

  1. Publish your package via NPM. This requires you to go through all the steps in How to publish your package, which is NOT recommended as you will need to merge your changes into main branch first
  2. Link your library and consumer project in locally :
  • Executes pnpm build in mh-ui-library
  • Make sure the output in the dist folder of mh-ui-library is updated with the latest changes
  • Go to the package.json of your consumer project and update the mh-ui-library package with link:../mh-ui-library
  • Eg, "@lolaihung/mh-ui-library": "link:../mh-ui-library", depending on the directory level, in this example case, the consumer project and mh-ui-library folders located in the same level
  • Executes pnpm i in the consumer project (might need to remove node_modules sometimes before executing the command)
  • Make sure the mh-ui-library in the node_modules of consumer project is updated with the latest changes in the library
  • You may use/test the components in your consumer project!

D. How to publish your package

  1. Please take note that the best practise is to always publish a beta/stable version based on the main branch
  2. Meaning to say, you will have to merge your changes into main branch before you can publish the package
  3. Bump the version, depending on the changes made
  1. It's very easy to publish manually, just get latest of the main branch, execute pnpm build, then after that run pnpm publish
  2. If the above commands failed, make sure you are logged-in in your terminal. Execute pnpm login if needed.

How to consume the library

  1. Treat it as just a normal dependency/library/framework that you are installing via NPM
  2. Go to the terminal and executed pnpm i @lolaihung/mh-ui-library@latest
  3. And you can enjoy all the available components now!