Skip to content

Commit 54e087e

Browse files
committed
fix(component name parsing): only switching out the word 'compoent/' if it is what starts the path, not for nest options. This should be revisited with unification Closes #236
1 parent 2625b05 commit 54e087e

6 files changed

Lines changed: 19 additions & 1 deletion

File tree

lib/component-names.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var md5 = require('md5');
66
module.exports = {
77
path: function(actualPath, classicStyleDir) {
88
var terminator = '/';
9-
var pathSegementToRemove = 'components/';
9+
var pathSegementToRemove = /^components\//;
1010

1111
if (actualPath.includes(classicStyleDir)) {
1212
terminator = '.';
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { test } from 'qunit';
2+
import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
3+
4+
moduleForAcceptance(`Acceptance | Unique Paths`);
5+
6+
test('base rule followed', function(assert) {
7+
visit(`/unique-component-paths`);
8+
9+
andThen(function() {
10+
assert.equal(find('h1').css('color'), 'rgb(0, 0, 14)');
11+
});
12+
});

tests/dummy/app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default Ember.Router.extend({
1515
this.route('no-style-files-yet');
1616
this.route('classic-structure');
1717
this.route('classic-structure-nested');
18+
this.route('unique-component-paths');
1819

1920
this.route('addon', function() {
2021
this.route('scss');
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
h1 {
2+
color: rgb(0, 0, 14);
3+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1> my color should be rgb(0, 0, 14) </h1>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{unique-component-paths/-components/test-component}}

0 commit comments

Comments
 (0)