Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Utilize importable gulp tasks #44

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Icon
node_modules
bin
dist
npm-debug.log
app
coverage
app-min
temp
npm-debug.log
coverage
3 changes: 0 additions & 3 deletions definitions/definitions.d.ts

This file was deleted.

67 changes: 25 additions & 42 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,65 +1,48 @@
'use strict';

var coveralls = require('gulp-coveralls');
var del = require('del');
var exec = require('child_process').exec;
var flatten = require('gulp-flatten');
var gulp = require('gulp');
var mocha = require('gulp-mocha');
var coveralls = require('gulp-coveralls');
var tsc = require('gulp-typescript');
var oneJsBuild = require('gulp-onejs-build');
var karma = require('karma').server;
var del = require('del');

var paths = {
app: 'app/',
dist: 'dist/',
amd: 'dist/amd',
commonjs: 'dist/commonjs',
appSourceDest: 'app/src',
appTestDest: 'app/test',
libSource: ['src/*.ts'],
libTest: ['test/*.ts']
};

var shouldExit = true;

gulp.task('clean', function(cb) {
del([paths.dist, paths.app], cb);
oneJsBuild.gulpTasks.all({
gulp: gulp,
rootDir: __dirname,
karma: karma
});

gulp.task('build-source', ['clean'], function() {
var tsResult = gulp.src(paths.libSource)
.pipe(tsc({
module: 'amd',
target: 'ES5',
declarationFiles: true
}));
var shouldExit = true;

tsResult.dts.pipe(gulp.dest(paths.amd));
tsResult.js.pipe(gulp.dest(paths.amd))
return tsResult.js.pipe(gulp.dest(paths.appSourceDest));
gulp.task('tdd', [], function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js'
}, done);
});

gulp.task('build-test', ['clean', 'build-source'], function() {
return gulp.src(paths.libTest)
.pipe(tsc({
module: 'amd',
target: 'ES5',
declarationFiles: false
}))
.pipe(gulp.dest(paths.appTestDest));
gulp.task('ciTest', ['test-preprocess'], function (done) {
karma.start({
configFile: __dirname + '/karma-ci.conf.js'
}, done);
});

gulp.task('build', ['build-source', 'build-test']);

gulp.task('test', ['build'], function (done) {
karma.start({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done);
gulp.task('covertest', ['ciTest'], function() {
return gulp.src('bin/coverage/**/lcov.info')
});

gulp.task('covertest', ['build','test'], function() {
gulp.task('covertest', ['build', 'test'], function() {
return gulp.src('coverage/**/lcov.info')
.pipe(coveralls());
});

gulp.task('watch', ['default'], function() {
shouldExit = false;
return gulp.watch(oneJsBuild.gulpTasks.paths.src.glob, ['default']);
});

gulp.task('default', ['build', 'test']);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
"del": "^0.1.3",
"gulp": "^3.8.5",
"gulp-coveralls": "^0.1.3",
"gulp-flatten": "0.0.4",
"gulp-jasmine": "^0.2.0",
"gulp-mocha": "^1.1.0",
"gulp-onejs-build": "^1.2.0",
"gulp-requirejs": "^0.1.3",
"gulp-rjs": "^0.1.0",
"gulp-typescript": "2.0.0",
Expand Down
19 changes: 10 additions & 9 deletions test/Block.test.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import Block = require('../Block');
import IBinding = require('../IBinding');
import Binding = require('../Binding');
import BlockProcessor = require('../BlockProcessor');
import BlockType = require('../BlockType');
import BaseView = require('../BaseView');
import View = require('../View');
import EventGroup = require('../EventGroup');

var assert = chai.assert;
import Block = require('../src/Block');
import IBinding = require('../src/IBinding');
import Binding = require('../src/Binding');
import BlockProcessor = require('../src/BlockProcessor');
import BlockType = require('../src/BlockType');
import BaseView = require('../src/BaseView');
import View = require('../src/View');
import EventGroup = require('../src/EventGroup');

describe('Block', function () {

Expand Down
6 changes: 3 additions & 3 deletions test/DomUtils.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import List = require("../src/List");
import DomUtils = require("../src/DomUtils");
import List = require("../List");
import DomUtils = require("../DomUtils");

var expect = chai.expect;
var assert = chai.assert;
Expand Down
6 changes: 3 additions & 3 deletions test/EventGroup.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import List = require("../src/List");
import EventGroup = require("../src/EventGroup");
import List = require("../List");
import EventGroup = require("../EventGroup");

var expect = chai.expect;
var assert = chai.assert;
Expand Down
11 changes: 6 additions & 5 deletions test/IfBlock.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import Block = require('../Block');
import BlockProcessor = require('../BlockProcessor');
import BlockType = require('../BlockType');
import View = require('../View');

var assert = chai.assert;
import Block = require('../src/Block');
import BlockProcessor = require('../src/BlockProcessor');
import BlockType = require('../src/BlockType');
import View = require('../src/View');

describe('Block', function () {

Expand Down
8 changes: 4 additions & 4 deletions test/List.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require('chai');
import List = require('../src/List');
import EventGroup = require('../src/EventGroup');
import ViewModel = require('../src/ViewModel');
import List = require('../List');
import EventGroup = require('../EventGroup');
import ViewModel = require('../ViewModel');

var assert = chai.assert;

Expand Down
6 changes: 3 additions & 3 deletions test/Observable.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import Observable = require("../src/Observable");
import EventGroup = require("../src/EventGroup");
import Observable = require("../Observable");
import EventGroup = require("../EventGroup");

var assert = chai.assert;

Expand Down
4 changes: 2 additions & 2 deletions test/Promise.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import Promise = require("../src/Promise");
import Promise = require("../Promise");

var expect = chai.expect;
var assert = chai.assert;
Expand Down
13 changes: 7 additions & 6 deletions test/RepeaterBlock.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import Block = require('../Block');
import BlockProcessor = require('../BlockProcessor');
import BlockType = require('../BlockType');
import View = require('../View');
import List = require('../List');

var assert = chai.assert;
import Block = require('../src/Block');
import BlockProcessor = require('../src/BlockProcessor');
import BlockType = require('../src/BlockType');
import View = require('../src/View');
import List = require('../src/List');

describe('Block', function () {

Expand Down
4 changes: 2 additions & 2 deletions test/Scheduler.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import Scheduler = require('../src/Scheduler');
import Scheduler = require('../Scheduler');

var assert = chai.assert;

Expand Down
8 changes: 4 additions & 4 deletions test/View.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import View = require("../src/View");
import Block = require("../src/Block");
import BlockType = require('../src/BlockType');
import View = require("../View");
import Block = require("../Block");
import BlockType = require('../BlockType');

var assert = chai.assert;

Expand Down
6 changes: 3 additions & 3 deletions test/ViewModel.test.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference path="../definitions/definitions.d.ts" />
/// <reference path="../typings/tsd.d.ts" />

import chai = require("chai");
import ViewModel = require("../src/ViewModel");
import View = require("../src/View");
import ViewModel = require("../ViewModel");
import View = require("../View");

var assert = chai.assert;

Expand Down
15 changes: 15 additions & 0 deletions tsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"chai/chai.d.ts": {
"commit": "2544abac24320d3f0edb67d256dcee8faf0e6f14"
},
"mocha/mocha.d.ts": {
"commit": "2544abac24320d3f0edb67d256dcee8faf0e6f14"
}
}
}
1 change: 1 addition & 0 deletions definitions/chai.d.ts → typings/chai/chai.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ declare module chai {
that: Expect;
and: Expect;
have: Expect;
has: Expect;
with: Expect;
at: Expect;
of: Expect;
Expand Down
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions typings/tsd.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference path="chai/chai.d.ts" />
/// <reference path="mocha/mocha.d.ts" />
/// <reference path="rewire.d.ts" />