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

ui-library-storybook

v1.0.98

Published

Resale UI Library

Downloads

3

Readme

Checkout UI Library

Storybook can be accessed at the following URL for testing:

http://checkout-storybook.s3-website-eu-west-1.amazonaws.com/

TODO: only allow our IP to access said URL.

How to Publish: Guidelines

Projects generally start at 1.0.0.

After this, changes should be handled as follows:

  • Bug fixes and other minor changes: Patch release, increment the last number, e.g. 1.0.1
npm version patch --no-git-tag-version
  • New features which don't break existing features: Minor release, increment the middle number, e.g. 1.1.0
npm version minor --no-git-tag-version
  • Changes which break backwards compatibility: Major release, increment the first number, e.g. 2.0.0
npm version major --no-git-tag-version

The command --no-git-tag-version is necessary if we don't want git to add an unnecessary commit.

Npm will tag your latest npm publish with latest.

More info here Semver guidelines

CI Pipeline

The pipeline has three separate stages:

  • Build (tests are running here);
  • Push image to registry;
  • Publish to private npm.

Environmental variables are set in Pipeline > Settings.

Notes

  • While $SERVER_IP in the echo command is the name of the EC2 instance without the http, the $PRIVATE_REGISTRY is a full URL (with http).

Go to this http://52.209.246.15/ to see the repo online.

Publish to private npm

In order to push to private npm follow readme instructions on how to publish on that repo.

Flow typed

Flow typed is a dependency used by Flow to deal with third party libraries.

From the Flow documentation: "If a third-party library that has no type information is used by your project, Flow should treat it like any other untyped dependency and mark all of its exports as any." This does not seem to be actually happening and Flow fails at the import with Required module not found.

There are two solutions:

  • Download the flow-typed library definitions from the flow-typed repo with:
flow-typed install your-package@version;
  • Write a definition yourself, if the above fails (see flow-typed/polished.js for an example).

You will need to install flow-typed globally.

Testing

Styled Components

Our styled components rely on a theme prop passed down via context from ThemeProvider. Our components will not have access to this when we render them in our tests, which means the style snapshots will be incorrect.

To correct this we must either:

  1. Import the theme and pass it as a prop directly on the component (if there are no children, or you are shallow rendering with Enzyme).
import theme from '../../themes/resale/base';
const el = renderer.create(
  <Button theme={theme}}>
    Click me
  </Button>
);
  1. Wrap our component in the Themify helper (to ensure all children get the theme prop).
import Themify from '../../styles/themify';
const el = renderer.create(
  <Themify>
    <RadioField {...props} />
  </Themify>
);