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

stucco

v0.1.2

Published

> Low Friction Rapid Prototyping For ReactJS

Downloads

5

Readme

STUCCO

Low Friction Rapid Prototyping For ReactJS

Build Status

Given the incidental complexity of setting up a new environent for a ReactJS component, this tool gives a (very!) opinionated stack for rapid prototyping. Recently the vast majority of the work I've been doing has been focused on building ReactJS components, distributed as individual modules in their own git repositories and npm modules. This means that for every module, the beginning is either manually creating the project structure or cloning a boilerplate. In both cases, keeping all the (at this point 100+) projects in sync with configuration and process is an exponentially difficult task. The hope is that with this tool, scaffolding a default project and keeping it's tooling up to date should be simple.

Table of Contents

Why Stucco?

  • Simple and easy to use
  • Low Friction: gets out of your way immediately so you can start building rather than configuring
  • Extensible: so you don't have to rebuild your tools with every new dependency or configuration change
  • Rapid Prototyping: Livereload, HMR, devtools (fixture switching, test and lint status)

This tool is purely focused on building self-contained modules not full applications. If you're looking for a build tool aimed at scaffolding and prototyping server/client application, take a look at React Project.

Features

HMR

Extensible Routes

Fixtures Swapper

CSS Modules

Usage

Create a new project and add Stucco as a dev-dependency

$ mkdir my-awesome-project
$ cd my-awesome-project
$ npm init
$ npm install -SD stucco
# you should only run scaffold once, at the beginning of your development
# it will not run if there is an existing .stuccorc file, to avoid overwriting your work
$ ./node_modules/.bin/stucco scaffold

# this command will create a
#   .stuccorc
#   src/index.js
#   src/fixtures.js
#   src/routes.js
# and add the following tasks to your package.json
#   watch
#   dist
//package.json
{
  ...
  "scripts": {
    "watch": "stucco watch", // runs a server that serves the component file, watching for changes and hot-reloading
    "dist": "stucco dist", // compiles and bundles the javascript and styles used by the project
    ...
  },
  ...
}
// .stuccorc
{
  // if any of the following are missing from this file, they will default to the values seen here

  // change the fixtures value to point to the file you want to store the fixtures in
  "fixtures": "src/fixtures.js",
  // change the component value to point to the file you want to store your top level component in
  "component": "src/index.js",
  // change the routes value to point to the file you want to store your server routes in
  "routes": "src/routes.js"
}
// src/index.js
import React from 'react';

// edit me!
export default class Component extends React.Component {
  render(
    <span>{this.props.greeting} {this.props.target}</span>
  );
}
// src/fixtures.js
const fixtures = [
  // label must be unique
  { label: '01', props: { greeting: 'Hello', target: 'World' } },
  { label: '02', props: { greeting: 'Goodbye', target: 'World' } },
];

export default fixtures;
// src/routes.js
const routes = [
  // method: the HTTP method: [get, post, patch, put, delete, *]
  // pattern: the pattern to match for the route
  // handler: the express route handler function
  {
    method: 'get',
    pattern: '/hello',
    handler: (req, res) => res.send('hello'),
  },
];

export default routes;