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

@risd/webhook-cms

v3.0.1

Published

This repository is for the Webhook CMS layer. There are several other repositories in Webhook's core.

Downloads

1

Readme

Webhook Overview

This repository is for the Webhook CMS layer. There are several other repositories in Webhook's core.

If you are interested in self-hosting Webhook, check the instructions here.

Webhook CMS

The Webhook CMS is the CMS layer of Webhook.com. Essentially it is a one-page Ember app based upon Ember App Kit. It uses an ES6 Module Transpiler which allows for ES6 module syntax. The code for the Ember app is in the app directory.

The CMS provides two primary functions.

  • Inserting data into a Firebase location following this format.
  • Sending calls through websockets to the local generator and production server to rebuild your site.

How to install for local development

Important: You need a working Webhook site account to develop on the CMS.

Steps to install:

  • Clone this repo and navigate to the webhook-cms directory
  • Run npm install for node dependencies
  • Run bower install for front-end dependencies
  • Look for <meta name="siteName" content="test" /> in app/index.html and change test to your site name. You can always wh create a new trial site if you want to work with scratch data.
  • Run grunt server, which loads on localhost:8000. It will activate livereload on changes to your JS, Handlebar and Sass files.

If working on a CMS for a self-hosted environment, use a .env file at the root of this project with the following values:

SITE_NAME=
FIREBASE=
SERVER=
EMBEDLY_KEY=
SELF_HOSTED=

Include the following keys to your .env file in order to push to production.

GOOGLE_CLOUD_PROJECT_ID=
GOOGLE_SERVICE_ACCOUNT=
GOOGLE_KEY_FILE=
ASSET_BUCKET=
ASSET_DIRECTORY=
CMS_VERSION=

Widgets in the form builder

Webhook uses a form builder to construct the various data entry forms users will use in the CMS. We call the different fields the Formbuilder allows "widgets".

The config/environment.js file names every widget the Form Builder allows. Each widget is organized into a controlType and a controlTypeGroup. Below is an example of the number widget:

{
  name     : 'Number',       // display name for widget
  widget   : 'number',       // id for widget
  iconClass: 'icon-list-ol', // icon for the button used in the Form Builder.
  valueType: null            // 'object' is the only supported non-null value type
}

The widget id field determines the proper template and code to execute in the CMS. If the value you are going to store is not a string or number, you must use the 'object' valueType. There are three differnt templates for each widget all located in the app/templates/widgets directory.

  • app/templates/widgets/_number.hbs is the template used for data entry by users.
    • These load into app/templates/widgets/common/formbuilder-widget.hbs, which is the common template for all widgets.
  • app/templates/widgets/info/_number.hbs is the template used when you edit the widget in the formbuilder.
    • These load into app/templates/form/_nav.hbs, which is a common template for all widgets.
  • app/templates/widgets/value/_number.hbs is the template used on the list view in the CMS. Like a list of existing blogs.

Validation for all widgets is done in app/utils/validators.js.

Handlebar helpers

Helpers are located in app/helpers.

  • resize-image: Accepts a width, height, a grow parameter. If grow is not specified, images will be resized to width/height but small images will not be filled in. If grow is set to true, small images will be filled into resize dimensions.