Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
icholy committed Jun 5, 2012
0 parents commit 4a00a89
Show file tree
Hide file tree
Showing 27 changed files with 59,881 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .gitignore
@@ -0,0 +1,26 @@
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.log
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache

# OS or Editor folders
.DS_Store
.cache
.project
.settings
.tmproj
nbproject
Thumbs.db

# NPM packages folder.
node_modules/

# Brunch folder for temporary files.
tmp/
65 changes: 65 additions & 0 deletions README.md
@@ -0,0 +1,65 @@
# Brunch with js
This is a simple js skeleton for [Brunch](http://brunch.io/).

Main languages are JavaScript,
[Stylus](http://learnboost.github.com/stylus/) and
[Handlebars](http://handlebarsjs.com/).

## Getting started

Clone the repo and run `npm install` & `brunch build`.
See more info on the [official site](http://brunch.io)

## Overview

config.coffee
README.md
/app/
/assets/
index.html
images/
/lib/
models/
styles/
views/
templates/
application.js
initialize.js
/test/
functional/
unit/
/vendor/
scripts/
backbone.js
jquery.js
console-helper.js
underscore.js
styles/
normalize.css
helpers.css

* `config.coffee` contains configuration of your app. You can set plugins /
languages that would be used here.
* `app/assets` contains images / static files. Contents of the directory would
be copied to `build/` without change.
Other `app/` directories could contain files that would be compiled. Languages,
that compile to JS (coffeescript, roy etc.) or js files and located in app are
automatically wrapped in module closure so they can be loaded by
`require('module/location')`.
* `app/models` & `app/views` contain base classes your app should inherit from.
* `test/` contains feature & unit tests.
* `vendor/` contains all third-party code. The code wouldn’t be wrapped in
modules, it would be loaded instantly instead.

This all will generate `public/` (by default) directory when `brunch build` or `brunch watch` is executed.

## Other
Versions of software the skeleton uses:

* jQuery 1.7.2
* Backbone 0.9.1
* Underscore 1.3.3
* HTML5Boilerplate 3.0.3

The license is [public domain](http://creativecommons.org/publicdomain/zero/1.0/).
Use it however you want.
10 changes: 10 additions & 0 deletions app/app.js
@@ -0,0 +1,10 @@

// Application bootstrapper.

var App = Em.Application.create({
Views : Em.Namespace.create(),
Models : Em.Namespace.create(),
Controllers : Em.Namespace.create()
});

module.exports = App;
Empty file added app/assets/images/.gitkeep
Empty file.
24 changes: 24 additions & 0 deletions app/assets/index.html
@@ -0,0 +1,24 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Example brunch application</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="stylesheets/app.css">
<script src="javascripts/vendor.js"></script>
<script src="javascripts/app.js"></script>
<script>require('initialize');</script>
</head>
<body>
<script type="text/x-handlebars">
{{#view App.Views.MyView}}
<h1>Ember User</h1>
<p>{{view.stuff.fullName}}</p>
{{/view}}
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions app/controllers.js
@@ -0,0 +1,3 @@
// Load all your controllers here

require('controllers/my_controller');
11 changes: 11 additions & 0 deletions app/controllers/my_controller.js
@@ -0,0 +1,11 @@

require('models/my_model');

var App = require('app');

App.myController = Em.Object.create({
theMan: App.Models.MyModel.create({
firstName: 'Bob',
lastName: 'Marley'
})
});
16 changes: 16 additions & 0 deletions app/initialize.js
@@ -0,0 +1,16 @@

require('models');
require('controllers');
require('views');

var App = require('app');

// ENV.VIEW_PRESERVES_CONTEXT = true;
// ENV.CP_DEFAULT_CACHEABLE = true;

App.reopen({
ready: function(){
this._super();
console.log('initializing ...');
}
});
1 change: 1 addition & 0 deletions app/lib/view_helper.js
@@ -0,0 +1 @@
// Put your handlebars.js helpers here.
1 change: 1 addition & 0 deletions app/models.js
@@ -0,0 +1 @@
require('models/my_model');
Empty file added app/models/.gitkeep
Empty file.
12 changes: 12 additions & 0 deletions app/models/my_model.js
@@ -0,0 +1,12 @@
var App = require('app');

App.Models.MyModel = Em.Object.extend({

firstName : null,
lastName : null,

fullName: function(){
return this.get('firstName') + ' ' + this.get('lastName');
}.property('firstName', 'lastName')

});
1 change: 1 addition & 0 deletions app/views.js
@@ -0,0 +1 @@
require('views/my_view');
12 changes: 12 additions & 0 deletions app/views/my_view.js
@@ -0,0 +1,12 @@
require('controllers/my_controller');

var App = require('app');

App.Views.MyView = Em.View.extend({

stuffBinding: 'App.myController',

click: function(e){
console.log('I was clicked ', e);
}
});
26 changes: 26 additions & 0 deletions app/views/styles/application.less
@@ -0,0 +1,26 @@
// nib is a powerful lib for stylus that provides cross-browser css3 mixins.
// No more vendor prefixes. http://visionmedia.github.com/nib/
//@import 'library'

// Apply a natural box layout model to all elements.
// http://paulirish.com/2012/box-sizing-border-box-ftw/
* {
box-sizing: border-box;
}

#home-view {
width: 480px;
margin: 0 auto;
}

h1 {
padding-left: 138px;
margin-bottom: 0.5em;
font-size: 5em;
color: #fff;
border-radius: 5px;
background-color: #91a2c0;
background-image: url('http://brunch.io/images/brunch.png');
background-repeat: no-repeat;
background-position: 2px;
}
25 changes: 25 additions & 0 deletions config.coffee
@@ -0,0 +1,25 @@
exports.config =
# See docs at http://brunch.readthedocs.org/en/latest/config.html.
files:
javascripts:
defaultExtension: 'js'
joinTo:
'javascripts/app.js': /^app/
'javascripts/vendor.js': /^vendor/
order:
before: [
'vendor/scripts/console-helper.js',
'vendor/scripts/jquery-1.7.2.js',
'vendor/scripts/ember-0.9.8.1.js'
]

stylesheets:
defaultExtension: 'less'
joinTo: 'stylesheets/app.css'
order:
before: ['vendor/styles/normalize.css']
after: ['vendor/styles/helpers.css']

# templates:
# defaultExtension: 'hbs'
# joinTo: 'javascripts/app.js'
30 changes: 30 additions & 0 deletions package.json
@@ -0,0 +1,30 @@
{
"author": "Your Name",
"name": "package-name",
"description": "Package description",
"version": "0.0.1",
"homepage": "",
"repository": {
"type": "git",
"url": ""
},
"engines": {
"node": "~0.6.10"
},
"scripts": {
"start": "brunch watch --server"
},
"dependencies": {
"javascript-brunch": "> 1.0 < 1.3",

"css-brunch": "> 1.0 < 1.3",
"less-brunch": "> 1.0 < 1.3",

"uglify-js-brunch": "> 1.0 < 1.3",
"clean-css-brunch": "> 1.0 < 1.3"
},
"devDependencies": {
"mocha": "0.14.0",
"expect.js": "0.1.2"
}
}
24 changes: 24 additions & 0 deletions public/index.html
@@ -0,0 +1,24 @@
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Example brunch application</title>
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="stylesheets/app.css">
<script src="javascripts/vendor.js"></script>
<script src="javascripts/app.js"></script>
<script>require('initialize');</script>
</head>
<body>
<script type="text/x-handlebars">
{{#view App.Views.MyView}}
<h1>Ember User</h1>
<p>{{view.stuff.fullName}}</p>
{{/view}}
</script>
</body>
</html>

0 comments on commit 4a00a89

Please sign in to comment.