This commit is contained in:
Joao Moreno 2018-02-27 15:41:00 +01:00
parent 6dc27ecac8
commit 838f4024b3
8 changed files with 12 additions and 22 deletions

View file

@ -14,8 +14,7 @@ const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
function readJson(filePath) {
//@ts-ignore review
return JSON.parse(fs.readFileSync(filePath));
return JSON.parse(fs.readFileSync(filePath, { encoding: 'utf8' }));
}
function writeJson(filePath, obj) {

View file

@ -94,11 +94,8 @@ const tasks = compilations.map(function (tsconfigFile) {
sourceRoot: '../src'
}))
.pipe(tsFilter.restore)
// @ts-ignore review
.pipe(build ? nlsDev.createAdditionalLanguageFiles(languages, i18nPath, out) : es.through())
// @ts-ignore review
.pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through())
// @ts-ignore review
.pipe(build ? nlsDev.bundleLanguageFiles() : es.through())
.pipe(reporter.end(emitError));
@ -146,8 +143,7 @@ const tasks = compilations.map(function (tsconfigFile) {
const watchInput = watcher(src, srcOpts);
return watchInput
// @ts-ignore review
.pipe(util.incremental(() => pipeline(true), input))
.pipe(util.incremental(() => pipeline(), input))
.pipe(gulp.dest(out));
});

View file

@ -39,7 +39,7 @@ const getElectronVersion = require('./lib/electron').getElectronVersion;
const createAsar = require('./lib/asar').createAsar;
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
//@ts-ignore review
// @ts-ignore
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
const nodeModules = ['electron', 'original-fs']
.concat(Object.keys(product.dependencies || {}))
@ -107,7 +107,6 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil
header: BUNDLED_FILE_HEADER,
out: 'out-vscode',
languages: languages,
// @ts-ignore review
bundleInfo: undefined
}));
@ -250,7 +249,6 @@ function packageTask(platform, arch, opts) {
// // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
.pipe(nlsFilter)
.pipe(buffer())
//@ts-ignore review
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
.pipe(nlsFilter.restore);
}));
@ -303,7 +301,6 @@ function packageTask(platform, arch, opts) {
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['**/*.node']))
//@ts-ignore review
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
@ -446,8 +443,7 @@ gulp.task('vscode-translations-pull', function () {
gulp.task('vscode-translations-import', function () {
[...i18n.defaultLanguages, ...i18n.extraLanguages].forEach(language => {
gulp.src(`../vscode-localization/${language.id}/build/*/*.xlf`)
//@ts-ignore review
.pipe(i18n.prepareI18nFiles(language))
.pipe(i18n.prepareI18nFiles())
.pipe(vfs.dest(`./i18n/${language.folderName}`));
gulp.src(`../vscode-localization/${language.id}/setup/*/*.xlf`)
.pipe(i18n.prepareIslFiles(language, innoSetupConfig[language.id]))
@ -478,8 +474,8 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
const branch = process.env.BUILD_SOURCEBRANCH;
//@ts-ignore review
if (!branch.endsWith('/master') && branch.indexOf('/release/') < 0) {
if (!/\/master$/.test(branch) && branch.indexOf('/release/') < 0) {
console.log(`Only runs on master and release branches, not ${branch}`);
return;
}

View file

@ -32,10 +32,9 @@ function isUpToDate(extension) {
return false;
}
const packageContents = fs.readFileSync(packagePath);
const packageContents = fs.readFileSync(packagePath, { encoding: 'utf8' });
try {
//@ts-ignore review
const diskVersion = JSON.parse(packageContents).version;
return (diskVersion === extension.version);
} catch (err) {

View file

@ -129,7 +129,7 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
});
}
export function cleanNodeModule(name: string, excludes: string[], includes: string[]): NodeJS.ReadWriteStream {
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;

View file

@ -30,7 +30,7 @@ function watch(root) {
path: path,
base: root
});
//@ts-ignore review
//@ts-ignore
file.event = type;
result.emit('data', file);
}

View file

@ -25,7 +25,7 @@ function watch(root) {
var child = cp.spawn(watcherPath, [root]);
child.stdout.on('data', function (data) {
//@ts-ignore review
// @ts-ignore
var lines = data.toString('utf8').split('\n');
for (var i = 0; i < lines.length; i++) {
var line = lines[i].trim();
@ -47,7 +47,7 @@ function watch(root) {
path: changePathFull,
base: root
});
//@ts-ignore review
//@ts-ignore
file.event = toChangeType(changeType);
result.emit('data', file);
}

View file

@ -50,7 +50,7 @@ extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
function yarnInstallBuildDependencies() {
// make sure we install the deps of build/lib/watch for the system installed
// node, since that is the driver of gulp
//@ts-ignore review
//@ts-ignore
const env = Object.assign({}, process.env);
const watchPath = path.join(path.dirname(__dirname), 'lib', 'watch');
const yarnrcPath = path.join(watchPath, '.yarnrc');