mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 17:00:04 +02:00
BOOM react jsx support added and linting fixed
This commit is contained in:
parent
a1024b22f2
commit
84e8ce71ae
3 changed files with 27 additions and 9 deletions
21
Gruntfile.js
21
Gruntfile.js
|
@ -35,9 +35,7 @@ var devDependencies = [
|
||||||
module.exports = function(grunt) {
|
module.exports = function(grunt) {
|
||||||
// eventually have sound...?
|
// eventually have sound...?
|
||||||
grunt.registerTask('compliment', 'Stay motivated!', function() {
|
grunt.registerTask('compliment', 'Stay motivated!', function() {
|
||||||
var defaults = ['Awesome!!'];
|
var compliments = grunt.config('compliment.compliments');
|
||||||
|
|
||||||
var compliments = grunt.config('compliment.compliments') || defaults;
|
|
||||||
var index = Math.floor(Math.random() * compliments.length);
|
var index = Math.floor(Math.random() * compliments.length);
|
||||||
|
|
||||||
grunt.log.writeln(compliments[index]);
|
grunt.log.writeln(compliments[index]);
|
||||||
|
@ -45,7 +43,7 @@ module.exports = function(grunt) {
|
||||||
|
|
||||||
grunt.registerTask('lintStrings', 'Find if an INTL string doesnt exist', function() {
|
grunt.registerTask('lintStrings', 'Find if an INTL string doesnt exist', function() {
|
||||||
var child_process = require('child_process');
|
var child_process = require('child_process');
|
||||||
var output = child_process.exec('node src/js/intl/checkStrings', function(err, output) {
|
child_process.exec('node src/js/intl/checkStrings', function(err, output) {
|
||||||
grunt.log.writeln(output);
|
grunt.log.writeln(output);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -110,7 +108,7 @@ module.exports = function(grunt) {
|
||||||
'src/__tests__/spec/*.js',
|
'src/__tests__/spec/*.js',
|
||||||
'src/js/**/*.js',
|
'src/js/**/*.js',
|
||||||
'src/js/**/**/*.js',
|
'src/js/**/**/*.js',
|
||||||
'src/levels/**/*.js',
|
'src/levels/**/*.js'
|
||||||
],
|
],
|
||||||
options: {
|
options: {
|
||||||
curly: true,
|
curly: true,
|
||||||
|
@ -209,28 +207,35 @@ module.exports = function(grunt) {
|
||||||
},
|
},
|
||||||
browserify: {
|
browserify: {
|
||||||
options: {
|
options: {
|
||||||
|
transform: [require('grunt-react').browserify],
|
||||||
ignore: [
|
ignore: [
|
||||||
'src/__tests__/casperjs/*.js',
|
'src/__tests__/casperjs/*.js',
|
||||||
'src/js/__tests__/create.js',
|
'src/js/__tests__/create.js',
|
||||||
'src/js/__tests__/*.js'
|
'src/js/__tests__/*.js'
|
||||||
],
|
]
|
||||||
},
|
},
|
||||||
dist: {
|
dist: {
|
||||||
files: {
|
files: {
|
||||||
'build/bundle.js': ['src/**/*.js', 'src/js/**/*.js'],
|
'build/bundle.js': [
|
||||||
|
'src/**/*.js',
|
||||||
|
'src/**/*.jsx',
|
||||||
|
'src/js/**/*.js',
|
||||||
|
'src/js/**/*.jsx'
|
||||||
|
]
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// all my npm helpers
|
// all my npm helpers
|
||||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
grunt.loadNpmTasks('grunt-jsxhint');
|
||||||
grunt.loadNpmTasks('grunt-browserify');
|
grunt.loadNpmTasks('grunt-browserify');
|
||||||
grunt.loadNpmTasks('grunt-hash');
|
grunt.loadNpmTasks('grunt-hash');
|
||||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||||
grunt.loadNpmTasks('grunt-shell-spawn');
|
grunt.loadNpmTasks('grunt-shell-spawn');
|
||||||
grunt.loadNpmTasks('grunt-jasmine-node');
|
grunt.loadNpmTasks('grunt-jasmine-node');
|
||||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||||
|
grunt.loadNpmTasks('grunt-react');
|
||||||
|
|
||||||
grunt.registerTask('build',
|
grunt.registerTask('build',
|
||||||
['clean', 'browserify', 'uglify', 'hash', 'buildIndex', 'shell:gitAdd', 'jasmine_node', 'jshint', 'lintStrings', 'compliment']
|
['clean', 'browserify', 'uglify', 'hash', 'buildIndex', 'shell:gitAdd', 'jasmine_node', 'jshint', 'lintStrings', 'compliment']
|
||||||
|
|
|
@ -16,11 +16,13 @@
|
||||||
"grunt-contrib-uglify": "~0.2.7",
|
"grunt-contrib-uglify": "~0.2.7",
|
||||||
"grunt-hash": "~0.5.0",
|
"grunt-hash": "~0.5.0",
|
||||||
"grunt-jasmine-node": "~0.1.0",
|
"grunt-jasmine-node": "~0.1.0",
|
||||||
|
"grunt-jsxhint": "^0.5.0",
|
||||||
"grunt-lib-phantomjs": "~0.4.0",
|
"grunt-lib-phantomjs": "~0.4.0",
|
||||||
"grunt-react": "^0.12.1",
|
"grunt-react": "^0.12.1",
|
||||||
"grunt-shell-spawn": "~0.3.0",
|
"grunt-shell-spawn": "~0.3.0",
|
||||||
"jasmine-node": "~1.12.0",
|
"jasmine-node": "~1.12.0",
|
||||||
"prompt": "0.2.9"
|
"prompt": "0.2.9",
|
||||||
|
"react-tools": "^0.13.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"backbone": "^1.1.2",
|
"backbone": "^1.1.2",
|
||||||
|
|
11
src/js/react_views/TestView.jsx
Normal file
11
src/js/react_views/TestView.jsx
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
var React = require('react');
|
||||||
|
|
||||||
|
var MyComponent = React.createClass({
|
||||||
|
render: function() {
|
||||||
|
return (
|
||||||
|
<p>Howdy</p>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = MyComponent;
|
Loading…
Add table
Add a link
Reference in a new issue