Skip to content

Commit 0e21209

Browse files
committed
fix(gulp): Fixed build process to make it work on Travis CI again
- Updated Gulp tasks, and also Gulp task directory structure - Updated dependencies, updated ts linting rules - Optimized Karma config - Updated ignore files
1 parent 0c89039 commit 0e21209

28 files changed

+282
-229
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Dependencies
22
/node_modules
33

4-
# Build: JavaScript plus sourcemaps
4+
# Build: TypeScript output
55
/index.d.ts
66
/index.js
77
/index.js.map
@@ -20,6 +20,9 @@
2020
# Build: Bundles
2121
/bundles
2222

23+
# Build: Temp folder
24+
/temp
25+
2326
# Build: Demo
2427
/demo/*.js
2528
!/demo/systemjs.config.js

.npmignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,18 @@
66
/src/**/*.ts
77
!/src/**/*.d.ts
88

9+
# Build: Tests
10+
/src/**/*.spec.js
11+
912
# Demo
1013
/demo
1114

12-
# Build process
15+
# Build: Temp folder
16+
/temp
17+
18+
# Not needed files
1319
/tools
20+
/.gitignore
1421
/.nvmrc
1522
/.sass-lint.yml
1623
/.travis.yml

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ branches:
1616
only:
1717
- master # Testing, Building, Releasing
1818
- develop # Testing, Building
19+
- feature/travis # Branch for testing Travis CI
1920

2021
before_install:
2122
- export CHROME_BIN=/usr/bin/google-chrome # Chrome path

gulpfile.js

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,31 @@ const gulp = require( 'gulp' );
55
/**
66
* Gulp tasks: Environment
77
*/
8-
const envCleanTasks = require( './tools/gulp-tasks/env/env-clean.task' );
9-
const envWatchTasks = require( './tools/gulp-tasks/env/env-watch.task' );
8+
const envCleanTasks = require( './tools/gulp/env/env-clean.task' );
9+
const envWatchTasks = require( './tools/gulp/env/env-watch.task' );
1010

1111
/**
1212
* Gulp tasks: Release
1313
*/
14-
const releaseChangelogTasks = require( './tools/gulp-tasks/release/release-changelog.task' );
15-
const releaseGitTasks = require( './tools/gulp-tasks/release/release-git.task' );
16-
const releaseGithubTasks = require( './tools/gulp-tasks/release/release-github.task' );
17-
const releaseVersionTasks = require( './tools/gulp-tasks/release/release-version.task' );
14+
const releaseChangelogTasks = require( './tools/gulp/release/release-changelog.task' );
15+
const releaseGitTasks = require( './tools/gulp/release/release-git.task' );
16+
const releaseGithubTasks = require( './tools/gulp/release/release-github.task' );
17+
const releaseVersionTasks = require( './tools/gulp/release/release-version.task' );
1818

1919
/**
2020
* Gulp tasks: SASS
2121
*/
22-
const sassBuildTasks = require( './tools/gulp-tasks/sass/sass-build.task' );
23-
const sassBundleTasks = require( './tools/gulp-tasks/sass/sass-bundle.task' );
24-
const sassLintTasks = require( './tools/gulp-tasks/sass/sass-lint.task' );
22+
const sassBuildTasks = require( './tools/gulp/sass/sass-build.task' );
23+
const sassBundleTasks = require( './tools/gulp/sass/sass-bundle.task' );
24+
const sassLintTasks = require( './tools/gulp/sass/sass-lint.task' );
2525

2626
/**
2727
* Gulp tasks: TypeScript
2828
*/
29-
const tsBuildTasks = require( './tools/gulp-tasks/ts/ts-build.task' );
30-
const tsBundleTasks = require( './tools/gulp-tasks/ts/ts-bundle.task' );
31-
const tsLintTasks = require( './tools/gulp-tasks/ts/ts-lint.task' );
32-
const tsTestTasks = require( './tools/gulp-tasks/ts/ts-test.task' );
29+
const tsBuildTasks = require( './tools/gulp/ts/ts-build.task' );
30+
const tsBundleTasks = require( './tools/gulp/ts/ts-bundle.task' );
31+
const tsLintTasks = require( './tools/gulp/ts/ts-lint.task' );
32+
const tsTestTasks = require( './tools/gulp/ts/ts-test.task' );
3333

3434

3535

@@ -132,8 +132,10 @@ gulp.task( 'watch',
132132
'env:clean--lib',
133133
'env:clean--demo',
134134
] ),
135-
'build--dev',
136-
'build--demo',
135+
gulp.parallel( [
136+
'build--dev',
137+
'build--demo'
138+
] ),
137139
gulp.parallel( [
138140
'env:serve',
139141
'env:watch'

karma-angular.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ System.config( {
3232

3333
} );
3434

35+
// Log how many files Karma is serving (for debugging and monitoring reasons)
36+
console.log( `[KARMA] Serving ${ Object.keys( __karma__.files ).length } files.` );
37+
3538
Promise
3639

3740
// Import Angular testing moduels and library specs
@@ -49,7 +52,7 @@ Promise
4952
if ( specModule.hasOwnProperty( 'main' ) ) {
5053
specModule.main();
5154
} else {
52-
throw new Error( `[KARMA] Spec module "${ path }" does not implement a main() method.` );
55+
throw new Error( `[KARMA] Spec file "${ path }" does not implement a main() method.` );
5356
}
5457
} )
5558
)

