Skip to content
This repository has been archived by the owner on Jul 8, 2024. It is now read-only.

Commit

Permalink
feat: update library so it builds in ng-packgr
Browse files Browse the repository at this point in the history
  • Loading branch information
abdul-akibu committed Sep 16, 2019
1 parent e858de5 commit 7cbc207
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 12 deletions.
17 changes: 16 additions & 1 deletion lib/commands/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const create = function () {
if (!answers.moveon) {
return;
}

let today = new Date(),
year = today.getFullYear().toString();

Expand All @@ -56,6 +55,22 @@ export const create = function () {
answers.appNameSlug = _.slugify(answers.appName);
answers.appTitle = startCase(answers.appName).split(' ').join('');
answers.appYear = year;

if (answers.projectType === 'library') {
gulp.src([
`${__dirname}/../../templates/${answers.projectType}-package/**`
])
.pipe(rename(file => {
if (file.basename[0] === '_') {
file.basename = '.' + file.basename.slice(1);
}
}))
.pipe(gulp.dest('./'))
.on('end', () => {
this.log.info(`Successfully moved inmutable LabShare ${answers.projectType} package's files...`);
});
return;
}
gulp.src([
`${__dirname}/../../templates/common/**`,
`${__dirname}/../../templates/${answers.projectType}-package/**`
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
provider: script
skip_cleanup: true
script:
- bash scripts/deploy.sh
- npm run semantic-release
2 changes: 1 addition & 1 deletion templates/library-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@angular/router": "^8.0.2",
"@commitlint/cli": "^8.1.0",
"@commitlint/config-conventional": "^7.0.1",
"@labshare/semantic-release-config": "^1.0.0",
"@labshare/semantic-release-config": "^1.1.0",
"@ngtools/webpack": "^1.3.3",
"@semantic-release/changelog": "^3.0.4",
"@semantic-release/commit-analyzer": "^6.3.0",
Expand Down
4 changes: 0 additions & 4 deletions templates/library-package/public-api.ts

This file was deleted.

8 changes: 8 additions & 0 deletions templates/library-package/public_api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//This defines what is available to consumers of your library.
export {
WelcomeComponent,
} from './src/app/base-lib/welcome/welcome.component';

export {
AppModule,
} from './src/app/app.module';
11 changes: 11 additions & 0 deletions templates/library-package/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

import {NgModule} from '@angular/core';
import {WelcomeModule} from '../app/base-lib/welcome/welcome.module';

// Export Angular 6 feature module
@NgModule({
imports: [
WelcomeModule
]
})
export class AppModule {}
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {UIRouterModule} from '@uirouter/angular';
import {WelcomeComponent} from './welcome.component';

@NgModule({
imports: [CommonModule, UIRouterModule],
imports: [CommonModule],
providers: [],
declarations: [WelcomeComponent],
exports: [WelcomeComponent],
exports: [WelcomeComponent]
})
export class WelcomeModule {}
4 changes: 2 additions & 2 deletions templates/library-package/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@
"lib": [
"es2017",
"dom"
],
},
]
}
}

0 comments on commit 7cbc207

Please sign in to comment.