Socket
Socket
Sign inDemoInstall

ember-cli-htmlbars

Package Overview
Dependencies
Maintainers
2
Versions
112
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-cli-htmlbars - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

ext/plugins/transform-each-in-to-hash.js

58

ember-addon-main.js

@@ -8,14 +8,8 @@ 'use strict';

included: function (app) {
var projectConfig = app.project.config(app.env);
var htmlbarsEnabled = projectConfig.EmberENV.FEATURES['ember-htmlbars'];
var htmlbarsComponentGeneration = projectConfig.EmberENV.FEATURES['ember-htmlbars-component-generation'];
var self = this;
if (htmlbarsEnabled) {
var htmlbarsOptions = {
disableComponentGeneration: htmlbarsComponentGeneration !== true
};
}
this._super.included.apply(this, arguments);
this.registerTransforms(app.registry);
// ensure that broccoli-ember-hbs-template-compiler is not processing hbs files

@@ -28,6 +22,50 @@ app.registry.remove('template', 'broccoli-ember-hbs-template-compiler');

toTree: function(tree) {
return htmlbarsCompile(tree, { htmlbarsOptions: htmlbarsOptions });
return htmlbarsCompile(tree, { htmlbarsOptions: self.htmlbarsOptions() });
}
})
},
htmlbarsOptions: function() {
var projectConfig = this.app.project.config(this.app.env);
var htmlbarsEnabled = projectConfig.EmberENV.FEATURES['ember-htmlbars'];
var htmlbarsComponentGeneration = projectConfig.EmberENV.FEATURES['ember-htmlbars-component-generation'];
var htmlbarsOptions;
if (htmlbarsEnabled) {
htmlbarsOptions = {
disableComponentGeneration: htmlbarsComponentGeneration !== true,
plugins: {
ast: this.astPlugins()
}
};
}
return htmlbarsOptions;
},
registerTransforms: function(registry) {
var eachTransform = require('./ext/plugins/transform-each-in-to-hash');
var withTransform = require('./ext/plugins/transform-with-as-to-hash');
registry.add('htmlbars-ast-plugin', {
name: 'transform-each-in-to-hash',
plugin: eachTransform
});
registry.add('htmlbars-ast-plugin', {
name: 'transform-with-as-to-hash',
plugin: withTransform
});
},
astPlugins: function() {
var plugins = this.app.registry.load('htmlbars-ast-plugin');
var pluginFunctions = plugins.map(function(plugin) {
return plugin.plugin;
});
return pluginFunctions;
}
}

4

package.json
{
"name": "ember-cli-htmlbars",
"version": "0.3.2",
"version": "0.3.3",
"description": "A library for adding htmlbars to ember CLI",

@@ -34,4 +34,4 @@ "main": "index.js",

"ember-template-compiler": "^1.9.0-alpha",
"htmlbars": "^0.1.11"
"htmlbars": "^0.1.12"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc