configure esModuleInterop: true, change some star-imports

This commit is contained in:
Johannes 2024-06-03 16:50:28 +02:00
parent 6908956c15
commit 09981a84af
No known key found for this signature in database
GPG Key ID: 6DEF802A22264FCA
8 changed files with 24 additions and 9 deletions

View File

@ -365,6 +365,9 @@ function removeDuplicateTSBoilerplate(destFiles: IConcatFile[]): IConcatFile[] {
{ start: /^var __param/, end: /^};$/ },
{ start: /^var __awaiter/, end: /^};$/ },
{ start: /^var __generator/, end: /^};$/ },
{ start: /^var __createBinding/, end: /^}\)\);$/ },
{ start: /^var __setModuleDefault/, end: /^}\);$/ },
{ start: /^var __importStar/, end: /^};$/ },
];
destFiles.forEach((destFile) => {

View File

@ -1,6 +1,7 @@
{
"extends": "./tsconfig.base.json",
"compilerOptions": {
"esModuleInterop": true,
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": false,

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as minimist from 'minimist';
import minimist from 'minimist';
import { isWindows } from 'vs/base/common/platform';
import { localize } from 'vs/nls';
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';

View File

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as assert from 'assert';
import assert from 'assert';
import { IProcessEnvironment } from 'vs/base/common/platform';
import { localize } from 'vs/nls';
import { NativeParsedArgs } from 'vs/platform/environment/common/argv';

View File

@ -500,7 +500,7 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
async isAdmin(): Promise<boolean> {
let isAdmin: boolean;
if (isWindows) {
isAdmin = (await import('native-is-elevated'))();
isAdmin = (await import('native-is-elevated')).default();
} else {
isAdmin = process.getuid?.() === 0;
}

View File

@ -5,7 +5,7 @@
import * as nativeWatchdog from 'native-watchdog';
import * as net from 'net';
import * as minimist from 'minimist';
import minimist from 'minimist';
import * as performance from 'vs/base/common/performance';
import type { MessagePortMain } from 'vs/base/parts/sandbox/node/electronTypes';
import { isCancellationError, isSigPipeError, onUnexpectedError } from 'vs/base/common/errors';

View File

@ -77,11 +77,20 @@ export function connectProxyResolver(
}
function createPatchedModules(params: ProxyAgentParams, resolveProxy: ReturnType<typeof createProxyResolver>) {
function proxyAssign(module: any, patch: any) {
return new Proxy(module, {
get(target, prop) {
return prop in patch ? patch[prop] : target[prop];
}
});
}
return {
http: Object.assign(http, createHttpPatch(params, http, resolveProxy)),
https: Object.assign(https, createHttpPatch(params, https, resolveProxy)),
net: Object.assign(net, createNetPatch(params, net)),
tls: Object.assign(tls, createTlsPatch(params, tls))
http: proxyAssign(http, createHttpPatch(params, http, resolveProxy)),
https: proxyAssign(https, createHttpPatch(params, https, resolveProxy)),
net: proxyAssign(net, createNetPatch(params, net)),
tls: proxyAssign(tls, createTlsPatch(params, tls))
};
}

View File

@ -207,7 +207,9 @@ async function loadTests(opts) {
for (const consoleFn of [console.log, console.error, console.info, console.warn, console.trace, console.debug]) {
console[consoleFn.name] = function (msg) {
if (!_allowedTestOutput.some(a => a.test(msg)) && !_allowedTestsWithOutput.has(currentTest.title)) {
if (!currentTest) {
consoleFn.apply(console, arguments);
} else if (!_allowedTestOutput.some(a => a.test(msg)) && !_allowedTestsWithOutput.has(currentTest.title)) {
_testsWithUnexpectedOutput = true;
consoleFn.apply(console, arguments);
}