Skip to content

Commit

Permalink
repo: upgrade generator
Browse files Browse the repository at this point in the history
The commit includes the following updates:
- updates the target from `es5` to `ES2017`
- updates `inversify` imports to used shared version from
  `@theia/core/shared/inversify`
- updates import to use consistent quotes (single-quotes)

Signed-off-by: vince-fugnitto <[email protected]>
  • Loading branch information
vince-fugnitto committed Sep 2, 2021
1 parent f275d56 commit 355fcaf
Show file tree
Hide file tree
Showing 25 changed files with 46 additions and 58 deletions.
10 changes: 5 additions & 5 deletions templates/backend/backend-module.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ConnectionHandler, JsonRpcConnectionHandler } from "@theia/core";
import { ContainerModule } from "inversify";
import { BackendClient, HelloBackendWithClientService, HelloBackendService, HELLO_BACKEND_PATH, HELLO_BACKEND_WITH_CLIENT_PATH } from "../common/protocol";
import { HelloBackendWithClientServiceImpl } from "./hello-backend-with-client-service";
import { HelloBackendServiceImpl } from "./hello-backend-service";
import { ConnectionHandler, JsonRpcConnectionHandler } from '@theia/core';
import { ContainerModule } from '@theia/core/shared/inversify';
import { BackendClient, HelloBackendWithClientService, HelloBackendService, HELLO_BACKEND_PATH, HELLO_BACKEND_WITH_CLIENT_PATH } from '../common/protocol';
import { HelloBackendWithClientServiceImpl } from './hello-backend-with-client-service';
import { HelloBackendServiceImpl } from './hello-backend-service';

