Lapple / generator-noscript

Noscript project generator for Yeoman

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Noscript generator

Build Status

A noscript project generator for Yeoman.

Getting started

Make sure you have yo and the generator installed:

npm install -g yo generator-noscript

Make a new directory and cd into it:

mkdir new-ns-project && cd $_

Run yo noscript and answer some prompts. After the dependencieas are installed run npm run build to assemble the project or npm run serve to start local development server.

Generators

List of available generators:

Note: Generators are supposed to be run from the root directory of your app.

App

Generates most of the boilerplate code you need to get started with a noscript app. Sets up the following folder structure:

/app              Folder, containing your front-end code:
  view-*.js       - ns.Views
  model-*.js      - ns.Models
  layout-*.js     - ns.Layouts
  init.js         - initialization code
  app.js          - layout inclusion and route definitions

/server           Folder, containing back-end, Express powered code:
  page-*.yate     - Yate templates for different pages
  model-*.js      - model retrieval modules
  server.js       - main server-side script
  route-models.js - models connector
  route-index.js  - main application template renderer
  engine-yate.js  - Yate template engine for Express

/tests            Tests folder
  /spec           - spec folder
  tests.html      - test-runner file

/styles           Project CSS written in Stylus

package.json
Grunfile.js
README.md

Build, powered by Grunt, comes bundled with following tasks:

  • npm run build assembles the project, building templates and concatenating scripts,
  • npm run serve builds the project and starts up a local instance of express server with livereload.

The generated app will use:

  • Yate as a templating engine,
  • Stylus for CSS preprocessing,
  • Express as backend router and server.

Build and run it in production mode using:

npm run build && npm start

Example:

yo noscript

Model

Generates ns.Model definition and pairs it with server-side model retrieval module. Note that dasherized or underscored names are camel-cased as per convention.

Pass --collection option to generate ns.ModelCollection definition.

Example:

yo noscript:model sampleModel
yo noscript:model sampleModels --collection

View

Generates ns.View definition with a corresponding Yate template. Note that dasherized or underscored names are camel-cased as per convention.

Pass --collection option to generate ns.ViewCollection definition.

Example:

yo noscript:view sampleView
yo noscript:view sampleViews --collection

List

Lists views, models or layouts currently present in the project.

Example:

yo noscript:list view
yo noscript:list model
yo noscript:list layout

License

MIT License

About

Noscript project generator for Yeoman

License:MIT License


Languages

Language:JavaScript 97.6%Language:CSS 2.4%