Skip to content

Commit 3820ab8

Browse files
authored
Merge pull request #279240 from mjbvz/dev/mjbvz/spotty-newt
Build script cleanup
2 parents 84f778c + e779f86 commit 3820ab8

17 files changed

+37
-49
lines changed

build/azure-pipelines/upload-cdn.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ const MimeTypesToCompress = new Set([
7171
function wait(stream: es.ThroughStream): Promise<void> {
7272
return new Promise<void>((c, e) => {
7373
stream.on('end', () => c());
74-
stream.on('error', (err: any) => e(err));
74+
stream.on('error', (err) => e(err));
7575
});
7676
}
7777

build/azure-pipelines/upload-sourcemaps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function main(): Promise<void> {
6565
prefix: `sourcemaps/${commit}/`
6666
}))
6767
.on('end', () => c())
68-
.on('error', (err: any) => e(err));
68+
.on('error', (err) => e(err));
6969
});
7070
}
7171

build/gulpfile.editor.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import gulp from 'gulp';
77
import path from 'path';
88
import * as util from './lib/util.ts';
9-
import * as getVersionModule from './lib/getVersion.ts';
9+
import { getVersion } from './lib/getVersion.ts';
1010
import * as task from './lib/task.ts';
1111
import es from 'event-stream';
1212
import File from 'vinyl';
@@ -17,11 +17,9 @@ import * as compilation from './lib/compilation.ts';
1717
import * as monacoapi from './lib/monaco-api.ts';
1818
import * as fs from 'fs';
1919
import filter from 'gulp-filter';
20-
import * as reporterModule from './lib/reporter.ts';
20+
import { createReporter } from './lib/reporter.ts';
2121
import monacoPackage from './monaco/package.json' with { type: 'json' };
2222

23-
const { getVersion } = getVersionModule;
24-
const { createReporter } = reporterModule;
2523
const root = path.dirname(import.meta.dirname);
2624
const sha1 = getVersion(root);
2725
const semver = monacoPackage.version;

build/gulpfile.extensions.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@ import * as nodeUtil from 'util';
1313
import es from 'event-stream';
1414
import filter from 'gulp-filter';
1515
import * as util from './lib/util.ts';
16-
import * as getVersionModule from './lib/getVersion.ts';
16+
import { getVersion } from './lib/getVersion.ts';
1717
import * as task from './lib/task.ts';
1818
import watcher from './lib/watch/index.ts';
19-
import * as reporterModule from './lib/reporter.ts';
19+
import { createReporter } from './lib/reporter.ts';
2020
import glob from 'glob';
2121
import plumber from 'gulp-plumber';
2222
import * as ext from './lib/extensions.ts';
2323
import * as tsb from './lib/tsb/index.ts';
2424
import sourcemaps from 'gulp-sourcemaps';
2525

26-
const { getVersion } = getVersionModule;
27-
const { createReporter } = reporterModule;
2826
const root = path.dirname(import.meta.dirname);
2927
const commit = getVersion(root);
3028

build/gulpfile.scan.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ import * as path from 'path';
88
import * as task from './lib/task.ts';
99
import * as util from './lib/util.ts';
1010
import electron from '@vscode/gulp-electron';
11-
import * as electronConfigModule from './lib/electron.ts';
11+
import { config } from './lib/electron.ts';
1212
import filter from 'gulp-filter';
1313
import * as deps from './lib/dependencies.ts';
1414
import { existsSync, readdirSync } from 'fs';
1515

16-
const { config } = electronConfigModule;
17-
1816
const root = path.dirname(import.meta.dirname);
1917

