A noscript project generator for Yeoman.
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.
List of available generators:
Note: Generators are supposed to be run from the root directory of your 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 buildassembles the project, building templates and concatenating scripts,npm run servebuilds the project and starts up a local instance of express server with livereload.
The generated app will use:
Build and run it in production mode using:
npm run build && npm start
Example:
yo noscript
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
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
Lists views, models or layouts currently present in the project.
Example:
yo noscript:list view
yo noscript:list model
yo noscript:list layout
