broccoli-ember-hbs-template-compiler
Advanced tools
Comparing version 1.6.2 to 1.6.3
13
index.js
var path = require('path'); | ||
var Filter = require('broccoli-filter'); | ||
var Filter = require('broccoli-persistent-filter'); | ||
var jsStringEscape = require('js-string-escape'); | ||
@@ -9,8 +9,10 @@ var compiler = require('ember-template-compiler'); | ||
TemplateCompiler.prototype.constructor = TemplateCompiler; | ||
function TemplateCompiler (inputTree, options) { | ||
function TemplateCompiler (inputTree, _options) { | ||
var options = _options || {}; | ||
options.persist = true; | ||
if (!(this instanceof TemplateCompiler)) { | ||
return new TemplateCompiler(inputTree, options); | ||
} | ||
this.inputTree = inputTree; | ||
this.options = options || {}; | ||
Filter.call(this, inputTree, options); | ||
this.options = options; | ||
} | ||
@@ -20,2 +22,5 @@ | ||
TemplateCompiler.prototype.targetExtension = 'js'; | ||
TemplateCompiler.prototype.baseDir = function() { | ||
return __dirname; | ||
}; | ||
@@ -22,0 +27,0 @@ TemplateCompiler.prototype.processString = function (string, relativePath) { |
@@ -8,5 +8,6 @@ { | ||
"description": "ember.js precompiler for projects that use broccoli", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"scripts": { | ||
"test": "mocha test/**/*.spec.js --reporter tap" | ||
"test": "mocha test/**/*.spec.js --reporter tap", | ||
"test:color": "mocha test/**/*.spec.js" | ||
}, | ||
@@ -28,9 +29,9 @@ "repository": { | ||
"js-string-escape": "^1.0.0", | ||
"broccoli-filter": "^0.1.6", | ||
"broccoli-persistent-filter": "^1.1.1", | ||
"ember-template-compiler": "1.6.1" | ||
}, | ||
"devDependencies": { | ||
"mocha": "^1.21.2" | ||
"mocha": "^2.3.3" | ||
}, | ||
"optionalDependencies": {} | ||
} |
var Ember = require('ember'); | ||
module.exports = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) { | ||
module.exports = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data | ||
/**/) { | ||
this.compilerInfo = [4,'>= 1.0.0']; | ||
@@ -4,0 +5,0 @@ helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {}; |
@@ -1,2 +0,3 @@ | ||
Ember.TEMPLATES['foo'] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) { | ||
Ember.TEMPLATES['foo'] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data | ||
/**/) { | ||
this.compilerInfo = [4,'>= 1.0.0']; | ||
@@ -3,0 +4,0 @@ helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {}; |
import Ember from 'ember'; | ||
export default Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) { | ||
export default Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data | ||
/**/) { | ||
this.compilerInfo = [4,'>= 1.0.0']; | ||
@@ -4,0 +5,0 @@ helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {}; |
@@ -7,10 +7,11 @@ var fs = require('fs'); | ||
describe('broccoli-ember-hbs-template-compiler', function() { | ||
it('it sets inputTree', function() { | ||
var filter = new TemplateFilter('templates'); | ||
assert(filter.inputTree == 'templates'); | ||
}); | ||
function assertSameAsFileContent(string, expectedPath) { | ||
var expected = fs.readFileSync(path.resolve(__dirname, expectedPath)).toString(); | ||
assert.equal(string, expected); | ||
} | ||
it('it sets options', function() { | ||
var filter = new TemplateFilter('templates', {module: true}); | ||
assert(filter.options.module === true); | ||
assert(filter.options.module); | ||
}); | ||
@@ -21,4 +22,4 @@ | ||
var template = filter.processString('foo', './templates/foo.hbs'); | ||
var expected = fs.readFileSync(path.resolve(__dirname, 'expected-global.js')).toString(); | ||
assert(template === expected); | ||
assertSameAsFileContent(template, 'expected-global.js'); | ||
}); | ||
@@ -29,4 +30,4 @@ | ||
var template = filter.processString('foo', './templates/foo.hbs'); | ||
var expected = fs.readFileSync(path.resolve(__dirname, 'expected-module.js')).toString(); | ||
assert(template === expected); | ||
assertSameAsFileContent(template, 'expected-module.js'); | ||
}); | ||
@@ -37,5 +38,5 @@ | ||
var template = filter.processString('foo', './templates/foo.hbs'); | ||
var expected = fs.readFileSync(path.resolve(__dirname, 'expected-commonjs.js')).toString(); | ||
assert(template === expected); | ||
assertSameAsFileContent(template, 'expected-commonjs.js'); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
6704
83
1
+ Addedasync@2.6.4(transitive)
+ Addedasync-disk-cache@1.3.5(transitive)
+ Addedasync-promise-queue@1.0.5(transitive)
+ Addedbinaryextensions@2.3.0(transitive)
+ Addedbroccoli-kitchen-sink-helpers@0.3.1(transitive)
+ Addedbroccoli-persistent-filter@1.4.6(transitive)
+ Addedbroccoli-plugin@1.3.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addededitions@1.3.4(transitive)
+ Addedensure-posix-path@1.1.1(transitive)
+ Addedfs-tree-diff@0.5.9(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedhash-for-dep@1.5.1(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedheimdalljs@0.2.6(transitive)
+ Addedheimdalljs-logger@0.1.10(transitive)
+ Addedis-core-module@2.16.1(transitive)
+ Addedistextorbinary@2.1.0(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedmatcher-collection@1.1.2(transitive)
+ Addedms@2.0.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-posix@1.0.0(transitive)
+ Addedpath-root@0.1.1(transitive)
+ Addedpath-root-regex@0.1.2(transitive)
+ Addedresolve@1.22.10(transitive)
+ Addedresolve-package-path@1.2.7(transitive)
+ Addedrsvp@3.2.1(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedtextextensions@2.6.0(transitive)
+ Addedusername-sync@1.0.3(transitive)
+ Addedwalk-sync@0.3.4(transitive)
- Removedbroccoli-filter@^0.1.6
- Removedbroccoli-filter@0.1.14(transitive)
- Removedbroccoli-kitchen-sink-helpers@0.2.9(transitive)
- Removedbroccoli-writer@0.1.1(transitive)
- Removedmkdirp@0.3.5(transitive)
- Removedwalk-sync@0.1.3(transitive)