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

basalplatten

v1.30.0

Published

Core components for building UIs the Fountainhead way

Downloads

12

Readme

Build Status Coverage Status

BasalPlatten

BasalPlatten ('Base Plate') is a collection of core components and utilities to help build UIs, the 'Fountainhead' way.

Much like a 'seed' or 'boilerplate' project, it is intended to offer a 'quick-start' way of initalizing a new project. However, unlike similar projects, it is not intended to be 'forked' each time you start a new project.

Instead, simply install BasalPlatten as an NPM module:

$ npm install --save basalplatten

BasalPlatten assumes the following architecture and conventions:

Webpack2 Configuration

Generate a Webpack2-compatible configuration using basalplatten/webpack/config:

// webpack.config.js
const {buildConfig} = require('basalplatten/webpack/config');

module.exports = buildConfig('myApp');

buildConfig accepts a second options object, which will be merged in with the default options. Alternatively, you may mutate the returned configuration object before exporting it.

Without any custom options or mutations, the webpack configuration will provide the following:

  • Hot Module Reloading (using React Hot Loader 3.0 Beta 6)
  • TypeScript 2.0 (using Awesome TypeScript Loader)
    • Entry point: src/index.tsx
    • Babel compilation step (required by Ant Design's homebrew tree-shaking strategy)
  • Less compilation
    • .less files ending in .inline.less will be embedded into index.html, useful for styling the IPL
  • Dev Server configuration
    • Sets up a proxy to a backend API running at localhost:8080 at /api

UI-Router

Create a UI-Router instance pre-configured with all of our favourite things using basalplatten/ui-router:

// AppEntryPoint.jsx
const {UIRouter} = require('@uirouter/react');
const {buildRouter} = require('basalplatten/ui-router');

var router = buildRouter();
router.stateRegistry.register({
  // ... your state definitions
});

<UIRouter router={router}>
  <UIView/>
</UIRouter>

The buildRouter factory provides you with a UI-Router instance preconfigured with our favourite things:

  • Reactive Extensions plugin so that you can .observe() state parameter changes directly from components
  • A default error handler that displays an Error Notification when a state transition fails
  • A URL routing handler that display a Notification and redirects to / when attempting to access a URL which does not match a state
  • Custom parameter types

UI-Router Parameter Types

A handful of custom parameter types that are useful for serializing state such as filter and order criteria from data tables into the URL. We use these types over the built-on json type as they're a little friendlier on the (human) eye.

If you use the buildRouter factory function in basalplatten/ui-router, then these types are already registered with the router instance and ready to use. Otherwise, you'll need to register them manually:

const {where} = require('basalplatten/ui-router/paramTypes');

router.urlMatcherFactory.type('where', where);

where

A parameter with the where type and following value:

{
  "user_id": "13",
  "owner_id": "37",
  "status": ["completed", "failed"]
}

Will be encoded into the URL as ?user_id:13!owner_id:37!~status:completed,failed.

order

A parameter with the order type and following value:

{
  "created_at": "desc"
}

Will be encoded into the URL as ?created_at:desc.