Dependency and doc updates.
This commit is contained in:
parent
f50f1a76cc
commit
53cfd8107e
@ -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:
|
||||
|
@ -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.
|
||||
*/
|
||||
|
||||
|
@ -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.
|
||||
|
||||
@ -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.
|
||||
@ -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
package.json
11
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",
|
||||
@ -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"
|
||||
|
@ -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: {},
|
||||
@ -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) {
|
||||
|
18
tasks/lib/jst.js
Normal file
18
tasks/lib/jst.js
Normal 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')
|
||||
};
|
||||
};
|
Loading…
Reference in New Issue
Block a user