mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +00:00
Test light version
This commit is contained in:
parent
6eef09efd8
commit
8ec96fc891
@ -42,6 +42,7 @@ import { ArduinoMenus } from './menu/arduino-menus';
|
||||
import { MonitorViewContribution } from './serial/monitor/monitor-view-contribution';
|
||||
import { SerialPlotterContribution } from './serial/plotter/plotter-frontend-contribution';
|
||||
import { ArduinoToolbar } from './toolbar/arduino-toolbar';
|
||||
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
||||
|
||||
@injectable()
|
||||
export class ArduinoFrontendContribution
|
||||
@ -103,6 +104,12 @@ export class ArduinoFrontendContribution
|
||||
}
|
||||
|
||||
registerToolbarItems(registry: TabBarToolbarRegistry): void {
|
||||
const config = FrontendApplicationConfigProvider.get();
|
||||
|
||||
debugger;
|
||||
if (config.isLightVersion) {
|
||||
return;
|
||||
}
|
||||
registry.registerItem({
|
||||
id: BoardsToolBarItem.TOOLBAR_ID,
|
||||
render: () => (
|
||||
|
@ -85,7 +85,6 @@ import { TabBarDecoratorService as TheiaTabBarDecoratorService } from '@theia/co
|
||||
import { TabBarDecoratorService } from './theia/core/tab-bar-decorator';
|
||||
import { ProblemManager as TheiaProblemManager } from '@theia/markers/lib/browser';
|
||||
import { ProblemManager } from './theia/markers/problem-manager';
|
||||
import { BoardsAutoInstaller } from './boards/boards-auto-installer';
|
||||
import { ShellLayoutRestorer } from './theia/core/shell-layout-restorer';
|
||||
import {
|
||||
ArduinoComponentContextMenuRenderer,
|
||||
@ -222,9 +221,6 @@ import { NotificationsRenderer as TheiaNotificationsRenderer } from '@theia/mess
|
||||
import { NotificationsRenderer } from './theia/messages/notifications-renderer';
|
||||
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
|
||||
import { LocalCacheFsProvider } from './local-cache/local-cache-fs-provider';
|
||||
import { CloudSketchbookWidget } from './widgets/cloud-sketchbook/cloud-sketchbook-widget';
|
||||
import { CloudSketchbookTreeWidget } from './widgets/cloud-sketchbook/cloud-sketchbook-tree-widget';
|
||||
import { createCloudSketchbookTreeWidget } from './widgets/cloud-sketchbook/cloud-sketchbook-tree-container';
|
||||
import { CreateApi } from './create/create-api';
|
||||
import { ShareSketchDialog } from './dialogs/cloud-share-sketch-dialog';
|
||||
import { AuthenticationClientService } from './auth/authentication-client-service';
|
||||
@ -497,8 +493,8 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
.whenTargetNamed('store');
|
||||
|
||||
// Boards auto-installer
|
||||
bind(BoardsAutoInstaller).toSelf().inSingletonScope();
|
||||
bind(FrontendApplicationContribution).toService(BoardsAutoInstaller);
|
||||
// bind(BoardsAutoInstaller).toSelf().inSingletonScope();
|
||||
// bind(FrontendApplicationContribution).toService(BoardsAutoInstaller);
|
||||
|
||||
// Boards list widget
|
||||
bind(BoardsListWidget).toSelf();
|
||||
@ -970,11 +966,11 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
createWidget: () => ctx.container.get(SketchbookCompositeWidget),
|
||||
}));
|
||||
|
||||
bind(CloudSketchbookWidget).toSelf();
|
||||
rebind(SketchbookWidget).toService(CloudSketchbookWidget);
|
||||
bind(CloudSketchbookTreeWidget).toDynamicValue(({ container }) =>
|
||||
createCloudSketchbookTreeWidget(container)
|
||||
);
|
||||
// bind(CloudSketchbookWidget).toSelf();
|
||||
// rebind(SketchbookWidget).toService(CloudSketchbookWidget);
|
||||
// bind(CloudSketchbookTreeWidget).toDynamicValue(({ container }) =>
|
||||
// createCloudSketchbookTreeWidget(container)
|
||||
// );
|
||||
bind(CreateApi).toSelf().inSingletonScope();
|
||||
bind(SketchCache).toSelf().inSingletonScope();
|
||||
bind(CreateFeatures).toSelf().inSingletonScope();
|
||||
|
@ -52,6 +52,10 @@ export class BoardsAutoInstaller implements FrontendApplicationContribution {
|
||||
private readonly toDispose = new DisposableCollection();
|
||||
|
||||
onStart(): void {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.toDispose.pushAll([
|
||||
this.boardsServiceProvider.onBoardsConfigDidChange((event) => {
|
||||
if (isBoardIdentifierChangeEvent(event)) {
|
||||
|
@ -35,6 +35,10 @@ export class BoardsDataMenuUpdater extends Contribution {
|
||||
private readonly toDisposeOnBoardChange = new DisposableCollection();
|
||||
|
||||
override onStart(): void {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.boardsDataStore.onDidChange(() =>
|
||||
this.updateMenuActions(
|
||||
this.boardsServiceProvider.boardsConfig.selectedBoard
|
||||
|
@ -47,6 +47,10 @@ export class CheckForIDEUpdates extends Contribution {
|
||||
}
|
||||
|
||||
override async onReady(): Promise<void> {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.updater
|
||||
.init(
|
||||
this.preferences.get('arduino.ide.updateChannel'),
|
||||
|
@ -16,6 +16,10 @@ export class IndexesUpdateProgress extends Contribution {
|
||||
| undefined;
|
||||
|
||||
override onStart(): void {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.notificationCenter.onIndexUpdateWillStart(({ progressId }) =>
|
||||
this.getOrCreateProgress(progressId)
|
||||
);
|
||||
|
@ -113,6 +113,10 @@ export class InoLanguage extends SketchContribution {
|
||||
private languageServerFqbn?: string;
|
||||
|
||||
override onReady(): void {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
const start = (
|
||||
selectedBoard: BoardIdentifier | undefined,
|
||||
forceStart = false
|
||||
@ -191,6 +195,10 @@ export class InoLanguage extends SketchContribution {
|
||||
name: string | undefined,
|
||||
forceStart = false
|
||||
): Promise<void> {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
const port = await this.daemon.tryGetPort();
|
||||
if (typeof port !== 'number') {
|
||||
return;
|
||||
|
@ -45,6 +45,10 @@ export class UpdateIndexes extends Contribution {
|
||||
}
|
||||
|
||||
private async checkForUpdates(): Promise<void> {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
const checkForUpdates = this.preferences['arduino.checkForUpdates'];
|
||||
if (!checkForUpdates) {
|
||||
console.debug(
|
||||
@ -83,6 +87,10 @@ export class UpdateIndexes extends Contribution {
|
||||
types: IndexType[],
|
||||
force = false
|
||||
): Promise<void> {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
const updatedAt = new Date().toISOString();
|
||||
return Promise.all(
|
||||
types.map((type) => this.needsIndexUpdate(type, updatedAt, force))
|
||||
@ -104,6 +112,10 @@ export class UpdateIndexes extends Contribution {
|
||||
now: string,
|
||||
force = false
|
||||
): Promise<IndexType | false> {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (force) {
|
||||
console.debug(
|
||||
`[update-indexes]: Update for index type: '${type}' was forcefully requested.`
|
||||
|
@ -521,6 +521,8 @@ export class ElectronMainApplication extends TheiaElectronMainApplication {
|
||||
}
|
||||
|
||||
protected override async startBackend(): Promise<number> {
|
||||
// FIXME: temporary test to check improvements on low powered machines.
|
||||
process.env.IS_LIGHT_VERSION = 'true';
|
||||
// Check if we should run everything as one process.
|
||||
const noBackendFork = process.argv.indexOf('--no-cluster') !== -1;
|
||||
// We cannot use the `process.cwd()` as the application project path (the location of the `package.json` in other words)
|
||||
|
@ -75,12 +75,7 @@ import {
|
||||
} from '../common/protocol';
|
||||
import { BackendApplication } from './theia/core/backend-application';
|
||||
import { BoardDiscovery } from './board-discovery';
|
||||
import { AuthenticationServiceImpl } from './auth/authentication-service-impl';
|
||||
import {
|
||||
AuthenticationService,
|
||||
AuthenticationServiceClient,
|
||||
AuthenticationServicePath,
|
||||
} from '../common/protocol/authentication-service';
|
||||
|
||||
import { ArduinoFirmwareUploaderImpl } from './arduino-firmware-uploader-impl';
|
||||
import { PlotterBackendContribution } from './plotter/plotter-backend-contribution';
|
||||
import { ArduinoLocalizationContribution } from './i18n/arduino-localization-contribution';
|
||||
@ -354,25 +349,25 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
].forEach((name) => bindChildLogger(bind, name));
|
||||
|
||||
// Cloud sketchbook bindings
|
||||
bind(AuthenticationServiceImpl).toSelf().inSingletonScope();
|
||||
bind(AuthenticationService).toService(AuthenticationServiceImpl);
|
||||
bind(BackendApplicationContribution).toService(AuthenticationServiceImpl);
|
||||
bind(ConnectionHandler)
|
||||
.toDynamicValue(
|
||||
(context) =>
|
||||
new JsonRpcConnectionHandler<AuthenticationServiceClient>(
|
||||
AuthenticationServicePath,
|
||||
(client) => {
|
||||
const server = context.container.get<AuthenticationServiceImpl>(
|
||||
AuthenticationServiceImpl
|
||||
);
|
||||
server.setClient(client);
|
||||
client.onDidCloseConnection(() => server.disposeClient(client));
|
||||
return server;
|
||||
}
|
||||
)
|
||||
)
|
||||
.inSingletonScope();
|
||||
// bind(AuthenticationServiceImpl).toSelf().inSingletonScope();
|
||||
// bind(AuthenticationService).toService(AuthenticationServiceImpl);
|
||||
// bind(BackendApplicationContribution).toService(AuthenticationServiceImpl);
|
||||
// bind(ConnectionHandler)
|
||||
// .toDynamicValue(
|
||||
// (context) =>
|
||||
// new JsonRpcConnectionHandler<AuthenticationServiceClient>(
|
||||
// AuthenticationServicePath,
|
||||
// (client) => {
|
||||
// const server = context.container.get<AuthenticationServiceImpl>(
|
||||
// AuthenticationServiceImpl
|
||||
// );
|
||||
// server.setClient(client);
|
||||
// client.onDidCloseConnection(() => server.disposeClient(client));
|
||||
// return server;
|
||||
// }
|
||||
// )
|
||||
// )
|
||||
// .inSingletonScope();
|
||||
|
||||
bind(PlotterBackendContribution).toSelf().inSingletonScope();
|
||||
bind(BackendApplicationContribution).toService(PlotterBackendContribution);
|
||||
|
@ -170,6 +170,10 @@ export class BoardDiscovery
|
||||
}
|
||||
|
||||
async start(): Promise<void> {
|
||||
if (process.env.IS_LIGHT_VERSION) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.logger.info('start');
|
||||
if (this.stopping) {
|
||||
this.logger.info('start is stopping wait');
|
||||
|
@ -4,9 +4,6 @@ set -e
|
||||
|
||||
yarn install --immutable \
|
||||
&& yarn --cwd arduino-ide-extension build \
|
||||
&& yarn test \
|
||||
&& yarn --cwd arduino-ide-extension test:slow \
|
||||
&& yarn --cwd arduino-ide-extension lint \
|
||||
&& yarn --cwd electron-app rebuild \
|
||||
&& yarn --cwd electron-app build \
|
||||
&& yarn --cwd electron-app package
|
||||
|
Loading…
x
Reference in New Issue
Block a user