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

@b12/metronome

v1.1.20

Published

Metronome is a design system we use for developing consistent user experiences at [B12](https://www.b12.io). We recently open sourced it to allow us to use it in other open source projects, and to make the useful and reusable components more widely availa

Downloads

1,264

Readme

Metronome

Metronome is a design system we use for developing consistent user experiences at B12. We recently open sourced it to allow us to use it in other open source projects, and to make the useful and reusable components more widely available to developers outside the company.

How to develop

Root of the repo looks like this. The main parts are: components and style directories, they contain basic components and styles all other files are here to help you develop and test your components. src directory contains files to preview your components in browser, keep in mind that this directory won’t be included in npm package (to see other ignored files and directories see .npmignore file).

.
├── LICENSE
├── README.md
├── components
├── index.es6.js
├── jest
├── node_modules
├── package.json
├── src
├── style
├── third_party
├── webpack.config.js
└── yarn.lock

::Warning! By convention, all javascript files should have a *.es6.js file extension.::

Below are basic command you may need:

# Run demo in browser
$ yarn start

# Run tests
$ yarn test

If you are developing on a remote machine and want to view the demo in your browser,

  • You'll probably need to edit webpack.config.js and change module.exports.devServer.port to be an available port on your machine.
  • You might also need to edit module.exports.devServer.allowedHosts to include your hostname. The default supports b12.io or any subdomain (see the documentation of host formats).
  • Then you can access the demo interface at http://your-remote-server.com:{port}.

How can I test my changes in an internal repository without publishing?

Note: If you're using docker, then you should do this outside of docker.

You can do it in five steps:

  1. In the metronome repository link metronome in yarn with command yarn link;
  2. In the metronome repository run yarn install --production;
  3. In your internal repository (crowdsurfing/product) use your linked version with command yarn link @b12/metronome;
  4. In your internal repository try to build product with yarn && yarn dev;

In case you accidentally ran the commands inside of docker and are running into permissions issues

  1. In your docker env remove node_modules folder, also remove build/static/build dir;
  2. On your host machine recreate build/static/build dir with local user permissions;
  3. Go to the internal repository on your host machine and run yarn && yarn dev;

Known issues

  1. Reinstall metronome dependencies with --production flag before testing your changes in an internal repository;
  2. If you see a lot of unexpected flow errors run yarn flow stop && yarn dev;
  3. If yarn install --production installs dev dependencies try npm npm install --production instead;

Steps to take if you continue to get flow, webpack, and duplicate react package errors

  • In your metronome repo, run:

    1. rm -rf node_modules;
    2. npm i --production;
  • Then, in the internal repository, run:

    1. rm -rf node_modules;
    2. yarn;
    3. yarn link @b12/metronome;
    4. yarn flow-reboot;