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

nypr-design-system

v3.1.29

Published

New York Public Radio design system

Downloads

19

Readme

nypr-design-system

Home of the Radial Design system.

This repo contains an Ember addon, nypr-design-system and the files to power Storybook.

Ember Addon

Installation

ember install nypr-design-system

Configuration

This app will automatically import the css for your chosen theme in head of your application template (using the content for 'head-footer' hook).

You can select which themes to build (usually just one) by adding a list of theme names to the options in your app's ember-cli-build.js file.

let app = new EmberApp(defaults, {
  //...
  'nypr-design-system': {
    themes: ['gothamist']
  },
  //...
});

If you don't specify a themes option, it will default to only the white label ([white-label]). If you don't want any themes, use themes: [].

Additional themes beyond the first one will be added as alternate stylesheets. This is useful within storybook itself and also when debugging themes in clients.

Storybook

The following folders contain files for storybook:

stories .storybook

To run Storybook locally you need Ember to already be running (ember serve) or built (ember build). More specifically you need the Ember addon to exist in the dist folder, so it can read and display the Ember components. After that you can start storybook by running:

yarn storybook

Deployment

Radial is deployed as a static site which is housed in an S3 Bucket behind a Cloudfront Distribution.

Production/Staging Environments

We use the addon-versions addon to maintain a single environment for both production and staging. This addon allows us to use the underlying directory structure of the S3 bucket as separate versions of the site. Each "version" that is deployed to the S3 bucket is stored in its own directory (as seen in the snippet from circle.yml below).

[[ $CIRCLE_BRANCH = "main" ]] && RELEASE="latest" || { [[ -n $CIRCLE_BRANCH ]] && RELEASE=$CIRCLE_BRANCH || RELEASE=$CIRCLE_TAG; }
yarn storybook-to-aws-s3 --bucket-path=$S3_BUCKET/$RELEASE -e=./storybook-static/$RELEASE
aws s3 cp storybook-static/index.html s3://$S3_BUCKET
aws s3 cp storybook-static/storybook-config.json s3://$S3_BUCKET
AWS_PAGER="" aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID --paths "/index.html" "/storybook-config.json" "/$RELEASE/*"

Then addon-versions displays a "Versions" tab in the Storybook UI that allows the user to toggle between different available versions. This addon doesn't automatically detect the underlying directory structure, it relies on the available-versions field in storybook-config.json to populate its buttons.

:warning: Thus, when deploying Radial, you must add a line to the available-versions field :warning:

QA Branches

All branches that begin with qa/ will be deployed to the S3 bucket. You have the option of adding your branch to the available-versions field or you can just modify the url manually to view your work.

License

This project is licensed under the MIT License.