mirror of https://github.com/microsoft/vscode.git
Enable noImplicitAny in build
This commit is contained in:
parent
a54e5f54d6
commit
ac737307d7
|
@ -6,8 +6,8 @@
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
var path = require("path");
|
var path = require("path");
|
||||||
var es = require("event-stream");
|
var es = require("event-stream");
|
||||||
var pickle = require("chromium-pickle-js");
|
var pickle = require('chromium-pickle-js');
|
||||||
var Filesystem = require("asar/lib/filesystem");
|
var Filesystem = require('asar/lib/filesystem');
|
||||||
var VinylFile = require("vinyl");
|
var VinylFile = require("vinyl");
|
||||||
var minimatch = require("minimatch");
|
var minimatch = require("minimatch");
|
||||||
function createAsar(folderPath, unpackGlobs, destFilename) {
|
function createAsar(folderPath, unpackGlobs, destFilename) {
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
|
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as es from 'event-stream';
|
import * as es from 'event-stream';
|
||||||
import * as pickle from 'chromium-pickle-js';
|
const pickle = require('chromium-pickle-js');
|
||||||
import * as Filesystem from 'asar/lib/filesystem';
|
const Filesystem = require('asar/lib/filesystem');
|
||||||
import * as VinylFile from 'vinyl';
|
import * as VinylFile from 'vinyl';
|
||||||
import * as minimatch from 'minimatch';
|
import * as minimatch from 'minimatch';
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba
|
||||||
config.paths['vs/css'] = 'out-build/vs/css.build';
|
config.paths['vs/css'] = 'out-build/vs/css.build';
|
||||||
loader.config(config);
|
loader.config(config);
|
||||||
|
|
||||||
loader(['require'], (localRequire) => {
|
loader(['require'], (localRequire: any) => {
|
||||||
let resolvePath = (path: string) => {
|
let resolvePath = (path: string) => {
|
||||||
let r = localRequire.toUrl(path);
|
let r = localRequire.toUrl(path);
|
||||||
if (!/\.js/.test(r)) {
|
if (!/\.js/.test(r)) {
|
||||||
|
@ -155,7 +155,7 @@ export function bundle(entryPoints: IEntryPoint[], config: ILoaderConfig, callba
|
||||||
cssInlinedResources: cssInlinedResources,
|
cssInlinedResources: cssInlinedResources,
|
||||||
bundleData: partialResult.bundleData
|
bundleData: partialResult.bundleData
|
||||||
});
|
});
|
||||||
}, (err) => callback(err, null));
|
}, (err: any) => callback(err, null));
|
||||||
}
|
}
|
||||||
|
|
||||||
function emitEntryPoints(modules: IBuildModuleInfo[], entryPoints: IEntryPointMap): IPartialBundleResult {
|
function emitEntryPoints(modules: IBuildModuleInfo[], entryPoints: IEntryPointMap): IPartialBundleResult {
|
||||||
|
@ -463,7 +463,7 @@ function emitEntryPoint(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let toIFile = (path): IFile => {
|
let toIFile = (path: string): IFile => {
|
||||||
let contents = readFileAndRemoveBOM(path);
|
let contents = readFileAndRemoveBOM(path);
|
||||||
return {
|
return {
|
||||||
path: path,
|
path: path,
|
||||||
|
@ -495,7 +495,7 @@ function readFileAndRemoveBOM(path: string): string {
|
||||||
function emitPlugin(entryPoint: string, plugin: ILoaderPlugin, pluginName: string, moduleName: string): IFile {
|
function emitPlugin(entryPoint: string, plugin: ILoaderPlugin, pluginName: string, moduleName: string): IFile {
|
||||||
let result = '';
|
let result = '';
|
||||||
if (typeof plugin.write === 'function') {
|
if (typeof plugin.write === 'function') {
|
||||||
let write: ILoaderPluginWriteFunc = <any>((what) => {
|
let write: ILoaderPluginWriteFunc = <any>((what: string) => {
|
||||||
result += what;
|
result += what;
|
||||||
});
|
});
|
||||||
write.getEntryPoint = () => {
|
write.getEntryPoint = () => {
|
||||||
|
|
|
@ -26,11 +26,11 @@ var stats_1 = require("./stats");
|
||||||
var util2 = require("./util");
|
var util2 = require("./util");
|
||||||
var remote = require("gulp-remote-src");
|
var remote = require("gulp-remote-src");
|
||||||
var vzip = require('gulp-vinyl-zip');
|
var vzip = require('gulp-vinyl-zip');
|
||||||
var filter = require('gulp-filter');
|
var filter = require("gulp-filter");
|
||||||
var rename = require('gulp-rename');
|
var rename = require("gulp-rename");
|
||||||
var util = require('gulp-util');
|
var util = require('gulp-util');
|
||||||
var buffer = require('gulp-buffer');
|
var buffer = require('gulp-buffer');
|
||||||
var json = require('gulp-json-editor');
|
var json = require("gulp-json-editor");
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
var webpackGulp = require('webpack-stream');
|
var webpackGulp = require('webpack-stream');
|
||||||
var root = path.resolve(path.join(__dirname, '..', '..'));
|
var root = path.resolve(path.join(__dirname, '..', '..'));
|
||||||
|
|
|
@ -15,11 +15,11 @@ import { createStatsStream } from './stats';
|
||||||
import * as util2 from './util';
|
import * as util2 from './util';
|
||||||
import remote = require('gulp-remote-src');
|
import remote = require('gulp-remote-src');
|
||||||
const vzip = require('gulp-vinyl-zip');
|
const vzip = require('gulp-vinyl-zip');
|
||||||
const filter = require('gulp-filter');
|
import filter = require('gulp-filter');
|
||||||
const rename = require('gulp-rename');
|
import rename = require('gulp-rename');
|
||||||
const util = require('gulp-util');
|
const util = require('gulp-util');
|
||||||
const buffer = require('gulp-buffer');
|
const buffer = require('gulp-buffer');
|
||||||
const json = require('gulp-json-editor');
|
import json = require('gulp-json-editor');
|
||||||
const webpack = require('webpack');
|
const webpack = require('webpack');
|
||||||
const webpackGulp = require('webpack-stream');
|
const webpackGulp = require('webpack-stream');
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
|
||||||
const patchFilesStream = filesStream
|
const patchFilesStream = filesStream
|
||||||
.pipe(packageJsonFilter)
|
.pipe(packageJsonFilter)
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(json(data => {
|
.pipe(json((data: any) => {
|
||||||
// hardcoded entry point directory!
|
// hardcoded entry point directory!
|
||||||
data.main = data.main.replace('/out/', /dist/);
|
data.main = data.main.replace('/out/', /dist/);
|
||||||
return data;
|
return data;
|
||||||
|
@ -89,7 +89,7 @@ function fromLocalWebpack(extensionPath: string, sourceMappingURLBase: string |
|
||||||
|
|
||||||
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => {
|
const webpackStreams = webpackConfigLocations.map(webpackConfigPath => {
|
||||||
|
|
||||||
const webpackDone = (err, stats) => {
|
const webpackDone = (err: any, stats: any) => {
|
||||||
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
util.log(`Bundled extension: ${util.colors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
|
||||||
if (err) {
|
if (err) {
|
||||||
result.emit('error', err);
|
result.emit('error', err);
|
||||||
|
@ -205,7 +205,7 @@ export function fromMarketplace(extensionName: string, version: string, metadata
|
||||||
return remote('', options)
|
return remote('', options)
|
||||||
.pipe(vzip.src())
|
.pipe(vzip.src())
|
||||||
.pipe(filter('extension/**'))
|
.pipe(filter('extension/**'))
|
||||||
.pipe(rename(p => p.dirname = p.dirname.replace(/^extension\/?/, '')))
|
.pipe(rename(p => p.dirname = p.dirname!.replace(/^extension\/?/, '')))
|
||||||
.pipe(packageJsonFilter)
|
.pipe(packageJsonFilter)
|
||||||
.pipe(buffer())
|
.pipe(buffer())
|
||||||
.pipe(json({ __metadata: metadata }))
|
.pipe(json({ __metadata: metadata }))
|
||||||
|
|
|
@ -957,7 +957,7 @@ function pullXlfFiles(apiHostname, username, password, language, resources) {
|
||||||
var credentials = username + ":" + password;
|
var credentials = username + ":" + password;
|
||||||
var expectedTranslationsCount = resources.length;
|
var expectedTranslationsCount = resources.length;
|
||||||
var translationsRetrieved = 0, called = false;
|
var translationsRetrieved = 0, called = false;
|
||||||
return event_stream_1.readable(function (count, callback) {
|
return event_stream_1.readable(function (_count, callback) {
|
||||||
// Mark end of stream when all resources were retrieved
|
// Mark end of stream when all resources were retrieved
|
||||||
if (translationsRetrieved === expectedTranslationsCount) {
|
if (translationsRetrieved === expectedTranslationsCount) {
|
||||||
return this.emit('end');
|
return this.emit('end');
|
||||||
|
|
|
@ -289,14 +289,14 @@ export class XLF {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let parser = new xml2js.Parser();
|
let parser = new xml2js.Parser();
|
||||||
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
|
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
|
||||||
parser.parseString(xlfString, function (err, result) {
|
parser.parseString(xlfString, function (err: any, result: any) {
|
||||||
const fileNodes: any[] = result['xliff']['file'];
|
const fileNodes: any[] = result['xliff']['file'];
|
||||||
fileNodes.forEach(file => {
|
fileNodes.forEach(file => {
|
||||||
const originalFilePath = file.$.original;
|
const originalFilePath = file.$.original;
|
||||||
const messages: Map<string> = {};
|
const messages: Map<string> = {};
|
||||||
const transUnits = file.body[0]['trans-unit'];
|
const transUnits = file.body[0]['trans-unit'];
|
||||||
if (transUnits) {
|
if (transUnits) {
|
||||||
transUnits.forEach(unit => {
|
transUnits.forEach((unit: any) => {
|
||||||
const key = unit.$.id;
|
const key = unit.$.id;
|
||||||
const val = pseudify(unit.source[0]['_'].toString());
|
const val = pseudify(unit.source[0]['_'].toString());
|
||||||
if (key && val) {
|
if (key && val) {
|
||||||
|
@ -317,7 +317,7 @@ export class XLF {
|
||||||
|
|
||||||
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
|
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
|
||||||
|
|
||||||
parser.parseString(xlfString, function (err, result) {
|
parser.parseString(xlfString, function (err: any, result: any) {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
|
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
|
||||||
}
|
}
|
||||||
|
@ -340,7 +340,7 @@ export class XLF {
|
||||||
|
|
||||||
const transUnits = file.body[0]['trans-unit'];
|
const transUnits = file.body[0]['trans-unit'];
|
||||||
if (transUnits) {
|
if (transUnits) {
|
||||||
transUnits.forEach(unit => {
|
transUnits.forEach((unit: any) => {
|
||||||
const key = unit.$.id;
|
const key = unit.$.id;
|
||||||
if (!unit.target) {
|
if (!unit.target) {
|
||||||
return; // No translation available
|
return; // No translation available
|
||||||
|
@ -1077,7 +1077,7 @@ function pullXlfFiles(apiHostname: string, username: string, password: string, l
|
||||||
let expectedTranslationsCount = resources.length;
|
let expectedTranslationsCount = resources.length;
|
||||||
let translationsRetrieved = 0, called = false;
|
let translationsRetrieved = 0, called = false;
|
||||||
|
|
||||||
return readable(function (count, callback) {
|
return readable(function (_count: any, callback: any) {
|
||||||
// Mark end of stream when all resources were retrieved
|
// Mark end of stream when all resources were retrieved
|
||||||
if (translationsRetrieved === expectedTranslationsCount) {
|
if (translationsRetrieved === expectedTranslationsCount) {
|
||||||
return this.emit('end');
|
return this.emit('end');
|
||||||
|
@ -1101,7 +1101,7 @@ function pullXlfFiles(apiHostname: string, username: string, password: string, l
|
||||||
}
|
}
|
||||||
const limiter = new Limiter<File | null>(NUMBER_OF_CONCURRENT_DOWNLOADS);
|
const limiter = new Limiter<File | null>(NUMBER_OF_CONCURRENT_DOWNLOADS);
|
||||||
|
|
||||||
function retrieveResource(language: Language, resource: Resource, apiHostname, credentials): Promise<File | null> {
|
function retrieveResource(language: Language, resource: Resource, apiHostname: string, credentials: string): Promise<File | null> {
|
||||||
return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
|
return limiter.queue(() => new Promise<File | null>((resolve, reject) => {
|
||||||
const slug = resource.name.replace(/\//g, '_');
|
const slug = resource.name.replace(/\//g, '_');
|
||||||
const project = resource.project;
|
const project = resource.project;
|
||||||
|
|
|
@ -181,7 +181,7 @@ exports.optimizeTask = optimizeTask;
|
||||||
*/
|
*/
|
||||||
function uglifyWithCopyrights() {
|
function uglifyWithCopyrights() {
|
||||||
var preserveComments = function (f) {
|
var preserveComments = function (f) {
|
||||||
return function (node, comment) {
|
return function (_node, comment) {
|
||||||
var text = comment.value;
|
var text = comment.value;
|
||||||
var type = comment.type;
|
var type = comment.type;
|
||||||
if (/@minifier_do_not_preserve/.test(text)) {
|
if (/@minifier_do_not_preserve/.test(text)) {
|
||||||
|
|
|
@ -32,7 +32,7 @@ function log(prefix: string, message: string): void {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function loaderConfig(emptyPaths?: string[]) {
|
export function loaderConfig(emptyPaths?: string[]) {
|
||||||
const result = {
|
const result: any = {
|
||||||
paths: {
|
paths: {
|
||||||
'vs': 'out-build/vs',
|
'vs': 'out-build/vs',
|
||||||
'vscode': 'empty:'
|
'vscode': 'empty:'
|
||||||
|
@ -258,7 +258,7 @@ declare class FileWithCopyright extends VinylFile {
|
||||||
*/
|
*/
|
||||||
function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
|
function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
|
||||||
const preserveComments = (f: FileWithCopyright) => {
|
const preserveComments = (f: FileWithCopyright) => {
|
||||||
return (node, comment: { value: string; type: string; }) => {
|
return (_node: any, comment: { value: string; type: string; }) => {
|
||||||
const text = comment.value;
|
const text = comment.value;
|
||||||
const type = comment.type;
|
const type = comment.type;
|
||||||
|
|
||||||
|
@ -286,7 +286,7 @@ function uglifyWithCopyrights(): NodeJS.ReadWriteStream {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const minify = composer(uglifyes);
|
const minify = (composer as any)(uglifyes);
|
||||||
const input = es.through();
|
const input = es.through();
|
||||||
const output = input
|
const output = input
|
||||||
.pipe(flatmap((stream, f) => {
|
.pipe(flatmap((stream, f) => {
|
||||||
|
@ -325,7 +325,7 @@ export function minifyTask(src: string, sourceMapBaseUrl?: string): (cb: any) =>
|
||||||
}),
|
}),
|
||||||
gulp.dest(src + '-min')
|
gulp.dest(src + '-min')
|
||||||
, (err: any) => {
|
, (err: any) => {
|
||||||
if (err instanceof uglify.GulpUglifyError) {
|
if (err instanceof (uglify as any).GulpUglifyError) {
|
||||||
console.error(`Uglify error in '${err.cause && err.cause.filename}'`);
|
console.error(`Uglify error in '${err.cause && err.cause.filename}'`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -99,8 +99,8 @@ export function submitAllStats(productJson: any, commit: string): Promise<boolea
|
||||||
return new Promise(resolve => {
|
return new Promise(resolve => {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const sizes = {};
|
const sizes: any = {};
|
||||||
const counts = {};
|
const counts: any = {};
|
||||||
for (const entry of sorted) {
|
for (const entry of sorted) {
|
||||||
sizes[entry.name] = entry.totalSize;
|
sizes[entry.name] = entry.totalSize;
|
||||||
counts[entry.name] = entry.totalCount;
|
counts[entry.name] = entry.totalCount;
|
||||||
|
|
|
@ -59,7 +59,7 @@ class TranslationRemindRuleWalker extends Lint.RuleWalker {
|
||||||
}
|
}
|
||||||
const workbenchResources = JSON.parse(json).workbench;
|
const workbenchResources = JSON.parse(json).workbench;
|
||||||
|
|
||||||
workbenchResources.forEach(existingResource => {
|
workbenchResources.forEach((existingResource: any) => {
|
||||||
if (existingResource.name === resource) {
|
if (existingResource.name === resource) {
|
||||||
resourceDefined = true;
|
resourceDefined = true;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
declare module "event-stream" {
|
declare module "event-stream" {
|
||||||
import { Stream } from 'stream';
|
import { Stream } from 'stream';
|
||||||
import { ThroughStream as _ThroughStream} from 'through';
|
import { ThroughStream as _ThroughStream} from 'through';
|
||||||
import { MapStream } from 'map-stream';
|
|
||||||
import * as File from 'vinyl';
|
import * as File from 'vinyl';
|
||||||
|
|
||||||
export interface ThroughStream extends _ThroughStream {
|
export interface ThroughStream extends _ThroughStream {
|
||||||
queue(data: File | null);
|
queue(data: File | null): any;
|
||||||
push(data: File | null);
|
push(data: File | null): any;
|
||||||
paused: boolean;
|
paused: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,5 +23,5 @@ declare module "event-stream" {
|
||||||
function mapSync<I,O>(cb: (data:I) => O): ThroughStream;
|
function mapSync<I,O>(cb: (data:I) => O): ThroughStream;
|
||||||
function map<I,O>(cb: (data:I, cb:(err?:Error, data?: O)=>void) => O): ThroughStream;
|
function map<I,O>(cb: (data:I, cb:(err?:Error, data?: O)=>void) => O): ThroughStream;
|
||||||
|
|
||||||
function readable(asyncFunction: Function): MapStream;
|
function readable(asyncFunction: Function): any;
|
||||||
}
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
declare module 'github-releases' {
|
||||||
|
|
||||||
|
}
|
|
@ -1,64 +0,0 @@
|
||||||
// Type definitions for Minimatch 2.0.8
|
|
||||||
// Project: https://github.com/isaacs/minimatch
|
|
||||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
||||||
|
|
||||||
declare module "minimatch" {
|
|
||||||
|
|
||||||
function M(target: string, pattern: string, options?: M.IOptions): boolean;
|
|
||||||
|
|
||||||
namespace M {
|
|
||||||
function match(list: string[], pattern: string, options?: IOptions): string[];
|
|
||||||
function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: string[]) => boolean;
|
|
||||||
function makeRe(pattern: string, options?: IOptions): RegExp;
|
|
||||||
|
|
||||||
var Minimatch: IMinimatchStatic;
|
|
||||||
|
|
||||||
interface IOptions {
|
|
||||||
debug?: boolean;
|
|
||||||
nobrace?: boolean;
|
|
||||||
noglobstar?: boolean;
|
|
||||||
dot?: boolean;
|
|
||||||
noext?: boolean;
|
|
||||||
nocase?: boolean;
|
|
||||||
nonull?: boolean;
|
|
||||||
matchBase?: boolean;
|
|
||||||
nocomment?: boolean;
|
|
||||||
nonegate?: boolean;
|
|
||||||
flipNegate?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IMinimatchStatic {
|
|
||||||
new (pattern: string, options?: IOptions): IMinimatch;
|
|
||||||
prototype: IMinimatch;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface IMinimatch {
|
|
||||||
pattern: string;
|
|
||||||
options: IOptions;
|
|
||||||
/** 2-dimensional array of regexp or string expressions. */
|
|
||||||
set: any[][]; // (RegExp | string)[][]
|
|
||||||
regexp: RegExp;
|
|
||||||
negate: boolean;
|
|
||||||
comment: boolean;
|
|
||||||
empty: boolean;
|
|
||||||
|
|
||||||
makeRe(): RegExp; // regexp or boolean
|
|
||||||
match(fname: string): boolean;
|
|
||||||
matchOne(files: string[], pattern: string[], partial: boolean): boolean;
|
|
||||||
|
|
||||||
/** Deprecated. For internal use. */
|
|
||||||
debug(): void;
|
|
||||||
/** Deprecated. For internal use. */
|
|
||||||
make(): void;
|
|
||||||
/** Deprecated. For internal use. */
|
|
||||||
parseNegate(): void;
|
|
||||||
/** Deprecated. For internal use. */
|
|
||||||
braceExpand(pattern: string, options: IOptions): void;
|
|
||||||
/** Deprecated. For internal use. */
|
|
||||||
parse(pattern: string, isSub?: boolean): void;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export = M;
|
|
||||||
}
|
|
|
@ -1,17 +0,0 @@
|
||||||
// Type definitions for rimraf
|
|
||||||
// Project: https://github.com/isaacs/rimraf
|
|
||||||
// Definitions by: Carlos Ballesteros Velasco <https://github.com/soywiz>
|
|
||||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
||||||
|
|
||||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/rimraf.d.ts
|
|
||||||
|
|
||||||
declare module "rimraf" {
|
|
||||||
function rimraf(path: string, callback: (error: Error) => void): void;
|
|
||||||
function rimraf(path: string, opts:{}, callback: (error: Error) => void): void;
|
|
||||||
namespace rimraf {
|
|
||||||
export function sync(path: string): void;
|
|
||||||
export var EMFILE_MAX: number;
|
|
||||||
export var BUSYTRIES_MAX: number;
|
|
||||||
}
|
|
||||||
export = rimraf;
|
|
||||||
}
|
|
|
@ -36,7 +36,7 @@ export function incremental(streamProvider: IStreamProvider, initial: NodeJS.Rea
|
||||||
|
|
||||||
const token: ICancellationToken | undefined = !supportsCancellation ? undefined : { isCancellationRequested: () => Object.keys(buffer).length > 0 };
|
const token: ICancellationToken | undefined = !supportsCancellation ? undefined : { isCancellationRequested: () => Object.keys(buffer).length > 0 };
|
||||||
|
|
||||||
const run = (input, isCancellable) => {
|
const run = (input: NodeJS.ReadWriteStream, isCancellable: boolean) => {
|
||||||
state = 'running';
|
state = 'running';
|
||||||
|
|
||||||
const stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken);
|
const stream = !supportsCancellation ? streamProvider() : streamProvider(isCancellable ? token : NoCancellationToken);
|
||||||
|
@ -220,7 +220,7 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
|
||||||
export function rimraf(dir: string): (cb: any) => void {
|
export function rimraf(dir: string): (cb: any) => void {
|
||||||
let retries = 0;
|
let retries = 0;
|
||||||
|
|
||||||
const retry = cb => {
|
const retry = (cb: (err?: any) => void) => {
|
||||||
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
|
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
return cb();
|
return cb();
|
||||||
|
|
|
@ -6,18 +6,24 @@
|
||||||
"@types/documentdb": "1.10.2",
|
"@types/documentdb": "1.10.2",
|
||||||
"@types/es6-collections": "0.5.31",
|
"@types/es6-collections": "0.5.31",
|
||||||
"@types/es6-promise": "0.0.33",
|
"@types/es6-promise": "0.0.33",
|
||||||
|
"@types/glob": "^7.1.1",
|
||||||
|
"@types/gulp-json-editor": "^2.2.31",
|
||||||
|
"@types/gulp-uglify": "^3.0.5",
|
||||||
"@types/mime": "0.0.29",
|
"@types/mime": "0.0.29",
|
||||||
|
"@types/minimatch": "^2.0.29",
|
||||||
"@types/node": "8.0.33",
|
"@types/node": "8.0.33",
|
||||||
"@types/xml2js": "0.0.33",
|
|
||||||
"@types/request": "^2.47.0",
|
"@types/request": "^2.47.0",
|
||||||
|
"@types/rimraf": "^2.0.2",
|
||||||
|
"@types/uglify-es": "^3.0.0",
|
||||||
|
"@types/xml2js": "0.0.33",
|
||||||
"azure-storage": "^2.1.0",
|
"azure-storage": "^2.1.0",
|
||||||
"documentdb": "1.13.0",
|
"documentdb": "1.13.0",
|
||||||
|
"github-releases": "^0.4.1",
|
||||||
"mime": "^1.3.4",
|
"mime": "^1.3.4",
|
||||||
"minimist": "^1.2.0",
|
"minimist": "^1.2.0",
|
||||||
|
"request": "^2.85.0",
|
||||||
"typescript": "3.1.1",
|
"typescript": "3.1.1",
|
||||||
"xml2js": "^0.4.17",
|
"xml2js": "^0.4.17"
|
||||||
"github-releases": "^0.4.1",
|
|
||||||
"request": "^2.85.0"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "tsc -p tsconfig.build.json",
|
"compile": "tsc -p tsconfig.build.json",
|
||||||
|
|
|
@ -107,17 +107,17 @@ function asyncRequest<T>(options: request.UrlOptions & request.CoreOptions): Pro
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadAsset(repository, assetName: string, targetPath: string, electronVersion: string) {
|
function downloadAsset(repository: any, assetName: string, targetPath: string, electronVersion: string) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
repository.getReleases({ tag_name: `v${electronVersion}` }, (err, releases) => {
|
repository.getReleases({ tag_name: `v${electronVersion}` }, (err: any, releases: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
const asset = releases[0].assets.filter(asset => asset.name === assetName)[0];
|
const asset = releases[0].assets.filter((asset: any) => asset.name === assetName)[0];
|
||||||
if (!asset) {
|
if (!asset) {
|
||||||
reject(new Error(`Asset with name ${assetName} not found`));
|
reject(new Error(`Asset with name ${assetName} not found`));
|
||||||
} else {
|
} else {
|
||||||
repository.downloadAsset(asset, (err, reader) => {
|
repository.downloadAsset(asset, (err: any, reader: any) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
} else {
|
} else {
|
||||||
|
@ -156,7 +156,7 @@ async function ensureVersionAndSymbols(options: IOptions) {
|
||||||
const symbolsName = symbolsZipName(options.platform, options.versions.electron, options.versions.insiders);
|
const symbolsName = symbolsZipName(options.platform, options.versions.electron, options.versions.insiders);
|
||||||
const symbolsPath = await tmpFile('symbols.zip');
|
const symbolsPath = await tmpFile('symbols.zip');
|
||||||
console.log(`HockeyApp: downloading symbols ${symbolsName} for electron ${options.versions.electron} (${options.platform}) into ${symbolsPath}`);
|
console.log(`HockeyApp: downloading symbols ${symbolsName} for electron ${options.versions.electron} (${options.platform}) into ${symbolsPath}`);
|
||||||
await downloadAsset(new github({ repo: options.repository, token: options.access.githubToken }), symbolsName, symbolsPath, options.versions.electron);
|
await downloadAsset(new (github as any)({ repo: options.repository, token: options.access.githubToken }), symbolsName, symbolsPath, options.versions.electron);
|
||||||
|
|
||||||
// Create version
|
// Create version
|
||||||
console.log(`HockeyApp: creating new version ${options.versions.code} (${options.platform})`);
|
console.log(`HockeyApp: creating new version ${options.versions.code} (${options.platform})`);
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es5",
|
"target": "es5",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"noImplicitAny": false,
|
"noImplicitAny": true,
|
||||||
"removeComments": false,
|
"removeComments": false,
|
||||||
"preserveConstEnums": true,
|
"preserveConstEnums": true,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
|
|
|
@ -31,6 +31,11 @@
|
||||||
resolved "https://registry.yarnpkg.com/@types/es6-promise/-/es6-promise-0.0.33.tgz#280a707e62b1b6bef1a86cc0861ec63cd06c7ff3"
|
resolved "https://registry.yarnpkg.com/@types/es6-promise/-/es6-promise-0.0.33.tgz#280a707e62b1b6bef1a86cc0861ec63cd06c7ff3"
|
||||||
integrity sha512-HKJFVLCGrWQ/1unEw8JdaTxu6n3EUxmwTxJ6D0O1x0gD8joCsgoTWxEgevb7fp2XIogNjof3KEd+3bJoGne/nw==
|
integrity sha512-HKJFVLCGrWQ/1unEw8JdaTxu6n3EUxmwTxJ6D0O1x0gD8joCsgoTWxEgevb7fp2XIogNjof3KEd+3bJoGne/nw==
|
||||||
|
|
||||||
|
"@types/events@*":
|
||||||
|
version "1.2.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/events/-/events-1.2.0.tgz#81a6731ce4df43619e5c8c945383b3e62a89ea86"
|
||||||
|
integrity sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==
|
||||||
|
|
||||||
"@types/form-data@*":
|
"@types/form-data@*":
|
||||||
version "2.2.1"
|
version "2.2.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e"
|
resolved "https://registry.yarnpkg.com/@types/form-data/-/form-data-2.2.1.tgz#ee2b3b8eaa11c0938289953606b745b738c54b1e"
|
||||||
|
@ -38,11 +43,51 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/glob@*", "@types/glob@^7.1.1":
|
||||||
|
version "7.1.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575"
|
||||||
|
integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==
|
||||||
|
dependencies:
|
||||||
|
"@types/events" "*"
|
||||||
|
"@types/minimatch" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/gulp-json-editor@^2.2.31":
|
||||||
|
version "2.2.31"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/gulp-json-editor/-/gulp-json-editor-2.2.31.tgz#3c1a8950556c109a0e2d0ab11d5f2a2443665ed2"
|
||||||
|
integrity sha512-piis0ImYAy0dt18R4EtTbAY+RV8jwTq5VisnUV6OfP8kD4743aHGkAdAd08No4NY3rFa5mD6ytIu8L0YU7nL9w==
|
||||||
|
dependencies:
|
||||||
|
"@types/js-beautify" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
|
"@types/gulp-uglify@^3.0.5":
|
||||||
|
version "3.0.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/gulp-uglify/-/gulp-uglify-3.0.5.tgz#ddcbbb6bd15a84b8a6c5e2218c2efba98102d135"
|
||||||
|
integrity sha512-LD2b6gCPugrKI1W188nIp0gm+cAnGGwaTFpPdeZYVXwPHdoCQloy3du0JR62MeMjAwUwlcOb+SKYT6Qgw7yBiA==
|
||||||
|
dependencies:
|
||||||
|
"@types/node" "*"
|
||||||
|
"@types/uglify-js" "^2"
|
||||||
|
|
||||||
|
"@types/js-beautify@*":
|
||||||
|
version "1.8.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/js-beautify/-/js-beautify-1.8.0.tgz#0369d3d0e1f35a6aec07cb4da2ee2bcda111367c"
|
||||||
|
integrity sha512-/siF86XrwDKLuHe8l7h6NhrAWgLdgqbxmjZv9NvGWmgYRZoTipkjKiWb0SQHy/jcR+ee0GvbG6uGd+LEBMGNvA==
|
||||||
|
|
||||||
"@types/mime@0.0.29":
|
"@types/mime@0.0.29":
|
||||||
version "0.0.29"
|
version "0.0.29"
|
||||||
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b"
|
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-0.0.29.tgz#fbcfd330573b912ef59eeee14602bface630754b"
|
||||||
integrity sha1-+8/TMFc7kS71nu7hRgK/rOYwdUs=
|
integrity sha1-+8/TMFc7kS71nu7hRgK/rOYwdUs=
|
||||||
|
|
||||||
|
"@types/minimatch@*":
|
||||||
|
version "3.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d"
|
||||||
|
integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==
|
||||||
|
|
||||||
|
"@types/minimatch@^2.0.29":
|
||||||
|
version "2.0.29"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-2.0.29.tgz#5002e14f75e2d71e564281df0431c8c1b4a2a36a"
|
||||||
|
integrity sha1-UALhT3Xi1x5WQoHfBDHIwbSio2o=
|
||||||
|
|
||||||
"@types/node@*":
|
"@types/node@*":
|
||||||
version "8.0.51"
|
version "8.0.51"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.51.tgz#b31d716fb8d58eeb95c068a039b9b6292817d5fb"
|
||||||
|
@ -63,11 +108,40 @@
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
"@types/tough-cookie" "*"
|
"@types/tough-cookie" "*"
|
||||||
|
|
||||||
|
"@types/rimraf@^2.0.2":
|
||||||
|
version "2.0.2"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-2.0.2.tgz#7f0fc3cf0ff0ad2a99bb723ae1764f30acaf8b6e"
|
||||||
|
integrity sha512-Hm/bnWq0TCy7jmjeN5bKYij9vw5GrDFWME4IuxV08278NtU/VdGbzsBohcCUJ7+QMqmUq5hpRKB39HeQWJjztQ==
|
||||||
|
dependencies:
|
||||||
|
"@types/glob" "*"
|
||||||
|
"@types/node" "*"
|
||||||
|
|
||||||
"@types/tough-cookie@*":
|
"@types/tough-cookie@*":
|
||||||
version "2.3.2"
|
version "2.3.2"
|
||||||
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.2.tgz#e0d481d8bb282ad8a8c9e100ceb72c995fb5e709"
|
resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-2.3.2.tgz#e0d481d8bb282ad8a8c9e100ceb72c995fb5e709"
|
||||||
integrity sha512-vOVmaruQG5EatOU/jM6yU2uCp3Lz6mK1P5Ztu4iJjfM4SVHU9XYktPUQtKlIXuahqXHdEyUarMrBEwg5Cwu+bA==
|
integrity sha512-vOVmaruQG5EatOU/jM6yU2uCp3Lz6mK1P5Ztu4iJjfM4SVHU9XYktPUQtKlIXuahqXHdEyUarMrBEwg5Cwu+bA==
|
||||||
|
|
||||||
|
"@types/uglify-es@^3.0.0":
|
||||||
|
version "3.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/uglify-es/-/uglify-es-3.0.0.tgz#2c5e70b43c0e86643ac1c223f61df15fa0b87bc2"
|
||||||
|
integrity sha512-Oc/c7pGIQL0MVhC6g+VftWiDQethKsT4c3fQKYm6nOprkvkx9s1MLrnJprDTKlZL3ZJulMpCF9Qn7s6u3uCNxQ==
|
||||||
|
dependencies:
|
||||||
|
"@types/uglify-js" "*"
|
||||||
|
|
||||||
|
"@types/uglify-js@*":
|
||||||
|
version "3.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-3.0.3.tgz#801a5ca1dc642861f47c46d14b700ed2d610840b"
|
||||||
|
integrity sha512-MAT0BW2ruO0LhQKjvlipLGCF/Yx0y/cj+tT67tK3QIQDrM2+9R78HgJ54VlrE8AbfjYJJBCQCEPM5ZblPVTuww==
|
||||||
|
dependencies:
|
||||||
|
source-map "^0.6.1"
|
||||||
|
|
||||||
|
"@types/uglify-js@^2":
|
||||||
|
version "2.6.31"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/uglify-js/-/uglify-js-2.6.31.tgz#c694755eeb6a1bb9f8f321f3ec37cc22ca4c4f6b"
|
||||||
|
integrity sha512-LjcyGt6CHsgZ0AoofnMwhyxo9hUqz2mgl6IcF+S8B1zdSTxHAvTO/1RPvBAHG3C1ZeAc+AoWA5mb3lDJKtM9Zg==
|
||||||
|
dependencies:
|
||||||
|
source-map "^0.6.1"
|
||||||
|
|
||||||
"@types/xml2js@0.0.33":
|
"@types/xml2js@0.0.33":
|
||||||
version "0.0.33"
|
version "0.0.33"
|
||||||
resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.0.33.tgz#20c5dd6460245284d64a55690015b95e409fb7de"
|
resolved "https://registry.yarnpkg.com/@types/xml2js/-/xml2js-0.0.33.tgz#20c5dd6460245284d64a55690015b95e409fb7de"
|
||||||
|
@ -714,6 +788,11 @@ sntp@2.x.x:
|
||||||
dependencies:
|
dependencies:
|
||||||
hoek "4.x.x"
|
hoek "4.x.x"
|
||||||
|
|
||||||
|
source-map@^0.6.1:
|
||||||
|
version "0.6.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
|
||||||
|
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
|
||||||
|
|
||||||
sshpk@^1.7.0:
|
sshpk@^1.7.0:
|
||||||
version "1.13.1"
|
version "1.13.1"
|
||||||
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
|
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
|
||||||
|
|
Loading…
Reference in New Issue