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

@crollalowis/cl-ui

v0.3.10

Published

[![Coverage Status](https://coveralls.io/repos/github/crollalowis/cl-ui/badge.svg?branch=master)](https://coveralls.io/github/crollalowis/cl-ui?branch=master)

Downloads

6

Readme

CL-UI Component System

Coverage Status

Build Status

Setup

yarn

copy example.env as .env

Development

run:

yarn start

To run tests:

yarn test

Open http://localhost:6006 in your browser. It is your Storybook with CL-UI components.

Process of creating a component

When creating a new component, decide on where the component should reside. As a general rule, very simple components that do not use other components, put it into the core folder, more complex components probably using multiple single components (from MUI) into the compound folder.

Folder Structure

| Folder | Rule | | ----------------- | ----------------------------------------------------- | | src/components/ | for simple core components |

Component Files

  src/core/MyCoreComponent
    index.js
    MyCoreComponent.jsx
    MyCoreComponent.notes.md
    MyCoreComponent.stories.{js,mdx}
    MyCoreComponent.test.js

Each component folder defines a seperated and isolated component, containing the implementation, a story explainin the use cases and a test, which tests the functionaliy of the component. Naming is important here. Always start components with an Uppercase Letter. If it contains JSX, end it with .jsx. There is always an index.js which exports the component itself as a default, but also maybe different variants or necessary side modules or helpers as named exports.

Each component should have a corresponding .stories.js file for usage in the storybook. The stories should represent and document all the necessary information to know how and why to use this component, and which Parameters affect it in what way. The .notes.md File can be used to add additional MDX documentation as 'notes'.

Component storis should be written using the new Component Story Format (CSF).

Alternatively you can use MDX flavoured CSF directly when using the .stories.mdx extension.

Each component should also be tested in a way that edge cases are represented. (No inputs, long inputs, short inputs, weird inputs)

Testing

unit testing: testing an isolated part of your app, usually done in combination with shallow rendering. example: a component renders with the default props.

integration testing: testing if different parts work or integrate with each other. Usually done with mounting or rendering a component. example: test if a child component can update context state in a parent.

e to e testing: Stands for end to end. Usually a multi step test combining multiple unit and integration tests into one big test. Usually very little is mocked or stubbed. Tests are done in a simulated browser, there may or may not be a UI while the test is running. example: testing an entire authentication flow.

Rules for Hooks

Don't think in lifecycles.

The question is not "when does this effect run" the question is "with which state does this effect synchronize with"

useEffect(fn) // all state
useEffect(fn, []) // no state
useEffect(fn, [these, states])

— Ryan Florence (@ryanflorence) May 5, 2019