chore: updated to Theia 1.37.0

- Updated `@theia/*` to `1.37.0`.
 - Fixed all `yarn audit` security vulnerabilities.
 - Updated to `electron@23.2.4`:
   - `contextIsolation` is `true`,
   - `nodeIntegration` is `false`, and the
   - `webpack` target is moved from `electron-renderer` to `web`.
 - Updated to `typescript@4.9.3`.
 - Updated the `eslint` plugins.
 - Added the new `Light High Contrast` theme to the IDE2.
 - High contrast themes use Theia APIs for style adjustments.
 - Support for ESM modules: `"moduleResolution": "node16"`.
 - Node.js >= 16.14 is required.
 - VISX langage packs were bumped to `1.70.0`.
 - Removed undesired editor context menu items. (Closes #1394)

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta
2023-03-13 14:40:31 +01:00
committed by Akos Kitta
parent 964ea3bc0c
commit 192aac5a81
167 changed files with 6173 additions and 6467 deletions

View File

@@ -1,6 +1,6 @@
import { join } from 'path';
import { join } from 'node:path';
import { inject, injectable, named } from '@theia/core/shared/inversify';
import { spawn, ChildProcess } from 'child_process';
import { spawn, ChildProcess } from 'node:child_process';
import { FileUri } from '@theia/core/lib/node/file-uri';
import { ILogger } from '@theia/core/lib/common/logger';
import { Deferred, retry } from '@theia/core/lib/common/promise-util';

View File

@@ -1,6 +1,5 @@
import fetch from 'node-fetch';
import { injectable } from '@theia/core/shared/inversify';
import { createServer, startServer } from './authentication-server';
import { Keychain } from './keychain';
import {
@@ -16,10 +15,10 @@ import {
AuthenticationProviderAuthenticationSessionsChangeEvent,
AuthenticationSession,
AuthenticationProvider,
AuthOptions,
} from './types';
import { Event, Emitter } from '@theia/core/lib/common/event';
import * as open from 'open';
import open from 'open';
import { AuthOptions } from '../../common/protocol/authentication-service';
const LOGIN_TIMEOUT = 30 * 1000;
const REFRESH_INTERVAL = 10 * 60 * 1000;

View File

@@ -1,9 +1,9 @@
import * as http from 'http';
import * as url from 'url';
import * as http from 'node:http';
import * as url from 'node:url';
import { body } from './body';
import { authServerPort } from '../../common/protocol/authentication-service';
export const authCallbackPath = 'callback';
export const serverPort = 9876;
export function createServer(
authCallback: (req: http.IncomingMessage, res: http.ServerResponse) => void
@@ -59,7 +59,7 @@ export async function startServer(server: http.Server): Promise<string> {
reject(new Error('Closed'));
});
server.listen(serverPort);
server.listen(authServerPort);
});
port.then(cancelPortTimer, cancelPortTimer);

View File

