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

@upgrowth/firelight

v2.0.1

Published

## Overview

Downloads

9

Readme

Firelight

Overview

The best way to think about Firelight is as a "CMS builder". When building and app there is the front-end which end users see, but there is almost always a significant, and often larger, amount of work in building the 'back-end' administration system where the app administrator configures elements of the front-end application.

Firelight aims to provide a fast and reusable way to define that back-end administration system so that it does not need to be rebuilt from scratch for every project.

Usage

<FirelightView firelight='admin' viewName='main' baseRoute='/admin/content' />

This includes a Firelight Admin View into your application.

The firelight property tells Firelight to use the configuration defined in the Realtime Database under the 'admin' node (you can set this to whatever you like. For example, you could have two admin systems if needed).

The viewName property tells Firelight which Firelight "main" to load initially, in this case "MainView". (TODO: What is a "view"?)

Finally, the baseRoute property tells Firelight what url route it should mount at.

(Note: It might be good to default these values, perhaps as defined above?)

When combined with the following data in the Firebase Realtime Database, Firelight will render a very simple CMS with a single view named 'MainView'. The MainView consists of a single tab named 'Sample Page'. The 'Sample Page' tab contains one field, which is a simple string named 'content', the value of which the administrator can edit.

{
  "admin": {
    "views": {
      "main": {
        "type": "tabs",
        "of" : {
          "Sample Page": "samplePage"
        }
      }
    },
    "types": {
      "samplePage": {
        "content": "string"
      } 
    }
  }
}

Views

TODO

Types

Firelight understands a variety of implicitly defined data types.

Basic/Implicit Types

The basic set of implicit data types supported by Firelight "out-of-the-box" include:

  • String (e.g. A simple HTML Input or TextArea )
  • Boolean (e.g. A simple checkbox or switch)
  • Markdown (e.g. for user defined Rich content)
  • File (e.g. Image or Video etc)

Composing Custom Types

These basic types described above can then be composed into into more complex custom data structures by adding a type definition under the types node in the database.

For example, an Address and Customer type could be defined as follows:

{
    types: {
        Address: {
            type: "Object",
            of: {
                line1: "String",
                line2: "String",
                suburb: "String",
                postcde: "String",
                state: "String",
            }
        },
        Customer: {
            type: "Object",
            of: {
                firstName: "String",
                lastName: "String",
                postalAddress: "Address",
                billingAddress: "Address"
            }
        }
    }
}

In this example both Address and Customer are defined as Objects.

  • An Object is simply a pre-defined set of properties (such as firstName), which themselves cannot be added or removed but the values of which can be changed.

In addition to Object we can also define properties to be Arrays or Collections:

  • Arrays: Items in an Array are ordered. They can also be added, deleted, reordered etc in the Firelight UI.
  • Collections: Items in a Collection are named but unordered. They can also be added, deleted, renamed etc in the Firelight UI.

Defining properties

TODO

Optionals?

Layouts

Collections can be laid out in a number of different ways:

Lists

A simple column of items (using CSS Flexbox )

Grids

Uses CSS Grid Layouts (e.g. define the number of columns and their width)

Forms

Uses an row/cell layout definition to explicitly define the layout of each row and the items within.

Tabs

As a set of navigation tabs

Pages (todo)

As a collection of pages