Skip to content
This repository was archived by the owner on Apr 4, 2019. It is now read-only.

Commit 9faee4a

Browse files
committed
Inline Handlebars.Utils.escapeExpression into htmlbars-utils.
1 parent 1060a73 commit 9faee4a

File tree

5 files changed

+39
-32
lines changed

5 files changed

+39
-32
lines changed

Brocfile.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var replace = require('broccoli-string-replace');
66
var removeFile = require('broccoli-file-remover');
77
var transpileES6 = require('broccoli-es6-module-transpiler');
88
var jsHint = require('broccoli-jshint');
9-
var handlebarsInlineTree = require('./build-support/handlebars-inliner');
9+
var handlebarsInlinedTrees = require('./build-support/handlebars-inliner');
1010
var getVersion = require('git-repo-version');
1111

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

24-
dependableTrees['handlebars-inliner'] = handlebarsInlineTree;
24+
dependableTrees['syntax-handlebars-inliner'] = handlebarsInlinedTrees.syntax;
25+
dependableTrees['util-handlebars-inliner'] = handlebarsInlinedTrees.util;
2526

2627
function getDependencyTree(depName) {
2728
var dep = dependableTrees[depName];
@@ -136,7 +137,7 @@ for (var packageName in packages.dependencies) {
136137
// jsHint tests
137138
var jsHintLibTree = new Funnel(libTree, {
138139
include: [new RegExp(packageName), new RegExp(packageName + '.+\.js$')],
139-
exclude: [/htmlbars-syntax\/handlebars/],
140+
exclude: [/htmlbars-(syntax|util)\/handlebars/],
140141
destDir: packageName+'-tests/'
141142
});
142143
jsHintLibTree = removeFile(jsHintLibTree, {
Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
var path = require('path');
22
var Funnel = require('broccoli-funnel');
33

4-
var files = [
5-
'handlebars/exception.js',
6-
'handlebars/safe-string.js',
7-
'handlebars/utils.js',
8-
'handlebars/compiler/ast.js',
9-
'handlebars/compiler/base.js',
10-
'handlebars/compiler/helpers.js',
11-
'handlebars/compiler/parser.js',
12-
'handlebars/compiler/visitor.js',
13-
'handlebars/compiler/whitespace-control.js'
14-
];
15-
164
var root = path.join(__dirname, '..', 'node_modules', 'handlebars', 'lib');
175

18-
module.exports = new Funnel(root, {
19-
files: files,
20-
destDir: '/htmlbars-syntax'
21-
});
6+
module.exports = {
7+
syntax: new Funnel(root, {
8+
files: [
9+
'handlebars/utils.js',
10+
'handlebars/exception.js',
11+
'handlebars/safe-string.js',
12+
'handlebars/compiler/ast.js',
13+
'handlebars/compiler/base.js',
14+
'handlebars/compiler/helpers.js',
15+
'handlebars/compiler/parser.js',
16+
'handlebars/compiler/visitor.js',
17+
'handlebars/compiler/whitespace-control.js'
18+
],
19+
destDir: '/htmlbars-syntax'
20+
}),
21+
22+
util: new Funnel(root, {
23+
24+
files: [
25+
'handlebars/utils.js',
26+
'handlebars/safe-string.js'
27+
],
28+
destDir: '/htmlbars-util'
29+
})
30+
}

packages/htmlbars-util/lib/main.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import SafeString from './htmlbars-util/safe-string';
2+
import { escapeExpression } from './htmlbars-util/handlebars/utils';
23

34
export {
4-
SafeString
5+
SafeString,
6+
escapeExpression
57
};
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
function SafeString(string) {
2-
this.string = string;
3-
}
4-
5-
SafeString.prototype.toString = function() {
6-
return "" + this.string;
7-
};
1+
import SafeString from './handlebars/safe-string';
82

93
export default SafeString;
10-

packages/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ module.exports = {
3232
dependencies: {
3333
"htmlbars": {
3434
node: true,
35-
lib: ["handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax", "htmlbars-compiler", "htmlbars-runtime", "morph"]
35+
lib: ["syntax-handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax", "htmlbars-compiler", "htmlbars-runtime", "morph"]
3636
},
3737
"htmlbars-syntax": {
3838
node: true,
39-
lib: ["handlebars-inliner", "htmlbars-util", "simple-html-tokenizer"]
39+
lib: ["syntax-handlebars-inliner", "htmlbars-util", "simple-html-tokenizer"]
4040
},
4141
"htmlbars-compiler": {
4242
node: true,
43-
lib: ["handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax"],
43+
lib: ["syntax-handlebars-inliner", "htmlbars-util", "simple-html-tokenizer", "htmlbars-syntax"],
4444
test: ["htmlbars-runtime", "morph", "htmlbars-test-helpers"]
4545
},
4646
"htmlbars-runtime": {
@@ -49,7 +49,9 @@ module.exports = {
4949
"morph": {
5050
test: ["htmlbars-util", "htmlbars-test-helpers"]
5151
},
52-
"htmlbars-util": { },
52+
"htmlbars-util": {
53+
lib: ["util-handlebars-inliner"]
54+
},
5355
"htmlbars-test-helpers": { }
5456
}
5557
};

0 commit comments

Comments
 (0)