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

@coop/trolley

v1.1.3

Published

This project is no longer maintained.

Downloads

10

Readme

DEPRECATED - Coop Trolley

This project is no longer maintained.

Intro

The Coop Trolley supply internal and external partners with Coop agnostic frontend tools to speed up development and improve reusability.

Packages can be included as React components or used in plain HTML with the Coop stylesheet.

Getting started

Install from npm:

npm i @coop/trolley --save

Include the stylesheet once in your project

// In Javascript
import '@coop/trolley/dist/coop-trolley.css'

or

// In SASS
@import '~@coop/trolley/dist/styles/coop-trolley';

Components can be used with React or - for static components - as plain HTML.

Use with React:

import { Button } from '@coop/trolley'

const MyComponent = () => (
  <div>
    <Button>My Button</Button>
  </div>
)

export default MyComponent

Use with plain HTML:

  <div class="coop-button">My Button</div>

Git Subtree

Internal users can utilize git subtree to push/pull components to project repositories. This allows for updating and improving components on the fly and commit changes to the Coop Trolley repo.

From project root.

Add remote git remote add -f -t master --no-tags coop-trolley https://github.com/theisof/coop-trolley

Add subtree, run git subtree add --prefix path/to/folder coop-trolley/master --squash

Push to subtree, commit first and run git subtree push --prefix=path/to/folder coop-trolley master

Pull from subtree, run git subtree pull --prefix path/to/folder coop-trolley master --squash

Prerequisite

Load fonts manually. Opens Sans and Roboto Slab can be loaded from Google Fonts.

<link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700,700i,800|Roboto+Slab:400,700" rel="stylesheet">

Standard: 'MarkOT' or 'Open Sans'
Display: 'Soho Std' or 'Roboto Slab'

Todo: solution for new hosted font

Development

Run local server on http://localhost:3001 with:

  npm i
  npm run start

To publish new version, increment version number in package.json and run npm run publish_all. Will update npm and Github demo page.

To only update Github pages run npm run publish_demo

Get images from local folder by adding ?local-images to url

Testing

Tests are setup with Jest and Enzyme. Place test files in same folder as tested file with .test. in filename. Run locally with npm run test. Tests are auto triggered on build.

Use the following approach when testing:

UI:

  • The goal is to eliminate the accidential removal of critical triggers, therefore...
  • Apply smoke tests to key UI actions such as toggle buttons
  • Don't test styling unless it impacts behaviour (like show/hiding a modal)
  • Make snapshots for tested components

Utils:

  • Make unit tests