@@ -5,12 +5,12 @@ import {
} from '@theia/core/lib/common/disposable';
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';
import {
AuthOptions,
AuthenticationService,
AuthenticationServiceClient,
AuthenticationSession,
} from '../../common/protocol/authentication-service';
import { ArduinoAuthenticationProvider } from './arduino-auth-provider';
import { AuthOptions } from './types';
@injectable()
export class AuthenticationServiceImpl
@@ -19,7 +19,7 @@ export class AuthenticationServiceImpl
protected readonly delegate = new ArduinoAuthenticationProvider();
protected readonly clients: AuthenticationServiceClient[] = [];
protected readonly toDispose = new DisposableCollection();
private initialized = false;
async onStart(): Promise<void> {

View File

@@ -1,16 +1,9 @@
import { AuthenticationSession } from '../../common/protocol/authentication-service';
import {
AuthOptions,
AuthenticationSession,
} from '../../common/protocol/authentication-service';
export { AuthenticationSession };
export type AuthOptions = {
redirectUri: string;
responseType: string;
clientID: string;
domain: string;
audience: string;
registerUri: string;
scopes: string[];
};
export interface AuthenticationProviderAuthenticationSessionsChangeEvent {
readonly added?: ReadonlyArray<AuthenticationSession>;
readonly removed?: ReadonlyArray<AuthenticationSession>;

View File

@@ -1,7 +1,7 @@
import jwt_decode from 'jwt-decode';
import { sha256 } from 'hash.js';
import { randomBytes } from 'crypto';
import btoa = require('btoa'); // TODO: check why we cannot
import { randomBytes } from 'node:crypto';
import btoa from 'btoa';
import { AuthenticationSession } from './types';
import { Unknown } from '../../common/nls';

View File

@@ -1,10 +1,10 @@
import * as os from 'os';
import * as os from 'node:os';
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
import { MaybePromise } from '@theia/core/lib/common/types';
import { FileUri } from '@theia/core/lib/node/file-uri';
import { inject, injectable } from '@theia/core/shared/inversify';
import { constants, promises as fs } from 'fs';
import { join } from 'path';
import { constants, promises as fs } from 'node:fs';
import { join } from 'node:path';
import { ConfigService } from '../common/protocol';
import { Formatter, FormatterOptions } from '../common/protocol/formatter';
import { getExecPath, spawnCommand } from './exec-util';

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var google_rpc_status_pb = require('../../../../../google/rpc/status_pb.js');
goog.object.extend(proto, google_rpc_status_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Board', null, global);
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.DownloadProgress', null, global);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js');
goog.object.extend(proto, google_protobuf_wrappers_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
goog.exportSymbol('proto.cc.arduino.cli.commands.v1.Port', null, global);
/**

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var cc_arduino_cli_commands_v1_common_pb = require('../../../../../cc/arduino/cli/commands/v1/common_pb.js');
goog.object.extend(proto, cc_arduino_cli_commands_v1_common_pb);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
goog.exportSymbol('proto.cc.arduino.cli.settings.v1.GetAllRequest', null, global);
goog.exportSymbol('proto.cc.arduino.cli.settings.v1.GetAllResponse', null, global);

View File

@@ -13,7 +13,13 @@
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var global = (function() {
if (this) { return this; }
if (typeof window !== 'undefined') { return window; }
if (typeof global !== 'undefined') { return global; }
if (typeof self !== 'undefined') { return self; }
return Function('return this')();
}.call(null));
var google_protobuf_any_pb = require('google-protobuf/google/protobuf/any_pb.js');
goog.object.extend(proto, google_protobuf_any_pb);

View File

@@ -1,5 +1,5 @@
import { promises as fs } from 'fs';
import { dirname } from 'path';
import { promises as fs } from 'node:fs';
import { dirname } from 'node:path';
import * as yaml from 'js-yaml';
import * as grpc from '@grpc/grpc-js';
import { injectable, inject, named } from '@theia/core/shared/inversify';

View File

@@ -1,4 +1,4 @@
import { join } from 'path';
import { join } from 'node:path';
import * as grpc from '@grpc/grpc-js';
import {
inject,

View File

@@ -1,6 +1,6 @@
import { FileUri } from '@theia/core/lib/node/file-uri';
import { inject, injectable } from '@theia/core/shared/inversify';
import { relative } from 'path';
import { relative } from 'node:path';
import * as jspb from 'google-protobuf';
import { BoolValue } from 'google-protobuf/google/protobuf/wrappers_pb';
import { ClientReadableStream } from '@grpc/grpc-js';

View File

@@ -1,5 +1,5 @@
import * as psTree from 'ps-tree';
const kill = require('tree-kill');
import psTree from 'ps-tree';
import kill from 'tree-kill';
const [theiaPid, daemonPid] = process.argv
.slice(2)
.map((id) => Number.parseInt(id, 10));
@@ -11,7 +11,10 @@ setInterval(() => {
} catch {
psTree(daemonPid, function (_, children) {
for (const { PID } of children) {
kill(PID);
const parsedPid = Number.parseInt(PID, 10);
if (!Number.isNaN(parsedPid)) {
kill(parsedPid);
}
}
kill(daemonPid, () => process.exit());
});

View File

@@ -3,8 +3,8 @@ import {
injectable,
postConstruct,
} from '@theia/core/shared/inversify';
import { join } from 'path';
import * as fs from 'fs';
import { join } from 'node:path';
import * as fs from 'node:fs';
import { FileUri } from '@theia/core/lib/node/file-uri';
import {
SketchRef,

View File

@@ -1,8 +1,8 @@
import * as os from 'os';
import * as which from 'which';
import * as semver from 'semver';
import { join } from 'path';
import { spawn } from 'child_process';
import os from 'node:os';
import which from 'which';
import semver from 'semver';
import { join } from 'node:path';
import { spawn } from 'node:child_process';
export async function getExecPath(
commandName: string,
@@ -38,7 +38,11 @@ export async function getExecPath(
onError
);
const pathShortVersion = (pathVersion.match(versionRegexp) || [])[0];
if (semver.gt(pathShortVersion, buildShortVersion)) {
if (
pathShortVersion &&
buildShortVersion &&
semver.gt(pathShortVersion, buildShortVersion)
) {
return pathCommand;
}
return buildCommand;

View File

@@ -3,7 +3,7 @@ import {
LocalizationRegistry,
} from '@theia/core/lib/node/i18n/localization-contribution';
import { injectable } from '@theia/core/shared/inversify';
import { join } from 'path';
import { join } from 'node:path';
@injectable()
export class ArduinoLocalizationContribution

View File

@@ -1,5 +1,5 @@
import * as fs from 'fs';
import * as tempDir from 'temp-dir';
import * as fs from 'node:fs';
import tempDir from 'temp-dir';
import { isWindows, isOSX } from '@theia/core/lib/common/os';
import { injectable } from '@theia/core/shared/inversify';
import { firstToLowerCase } from '../common/utils';

View File

@@ -2,13 +2,11 @@ import { inject, injectable } from '@theia/core/shared/inversify';
import {
MonitorManagerProxy,
MonitorManagerProxyClient,
MonitorSettings,
PluggableMonitorSettings,
} from '../common/protocol';
import { Board, Port } from '../common/protocol';
import { MonitorManager } from './monitor-manager';
import {
MonitorSettings,
PluggableMonitorSettings,
} from './monitor-settings/monitor-settings-provider';
@injectable()
export class MonitorManagerProxyImpl implements MonitorManagerProxy {

View File

@@ -4,15 +4,13 @@ import {
AlreadyConnectedError,
Board,
BoardsService,
MonitorSettings,
PluggableMonitorSettings,
Port,
} from '../common/protocol';
import { CoreClientAware } from './core-client-provider';
import { MonitorService } from './monitor-service';
import { MonitorServiceFactory } from './monitor-service-factory';
import {
MonitorSettings,
PluggableMonitorSettings,
} from './monitor-settings/monitor-settings-provider';
type MonitorID = string;

View File

@@ -7,7 +7,6 @@ import {
nls,
} from '@theia/core';
import { inject, named, postConstruct } from '@theia/core/shared/inversify';
import { diff, Operation } from 'just-diff';
import {
Board,
Port,
@@ -17,6 +16,8 @@ import {
createNotConnectedError,
createConnectionFailedError,
isMonitorConnected,
MonitorSettings,
PluggableMonitorSettings,
} from '../common/protocol';
import {
EnumerateMonitorPortSettingsRequest,
@@ -29,11 +30,7 @@ import {
import { CoreClientAware } from './core-client-provider';
import { WebSocketProvider } from './web-socket/web-socket-provider';
import { Port as RpcPort } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb';
import {
MonitorSettings,
PluggableMonitorSettings,
MonitorSettingsProvider,
} from './monitor-settings/monitor-settings-provider';
import { MonitorSettingsProvider } from './monitor-settings/monitor-settings-provider';
import {
Deferred,
retry,
@@ -583,7 +580,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
return;
}
const diffConfig = this.maybeUpdatePortConfigSnapshot(config);
const diffConfig = await this.maybeUpdatePortConfigSnapshot(config);
if (!diffConfig) {
this.logger.info(
`No port configuration changes have been detected. No need to send configure commands to the running monitor ${this.port.protocol}:${this.port.address}.`
@@ -614,9 +611,9 @@ export class MonitorService extends CoreClientAware implements Disposable {
* representing only the difference between the two snapshot configs to avoid sending unnecessary monitor to configure commands to the CLI.
* See [#1703 (comment)](https://github.com/arduino/arduino-ide/pull/1703#issuecomment-1327913005) for more details.
*/
private maybeUpdatePortConfigSnapshot(
private async maybeUpdatePortConfigSnapshot(
otherPortConfig: MonitorPortConfiguration
): MonitorPortConfiguration | undefined {
): Promise<MonitorPortConfiguration | undefined> {
const otherPortConfigSnapshot = MonitorPortConfiguration.toObject(
false,
otherPortConfig
@@ -629,7 +626,8 @@ export class MonitorService extends CoreClientAware implements Disposable {
);
}
const snapshotDiff = diff(
const justDiff = await import('just-diff');
const snapshotDiff = justDiff.diff(
this.currentPortConfigSnapshot,
otherPortConfigSnapshot
);
@@ -676,7 +674,7 @@ export class MonitorService extends CoreClientAware implements Disposable {
}
private isValidMonitorPortSettingChange(entry: {
op: Operation;
op: string;
path: (string | number)[];
value: unknown;
}): entry is {

View File

@@ -1,5 +1,5 @@
import * as fs from 'fs';
import { join } from 'path';
import * as fs from 'node:fs';
import { join } from 'node:path';
import {
injectable,
inject,
@@ -8,16 +8,14 @@ import {
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
import { FileUri } from '@theia/core/lib/node/file-uri';
import { promisify } from 'util';
import {
PluggableMonitorSettings,
MonitorSettingsProvider,
} from './monitor-settings-provider';
import { MonitorSettingsProvider } from './monitor-settings-provider';
import { Deferred } from '@theia/core/lib/common/promise-util';
import {
longestPrefixMatch,
reconcileSettings,
} from './monitor-settings-utils';
import { ILogger } from '@theia/core';
import { PluggableMonitorSettings } from '../../common/protocol';
const MONITOR_SETTINGS_FILE = 'pluggable-monitor-settings.json';

View File

@@ -1,10 +1,4 @@
import { MonitorState, PluggableMonitorSetting } from '../../common/protocol';
export type PluggableMonitorSettings = Record<string, PluggableMonitorSetting>;
export interface MonitorSettings {
pluggableMonitorSettings?: PluggableMonitorSettings;
monitorUISettings?: Partial<MonitorState>;
}
import { PluggableMonitorSettings } from '../../common/protocol';
export const MonitorSettingsProvider = Symbol('MonitorSettingsProvider');
export interface MonitorSettingsProvider {

View File

@@ -1,4 +1,4 @@
import { PluggableMonitorSettings } from './monitor-settings-provider';
import { PluggableMonitorSettings } from '../../common/protocol';
export function longestPrefixMatch(
id: string,

View File

@@ -1,4 +1,4 @@
import * as path from 'path';
import * as path from 'node:path';
import * as express from '@theia/core/shared/express';
import { injectable } from '@theia/core/shared/inversify';
import { BackendApplicationContribution } from '@theia/core/lib/node/backend-application';

View File

@@ -1,13 +1,13 @@
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
import { FileUri } from '@theia/core/lib/node/file-uri';
import { inject, injectable } from '@theia/core/shared/inversify';
import { promises as fs } from 'fs';
import { promises as fs } from 'node:fs';
import {
parse as parseJsonc,
ParseError,
printParseErrorCode,
} from 'jsonc-parser';
import { join } from 'path';
import { join } from 'node:path';
import { ErrnoException } from './utils/errors';
// Poor man's preferences on the backend. (https://github.com/arduino/arduino-ide/issues/1056#issuecomment-1153975064)

View File

@@ -1,11 +1,11 @@
import { injectable, inject, named } from '@theia/core/shared/inversify';
import { promises as fs, realpath, lstat, Stats, constants } from 'fs';
import * as os from 'os';
import * as temp from 'temp';
import * as path from 'path';
import * as glob from 'glob';
import * as crypto from 'crypto';
import * as PQueue from 'p-queue';
import { promises as fs, realpath, lstat, Stats, constants } from 'node:fs';
import os from 'node:os';
import temp from 'temp';
import path from 'node:path';
import glob from 'glob';
import crypto from 'node:crypto';
import PQueue from 'p-queue';
import { Mutable } from '@theia/core/lib/common/types';
import URI from '@theia/core/lib/common/uri';
import { ILogger } from '@theia/core/lib/common/logger';
@@ -34,7 +34,7 @@ import {
TempSketchPrefix,
Win32DriveRegex,
} from './is-temp-sketch';
import { join } from 'path';
import { join } from 'node:path';
import { ErrnoException } from './utils/errors';
import { isWindows } from '@theia/core/lib/common/os';
import {
@@ -43,7 +43,6 @@ import {
startsWithUpperCase,
} from '../common/utils';
import { SettingsReader } from './settings-reader';
import cpy = require('cpy');
const RecentSketches = 'recent-sketches.json';
const DefaultIno = `void setup() {
@@ -74,19 +73,14 @@ export class SketchesServiceImpl
@inject(ILogger)
@named('sketches-service')
private readonly logger: ILogger;
@inject(ConfigServiceImpl)
private readonly configService: ConfigServiceImpl;
@inject(NotificationServiceServer)
private readonly notificationService: NotificationServiceServer;
@inject(EnvVariablesServer)
private readonly envVariableServer: EnvVariablesServer;
@inject(IsTempSketch)
private readonly isTempSketch: IsTempSketch;
@inject(SettingsReader)
private readonly settingsReader: SettingsReader;
@@ -516,13 +510,15 @@ export class SketchesServiceImpl
}
const sourceFolderBasename = path.basename(source);
const destinationFolderBasename = path.basename(destination);
let filter: cpy.Options['filter'];
let filter;
if (onlySketchFiles) {
const sketchFilePaths = Sketch.uris(sketch).map(FileUri.fsPath);
filter = (file) => sketchFilePaths.includes(file.path);
filter = (file: { path: string }) => sketchFilePaths.includes(file.path);
} else {
filter = () => true;
}
const cpyModule = await import('cpy');
const cpy = cpyModule.default;
await cpy(sourceFolderBasename, destination, {
rename: (basename) =>
sourceFolderBasename !== destinationFolderBasename &&

View File

@@ -12,8 +12,8 @@ import {
postConstruct,
} from '@theia/core/shared/inversify';
import { list as listDrives } from 'drivelist';
import { homedir } from 'os';
import { join } from 'path';
import { homedir } from 'node:os';
import { join } from 'node:path';
@injectable()
export class ConfigDirUriProvider {

View File

@@ -1,4 +1,4 @@
import { join } from 'path';
import { join } from 'node:path';
import { interfaces } from '@theia/core/shared/inversify';
import {
NsfwFileSystemWatcherServiceProcessOptions,

View File

@@ -10,8 +10,8 @@ import {
} from '@theia/plugin-ext/lib/common/plugin-protocol';
import { PluginDeployerImpl } from '@theia/plugin-ext/lib/main/node/plugin-deployer-impl';
import { LocalDirectoryPluginDeployerResolver } from '@theia/plugin-ext/lib/main/node/resolvers/local-directory-plugin-deployer-resolver';
import { constants, promises as fs } from 'fs';
import { isAbsolute, resolve } from 'path';
import { constants, promises as fs } from 'node:fs';
import { isAbsolute, resolve } from 'node:path';
@injectable()
export class LocalDirectoryPluginDeployerResolverWithFallback extends LocalDirectoryPluginDeployerResolver {

View File

@@ -72,6 +72,14 @@ const cortexDebugFilter: PluginContributionFilter = (
}
}
}
if (contribution.commands) {
for (const command of contribution.commands) {
if (command.command === 'cortex-debug.resetDevice') {
// TODO: fix loading of original SVG icon in Theia
delete command.iconUrl;
}
}
}
return contribution;
};

View File

@@ -1,4 +1,4 @@
import { promises as fs, constants } from 'fs';
import { promises as fs, constants } from 'node:fs';
import { injectable, inject } from '@theia/core/shared/inversify';
import { DefaultWorkspaceServer as TheiaDefaultWorkspaceServer } from '@theia/workspace/lib/node/default-workspace-server';
import { SketchesService } from '../../../common/protocol';