gulp-typescript: Provides its own types (#15601)

This commit is contained in:
Andy 2017-04-17 08:55:59 -07:00 committed by GitHub
parent d1b75ee8b6
commit 61f09b2ce8
5 changed files with 7 additions and 164 deletions

View File

@ -120,6 +120,12 @@
"sourceRepoURL": "https://github.com/mikedeboer/node-github",
"asOfVersion": "7.1.0"
},
{
"libraryName": "gulp-typescript",
"typingsPackageName": "gulp-typescript",
"sourceRepoURL": "https://github.com/ivogabe/gulp-typescript",
"asOfVersion": "2.13.0"
},
{
"libraryName": "Facebook's Immutable",
"typingsPackageName": "immutable",

View File

@ -1,65 +0,0 @@
import gulp = require("gulp");
import typescript = require("gulp-typescript");
function merge(streams: NodeJS.ReadWriteStream[]): NodeJS.ReadWriteStream {
return null;
}
gulp.task('scripts', function() {
var tsResult = gulp.src('lib/*.ts')
.pipe(typescript({
declarationFiles: true,
noExternalResolve: true,
skipLibCheck: true
}));
return merge([
tsResult.dts.pipe(gulp.dest('release/definitions')),
tsResult.js.pipe(gulp.dest('release/js'))]
);
});
var tsProject = typescript.createProject({
declarationFiles: true,
noExternalResolve: true
});
gulp.task('scripts', function() {
var tsResult = tsProject.src()
.pipe(typescript(tsProject));
return tsResult.js.pipe(gulp.dest('release'));
});
var mainTscProject = typescript.createProject("tsconfig.json", {
target: "es6"
});
gulp.task('scripts', function() {
var tsResult = gulp.src('lib/*.ts')
.pipe(typescript(tsProject));
return merge([ // Merge the two output streams, so this task is finished when the IO of both operations are done.
tsResult.dts.pipe(gulp.dest('release/definitions')),
tsResult.js.pipe(gulp.dest('release/js'))]
);
});
gulp.task('watch', ['scripts'], function() {
gulp.watch('lib/*.ts', ['scripts']);
});
gulp.task('scripts', function () {
return gulp.src('lib/*.ts')
.pipe(typescript(tsProject, undefined, typescript.reporter.fullReporter()));
});
gulp.task('default', function () {
return gulp.src('src/**/*.ts')
.pipe(typescript())
.pipe(gulp.dest('built/local'));
});
var compilerOptions = tsProject.config.compilerOptions;
var exclude = tsProject.config.exclude;
var files = tsProject.config.files;

View File

@ -1,73 +0,0 @@
// Type definitions for gulp-typescript
// Project: https://github.com/ivogabe/gulp-typescript
// Definitions by: Asana <https://asana.com>, Thomas Corbière <https://github.com/tomc974>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node"/>
declare function GulpTypescript(params?: GulpTypescript.Params, filters?: GulpTypescript.FilterSettings, reporter?: GulpTypescript.Reporter): GulpTypescript.CompilationStream;
declare namespace GulpTypescript {
export function createProject(params?: Params): Project;
export function createProject(file: string, params?: Params): Project;
export function filter(filters: FilterSettings): CompilationStream;
interface Params {
declarationFiles?: boolean;
module?: string;
noEmitOnError?: boolean;
noExternalResolve?: boolean;
noImplicitAny?: boolean;
noLib?: boolean;
removeComments?: boolean;
sourceRoot?: string; // use gulp-sourcemaps instead
sortOutput?: boolean;
target?: string;
typescript?: any;
outFile?: string;
outDir?: string;
suppressImplicitAnyIndexErrors?: boolean;
jsx?: string;
declaration?: boolean;
emitDecoratorMetadata?: boolean;
experimentalDecorators?: boolean;
experimentalAsyncFunctions?: boolean;
moduleResolution?: string;
noEmitHelpers?: boolean;
preserveConstEnums?: boolean;
isolatedModules?: boolean;
skipLibCheck?: boolean;
}
interface TsConfig {
files?: string[];
exclude?: string[];
compilerOptions?: any;
}
interface Project {
config: TsConfig;
src(): NodeJS.ReadWriteStream;
}
interface FilterSettings {
referencedFrom?: string[];
}
interface Reporter {
error(error: any): void;
}
interface CompilationStream extends NodeJS.ReadWriteStream {
dts: NodeJS.ReadWriteStream;
js: NodeJS.ReadWriteStream;
}
namespace reporter {
function nullReporter(): Reporter;
function defaultReporter(): Reporter;
function fullReporter(showFullFilename?: boolean): Reporter;
}
}
export = GulpTypescript;

View File

@ -1,25 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"paths": {
"q": [ "q/v0" ]
},
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"gulp-typescript-tests.ts"
]
}

View File

@ -40,7 +40,7 @@ gulp.task('default', function () {
// options.additionalStreams
import * as ts from 'gulp-typescript';
declare function ts(): any;
// create stream of virtual files
var tsStream = gulp.src('src/**/*.ts')