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

component-template

v1.0.0

Published

A React component template for building and publishing reactstrap components

Downloads

8

Readme

component-template Build Status

Build, Document, Release & Publish React Components for reactstrap with this Component Template.

This project was bootstrapped with Create React App.

Documentation

To start using the example npm module component-template, check out the documentation.

Developing with Component Template

Looking to build your own components? Fork this repo and proceed with the following documentation.

Getting started

To begin, install dependencies with

npm install

To run a local server with create-react-app, run:

npm start

A new browser window should open up with the following url: http://localhost:3000

Testing components

Testing is provided via create-react-app which includes the jest test runner. Enzyme is also added to enable better integration testing of components via mount.

Execute the following command to run tests. Read more about that here.

npm run test

To also see test coverage when running tests, execute the following command:

npm test -- --coverage

Adding your own components

Currently the example component shipped in this project is HelloWorld. To add your own components, replace HelloWorld with your own named component and tests.

Notes

  • Component source code should live in /src/components
  • Be sure to export your components here /src/components/index.js
  • When published to npm, the main script in package.json will be available at lib/index.js thanks to the prebuild task
  • Changelogs are important for communicating to users what features, fixes and breaking changes have been shipped. This project uses the angular commit convention as standard for creating readable and machine parseable commit messages.

Release Flow

Included in this project are a few scripts to help document, release and publish a react component. Before proceeding, make sure the name, version, description, and repository in package.json are updated to properly define your own component.

Once your components are added and tested, use the following steps to release to npm.

Create Release branch

First, run the create-release-branch script locally, which takes 1 argument, the release version. The release version can be a specific semantic version or it accepts patch, minor, major to automatically increment the current release version and update the changelog. After the script is run, a branch will be pushed to the repo.

# RELEASE_VERSION: "1.0.0", patch, minor, major
RELEASE_VERSION=0.2.0
npm run create-release-branch -- $RELEASE_VERSION

With the branch pushed to github, you can now manually create the pr.

Publish Docs

First, update the npm task gh-pages, to set the proper REACT_APP_GH_PAGES_PATH for your project. Ex: https://reactstrap.github.io/component-template project would be component-template. No need for the trailing or leading slash.

Follow the next sections to publish locally or via Travis CI.

Without CI

With the REACT_APP_GH_PAGES_PATH path updated, run the deploy-docs script to compile the production version of your docs and push those changes to the gh-pages branch of your repo.

npm run deploy-docs
via Travis CI

Coming soon

Publish Release

First, be sure to signup for npm if you haven't or run npm login with your existing credentials.

Next, run the publish-release task which will pull the latest changes, compile the components, tag the current commit as the version in packge.json. push the tags to github and finally will run npm publish. Check the publish-release script for more info.

npm run publish-release

Missing Something

Feel free to create an issue or PR.