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

react-lib-starter

v0.1.0

Published

A react component boilerplate with tech stack of react, typescript, sass, jest, storybook, rollup, closure

Downloads

2

Readme

react-lib-starter

CircleCI MIT LICENSE npm package npm package

A react component boilerplate with tech stack of

  • react: UI framework
  • typescript: for type checking
  • sass: for css processing
  • jest: for tests
  • tslint & stylelint: for lint
  • storybook: for demo
  • rollup: for bundling
  • closure: for code comporession

Setup

  • clone repo
  • remove .git directory
  • alter README, rollup config files and others to meet your requirments
  • yarn install
  • yarn start to start development. this will start a local server and open http://localhost:3000 to see demo with live reload.

other available scripts:

  • yarn build to generate dist output
  • yarn test to run tests
  • yarn storybook to start local storybook
  • storybook:deploy to deploy storybook to github pages

Circle CI configuration

Here we use a CI service to

  • generate dist files
  • run tests and lint
  • deploy stories to github pages

Either Travis or Circle CI will do, in this boilerplate we use the latter.

To intergrate Circle CI and make it work

  • update the username and email in .circleci/config.yml
  • setup GH_TOKEN environment variables in Circle CI for the project
    • generate a github personal access tokens from https://github.com/settings/tokens
    • add an environment variable called GH_TOKEN in Circle CI project setting page https://circleci.com/gh/<user_name>/<repo_name>/edit#env-vars and it's value is the github personal access token above.
  • give Circle CI write access for the repo by adding suer key at https://circleci.com/gh/<user_name>/<repo_name>/edit#checkout

BELOW IS A TEMPLATE README FOR THE COMPONENT

Features

List features as list.

  • feature one
  • feature two
  • ...

Installing

Using command line:

$ yarn add <package_name>
# or
$ npm i -S <package_name>

Using cdn:

<script src="//unpkg.com/<repo_name>/dist/MyComponent.umd.js"></script>

Usage

A simple usage demonstration with code goes here.

import YourComponent from '<package_name>';

class Example extends React.Component{
  public render(){
    return <YourComponent />
  }
}

Options

List and describe available options for your component.

  • optoin: description goes here
    • type: string
    • default: the default value
  • callback: description goes here
    • type: (event: Event) => void

Examples

Publish stories to github pages for online demo.

See the examples.

Run the example at local

clone this repo then:

$ yarn install && yarn start

navigate to http://localhost:3000

Development

Describe how others can run the project local and contribute.

For development, clone this repo then

$ yarn install && yarn start

this will start a local server then open browser and go to http://localhost:3000 to see examples in action.

available scripts:

  • build: generate budnles that are ready to publish
  • dev: start local server for local development
  • lint: run tslint & stylelint
  • test: test the component

Acknowledgement

Other infomation that may help