Skip to content
This repository has been archived by the owner on Jan 21, 2023. It is now read-only.

Commit

Permalink
Updated documentation
Browse files Browse the repository at this point in the history
Added grunt-exorcise to externalize browserify sourcemaps
Added use strict statements for script sub-generator and fixed pathing issues
  • Loading branch information
larsonjj committed Apr 1, 2014
1 parent dfab128 commit 27c36c7
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 17 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* Removed karma and jshint tests from 'build task' and added to the 'default' task
* Defined the console object within the dynamic dashboard for IE
* Added Jade file check for dynamic dashboard (fixes problem with file types other than .jade causing status classes to fail)
* Externalized sourcemaps for browserify builds (sourcesContent property is null for grunt build tasks, should be fixed after this PR is merged: https://github.com/gruntjs/grunt-contrib-uglify/pull/196)

### v0.3.5:
#### date: 2014-03-18
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ Creates jade file within the `dev/markup/pages` folder by default or within anot
Example:
```bash
## Page
yo yeogurt:markup mypage --type=page
yo yeogurt:markup mypage

## Page using specific Template
yo yeogurt:markup mypage --type=page --template=one-column
yo yeogurt:markup mypage --template=one-column

## Template
yo yeogurt:markup mytemplate --type=template
Expand All @@ -85,7 +85,8 @@ yo yeogurt:markup mycomponent --type=component
```

### Script
If using Browserify or RequireJS, this creates module script within the `dev/scripts/modules` folder by default. Otherwise, the script will be created within `dev/scripts`
If using Browserify or RequireJS, this creates module script within the `dev/scripts/modules` folder by default. Otherwise, the script will be created within `dev/scripts`.
This sub-generator will also create a unit test *Spec file within the `test/spec` folder (enter `grunt test` command to run your tests)

Example:
```bash
Expand Down
36 changes: 26 additions & 10 deletions app/templates/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ module.exports = function(grunt) {
],
tasks: [<% if (jshint) { %>
'newer:jshint',<% } %><% if (jsOption === 'Browserify') { %>
'browserify:server',<% } %>
'browserify:server',
'exorcise:server',<% } %>
'newer:copy:server'
]
},
Expand Down Expand Up @@ -549,25 +550,38 @@ module.exports = function(grunt) {
browserify: {
server: {
options: {
debug: true,
aliasMappings: {
cwd: '<%%= yeoman.dev %>/scripts',
src: ['app.js', 'vendor/**/*.js'],
dest: 'lib'
},
bundleOptions: {
debug: true
}
},
files: {
'<%%= yeoman.server %>/scripts/main.js': ['<%%= yeoman.dev %>/scripts/main.js']
}
},
dist: {
options: {
debug: false
bundleOptions: {
debug: true
}
},
files: {
'<%%= yeoman.dist %>/scripts/main.js': ['<%%= yeoman.dev %>/scripts/main.js']
}
}
},
exorcise: {
server: {
options: {},
files: {
'<%%= yeoman.server %>/scripts/main.js.map': ['<%%= yeoman.server %>/scripts/main.js'],
}
},
dist: {
options: {},
files: {
'<%%= yeoman.dist %>/scripts/main.js.map': ['<%%= yeoman.dist %>/scripts/main.js'],
}
}
},<% } %><% if (jsOption === 'RequireJS') { %>
requirejs: {
dist: {
Expand Down Expand Up @@ -908,7 +922,8 @@ module.exports = function(grunt) {
'copy:server'<% if (useDashboard) { %>,
'build-dashboard'<% } %><% if (jshint) { %>,
'jshint:test'<% } %><% if (jsOption === 'Browserify') { %>,
'browserify:server'<% } %>,
'browserify:server',
'exorcise:server'<% } %>,
'jade:server'<% if (useDashboard) { %>,
'jade:serverDashboard'<% } %><% if (cssOption === 'LESS') { %>,
'less:server'<% if (ieSupport) { %>,
Expand All @@ -928,7 +943,8 @@ module.exports = function(grunt) {
'clean:dist',
'copy:dist',<% if (useDashboard) { %>
'build-dashboard',<% } %><% if (jsOption === 'Browserify') { %>
'browserify:dist',<% } %>
'browserify:dist',
'exorcise:dist',<% } %>
'imagemin',
'svgmin',
'jade:dist',<% if (useDashboard) { %>
Expand Down
1 change: 1 addition & 0 deletions app/templates/_package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"grunt-contrib-htmlmin": "0.2.0",<% if (jsOption ==='RequireJS') { %>
"grunt-contrib-requirejs": "0.4.3",<% } else if (jsOption ==='Browserify') { %>
"grunt-browserify": "2.0.1",
"grunt-exorcise": "0.1.0",
"browserify-shim": "3.3.2",<% } %><% if (jsOption === 'None (Vanilla JavaScript)' || cssOption === 'None (Vanilla CSS)') { %>
"grunt-usemin": "2.1.0",
"grunt-contrib-concat": "0.3.0",<% } %><% if (cssOption === 'None (Vanilla CSS)') { %>
Expand Down
7 changes: 4 additions & 3 deletions script/templates/scriptSpec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* <%= _.slugify(name.toLowerCase()) %>Spec.js
*/

<% if (jsOption === 'RequireJS') { %>'use strict';

define(['modules/<%= camelCase(name) %>', 'jquery'], function(<%= camelCase(name) %>, $) {
Expand All @@ -17,8 +18,7 @@ define(['modules/<%= camelCase(name) %>', 'jquery'], function(<%= camelCase(name

});

});<% } else if (jsOption === 'Browserify') { %>
'use strict';
});<% } else if (jsOption === 'Browserify') { %>'use strict';

var <%= camelCase(name) %> = require('../../dev/scripts/modules/<%= _.slugify(name.toLowerCase()) %>.js');

Expand All @@ -33,7 +33,8 @@ describe('just checking', function() {
});

});
<% } else { %>
<% } else { %>'use strict';

describe('just checking <%= _.slugify(name.toLowerCase()) %>', function() {

it('works for <%= _.slugify(name.toLowerCase()) %>', function() {
Expand Down
2 changes: 1 addition & 1 deletion style/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ StyleGenerator.prototype.files = function files() {
this.template('style.less', 'dev/styles/partials/' + '_' + this._.slugify(this.name.toLowerCase()) + '.scss');
}
else {
this.template('style.less', 'dev/styles/partials/' + this._.slugify(this.name.toLowerCase()) + '.css');
this.template('style.less', 'dev/styles/' + this._.slugify(this.name.toLowerCase()) + '.css');
}
}
};

0 comments on commit 27c36c7

Please sign in to comment.