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-marionette-advanced-app

v0.1.0

Published

Yeoman Marionette generator for advanced and scalable apps using RequireJS, Underscore Templates and Backbone.Syphon

Downloads

7

Readme

generator-marionette-advanced-app Build Status

Getting Started

What is Yeoman?

Trick question. It's not a thing. It's this guy:

Basically, he wears a top hat, lives in your computer, and waits for you to tell him what kind of application you wish to create.

Not every new computer comes with a Yeoman pre-installed. He lives in the npm package repository. You only have to ask for him once, then he packs up and moves into your hard drive. Make sure you clean up, he likes new and shiny things.

npm install -g yo

Installation

To install generator-marionette-advanced-app from npm, run:

npm install -g generator-marionette-advanced-app

Finally, initiate the generator:

yo marionette-advanced-app

Introduction

The grounds to build this app structure were extracted from the structure David Sulc presents in his books "Backbone Marionette js: A gentle introduction", "Structuring Backbone.js code with RequireJS and Marionette.js modules: A gentle introduction" and "Backbone Marionette js: A serious progression". All credits granted to him and to his knowledge translated in these books.

[David Sulc Github] (https://github.com/davidsulc)

[David Sulc Site] (http://davidsulc.com/)

This generator follows an app and action based approach, with the objective of creating separate modules inside a bigger app. This proves to be useful in maintaining it and in order to better scale the app in the future. There are a lot of third party plugins and dependencies required for this to work properly:

[Backbone] (http://backbonejs.org/)

[Marionette] (http://marionettejs.com/)

[jQuery] (http://jquery.com/download/)

[Backbone Syphon] (https://github.com/marionettejs/backbone.syphon)

[Require] (http://requirejs.org/docs/download.html)

[Underscore] (http://underscorejs.org/)

[Tpl] (https://github.com/jfparadis/requirejs-tpl)

This generator only creates and will ever only create the structure of the app. It will NOT include the dependencies you need in the vendor folder, leaving that task to you. A tutorial showing how to properly work with this structure will soon follow and a link to it will be posted here.

App Structure

yourAppName
|---index.html                                			// holds the base html of your app (keep it as simple as possible)
|---assets
|	|---css                                     		// all of the css's you need
|	|---img                                     		// all of the images you need
|	|---js                                      		// your main app folder, per say
|	|	|---app.js                                		// your main app (the entry point for your Marionette app)
|	|	|---main.js                               		// dependencies for require.js module (Marionette app starts here)
|	|	|---apps                                  		// where your modules or sub-apps reside
|	|	|	|---module1                             	// module or sub-app named "module1"
|	|	|	|	|---module1_app.js                    	// this specific module main app (the gluer of the sub-app)
|	|	|	|	|---list                              	// the action of listing something in this sub-app
|	|	|	|	|	|---list_controller.js              // the controller of this action only
|	|	|	|	|	|---list_view.js                    // the marionette views for the controller to use
|	|	|	|	|	|---templates                       // templates for the listing action only
|	|	|	|	|	|	|---module1_list_template.tpl
|	|	|	|	|	|	|---etc
|	|	|	|	|---new                               	// the action of creating something new in this sub-app
|	|	|	|	|	|---new_controller.js               // the controller of this action only
|	|	|	|	|	|---new_view.js                     // the marionette views for the controller to use
|	|	|	|	|	|---templates                       // templates for the new action only
|	|	|	|	|	|	|---module1_new_template.tpl
|	|	|	|	|	|	|---etc
|	|	|	|	|---show                              	// the action of showing something in this sub-app
|	|	|	|	|	|---show_controller.js              // the controller of this action only
|	|	|	|	|	|---show_view.js                    // the marionette views for the controller to use
|	|	|	|	|	|---templates                       // templates for the new action only
|	|	|	|	|	|	|---module1_show_template.tpl
|	|	|	|	|	|	|---etc
|	|	|	|	|---etc
|	|	|	|---module2
|	|	|	|	|---module2_app.js
|	|	|	|	|---list
|	|	|	|	|	|---list_controller.js
|	|	|	|	|	|---list_view.js
|	|	|	|	|	|---templates
|	|	|	|	|	|	|---module2_list_template.tpl
|	|	|	|	|	|	|---etc
|	|	|	|	|---new
|	|	|	|	|	|---new_controller.js
|	|	|	|	|	|---new_view.js
|	|	|	|	|	|---templates
|	|	|	|	|	|	|---module2_new_template.tpl
|	|	|	|	|	|	|---etc
|	|	|	|	|---show
|	|	|	|	|	|---show_controller.js
|	|	|	|	|	|---show_view.js
|	|	|	|	|	|---templates
|	|	|	|	|	|	|---module2_show_template.tpl
|	|	|	|	|	|	|---etc
|	|	|	|	|---etc
|	|	|	|---etc
|	|	|---common                                		// common views or functionality across the app
|	|	|---entities                              		// the models of the app (they contact with some remote API)
|	|	|	|---module1_entity.js                   	// entity used by module1, but there may be more of course
|	|	|	|---module2_entity.js                   	// entity used by module2, but there may be more of course
|	|	|---vendor                                		// third party plugins and dependencies needed for the app

Usage

Run the generator

The app name requested is the name by which your main app will be called throughout the development of your app (e.g. ContactsManager).

Set the number of modules or sub-apps wanted

The objective of this app structure is to solely support any number of sub-apps inside the main one, in order to maintain it more easily in the future. So, here you choose how many sub-apps or modules you want inside your main app.

Set the name for each module or sub-app

Time to work!

After this small setup, the generator will create a base structure for you to work with the modules you set previously.

License

MIT