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

generator-frontify

v1.0.3

Published

Modular front-end boilerplate including declarative views

Downloads

5

Readme

Frontify Boilerplate

Framework for your simple, maintainable & super-fast front-end application.

Notice: This is a generator for Yeoman.

Build Status

Getting Started

Install

$ npm install -g yo grunt-cli
$ npm install generator-frontify

Initialize

$ yo frontify

Generate Module

$ yo frontify:module Example

What is it?

Framework for your simple, maintainable & super-fast front-end application

Goals

  • Complete front-end/back-end separation
  • Small footprint
  • Minimal production dependencies
  • Maintainability through a component system for HTML/CSS/JS (with naming conventions)
  • Declarative View/Layout through json configuration
  • Built-in CSS pre-compiler support
  • Auto-compilation on changes
  • Simple and fast development environment
  • Minimal deployment bundle for production (static files)
  • Optimized resources for production (concatenated, minified)
  • Extensible
  • Fast!

Prerequisites

The following requirements are only needed for development.

What's included

JavaScript

CSS

Getting started

This application uses grunt to build it's components and run itself. If you haven't used grunt before, be sure to check out the Getting Started guide. Once you're familiar with that process, run the application with the command:

grunt app

This command generates all resources needed by the front-end and runs it within a node server. You don't have to install an additional webserver. The script opens up your default browser on

http://localhost:3000/

Notice: You are not limited to a node server. You can run the application on every webserver.

Distribution

To prepare your application for deployment, run the following command to create a zip package dist/application.zip with all resources and assets needed for deployment on a webserver.

grunt dist

Pre-Compilation, Concatenation & Minification

Normally, the following tasks do not need to be run manually, because of the watch tasks.

Compiles all *.less files as combined css.

grunt less

Concatenate all javascript files and build combined files with the concat task.

grunt concat

Minify all javascript files using the uglify task.

grunt uglify

Minify all css files using the cssmin task.

grunt cssmin

Modules

Each component or block of the UI is called module. Examples are Logo or Navigation. These modules are located in the src/modules directory and they contain all their relevant *.html, *.css/*.less and *.js files. This separates the code in a maintainable way, even for very large applications.

HTML Skeleton

All .html files are handled as doT templates (open-source javascript template engine). Read more about the syntax in the documentation.

<div class="mod mod-example"></div>

CSS/LESS Skeleton

Here's an example of such a module css snippet. Placed as src/modules/Example/css/example.less. You can use LESS syntax to make use of mixins, variables & other pre-compilation features. Read the documentation for more information on the syntax.

Be sure to use prefix .mod-modulename for every rule. Scoping is important for maintainable code.

@import "variables.less";

.mod-example { }

Javascript Skeleton

You can write vanilla javascript or you can create modules (recommended), a concept introduced by the open-source library Terrific.js. Read more about the usage and features in the documentation. Modules are great for writing small pieces of maintainable javascript code scoped on the actual module, rather than on the whole application.

Here's an example of such a module javascript snippet. Placed as src/modules/Example/js/example.js

(function($) {
  Tc.Module.Example = Tc.Module.extend({
    on: function(callback) {
        // your bindings here (e.g. onclick, etc.)
        callback();
    },
    after: function() { 
        // your module code here (e.g. AJAX calls, etc.)
    }
  });
})(Tc.$);

Views

The application views are configured within src/api/app/views.json.

Here's an example of a view configuration.

{ 
    "id": 1,
    "route": "/example",
    "title": "Example",
    "layout": "default",
    "modules": {
        "content": [ "article-home"]
    }
}

Layouts

All layouts are located in src/modules/Layout. Each layout defines regions with data-region attributes. They are filled with the modules configured in the corresponding view, as seen above.

Here's an example of the default layout markup (src/modules/Layout/layout-default.html).

<header data-region="header"></header>
<div data-region="content"></div>
<footer data-region="footer"></footer>

and here is the definition of the default state (default modules, etc.), which will be extended through the specific view configuration.

{ 
    "id": "default",
    "modules": {
        "header": [ "logo", "navigation" ]
    }
}

Watcher

All compilations needed for run-time are done automatically on file changes. Sometimes it's needed to run grunt app to get freshly compiled files.

Build

JavaScript

The JavaScript build generates two concatenated `*.js files.

  • dist/assets/js/application-core.min.js Minified version of javascript libraries
  • dist/assets/js/application.min.js Minified version of application-specific javascript

In addition, there are some language specific javascript files generated.

CSS

  • dist/assets/css/application.min.css Minified version of application-specific css

Compatibility

The framework is intended to be compatible with all major browsers, including IE7+.

Credits

Built by Roger Dudler @ Frontify & Frank Vollenweider @ Pixabytes