consolidate build package.json
This commit is contained in:
parent
613724d43b
commit
74fab50d5d
27 changed files with 3612 additions and 23471 deletions
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fs = require("fs");
|
||||
var path = require("path");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var event_stream_1 = require("event-stream");
|
||||
var assign = require("object-assign");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var path = require("path");
|
||||
var fs = require("fs");
|
||||
|
@ -527,7 +527,6 @@ var workbenchResources = [
|
|||
{ name: 'vs/workbench/parts/extensions', project: workbenchProject },
|
||||
{ name: 'vs/workbench/parts/feedback', project: workbenchProject },
|
||||
{ name: 'vs/workbench/parts/files', project: workbenchProject },
|
||||
{ name: 'vs/workbench/parts/git', project: workbenchProject },
|
||||
{ name: 'vs/workbench/parts/html', project: workbenchProject },
|
||||
{ name: 'vs/workbench/parts/markers', project: workbenchProject },
|
||||
{ name: 'vs/workbench/parts/nps', project: workbenchProject },
|
||||
|
@ -557,30 +556,30 @@ var workbenchResources = [
|
|||
];
|
||||
function getResource(sourceFile) {
|
||||
var resource;
|
||||
if (sourceFile.startsWith('vs/platform')) {
|
||||
if (/^vs\/platform/.test(sourceFile)) {
|
||||
return { name: 'vs/platform', project: editorProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/editor/contrib')) {
|
||||
else if (/^vs\/editor\/contrib/.test(sourceFile)) {
|
||||
return { name: 'vs/editor/contrib', project: editorProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/editor')) {
|
||||
else if (/^vs\/editor/.test(sourceFile)) {
|
||||
return { name: 'vs/editor', project: editorProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/base')) {
|
||||
else if (/^vs\/base/.test(sourceFile)) {
|
||||
return { name: 'vs/base', project: editorProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/code')) {
|
||||
else if (/^vs\/code/.test(sourceFile)) {
|
||||
return { name: 'vs/code', project: workbenchProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/workbench/parts')) {
|
||||
else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
||||
resource = sourceFile.split('/', 4).join('/');
|
||||
return { name: resource, project: workbenchProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/workbench/services')) {
|
||||
else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
||||
resource = sourceFile.split('/', 4).join('/');
|
||||
return { name: resource, project: workbenchProject };
|
||||
}
|
||||
else if (sourceFile.startsWith('vs/workbench')) {
|
||||
else if (/^vs\/workbench/.test(sourceFile)) {
|
||||
return { name: 'vs/workbench', project: workbenchProject };
|
||||
}
|
||||
throw new Error("Could not identify the XLF bundle for " + sourceFile);
|
||||
|
@ -914,7 +913,7 @@ function prepareJsonFiles() {
|
|||
resolvedFiles.forEach(function (file) {
|
||||
var messages = file.messages, translatedFile;
|
||||
// ISL file path always starts with 'build/'
|
||||
if (file.originalFilePath.startsWith('build/')) {
|
||||
if (/^build\//.test(file.originalFilePath)) {
|
||||
var defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true };
|
||||
if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) {
|
||||
return;
|
||||
|
|
|
@ -220,13 +220,13 @@ export class XLF {
|
|||
this.buffer.push(line.toString());
|
||||
}
|
||||
|
||||
static parse = function(xlfString: string) : Promise<ParsedXLF[]> {
|
||||
static parse = function (xlfString: string): Promise<ParsedXLF[]> {
|
||||
return new Promise((resolve, reject) => {
|
||||
let parser = new xml2js.Parser();
|
||||
|
||||
let files: { messages: Map<string>, originalFilePath: string, language: string }[] = [];
|
||||
|
||||
parser.parseString(xlfString, function(err, result) {
|
||||
parser.parseString(xlfString, function (err, result) {
|
||||
if (err) {
|
||||
reject(`Failed to parse XLIFF string. ${err}`);
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ function stripComments(content: string): string {
|
|||
// A line comment. If it ends in \r?\n then keep it.
|
||||
let length = m4.length;
|
||||
if (length > 2 && m4[length - 1] === '\n') {
|
||||
return m4[length - 2] === '\r' ? '\r\n': '\n';
|
||||
return m4[length - 2] === '\r' ? '\r\n' : '\n';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
|
@ -384,11 +384,11 @@ function stripComments(content: string): string {
|
|||
return result;
|
||||
}
|
||||
|
||||
function escapeCharacters(value:string):string {
|
||||
var result:string[] = [];
|
||||
function escapeCharacters(value: string): string {
|
||||
var result: string[] = [];
|
||||
for (var i = 0; i < value.length; i++) {
|
||||
var ch = value.charAt(i);
|
||||
switch(ch) {
|
||||
switch (ch) {
|
||||
case '\'':
|
||||
result.push('\\\'');
|
||||
break;
|
||||
|
@ -420,7 +420,7 @@ function escapeCharacters(value:string):string {
|
|||
return result.join('');
|
||||
}
|
||||
|
||||
function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter: any) {
|
||||
function processCoreBundleFormat(fileHeader: string, json: BundledFormat, emitter: any) {
|
||||
let keysSection = json.keys;
|
||||
let messageSection = json.messages;
|
||||
let bundleSection = json.bundles;
|
||||
|
@ -511,12 +511,12 @@ function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter
|
|||
return;
|
||||
}
|
||||
messages.forEach((message, index) => {
|
||||
contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",': '"'}`);
|
||||
contents.push(`\t\t"${escapeCharacters(message)}${index < messages.length ? '",' : '"'}`);
|
||||
});
|
||||
contents.push(index < modules.length - 1 ? '\t],' : '\t]');
|
||||
});
|
||||
contents.push('});');
|
||||
emitter.emit('data', new File( { path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') }));
|
||||
emitter.emit('data', new File({ path: bundle + '.nls.' + language.iso639_2 + '.js', contents: new Buffer(contents.join('\n'), 'utf-8') }));
|
||||
});
|
||||
});
|
||||
Object.keys(statistics).forEach(key => {
|
||||
|
@ -536,8 +536,8 @@ function processCoreBundleFormat(fileHeader:string, json: BundledFormat, emitter
|
|||
});
|
||||
}
|
||||
|
||||
export function processNlsFiles(opts:{fileHeader:string;}): ThroughStream {
|
||||
return through(function(file: File) {
|
||||
export function processNlsFiles(opts: { fileHeader: string; }): ThroughStream {
|
||||
return through(function (file: File) {
|
||||
let fileName = path.basename(file.path);
|
||||
if (fileName === 'nls.metadata.json') {
|
||||
let json = null;
|
||||
|
@ -637,27 +637,27 @@ const workbenchResources: Resource[] = [
|
|||
export function getResource(sourceFile: string): Resource {
|
||||
let resource: string;
|
||||
|
||||
if (sourceFile.startsWith('vs/platform')) {
|
||||
if (/^vs\/platform/.test(sourceFile)) {
|
||||
return { name: 'vs/platform', project: editorProject };
|
||||
} else if (sourceFile.startsWith('vs/editor/contrib')) {
|
||||
} else if (/^vs\/editor\/contrib/.test(sourceFile)) {
|
||||
return { name: 'vs/editor/contrib', project: editorProject };
|
||||
} else if (sourceFile.startsWith('vs/editor')) {
|
||||
} else if (/^vs\/editor/.test(sourceFile)) {
|
||||
return { name: 'vs/editor', project: editorProject };
|
||||
} else if (sourceFile.startsWith('vs/base')) {
|
||||
} else if (/^vs\/base/.test(sourceFile)) {
|
||||
return { name: 'vs/base', project: editorProject };
|
||||
} else if (sourceFile.startsWith('vs/code')) {
|
||||
} else if (/^vs\/code/.test(sourceFile)) {
|
||||
return { name: 'vs/code', project: workbenchProject };
|
||||
} else if (sourceFile.startsWith('vs/workbench/parts')) {
|
||||
} else if (/^vs\/workbench\/parts/.test(sourceFile)) {
|
||||
resource = sourceFile.split('/', 4).join('/');
|
||||
return { name: resource, project: workbenchProject };
|
||||
} else if (sourceFile.startsWith('vs/workbench/services')) {
|
||||
} else if (/^vs\/workbench\/services/.test(sourceFile)) {
|
||||
resource = sourceFile.split('/', 4).join('/');
|
||||
return { name: resource, project: workbenchProject };
|
||||
} else if (sourceFile.startsWith('vs/workbench')) {
|
||||
} else if (/^vs\/workbench/.test(sourceFile)) {
|
||||
return { name: 'vs/workbench', project: workbenchProject };
|
||||
}
|
||||
|
||||
throw new Error (`Could not identify the XLF bundle for ${sourceFile}`);
|
||||
throw new Error(`Could not identify the XLF bundle for ${sourceFile}`);
|
||||
}
|
||||
|
||||
|
||||
|
@ -681,7 +681,7 @@ function importBundleJson(file: File, json: BundledFormat, stream: ThroughStream
|
|||
|
||||
for (let resource in bundleXlfs) {
|
||||
const newFilePath = `${bundleXlfs[resource].project}/${resource.replace(/\//g, '_')}.xlf`;
|
||||
const xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8')});
|
||||
const xlfFile = new File({ path: newFilePath, contents: new Buffer(bundleXlfs[resource].toString(), 'utf-8') });
|
||||
stream.emit('data', xlfFile);
|
||||
}
|
||||
}
|
||||
|
@ -723,7 +723,7 @@ function importModuleOrPackageJson(file: File, json: ModuleJsonFormat | PackageJ
|
|||
// Check if XLF is populated with file nodes to emit it
|
||||
if (++extensions[extensionName].processed === localizationFilesCount) {
|
||||
const newFilePath = path.join(projectName, extensionName + '.xlf');
|
||||
const xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8')});
|
||||
const xlfFile = new File({ path: newFilePath, contents: new Buffer(extension.xlf.toString(), 'utf-8') });
|
||||
stream.emit('data', xlfFile);
|
||||
}
|
||||
}
|
||||
|
@ -774,12 +774,12 @@ function importIsl(file: File, stream: ThroughStream) {
|
|||
}
|
||||
});
|
||||
|
||||
const originalPath = file.path.substring(file.cwd.length+1, file.path.split('.')[0].length).replace(/\\/g, '/');
|
||||
const originalPath = file.path.substring(file.cwd.length + 1, file.path.split('.')[0].length).replace(/\\/g, '/');
|
||||
xlf.addFile(originalPath, keys, messages);
|
||||
|
||||
// Emit only upon all ISL files combined into single XLF instance
|
||||
const newFilePath = path.join(projectName, resourceFile);
|
||||
const xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8')});
|
||||
const xlfFile = new File({ path: newFilePath, contents: new Buffer(xlf.toString(), 'utf-8') });
|
||||
stream.emit('data', xlfFile);
|
||||
}
|
||||
|
||||
|
@ -787,7 +787,7 @@ export function pushXlfFiles(apiHostname: string, username: string, password: st
|
|||
let tryGetPromises = [];
|
||||
let updateCreatePromises = [];
|
||||
|
||||
return through(function(file: File) {
|
||||
return through(function (file: File) {
|
||||
const project = path.dirname(file.relative);
|
||||
const fileName = path.basename(file.path);
|
||||
const slug = fileName.substr(0, fileName.length - '.xlf'.length);
|
||||
|
@ -805,7 +805,7 @@ export function pushXlfFiles(apiHostname: string, username: string, password: st
|
|||
updateCreatePromises.push(promise);
|
||||
});
|
||||
|
||||
}, function() {
|
||||
}, function () {
|
||||
// End the pipe only after all the communication with Transifex API happened
|
||||
Promise.all(tryGetPromises).then(() => {
|
||||
Promise.all(updateCreatePromises).then(() => {
|
||||
|
@ -880,7 +880,7 @@ function createResource(project: string, slug: string, xlfFile: File, apiHostnam
|
|||
* The following link provides information about how Transifex handles updates of a resource file:
|
||||
* https://dev.befoolish.co/tx-docs/public/projects/updating-content#what-happens-when-you-update-files
|
||||
*/
|
||||
function updateResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: string) : Promise<any> {
|
||||
function updateResource(project: string, slug: string, xlfFile: File, apiHostname: string, credentials: string): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const data = JSON.stringify({ content: xlfFile.contents.toString() });
|
||||
const options = {
|
||||
|
@ -956,7 +956,7 @@ export function pullXlfFiles(projectName: string, apiHostname: string, username:
|
|||
let expectedTranslationsCount = languages.length * resources.length;
|
||||
let translationsRetrieved = 0, called = false;
|
||||
|
||||
return readable(function(count, callback) {
|
||||
return readable(function (count, callback) {
|
||||
// Mark end of stream when all resources were retrieved
|
||||
if (translationsRetrieved === expectedTranslationsCount) {
|
||||
return this.emit('end');
|
||||
|
@ -967,8 +967,8 @@ export function pullXlfFiles(projectName: string, apiHostname: string, username:
|
|||
const stream = this;
|
||||
|
||||
// Retrieve XLF files from main projects
|
||||
languages.map(function(language) {
|
||||
resources.map(function(resource) {
|
||||
languages.map(function (language) {
|
||||
resources.map(function (resource) {
|
||||
retrieveResource(language, resource, apiHostname, credentials).then((file: File) => {
|
||||
stream.emit('data', file);
|
||||
translationsRetrieved++;
|
||||
|
@ -995,7 +995,7 @@ function retrieveResource(language: string, resource: Resource, apiHostname, cre
|
|||
|
||||
let request = http.request(options, (res) => {
|
||||
let xlfBuffer: Buffer[] = [];
|
||||
res.on('data', (chunk) => xlfBuffer.push(chunk));
|
||||
res.on('data', (chunk: Buffer) => xlfBuffer.push(chunk));
|
||||
res.on('end', () => {
|
||||
if (res.statusCode === 200) {
|
||||
resolve(new File({ contents: Buffer.concat(xlfBuffer), path: `${project}/${iso639_2_to_3[language]}/${slug}.xlf` }));
|
||||
|
@ -1013,17 +1013,17 @@ function retrieveResource(language: string, resource: Resource, apiHostname, cre
|
|||
export function prepareJsonFiles(): ThroughStream {
|
||||
let parsePromises: Promise<ParsedXLF[]>[] = [];
|
||||
|
||||
return through(function(xlf: File) {
|
||||
return through(function (xlf: File) {
|
||||
let stream = this;
|
||||
let parsePromise = XLF.parse(xlf.contents.toString());
|
||||
parsePromises.push(parsePromise);
|
||||
parsePromise.then(
|
||||
function(resolvedFiles) {
|
||||
function (resolvedFiles) {
|
||||
resolvedFiles.forEach(file => {
|
||||
let messages = file.messages, translatedFile;
|
||||
|
||||
// ISL file path always starts with 'build/'
|
||||
if (file.originalFilePath.startsWith('build/')) {
|
||||
if (/^build\//.test(file.originalFilePath)) {
|
||||
const defaultLanguages = { 'zh-hans': true, 'zh-hant': true, 'ko': true };
|
||||
if (path.basename(file.originalFilePath) === 'Default' && !defaultLanguages[file.language]) {
|
||||
return;
|
||||
|
@ -1037,11 +1037,11 @@ export function prepareJsonFiles(): ThroughStream {
|
|||
stream.emit('data', translatedFile);
|
||||
});
|
||||
},
|
||||
function(rejectReason) {
|
||||
function (rejectReason) {
|
||||
throw new Error(`XLF parsing error: ${rejectReason}`);
|
||||
}
|
||||
);
|
||||
}, function() {
|
||||
}, function () {
|
||||
Promise.all(parsePromises)
|
||||
.then(() => { this.emit('end'); })
|
||||
.catch(reason => { throw new Error(reason); });
|
||||
|
@ -1161,6 +1161,6 @@ function encodeEntities(value: string): string {
|
|||
return result.join('');
|
||||
}
|
||||
|
||||
function decodeEntities(value:string): string {
|
||||
function decodeEntities(value: string): string {
|
||||
return value.replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
|
||||
}
|
|
@ -41,7 +41,7 @@ function log() {
|
|||
.filter(function (match) { return !!match; })
|
||||
.map(function (_a) {
|
||||
var path = _a[1], line = _a[2], column = _a[3], message = _a[4];
|
||||
return ({ path: path, line: Number.parseInt(line), column: Number.parseInt(column), message: message });
|
||||
return ({ path: path, line: parseInt(line), column: parseInt(column), message: message });
|
||||
});
|
||||
try {
|
||||
fs.writeFileSync(buildLogPath, JSON.stringify(messages));
|
||||
|
|
|
@ -48,7 +48,7 @@ function log(): void {
|
|||
const messages = errors
|
||||
.map(err => regex.exec(err))
|
||||
.filter(match => !!match)
|
||||
.map(([, path, line, column, message]) => ({ path, line: Number.parseInt(line), column: Number.parseInt(column), message }));
|
||||
.map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message }));
|
||||
|
||||
try {
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var assert = require("assert");
|
||||
var i18n = require("../i18n");
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
|
|
@ -34,7 +34,7 @@ class AsyncRuleWalker extends Lint.RuleWalker {
|
|||
return;
|
||||
}
|
||||
|
||||
const path = node.getSourceFile().path;
|
||||
const path = (node.getSourceFile() as any).path;
|
||||
const pathParts = path.split(/\\|\//);
|
||||
|
||||
if (pathParts.some(part => this.allowed.some(allowed => part === allowed))) {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
|
|
18296
build/lib/typings/lib.es6.d.ts
vendored
18296
build/lib/typings/lib.es6.d.ts
vendored
File diff suppressed because it is too large
Load diff
1536
build/lib/typings/node.d.ts
vendored
1536
build/lib/typings/node.d.ts
vendored
File diff suppressed because it is too large
Load diff
|
@ -22,19 +22,19 @@ export interface ICancellationToken {
|
|||
isCancellationRequested(): boolean;
|
||||
}
|
||||
|
||||
const NoCancellationToken:ICancellationToken = { isCancellationRequested: () => false };
|
||||
const NoCancellationToken: ICancellationToken = { isCancellationRequested: () => false };
|
||||
|
||||
export interface IStreamProvider {
|
||||
(cancellationToken?:ICancellationToken): NodeJS.ReadWriteStream;
|
||||
(cancellationToken?: ICancellationToken): NodeJS.ReadWriteStream;
|
||||
}
|
||||
|
||||
export function incremental(streamProvider:IStreamProvider, initial:NodeJS.ReadWriteStream, supportsCancellation:boolean): NodeJS.ReadWriteStream {
|
||||
export function incremental(streamProvider: IStreamProvider, initial: NodeJS.ReadWriteStream, supportsCancellation: boolean): NodeJS.ReadWriteStream {
|
||||
const input = es.through();
|
||||
const output = es.through();
|
||||
let state = 'idle';
|
||||
let buffer = Object.create(null);
|
||||
|
||||
const token:ICancellationToken = !supportsCancellation ? null : { isCancellationRequested: () => Object.keys(buffer).length > 0 };
|
||||
const token: ICancellationToken = !supportsCancellation ? null : { isCancellationRequested: () => Object.keys(buffer).length > 0 };
|
||||
|
||||
const run = (input, isCancellable) => {
|
||||
state = 'running';
|
||||
|
@ -66,7 +66,7 @@ export function incremental(streamProvider:IStreamProvider, initial:NodeJS.ReadW
|
|||
run(es.readArray(data), true);
|
||||
}, 500);
|
||||
|
||||
input.on('data', f => {
|
||||
input.on('data', (f: any) => {
|
||||
buffer[f.path] = f;
|
||||
|
||||
if (state === 'idle') {
|
||||
|
@ -82,7 +82,7 @@ export function fixWin32DirectoryPermissions(): NodeJS.ReadWriteStream {
|
|||
return es.through();
|
||||
}
|
||||
|
||||
return es.mapSync<VinylFile,VinylFile>(f => {
|
||||
return es.mapSync<VinylFile, VinylFile>(f => {
|
||||
if (f.stat && f.stat.isDirectory && f.stat.isDirectory()) {
|
||||
f.stat.mode = 16877;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ export function fixWin32DirectoryPermissions(): NodeJS.ReadWriteStream {
|
|||
}
|
||||
|
||||
export function setExecutableBit(pattern: string | string[]): NodeJS.ReadWriteStream {
|
||||
var setBit = es.mapSync<VinylFile,VinylFile>(f => {
|
||||
var setBit = es.mapSync<VinylFile, VinylFile>(f => {
|
||||
f.stat.mode = /* 100755 */ 33261;
|
||||
return f;
|
||||
});
|
||||
|
@ -111,7 +111,7 @@ export function setExecutableBit(pattern: string | string[]): NodeJS.ReadWriteSt
|
|||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
export function toFileUri(filePath:string): string {
|
||||
export function toFileUri(filePath: string): string {
|
||||
const match = filePath.match(/^([a-z])\:(.*)$/i);
|
||||
|
||||
if (match) {
|
||||
|
@ -122,23 +122,23 @@ export function toFileUri(filePath:string): string {
|
|||
}
|
||||
|
||||
export function skipDirectories(): NodeJS.ReadWriteStream {
|
||||
return es.mapSync<VinylFile,VinylFile>(f => {
|
||||
return es.mapSync<VinylFile, VinylFile>(f => {
|
||||
if (!f.isDirectory()) {
|
||||
return f;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export function cleanNodeModule(name:string, excludes:string[], includes:string[]): NodeJS.ReadWriteStream {
|
||||
const toGlob = (path:string) => '**/node_modules/' + name + (path ? '/' + path : '');
|
||||
const negate = (str:string) => '!' + str;
|
||||
export function cleanNodeModule(name: string, excludes: string[], includes: string[]): NodeJS.ReadWriteStream {
|
||||
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
|
||||
const negate = (str: string) => '!' + str;
|
||||
|
||||
const allFilter = _filter(toGlob('**'), { restore: true });
|
||||
const globs = [toGlob('**')].concat(excludes.map(_.compose(negate, toGlob)));
|
||||
|
||||
const input = es.through();
|
||||
const nodeModuleInput = input.pipe(allFilter);
|
||||
let output:NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs));
|
||||
let output: NodeJS.ReadWriteStream = nodeModuleInput.pipe(_filter(globs));
|
||||
|
||||
if (includes) {
|
||||
const includeGlobs = includes.map(toGlob);
|
||||
|
@ -157,7 +157,7 @@ export function loadSourcemaps(): NodeJS.ReadWriteStream {
|
|||
const input = es.through();
|
||||
|
||||
const output = input
|
||||
.pipe(es.map<FileSourceMap,FileSourceMap>((f, cb): FileSourceMap => {
|
||||
.pipe(es.map<FileSourceMap, FileSourceMap>((f, cb): FileSourceMap => {
|
||||
if (f.sourceMap) {
|
||||
cb(null, f);
|
||||
return;
|
||||
|
@ -207,7 +207,7 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
|
|||
const input = es.through();
|
||||
|
||||
const output = input
|
||||
.pipe(es.mapSync<VinylFile,VinylFile>(f => {
|
||||
.pipe(es.mapSync<VinylFile, VinylFile>(f => {
|
||||
const contents = (<Buffer>f.contents).toString('utf8');
|
||||
f.contents = new Buffer(contents.replace(/\n\/\/# sourceMappingURL=(.*)$/gm, ''), 'utf8');
|
||||
return f;
|
||||
|
@ -216,11 +216,11 @@ export function stripSourceMappingURL(): NodeJS.ReadWriteStream {
|
|||
return es.duplex(input, output);
|
||||
}
|
||||
|
||||
export function rimraf(dir:string):(cb:any)=>void {
|
||||
export function rimraf(dir: string): (cb: any) => void {
|
||||
let retries = 0;
|
||||
|
||||
const retry = cb => {
|
||||
_rimraf(dir, { maxBusyTries: 1 }, (err:any) => {
|
||||
_rimraf(dir, { maxBusyTries: 1 }, (err: any) => {
|
||||
if (!err) {
|
||||
return cb();
|
||||
};
|
||||
|
@ -236,7 +236,7 @@ export function rimraf(dir:string):(cb:any)=>void {
|
|||
return cb => retry(cb);
|
||||
}
|
||||
|
||||
export function getVersion(root:string): string {
|
||||
export function getVersion(root: string): string {
|
||||
let version = process.env['BUILD_SOURCEVERSION'];
|
||||
|
||||
if (!version || !/^[0-9a-f]{40}$/i.test(version)) {
|
||||
|
@ -246,7 +246,7 @@ export function getVersion(root:string): string {
|
|||
return version;
|
||||
}
|
||||
|
||||
export function rebase(count:number): NodeJS.ReadWriteStream {
|
||||
export function rebase(count: number): NodeJS.ReadWriteStream {
|
||||
return rename(f => {
|
||||
const parts = f.dirname.split(/[\/\\]/);
|
||||
f.dirname = parts.slice(count).join(path.sep);
|
||||
|
@ -257,7 +257,7 @@ export interface FilterStream extends NodeJS.ReadWriteStream {
|
|||
restore: ThroughStream;
|
||||
}
|
||||
|
||||
export function filter(fn:(data:any)=>boolean):FilterStream {
|
||||
export function filter(fn: (data: any) => boolean): FilterStream {
|
||||
const result = <FilterStream><any>es.through(function (data) {
|
||||
if (fn(data)) {
|
||||
this.emit('data', data);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
"use strict";
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fs = require("fs");
|
||||
var ts = require("typescript");
|
||||
|
|
|
@ -2,7 +2,21 @@
|
|||
"name": "code-oss-dev-build",
|
||||
"version": "1.0.0",
|
||||
"devDependencies": {
|
||||
"@types/azure": "^0.9.18",
|
||||
"@types/documentdb": "^1.10.1",
|
||||
"@types/es6-collections": "^0.5.30",
|
||||
"@types/es6-promise": "0.0.32",
|
||||
"@types/mime": "0.0.29",
|
||||
"@types/node": "^7.0.13",
|
||||
"@types/xml2js": "^0.0.33",
|
||||
"azure-storage": "^2.1.0",
|
||||
"documentdb": "^1.11.0",
|
||||
"mime": "^1.3.4",
|
||||
"typescript": "^2.2.2",
|
||||
"xml2js": "^0.4.17"
|
||||
},
|
||||
"scripts": {
|
||||
"compile": "tsc",
|
||||
"watch": "tsc --watch"
|
||||
}
|
||||
}
|
|
@ -1,27 +0,0 @@
|
|||
{
|
||||
"name": "vscode-distro",
|
||||
"version": "1.0.0",
|
||||
"description": "VS Code Distro",
|
||||
"repository": {
|
||||
"url": "https://github.com/Microsoft/vscode-distro"
|
||||
},
|
||||
"main": "enqueue.js",
|
||||
"scripts": {
|
||||
"compile": "tsc",
|
||||
"watch": "tsc --watch",
|
||||
"postinstall": "npm run compile"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/azure": "^0.9.18",
|
||||
"@types/documentdb": "^1.10.1",
|
||||
"@types/es6-promise": "0.0.32",
|
||||
"@types/mime": "0.0.29",
|
||||
"@types/node": "^7.0.13",
|
||||
"azure-storage": "^2.1.0",
|
||||
"documentdb": "^1.11.0",
|
||||
"mime": "^1.3.4",
|
||||
"typescript": "^2.2.2"
|
||||
}
|
||||
}
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"target": "es5",
|
||||
"noImplicitAny": true,
|
||||
"noUnusedLocals": true,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitReturns": true,
|
||||
"noImplicitUseStrict": true
|
||||
}
|
||||
}
|
|
@ -1,17 +1,15 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"module": "commonjs",
|
||||
"noImplicitAny": false,
|
||||
"removeComments": false,
|
||||
"preserveConstEnums": true,
|
||||
"target": "es5",
|
||||
"sourceMap": false,
|
||||
"experimentalDecorators": true,
|
||||
"noLib": true,
|
||||
"newLine": "LF"
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"./lib/watch/node_modules/**/*"
|
||||
"node_modules/**"
|
||||
]
|
||||
}
|
Loading…
Reference in a new issue