Skip to content

Commit e3e0a32

Browse files
committedNov 13, 2016
Update release
1 parent d2c929f commit e3e0a32

File tree

5 files changed

+29
-20
lines changed

5 files changed

+29
-20
lines changed
 

‎release/main.js

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
"use strict";
22
var fs = require('fs');
33
var path = require('path');
4-
var gutil = require('gulp-util');
54
var _project = require('./project');
65
var utils = require('./utils');
76
var _reporter = require('./reporter');
87
function compile(param, theReporter) {
98
if (arguments.length >= 3) {
10-
deprecate("Reporter are now passed as the second argument", "remove the second argument", "Filters have been removed as of gulp-typescript 3.0.\nThe reporter is now passed as the second argument instead of the third argument.");
9+
utils.deprecate("Reporter are now passed as the second argument", "remove the second argument", "Filters have been removed as of gulp-typescript 3.0.\nThe reporter is now passed as the second argument instead of the third argument.");
1110
}
1211
var proj;
1312
if (typeof param === "function") {
1413
proj = param;
1514
if (arguments.length >= 2) {
16-
deprecate("ts(tsProject, ...) has been deprecated", "use .pipe(tsProject(reporter)) instead", "As of gulp-typescript 3.0, .pipe(ts(tsProject, ...)) should be written as .pipe(tsProject(reporter)).");
15+
utils.deprecate("ts(tsProject, ...) has been deprecated", "use .pipe(tsProject(reporter)) instead", "As of gulp-typescript 3.0, .pipe(ts(tsProject, ...)) should be written as .pipe(tsProject(reporter)).");
1716
}
1817
else {
19-
deprecate("ts(tsProject) has been deprecated", "use .pipe(tsProject(reporter)) instead", "As of gulp-typescript 3.0, .pipe(ts(tsProject)) should be written as .pipe(tsProject()).");
18+
utils.deprecate("ts(tsProject) has been deprecated", "use .pipe(tsProject(reporter)) instead", "As of gulp-typescript 3.0, .pipe(ts(tsProject)) should be written as .pipe(tsProject()).");
2019
}
2120
}
2221
else {
@@ -31,7 +30,7 @@ function getTypeScript(typescript) {
3130
return require('typescript');
3231
}
3332
catch (e) {
34-
deprecate("TypeScript not installed", "install with `npm install typescript --save-dev`", "As of gulp-typescript 3.0, TypeScript isn't bundled with gulp-typescript any more.\nInstall the latest stable version with `npm install typescript --save-dev`\nor a nightly with `npm install typescript@next --save-dev`");
33+
utils.deprecate("TypeScript not installed", "install with `npm install typescript --save-dev`", "As of gulp-typescript 3.0, TypeScript isn't bundled with gulp-typescript any more.\nInstall the latest stable version with `npm install typescript --save-dev`\nor a nightly with `npm install typescript@next --save-dev`");
3534
throw new Error("TypeScript not installed");
3635
}
3736
}
@@ -41,10 +40,10 @@ function getCompilerOptions(settings, projectPath, configFileName) {
4140
console.warn('gulp-typescript: sourceRoot isn\'t supported any more. Use sourceRoot option of gulp-sourcemaps instead.');
4241
}
4342
if (settings.noExternalResolve !== undefined) {
44-
deprecate("noExternalResolve is deprecated", "use noResolve instead", "The non-standard option noExternalResolve has been removed as of gulp-typescript 3.0.\nUse noResolve instead.");
43+
utils.deprecate("noExternalResolve is deprecated", "use noResolve instead", "The non-standard option noExternalResolve has been removed as of gulp-typescript 3.0.\nUse noResolve instead.");
4544
}
4645
if (settings.sortOutput !== undefined) {
47-
deprecate("sortOutput is deprecated", "your project might work without it", "The non-standard option sortOutput has been removed as of gulp-typescript 3.0.\nYour project will probably compile without this option.\nOtherwise, if you're using gulp-concat, you should remove gulp-concat and use the outFile option instead.");
46+
utils.deprecate("sortOutput is deprecated", "your project might work without it", "The non-standard option sortOutput has been removed as of gulp-typescript 3.0.\nYour project will probably compile without this option.\nOtherwise, if you're using gulp-concat, you should remove gulp-concat and use the outFile option instead.");
4847
}
4948
// Copy settings and remove several options
5049
var newSettings = {};
@@ -121,18 +120,8 @@ var compile;
121120
for (var _i = 0; _i < arguments.length; _i++) {
122121
args[_i - 0] = arguments[_i];
123122
}
124-
deprecate('ts.filter() is deprecated', 'soon you can use tsProject.resolve()', 'Filters have been removed as of gulp-typescript 3.0.\nSoon tsProject.resolve() will be available as an alternative.\nSee https://github.com/ivogabe/gulp-typescript/issues/190.');
123+
utils.deprecate('ts.filter() is deprecated', 'soon you can use tsProject.resolve()', 'Filters have been removed as of gulp-typescript 3.0.\nSoon tsProject.resolve() will be available as an alternative.\nSee https://github.com/ivogabe/gulp-typescript/issues/190.');
125124
}
126125
compile.filter = filter;
127126
})(compile || (compile = {}));
128-
function deprecate(title, alternative, description) {
129-
console.log(gutil.colors.red('gulp-typescript').toString() +
130-
gutil.colors.gray(': ') +
131-
title +
132-
gutil.colors.gray(' - ') +
133-
alternative);
134-
if (description)
135-
console.log(' ' + gutil.colors.gray(description.replace(/\n/g, '\n ')));
136-
console.log(' ' + gutil.colors.gray('More information: ' + gutil.colors.underline('http://dev.ivogabe.com/gulp-typescript-3/')));
137-
}
138127
module.exports = compile;

