diff --git a/templates/backend/backend-module.ts b/templates/backend/backend-module.ts index 9886856..7e6d983 100644 --- a/templates/backend/backend-module.ts +++ b/templates/backend/backend-module.ts @@ -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() diff --git a/templates/backend/contribution.ts b/templates/backend/contribution.ts index 889a16b..9b03d9c 100644 --- a/templates/backend/contribution.ts +++ b/templates/backend/contribution.ts @@ -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 = { diff --git a/templates/backend/frontend-module.ts b/templates/backend/frontend-module.ts index 381c1ba..3f1435c 100644 --- a/templates/backend/frontend-module.ts +++ b/templates/backend/frontend-module.ts @@ -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'; diff --git a/templates/backend/hello-backend-service.ts b/templates/backend/hello-backend-service.ts index 8b4f22c..51dfc10 100644 --- a/templates/backend/hello-backend-service.ts +++ b/templates/backend/hello-backend-service.ts @@ -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 { diff --git a/templates/backend/hello-backend-with-client-service.ts b/templates/backend/hello-backend-with-client-service.ts index 02cf352..0a491d9 100644 --- a/templates/backend/hello-backend-with-client-service.ts +++ b/templates/backend/hello-backend-with-client-service.ts @@ -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 { diff --git a/templates/empty/contribution.ts b/templates/empty/contribution.ts index 8980cf5..8c139b0 100644 --- a/templates/empty/contribution.ts +++ b/templates/empty/contribution.ts @@ -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" diff --git a/templates/empty/frontend-module.ts b/templates/empty/frontend-module.ts index 68dd7c5..74b7368 100644 --- a/templates/empty/frontend-module.ts +++ b/templates/empty/frontend-module.ts @@ -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'; diff --git a/templates/hello-world/contribution.ts b/templates/hello-world/contribution.ts index 99eda42..73c82be 100644 --- a/templates/hello-world/contribution.ts +++ b/templates/hello-world/contribution.ts @@ -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() diff --git a/templates/hello-world/frontend-module.ts b/templates/hello-world/frontend-module.ts index 1db5809..b014191 100644 --- a/templates/hello-world/frontend-module.ts +++ b/templates/hello-world/frontend-module.ts @@ -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 diff --git a/templates/labelprovider/contribution.ts b/templates/labelprovider/contribution.ts index 512ec40..a583d50 100644 --- a/templates/labelprovider/contribution.ts +++ b/templates/labelprovider/contribution.ts @@ -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 { diff --git a/templates/labelprovider/frontend-module.ts b/templates/labelprovider/frontend-module.ts index ca34b5e..03df5b6 100644 --- a/templates/labelprovider/frontend-module.ts +++ b/templates/labelprovider/frontend-module.ts @@ -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'; diff --git a/templates/tree-editor/example-file/example-file-command.ts b/templates/tree-editor/example-file/example-file-command.ts index bdd7b76..c8b552e 100644 --- a/templates/tree-editor/example-file/example-file-command.ts +++ b/templates/tree-editor/example-file/example-file-command.ts @@ -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'; diff --git a/templates/tree-editor/example-file/example-file-contribution.ts b/templates/tree-editor/example-file/example-file-contribution.ts index ac31ad0..31dc7d2 100644 --- a/templates/tree-editor/example-file/example-file-contribution.ts +++ b/templates/tree-editor/example-file/example-file-contribution.ts @@ -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'; diff --git a/templates/tree-editor/tree-contribution.ts b/templates/tree-editor/tree-contribution.ts index 3131bde..129759a 100644 --- a/templates/tree-editor/tree-contribution.ts +++ b/templates/tree-editor/tree-contribution.ts @@ -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 { diff --git a/templates/tree-editor/tree-frontend-module.ts b/templates/tree-editor/tree-frontend-module.ts index 5b6db3d..f0a0ccd 100644 --- a/templates/tree-editor/tree-frontend-module.ts +++ b/templates/tree-editor/tree-frontend-module.ts @@ -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'; @@ -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. diff --git a/templates/tree-editor/tree-label-provider-contribution.ts b/templates/tree-editor/tree-label-provider-contribution.ts index 806e64e..45fd91d 100644 --- a/templates/tree-editor/tree-label-provider-contribution.ts +++ b/templates/tree-editor/tree-label-provider-contribution.ts @@ -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 { diff --git a/templates/tree-editor/tree/tree-editor-widget.ts b/templates/tree-editor/tree/tree-editor-widget.ts index 952beed..f1d6e19 100644 --- a/templates/tree-editor/tree/tree-editor-widget.ts +++ b/templates/tree-editor/tree/tree-editor-widget.ts @@ -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, diff --git a/templates/tree-editor/tree/tree-label-provider.ts b/templates/tree-editor/tree/tree-label-provider.ts index 4e86655..c2331ef 100644 --- a/templates/tree-editor/tree/tree-label-provider.ts +++ b/templates/tree-editor/tree/tree-label-provider.ts @@ -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'; diff --git a/templates/tree-editor/tree/tree-model-service.ts b/templates/tree-editor/tree/tree-model-service.ts index 25b1102..904ad8a 100644 --- a/templates/tree-editor/tree/tree-model-service.ts +++ b/templates/tree-editor/tree/tree-model-service.ts @@ -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, diff --git a/templates/tree-editor/tree/tree-node-factory.ts b/templates/tree-editor/tree/tree-node-factory.ts index 3c80c60..e10e99a 100644 --- a/templates/tree-editor/tree/tree-node-factory.ts +++ b/templates/tree-editor/tree/tree-node-factory.ts @@ -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 { diff --git a/templates/tsconfig.json b/templates/tsconfig.json index 889b54d..8419101 100644 --- a/templates/tsconfig.json +++ b/templates/tsconfig.json @@ -14,10 +14,10 @@ "resolveJsonModule": true, "module": "commonjs", "moduleResolution": "node", - "target": "es5", + "target": "ES2017", "jsx": "react", "lib": [ - "es6", + "ES2017", "dom" ], "sourceMap": true, diff --git a/templates/widget/contribution.ts b/templates/widget/contribution.ts index 09dcbf6..90f20e5 100644 --- a/templates/widget/contribution.ts +++ b/templates/widget/contribution.ts @@ -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'; diff --git a/templates/widget/frontend-module.ts b/templates/widget/frontend-module.ts index ba01abc..333101c 100644 --- a/templates/widget/frontend-module.ts +++ b/templates/widget/frontend-module.ts @@ -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'; diff --git a/templates/widget/widget.test.ts b/templates/widget/widget.test.ts index 62b6b0e..817e787 100644 --- a/templates/widget/widget.test.ts +++ b/templates/widget/widget.test.ts @@ -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' diff --git a/templates/widget/widget.tsx b/templates/widget/widget.tsx index 5e3fd18..6e6e8eb 100644 --- a/templates/widget/widget.tsx +++ b/templates/widget/widget.tsx @@ -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';