A Yeoman generator for The-M-Project 2.0.
Make sure you have installed Node.js, Git and optionally, Ruby and Compass (if you plan to use Sass).
Install: npm install -g generator-m
Create a folder and name it after the application name and cd
into it:
mkdir my-new-project && cd $_
Run the yo generator:
yo m
Run grunt
for building and grunt server
for preview
Available generators:
Create a new The-M-Project app and generate all the boilerplate for you.
yo m
Generates a view in app/scripts/views
.
Example:
yo m:view foo
Produces app/scripts/views/foo.js
:
APPNAME.Views.FooView = M.View.extend({
// ...
})
Generates a layout in app/scripts/layouts
.
Example:
yo m:layout foo
Produces app/scripts/layouts/foo.js
:
APPNAME.Layouts.FooLayout = M.Layout.extend({
// ...
})
Generates a controller in app/scripts/controllers
.
Example:
yo m:controller foo
Produces app/scripts/controllers/foo.js
:
APPNAME.Controllers.FooController = M.Controller.extend({
// ...
})
Generates a model in app/scripts/models
.
Example:
yo m:model foo
Produces app/scripts/models/foo.js
:
APPNAME.Models.FooModel = M.Model.extend({
// ...
})
Generates a collection in app/scripts/collections
.
Example:
yo m:collection foo
Produces app/scripts/collections/foo.js
:
APPNAME.Collections.FooCollection = M.Collection.extend({
// ...
})
Generates a router in app/scripts/routers
.
Example:
yo m:routers foo
Produces app/scripts/routers/foo.js
:
APPNAME.Routers.FooRouter = M.Router.extend({
// ...
})
Generates a i18n in app/i18n
.
Example:
yo m:i18n en
Produces app/i18n/en.json
:
{
"global.button.save": "Save document",
"global.button.emptyTrash": "Empty Trash ({{count}})",
"global.error.permissionDenied": "Permission denied"
}
-
--skip-install
Skips the automatic execution of
bower
andnpm
after scaffolding has finished. -
--test-framework <framework>
Defaults to
mocha
. Can be switched for another supported testing framework likejasmine
.
See the contributing docs
When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.
When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix.
When submitting a new feature, add tests that cover the feature.