Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,7 @@ jobs:
node-version: 22.x
cache: pnpm
- name: Test
run: pnpm test:ci
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@0f299074936c32ccaab5be5230511f6b2b9080aa # v1.0.28
with:
report-path: 'packages/*/ctrf/*.json'
summary-report: true
file-report: true
if: always()
run: pnpm test
lint:
name: Lint
timeout-minutes: 60
Expand Down Expand Up @@ -83,7 +76,7 @@ jobs:
node-version: 22.x
cache: pnpm
- name: Run Coverage Tests
run: pnpm test:coverage:ci
run: pnpm test:coverage
- name: Upload Coverage Report
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@ node_modules/
lib/
artifacts/
coverage/
.nyc_output/

*.log
*.jar

/.metadata/
yarn-error.log

tsconfig.tsbuildinfo
*.tsbuildinfo
eslint.xml
report.xml
**/ctrf

wf-glsp-server-node.js
wf-glsp-server-node.js.map
Expand Down
5 changes: 0 additions & 5 deletions .mocharc

This file was deleted.

3 changes: 0 additions & 3 deletions .nycrc

This file was deleted.

74 changes: 37 additions & 37 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,61 +5,61 @@
"name": "Run current test file",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": ["--config", "${workspaceFolder}/.mocharc", "${relativeFile}"],
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "${relativeFile}"],
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
}
"internalConsoleOptions": "neverOpen"
},
{
"name": "Run server-node tests",
"name": "Run server tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": [
"--config",
"${workspaceFolder}/.mocharc",
"${workspaceFolder}/packages/server/src/**/*.spec.ts"
],
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "packages/server/src"],
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
}
"internalConsoleOptions": "neverOpen"
},
{
"name": "Run server-mcp tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "packages/server-mcp/src"],
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
},
{
"name": "Run graph tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": [
"--config",
"${workspaceFolder}/.mocharc",
"${workspaceFolder}/packages/graph/src/**/*.spec.ts"
],
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "packages/graph/src"],
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
}
"internalConsoleOptions": "neverOpen"
},
{
"name": "Run layout-elk tests",
"type": "node",
"request": "launch",
"program": "${workspaceFolder}/node_modules/.bin/mocha",
"args": [
"--config",
"${workspaceRoot}/.mocharc",
"${workspaceRoot}/packages/layout-elk/src/**/*.spec.ts"
],
"program": "${workspaceFolder}/node_modules/vitest/vitest.mjs",
"args": ["run", "packages/layout-elk/src"],
"autoAttachChildProcesses": true,
"skipFiles": ["<node_internals>/**"],
"smartStep": true,
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"env": {
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
}
"internalConsoleOptions": "neverOpen"
},
{
"type": "node",
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
"build": "pnpm compile && pnpm bundle",
"bundle": "pnpm -C examples/workflow-server bundle",
"check:all": "pnpm build && pnpm lint && pnpm test && pnpm format:check && pnpm headers:check",
"clean": "pnpm -r run clean && rimraf coverage .nyc_output",
"clean": "pnpm -r run clean && rimraf coverage",
"compile": "tsc -b",
"compile:test": "pnpm compile && tsc -b tsconfig.test.json",
"dev": "pnpm -C examples/workflow-server dev",
"dev:ws": "pnpm -C examples/workflow-server dev:ws",
"fix:all": "pnpm lint:fix && pnpm format && pnpm headers:fix",
Expand All @@ -24,16 +25,13 @@
"start": "pnpm -C examples/workflow-server-bundled start",
"start:mcp-demo": "pnpm -C examples/workflow-server build && pnpm -C examples/workflow-server-mcp-demo start",
"start:websocket": "pnpm -C examples/workflow-server-bundled start:websocket",
"test": "pnpm compile && pnpm -r --no-bail test",
"test:ci": "pnpm compile && pnpm -r --no-bail test:ci",
"test:coverage": "pnpm compile && pnpm -r test:coverage",
"test:coverage:ci": "glsp coverageReport",
"test": "pnpm compile:test && vitest run",
"test:coverage": "pnpm test --coverage",
"upgrade:next": "glsp updateNext"
Comment thread
tortmayr marked this conversation as resolved.
},
"devDependencies": {
"@eclipse-glsp/dev": "next",
"@types/node": "22.x",
"mocha-ctrf-json-reporter": "0.0.11",
"typescript": "^5.9.2"
},
"packageManager": "pnpm@11.7.0",
Expand Down
11 changes: 5 additions & 6 deletions packages/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,16 @@
"types": "lib/index",
"files": [
"lib",
"src"
"src",
"!**/*.spec.ts",
"!**/*.spec.tsx"
],
"scripts": {
"build": "tsc -b",
"clean": "rimraf lib *.tsbuildinfo coverage .nyc_output",
"clean": "rimraf lib *.tsbuildinfo coverage",
"generate:index": "glsp generateIndex src -f -s",
"lint": "eslint ./src",
"prepublishOnly": "pnpm build",
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
"test:ci": "pnpm test --reporter mocha-ctrf-json-reporter",
"test:coverage": "nyc pnpm test"
"prepublishOnly": "pnpm build"
},
"dependencies": {
"@eclipse-glsp/protocol": "next"
Expand Down
18 changes: 9 additions & 9 deletions packages/graph/src/galignable.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 EclipseSource and others.
* Copyright (c) 2024-2026 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 @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { DefaultTypes } from '@eclipse-glsp/protocol';
import { expect } from 'chai';
import { describe, expect, it } from 'vitest';
import { GAlignableBuilder, isGAlignable } from './galignable';
import { GLabel, GLabelBuilder } from './glabel';
import { GNode, GNodeBuilder } from './gnode';
Expand All @@ -27,7 +27,7 @@ describe('GAlignable Tests', () => {
.build();

const result = isGAlignable(gLabelElement);
expect(result).to.be.true;
expect(result).toBe(true);
});

it('should return false for a non-GAlignable element', () => {
Expand All @@ -38,37 +38,37 @@ describe('GAlignable Tests', () => {
.build();

const result = isGAlignable(gNodeElement);
expect(result).to.be.false;
expect(result).toBe(false);
});
});

describe('GAlignableBuilder alignment function', () => {
it('should set alignment using a point object', () => {
const builder = new GLabelBuilder(GLabel);
GAlignableBuilder.alignment(builder, { x: 45, y: 90 });
expect(builder['proxy'].alignment).to.deep.equal({ x: 45, y: 90 });
expect(builder['proxy'].alignment).toEqual({ x: 45, y: 90 });
});

it('should set alignment using x and y parameters', () => {
let builder = new GLabelBuilder(GLabel);
GAlignableBuilder.alignment(builder, 8, 16);
expect(builder['proxy'].alignment).to.deep.equal({ x: 8, y: 16 });
expect(builder['proxy'].alignment).toEqual({ x: 8, y: 16 });

builder = new GLabelBuilder(GLabel);
GAlignableBuilder.alignment(builder, 12, 0);
expect(builder['proxy'].alignment).to.deep.equal({ x: 12, y: 0 });
expect(builder['proxy'].alignment).toEqual({ x: 12, y: 0 });
});

it('should set alignment from point object if y is provided too', () => {
const builder = new GLabelBuilder(GLabel);
GAlignableBuilder.alignment(builder, { x: 17, y: 71 }, 15);
expect(builder['proxy'].alignment).to.deep.equal({ x: 17, y: 71 });
expect(builder['proxy'].alignment).toEqual({ x: 17, y: 71 });
});

it('should default y to 0 if y is not provided', () => {
const builder = new GLabelBuilder(GLabel);
GAlignableBuilder.alignment(builder, 77);
expect(builder['proxy'].alignment).to.deep.equal({ x: 77, y: 0 });
expect(builder['proxy'].alignment).toEqual({ x: 77, y: 0 });
});
});
});
28 changes: 14 additions & 14 deletions packages/graph/src/gbounds-aware.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2024 EclipseSource and others.
* Copyright (c) 2024-2026 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 @@ -14,7 +14,7 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
import { DefaultTypes } from '@eclipse-glsp/protocol';
import { expect } from 'chai';
import { describe, expect, it } from 'vitest';
import { GBoundsAwareBuilder, isGBoundsAware } from './gbounds-aware';
import { GEdge, GEdgeBuilder } from './gedge';
import { GNode, GNodeBuilder } from './gnode';
Expand All @@ -30,7 +30,7 @@ describe('GBoundsAware Tests', () => {
.build();

const result = isGBoundsAware(gNodeElement);
expect(result).to.be.true;
expect(result).toBe(true);
});

