Dependency and doc updates.

This commit is contained in:
vladikoff 2014-07-11 10:17:51 -07:00
parent f50f1a76cc
commit 53cfd8107e
6 changed files with 34 additions and 11 deletions

View File

@ -1,3 +1,8 @@
v0.6.0:
date: 2014-02-28
changes:
- Bug fixes and dependency updates.
- Adds color log.
v0.5.1: v0.5.1:
date: 2013-07-14 date: 2013-07-14
changes: changes:

View File

@ -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. > Precompile Underscore templates to JST file.
@ -149,6 +149,7 @@ Note that the `interpolate: /\{\{(.+?)\}\}/g` setting above is simply an example
## Release History ## Release History
* 2014-02-28v0.6.0Bug fixes and dependency updates. Adds color log.
* 2013-07-14v0.5.1Display filepath when fails to compile. * 2013-07-14v0.5.1Display filepath when fails to compile.
* 2013-03-06v0.5.0When `namespace` is false and `amd` is true, return templates directly from AMD wrapper. Rename `amdwrapper` option to `amd` to match grunt-contrib-handlebars. * 2013-03-06v0.5.0When `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-15v0.4.1First official release for Grunt 0.4.0. * 2013-02-15v0.4.1First official release for Grunt 0.4.0.
@ -165,4 +166,4 @@ Note that the `interpolate: /\{\{(.+?)\}\}/g` setting above is simply an example
Task submitted by [Tim Branyen](http://tbranyen.com) 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.*

View File

@ -1,7 +1,7 @@
{ {
"name": "grunt-contrib-jst", "name": "grunt-contrib-jst",
"description": "Precompile Underscore templates to JST file.", "description": "Precompile Underscore templates to JST file.",
"version": "0.6.0", "version": "0.7.0-pre",
"homepage": "https://github.com/gruntjs/grunt-contrib-jst", "homepage": "https://github.com/gruntjs/grunt-contrib-jst",
"author": { "author": {
"name": "Grunt Team", "name": "Grunt Team",
@ -21,19 +21,18 @@
} }
], ],
"engines": { "engines": {
"node": ">= 0.8.0" "node": ">= 0.10.0"
}, },
"scripts": { "scripts": {
"test": "grunt test" "test": "grunt test"
}, },
"dependencies": { "dependencies": {
"lodash": "~2.4.1", "lodash": "~2.4.1",
"grunt-lib-contrib": "~0.7.0", "chalk": "~0.5.0"
"chalk": "~0.4.0"
}, },
"devDependencies": { "devDependencies": {
"grunt-contrib-jshint": "~0.8.0", "grunt-contrib-jshint": "~0.10.0",
"grunt-contrib-nodeunit": "~0.3.2", "grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-clean": "~0.5.0", "grunt-contrib-clean": "~0.5.0",
"grunt-contrib-internal": "~0.4.5", "grunt-contrib-internal": "~0.4.5",
"grunt": "~0.4.2" "grunt": "~0.4.2"

View File

@ -16,7 +16,7 @@ module.exports = function(grunt) {
grunt.registerMultiTask('jst', 'Compile underscore templates to JST file', function() { grunt.registerMultiTask('jst', 'Compile underscore templates to JST file', function() {
var lf = grunt.util.linefeed; var lf = grunt.util.linefeed;
var helpers = require('grunt-lib-contrib').init(grunt); var lib = require('./lib/jst');
var options = this.options({ var options = this.options({
namespace: 'JST', namespace: 'JST',
templateSettings: {}, templateSettings: {},
@ -29,7 +29,7 @@ module.exports = function(grunt) {
var nsInfo; var nsInfo;
if (options.namespace !== false) { if (options.namespace !== false) {
nsInfo = helpers.getNamespaceDeclaration(options.namespace); nsInfo = lib.getNamespaceDeclaration(options.namespace);
} }
this.files.forEach(function(f) { this.files.forEach(function(f) {

18
tasks/lib/jst.js Normal file
View File

@ -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')
};
};