Skip to content

Commit aac9abf

Browse files
committed
chore: add a shared barrel for generated routes
Create the emtpy index.ts file which will be filled with generated items Closes #454
1 parent 4945677 commit aac9abf

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

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

Whitespace-only changes.

addon/ng2/blueprints/component/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ module.exports = {
88
description: '',
99

1010
availableOptions: [
11-
{ name: 'flat', type: Boolean, default: false }
11+
{ name: 'flat', type: Boolean, default: false },
12+
{ name: 'route', type: Boolean, default: false }
1213
],
1314

1415
normalizeEntityName: function (entityName) {
@@ -37,6 +38,9 @@ module.exports = {
3738
if (this.options.flat) {
3839
fileList = fileList.filter(p => p.indexOf('index.ts') <= 0);
3940
}
41+
if (!this.options.route) {
42+
fileList = fileList.filter(p => p.indexOf(path.join('shared', 'index.ts')) <= 0);
43+
}
4044

4145
return fileList;
4246
},

addon/ng2/blueprints/route/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ module.exports = {
1717
],
1818

1919
beforeInstall: function(options) {
20+
options.route = true;
2021
if (options.lazy) {
2122
options.isLazyRoute = true;
2223
}

0 commit comments

Comments
 (0)