Skip to content

Commit ec450af

Browse files
committed
Ensure private components in src/ui/components are not nested in -components.
1 parent d1b3ff3 commit ec450af

3 files changed

Lines changed: 47 additions & 1 deletion

File tree

lib/models/file-info.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ Object.defineProperty(FileInfo.prototype, 'destRelativePath', {
141141

142142
if (this._privateRenderableInvoker) {
143143
var invokerLocation = path.dirname(this._privateRenderableInvoker.destRelativePath);
144-
var privateCollection = invokerLocation.indexOf('-components') > -1 ? '' : '-components';
144+
var invokerInComponentsCollection = this._privateRenderableInvoker.collection === 'components';
145+
var invokerInPrivateCollection = invokerLocation.indexOf('-components') > -1;
146+
var privateCollection = invokerInPrivateCollection || invokerInComponentsCollection? '' : '-components';
145147

146148
baseRelativePath = path.join(
147149
invokerLocation,
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
module.exports = {
2+
app: {
3+
templates: {
4+
components: {
5+
'x-button.hbs': 'x-button template',
6+
'x-foo.hbs': 'x-foo template: {{x-bar}}',
7+
'x-bar.hbs': 'x-bar template'
8+
},
9+
posts: {
10+
'edit.hbs': '{{x-button}}\n{{#x-button}}\n foo\n{{/x-button}}'
11+
}
12+
}
13+
},
14+
15+
tests: {
16+
17+
}
18+
};
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = {
2+
src: {
3+
ui: {
4+
components: {
5+
'x-foo': {
6+
'template.hbs': 'x-foo template: {{x-bar}}',
7+
'x-bar': {
8+
'template.hbs': 'x-bar template'
9+
}
10+
}
11+
},
12+
routes: {
13+
posts: {
14+
edit: {
15+
'-components': {
16+
'x-button': {
17+
'template.hbs': 'x-button template'
18+
}
19+
},
20+
'template.hbs': '{{x-button}}\n{{#x-button}}\n foo\n{{/x-button}}'
21+
}
22+
}
23+
}
24+
}
25+
}
26+
};

0 commit comments

Comments
 (0)