Skip to content

Commit 0b07bb9

Browse files
author
Gillian Pérard
committed
Fix imports and replace npm by yarn
1 parent ebd7208 commit 0b07bb9

File tree

8 files changed

+3973
-5120
lines changed

8 files changed

+3973
-5120
lines changed

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock.json

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ language : node_js
22
node_js :
33
- stable
44
install:
5-
- npm i
5+
- yarn
66
script:
7-
- npm run cover
7+
- yarn cover
88
notifications:
99
email:
1010
on_success: never

dist/examples/models/panther.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"use strict";
22
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3+
var extendStatics = function (d, b) {
4+
extendStatics = Object.setPrototypeOf ||
5+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7+
return extendStatics(d, b);
8+
};
69
return function (d, b) {
710
extendStatics(d, b);
811
function __() { this.constructor = d; }

dist/examples/models/snake.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
"use strict";
22
var __extends = (this && this.__extends) || (function () {
3-
var extendStatics = Object.setPrototypeOf ||
4-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5-
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
3+
var extendStatics = function (d, b) {
4+
extendStatics = Object.setPrototypeOf ||
5+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6+
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7+
return extendStatics(d, b);
8+
};
69
return function (d, b) {
710
extendStatics(d, b);
811
function __() { this.constructor = d; }

gulpfile.js

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,42 @@
11
const gulp = require('gulp');
2-
const gulpTs = require('gulp-typescript');
3-
const gulpTslint = require('gulp-tslint');
2+
const ts = require('gulp-typescript');
3+
const tsLint = require('gulp-tslint');
44
const del = require('del');
55
const runSequence = require('run-sequence');
66

7-
const tsProject = gulpTs.createProject('./tsconfig.json');
7+
const project = ts.createProject('./tsconfig.json');
88

9-
gulp.task('clean', () => {
10-
return del('./dist/');
11-
});
9+
const destinationFolder = './dist/';
1210

13-
gulp.task('tslint', () => {
14-
return gulp.src(['./src/**/*.ts', './spec/**/*.spec.ts', './examples/**/*.ts'])
15-
.pipe(gulpTslint({
16-
formatter: 'verbose'
17-
}))
18-
.pipe(gulpTslint.report());
19-
});
11+
const clean = () => del(destinationFolder);
2012

21-
gulp.task('ts', () => {
22-
return tsResult = tsProject.src()
23-
.pipe(tsProject())
13+
const lint = () => {
14+
return project
15+
.src()
16+
.pipe(tsLint({ configuration: "./tslint.json", formatter: "verbose" }))
17+
.pipe(tsLint.report())
18+
}
19+
20+
const transpile = () => {
21+
return project
22+
.src()
23+
.pipe(project())
2424
.js
25-
.pipe(gulp.dest('./dist/'));
26-
});
25+
.pipe(gulp.dest(destinationFolder))
26+
}
2727

28-
gulp.task('declaration', () => {
29-
return tsResult = gulp.src('src/**/*.ts')
30-
.pipe(tsProject())
28+
const declare = () => {
29+
return tsResult = gulp
30+
.src('src/**/*.ts')
31+
.pipe(project())
3132
.dts
32-
.pipe(gulp.dest('./dist/src/'));
33-
});
33+
.pipe(gulp.dest(`${destinationFolder}/src/`));
34+
}
35+
36+
const build = (done) => gulp.series(lint, clean, transpile, declare)(done)
37+
38+
const tasks = [clean, lint, transpile, declare, build]
3439

35-
gulp.task('default', () => {
36-
const tasks = ['tslint', 'clean', 'ts', 'declaration'];
37-
runSequence.apply(runSequence, tasks);
40+
tasks.forEach(t => {
41+
gulp.task(t);
3842
});

0 commit comments

Comments
 (0)