2018
const BUILD_TARGETS = [

build/gulpfile.vscode.web.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ const vscodeWebEntryPoints = [
8686
].flat();
8787

8888
/**
89-
* @param extensionsRoot {string} The location where extension will be read from
89+
* @param extensionsRoot The location where extension will be read from
9090
* @param product The parsed product.json file contents
9191
*/
9292
export const createVSCodeWebFileContentMapper = (extensionsRoot: string, product: typeof import('../product.json')) => {

build/gulpfile.vscode.win32.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
* Copyright (c) Microsoft Corporation. All rights reserved.
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
5-
import gulp from 'gulp';
6-
import * as path from 'path';
7-
import * as fs from 'fs';
85
import assert from 'assert';
96
import * as cp from 'child_process';
10-
import * as util from './lib/util.ts';
11-
import * as getVersionModule from './lib/getVersion.ts';
12-
import * as task from './lib/task.ts';
7+
import * as fs from 'fs';
8+
import gulp from 'gulp';
9+
import * as path from 'path';
10+
import rcedit from 'rcedit';
11+
import vfs from 'vinyl-fs';
1312
import pkg from '../package.json' with { type: 'json' };
1413
import product from '../product.json' with { type: 'json' };
15-
import vfs from 'vinyl-fs';
16-
import rcedit from 'rcedit';
17-
import { createRequire } from 'module';
14+
import { getVersion } from './lib/getVersion.ts';
15+
import * as task from './lib/task.ts';
16+
import * as util from './lib/util.ts';
1817

19-
const { getVersion } = getVersionModule;
18+
import { createRequire } from 'module';
2019
const require = createRequire(import.meta.url);
20+
2121
const repoPath = path.dirname(import.meta.dirname);
2222
const commit = getVersion(repoPath);
2323
const buildPath = (arch: string) => path.join(path.dirname(repoPath), `VSCode-win32-${arch}`);
@@ -58,12 +58,12 @@ function packageInnoSetup(iss: string, options: { definitions?: Record<string, u
5858
});
5959
}
6060

61-
function buildWin32Setup(arch: string, target: string) {
61+
function buildWin32Setup(arch: string, target: string): task.CallbackTask {
6262
if (target !== 'system' && target !== 'user') {
6363
throw new Error('Invalid setup target');
6464
}
6565

66-
return (cb?: (err?: any) => void) => {
66+
return (cb) => {
6767
const x64AppId = target === 'system' ? product.win32x64AppId : product.win32x64UserAppId;
6868
const arm64AppId = target === 'system' ? product.win32arm64AppId : product.win32arm64UserAppId;
6969

build/lib/compilation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class MonacoGenerator {
247247
return r;
248248
}
249249

250-
private _log(message: any, ...rest: unknown[]): void {
250+
private _log(message: string, ...rest: unknown[]): void {
251251
fancyLog(ansiColors.cyan('[monaco.d.ts]'), message, ...rest);
252252
}
253253

build/lib/extensions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ function fromLocalWebpack(extensionPath: string, webpackConfigFileName: string,
131131
) as string[]);
132132
const webpackStreams = webpackConfigLocations.flatMap(webpackConfigPath => {
133133

134-
const webpackDone = (err: any, stats: any) => {
134+
const webpackDone = (err: Error | undefined, stats: any) => {
135135
fancyLog(`Bundled extension: ${ansiColors.yellow(path.join(path.basename(extensionPath), path.relative(extensionPath, webpackConfigPath)))}...`);
136136
if (err) {
137137
result.emit('error', err);

build/lib/i18n.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ interface BundledFormat {
8080

8181
type NLSKeysFormat = [string /* module ID */, string[] /* keys */];
8282

83-
function isNLSKeysFormat(value: any): value is NLSKeysFormat {
83+
function isNLSKeysFormat(value: unknown): value is NLSKeysFormat {
8484
if (value === undefined) {
8585
return false;
8686
}
@@ -239,7 +239,7 @@ export class XLF {
239239

240240
const files: { messages: Record<string, string>; name: string; language: string }[] = [];
241241

242-
parser.parseString(xlfString, function (err: any, result: any) {
242+
parser.parseString(xlfString, function (err: Error | undefined, result: any) {
243243
if (err) {
244244
reject(new Error(`XLF parsing error: Failed to parse XLIFF string. ${err}`));
245245
}

0 commit comments

Comments
 (0)