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

@comicrelief/storybook

v2.5.2

Published

React components to build the Comic Relief front-end experience

Downloads

158

Readme

Comic Relief Storybook NPM version Build Status

React components to build the Comic Relief front-end experience

To run CR Storybook locally

Installation

  • Clone this repository
  • npm install
  • npm run storybook
  • Visit http://localhost:9009/

Development

Then import your component(s) into stories/index.js and render them like so:

storiesOf("Some component name", module)
  .add("Default", () => (
    <ComponentName />
  ))
  .add("Some variation", () => (
    <ComponentName prop="value" />
  ));

Unit testing

Our target is to cover:

  • interaction with component via user actions mainly
    • We use Jest, a testing framework with its own assertions.
    • We use Enzyme, a testing utility which makes it easy to render, manipulate, and traverse React Components' output.
    • We use Sinon to mock API calls and spy on methods expected to be triggered.
  • component layout at it's lifecycle different states

In order to run unit tests

  • yarn test
  • For update mode : yarn test-update You may need it to update snapshots after intentional layout changes

Getting Started as dependencies in your project

To build storybook components locally within an app, please use npm link. Learn how to do this here

Then import your component(s) into components/index.js and rebuild build files via yarn build

Install dependencies

Ensure packages are installed with correct version numbers by running:

npm install @comicrelief/storybook --save

Include component

import { Footer, FileUp } from '@comicrelief/storybook';

In some cases there is documentation for a specific component in a README.md inside its own directory.

Semantic Release Process

Git commit messages are used to automatically publish a new version of npm package. To achieve this, every commit message should have a type and a message in the format that is described below.

Travis CI will run a job automatically after PR is merged and analyze all commit messages since last npm release. Then semantic-release plugin will calculate new version according to this result.

To avoid commit loops, version numbers are not committed back to package.json. Versions are listed on GitHub releases and used in the modified package.json published to npm.

Commit messages are expected to be in this format:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

Minimally, only type and subject is required.

Bugfix / patch

When there are no breaking changes or adding no new features. When we are fixing bugs or styles.

fix: A bug fix

Minor / Feature

When there is a new feature / functionality is added to the library

feat: A new feature

Major / breaking change

When there is a breaking change, we need to extend our commit message and add BREAKING CHANGE: A description of the change to its body. This message can be added to any type of commit. Example:

feat: A new feature

BREAKING CHANGE: A description of the change

Automating commit message format

Commitizen library is added as npm dev dependency and it can be used to generate commit messages by answering a few questions and skipping the ones which are not relavent. Example workflow:

  • Make code changes in your feature branch
  • Run git add . to add changed files and get ready to commit
  • Run yarn commit

This will start an interactive process to build commit message. Simply answer all questions or press Enter to skip.

  • Repeat and follow rest of the GitHub workflow

Release contingency

Currently, the semantic build release method is broken so, with very limited resource to maintain this legacy code, we're reverting to updating the version number in package.json and running npm publish.