karma.config.js

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function( config ) {
77
let options = {
88

99
// Base path for resolving patterns
10-
basePath: '',
10+
basePath: './',
1111

1212
// List of used frameworks (see https://npmjs.org/browse/keyword/karma-adapter)
1313
frameworks: [
@@ -33,7 +33,7 @@ module.exports = function( config ) {
3333
colors: true,
3434

3535
// Level of logging (e.g. LOG_DISABLE, LOG_ERROR, LOG_WARN, LOG_INFO, LOG_DEBUG )
36-
logLevel: config.DEBUG,
36+
logLevel: config.INFO,
3737

3838
// Watcher
3939
autoWatch: true,
@@ -61,100 +61,137 @@ module.exports = function( config ) {
6161

6262
// Polyfills (always first)
6363
{
64-
pattern: './node_modules/core-js/client/shim.js',
64+
pattern: 'node_modules/core-js/client/shim.js',
6565
included: true,
6666
watched: false
6767
},
6868
{
69-
pattern: './node_modules/reflect-metadata/Reflect.js',
69+
pattern: 'node_modules/reflect-metadata/Reflect.js',
7070
included: true,
7171
watched: false
7272
},
7373
{
74-
pattern: './node_modules/zone.js/dist/zone.js',
74+
pattern: 'node_modules/zone.js/dist/zone.js',
7575
included: true,
7676
watched: false
7777
},
7878
{
79-
pattern: './node_modules/zone.js/dist/long-stack-trace-zone.js',
79+
pattern: 'node_modules/zone.js/dist/long-stack-trace-zone.js',
8080
included: true,
8181
watched: false
8282
},
8383
{
84-
pattern: './node_modules/zone.js/dist/proxy.js',
84+
pattern: 'node_modules/zone.js/dist/proxy.js',
8585
included: true,
8686
watched: false
8787
},
8888
{
89-
pattern: './node_modules/zone.js/dist/sync-test.js',
89+
pattern: 'node_modules/zone.js/dist/sync-test.js',
9090
included: true,
9191
watched: false
9292
},
9393
{
94-
pattern: './node_modules/zone.js/dist/jasmine-patch.js',
94+
pattern: 'node_modules/zone.js/dist/jasmine-patch.js',
9595
included: true,
9696
watched: false
9797
},
9898
{
99-
pattern: './node_modules/zone.js/dist/async-test.js',
99+
pattern: 'node_modules/zone.js/dist/async-test.js',
100100
included: true,
101101
watched: false
102102
},
103103
{
104-
pattern: './node_modules/zone.js/dist/fake-async-test.js',
104+
pattern: 'node_modules/zone.js/dist/fake-async-test.js',
105105
included: true,
106106
watched: false
107107
},
108108

109109
// SystemJS module loader
110110
{
111-
pattern: './node_modules/systemjs/dist/system.src.js',
111+
pattern: 'node_modules/systemjs/dist/system.src.js',
112112
included: true,
113113
watched: false
114114
},
115115

116-
// Framework & libraries
116+
// Angular modules
117117
{
118-
pattern: './node_modules/@angular/**/*.js',
118+
pattern: 'node_modules/@angular/common/bundles/common.umd.js',
119119
included: false,
120120
watched: false
121121
},
122122
{
123-
pattern: './node_modules/@angular/**/*.js.map',
123+
pattern: 'node_modules/@angular/common/bundles/common-testing.umd.js',
124124
included: false,
125125
watched: false
126126
},
127127
{
128-
pattern: './node_modules/rxjs/**/*.js',
128+
pattern: 'node_modules/@angular/compiler/bundles/compiler.umd.js',
129129
included: false,
130130
watched: false
131131
},
132132
{
133-
pattern: './node_modules/rxjs/**/*.js.map',
133+
pattern: 'node_modules/@angular/compiler/bundles/compiler-testing.umd.js',
134+
included: false,
135+
watched: false
136+
},
137+
{
138+
pattern: 'node_modules/@angular/core/bundles/core.umd.js',
139+
included: false,
140+
watched: false
141+
},
142+
{
143+
pattern: 'node_modules/@angular/core/bundles/core-testing.umd.js',
144+
included: false,
145+
watched: false
146+
},
147+
{
148+
pattern: 'node_modules/@angular/platform-browser/bundles/platform-browser.umd.js',
149+
included: false,
150+
watched: false
151+
},
152+
{
153+
pattern: 'node_modules/@angular/platform-browser/bundles/platform-browser-testing.umd.js',
154+
included: false,
155+
watched: false
156+
},
157+
{
158+
pattern: 'node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
159+
included: false,
160+
watched: false
161+
},
162+
{
163+
pattern: 'node_modules/@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
164+
included: false,
165+
watched: false
166+
},
167+
168+
// Other libraries
169+
{
170+
pattern: 'node_modules/rxjs/**/*.js',
134171
included: false,
135172
watched: false
136173
},
137174

138175
// Configuration files
139176
{
140-
pattern: './demo/systemjs.config.js',
177+
pattern: 'demo/systemjs.config.js',
141178
included: true,
142179
watched: false
143180
},
144181
{
145-
pattern: './karma-angular.config.js',
182+
pattern: 'karma-angular.config.js',
146183
included: true,
147184
watched: false
148185
},
149186

150187
// Transpiled and original files as well as sourcemaps (source & tests)
151188
{
152-
pattern: './src/**/*.js',
189+
pattern: 'src/**/*.js',
153190
included: false,
154191
watched: true // auto watch
155192
},
156193
{
157-
pattern: './src/**/*.js.map',
194+
pattern: 'src/**/*.js.map',
158195
included: false,
159196
watched: false
160197
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@types/core-js": "0.9.x",
5454
"@types/jasmine": "2.5.x",
5555
"browser-sync": "2.18.x",
56-
"codelyzer": "1.0.0-beta.4",
56+
"codelyzer": "2.0.0-beta.1",
5757
"conventional-github-releaser": "1.1.x",
5858
"conventional-recommended-bump": "0.3.x",
5959
"core-js": "2.4.x",
@@ -70,7 +70,7 @@
7070
"gulp-sourcemaps": "2.2.x",
7171
"gulp-sass": "2.3.x",
7272
"gulp-sass-lint": "1.3.x",
73-
"gulp-tslint": "6.1.x",
73+
"gulp-tslint": "7.0.x",
7474
"gulp-typescript": "3.1.x",
7575
"gulp-util": "3.0.x",
7676
"html-minifier": "3.2.x",
@@ -87,7 +87,7 @@
8787
"rxjs": "5.0.0-beta.12",
8888
"source-map-loader": "0.1.x",
8989
"systemjs": "0.19.x",
90-
"tslint": "3.15.x",
90+
"tslint": "4.0.x",
9191
"typescript": "2.0.x",
9292
"web-animations-js": "2.2.x",
9393
"webpack": "2.1.0-beta.27",

src/components/notifier-notification.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, Renderer } from '@angular/core';
22

33
import { NotifierAnimationData } from './../models/notifier-animation.model';
4+
import { NotifierAnimationService } from './../services/notifier-animation.service';
45
import { NotifierConfig } from './../models/notifier-config.model';
56
import { NotifierNotification } from './../models/notifier-notification.model';
6-
import { NotifierAnimationService } from './../services/notifier-animation.service';
7-
import { NotifierTimerService } from './../services/notifier-timer.service';
87
import { NotifierService } from './../services/notifier.service';
8+
import { NotifierTimerService } from './../services/notifier-timer.service';
99

1010
/**
1111
* Notifier notification component
@@ -18,10 +18,10 @@ import { NotifierService } from './../services/notifier.service';
1818
@Component( {
1919
changeDetection: ChangeDetectionStrategy.OnPush, // (#perfmatters)
2020
host: {
21-
class: 'x-notifier__notification',
2221
'(click)': 'onNotificationClick()',
22+
'(mouseout)': 'onNotificationMouseout()',
2323
'(mouseover)': 'onNotificationMouseover()',
24-
'(mouseout)': 'onNotificationMouseout()'
24+
class: 'x-notifier__notification'
2525
},
2626
providers: [
2727
// We provide the timer to the component's local injector, so that every notification components gets its own

src/models/notifier-config.model.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ export interface NotifierOptions {
5353
*/
5454
@Injectable()
5555
export class NotifierConfig implements NotifierOptions {
56+
57+
/**
58+
* Customize animations
59+
*/
5660
public animations: {
5761
enabled: boolean;
5862
hide: {
@@ -72,13 +76,21 @@ export class NotifierConfig implements NotifierOptions {
7276
speed: number;
7377
};
7478
};
79+
80+
/**
81+
* Customize behaviour
82+
*/
7583
public behaviour: {
7684
autoHide: number | false;
7785
onClick: 'hide' | false;
7886
onMouseover: 'pauseAutoHide' | 'resetAutoHide' | false;
7987
showDismissButton: boolean;
8088
stacking: number | false;
8189
};
90+
91+
/**
92+
* Customize positioning
93+
*/
8294
public position: {
8395
horizontal: {
8496
distance: number;
@@ -90,6 +102,10 @@ export class NotifierConfig implements NotifierOptions {
90102
position: 'top' | 'bottom';
91103
};
92104
};
105+
106+
/**
107+
* Customize theming
108+
*/
93109
public theme: string;
94110

95111
/**

0 commit comments

Comments
 (0)