it('should return false for a non-GBoundsAware element', () => {
Expand All @@ -39,67 +39,67 @@ describe('GBoundsAware Tests', () => {
.build();

const result = isGBoundsAware(gEdgeElement);
expect(result).to.be.false;
expect(result).toBe(false);
});
});

describe('GBoundsAwareBuilder position function', () => {
it('should set position using a point object', () => {
const builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.position(builder, { x: 5, y: 10 });
expect(builder['proxy'].position).to.deep.equal({ x: 5, y: 10 });
expect(builder['proxy'].position).toEqual({ x: 5, y: 10 });
});

it('should set position using x and y parameters', () => {
let builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.position(builder, 5, 10);
expect(builder['proxy'].position).to.deep.equal({ x: 5, y: 10 });
expect(builder['proxy'].position).toEqual({ x: 5, y: 10 });

builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.position(builder, 5, 0);
expect(builder['proxy'].position).to.deep.equal({ x: 5, y: 0 });
expect(builder['proxy'].position).toEqual({ x: 5, y: 0 });
});

it('should set position from point object if y is provided too', () => {
const builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.position(builder, { x: 17, y: 71 }, 15);
expect(builder['proxy'].position).to.deep.equal({ x: 17, y: 71 });
expect(builder['proxy'].position).toEqual({ x: 17, y: 71 });
});

it('should default y to 0 if y is not provided', () => {
const builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.position(builder, 35);
expect(builder['proxy'].position).to.deep.equal({ x: 35, y: 0 });
expect(builder['proxy'].position).toEqual({ x: 35, y: 0 });
});
});