‎release/project.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ function setupProject(projectDirectory, config, options, typescript) {
5858
}
5959
exports.setupProject = setupProject;
6060
function src() {
61+
if (arguments.length >= 1) {
62+
utils.message("tsProject.src() takes no arguments", "Use gulp.src(..) if you need to specify a glob");
63+
}
6164
var base;
6265
if (this.options["rootDir"]) {
6366
base = path.resolve(this.projectDirectory, this.options["rootDir"]);

‎release/types.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ export interface VinylFile {
1818
isDirectory(): boolean;
1919
}
2020
export interface RawSourceMap {
21-
file?: string;
21+
file: string;
2222
sourceRoot?: string;
23-
version: string;
23+
version: number;
2424
sources: string[];
2525
names: string[];
2626
sourcesContent?: string[];

‎release/utils.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,5 @@ export declare function splitExtension(fileName: string, knownExtensions?: strin
1919
export declare function getCommonBasePath(a: string, b: string): string;
2020
export declare function getCommonBasePathOfArray(paths: string[]): string;
2121
export declare function getError(info: ts.Diagnostic, typescript: typeof ts, file?: File): reporter.TypeScriptError;
22+
export declare function deprecate(title: string, alternative: string, description?: string): void;
23+
export declare function message(title: string, alternative: string, description?: string): void;

‎release/utils.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,18 @@ function getError(info, typescript, file) {
9797
return err;
9898
}
9999
exports.getError = getError;
100+
function deprecate(title, alternative, description) {
101+
message(title, alternative, description);
102+
console.log(' ' + gutil.colors.gray('More information: ' + gutil.colors.underline('http://dev.ivogabe.com/gulp-typescript-3/')));
103+
}
104+
exports.deprecate = deprecate;
105+
function message(title, alternative, description) {
106+
console.log(gutil.colors.red('gulp-typescript').toString() +
107+
gutil.colors.gray(': ') +
108+
title +
109+
gutil.colors.gray(' - ') +
110+
alternative);
111+
if (description)
112+
console.log(' ' + gutil.colors.gray(description.replace(/\n/g, '\n ')));
113+
}
114+
exports.message = message;

0 commit comments

Comments
 (0)
Please sign in to comment.