Skip to content

chore(barrels): remove barrels from blueprints #1658

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 0 additions & 8 deletions addon/ng2/blueprints/class/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stringUtils = require('ember-cli-string-utils');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');

module.exports = {
description: '',
Expand Down Expand Up @@ -40,12 +39,5 @@ module.exports = {
return this.fileName;
}
};
},

afterInstall: function() {
return addBarrelRegistration(
this,
this.generatePath,
this.fileName);
}
};
1 change: 0 additions & 1 deletion addon/ng2/blueprints/component/files/__path__/index.ts

This file was deleted.

Empty file.
13 changes: 0 additions & 13 deletions addon/ng2/blueprints/component/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ var path = require('path');
var chalk = require('chalk');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');
Expand Down Expand Up @@ -65,12 +64,6 @@ module.exports = {
files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.flat) {
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
}
if (this.options && !this.options.route) {
fileList = fileList.filter(p => p.indexOf(path.join('shared', 'index.ts')) <= 0);
}
if (this.options && this.options.inlineTemplate) {
fileList = fileList.filter(p => p.indexOf('.html') < 0);
}
Expand Down Expand Up @@ -127,12 +120,6 @@ module.exports = {
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;

if (!options.flat) {
returns.push(addBarrelRegistration(this, componentDir));
} else {
returns.push(addBarrelRegistration(this, componentDir, fileName));
}

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
Expand Down
1 change: 0 additions & 1 deletion addon/ng2/blueprints/directive/files/__path__/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions addon/ng2/blueprints/directive/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
var path = require('path');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');

Expand All @@ -29,16 +26,6 @@ module.exports = {
};
},

files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.flat) {
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
}

return fileList;
},

fileMapTokens: function (options) {
// Return custom template variables here.
return {
Expand All @@ -65,12 +52,6 @@ module.exports = {
const componentDir = path.relative(this.dynamicPath.appRoot, this.generatePath);
const importPath = componentDir ? `./${componentDir}/${fileName}` : `./${fileName}`;

if (!options.flat) {
returns.push(addBarrelRegistration(this, componentDir));
} else {
returns.push(addBarrelRegistration(this, componentDir, fileName));
}

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
Expand Down
8 changes: 0 additions & 8 deletions addon/ng2/blueprints/enum/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stringUtils = require('ember-cli-string-utils');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');

module.exports = {
description: '',
Expand Down Expand Up @@ -33,12 +32,5 @@ module.exports = {
return this.fileName;
}
};
},

afterInstall: function() {
return addBarrelRegistration(
this,
this.generatePath,
this.fileName);
}
};
8 changes: 0 additions & 8 deletions addon/ng2/blueprints/interface/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const stringUtils = require('ember-cli-string-utils');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');

module.exports = {
description: '',
Expand Down Expand Up @@ -47,12 +46,5 @@ module.exports = {
return this.fileName;
}
};
},

afterInstall: function() {
return addBarrelRegistration(
this,
this.generatePath,
this.fileName);
}
};
1 change: 0 additions & 1 deletion addon/ng2/blueprints/pipe/files/__path__/index.ts

This file was deleted.

19 changes: 0 additions & 19 deletions addon/ng2/blueprints/pipe/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
var path = require('path');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');
const astUtils = require('../../utilities/ast-utils');

Expand All @@ -26,16 +23,6 @@ module.exports = {
flat: options.flat
};
},

files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.flat) {
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
}

return fileList;
},

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

if (!options.flat) {
returns.push(addBarrelRegistration(this, componentDir));
} else {
returns.push(addBarrelRegistration(this, componentDir, fileName));
}

if (!options['skip-import']) {
returns.push(
astUtils.addComponentToModule(modulePath, className, importPath)
Expand Down
1 change: 0 additions & 1 deletion addon/ng2/blueprints/service/files/__path__/index.ts

This file was deleted.

27 changes: 0 additions & 27 deletions addon/ng2/blueprints/service/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
var path = require('path');
var Blueprint = require('ember-cli/lib/models/blueprint');
var dynamicPathParser = require('../../utilities/dynamic-path-parser');
var addBarrelRegistration = require('../../utilities/barrel-management');
var getFiles = Blueprint.prototype.files;
const stringUtils = require('ember-cli-string-utils');

module.exports = {
description: '',
Expand All @@ -26,16 +22,6 @@ module.exports = {
};
},

files: function() {
var fileList = getFiles.call(this);

if (this.options && this.options.flat) {
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
}

return fileList;
},

fileMapTokens: function (options) {
// Return custom template variables here.
return {
Expand All @@ -48,18 +34,5 @@ module.exports = {
return dir;
}
};
},

afterInstall: function(options) {
const returns = [];
const fileName = stringUtils.dasherize(`${options.entity.name}.service`);

if (!options.flat) {
returns.push(addBarrelRegistration(this, this.generatePath));
} else {
returns.push(addBarrelRegistration(this, this.generatePath, fileName));
}

return Promise.all(returns);
}
};
43 changes: 0 additions & 43 deletions addon/ng2/utilities/barrel-management.js

This file was deleted.

Loading