describe('GBoundsAwareBuilder size function', () => {
it('should set size using a dimension object', () => {
const builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.size(builder, { width: 55, height: 15 });
expect(builder['proxy'].size).to.deep.equal({ width: 55, height: 15 });
expect(builder['proxy'].size).toEqual({ width: 55, height: 15 });
});

it('should set size using width and height parameters', () => {
let builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.size(builder, 50, 35);
expect(builder['proxy'].size).to.deep.equal({ width: 50, height: 35 });
expect(builder['proxy'].size).toEqual({ width: 50, height: 35 });

builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.size(builder, 70, 0);
expect(builder['proxy'].size).to.deep.equal({ width: 70, height: 0 });
expect(builder['proxy'].size).toEqual({ width: 70, height: 0 });
});

it('should set size from dimension object if height is provided too', () => {
const builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.size(builder, { width: 11, height: 33 }, 15);
expect(builder['proxy'].size).to.deep.equal({ width: 11, height: 33 });
expect(builder['proxy'].size).toEqual({ width: 11, height: 33 });
});

it('should default height to 0 if height is not provided', () => {
const builder = new GShapeElementBuilder(GNode);
GBoundsAwareBuilder.size(builder, 60);
expect(builder['proxy'].size).to.deep.equal({ width: 60, height: 0 });
expect(builder['proxy'].size).toEqual({ width: 60, height: 0 });
});
});
});
3 changes: 2 additions & 1 deletion packages/graph/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"outDir": "lib",
"composite": true,
"reactNamespace": "JSX",
"types": ["node", "mocha"]
"types": ["node"]
},
"exclude": ["**/*.spec.ts"],
"include": ["src"]
}
Loading