Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Aura TodoMVC compatible with latest Aura #3

Open
wants to merge 6 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .bowerrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"directory" : "app/components",
"json" : "component.json"
"directory" : "app/bower_components",
"json" : "bower.json"
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ npm-debug.log
/lib
/tmp
/dist

20 changes: 10 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ module.exports = function (grunt) {
// default watch configuration
watch: {
widgets: {
files: ['app/widgets/**/*.js'],
files: ['app/aura_components/**/*.js'],
tasks: ['concat']
},
handlebars: {
files: ['app/widgets/**/*.hbs'],
files: ['app/aura_components/**/*.hbs'],
tasks: ['handlebars']
},
livereload: {
Expand All @@ -43,20 +43,20 @@ module.exports = function (grunt) {
jshint: {
all: [
'app/scripts/[^templates].js',
'app/widgets/**/*.js'
'app/aura_components/**/*.js'
]
},

handlebars: {
compile: {
files: {
"app/scripts/templates.js" : ["app/widgets/**/*.hbs"]
"app/scripts/templates.js" : ["app/aura_components/**/*.hbs"]
},
options: {
wrapped: true,
namespace: "Aura.templates",
processName: function (filename) {
return filename.replace(/^app\/widgets\//, '').replace(/\.hbs$/, '');
return filename.replace(/^app\/aura_components\//, '').replace(/\.hbs$/, '');
}
}
}
Expand Down Expand Up @@ -110,8 +110,8 @@ module.exports = function (grunt) {
dist: {
files: {
'dist/application.css': [
'app/components/ratchet/dist/ratchet.css',
'app/components/font-awesome/css/font-awesome.css',
'app/bower_components/ratchet/dist/ratchet.css',
'app/bower_components/font-awesome/css/font-awesome.css',
'app/styles/*.css'
]
}
Expand All @@ -124,7 +124,7 @@ module.exports = function (grunt) {
{ dest: 'dist/index.php', src: 'dist/index.html' },
{ cwd: 'app/', dest: 'dist/', src: ['.htaccess', 'robots.txt'], expand: true },
{
cwd: 'app/components/font-awesome/font/',
cwd: 'app/bower_components/font-awesome/font/',
dest: 'dist/font/',
filter: 'isFile',
src: '*',
Expand Down Expand Up @@ -161,8 +161,8 @@ module.exports = function (grunt) {
separator: "\n\n\n\n//--------\n\n\n"
},
dist: {
src: ['app/widgets/**/*.js'],
dest: 'app/scripts/widgets.js'
src: ['app/aura_components/**/*.js'],
dest: 'app/scripts/components.js'
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
define(['components/aura/lib/aura'], function(Aura) {
define(['bower_components/aura/lib/aura'], function(Aura) {
Aura()
.use('extensions/aura-backbone')
.use('extensions/aura-localstorage')
.use('extensions/aura-handlebars')
.use(function(app) {
window.Todos = app.createSandbox();
window.Todos = app.sandboxes.create();
})
.start({ widgets: 'body' }).then(function() {
console.warn("Aura started !");
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<header id="header" data-aura-widget="new-todo"></header>
<header id="header" data-aura-component="new-todo"></header>

<section id="main">
<input id="toggle-all" type="checkbox">
Expand All @@ -7,4 +7,4 @@
</ul>
</section>

<footer id="footer" data-aura-widget='stats'></footer>
<footer id="footer" data-aura-component='stats'></footer>
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ define(['underscore', 'hbs!./list', 'hbs!./item'], function(_, listTemplate, ite
this.taskViews = {};
var sandbox = this.sandbox;
var handle = _.bind(this.handleTaskAction, this);
_.bindAll(this);
_.bindAll(this,
'render','getTask','getCompletedTasks','getStats','clearCompleted',
'handleTaskAction','addTask','toggleTask','destroyTask'
);
_.each(['add', 'destroy', 'toggle'], function(action) {
sandbox.on('tasks.' + action, handle);
});
Expand Down
22 changes: 22 additions & 0 deletions app/bower_components/aura/.bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "aura",
"version": "0.9.1",
"main": "lib/aura.js",
"dependencies": {
"jquery": "~1.10.x",
"underscore": "~1.5.x",
"eventemitter2": "~0.4.11",
"requirejs": "~2.1.4",
"requirejs-text": "~2.0.5"
},
"homepage": "https://github.com/aurajs/aura",
"_release": "0.9.1",
"_resolution": {
"type": "version",
"tag": "v0.9.1",
"commit": "12457321d2764d4b86a2f766d9d4608af1cbf802"
},
"_source": "git://github.com/aurajs/aura.git",
"_target": "*",
"_originalSource": "aura"
}
4 changes: 4 additions & 0 deletions app/bower_components/aura/.bowerrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"directory": "bower_components",
"json": "bower.json"
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.DS_Store
node_modules
bower_components
components
npm-debug.log
dist
.sass-cache
/docs/
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,26 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-yuidoc');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-mocha');
grunt.loadNpmTasks('grunt-dox');

var PORT = 8899;

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*!\n' +
'* <%= pkg.name %>\n' +
'* v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
'<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' +
'* (c) <%= pkg.author.name %>;' +
' <%= _.pluck(pkg.licenses, "type").join(", ") %> License\n' +
'* Created by: <%= _.pluck(pkg.maintainers, "name").join(", ") %>\n' +
'* Contributors: <%= _.pluck(pkg.contributors, "name").join(", ") %>\n' +
'*/'
},
connect: {
server: {
options: {
Expand All @@ -24,12 +37,13 @@ module.exports = function (grunt) {
compile: {
options: {
baseUrl: '.',
optimize: 'none',
optimize: 'uglify2',
preserveLicenseComments: false,
paths: {
aura: 'lib',
jquery: 'empty:',
underscore: 'empty:',
eventemitter: 'components/eventemitter2/lib/eventemitter2'
eventemitter: 'bower_components/eventemitter2/lib/eventemitter2'
},
shim: {
underscore: {
Expand All @@ -41,20 +55,38 @@ module.exports = function (grunt) {
'aura/aura.extensions',
'aura/ext/debug',
'aura/ext/mediator',
'aura/ext/widgets'
'aura/ext/components'
],
exclude: ['jquery'],
out: 'dist/aura.js'
}
}
},
dox: {
concat: {
options: {
title: "AuraJS documentation"
stripBanners: true,
banner:
"/*! Aura v<%= pkg.version %> | " +
"(c) 2013 The Aura authors | " +
"MIT License " +
"*/\n"
},
dist: {
src: ['dist/aura.js'],
dest: 'dist/aura.js',
},
files: {
src: ['lib/'],
dest: 'docs'
},
yuidoc: {
compile: {
name: "<%= pkg.name %>",
description: "<%= pkg.description %>",
version: "<%= pkg.version %>",
url: "<%= pkg.homepage %>",
options: {
paths: [ "lib" ],
outdir: "docs",
parseOnly: true
}
}
},
jshint: {
Expand Down Expand Up @@ -87,6 +119,6 @@ module.exports = function (grunt) {
});

grunt.registerTask('spec', ['jshint', 'mocha']);
grunt.registerTask('build', ['connect', 'spec', 'requirejs','dox']);
grunt.registerTask('build', ['connect', 'spec', 'requirejs', 'concat']);
grunt.registerTask('default', ['connect', 'spec', 'watch']);
};
File renamed without changes.
Loading