Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var replace = require('broccoli-string-replace');
var removeFile = require('broccoli-file-remover');
var transpileES6 = require('broccoli-es6-module-transpiler');
var jsHint = require('broccoli-jshint');
var handlebarsInlineTree = require('./build-support/handlebars-inliner');
var handlebarsInlinedTrees = require('./build-support/handlebars-inliner');
var getVersion = require('git-repo-version');

var packages = require('./packages');
Expand All @@ -21,7 +21,8 @@ var demos = new Funnel('demos', {
var ES6Tokenizer = new Funnel(bower+'/simple-html-tokenizer/lib/');
dependableTrees['simple-html-tokenizer'] = ES6Tokenizer;

dependableTrees['handlebars-inliner'] = handlebarsInlineTree;
dependableTrees['syntax-handlebars-inliner'] = handlebarsInlinedTrees.syntax;
dependableTrees['util-handlebars-inliner'] = handlebarsInlinedTrees.util;

function getDependencyTree(depName) {
var dep = dependableTrees[depName];
Expand Down Expand Up @@ -136,7 +137,7 @@ for (var packageName in packages.dependencies) {
// jsHint tests
var jsHintLibTree = new Funnel(libTree, {
include: [new RegExp(packageName), new RegExp(packageName + '.+\.js$')],
exclude: [/htmlbars-syntax\/handlebars/],
exclude: [/htmlbars-(syntax|util)\/handlebars/],
destDir: packageName+'-tests/'
});
jsHintLibTree = removeFile(jsHintLibTree, {
Expand Down
41 changes: 25 additions & 16 deletions build-support/handlebars-inliner.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,30 @@
var path = require('path');
var Funnel = require('broccoli-funnel');

var files = [
'handlebars/exception.js',
'handlebars/safe-string.js',
'handlebars/utils.js',
'handlebars/compiler/ast.js',
'handlebars/compiler/base.js',
'handlebars/compiler/helpers.js',
'handlebars/compiler/parser.js',
'handlebars/compiler/visitor.js',
'handlebars/compiler/whitespace-control.js'
];

var root = path.join(__dirname, '..', 'node_modules', 'handlebars', 'lib');

module.exports = new Funnel(root, {
files: files,
destDir: '/htmlbars-syntax'
});
module.exports = {
syntax: new Funnel(root, {
files: [
'handlebars/utils.js',
'handlebars/exception.js',
'handlebars/safe-string.js',
'handlebars/compiler/ast.js',
'handlebars/compiler/base.js',
'handlebars/compiler/helpers.js',
'handlebars/compiler/parser.js',
'handlebars/compiler/visitor.js',
'handlebars/compiler/whitespace-control.js'
],
destDir: '/htmlbars-syntax'
}),

util: new Funnel(root, {

files: [
'handlebars/utils.js',
'handlebars/safe-string.js'
],
destDir: '/htmlbars-util'
})
}
4 changes: 3 additions & 1 deletion packages/htmlbars-util/lib/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import SafeString from './htmlbars-util/safe-string';
import { escapeExpression } from './htmlbars-util/handlebars/utils';

export {
SafeString
SafeString,
escapeExpression
};
9 changes: 1 addition & 8 deletions packages/htmlbars-util/lib/safe-string.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
function SafeString(string) {
this.string = string;
}

SafeString.prototype.toString = function() {
return "" + this.string;
};
import SafeString from './handlebars/safe-string';

export default SafeString;

12 changes: 7 additions & 5 deletions packages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,24 +32,26 @@ module.exports = {
dependencies: {
"htmlbars": {
node: true,
lib: ["handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax", "htmlbars-compiler", "htmlbars-runtime", "morph"]
lib: ["syntax-handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax", "htmlbars-compiler", "htmlbars-runtime", "morph"]
},
"htmlbars-syntax": {
node: true,
lib: ["handlebars-inliner", "htmlbars-util", "simple-html-tokenizer"]
lib: ["syntax-handlebars-inliner", "htmlbars-util", "simple-html-tokenizer"]
},
"htmlbars-compiler": {
node: true,
lib: ["handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax"],
lib: ["syntax-handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax"],
test: ["htmlbars-runtime", "morph", "htmlbars-test-helpers"]
},
"htmlbars-runtime": {
lib: ["htmlbars-util", "morph"]
},
"morph": {
test: ["htmlbars-util", "htmlbars-test-helpers"]
test: ["util-handlebars-inliner", "htmlbars-util", "htmlbars-test-helpers"]
},
"htmlbars-util": {
lib: ["util-handlebars-inliner"]
},
"htmlbars-util": { },
"htmlbars-test-helpers": { }
}
};