@eclipse-glsp-examples/workflow-server-bundled 2.7.0 → 2.8.0-next.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eclipse-glsp-examples/workflow-server-bundled",
3
- "version": "2.7.0",
3
+ "version": "2.8.0-next.1+ab013b0",
4
4
  "description": "GLSP node server for the workflow example (bundled)",
5
5
  "keywords": [
6
6
  "eclipse",
@@ -49,5 +49,5 @@
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "009013242e08e679f251b4bb7feceb05314d73b2"
52
+ "gitHead": "ab013b0c1f1fce1734182e324ea9f915d50f92a6"
53
53
  }
@@ -66554,15 +66554,36 @@ let ElkLayoutModule = class ElkLayoutModule extends server_1.GLSPModule {
66554
66554
  }
66555
66555
  bindElkFactory() {
66556
66556
  const { algorithms, defaultLayoutOptions, isWebWorker } = this.options;
66557
- const factory = () => new elk_bundled_1.default({
66558
- algorithms,
66559
- defaultLayoutOptions,
66560
- // The node implementation relies on elkjs' `FakeWorker` to set the `workerFactory`. The required file is
66561
- // dynamically loaded and not available in a web-worker context, so it has to be mocked manually there.
66562
- workerFactory: isWebWorker ? () => ({ postMessage: () => { } }) : undefined
66563
- });
66557
+ const factory = () => this.createElk({ algorithms, defaultLayoutOptions }, isWebWorker);
66564
66558
  return { constantValue: factory };
66565
66559
  }
66560
+ /** Creates the underlying elkjs {@link ELK} instance, see {@link createWebWorkerElk} for the web-worker case. */
66561
+ createElk(options, isWebWorker) {
66562
+ return isWebWorker ? this.createWebWorkerElk(options) : new elk_bundled_1.default(options);
66563
+ }
66564
+ /**
66565
+ * Creates an {@link ELK} instance for a web-worker server. elkjs only exposes its in-process fake worker when it
66566
+ * doesn't detect a dedicated-worker scope (`self` present, `document` absent) — otherwise it hijacks
66567
+ * `self.onmessage` and layout never runs. Briefly presenting a `document` during construction flips elkjs back to
66568
+ * the in-process worker without touching the server's own `self.onmessage` handler.
66569
+ */
66570
+ createWebWorkerElk(options) {
66571
+ const globalScope = globalThis;
66572
+ const hadDocument = 'document' in globalScope;
66573
+ const previousDocument = globalScope.document;
66574
+ globalScope.document = previousDocument !== null && previousDocument !== void 0 ? previousDocument : {};
66575
+ try {
66576
+ return new elk_bundled_1.default(options);
66577
+ }
66578
+ finally {
66579
+ if (hadDocument) {
66580
+ globalScope.document = previousDocument;
66581
+ }
66582
+ else {
66583
+ delete globalScope.document;
66584
+ }
66585
+ }
66586
+ }
66566
66587
  bindGlspElkLayoutEngine() {
66567
66588
  return {
66568
66589
  dynamicValue: ctx => {
@@ -125861,7 +125882,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"name":"winston","description":"A log
125861
125882
  /***/ ((module) => {
125862
125883
 
125863
125884
  "use strict";
125864
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@eclipse-glsp/server-mcp","version":"2.7.0","description":"Model Context Protocol (MCP) server for the GLSP TypeScript server — runs on Node, browser, and Fetch-API runtimes","keywords":["eclipse","graphics","diagram","modeling","visualization","glsp","diagram editor","mcp"],"homepage":"https://www.eclipse.org/glsp/","bugs":"https://github.com/eclipse-glsp/glsp/issues","repository":{"type":"git","url":"https://github.com/eclipse-glsp/glsp-server-node.git"},"license":"(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)","author":{"name":"Eclipse GLSP"},"contributors":[{"name":"Eclipse GLSP Project","email":"glsp-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.glsp"}],"main":"lib/node/index","browser":{"lib/node/index":"./lib/browser/index"},"types":"lib/common/index","files":["lib","src","node.js","node.d.ts","browser.js","browser.d.ts","common.js","common.d.ts"],"scripts":{"build":"tsc -b","clean":"rimraf lib *.tsbuildinfo coverage .nyc_output","generate:index":"glsp generateIndex src/browser src/common src/node -f -s","lint":"eslint --ext .ts,.tsx ./src","test":"mocha --config ../../.mocharc \\"./src/**/*.spec.?(ts|tsx)\\"","test:ci":"yarn test --reporter mocha-ctrf-json-reporter","test:coverage":"nyc yarn test","watch":"tsc -w"},"dependencies":{"@eclipse-glsp/server":"2.7.0","@hono/node-server":"^1.19.9","@modelcontextprotocol/sdk":"^1.29.0"},"peerDependencies":{"inversify":"^6.1.3"},"publishConfig":{"access":"public"},"gitHead":"009013242e08e679f251b4bb7feceb05314d73b2"}');
125885
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@eclipse-glsp/server-mcp","version":"2.8.0-next","description":"Model Context Protocol (MCP) server for the GLSP TypeScript server — runs on Node, browser, and Fetch-API runtimes","keywords":["eclipse","graphics","diagram","modeling","visualization","glsp","diagram editor","mcp"],"homepage":"https://www.eclipse.org/glsp/","bugs":"https://github.com/eclipse-glsp/glsp/issues","repository":{"type":"git","url":"https://github.com/eclipse-glsp/glsp-server-node.git"},"license":"(EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0)","author":{"name":"Eclipse GLSP"},"contributors":[{"name":"Eclipse GLSP Project","email":"glsp-dev@eclipse.org","url":"https://projects.eclipse.org/projects/ecd.glsp"}],"main":"lib/node/index","browser":{"lib/node/index":"./lib/browser/index"},"types":"lib/common/index","files":["lib","src","node.js","node.d.ts","browser.js","browser.d.ts","common.js","common.d.ts"],"scripts":{"build":"tsc -b","clean":"rimraf lib *.tsbuildinfo coverage .nyc_output","generate:index":"glsp generateIndex src/browser src/common src/node -f -s","lint":"eslint --ext .ts,.tsx ./src","test":"mocha --config ../../.mocharc \\"./src/**/*.spec.?(ts|tsx)\\"","test:ci":"yarn test --reporter mocha-ctrf-json-reporter","test:coverage":"nyc yarn test","watch":"tsc -w"},"dependencies":{"@eclipse-glsp/server":"2.8.0-next","@hono/node-server":"^1.19.9","@modelcontextprotocol/sdk":"^1.29.0"},"peerDependencies":{"inversify":"^6.1.3"},"publishConfig":{"access":"public"}}');
125865
125886
 
125866
125887
  /***/ })
125867
125888