mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-23 19:59:37 +00:00
chore: reduce any usage in build/ (#270109)
This commit is contained in:
@@ -48,8 +48,7 @@ async function fetchUrl(url, options, retries = 10, retryDelay = 1000) {
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
...options.nodeFetchOptions,
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
signal: controller.signal /* Typings issue with lib.dom.d.ts */
|
||||
signal: controller.signal
|
||||
});
|
||||
if (verbose) {
|
||||
(0, fancy_log_1.default)(`Fetch completed: Status ${response.status}. Took ${ansi_colors_1.default.magenta(`${new Date().getTime() - startTime} ms`)}`);
|
||||
|
||||
@@ -54,8 +54,7 @@ export async function fetchUrl(url: string, options: IFetchOptions, retries = 10
|
||||
try {
|
||||
const response = await fetch(url, {
|
||||
...options.nodeFetchOptions,
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
signal: controller.signal as any /* Typings issue with lib.dom.d.ts */
|
||||
signal: controller.signal
|
||||
});
|
||||
if (verbose) {
|
||||
log(`Fetch completed: Status ${response.status}. Took ${ansiColors.magenta(`${new Date().getTime() - startTime} ms`)}`);
|
||||
|
||||
@@ -73,8 +73,7 @@ async function fetchUrl(options, retries = 10, retryDelay = 1000) {
|
||||
try {
|
||||
const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
|
||||
headers: ghApiHeaders,
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
signal: controller.signal /* Typings issue with lib.dom.d.ts */
|
||||
signal: controller.signal
|
||||
});
|
||||
if (response.ok && (response.status >= 200 && response.status < 300)) {
|
||||
console.log(`Fetch completed: Status ${response.status}.`);
|
||||
|
||||
@@ -82,8 +82,7 @@ async function fetchUrl(options: IFetchOptions, retries = 10, retryDelay = 1000)
|
||||
try {
|
||||
const response = await fetch(`https://api.github.com/repos/Microsoft/vscode-linux-build-agent/releases/tags/v${version}`, {
|
||||
headers: ghApiHeaders,
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
signal: controller.signal as any /* Typings issue with lib.dom.d.ts */
|
||||
signal: controller.signal
|
||||
});
|
||||
if (response.ok && (response.status >= 200 && response.status < 300)) {
|
||||
console.log(`Fetch completed: Status ${response.status}.`);
|
||||
|
||||
@@ -13,6 +13,7 @@ const debug_1 = __importDefault(require("debug"));
|
||||
const path_1 = __importDefault(require("path"));
|
||||
const get_1 = require("@electron/get");
|
||||
const product_json_1 = __importDefault(require("../../product.json"));
|
||||
const product = product_json_1.default;
|
||||
const d = (0, debug_1.default)('explorer-dll-fetcher');
|
||||
async function downloadExplorerDll(outDir, quality = 'stable', targetArch = 'x64') {
|
||||
const fileNamePrefix = quality === 'insider' ? 'code_insider' : 'code';
|
||||
@@ -53,8 +54,7 @@ async function main(outputDir) {
|
||||
if (!outputDir) {
|
||||
throw new Error('Required build env not set');
|
||||
}
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
await downloadExplorerDll(outputDir, product_json_1.default.quality, arch);
|
||||
await downloadExplorerDll(outputDir, product.quality, arch);
|
||||
}
|
||||
if (require.main === module) {
|
||||
main(process.argv[2]).catch(err => {
|
||||
|
||||
@@ -9,7 +9,14 @@ import fs from 'fs';
|
||||
import debug from 'debug';
|
||||
import path from 'path';
|
||||
import { downloadArtifact } from '@electron/get';
|
||||
import product from '../../product.json';
|
||||
import productJson from '../../product.json';
|
||||
|
||||
interface ProductConfiguration {
|
||||
quality?: string;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
const product: ProductConfiguration = productJson;
|
||||
|
||||
const d = debug('explorer-dll-fetcher');
|
||||
|
||||
@@ -60,8 +67,7 @@ async function main(outputDir?: string): Promise<void> {
|
||||
throw new Error('Required build env not set');
|
||||
}
|
||||
|
||||
// eslint-disable-next-line local/code-no-any-casts
|
||||
await downloadExplorerDll(outputDir, (product as any).quality, arch);
|
||||
await downloadExplorerDll(outputDir, product.quality, arch);
|
||||
}
|
||||
|
||||
if (require.main === module) {
|
||||
|
||||
Reference in New Issue
Block a user