mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-09 04:16:38 +00:00
chore(deps): update to theia@1.41.0
(#2211)
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
parent
ce02e263ec
commit
8f4bcc83ec
@ -24,27 +24,27 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@grpc/grpc-js": "^1.8.14",
|
"@grpc/grpc-js": "^1.8.14",
|
||||||
"@theia/application-package": "1.39.0",
|
"@theia/application-package": "1.41.0",
|
||||||
"@theia/core": "1.39.0",
|
"@theia/core": "1.41.0",
|
||||||
"@theia/debug": "1.39.0",
|
"@theia/debug": "1.41.0",
|
||||||
"@theia/editor": "1.39.0",
|
"@theia/editor": "1.41.0",
|
||||||
"@theia/electron": "1.39.0",
|
"@theia/electron": "1.41.0",
|
||||||
"@theia/filesystem": "1.39.0",
|
"@theia/filesystem": "1.41.0",
|
||||||
"@theia/keymaps": "1.39.0",
|
"@theia/keymaps": "1.41.0",
|
||||||
"@theia/markers": "1.39.0",
|
"@theia/markers": "1.41.0",
|
||||||
"@theia/messages": "1.39.0",
|
"@theia/messages": "1.41.0",
|
||||||
"@theia/monaco": "1.39.0",
|
"@theia/monaco": "1.41.0",
|
||||||
"@theia/monaco-editor-core": "1.72.3",
|
"@theia/monaco-editor-core": "1.72.3",
|
||||||
"@theia/navigator": "1.39.0",
|
"@theia/navigator": "1.41.0",
|
||||||
"@theia/outline-view": "1.39.0",
|
"@theia/outline-view": "1.41.0",
|
||||||
"@theia/output": "1.39.0",
|
"@theia/output": "1.41.0",
|
||||||
"@theia/plugin-ext": "1.39.0",
|
"@theia/plugin-ext": "1.41.0",
|
||||||
"@theia/preferences": "1.39.0",
|
"@theia/preferences": "1.41.0",
|
||||||
"@theia/scm": "1.39.0",
|
"@theia/scm": "1.41.0",
|
||||||
"@theia/search-in-workspace": "1.39.0",
|
"@theia/search-in-workspace": "1.41.0",
|
||||||
"@theia/terminal": "1.39.0",
|
"@theia/terminal": "1.41.0",
|
||||||
"@theia/typehierarchy": "1.39.0",
|
"@theia/typehierarchy": "1.41.0",
|
||||||
"@theia/workspace": "1.39.0",
|
"@theia/workspace": "1.41.0",
|
||||||
"@tippyjs/react": "^4.2.5",
|
"@tippyjs/react": "^4.2.5",
|
||||||
"@types/auth0-js": "^9.14.0",
|
"@types/auth0-js": "^9.14.0",
|
||||||
"@types/btoa": "^1.2.3",
|
"@types/btoa": "^1.2.3",
|
||||||
|
@ -358,6 +358,9 @@ import { MonacoEditorMenuContribution as TheiaMonacoEditorMenuContribution } fro
|
|||||||
import { UpdateArduinoState } from './contributions/update-arduino-state';
|
import { UpdateArduinoState } from './contributions/update-arduino-state';
|
||||||
import { TerminalFrontendContribution } from './theia/terminal/terminal-frontend-contribution';
|
import { TerminalFrontendContribution } from './theia/terminal/terminal-frontend-contribution';
|
||||||
import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
import { TerminalFrontendContribution as TheiaTerminalFrontendContribution } from '@theia/terminal/lib/browser/terminal-frontend-contribution';
|
||||||
|
import { SelectionService } from '@theia/core/lib/common/selection-service';
|
||||||
|
import { CommandService } from '@theia/core/lib/common/command';
|
||||||
|
import { CorePreferences } from '@theia/core/lib/browser/core-preferences';
|
||||||
|
|
||||||
// Hack to fix copy/cut/paste issue after electron version update in Theia.
|
// Hack to fix copy/cut/paste issue after electron version update in Theia.
|
||||||
// https://github.com/eclipse-theia/theia/issues/12487
|
// https://github.com/eclipse-theia/theia/issues/12487
|
||||||
@ -796,10 +799,19 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
|||||||
);
|
);
|
||||||
const iconThemeService =
|
const iconThemeService =
|
||||||
context.container.get<IconThemeService>(IconThemeService);
|
context.container.get<IconThemeService>(IconThemeService);
|
||||||
|
const selectionService =
|
||||||
|
context.container.get<SelectionService>(SelectionService);
|
||||||
|
const commandService =
|
||||||
|
context.container.get<CommandService>(CommandService);
|
||||||
|
const corePreferences =
|
||||||
|
context.container.get<CorePreferences>(CorePreferences);
|
||||||
return new TabBarRenderer(
|
return new TabBarRenderer(
|
||||||
contextMenuRenderer,
|
contextMenuRenderer,
|
||||||
decoratorService,
|
decoratorService,
|
||||||
iconThemeService
|
iconThemeService,
|
||||||
|
selectionService,
|
||||||
|
commandService,
|
||||||
|
corePreferences
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { injectable } from '@theia/core/shared/inversify';
|
|
||||||
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
|
|
||||||
import {
|
import {
|
||||||
CommonFrontendContribution as TheiaCommonFrontendContribution,
|
|
||||||
CommonCommands,
|
CommonCommands,
|
||||||
|
CommonFrontendContribution as TheiaCommonFrontendContribution,
|
||||||
} from '@theia/core/lib/browser/common-frontend-contribution';
|
} from '@theia/core/lib/browser/common-frontend-contribution';
|
||||||
import { CommandRegistry } from '@theia/core/lib/common/command';
|
|
||||||
import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
|
import type { OnWillStopAction } from '@theia/core/lib/browser/frontend-application';
|
||||||
import { KeybindingRegistry } from '@theia/core/lib/browser';
|
import type { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
|
||||||
import { isOSX } from '@theia/core';
|
import type { CommandRegistry } from '@theia/core/lib/common/command';
|
||||||
|
import type { MenuModelRegistry } from '@theia/core/lib/common/menu';
|
||||||
|
import { isOSX } from '@theia/core/lib/common/os';
|
||||||
|
import { injectable } from '@theia/core/shared/inversify';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
|
export class CommonFrontendContribution extends TheiaCommonFrontendContribution {
|
||||||
@ -25,6 +25,7 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
|
|||||||
CommonCommands.PIN_TAB,
|
CommonCommands.PIN_TAB,
|
||||||
CommonCommands.UNPIN_TAB,
|
CommonCommands.UNPIN_TAB,
|
||||||
CommonCommands.NEW_UNTITLED_FILE,
|
CommonCommands.NEW_UNTITLED_FILE,
|
||||||
|
CommonCommands.NEW_UNTITLED_TEXT_FILE,
|
||||||
]) {
|
]) {
|
||||||
commandRegistry.unregisterCommand(command);
|
commandRegistry.unregisterCommand(command);
|
||||||
}
|
}
|
||||||
@ -48,6 +49,7 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
|
|||||||
CommonCommands.ABOUT_COMMAND,
|
CommonCommands.ABOUT_COMMAND,
|
||||||
CommonCommands.SAVE_WITHOUT_FORMATTING, // Patched for https://github.com/eclipse-theia/theia/pull/8877,
|
CommonCommands.SAVE_WITHOUT_FORMATTING, // Patched for https://github.com/eclipse-theia/theia/pull/8877,
|
||||||
CommonCommands.NEW_UNTITLED_FILE,
|
CommonCommands.NEW_UNTITLED_FILE,
|
||||||
|
CommonCommands.NEW_UNTITLED_TEXT_FILE,
|
||||||
]) {
|
]) {
|
||||||
registry.unregisterMenuAction(command);
|
registry.unregisterMenuAction(command);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,9 @@ export class MonacoTextModelService extends TheiaMonacoTextModelService {
|
|||||||
const factory = this.factories
|
const factory = this.factories
|
||||||
.getContributions()
|
.getContributions()
|
||||||
.find(({ scheme }) => resource.uri.scheme === scheme);
|
.find(({ scheme }) => resource.uri.scheme === scheme);
|
||||||
const readOnly = this.sketchesServiceClient.isReadOnly(resource.uri);
|
const readOnly =
|
||||||
|
Boolean(resource.isReadonly) ||
|
||||||
|
this.sketchesServiceClient.isReadOnly(resource.uri);
|
||||||
return factory
|
return factory
|
||||||
? factory.createModel(resource)
|
? factory.createModel(resource)
|
||||||
: new MaybeReadonlyMonacoEditorModel(
|
: new MaybeReadonlyMonacoEditorModel(
|
||||||
|
@ -29,7 +29,7 @@ export function createServer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export async function startServer(server: http.Server): Promise<string> {
|
export async function startServer(server: http.Server): Promise<string> {
|
||||||
let portTimer: NodeJS.Timer;
|
let portTimer: NodeJS.Timeout;
|
||||||
|
|
||||||
function cancelPortTimer() {
|
function cancelPortTimer() {
|
||||||
clearTimeout(portTimer);
|
clearTimeout(portTimer);
|
||||||
|
@ -7,13 +7,14 @@ import { HostedPluginReader as TheiaHostedPluginReader } from '@theia/plugin-ext
|
|||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class HostedPluginReader extends TheiaHostedPluginReader {
|
export class HostedPluginReader extends TheiaHostedPluginReader {
|
||||||
override readContribution(
|
override async readContribution(
|
||||||
plugin: PluginPackage
|
plugin: PluginPackage
|
||||||
): PluginContribution | undefined {
|
): Promise<PluginContribution | undefined> {
|
||||||
const scanner = this.scanner.getScanner(plugin);
|
const scanner = this.scanner.getScanner(plugin);
|
||||||
const contributions = scanner.getContribution(plugin);
|
const contributions = await scanner.getContribution(plugin);
|
||||||
return this.filterContribution(plugin.name, contributions);
|
return this.filterContribution(plugin.name, contributions);
|
||||||
}
|
}
|
||||||
|
|
||||||
private filterContribution(
|
private filterContribution(
|
||||||
pluginName: string,
|
pluginName: string,
|
||||||
contributions: PluginContribution | undefined
|
contributions: PluginContribution | undefined
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
import { promises as fs, constants } from 'node:fs';
|
import { FileUri } from '@theia/core/lib/node';
|
||||||
import { injectable, inject } from '@theia/core/shared/inversify';
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
||||||
import { DefaultWorkspaceServer as TheiaDefaultWorkspaceServer } from '@theia/workspace/lib/node/default-workspace-server';
|
import { DefaultWorkspaceServer as TheiaDefaultWorkspaceServer } from '@theia/workspace/lib/node/default-workspace-server';
|
||||||
import { SketchesService } from '../../../common/protocol';
|
import { SketchesService } from '../../../common/protocol';
|
||||||
import { FileUri } from '@theia/core/lib/node';
|
|
||||||
import { IsTempSketch } from '../../is-temp-sketch';
|
import { IsTempSketch } from '../../is-temp-sketch';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
@ -21,26 +20,6 @@ export class DefaultWorkspaceServer extends TheiaDefaultWorkspaceServer {
|
|||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* This is the async re-implementation of the default Theia behavior.
|
|
||||||
*/
|
|
||||||
override async getRecentWorkspaces(): Promise<string[]> {
|
|
||||||
const listUri: string[] = [];
|
|
||||||
const data = await this.readRecentWorkspacePathsFromUserHome();
|
|
||||||
if (data && data.recentRoots) {
|
|
||||||
await Promise.all(
|
|
||||||
data.recentRoots
|
|
||||||
.filter((element) => Boolean(element))
|
|
||||||
.map(async (element) => {
|
|
||||||
if (await this.exists(element)) {
|
|
||||||
listUri.push(element);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return listUri;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override async writeToUserHome(
|
protected override async writeToUserHome(
|
||||||
data: RecentWorkspacePathsData
|
data: RecentWorkspacePathsData
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
@ -69,15 +48,6 @@ export class DefaultWorkspaceServer extends TheiaDefaultWorkspaceServer {
|
|||||||
recentRoots,
|
recentRoots,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private async exists(uri: string): Promise<boolean> {
|
|
||||||
try {
|
|
||||||
await fs.access(FileUri.fsPath(uri), constants.R_OK | constants.W_OK);
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove after https://github.com/eclipse-theia/theia/pull/11603
|
// Remove after https://github.com/eclipse-theia/theia/pull/11603
|
||||||
|
@ -5,24 +5,24 @@
|
|||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"main": "./src-gen/backend/electron-main.js",
|
"main": "./src-gen/backend/electron-main.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@theia/core": "1.39.0",
|
"@theia/core": "1.41.0",
|
||||||
"@theia/debug": "1.39.0",
|
"@theia/debug": "1.41.0",
|
||||||
"@theia/editor": "1.39.0",
|
"@theia/editor": "1.41.0",
|
||||||
"@theia/electron": "1.39.0",
|
"@theia/electron": "1.41.0",
|
||||||
"@theia/filesystem": "1.39.0",
|
"@theia/filesystem": "1.41.0",
|
||||||
"@theia/keymaps": "1.39.0",
|
"@theia/keymaps": "1.41.0",
|
||||||
"@theia/messages": "1.39.0",
|
"@theia/messages": "1.41.0",
|
||||||
"@theia/monaco": "1.39.0",
|
"@theia/monaco": "1.41.0",
|
||||||
"@theia/navigator": "1.39.0",
|
"@theia/navigator": "1.41.0",
|
||||||
"@theia/plugin-ext": "1.39.0",
|
"@theia/plugin-ext": "1.41.0",
|
||||||
"@theia/plugin-ext-vscode": "1.39.0",
|
"@theia/plugin-ext-vscode": "1.41.0",
|
||||||
"@theia/preferences": "1.39.0",
|
"@theia/preferences": "1.41.0",
|
||||||
"@theia/terminal": "1.39.0",
|
"@theia/terminal": "1.41.0",
|
||||||
"@theia/workspace": "1.39.0",
|
"@theia/workspace": "1.41.0",
|
||||||
"arduino-ide-extension": "2.2.2"
|
"arduino-ide-extension": "2.2.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@theia/cli": "1.39.0",
|
"@theia/cli": "1.41.0",
|
||||||
"7zip-min": "^1.4.4",
|
"7zip-min": "^1.4.4",
|
||||||
"chmodr": "^1.2.0",
|
"chmodr": "^1.2.0",
|
||||||
"compression-webpack-plugin": "^9.0.0",
|
"compression-webpack-plugin": "^9.0.0",
|
||||||
@ -201,22 +201,22 @@
|
|||||||
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
|
"vscode-builtin-json-language-features": "https://open-vsx.org/api/vscode/json-language-features/1.46.1/file/vscode.json-language-features-1.46.1.vsix",
|
||||||
"cortex-debug": "https://downloads.arduino.cc/marus25.cortex-debug/marus25.cortex-debug-1.5.1.vsix",
|
"cortex-debug": "https://downloads.arduino.cc/marus25.cortex-debug/marus25.cortex-debug-1.5.1.vsix",
|
||||||
"vscode-language-pack-bg": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-bg/1.48.3/file/MS-CEINTL.vscode-language-pack-bg-1.48.3.vsix",
|
"vscode-language-pack-bg": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-bg/1.48.3/file/MS-CEINTL.vscode-language-pack-bg-1.48.3.vsix",
|
||||||
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.78.0/file/MS-CEINTL.vscode-language-pack-cs-1.78.0.vsix",
|
"vscode-language-pack-cs": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-cs/1.80.0/file/MS-CEINTL.vscode-language-pack-cs-1.80.0.vsix",
|
||||||
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.78.0/file/MS-CEINTL.vscode-language-pack-de-1.78.0.vsix",
|
"vscode-language-pack-de": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-de/1.80.0/file/MS-CEINTL.vscode-language-pack-de-1.80.0.vsix",
|
||||||
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.78.0/file/MS-CEINTL.vscode-language-pack-es-1.78.0.vsix",
|
"vscode-language-pack-es": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-es/1.80.0/file/MS-CEINTL.vscode-language-pack-es-1.80.0.vsix",
|
||||||
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.78.0/file/MS-CEINTL.vscode-language-pack-fr-1.78.0.vsix",
|
"vscode-language-pack-fr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-fr/1.80.0/file/MS-CEINTL.vscode-language-pack-fr-1.80.0.vsix",
|
||||||
"vscode-language-pack-hu": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-hu/1.48.3/file/MS-CEINTL.vscode-language-pack-hu-1.48.3.vsix",
|
"vscode-language-pack-hu": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-hu/1.48.3/file/MS-CEINTL.vscode-language-pack-hu-1.48.3.vsix",
|
||||||
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.78.0/file/MS-CEINTL.vscode-language-pack-it-1.78.0.vsix",
|
"vscode-language-pack-it": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-it/1.80.0/file/MS-CEINTL.vscode-language-pack-it-1.80.0.vsix",
|
||||||
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.78.0/file/MS-CEINTL.vscode-language-pack-ja-1.78.0.vsix",
|
"vscode-language-pack-ja": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ja/1.80.0/file/MS-CEINTL.vscode-language-pack-ja-1.80.0.vsix",
|
||||||
"vscode-language-pack-ko": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ko/1.78.0/file/MS-CEINTL.vscode-language-pack-ko-1.78.0.vsix",
|
"vscode-language-pack-ko": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ko/1.80.0/file/MS-CEINTL.vscode-language-pack-ko-1.80.0.vsix",
|
||||||
"vscode-language-pack-nl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-nl/1.48.3/file/MS-CEINTL.vscode-language-pack-nl-1.48.3.vsix",
|
"vscode-language-pack-nl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-nl/1.48.3/file/MS-CEINTL.vscode-language-pack-nl-1.48.3.vsix",
|
||||||
"vscode-language-pack-pl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pl/1.78.0/file/MS-CEINTL.vscode-language-pack-pl-1.78.0.vsix",
|
"vscode-language-pack-pl": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pl/1.80.0/file/MS-CEINTL.vscode-language-pack-pl-1.80.0.vsix",
|
||||||
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.78.0/file/MS-CEINTL.vscode-language-pack-pt-BR-1.78.0.vsix",
|
"vscode-language-pack-pt-BR": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-pt-BR/1.80.0/file/MS-CEINTL.vscode-language-pack-pt-BR-1.80.0.vsix",
|
||||||
"vscode-language-pack-ru": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.78.0/file/MS-CEINTL.vscode-language-pack-ru-1.78.0.vsix",
|
"vscode-language-pack-ru": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-ru/1.80.0/file/MS-CEINTL.vscode-language-pack-ru-1.80.0.vsix",
|
||||||
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.78.0/file/MS-CEINTL.vscode-language-pack-tr-1.78.0.vsix",
|
"vscode-language-pack-tr": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-tr/1.80.0/file/MS-CEINTL.vscode-language-pack-tr-1.80.0.vsix",
|
||||||
"vscode-language-pack-uk": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-uk/1.48.3/file/MS-CEINTL.vscode-language-pack-uk-1.48.3.vsix",
|
"vscode-language-pack-uk": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-uk/1.48.3/file/MS-CEINTL.vscode-language-pack-uk-1.48.3.vsix",
|
||||||
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.78.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.78.0.vsix",
|
"vscode-language-pack-zh-hans": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hans/1.80.0/file/MS-CEINTL.vscode-language-pack-zh-hans-1.80.0.vsix",
|
||||||
"vscode-language-pack-zh-hant": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hant/1.78.0/file/MS-CEINTL.vscode-language-pack-zh-hant-1.78.0.vsix"
|
"vscode-language-pack-zh-hant": "https://open-vsx.org/api/MS-CEINTL/vscode-language-pack-zh-hant/1.80.0/file/MS-CEINTL.vscode-language-pack-zh-hant-1.80.0.vsix"
|
||||||
},
|
},
|
||||||
"mocha": {
|
"mocha": {
|
||||||
"reporter": "spec",
|
"reporter": "spec",
|
||||||
|
@ -4,11 +4,10 @@
|
|||||||
const chmodr = require('chmodr');
|
const chmodr = require('chmodr');
|
||||||
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
const CopyWebpackPlugin = require('copy-webpack-plugin');
|
||||||
const path = require('node:path');
|
const path = require('node:path');
|
||||||
const fs = require('node:fs/promises');
|
|
||||||
|
|
||||||
const isWindows = process.platform === 'win32';
|
|
||||||
const isMacOS = process.platform === 'darwin';
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} target the name of the `npm` package to resolve.
|
||||||
|
*/
|
||||||
function resolvePackagePath(target, baseDir = __dirname) {
|
function resolvePackagePath(target, baseDir = __dirname) {
|
||||||
const resolvePackageJsonPath = require('resolve-package-path');
|
const resolvePackageJsonPath = require('resolve-package-path');
|
||||||
const packageJsonPath = resolvePackageJsonPath(target, baseDir);
|
const packageJsonPath = resolvePackageJsonPath(target, baseDir);
|
||||||
@ -23,9 +22,11 @@ function resolvePackagePath(target, baseDir = __dirname) {
|
|||||||
// restore file permissions after webpack copy
|
// restore file permissions after webpack copy
|
||||||
// https://github.com/webpack-contrib/copy-webpack-plugin/issues/35#issuecomment-1407280257
|
// https://github.com/webpack-contrib/copy-webpack-plugin/issues/35#issuecomment-1407280257
|
||||||
class PermissionsPlugin {
|
class PermissionsPlugin {
|
||||||
constructor(targetPath, patchTheia12780 = false) {
|
/**
|
||||||
|
* @param {string} targetPath
|
||||||
|
*/
|
||||||
|
constructor(targetPath) {
|
||||||
this.targetPath = targetPath;
|
this.targetPath = targetPath;
|
||||||
this.patchTheia12780 = patchTheia12780;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -34,20 +35,6 @@ class PermissionsPlugin {
|
|||||||
apply(compiler) {
|
apply(compiler) {
|
||||||
compiler.hooks.afterEmit.tap('PermissionsPlugin', () => {
|
compiler.hooks.afterEmit.tap('PermissionsPlugin', () => {
|
||||||
return new Promise(async (resolve, reject) => {
|
return new Promise(async (resolve, reject) => {
|
||||||
if (this.patchTheia12780) {
|
|
||||||
let trashBinaryFilename = undefined;
|
|
||||||
if (isWindows) {
|
|
||||||
trashBinaryFilename = 'windows-trash.exe';
|
|
||||||
} else if (isMacOS) {
|
|
||||||
trashBinaryFilename = 'macos-trash';
|
|
||||||
}
|
|
||||||
if (trashBinaryFilename) {
|
|
||||||
await fs.chmod(
|
|
||||||
path.join(__dirname, 'lib', 'backend', trashBinaryFilename),
|
|
||||||
0o755
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
chmodr(this.targetPath, 0o755, (err) =>
|
chmodr(this.targetPath, 0o755, (err) =>
|
||||||
err ? reject(err) : resolve(undefined)
|
err ? reject(err) : resolve(undefined)
|
||||||
);
|
);
|
||||||
@ -59,18 +46,9 @@ class PermissionsPlugin {
|
|||||||
/**
|
/**
|
||||||
* Creates webpack plugins to copy all required resources (binaries, plotter app, translation files, etc.) to the appropriate location.
|
* Creates webpack plugins to copy all required resources (binaries, plotter app, translation files, etc.) to the appropriate location.
|
||||||
* @param {string} targetPath where to copy the resources
|
* @param {string} targetPath where to copy the resources
|
||||||
* @param {boolean|undefined} [patchTheia12780=true] to apply patch for https://github.com/eclipse-theia/theia/issues/12780. Only required in the production app.
|
|
||||||
* @param {string|undefined} [baseDir=__dirname] to calculate the modules from. Defaults to `__dirname`
|
* @param {string|undefined} [baseDir=__dirname] to calculate the modules from. Defaults to `__dirname`
|
||||||
*/
|
*/
|
||||||
function createCopyArduinoResourcesPlugins(
|
function createCopyArduinoResourcesPlugins(targetPath, baseDir = __dirname) {
|
||||||
targetPath,
|
|
||||||
patchTheia12780 = false,
|
|
||||||
baseDir = __dirname
|
|
||||||
) {
|
|
||||||
const trashBinariesPath = path.join(
|
|
||||||
resolvePackagePath('trash', baseDir),
|
|
||||||
'lib'
|
|
||||||
);
|
|
||||||
const copyOptions = {
|
const copyOptions = {
|
||||||
patterns: [
|
patterns: [
|
||||||
// binaries
|
// binaries
|
||||||
@ -96,25 +74,9 @@ function createCopyArduinoResourcesPlugins(
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
if (patchTheia12780) {
|
|
||||||
// workaround for https://github.com/eclipse-theia/theia/issues/12780
|
|
||||||
// copy the Windows (`windows-trash.exe`) and macOS (`macos-trash`) executables for `trash`
|
|
||||||
if (isWindows) {
|
|
||||||
copyOptions.patterns.push({
|
|
||||||
from: path.join(trashBinariesPath, 'windows-trash.exe'),
|
|
||||||
to: path.resolve(__dirname, 'lib', 'backend'),
|
|
||||||
});
|
|
||||||
} else if (isMacOS) {
|
|
||||||
copyOptions.patterns.push({
|
|
||||||
from: path.join(trashBinariesPath, 'macos-trash'),
|
|
||||||
to: path.resolve(__dirname, 'lib', 'backend'),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return [
|
return [
|
||||||
new CopyWebpackPlugin(copyOptions),
|
new CopyWebpackPlugin(copyOptions),
|
||||||
new PermissionsPlugin(targetPath, patchTheia12780),
|
new PermissionsPlugin(targetPath),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,20 +21,11 @@ mainWindowConfig.plugins?.push(
|
|||||||
);
|
);
|
||||||
const preloadConfig = frontend[2];
|
const preloadConfig = frontend[2];
|
||||||
|
|
||||||
// Taken from https://github.com/eclipse-theia/theia-blueprint/blob/022878d5488c47650fb17b5fdf49a28be88465fe/applications/electron/webpack.config.js#L18-L21
|
|
||||||
if (process.platform !== 'win32') {
|
|
||||||
// For some reason, blueprint wants to bundle the `.node` files directly without going through `@vscode/windows-ca-certs`
|
|
||||||
backend.ignoredResources.add(
|
|
||||||
'@vscode/windows-ca-certs/build/Release/crypt32.node'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy all the IDE2 binaries and the plotter web app.
|
// Copy all the IDE2 binaries and the plotter web app.
|
||||||
// XXX: For whatever reason it is important to use `unshift` instead of `push`, and execute the additional webpack plugins before the Theia contributed ones kick in. Otherwise ours do not work.
|
// XXX: For whatever reason it is important to use `unshift` instead of `push`, and execute the additional webpack plugins before the Theia contributed ones kick in. Otherwise ours do not work.
|
||||||
backend.config.plugins.unshift(
|
backend.config.plugins.unshift(
|
||||||
...createCopyArduinoResourcesPlugins(
|
...createCopyArduinoResourcesPlugins(
|
||||||
path.resolve(__dirname, 'lib', 'backend', 'resources'),
|
path.resolve(__dirname, 'lib', 'backend', 'resources')
|
||||||
true
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
"node": ">=18.17.0 <21"
|
"node": ">=18.17.0 <21"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@theia/cli": "1.39.0",
|
"@theia/cli": "1.41.0",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
"@typescript-eslint/eslint-plugin": "^5.59.0",
|
||||||
"@typescript-eslint/parser": "^5.59.0",
|
"@typescript-eslint/parser": "^5.59.0",
|
||||||
"@xhmikosr/downloader": "^13.0.1",
|
"@xhmikosr/downloader": "^13.0.1",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user