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

@prodo-ai/snoopy-ui

v0.2.0

Published

<p className="markdown"> <a href="https://circleci.com/gh/prodo-ai/snoopy/tree/master"> <img src="https://circleci.com/gh/prodo-ai/snoopy/tree/master.svg?style=svg" alt="Current CircleCI build status." /> </a> <a href="https://ww

Downloads

13

Readme

Snoopy

To get started, we recommend installing Snoopy with yarn add --dev @prodo-ai/snoopy or npm install --save-dev @prodo-ai/snoopy. Then you can run:

$ ./node_modules/.bin/snoopy

Alternatively, you can simply run this inside your project's root or source directory, but it might be slower:

$ npx @prodo-ai/snoopy

To interact with the UI, go to localhost:3042/ (or a different port that the CLI will notify you about if this one is busy).

Components

Snoopy will detect most exported components automatically. If you find any that are missing, add // @snoopy above the export line to display/preview/visualize it (and let us know so we can detect it in the future). If you want Snoopy to ignore your component, put the // @snoopy:ignore tag above the export line.

For pure components, you don't need to do anything else. If your component requires props to be passed in, you will need to define examples.

Examples are defined in a separate examples/ directory at the root of your project (where your package.json file is). All source files in this directory are searched, but the convention is to name the file Component.example.jsx). The default export of this file is the component that the examples are for. All other named exports are examples that will be displayed in the UI.

Here is a simple example:

// src/components/Counter.tsx
import React from "react";

export default ({count}) => <p>{count}</p>;
// examples/Counter.example.jsx
import Counter from "../src/components/Counter";

export default Counter;

export const count0 = <Counter count={0} />;
count0.title = "Count is 0";

export const count10 = <Counter count={10} />;
count10.title = "Count is 10";

You can also use Snoopy with TypeScript.

Styles & Themes

If you use the styled-components ThemeProvider, you can also annotate your exported themes with // @snoopy:theme to visualize your components in different themes.

If you want to include any application-level CSS files, just put a /* @snoopy:styles */ comment anywhere inside the file, and they will be applied to all your examples.

What is and isn't supported yet

We support many libraries and use cases, including:

  • styled components with themes
  • react-router
  • hooks

Here's a list of things we don't support yet, most of which are on the roadmap:

  • Redux
  • React Context
  • react-modal
  • chroma.js (due to a chroma issue with parcel)
  • some CSS attributes (for example absolute positioning)

There are a couple of cases where you may want to tweak something in your code to get it fully working in Snoopy.

  • Images should render in Snoopy, but if yours isn't, check how it's imported. If you're using import * as image from ... syntax, try replacing it with import image from ....
  • If you're seeing duplication, make sure you're not unintentionally running Snoopy on your build files.

Examples

Here is a basic example of a Counter project set up for testing with Snoopy. In it, we test the following components: App, Button and Counter.

We also test Snoopy with Snoopy, so you can check our source code directly.

Contact

We'd love your feedback! You can reach us at [email protected].

You can also talk to us directly on Spectrum.