Skip to content

Commit 6b7dea8

Browse files
Broccofilipesilva
authored andcommitted
chore(barrels): remove barrels from blueprints
Close #1658
1 parent 69ccdc6 commit 6b7dea8

File tree

14 files changed

+0
-318
lines changed

14 files changed

+0
-318
lines changed

addon/ng2/blueprints/class/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const stringUtils = require('ember-cli-string-utils');
22
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
3-
var addBarrelRegistration = require('../../utilities/barrel-management');
43

54
module.exports = {
65
description: '',
@@ -40,12 +39,5 @@ module.exports = {
4039
return this.fileName;
4140
}
4241
};
43-
},
44-
45-
afterInstall: function() {
46-
return addBarrelRegistration(
47-
this,
48-
this.generatePath,
49-
this.fileName);
5042
}
5143
};

addon/ng2/blueprints/component/files/__path__/index.ts

-1
This file was deleted.

addon/ng2/blueprints/component/files/__path__/shared/index.ts

Whitespace-only changes.

addon/ng2/blueprints/component/index.js

-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var path = require('path');
22
var chalk = require('chalk');
33
var Blueprint = require('ember-cli/lib/models/blueprint');
44
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
5-
var addBarrelRegistration = require('../../utilities/barrel-management');
65
var getFiles = Blueprint.prototype.files;
76
const stringUtils = require('ember-cli-string-utils');
87
const astUtils = require('../../utilities/ast-utils');
@@ -65,12 +64,6 @@ module.exports = {
6564
files: function() {
6665
var fileList = getFiles.call(this);
6766

68-
if (this.options && this.options.flat) {
69-
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
70-
}
71-
if (this.options && !this.options.route) {
72-
fileList = fileList.filter(p => p.indexOf(path.join('shared', 'index.ts')) <= 0);
73-
}
7467
if (this.options && this.options.inlineTemplate) {
7568
fileList = fileList.filter(p => p.indexOf('.html') < 0);
7669
}
@@ -127,12 +120,6 @@ module.exports = {
127120
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
128121
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
129122

130-
if (!options.flat) {
131-
returns.push(addBarrelRegistration(this, componentDir));
132-
} else {
133-
returns.push(addBarrelRegistration(this, componentDir, fileName));
134-
}
135-
136123
if (!options['skip-import']) {
137124
returns.push(
138125
astUtils.addComponentToModule(modulePath, className, importPath)

addon/ng2/blueprints/directive/files/__path__/index.ts

-1
This file was deleted.

addon/ng2/blueprints/directive/index.js

-19
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
var path = require('path');
2-
var Blueprint = require('ember-cli/lib/models/blueprint');
32
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
4-
var addBarrelRegistration = require('../../utilities/barrel-management');
5-
var getFiles = Blueprint.prototype.files;
63
const stringUtils = require('ember-cli-string-utils');
74
const astUtils = require('../../utilities/ast-utils');
85

@@ -29,16 +26,6 @@ module.exports = {
2926
};
3027
},
3128

32-
files: function() {
33-
var fileList = getFiles.call(this);
34-
35-
if (this.options && this.options.flat) {
36-
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
37-
}
38-
39-
return fileList;
40-
},
41-
4229
fileMapTokens: function (options) {
4330
// Return custom template variables here.
4431
return {
@@ -65,12 +52,6 @@ module.exports = {
6552
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
6653
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
6754

68-
if (!options.flat) {
69-
returns.push(addBarrelRegistration(this, componentDir));
70-
} else {
71-
returns.push(addBarrelRegistration(this, componentDir, fileName));
72-
}
73-
7455
if (!options['skip-import']) {
7556
returns.push(
7657
astUtils.addComponentToModule(modulePath, className, importPath)

addon/ng2/blueprints/enum/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const stringUtils = require('ember-cli-string-utils');
22
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
3-
var addBarrelRegistration = require('../../utilities/barrel-management');
43

54
module.exports = {
65
description: '',
@@ -33,12 +32,5 @@ module.exports = {
3332
return this.fileName;
3433
}
3534
};
36-
},
37-
38-
afterInstall: function() {
39-
return addBarrelRegistration(
40-
this,
41-
this.generatePath,
42-
this.fileName);
4335
}
4436
};

addon/ng2/blueprints/interface/index.js

-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const stringUtils = require('ember-cli-string-utils');
22
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
3-
var addBarrelRegistration = require('../../utilities/barrel-management');
43

54
module.exports = {
65
description: '',
@@ -47,12 +46,5 @@ module.exports = {
4746
return this.fileName;
4847
}
4948
};
50-
},
51-
52-
afterInstall: function() {
53-
return addBarrelRegistration(
54-
this,
55-
this.generatePath,
56-
this.fileName);
5749
}
5850
};

addon/ng2/blueprints/pipe/files/__path__/index.ts

-1
This file was deleted.

addon/ng2/blueprints/pipe/index.js

-19
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
var path = require('path');
2-
var Blueprint = require('ember-cli/lib/models/blueprint');
32
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
4-
var addBarrelRegistration = require('../../utilities/barrel-management');
5-
var getFiles = Blueprint.prototype.files;
63
const stringUtils = require('ember-cli-string-utils');
74
const astUtils = require('../../utilities/ast-utils');
85

@@ -26,16 +23,6 @@ module.exports = {
2623
flat: options.flat
2724
};
2825
},
29-
30-
files: function() {
31-
var fileList = getFiles.call(this);
32-
33-
if (this.options && this.options.flat) {
34-
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
35-
}
36-
37-
return fileList;
38-
},
3926

4027
fileMapTokens: function (options) {
4128
// Return custom template variables here.
@@ -63,12 +50,6 @@ module.exports = {
6350
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
6451
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;
6552

66-
if (!options.flat) {
67-
returns.push(addBarrelRegistration(this, componentDir));
68-
} else {
69-
returns.push(addBarrelRegistration(this, componentDir, fileName));
70-
}
71-
7253
if (!options['skip-import']) {
7354
returns.push(
7455
astUtils.addComponentToModule(modulePath, className, importPath)

addon/ng2/blueprints/service/files/__path__/index.ts

-1
This file was deleted.

addon/ng2/blueprints/service/index.js

-27
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
var path = require('path');
2-
var Blueprint = require('ember-cli/lib/models/blueprint');
32
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
4-
var addBarrelRegistration = require('../../utilities/barrel-management');
5-
var getFiles = Blueprint.prototype.files;
6-
const stringUtils = require('ember-cli-string-utils');
73

84
module.exports = {
95
description: '',
@@ -26,16 +22,6 @@ module.exports = {
2622
};
2723
},
2824

29-
files: function() {
30-
var fileList = getFiles.call(this);
31-
32-
if (this.options && this.options.flat) {
33-
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
34-
}
35-
36-
return fileList;
37-
},
38-
3925
fileMapTokens: function (options) {
4026
// Return custom template variables here.
4127
return {
@@ -48,18 +34,5 @@ module.exports = {
4834
return dir;
4935
}
5036
};
51-
},
52-
53-
afterInstall: function(options) {
54-
const returns = [];
55-
const fileName = stringUtils.dasherize(`${options.entity.name}.service`);
56-
57-
if (!options.flat) {
58-
returns.push(addBarrelRegistration(this, this.generatePath));
59-
} else {
60-
returns.push(addBarrelRegistration(this, this.generatePath, fileName));
61-
}
62-
63-
return Promise.all(returns);
6437
}
6538
};

addon/ng2/utilities/barrel-management.js

-43
This file was deleted.

0 commit comments

Comments
 (0)