Skip to content

Commit

Permalink
Merge pull request #1 from sgmeyer/Development
Browse files Browse the repository at this point in the history
v0.1.0 release
  • Loading branch information
sgmeyer committed Oct 17, 2013
2 parents 576130d + ede8ab9 commit abf93a5
Show file tree
Hide file tree
Showing 9 changed files with 10,898 additions and 50 deletions.
6 changes: 6 additions & 0 deletions app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ CraftyGenerator.prototype.app = function app() {
};

CraftyGenerator.prototype.projectfiles = function projectfiles() {
this.mkdir('app/web/css');
this.mkdir('app/web/images');

this.copy('_.editorconfig', '.editorconfig');
this.copy('_.jshintrc', '.jshintrc');

Expand All @@ -47,6 +50,9 @@ CraftyGenerator.prototype.projectfiles = function projectfiles() {
this.copy('src/entities/base/_BaseEntity.js', 'app/src/entities/base/BaseEntity.js');
this.copy('src/interfaces/_info.js', 'app/src/interfaces/info.js');
this.copy('src/scenes/_main.js', 'app/src/scenes/main.js');

this.copy('src/libs/crafty/_crafty.js', 'app/src/libs/crafty/crafty.js');
this.copy('src/libs/crafty/_crafty.min.js', 'app/src/libs/crafty/crafty.min.js');
};

CraftyGenerator.prototype.gruntfileJSON = function gruntfile() {
Expand Down
69 changes: 42 additions & 27 deletions app/templates/_Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,38 @@ var mountFolder = function (connect, dir) {
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: ['build/'],
clean: ['dist'],
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
},
build: {
src: ['src/**/*.js', '!src/libs/**'],
dest: 'build/src/<%= pkg.name %>.min.js'
}
build: {
files: [{
expand: true,
cwd: 'app/src/',
src: ['**/*.js', '!libs/**/*'],
dest: 'dist/src/',
ext: 'a.js'
},
{
expand: true,
flatten: true,
cwd: 'app/src/libs/',
src: ['jquery/jquery.js', 'modernizr/modernizr.js'],
dest: 'dist/src/libs/',
ext: '.min.js'
},
{
'dist/src/libs/requirejs-jquery.min.js': ['app/src/libs/requirejs-jquery/parts/require.js', 'app/src/libs/requirejs-jquery/parts/query.js']
}]
}
},
copy: {
dev: {
dist: {
files: [{
src: 'src/libs/*.js',
dest: 'build/'
expand: true,
flatten: true,
cwd: 'app/src/libs/',
src: ['backbone/backbone-min.js', 'backbone/backbone-min.map', 'underscore/underscore-min.js', 'underscore/underscore-min.map', 'crafty/crafty.min.js'],
dest: 'dist/src/libs/',
filter: 'isFile'
}]
}
},
Expand All @@ -29,14 +46,13 @@ module.exports = function(grunt) {
options: {
port: 8888,
hostname: 'localhost',
base: "app"
base: "app/"
}
},
livereload: {
options: {
middleware: function (connect) {
return [
require('connect-livereload')({port: LIVERELOAD_PORT}),
return [require('connect-livereload')({port: LIVERELOAD_PORT}),
mountFolder(connect, '.')
];
}
Expand All @@ -49,16 +65,14 @@ module.exports = function(grunt) {
}
},
watch: {
options: {
nospawn: true,
livereload: LIVERELOAD_PORT
},
livereload: {
files: [
'app/index.html'
],
tasks: ['build']
}
html: {
options: { livereload: true },
files: ['app/index.html'],
},
js: {
options: { livereload: true },
files: ['app/src/**/*.js']
}
}
});

Expand All @@ -67,9 +81,10 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-livereload');
grunt.loadNpmTasks('grunt-open');

grunt.registerTask('build', ['clean', 'uglify', 'copy']);
grunt.registerTask('server', ['build', 'connect:server', 'open', 'watch']);
grunt.registerTask('default', ['build', 'server']);
}
grunt.registerTask('server', ['connect:server', 'open', 'watch']);
grunt.registerTask('default', ['server']);
}
3 changes: 1 addition & 2 deletions app/templates/_bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"underscore": "~1.5.2",
"backbone": "~1.1.0",
"modernizr": "~2.6.2",
"requirejs-jquery": "~0.25.0",
"crafty": "~0.5.4"
"requirejs-jquery": "~0.25.0"
}
}
10 changes: 5 additions & 5 deletions app/templates/_index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@
<!-- Add your site or application content here -->

<script src="src/libs/jquery/jquery.js"></script>
<script src="src/libs/crafty/crafty-local.js"></script>
<script src="src/libs/underscore/underscore-min.js"></script>
<script src="src/libs/backbone/backbone-min.js"></script>
<script src="src/libs/crafty/crafty.js"></script>
<script src="src/libs/underscore/underscore.js"></script>
<script src="src/libs/backbone/backbone.js"></script>
<script src="src/libs/requirejs-jquery/parts/require.js"></script>
<script src="src/game.js"></script>

<script type="text/javascript">
gameContainer = {
env : 'dev',
Expand All @@ -48,5 +47,6 @@
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
<script src="//localhost:35729/livereload.js"></script>
</body>
</html>
</html>
5 changes: 2 additions & 3 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-watch": "~0.5.3",
"grunt-open": "~0.2.2",
"connect-livereload": "~0.3.0"
"grunt-open": "~0.2.2"
}
}
}
Loading

0 comments on commit abf93a5

Please sign in to comment.