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

sails-blueprint-generate

v1.4.7

Published

Interactive Sails Blueprint generator

Downloads

32

Readme

Interactive Wizard to generate Sails Blueprint

This generator was made to help users to setup Sails project with interactive wizard and ready to use templates. So users doesn't need to manually setup the template to get working (E.g: Swig + Bootstrap), configuring packages.json, bower.json and etc.

Generator will automatically install the NPM Packages and Bower Packages at the final step. So users doesn't need to manually run npm install and bower install, and the generator also giving prompt to install additional bower and npm packages.

Each template is ready to use. So users doesn't need to manually add grunt-task to compile and sync the assets, adding scripts and styles to HTML Layout, and so on.

Each template also ready for environment use. For example, in Development environment, template will using non minified javascript and css, but will use minfied version on Production environment.

Generator also will promt users to choose which port to be used in Development and Production environment, including which databse driver that will be used.


Installation

Sails Blueprint Generator requires NodeJS, NPM, and Bower installed on your machine. To install Sails Blueprint Generator, run:

$ npm install -g sails-blueprint-generate

Install External Templates

To install external templates, templates must be registered on bower registry. After installing, external templates will vailable on Select Template list

$ sailsgen install template-name

Example

$ sailsgen install sails-swig-angular sails-jade-bootstrap

Usage

To generate new blueprint, run:

$ sailsgen project-name

and follow the instructions.


Default Prompts

When running the sails-blueprint-generate project-name, users will be asked for few questions to setup the project. The prompts will be used by templates to setup the template requirements, e.g Project Name will be used in package.json and bower.json for field name. Where will be the informations used is depend on the templates requirements.

  • Project Name - required
  • Full Name - optional
  • Description - optional
  • Version - optional
  • Repository - optional
  • Select Template - required
  • Author - optional
  • License - optional
  • Additional NPM Packages - optional
  • Additional Bower Packages - optional

Each template will also have their own prompts to fits with the template requirements.


Example

Setup

macbook:projects euser$ sails-blueprint-generate sails-app
Welcome to interactive Sails Blueprint generator

? Project Name: sails-app
? Full Name: Sails Application
? Description: The web framework of your dreams.
? Version: 1.0.0
? Repository: https://github.com/user/reponame
? Select Template: sails-swig-foundation
? Author: Your Name <[email protected]>
? License: MIT
? Install Additional NPM Packages? Separated by space: 
? Install Additional Bower Packages? separated by space: gsap angular
? Development Port: 1337
? Production Port: 80
? Development Database Driver: sails-disk
? Production Database Driver: sails-disk
{ name: 'sails-app',
  realname: 'Sails Application',
  description: 'The web framework of your dreams.',
  version: '1.0.0',
  repository: 'https://github.com/user/reponame',
  template: 'sails-swig-foundation',
  author: 'Your Name <[email protected]>',
  license: 'MIT',
  npmdep: '',
  bowdep: 'gsap angular',
  devport: '1337',
  prodport: '80',
  devdriver: 'sails-disk',
  proddriver: 'sails-disk' }
? Check the settings. Continue? yes/no: yes
Generating Sails Blueprint for sails-app with template sails-swig-foundation ...

Sails Blueprint successfully generated.
Project path: /Users/euser/projects/sails-app
Run the application by executing sails lift or forever -w app.js

Installing NPM Packages...
Installing Bower Packages...
Bower Packages installed.
NPM Packages installed.
macbook:projects euser$ 

bower.json result:

{
  "name": "sails-app",
  "version": "1.0.0",
  "description": "The web framework of your dreams.",
  "ignore": [
    "**/.*",
    "node_modules",
    "bower_components",
    "library",
    "test",
    "tests"
  ],
  "keywords": [
    "sails",
    "swig",
    "foundation",
    "template"
  ],
  "author": "Your Name <[email protected]>",
  "license": "MIT",
  "homepage": "https://github.com/user/reponame",
  "main": "app.js",
  "dependencies": {
    "foundation": "~5.5.2",
    "short-sass": "~2.1.1",
    "jquery": "~2.1.4",
    "jqpatch": "~1.1.1",
    "gsap": "~1.16.1",
    "angular": "~1.4.0"
  }
}

Available Templates

  • sails-swig - Sails Blueprint with Swig Template Engine
  • sails-swig-bootstrap - Sails Blueprint with Swig Template Engine and Bootstrap
  • sails-swig-foundation - Sails Blueprint with Swig Template Engine and Foundation
  • stater-swig - Front-End Template with NodeJS server Stater

Creating Template

You can create new template and publish it to bower, since this generator only can install template from bower. To add custom prompts to your template, add file prompts.js to your template directory. Then you can add your custom prompts pattern to your files, wherever you need it. Pattern format is __NAME__.

Example

prompts.json

[
    {
        "name"    : "pets",
        "type"    : "input",
        "message" : "Favourite Pet",
        "default" : "Cat"
    }
]

readme.md

Project owner love %%PETS%%

Generator will iterate all prompts and apply to all files inside template folder.


Notes

Generator will embedding NativeJS to the generated template. You can remove it in the template main file (e.g app.js) at the first line if you don't want it.

Please open new issue for suggestions, template request or input prompts request.