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

@mycause/ui

v0.0.0-c9ff4eb5

Published

Design system and UI components for mycause.

Downloads

1,925

Readme

mycause ui

Design system and UI components for mycause.

Prerequisites

  • Node.js (>= 22.x)
  • Yarn (>= 1.22.22)

Setup

Install the package:

$ yarn add @mycause/ui

mycause ui depends on a global style reset as well as global styles for some components. The reset includes normalize.css and a box-sizing border box reset, if you are already using something similar you may not need to include it.

Ensure you include these in your app, for example with Webpack's style-loader:

import "@mycause/ui/styles/reset.css";
import "@mycause/ui/styles/index.css";

Some components make use of the fonts:

  • Montserrat
  • Montserrat Alternates
  • Material Icons
  • Material Icons Outlined

Ensure you include these in your app, for example using the Google Fonts CDN:

<link
  href="https://fonts.googleapis.com/css?family=Montserrat:300,400,500,600&display=swap"
  rel="stylesheet"
/>
<link
  href="https://fonts.googleapis.com/css?family=Montserrat+Alternates:400,500&display=swap"
  rel="stylesheet"
/>
<link
  href="https://fonts.googleapis.com/icon?family=Material+Icons"
  rel="stylesheet"
/>
<link
  href="https://fonts.googleapis.com/icon?family=Material+Icons+Outlined"
  rel="stylesheet"
/>

Applying Patches with patch-package

This project uses patch-package to apply fixes to certain dependencies. This is necessary to address issues such as the punycode deprecation warning. Below are the steps to apply and manage these patches.

The following patches are applied:

  • normalize-url: Replaced require('punycode') with require('punycode/')
  • psl: Replaced require('punycode') with require('punycode/')
  • unicode-length: Replaced require('punycode') with require('punycode/')
  • url: Replaced require('punycode') with require('punycode/')
  • tough-cookie: Replaced require('punycode') with require('punycode/')

Local development

This project uses Yarn for development dependencies.

Install dependencies with yarn:

$ yarn install

Start the Storybook development server:

$ yarn storybook

View TypeScript errors and warnings:

$ yarn type-check
$ yarn type-check --watch # to watch

View ESLint errors and warnings:

$ yarn lint

Format code with Prettier:

$ yarn format

Build package:

$ yarn build

Storybook site

Build static Storybook site:

$ yarn build-storybook

Serve static Storybook site:

$ yarn start-storybook

Build static Storybook site as Docker image:

$ yarn build-storybook
$ docker build -t mycause/ui . # or replace with a different image name

Git hooks

Git hooks have been set up with husky.

To skip installing git hooks, set the HUSKY_SKIP_INSTALL environment variable to 1

$ HUSKY_SKIP_INSTALL=1 yarn install

To skip running hooks, for example when rebasing or commiting incomplete work, set the HUSKY_SKIP_HOOKS environment variable to 1.

$ HUSKY_SKIP_HOOKS=1 git commit ...
$ HUSKY_SKIP_HOOKS=1 git rebase ...

Linking as a dependency

To use a development version of this package as a dependency, first link it:

$ yarn link

Then go to the dependent project and run:

$ yarn link @mycause/ui

Then start the bundler in watch mode:

$ yarn dev

Publishing

Publishing a new version

Bump the version.

npm version [major | minor | patch]

Then ensure that the CHANGELOG.md is updated for the new release. This is the last chance to make any pending changes to this version. Commit any changes and push, including tags.

CircleCI will then automatically build and publish the new version.


To manually publish the package locally, use the following command:

npm publish --access public

Using git commands

git tag <version>
git push origin <version>

Publishing an unstable version

Use the following commands to publish an unstable version. These versions are tagged with the version number 0.0.0-cHASH where HASH is the abbreviated git commit hash. These should only be used for internal development purposes.

The version 0.0.0 indicates that these releases have no stability guarantees and do not necessarily have any relationship with other versions.

yarn build
npm version 0.0.0-c$(git rev-parse --short HEAD) --git-tag-version=false
npm pack
npm publish mycause-ui-0.0.0-c$(git rev-parse --short HEAD).tgz  --access public
git reset --hard

The c prefix prevents an issue where npm doesn't accept numeric identifiers that start with 0, the abbreviated git commit has may be all numeric and start with 0, so c is prepended to avoid this.

License

MIT