export default new ContainerModule(bind => {
bind(HelloBackendService).to(HelloBackendServiceImpl).inSingletonScope()
Expand Down
2 changes: 1 addition & 1 deletion templates/backend/contribution.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Command, CommandContribution, CommandRegistry} from '@theia/core/lib/common';
import { inject, injectable } from 'inversify';
import { inject, injectable } from '@theia/core/shared/inversify';
import { HelloBackendWithClientService, HelloBackendService } from '../common/protocol';

const SayHelloViaBackendCommandWithCallBack: Command = {
Expand Down
4 changes: 2 additions & 2 deletions templates/backend/frontend-module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CommandContribution} from '@theia/core';
import { WebSocketConnectionProvider } from "@theia/core/lib/browser";
import { ContainerModule, injectable } from "inversify";
import { WebSocketConnectionProvider } from '@theia/core/lib/browser';
import { ContainerModule, injectable } from '@theia/core/shared/inversify';
import { BackendClient, HelloBackendWithClientService, HelloBackendService, HELLO_BACKEND_PATH, HELLO_BACKEND_WITH_CLIENT_PATH } from '../common/protocol';
import { <%= params.extensionPrefix %>CommandContribution} from './<%= params.extensionPath %>-contribution';

Expand Down
4 changes: 2 additions & 2 deletions templates/backend/hello-backend-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { injectable } from "inversify";
import { HelloBackendService } from "../common/protocol";
import { injectable } from '@theia/core/shared/inversify';
import { HelloBackendService } from '../common/protocol';

@injectable()
export class HelloBackendServiceImpl implements HelloBackendService {
Expand Down
4 changes: 2 additions & 2 deletions templates/backend/hello-backend-with-client-service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { injectable } from "inversify";
import { BackendClient, HelloBackendWithClientService } from "../common/protocol";
import { injectable } from '@theia/core/shared/inversify';
import { BackendClient, HelloBackendWithClientService } from '../common/protocol';

@injectable()
export class HelloBackendWithClientServiceImpl implements HelloBackendWithClientService {
Expand Down
2 changes: 1 addition & 1 deletion templates/empty/contribution.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { injectable } from 'inversify';
import { injectable } from '@theia/core/shared/inversify';

@injectable()
// Add contribution interface to be implemented, e.g. "<%= params.extensionPrefix %>Contribution implements CommandContribution"
Expand Down
2 changes: 1 addition & 1 deletion templates/empty/frontend-module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Generated using theia-extension-generator
*/
import { ContainerModule } from 'inversify';
import { ContainerModule } from '@theia/core/shared/inversify';
import { <%= params.extensionPrefix %>Contribution } from './<%= params.extensionPath %>-contribution';


Expand Down
8 changes: 4 additions & 4 deletions templates/hello-world/contribution.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { injectable, inject } from "inversify";
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, MessageService } from "@theia/core/lib/common";
import { CommonMenus } from "@theia/core/lib/browser";
import { injectable, inject } from '@theia/core/shared/inversify';
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, MessageService } from '@theia/core/lib/common';
import { CommonMenus } from '@theia/core/lib/browser';

export const <%= params.extensionPrefix %>Command = {
id: '<%= params.extensionPrefix %>.command',
label: "Say Hello"
label: 'Say Hello'
};

@injectable()
Expand Down
7 changes: 2 additions & 5 deletions templates/hello-world/frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@
* Generated using theia-extension-generator
*/
import { <%= params.extensionPrefix %>CommandContribution, <%= params.extensionPrefix %>MenuContribution } from './<%= params.extensionPath %>-contribution';
import {
CommandContribution,
MenuContribution
} from "@theia/core/lib/common";
import { ContainerModule } from "inversify";
import { CommandContribution, MenuContribution } from '@theia/core/lib/common';
import { ContainerModule } from '@theia/core/shared/inversify';

export default new ContainerModule(bind => {
// add your contribution bindings here
Expand Down
6 changes: 3 additions & 3 deletions templates/labelprovider/contribution.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FileStatNode } from "@theia/filesystem/lib/browser/file-tree/file-tree";
import { FileTreeLabelProvider } from "@theia/filesystem/lib/browser/file-tree/file-tree-label-provider";
import { injectable, } from "inversify";
import { FileStatNode } from '@theia/filesystem/lib/browser/file-tree/file-tree';
import { FileTreeLabelProvider } from '@theia/filesystem/lib/browser/file-tree/file-tree-label-provider';
import { injectable } from '@theia/core/shared/inversify';

@injectable()
export class <%= params.extensionPrefix %>LabelProviderContribution extends FileTreeLabelProvider {
Expand Down
2 changes: 1 addition & 1 deletion templates/labelprovider/frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Generated using theia-extension-generator
*/
import { LabelProviderContribution } from "@theia/core/lib/browser";
import { ContainerModule } from "inversify";
import { ContainerModule } from "@theia/core/shared/inversify";
import { <%= params.extensionPrefix %>LabelProviderContribution } from './<%= params.extensionPath %>-contribution';
import '../../src/browser/style/example.css';

Expand Down
2 changes: 1 addition & 1 deletion templates/tree-editor/example-file/example-file-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import URI from '@theia/core/lib/common/uri';
import { SingleUriCommandHandler } from '@theia/core/lib/common/uri-command-handler';
import { FileService } from '@theia/filesystem/lib/browser/file-service';
import { FileSystemUtils } from '@theia/filesystem/lib/common';
import { inject, injectable } from 'inversify';
import { inject, injectable } from '@theia/core/shared/inversify';
import { OpenerService } from '@theia/core/lib/browser';
import { WorkspaceService } from '@theia/workspace/lib/browser';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry, SelectionService, MAIN_MENU_BAR } from '@theia/core/lib/common';
import { inject, injectable } from 'inversify';
import { inject, injectable } from '@theia/core/shared/inversify';
import { WorkspaceRootUriAwareCommandHandler } from '@theia/workspace/lib/browser/workspace-commands';
import { WorkspaceService } from '@theia/workspace/lib/browser';
import { NewTreeExampleFileCommandHandler, NewTreeExampleFileCommand } from './example-file-command';
Expand Down
11 changes: 3 additions & 8 deletions templates/tree-editor/tree-contribution.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import URI from '@theia/core/lib/common/uri';
import { CommandRegistry, MenuModelRegistry } from '@theia/core';
import { ApplicationShell, NavigatableWidgetOptions, OpenerService, WidgetOpenerOptions } from '@theia/core/lib/browser';
import URI from '@theia/core/lib/common/uri';
import { inject, injectable } from 'inversify';
import {
BaseTreeEditorContribution,
MasterTreeWidget,
TreeEditor,
} from '@eclipse-emfcloud/theia-tree-editor';

import { inject, injectable } from '@theia/core/shared/inversify';
import { TreeModelService } from './tree/tree-model-service';
import { TreeEditorWidget } from './tree/tree-editor-widget';
import { TreeLabelProvider } from './tree/tree-label-provider';
import { BaseTreeEditorContribution, MasterTreeWidget, TreeEditor,} from '@eclipse-emfcloud/theia-tree-editor';

@injectable()
export class TreeContribution extends BaseTreeEditorContribution {
Expand Down
5 changes: 2 additions & 3 deletions templates/tree-editor/tree-frontend-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import '../../src/browser/style/editor.css';
import { CommandContribution, MenuContribution } from '@theia/core';
import { LabelProviderContribution, NavigatableWidgetOptions, OpenHandler, WidgetFactory } from '@theia/core/lib/browser';
import URI from '@theia/core/lib/common/uri';
import { ContainerModule } from 'inversify';
import { createBasicTreeContainer, NavigatableTreeEditorOptions } from '@eclipse-emfcloud/theia-tree-editor';

import { ContainerModule } from '@theia/core/shared/inversify';
import { TreeContribution } from './tree-contribution';
import { TreeModelService } from './tree/tree-model-service';
import { TreeNodeFactory } from './tree/tree-node-factory';
Expand All @@ -16,6 +14,7 @@ import { TreeLabelProvider } from './tree/tree-label-provider';
import { TreeLabelProviderContribution } from './tree-label-provider-contribution';
import { NewTreeExampleFileCommandHandler } from './example-file/example-file-command';
import { NewTreeExampleFileCommandContribution, NewTreeExampleFileMenuContribution } from './example-file/example-file-contribution';
import { createBasicTreeContainer, NavigatableTreeEditorOptions } from '@eclipse-emfcloud/theia-tree-editor';

export default new ContainerModule(bind => {
// Bind Theia IDE contributions for the example file creation menu entry.
Expand Down
2 changes: 1 addition & 1 deletion templates/tree-editor/tree-label-provider-contribution.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LabelProviderContribution } from '@theia/core/lib/browser';
import URI from '@theia/core/lib/common/uri';
import { FileStat } from '@theia/filesystem/lib/common';
import { injectable } from 'inversify';
import { injectable } from '@theia/core/shared/inversify';

@injectable()
export class TreeLabelProviderContribution implements LabelProviderContribution {
Expand Down
2 changes: 1 addition & 1 deletion templates/tree-editor/tree/tree-editor-widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Title, Widget } from '@theia/core/lib/browser';
import { DefaultResourceProvider, ILogger } from '@theia/core/lib/common';
import { EditorPreferences } from '@theia/editor/lib/browser';
import { WorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
import { inject, injectable } from 'inversify';
import { inject, injectable } from '@theia/core/shared/inversify';
import {
MasterTreeWidget,
DetailFormWidget,
Expand Down
5 changes: 2 additions & 3 deletions templates/tree-editor/tree/tree-label-provider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { injectable } from '@theia/core/shared/inversify';
import { LabelProviderContribution } from '@theia/core/lib/browser';
import { injectable } from 'inversify';
import { TreeEditor } from '@eclipse-emfcloud/theia-tree-editor';

import { CoffeeModel } from './tree-model';
import { TreeEditorWidget } from './tree-editor-widget';
import { TreeEditor } from '@eclipse-emfcloud/theia-tree-editor';

const DEFAULT_COLOR = 'black';

Expand Down
5 changes: 2 additions & 3 deletions templates/tree-editor/tree/tree-model-service.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ILogger } from '@theia/core';
import { inject, injectable } from 'inversify';
import { TreeEditor } from '@eclipse-emfcloud/theia-tree-editor';

import { inject, injectable } from '@theia/core/shared/inversify';
import { CoffeeModel } from './tree-model';
import { TreeEditor } from '@eclipse-emfcloud/theia-tree-editor';
import {
brewingView,
coffeeSchema,
Expand Down
7 changes: 3 additions & 4 deletions templates/tree-editor/tree/tree-node-factory.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { ILogger } from '@theia/core';
import { inject, injectable } from 'inversify';
import { TreeEditor } from '@eclipse-emfcloud/theia-tree-editor';
import { v4 } from 'uuid';

import { ILogger } from '@theia/core';
import { inject, injectable } from '@theia/core/shared/inversify';
import { CoffeeModel } from './tree-model';
import { TreeEditorWidget } from './tree-editor-widget';
import { TreeLabelProvider } from './tree-label-provider';
import { TreeEditor } from '@eclipse-emfcloud/theia-tree-editor';

@injectable()
export class TreeNodeFactory implements TreeEditor.NodeFactory {
Expand Down
4 changes: 2 additions & 2 deletions templates/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"resolveJsonModule": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es5",
"target": "ES2017",
"jsx": "react",
"lib": [
"es6",
"ES2017",
"dom"
],
"sourceMap": true,
Expand Down
2 changes: 1 addition & 1 deletion templates/widget/contribution.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { injectable } from 'inversify';
import { injectable } from '@theia/core/shared/inversify';
import { MenuModelRegistry } from '@theia/core';
import { <%= params.extensionPrefix %>Widget } from './<%= params.extensionPath %>-widget';
import { AbstractViewContribution } from '@theia/core/lib/browser';
Expand Down
2 changes: 1 addition & 1 deletion templates/widget/frontend-module.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContainerModule } from 'inversify';
import { ContainerModule } from '@theia/core/shared/inversify';
import { <%= params.extensionPrefix %>Widget } from './<%= params.extensionPath %>-widget';
import { <%= params.extensionPrefix %>Contribution } from './<%= params.extensionPath %>-contribution';
import { bindViewContribution, FrontendApplicationContribution, WidgetFactory } from '@theia/core/lib/browser';
Expand Down
2 changes: 1 addition & 1 deletion templates/widget/widget.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'reflect-metadata';
import { MessageService } from '@theia/core';
import { ContainerModule, Container } from 'inversify';
import { ContainerModule, Container } from '@theia/core/shared/inversify';
import { <%= params.extensionPrefix %>Widget } from './<%= params.extensionPath %>-widget';
import { render } from '@testing-library/react'

Expand Down
2 changes: 1 addition & 1 deletion templates/widget/widget.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { injectable, postConstruct, inject } from 'inversify';
import { injectable, postConstruct, inject } from '@theia/core/shared/inversify';
import { AlertMessage } from '@theia/core/lib/browser/widgets/alert-message';
import { ReactWidget } from '@theia/core/lib/browser/widgets/react-widget';
import { MessageService } from '@theia/core';
Expand Down

0 comments on commit 355fcaf

Please sign in to comment.