Skip to content

Commit

Permalink
GLSP-1022: Update dependencies (#253)
Browse files Browse the repository at this point in the history
* GLSP-1022: Update dependencies

- Update to latest next version of glsp dev packages and sprotty
  - This also requires an update to inversify 6
- Update to TS 6

## Sprotty update
- Move sprotty-reexport.ts into `glsp-sprotty´ directory  and provide `~glsp-sprotty` path alias to ensure that client-internal we
also only reuse the augmented `glsp-sprotty` reexport with having to use relative paths.
- Counteract the breaking sprotty naming changes by rexporting them as the old types (SModelElementImpl-> SModelElement)
- Adapt sprotty an glsp-protocol imports of `@eclipse-glsp/client` to consistently use `~glsp-sprotty` instead
This reexport is a glsp-ified version of the sprotty main index that augments some modules of sprotty
(actions,types) and replaces some modules with a specific glsp version (SModel API Impl -> GModel API)

Part of eclipse-glsp/glsp#1022

* Address review feedback
  • Loading branch information
tortmayr authored Jun 20, 2023
1 parent d81a1ea commit cab84ec
Show file tree
Hide file tree
Showing 160 changed files with 3,595 additions and 2,897 deletions.
10 changes: 8 additions & 2 deletions .mocharc
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"$schema": "https://json.schemastore.org/mocharc",
"extends": "@eclipse-glsp/mocha-config"
"$schema": "https://json.schemastore.org/mocharc",
"extends": "@eclipse-glsp/mocha-config",
"require": [
"ts-node/register",
"tsconfig-paths/register",
"reflect-metadata/Reflect",
"ignore-styles"
]
}
18 changes: 10 additions & 8 deletions examples/workflow-glsp/src/di.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,17 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import {
bindAsService,
configureDefaultModelElements,
configureModelElement,
ConsoleLogger,
ContainerConfiguration,
DefaultTypes,
DeleteElementContextMenuItemProvider,
DiamondNodeView,
editLabelFeature,
GEdge,
glspAccessibilityModule,
GLSPGraph,
GLSPProjectionView,
GridSnapper,
initializeDiagramContainer,
LogLevel,
overrideViewerOptions,
RectangularNodeView,
RevealNamedElementActionProvider,
RoundedCornerNodeView,
Expand All @@ -37,9 +33,15 @@ import {
SLabel,
SLabelView,
StructureCompartmentView,
TYPES
TYPES,
bindAsService,
bindOrRebind,
configureDefaultModelElements,
configureModelElement,
editLabelFeature,
initializeDiagramContainer,
overrideViewerOptions
} from '@eclipse-glsp/client';
import { bindOrRebind, ContainerConfiguration, DefaultTypes } from '@eclipse-glsp/protocol';
import 'balloon-css/balloon.min.css';
import { Container, ContainerModule } from 'inversify';
import 'sprotty/css/edit-label.css';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ import {
AbstractUIExtension,
Action,
AutoCompleteWidget,
DOMHelper,
EditorContextService,
getAbsoluteClientBounds,
GLSPActionDispatcher,
hasStringProp,
ILogger,
LabeledAction,
ModelIndexImpl,
Operation,
RequestContextActions,
RequestEditValidationAction,
SModelRoot,
SetContextActions,
SetEditValidationResultAction,
SModelRoot,
toActionArray,
TYPES,
ValidationDecorator,
ValidationStatus,
ViewerOptions
ViewerOptions,
getAbsoluteClientBounds,
hasStringProp,
toActionArray
} from '@eclipse-glsp/client';
import { inject, injectable } from 'inversify';
import { DOMHelper } from 'sprotty/lib/base/views/dom-helper';
import { isTaskNode, TaskNode } from '../model';
import { TaskNode, isTaskNode } from '../model';

/**
* Is send from the {@link TaskEditor} to the GLSP server
Expand Down
2 changes: 1 addition & 1 deletion examples/workflow-glsp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "@eclipse-glsp/ts-config/tsconfig.json",
"extends": "@eclipse-glsp/ts-config",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib",
Expand Down
56 changes: 27 additions & 29 deletions examples/workflow-standalone/app/diagram.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<style>
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
}

<head>
<meta charset="utf-8" />
<style>
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
}
#sprotty {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}

#sprotty {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
svg {
width: 100%;
height: 100%;
}
</style>
</head>

svg {
width: 100%;
height: 100%;
}
</style>
</head>

<body>
<div id="sprotty"></div>
<script src="bundle.js"></script>
</body>

</html>
<body>
<div id="sprotty"></div>
<script src="bundle.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions examples/workflow-standalone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"@eclipse-glsp-examples/workflow-server-bundled": "next",
"circular-dependency-plugin": "^5.2.2",
"css-loader": "^6.7.1",
"inversify": "^6.0.1",
"path-browserify": "^1.0.1",
"source-map-loader": "^4.0.0",
"style-loader": "^3.3.1",
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@
"watch": "lerna run --parallel watch"
},
"devDependencies": {
"@eclipse-glsp/dev": "1.1.0-next.164cf99.124",
"@eclipse-glsp/dev": "next",
"@types/lodash": "4.14.191",
"@types/node": "16.x"
"@types/node": "16.x",
"lerna": "^6.6.2",
"tsc-alias": "^1.8.2",
"typescript": "^5.0.4"
},
"engines": {
"node": ">=16.11.0",
Expand Down
23 changes: 20 additions & 3 deletions packages/client/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,31 @@ module.exports = {
rules: {
'no-restricted-imports': [
'warn',
{
name: 'sprotty',
message: "Please use '~glsp-sprotty' instead"
},
{
name: 'sprotty/*',
message: "Please use '~glsp-sprotty' instead"
},
{
name: 'sprotty-protocol',
message: "Please use '@eclipse-glsp/protocol' instead"
message: "Please use '~glsp-sprotty' instead"
},
{
name: 'sprotty-protocol/*',
message: "Please use '@eclipse-glsp/protocol' instead"
message: "Please use '~glsp-sprotty' instead"
},
{
name: '@eclipse-glsp/protocol',
message: "Please use '~glsp-sprotty' instead"
},
{
name: '@eclipse-glsp/protocol/*',
message: "Please use '~glsp-sprotty' instead"
}
]
],
'import/no-unresolved': ['error', { ignore: ['~glsp-sprotty'] }]
}
};
7 changes: 4 additions & 3 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"css"
],
"scripts": {
"build": "tsc -b",
"build": "tsc -b && tsc-alias",
"clean": "rimraf lib tsconfig.tsbuildinfo coverage .nyc_output",
"lint": "eslint --ext .ts,.tsx ./src",
"lint:ci": "yarn lint -o eslint.xml -f checkstyle",
Expand All @@ -50,11 +50,12 @@
"@eclipse-glsp/protocol": "1.1.0-next",
"autocompleter": "5.1.0",
"lodash": "4.17.21",
"sprotty": "0.13.0-next.f4445dd.342"
"sprotty": "0.14.0-next.02bbac0.26"
},
"devDependencies": {
"@types/lodash": "4.14.191",
"@vscode/codicons": "^0.0.25"
"@vscode/codicons": "^0.0.25",
"tsc-alias": "^1.8.2"
},
"publishConfig": {
"access": "public"
Expand Down
5 changes: 2 additions & 3 deletions packages/client/src/base/action-dispatcher.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2019-2022 EclipseSource and others.
* Copyright (c) 2019-2023 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,9 +13,8 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Action, RequestAction, ResponseAction } from '@eclipse-glsp/protocol';
import { inject } from 'inversify';
import { ActionDispatcher } from 'sprotty';
import { Action, ActionDispatcher, RequestAction, ResponseAction } from '~glsp-sprotty';
import { ModelInitializationConstraint } from './model-initialization-constraint';

export class GLSPActionDispatcher extends ActionDispatcher {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/base/actions/focus-change-action.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2021-2022 EclipseSource and others.
* Copyright (c) 2021-2023 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,7 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Action, hasBooleanProp } from '@eclipse-glsp/protocol';
import { Action, hasBooleanProp } from '~glsp-sprotty';

/**
* A `FocusStateChangedAction` is dispatched by the client whenever the
Expand Down
26 changes: 0 additions & 26 deletions packages/client/src/base/actions/sprotty-actions.ts

This file was deleted.

5 changes: 2 additions & 3 deletions packages/client/src/base/argumentable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020-2021 EclipseSource and others.
* Copyright (c) 2020-2023 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Args } from '@eclipse-glsp/protocol';
import { SModelElement } from 'sprotty';
import { Args, SModelElement } from '~glsp-sprotty';

export interface SArgumentable {
args: Args;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020-2022 EclipseSource and others.
* Copyright (c) 2020-2023 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,7 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { hasStringProp, LabeledAction } from '@eclipse-glsp/protocol';
import { hasStringProp, LabeledAction } from '~glsp-sprotty';

export interface AutoCompleteValue extends LabeledAction {
readonly text: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { Action, LabeledAction, ValidationStatus } from '@eclipse-glsp/protocol';
import { AutocompleteResult, AutocompleteSettings } from 'autocompleter';
import { codiconCSSClasses, ILogger, SModelRoot } from 'sprotty';
import { toArray } from 'sprotty/lib/utils/iterable';
import { matchesKeystroke } from 'sprotty/lib/utils/keyboard';
import { Action, ILogger, LabeledAction, SModelRoot, ValidationStatus, codiconCSSClasses, matchesKeystroke, toArray } from '~glsp-sprotty';
import { AutoCompleteValue } from './auto-complete-actions';
import { IValidationDecorator } from './validation-decorator';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2020-2021 EclipseSource and others.
* Copyright (c) 2020-2023 EclipseSource and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0 which is available at
Expand All @@ -13,8 +13,7 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { codiconCSSString } from 'sprotty/lib/utils/codicon';
import { ValidationStatus } from '@eclipse-glsp/protocol';
import { ValidationStatus, codiconCSSString } from '~glsp-sprotty';

export interface IValidationDecorator {
decorateValidationResult(status: ValidationStatus): void;
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/base/command-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { injectable } from 'inversify';
import { CommandStack, SModelRoot } from 'sprotty';
import { CommandStack, SModelRoot } from '~glsp-sprotty';

@injectable()
export class GLSPCommandStack extends CommandStack {
Expand Down
Loading

0 comments on commit cab84ec

Please sign in to comment.