Skip to content

Commit

Permalink
Dependency and doc updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
vladikoff committed Jul 11, 2014
1 parent f50f1a7 commit 53cfd81
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
@@ -1,3 +1,8 @@
v0.6.0:
date: 2014-02-28
changes:
- Bug fixes and dependency updates.
- Adds color log.
v0.5.1:
date: 2013-07-14
changes:
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Expand Up @@ -2,7 +2,7 @@
* grunt-contrib-jst
* http://gruntjs.com/
*
* Copyright (c) 2014 Tim Branyen, contributors
* Copyright (c) 2014 Tim Branyen, contributors
* Licensed under the MIT license.
*/

Expand Down
5 changes: 3 additions & 2 deletions README.md
@@ -1,4 +1,4 @@
# grunt-contrib-jst v0.6.0 [![Build Status](https://travis-ci.org/gruntjs/grunt-contrib-jst.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jst)
# grunt-contrib-jst v0.7.0-pre [![Build Status: Linux](https://travis-ci.org/gruntjs/grunt-contrib-jst.png?branch=master)](https://travis-ci.org/gruntjs/grunt-contrib-jst)

> Precompile Underscore templates to JST file.
Expand Down Expand Up @@ -149,6 +149,7 @@ Note that the `interpolate: /\{\{(.+?)\}\}/g` setting above is simply an example

## Release History

* 2014-02-28   v0.6.0   Bug fixes and dependency updates. Adds color log.
* 2013-07-14   v0.5.1   Display filepath when fails to compile.
* 2013-03-06   v0.5.0   When `namespace` is false and `amd` is true, return templates directly from AMD wrapper. Rename `amdwrapper` option to `amd` to match grunt-contrib-handlebars.
* 2013-02-15   v0.4.1   First official release for Grunt 0.4.0.
Expand All @@ -165,4 +166,4 @@ Note that the `interpolate: /\{\{(.+?)\}\}/g` setting above is simply an example

Task submitted by [Tim Branyen](http://tbranyen.com)

*This file was generated on Sat Mar 01 2014 03:29:46.*
*This file was generated on Fri Jul 11 2014 10:15:42.*
11 changes: 5 additions & 6 deletions package.json
@@ -1,7 +1,7 @@
{
"name": "grunt-contrib-jst",
"description": "Precompile Underscore templates to JST file.",
"version": "0.6.0",
"version": "0.7.0-pre",
"homepage": "https://github.com/gruntjs/grunt-contrib-jst",
"author": {
"name": "Grunt Team",
Expand All @@ -21,19 +21,18 @@
}
],
"engines": {
"node": ">= 0.8.0"
"node": ">= 0.10.0"
},
"scripts": {
"test": "grunt test"
},
"dependencies": {
"lodash": "~2.4.1",
"grunt-lib-contrib": "~0.7.0",
"chalk": "~0.4.0"
"chalk": "~0.5.0"
},
"devDependencies": {
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-nodeunit": "~0.3.2",
"grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-internal": "~0.4.5",
"grunt": "~0.4.2"
Expand Down
4 changes: 2 additions & 2 deletions tasks/jst.js
Expand Up @@ -16,7 +16,7 @@ module.exports = function(grunt) {

grunt.registerMultiTask('jst', 'Compile underscore templates to JST file', function() {
var lf = grunt.util.linefeed;
var helpers = require('grunt-lib-contrib').init(grunt);
var lib = require('./lib/jst');
var options = this.options({
namespace: 'JST',
templateSettings: {},
Expand All @@ -29,7 +29,7 @@ module.exports = function(grunt) {

var nsInfo;
if (options.namespace !== false) {
nsInfo = helpers.getNamespaceDeclaration(options.namespace);
nsInfo = lib.getNamespaceDeclaration(options.namespace);
}

this.files.forEach(function(f) {
Expand Down
18 changes: 18 additions & 0 deletions tasks/lib/jst.js
@@ -0,0 +1,18 @@
exports.getNamespaceDeclaration = function(ns) {
var output = [];
var curPath = 'this';
if (ns !== 'this') {
var nsParts = ns.split('.');
nsParts.forEach(function(curPart, index) {
if (curPart !== 'this') {
curPath += '[' + JSON.stringify(curPart) + ']';
output.push(curPath + ' = ' + curPath + ' || {};');
}
});
}

return {
namespace: curPath,
declaration: output.join('\n')
};
};

0 comments on commit 53cfd81

Please sign in to comment.