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

@department-of-veterans-affairs/caseflow-frontend-toolkit

v2.5.8

Published

Build tools and React components for the Caseflow frontends

Downloads

36

Readme

caseflow-frontend-toolkit

Build tools and React components for the Caseflow frontends.

Installation

$ yarn add @department-of-veterans-affairs/caseflow-frontend-toolkit

Usage

See how other libraries, like Caseflow, are using this tool.

Component Assumptions

The components make assumptions, like:

  • Caseflow Commons CSS will be on the page.
  • Global analytics functions will be available.

These assumptions are not explicitly documented, so you'll have to read the code. :)

Dependencies

This module has many peer dependencies. It relies on contracts with a variety of modules in the Webpack, React, and Karma ecosystems. Unfortunately, yarn and npm's support for peerDependencies is weak. For instance, adding peer dependencies can cause yarn to log warnings for no reason. This means that you'll have to just look in package.json for what seems relevant, and manually add it to your consumer project.

Dev Notes

This module has the public contract that consumers can require certain files in config/, test/ and components/ directly. Before you move files around, be sure that no consumer is using them. (We can come up with a more formal way to declare what files are public when the usage of this module gets more complex, but for now I'd say it's overkill.)

Build Process

Traditionally, an npm module is supposed to own its build process. Before running yarn publish, you'd have a script that compiles a JS file that does not need further compilation to run in any environment you support. This greatly simplifies sharing code in the broad OSS world, because you don't need to know how a module was compiled to use it.

For our use case, I've decided to forgo that. Our team owns both this module and the consumers of it. In the near term, we have two consumers. Additionally, the build process for those two consumers is defined by this module itself. So it should be easy to keep all three places in sync. And this allows us to greatly simplify our publishing process. Instead of having Travis publish on master builds, or hoping that people remember to run yarn run build-and-publish instead of just yarn publish, we can just publish directly without extra steps. We won't have the pain of accidentally publishing a version that does not have the prebuilt JS file.

React as a dev dep

Unfortunately, if react is listed as a dependency in package.json, then yarn fires a bunch of erroneous warnings about react not being met as a peer dependency. Thus, we move it to devDependencies to silence the warnings. Semantically, react is a dependency of this module and should be listed as such.