@eclipse-glsp-examples/workflow-server 1.1.0-next.44aae0c.44 → 1.1.0-next.5c40594.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,7 +32,7 @@ async function launch(argv) {
32
32
  const elkLayoutModule = (0, layout_elk_1.configureELKLayoutModule)({ algorithms: ['layered'], layoutConfigurator: workflow_layout_configurator_1.WorkflowLayoutConfigurator });
33
33
  const serverModule = new workflow_diagram_module_1.WorkflowServerModule().configureDiagramModule(new workflow_diagram_module_1.WorkflowDiagramModule(() => mock_model_storage_1.WorkflowMockModelStorage), elkLayoutModule);
34
34
  launcher.configure(serverModule);
35
- await launcher.start();
35
+ await launcher.start({});
36
36
  }
37
37
  catch (error) {
38
38
  (logger !== null && logger !== void 0 ? logger : console).error('Error in workflow server launcher:', error);
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/browser/app.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yDAAoE;AACpE,0DAAsH;AACtH,yCAAsC;AACtC,gGAA2F;AAC3F,+EAAgG;AAChG,6DAAgE;AAEzD,KAAK,UAAU,MAAM,CAAC,IAAe;IACxC,IAAI,MAA0B,CAAC;IAE/B,IAAI;QACA,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,IAAA,yBAAe,EAAC,EAAE,QAAQ,EAAE,kBAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QAEhE,MAAM,GAAG,YAAY,CAAC,GAAG,CAAgB,uBAAa,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7E,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,8BAAoB,CAAC,CAAC;QAC5D,MAAM,eAAe,GAAG,IAAA,qCAAwB,EAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,yDAA0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G,EAAE,CAAC,6CAAwB,CAAC,EACzD,eAAe,CAClB,CAAC;QAEF,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;QAEjC,MAAM,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;KAC5B;IAAC,OAAO,KAAK,EAAE;QACZ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,OAAO,CAAC,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;KAC1E;AACL,CAAC;AAtBD,wBAsBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":"AA4BA,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAqB3D"}
1
+ {"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":"AA6BA,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B3D"}
package/lib/node/app.js CHANGED
@@ -21,18 +21,26 @@ const node_1 = require("@eclipse-glsp/server/node");
21
21
  const inversify_1 = require("inversify");
22
22
  const workflow_layout_configurator_1 = require("../common/layout/workflow-layout-configurator");
23
23
  const workflow_diagram_module_1 = require("../common/workflow-diagram-module");
24
+ const workflow_cli_parser_1 = require("./workflow-cli-parser");
24
25
  async function launch(argv) {
25
26
  let logger;
26
27
  try {
27
- const options = (0, node_1.createSocketCliParser)().parse(argv);
28
+ const options = (0, workflow_cli_parser_1.createWorkflowCliParser)().parse(argv);
28
29
  const appContainer = new inversify_1.Container();
29
30
  appContainer.load((0, node_1.createAppModule)(options));
30
31
  logger = appContainer.get(node_1.LoggerFactory)('WorkflowServerApp');
31
- const launcher = appContainer.resolve(node_1.SocketServerLauncher);
32
32
  const elkLayoutModule = (0, layout_elk_1.configureELKLayoutModule)({ algorithms: ['layered'], layoutConfigurator: workflow_layout_configurator_1.WorkflowLayoutConfigurator });
33
33
  const serverModule = new workflow_diagram_module_1.WorkflowServerModule().configureDiagramModule(new workflow_diagram_module_1.WorkflowDiagramModule(() => node_1.GModelStorage), elkLayoutModule);
34
- launcher.configure(serverModule);
35
- launcher.start({ port: options.port, host: options.host });
34
+ if (options.webSocket) {
35
+ const launcher = appContainer.resolve(node_1.WebSocketServerLauncher);
36
+ launcher.configure(serverModule);
37
+ launcher.start({ port: options.port, host: options.host, path: 'workflow' });
38
+ }
39
+ else {
40
+ const launcher = appContainer.resolve(node_1.SocketServerLauncher);
41
+ launcher.configure(serverModule);
42
+ launcher.start({ port: options.port, host: options.host });
43
+ }
36
44
  }
37
45
  catch (error) {
38
46
  (logger !== null && logger !== void 0 ? logger : console).error('Error in workflow server launcher:', error);
@@ -1 +1 @@
1
- {"version":3,"file":"app.js","sourceRoot":"","sources":["../../src/node/app.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;kFAckF;AAClF,yDAAoE;AACpE,oDAOmC;AACnC,yCAAsC;AACtC,gGAA2F;AAC3F,+EAAgG;AAEzF,KAAK,UAAU,MAAM,CAAC,IAAe;IACxC,IAAI,MAA0B,CAAC;IAC/B,IAAI;QACA,MAAM,OAAO,GAAG,IAAA,4BAAqB,GAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACpD,MAAM,YAAY,GAAG,IAAI,qBAAS,EAAE,CAAC;QACrC,YAAY,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,OAAO,CAAC,CAAC,CAAC;QAE5C,MAAM,GAAG,YAAY,CAAC,GAAG,CAAgB,oBAAa,CAAC,CAAC,mBAAmB,CAAC,CAAC;QAC7E,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,2BAAoB,CAAC,CAAC;QAC5D,MAAM,eAAe,GAAG,IAAA,qCAAwB,EAAC,EAAE,UAAU,EAAE,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,y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EAAE,CAAC,sBAAsB,CAClE,IAAI,+CAAqB,CAAC,GAAG,EAAE,CAAC,oBAAa,CAAC,EAC9C,eAAe,CAClB,CAAC;QAEF,IAAI,OAAO,CAAC,SAAS,EAAE;YACnB,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,8BAAuB,CAAC,CAAC;YAC/D,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;SAChF;aAAM;YACH,MAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,2BAAoB,CAAC,CAAC;YAC5D,QAAQ,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;YACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;SAC9D;KACJ;IAAC,OAAO,KAAK,EAAE;QACZ,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,OAAO,CAAC,CAAC,KAAK,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;KAC1E;AACL,CAAC;AA3BD,wBA2BC"}
@@ -0,0 +1,21 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+ import { CliParser, SocketLaunchOptions } from '@eclipse-glsp/server/node';
17
+ export interface WorkflowLaunchOptions extends SocketLaunchOptions {
18
+ webSocket: boolean;
19
+ }
20
+ export declare function createWorkflowCliParser<O extends WorkflowLaunchOptions = WorkflowLaunchOptions>(defaultOptions?: WorkflowLaunchOptions): CliParser<O>;
21
+ //# sourceMappingURL=workflow-cli-parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-cli-parser.d.ts","sourceRoot":"","sources":["../../src/node/workflow-cli-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;kFAckF;AAElF,OAAO,EAAE,SAAS,EAAqD,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE9H,MAAM,WAAW,qBAAsB,SAAQ,mBAAmB;IAC9D,SAAS,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,uBAAuB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,EAC3F,cAAc,GAAE,qBAA2E,GAC5F,SAAS,CAAC,CAAC,CAAC,CAId"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2023 EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the Eclipse Public License v. 2.0 which is available at
7
+ * http://www.eclipse.org/legal/epl-2.0.
8
+ *
9
+ * This Source Code may also be made available under the following Secondary
10
+ * Licenses when the conditions for such availability set forth in the Eclipse
11
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ * with the GNU Classpath Exception which is available at
13
+ * https://www.gnu.org/software/classpath/license.html.
14
+ *
15
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ ********************************************************************************/
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.createWorkflowCliParser = void 0;
19
+ const node_1 = require("@eclipse-glsp/server/node");
20
+ function createWorkflowCliParser(defaultOptions = Object.assign({ webSocket: false }, node_1.defaultSocketLaunchOptions)) {
21
+ const parser = (0, node_1.createSocketCliParser)(defaultOptions);
22
+ parser.command.option('-w , --webSocket', 'Flag to use websocket launcher instead of default launcher', false);
23
+ return parser;
24
+ }
25
+ exports.createWorkflowCliParser = createWorkflowCliParser;
26
+ //# sourceMappingURL=workflow-cli-parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workflow-cli-parser.js","sourceRoot":"","sources":["../../src/node/workflow-cli-parser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;kFAckF;;;AAElF,oDAA8H;AAM9H,SAAgB,uBAAuB,CACnC,iCAA0C,SAAS,EAAE,KAAK,IAAK,iCAA0B,CAAE;IAE3F,MAAM,MAAM,GAAG,IAAA,4BAAqB,EAAI,cAAc,CAAC,CAAC;IACxD,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,4DAA4D,EAAE,KAAK,CAAC,CAAC;IAC/G,OAAO,MAAM,CAAC;AAClB,CAAC;AAND,0DAMC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp-examples/workflow-server",
3
- "version": "1.1.0-next.44aae0c.44+44aae0c",
3
+ "version": "1.1.0-next.5c40594.46+5c40594",
4
4
  "description": "GLSP node server for the workflow example",
5
5
  "keywords": [
6
6
  "eclipse",
@@ -50,11 +50,12 @@
50
50
  "lint:ci": "yarn lint -o eslint.xml -f checkstyle",
51
51
  "prepare": "yarn clean && yarn build",
52
52
  "start": "node --enable-source-maps bundle/wf-glsp-server-node.js",
53
+ "start:websocket": "node --enable-source-maps bundle/wf-glsp-server-node.js -w --port 8081",
53
54
  "watch": "tsc -w"
54
55
  },
55
56
  "dependencies": {
56
- "@eclipse-glsp/layout-elk": "1.1.0-next.44aae0c.44+44aae0c",
57
- "@eclipse-glsp/server": "1.1.0-next.44aae0c.44+44aae0c"
57
+ "@eclipse-glsp/layout-elk": "1.1.0-next.5c40594.46+5c40594",
58
+ "@eclipse-glsp/server": "1.1.0-next.5c40594.46+5c40594"
58
59
  },
59
60
  "devDependencies": {
60
61
  "source-map-loader": "^4.0.1",
@@ -64,5 +65,5 @@
64
65
  "publishConfig": {
65
66
  "access": "public"
66
67
  },
67
- "gitHead": "44aae0ca2380fe42eb95aac54d2d4e45e187d14f"
68
+ "gitHead": "5c40594962e16e16e56ec82d8100f45b849de315"
68
69
  }
@@ -38,7 +38,7 @@ export async function launch(argv?: string[]): Promise<void> {
38
38
 
39
39
  launcher.configure(serverModule);
40
40
 
41
- await launcher.start();
41
+ await launcher.start({});
42
42
  } catch (error) {
43
43
  (logger ?? console).error('Error in workflow server launcher:', error);
44
44
  }
package/src/node/app.ts CHANGED
@@ -16,34 +16,41 @@
16
16
  import { configureELKLayoutModule } from '@eclipse-glsp/layout-elk';
17
17
  import {
18
18
  createAppModule,
19
- createSocketCliParser,
20
19
  GModelStorage,
21
20
  Logger,
22
21
  LoggerFactory,
23
- SocketServerLauncher
22
+ SocketServerLauncher,
23
+ WebSocketServerLauncher
24
24
  } from '@eclipse-glsp/server/node';
25
25
  import { Container } from 'inversify';
26
26
  import { WorkflowLayoutConfigurator } from '../common/layout/workflow-layout-configurator';
27
27
  import { WorkflowDiagramModule, WorkflowServerModule } from '../common/workflow-diagram-module';
28
+ import { createWorkflowCliParser } from './workflow-cli-parser';
28
29
 
29
30
  export async function launch(argv?: string[]): Promise<void> {
30
31
  let logger: Logger | undefined;
31
32
  try {
32
- const options = createSocketCliParser().parse(argv);
33
+ const options = createWorkflowCliParser().parse(argv);
33
34
  const appContainer = new Container();
34
35
  appContainer.load(createAppModule(options));
35
36
 
36
37
  logger = appContainer.get<LoggerFactory>(LoggerFactory)('WorkflowServerApp');
37
- const launcher = appContainer.resolve(SocketServerLauncher);
38
+
38
39
  const elkLayoutModule = configureELKLayoutModule({ algorithms: ['layered'], layoutConfigurator: WorkflowLayoutConfigurator });
39
40
  const serverModule = new WorkflowServerModule().configureDiagramModule(
40
41
  new WorkflowDiagramModule(() => GModelStorage),
41
42
  elkLayoutModule
42
43
  );
43
44
 
44
- launcher.configure(serverModule);
45
-
46
- launcher.start({ port: options.port, host: options.host });
45
+ if (options.webSocket) {
46
+ const launcher = appContainer.resolve(WebSocketServerLauncher);
47
+ launcher.configure(serverModule);
48
+ launcher.start({ port: options.port, host: options.host, path: 'workflow' });
49
+ } else {
50
+ const launcher = appContainer.resolve(SocketServerLauncher);
51
+ launcher.configure(serverModule);
52
+ launcher.start({ port: options.port, host: options.host });
53
+ }
47
54
  } catch (error) {
48
55
  (logger ?? console).error('Error in workflow server launcher:', error);
49
56
  }
@@ -0,0 +1,29 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2023 EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the Eclipse Public License v. 2.0 which is available at
6
+ * http://www.eclipse.org/legal/epl-2.0.
7
+ *
8
+ * This Source Code may also be made available under the following Secondary
9
+ * Licenses when the conditions for such availability set forth in the Eclipse
10
+ * Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ * with the GNU Classpath Exception which is available at
12
+ * https://www.gnu.org/software/classpath/license.html.
13
+ *
14
+ * SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
+ ********************************************************************************/
16
+
17
+ import { CliParser, createSocketCliParser, defaultSocketLaunchOptions, SocketLaunchOptions } from '@eclipse-glsp/server/node';
18
+
19
+ export interface WorkflowLaunchOptions extends SocketLaunchOptions {
20
+ webSocket: boolean;
21
+ }
22
+
23
+ export function createWorkflowCliParser<O extends WorkflowLaunchOptions = WorkflowLaunchOptions>(
24
+ defaultOptions: WorkflowLaunchOptions = { webSocket: false, ...defaultSocketLaunchOptions }
25
+ ): CliParser<O> {
26
+ const parser = createSocketCliParser<O>(defaultOptions);
27
+ parser.command.option('-w , --webSocket', 'Flag to use websocket launcher instead of default launcher', false);
28
+ return parser;
29
+ }