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

@tshio/frontend-components

v1.0.0

Published

TSH Frontend Components

Downloads

1

Readme

📘 Project context

Knowledge sharing and development process acceleration are the backbone of this project. In this repository you can find components that can be treated as an inspiration or starter point for production graded code.

Main assumption is that custom MUI based components in this repository should be versatile and easy to configure in your current project.

This project has also a CLI that can be used to copy components directly to your project.


🔨 Setup & Usage

Husky

In order to keep codebase frequently tested, linted and formatted, set up husky:

npm run prepare

Packages

Install packages for both projects - components and CLI:

npm i
cd packages/cli
npm i

And return to the main directory:

../..

Components

Local development

To work on components, you can run Storybook on your localhost to set up hermetic, hot-reloading environment. In order to do that, run:

npm run storybook

To set up a new component in Storybook, you have to create a story (ComponentName.stories.tsx), check out official documentation for in-depth guidelines - link to Storybook docs. Or simply follow convention from components that already exists in this repository.

CLI

Destination project initialization

In order to add your destination project, you have to run command:

npm run init

And follow steps that are visible in your console.

You can set up multiple destination projects to have multiple choice for where to copy components to. All you need to do is to run this command again.

Your configuration will be saved in cli.settings.json file, you can manipulate project metadata directly from there.

Component copy

To copy components to project that you set up earlier, go ahead and run command:

npm run copy

And follow steps that are visible in your console.

As a default, Storybook file (*.stories.tsx) is selected to be copied, if your project doesn't have Storybook set up, hit N button in CLI wizard at 3rd step.


🛃 Development & Conventions

File system

In order to keep CLI running, new components should be kept in separate directories in packages/components. Example:

If you would like to add Input component, create directory and name it as the component (lowercased):

packages/components/input

And add files in that directory.

schema.json

In order to manage components dependencies (both libraries and other components), we created a packages/schema.json file to keep it in one place. If you are adding new component, you have to declare it in that file.

Example: I've created a <List/> component that have <ListItem/> as a dependency, and it is based on MUI library. Schema for that component may look like that:

packages/schema.json

...
components: [
  ...,
  {
    "name": "List",
    "componentsDependencies": ["ListItem"],
    "packagesDependencies": ["@mui/material"]
  }
]
...

Important! Component which isn't declared in schema.json won't show up in CLI copy list.


🔥 Deployment

Building the package

In current version, CLI is bundled with components in one package. In order to build the end-product, you have to run command:

npn run build-cli

It will transform Typescript source code of CLI to Javascript and copy components directory to dist.

Storybook hosting

Storybook is currently hosted at https://dz6s1m3491km4.cloudfront.net/