Permalink
Browse files

initial drop

  • Loading branch information...
1 parent f11696f commit ed2a618411b1ce35e68065c0b5f9def5634909ad @dbashford committed Mar 24, 2013
View
@@ -0,0 +1,45 @@
+# Ignore npm packaging
+/.node_modules
+/node_modules
+
+# Ignore all logfiles and tempfiles.
+*.log
+/tmp
+
+## Ignore all generated files
+/coverage
+/rdoc
+/wiki
+/packaging
+npm-debug.log
+*.tmproj
+azure_error
+what
+*.sublime-workspace
+
+# Output folder
+/public
+/dist
+
+# Numerous always-ignore extensions
+*~
+*.diff
+*.patch
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.vi
+*~
+*.sass-cache
+
+# OS or Editor folders
+.DS_Store
+.cache
+.project
+.settings
+.tmproj
+nbproject
+Thumbs.db
View
@@ -0,0 +1,45 @@
+# Ignore npm packaging
+/.node_modules
+/node_modules
+
+# Ignore all logfiles and tempfiles.
+*.log
+/tmp
+
+## Ignore all generated files
+/coverage
+/rdoc
+/wiki
+/packaging
+npm-debug.log
+*.tmproj
+azure_error
+what
+*.sublime-workspace
+
+# Output folder
+/public
+/dist
+
+# Numerous always-ignore extensions
+*~
+*.diff
+*.patch
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.vi
+*~
+*.sass-cache
+
+# OS or Editor folders
+.DS_Store
+.cache
+.project
+.settings
+.tmproj
+nbproject
+Thumbs.db
@@ -0,0 +1,11 @@
+define ['jquery', 'templates'], ($, templates) ->
+
+ class ExampleView
+
+ render: (element) ->
+ templates.render 'example', {name:'Dust', css:'stylus'}, (err, out) ->
+ $(element).append out
+ templates.render 'another-example', {name:'Dust'}, (err, out) ->
+ $(element).append out
+
+ ExampleView
@@ -0,0 +1 @@
+AAAAAAAnd this is coming from another {name} template that is concatenated into a single template file with the others.
@@ -0,0 +1,3 @@
+<div class="template">This is coming from a {name} template</div>
+{>example_partial/}
+<div class="styled">And it has all been styled (poorly) using {css}</div>
@@ -0,0 +1 @@
+<div class="helper">And this is coming from a Dust partial</div>
@@ -0,0 +1,8 @@
+require
+ urlArgs: "b=#{(new Date()).getTime()}"
+ paths:
+ jquery: 'vendor/jquery'
+ , ['app/example-view']
+ , (ExampleView) ->
+ view = new ExampleView()
+ view.render('body')

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
@@ -0,0 +1,18 @@
+blue = #5B83AD
+yellow = #FFFFE0
+
+body
+ padding 50px
+ font 14px "Lucida Grande", Helvetica, Arial, sans-serif
+
+ .template
+ background linear-gradient(top, white, yellow)
+ border-radius bottom 10px
+
+ .helper
+ border 1px solid blue
+
+ .styled
+ transform rotate(-30deg)
+ margin-top 100px
+ position absolute
@@ -0,0 +1,7 @@
+exports.config =
+ server:
+ path: '../server/lib/server.js'
+ views:
+ path: '../views' # relative to server.path, not root of client project, make absolute path until Mimosa 0.11.1 is released
+ liveReload:
+ additionalDirs:['../server/views']
View
@@ -0,0 +1,45 @@
+# Ignore npm packaging
+/.node_modules
+/node_modules
+
+# Ignore all logfiles and tempfiles.
+*.log
+/tmp
+
+## Ignore all generated files
+/coverage
+/rdoc
+/wiki
+/packaging
+npm-debug.log
+*.tmproj
+azure_error
+what
+*.sublime-workspace
+
+# Output folder
+/public
+/dist
+
+# Numerous always-ignore extensions
+*~
+*.diff
+*.patch
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.vi
+*~
+*.sass-cache
+
+# OS or Editor folders
+.DS_Store
+.cache
+.project
+.settings
+.tmproj
+nbproject
+Thumbs.db
View
@@ -0,0 +1,45 @@
+# Ignore npm packaging
+/.node_modules
+/node_modules
+
+# Ignore all logfiles and tempfiles.
+*.log
+/tmp
+
+## Ignore all generated files
+/coverage
+/rdoc
+/wiki
+/packaging
+npm-debug.log
+*.tmproj
+azure_error
+what
+*.sublime-workspace
+
+# Output folder
+/public
+/dist
+
+# Numerous always-ignore extensions
+*~
+*.diff
+*.patch
+*.err
+*.orig
+*.log
+*.rej
+*.swo
+*.swp
+*.vi
+*~
+*.sass-cache
+
+# OS or Editor folders
+.DS_Store
+.cache
+.project
+.settings
+.tmproj
+nbproject
+Thumbs.db
View
@@ -0,0 +1,17 @@
+var index;
+
+index = function(config) {
+ var name, options, _ref;
+
+ options = {
+ reload: config.liveReload.enabled,
+ optimize: (_ref = config.isOptimize) != null ? _ref : false,
+ cachebust: process.env.NODE_ENV !== "production" ? "?b=" + ((new Date()).getTime()) : ''
+ };
+ name = config.isOptimize && config.server.views.html ? "index-optimize" : "index";
+ return function(req, res) {
+ return res.render(name, options);
+ };
+};
+
+exports.index = index;
View
@@ -0,0 +1,33 @@
+var engines, express, routes;
+
+express = require('express');
+
+engines = require('consolidate');
+
+routes = require('./routes');
+
+exports.startServer = function(config, callback) {
+ var app, server;
+
+ app = express();
+ server = app.listen(config.server.port, function() {
+ return console.log("Express server listening on port %d in %s mode", server.address().port, app.settings.env);
+ });
+ app.configure(function() {
+ app.set('port', config.server.port);
+ app.set('views', config.server.views.path);
+ app.engine(config.server.views.extension, engines[config.server.views.compileWith]);
+ app.set('view engine', config.server.views.extension);
+ app.use(express.favicon());
+ app.use(express.bodyParser());
+ app.use(express.methodOverride());
+ app.use(express.compress());
+ app.use(config.server.base, app.router);
+ return app.use(express["static"](config.watch.compiledDir));
+ });
+ app.configure('development', function() {
+ return app.use(express.errorHandler());
+ });
+ app.get('/', routes.index(config));
+ return callback(server);
+};
@@ -0,0 +1,8 @@
+exports.config =
+ modules: ["lint"]
+ watch:
+ sourceDir: "src"
+ compiledDir: "lib"
+ javascriptDir: "" # Note self, possible TODO: fix the need to do this?
+ coffeescript:
+ sourceMap:false
Oops, something went wrong.

0 comments on commit ed2a618

Please sign in to comment.