chore: use theia@1.55.1

This commit is contained in:
Giacomo Cusinato 2025-03-19 19:02:32 +07:00
parent e7bd926a2d
commit b0a32df099
15 changed files with 795 additions and 593 deletions

View File

@ -24,29 +24,29 @@
},
"dependencies": {
"@grpc/grpc-js": "^1.8.14",
"@theia/application-package": "1.54.0",
"@theia/core": "1.54.0",
"@theia/debug": "1.54.0",
"@theia/editor": "1.54.0",
"@theia/electron": "1.54.0",
"@theia/filesystem": "1.54.0",
"@theia/keymaps": "1.54.0",
"@theia/markers": "1.54.0",
"@theia/messages": "1.54.0",
"@theia/monaco": "1.54.0",
"@theia/application-package": "1.55.1",
"@theia/core": "1.55.1",
"@theia/debug": "1.55.1",
"@theia/editor": "1.55.1",
"@theia/electron": "1.55.1",
"@theia/filesystem": "1.55.1",
"@theia/keymaps": "1.55.1",
"@theia/markers": "1.55.1",
"@theia/messages": "1.55.1",
"@theia/monaco": "1.55.1",
"@theia/monaco-editor-core": "1.83.101",
"@theia/navigator": "1.54.0",
"@theia/outline-view": "1.54.0",
"@theia/output": "1.54.0",
"@theia/plugin-ext": "1.54.0",
"@theia/plugin-ext-vscode": "1.54.0",
"@theia/preferences": "1.54.0",
"@theia/scm": "1.54.0",
"@theia/search-in-workspace": "1.54.0",
"@theia/terminal": "1.54.0",
"@theia/test": "1.54.0",
"@theia/typehierarchy": "1.54.0",
"@theia/workspace": "1.54.0",
"@theia/navigator": "1.55.1",
"@theia/outline-view": "1.55.1",
"@theia/output": "1.55.1",
"@theia/plugin-ext": "1.55.1",
"@theia/plugin-ext-vscode": "1.55.1",
"@theia/preferences": "1.55.1",
"@theia/scm": "1.55.1",
"@theia/search-in-workspace": "1.55.1",
"@theia/terminal": "1.55.1",
"@theia/test": "1.55.1",
"@theia/typehierarchy": "1.55.1",
"@theia/workspace": "1.55.1",
"@tippyjs/react": "^4.2.5",
"@types/auth0-js": "^9.21.3",
"@types/btoa": "^1.2.3",
@ -126,7 +126,7 @@
"mockdate": "^3.0.5",
"moment": "^2.24.0",
"ncp": "^2.0.0",
"rimraf": "^2.6.1"
"rimraf": "^5.0.0"
},
"optionalDependencies": {
"@pingghost/protoc": "^1.0.2",

View File

@ -1,19 +1,18 @@
import { injectable } from '@theia/core/shared/inversify';
import { TextEditor } from '@theia/editor/lib/browser';
import { EditorContribution as TheiaEditorContribution } from '@theia/editor/lib/browser/editor-contribution';
@injectable()
export class EditorContribution extends TheiaEditorContribution {
protected override updateLanguageStatus(
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
editor: TextEditor | undefined
// eslint-disable-next-line @typescript-eslint/no-unused-vars
..._: Parameters<TheiaEditorContribution['updateLanguageStatus']>
): void {
// NOOP
}
protected override updateEncodingStatus(
// eslint-disable-next-line @typescript-eslint/no-unused-vars, unused-imports/no-unused-vars
editor: TextEditor | undefined
// eslint-disable-next-line @typescript-eslint/no-unused-vars
..._: Parameters<TheiaEditorContribution['updateEncodingStatus']>
): void {
// https://github.com/arduino/arduino-ide/issues/1393
// NOOP

View File

@ -38,33 +38,33 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
this.preferencesService.onPreferenceChanged(
debounce((e) => {
if (e.preferenceName === 'window.menuBarVisibility') {
this.setMenuBar();
this.doSetMenuBar();
}
if (this._menu) {
for (const cmd of this._toggledCommands) {
const menuItem = this.findMenuById(this._menu, cmd);
if (this.menu) {
for (const cmd of this.toggledCommands) {
const menuItem = this.findMenuById(this.menu, cmd);
if (menuItem) {
menuItem.checked = this.commandRegistry.isToggled(cmd);
}
}
window.electronArduino.setMenu(this._menu); // calls the IDE2-specific implementation
window.electronArduino.setMenu(this.menu); // calls the IDE2-specific implementation
}
}, 10)
);
this.keybindingRegistry.onKeybindingsChanged(() => {
this.setMenuBar();
this.doSetMenuBar();
});
// #endregion Theia `postConstruct`
this.appStateService.reachedState('ready').then(() => {
this.appReady = true;
if (this.updateWhenReady) {
this.setMenuBar();
this.doSetMenuBar();
}
});
}
override createElectronMenuBar(): MenuDto[] {
this._toggledCommands.clear(); // https://github.com/eclipse-theia/theia/issues/8977
this.toggledCommands.clear(); // https://github.com/eclipse-theia/theia/issues/8977
const menuModel = this.menuProvider.getMenu(MAIN_MENU_BAR);
const menu = this.fillMenuTemplate([], menuModel, [], {
rootMenuPath: MAIN_MENU_BAR,
@ -73,11 +73,12 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
menu.unshift(this.createOSXMenu());
}
const escapedMenu = this.escapeAmpersand(menu);
this._menu = escapedMenu;
this.menu = escapedMenu;
return escapedMenu;
}
override async setMenuBar(): Promise<void> {
// CHECK ME
override async doSetMenuBar(): Promise<void> {
// Avoid updating menu items when the app is not ready.
// Getting the current electron window is not free and synchronous.
// Here, we defer all menu update requests, and fire one when the app is ready.
@ -124,17 +125,17 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
...args
);
if (
this._menu &&
this.menu &&
this.menuCommandExecutor.isVisible(menuPath, commandId, ...args)
) {
const item = this.findMenuById(this._menu, commandId);
const item = this.findMenuById(this.menu, commandId);
if (item) {
item.checked = this.menuCommandExecutor.isToggled(
menuPath,
commandId,
...args
);
window.electronArduino.setMenu(this._menu); // overridden to call the IDE2-specific implementation.
window.electronArduino.setMenu(this.menu); // overridden to call the IDE2-specific implementation.
}
}
}
@ -342,7 +343,7 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
parentItems.push(menuItem);
if (this.commandRegistry.getToggledHandler(commandId, ...args)) {
this._toggledCommands.add(commandId);
this.toggledCommands.add(commandId);
}
}
return parentItems;

View File

@ -106,7 +106,6 @@ import { FormatterPath } from '../common/protocol/formatter';
import { HostedPluginLocalizationService } from './theia/plugin-ext/hosted-plugin-localization-service';
import { HostedPluginLocalizationService as TheiaHostedPluginLocalizationService } from '@theia/plugin-ext/lib/hosted/node/hosted-plugin-localization-service';
import { IsTempSketch } from './is-temp-sketch';
import { rebindNsfwFileSystemWatcher } from './theia/filesystem/nsfw-bindings';
import { WebsocketEndpoint } from './theia/core/websocket-endpoint';
import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
import { HostedPluginReader } from './theia/plugin-ext/plugin-reader';
@ -121,6 +120,7 @@ import {
} from './theia/plugin-ext/plugin-deployer';
import { SettingsReader } from './settings-reader';
import { VsCodePluginScanner } from './theia/plugin-ext-vscode/scanner-vscode';
import { rebindParcelFileSystemWatcher } from './theia/filesystem/parcel-bindings';
export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(BackendApplication).toSelf().inSingletonScope();
@ -300,7 +300,7 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
)
)
.inSingletonScope();
rebindNsfwFileSystemWatcher(rebind);
rebindParcelFileSystemWatcher(rebind);
// Output service per connection.
bind(ConnectionContainerModule).toConstantValue(

View File

@ -1,42 +0,0 @@
import { join } from 'node:path';
import { interfaces } from '@theia/core/shared/inversify';
import {
NsfwFileSystemWatcherServiceProcessOptions,
NSFW_SINGLE_THREADED,
spawnNsfwFileSystemWatcherServiceProcess,
} from '@theia/filesystem/lib/node/filesystem-backend-module';
import { FileSystemWatcherService } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
import { NsfwFileSystemWatcherServerOptions } from '@theia/filesystem/lib/node/nsfw-watcher/nsfw-filesystem-service';
import { FileSystemWatcherServiceDispatcher } from '@theia/filesystem/lib/node/filesystem-watcher-dispatcher';
import { NoDelayDisposalTimeoutNsfwFileSystemWatcherService } from './nsfw-watcher/nsfw-filesystem-service';
export function rebindNsfwFileSystemWatcher(rebind: interfaces.Rebind): void {
rebind<NsfwFileSystemWatcherServiceProcessOptions>(
NsfwFileSystemWatcherServiceProcessOptions
).toConstantValue({
entryPoint: join(__dirname, 'nsfw-watcher'),
});
rebind<FileSystemWatcherService>(FileSystemWatcherService)
.toDynamicValue((context) =>
NSFW_SINGLE_THREADED
? createNsfwFileSystemWatcherService(context)
: spawnNsfwFileSystemWatcherServiceProcess(context)
)
.inSingletonScope();
}
function createNsfwFileSystemWatcherService({
container,
}: interfaces.Context): FileSystemWatcherService {
const options = container.get<NsfwFileSystemWatcherServerOptions>(
NsfwFileSystemWatcherServerOptions
);
const dispatcher = container.get<FileSystemWatcherServiceDispatcher>(
FileSystemWatcherServiceDispatcher
);
const server = new NoDelayDisposalTimeoutNsfwFileSystemWatcherService(
options
);
server.setClient(dispatcher);
return server;
}

View File

@ -0,0 +1,42 @@
import { join } from 'node:path';
import { interfaces } from '@theia/core/shared/inversify';
import {
FileSystemWatcherServiceProcessOptions,
WATCHER_SINGLE_THREADED,
spawnParcelFileSystemWatcherServiceProcess,
} from '@theia/filesystem/lib/node/filesystem-backend-module';
import { FileSystemWatcherService } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
import { ParcelFileSystemWatcherServerOptions } from '@theia/filesystem/lib/node/parcel-watcher/parcel-filesystem-service';
import { FileSystemWatcherServiceDispatcher } from '@theia/filesystem/lib/node/filesystem-watcher-dispatcher';
import { NoDelayDisposalTimeoutParcelFileSystemWatcherService } from './parcel-watcher/parcel-filesystem-service';
export function rebindParcelFileSystemWatcher(rebind: interfaces.Rebind): void {
rebind<FileSystemWatcherServiceProcessOptions>(
FileSystemWatcherServiceProcessOptions
).toConstantValue({
entryPoint: join(__dirname, 'parcel-watcher'),
});
rebind<FileSystemWatcherService>(FileSystemWatcherService)
.toDynamicValue((context) =>
WATCHER_SINGLE_THREADED
? createParcelFileSystemWatcherService(context)
: spawnParcelFileSystemWatcherServiceProcess(context)
)
.inSingletonScope();
}
function createParcelFileSystemWatcherService({
container,
}: interfaces.Context): FileSystemWatcherService {
const options = container.get<ParcelFileSystemWatcherServerOptions>(
ParcelFileSystemWatcherServerOptions
);
const dispatcher = container.get<FileSystemWatcherServiceDispatcher>(
FileSystemWatcherServiceDispatcher
);
const server = new NoDelayDisposalTimeoutParcelFileSystemWatcherService(
options
);
server.setClient(dispatcher);
return server;
}

View File

@ -1,6 +1,6 @@
import * as yargs from '@theia/core/shared/yargs';
import { JsonRpcProxyFactory } from '@theia/core/lib/common/messaging/proxy-factory';
import { NoDelayDisposalTimeoutNsfwFileSystemWatcherService } from './nsfw-filesystem-service';
import { NoDelayDisposalTimeoutParcelFileSystemWatcherService } from './parcel-filesystem-service';
import type { IPCEntryPoint } from '@theia/core/lib/node/messaging/ipc-protocol';
import type { FileSystemWatcherServiceClient } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
@ -20,7 +20,7 @@ const options: {
}).argv as any;
export default <IPCEntryPoint>((connection) => {
const server = new NoDelayDisposalTimeoutNsfwFileSystemWatcherService(
const server = new NoDelayDisposalTimeoutParcelFileSystemWatcherService(
options
);
const factory = new JsonRpcProxyFactory<FileSystemWatcherServiceClient>(

View File

@ -1,26 +1,26 @@
import { Minimatch } from 'minimatch';
import type { WatchOptions } from '@theia/filesystem/lib/common/filesystem-watcher-protocol';
import {
NsfwFileSystemWatcherService,
NsfwWatcher,
} from '@theia/filesystem/lib/node/nsfw-watcher/nsfw-filesystem-service';
ParcelFileSystemWatcherService,
ParcelWatcher,
} from '@theia/filesystem/lib/node/parcel-watcher/parcel-filesystem-service';
// Dispose the watcher immediately when the last reference is removed. By default, Theia waits 10 sec.
// https://github.com/eclipse-theia/theia/issues/11639#issuecomment-1238980708
const NoDelay = 0;
export class NoDelayDisposalTimeoutNsfwFileSystemWatcherService extends NsfwFileSystemWatcherService {
export class NoDelayDisposalTimeoutParcelFileSystemWatcherService extends ParcelFileSystemWatcherService {
protected override createWatcher(
clientId: number,
fsPath: string,
options: WatchOptions
): NsfwWatcher {
): ParcelWatcher {
const watcherOptions = {
ignored: options.ignored.map(
(pattern) => new Minimatch(pattern, { dot: true })
),
};
return new NsfwWatcher(
return new ParcelWatcher(
clientId,
fsPath,
watcherOptions,

View File

@ -6,7 +6,7 @@ import { expect } from 'chai';
import { dump, load } from 'js-yaml';
import { promises as fs } from 'node:fs';
import { join } from 'node:path';
import { sync as deleteSync } from 'rimraf';
import { rimrafSync } from 'rimraf';
import {
BoardsService,
CoreService,
@ -65,7 +65,7 @@ describe('core-client-provider', () => {
it("should recover when the 'directories.data' folder is missing", async function () {
this.timeout(timeout);
const configDirPath = await prepareTestConfigDir();
deleteSync(join(configDirPath, 'data'));
rimrafSync(join(configDirPath, 'data'));
const container = await startCli(configDirPath, toDispose);
await assertFunctionalCli(container, ({ coreClientProvider }) => {
@ -84,7 +84,7 @@ describe('core-client-provider', () => {
'Arduino15',
'package_index.json'
);
deleteSync(primaryPackageIndexPath);
rimrafSync(primaryPackageIndexPath);
const container = await startCli(configDirPath, toDispose);
await assertFunctionalCli(container, ({ coreClientProvider }) => {
@ -118,7 +118,7 @@ describe('core-client-provider', () => {
'tools',
tool
);
deleteSync(builtinToolsPath);
rimrafSync(builtinToolsPath);
const container = await startCli(configDirPath, toDispose);
await assertFunctionalCli(container, ({ coreClientProvider }) => {
@ -140,7 +140,7 @@ describe('core-client-provider', () => {
'Arduino15',
'library_index.json'
);
deleteSync(libraryPackageIndexPath);
rimrafSync(libraryPackageIndexPath);
const container = await startCli(configDirPath, toDispose);
await assertFunctionalCli(container, ({ coreClientProvider }) => {
@ -176,7 +176,7 @@ describe('core-client-provider', () => {
'Arduino15',
'package_teensy_index.json'
);
deleteSync(thirdPartyPackageIndexPath);
rimrafSync(thirdPartyPackageIndexPath);
const container = await startCli(configDirPath, toDispose);
await assertFunctionalCli(
@ -193,7 +193,7 @@ describe('core-client-provider', () => {
it("should recover when invalid 3rd package URL is defined in the CLI config and the 'directories.data' folder is missing", async function () {
this.timeout(timeout);
const configDirPath = await prepareTestConfigDir();
deleteSync(join(configDirPath, 'data'));
rimrafSync(join(configDirPath, 'data'));
// set an invalid URL so the CLI will try to download it
const cliConfigPath = join(configDirPath, 'arduino-cli.yaml');

View File

@ -10,7 +10,7 @@ import { expect } from 'chai';
import { rejects } from 'node:assert/strict';
import { promises as fs } from 'node:fs';
import path, { basename, join } from 'node:path';
import { sync as rimrafSync } from 'rimraf';
import { rimrafSync } from 'rimraf';
import temp from 'temp';
import { Sketch, SketchesError, SketchesService } from '../../common/protocol';
import {
@ -574,7 +574,7 @@ function disposeSketch(...sketch: Sketch[]): Disposable {
function disposeFolder(...paths: string[]): Disposable {
return new DisposableCollection(
...paths.map((path) =>
Disposable.create(() => rimrafSync(path, { maxBusyTries: 5 }))
Disposable.create(() => rimrafSync(path, { maxRetries: 5 }))
)
);
}

View File

@ -20,5 +20,4 @@
"skipLibCheck": true
},
"include": ["src"],
"files": ["../node_modules/nsfw/index.d.ts"]
}

View File

@ -5,24 +5,24 @@
"license": "AGPL-3.0-or-later",
"main": "./src-gen/backend/electron-main.js",
"dependencies": {
"@theia/core": "1.54.0",
"@theia/debug": "1.54.0",
"@theia/editor": "1.54.0",
"@theia/electron": "1.54.0",
"@theia/filesystem": "1.54.0",
"@theia/keymaps": "1.54.0",
"@theia/messages": "1.54.0",
"@theia/monaco": "1.54.0",
"@theia/navigator": "1.54.0",
"@theia/plugin-ext": "1.54.0",
"@theia/plugin-ext-vscode": "1.54.0",
"@theia/preferences": "1.54.0",
"@theia/terminal": "1.54.0",
"@theia/workspace": "1.54.0",
"@theia/core": "1.55.1",
"@theia/debug": "1.55.1",
"@theia/editor": "1.55.1",
"@theia/electron": "1.55.1",
"@theia/filesystem": "1.55.1",
"@theia/keymaps": "1.55.1",
"@theia/messages": "1.55.1",
"@theia/monaco": "1.55.1",
"@theia/navigator": "1.55.1",
"@theia/plugin-ext": "1.55.1",
"@theia/plugin-ext-vscode": "1.55.1",
"@theia/preferences": "1.55.1",
"@theia/terminal": "1.55.1",
"@theia/workspace": "1.55.1",
"arduino-ide-extension": "2.3.5"
},
"devDependencies": {
"@theia/cli": "1.54.0",
"@theia/cli": "1.55.1",
"7zip-min": "^1.4.4",
"chmodr": "^1.2.0",
"compression-webpack-plugin": "^9.0.0",
@ -36,7 +36,7 @@
"glob": "^10.3.3",
"is-ci": "^2.0.0",
"resolve-package-path": "^4.0.3",
"rimraf": "^2.6.1",
"rimraf": "^5.0.0",
"semver": "^7.3.2",
"temp": "^0.9.1",
"yaml": "^1.10.2"
@ -53,7 +53,7 @@
"prepackage": "rimraf dist",
"package": "node ./scripts/package.js",
"postpackage": "node ./scripts/post-package.js",
"rebuild": "theia rebuild:browser --cacheRoot ../.. && theia rebuild:electron --cacheRoot ../.."
"rebuild": "theia rebuild:browser --cacheRoot .. && theia rebuild:electron --cacheRoot .."
},
"theia": {
"target": "electron",

View File

@ -30,9 +30,9 @@ backend.config.plugins.unshift(
);
// Override the default entry from Theia as IDE2 has a customization of the module.
backend.config.entry['nsfw-watcher'] = {
backend.config.entry['parcel-watcher'] = {
import: require.resolve(
'arduino-ide-extension/lib/node/theia/filesystem/nsfw-watcher'
'arduino-ide-extension/lib/node/theia/filesystem/parcel-watcher'
),
library: {
type: 'commonjs2',

View File

@ -22,7 +22,7 @@
"nx/axios": "^1.6.7"
},
"devDependencies": {
"@theia/cli": "1.54.0",
"@theia/cli": "1.55.1",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"@xhmikosr/downloader": "^13.0.1",
@ -41,7 +41,7 @@
"node-gyp": "^9.3.0",
"prettier": "^2.3.1",
"reflect-metadata": "^0.1.10",
"rimraf": "^2.6.1",
"rimraf": "^5.0.0",
"semver": "^7.3.2",
"style-dictionary": "^3.7.0",
"typescript": "^4.9.3",

1139
yarn.lock

File diff suppressed because it is too large Load Diff