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: 0 additions & 11 deletions .eslintignore

This file was deleted.

24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ report.xml
wf-glsp-server-node.js
wf-glsp-server-node.js.map
wf-glsp-server-webworker.js
wf-glsp-server-webworker.js.map
wf-glsp-server-webworker.js.map

.claude/settings.local.json
CLAUDE.local.md
.claude/plans/
.reviews/
47 changes: 47 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Repository Guidelines

## Project Structure & Module Organization

This repository is a Yarn workspace monorepo for the GLSP Node server stack.

- `packages/server`: core framework (`src/common`, `src/node`, `src/browser`).
- `packages/graph`: TypeScript GModel types and utilities.
- `packages/layout-elk`: ELK-based layout integration.
- `examples/workflow-server` and `examples/workflow-server-bundled`: runnable example server and bundling setup.
- Root config files (`tsconfig.json`, `eslint.config.mjs`, `.mocharc`, `.nycrc`) define shared standards across packages.

## Build, Test, and Development Commands

Run from repository root unless noted.

- `yarn`: install dependencies and trigger prepare build.
- `yarn build`: compile TypeScript and bundle the workflow example.
- `yarn lint`: run ESLint across the repo.
- `yarn test`: run package tests via Lerna (`--no-bail`).
- `yarn test:coverage`: run coverage per package (nyc).
- `yarn format` / `yarn format:check`: apply/check Prettier formatting.
- `yarn check:all`: full CI-style validation (lint, test, format, header checks).
- `yarn start` or `yarn start:websocket`: launch bundled workflow example server.

## Coding Style & Naming Conventions

- Language: TypeScript (`Node >= 20`, Yarn 1.x).
- Formatting and linting are enforced by `@eclipse-glsp/prettier-config` and `@eclipse-glsp/eslint-config`.
- Use 4-space indentation and existing import ordering patterns.
- Prefer descriptive kebab-case filenames; tests use `*.spec.ts`.
- Keep public API barrel exports current (use `yarn generate:index` when needed).

## Testing Guidelines

- Framework: Mocha with shared config from `.mocharc`.
- Place tests next to source files using `*.spec.ts` naming.
- Run all tests: `yarn test`; package-only tests: `yarn --cwd packages/server test`.
- Validate coverage with `yarn test:coverage` before opening larger changes.

## Commit & Pull Request Guidelines

- Open or reference an umbrella issue in `https://github.com/eclipse-glsp/glsp` before implementation.
- Branch naming convention: `issues/<issue_number>` (for example, `issues/241`).
- Commit messages should be imperative and include issue linkage with an absolute URL, e.g. `closes https://github.com/eclipse-glsp/glsp/issues/241`.
- PRs should include: problem statement, scope, test evidence (`yarn test`, `yarn lint`), and screenshots/logs for behavior changes.
- Ensure ECA requirements are met before requesting merge.
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# GLSP Server [![Build Status](https://img.shields.io/github/actions/workflow/status/eclipse-glsp/glsp-server-node/ci.yml?branch=main&label=build)](https://github.com/eclipse-glsp/glsp-server-node/actions/workflows/ci.yml)

Contains the code for the Typescript-based framework to create [GLSP](https://github.com/eclipse-glsp/glsp) server components.
The implementation of this server is aligned with the default Java based [GLSP Server](https://github.com/eclipse-glsp/glsp-server-node).

Expand Down
46 changes: 46 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import glspConfig from '@eclipse-glsp/eslint-config';

export default [
...glspConfig,
// Ignore JS config/build files that are not part of the TS project
{
ignores: ['**/*.js', '**/*.mjs', '**/*.cjs']
},
// Apply parserOptions.project only to TypeScript files
{
files: ['**/*.{ts,tsx}'],
languageOptions: {
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: import.meta.dirname
}
}
},
// Repository-specific rule overrides
{
files: ['**/*.{ts,tsx}'],
rules: {
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/padding-line-between-statements': 'off',
'no-restricted-imports': [
'warn',
{
name: 'sprotty-protocol',
message:
"The sprotty-protocol default exports are customized and reexported by GLSP. Please import from '@eclipse-glsp/protocol' instead"
},
'.',
'..',
'../..'
]
}
},
// Test file overrides
{
files: ['**/*.spec.{ts,tsx}'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'import-x/namespace': 'off'
}
}
];
2 changes: 1 addition & 1 deletion examples/workflow-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"bundle:browser": "webpack --env target=webworker ",
"clean": "rimraf lib *.tsbuildinfo",
"generate:index": "glsp generateIndex src/browser src/common src/node -s -f",
"lint": "eslint --ext .ts,.tsx ./src",
"lint": "eslint ./src",
"watch": "tsc -w",
"watch:bundle": "webpack -w"
},
Expand Down
3 changes: 1 addition & 2 deletions examples/workflow-server/src/common/util/model-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2023 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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,6 @@
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
********************************************************************************/
/* eslint-disable @typescript-eslint/padding-line-between-statements */
export namespace ModelTypes {
export const LABEL_HEADING = 'label:heading';
export const LABEL_TEXT = 'label:text';
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"all": "yarn install && yarn lint && yarn test",
"build": "yarn compile && yarn bundle",
"bundle": "yarn --cwd examples/workflow-server bundle",
"check:headers": "glsp checkHeaders . -t lastCommit",
"check:pr": "yarn all && yarn format:check && yarn check:headers",
"check:all": "yarn install && yarn lint && yarn test && yarn format:check && yarn headers:check",
"clean": "lerna run clean && rimraf coverage .nyc_output",
"compile": "tsc -b",
"fix:all": "yarn lint:fix && yarn format && yarn headers:fix",
"format": "prettier --write .",
"format:check": "prettier --check .",
"generate:index": "lerna run generate:index && yarn lint:fix",
"lint": "eslint --ext .ts,.tsx .",
"headers:check": "glsp checkHeaders .",
"headers:fix": "glsp checkHeaders . --autoFix",
"lint": "eslint .",
"lint:ci": "yarn lint --output-file eslint_report.json --format json",
"lint:fix": "yarn lint --fix",
"prepare": " yarn compile && yarn bundle",
Expand Down
2 changes: 1 addition & 1 deletion packages/graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"build": "tsc -b",
"clean": "rimraf lib *.tsbuildinfo coverage .nyc_output",
"generate:index": "glsp generateIndex src -f -s",
"lint": "eslint --ext .ts,.tsx ./src",
"lint": "eslint ./src",
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
"test:ci": "yarn test --reporter mocha-ctrf-json-reporter",
"test:coverage": "nyc yarn test",
Expand Down
2 changes: 1 addition & 1 deletion packages/layout-elk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"build": "tsc -b",
"clean": "rimraf lib *.tsbuildinfo coverage .nyc_output",
"generate:index": "glsp generateIndex src -f -s",
"lint": "eslint --ext .ts,.tsx ./src",
"lint": "eslint ./src",
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
"test:ci": "yarn test --reporter mocha-ctrf-json-reporter",
"test:coverage": "nyc yarn test",
Expand Down
2 changes: 1 addition & 1 deletion packages/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"build": "tsc -b",
"clean": "rimraf lib *.tsbuildinfo coverage .nyc_output",
"generate:index": "glsp generateIndex src/browser src/common src/node -s -f",
"lint": "eslint --ext .ts,.tsx ./src",
"lint": "eslint ./src",
"test": "mocha --config ../../.mocharc \"./src/**/*.spec.?(ts|tsx)\"",
"test:ci": "yarn test --reporter mocha-ctrf-json-reporter",
"test:coverage": "nyc yarn test:ci",
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/common/actions/global-action-provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2023 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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 Down Expand Up @@ -51,7 +51,7 @@ export class DefaultGlobalActionProvider implements GlobalActionProvider {
const container = serverContainer.createChild();
const clientSessionModule = createClientSessionModule({
clientId: 'tempId',
// eslint-disable-next-line @typescript-eslint/no-empty-function

glspClient: { process: () => {} },
clientActionKinds: []
});
Expand Down
3 changes: 1 addition & 2 deletions packages/server/src/common/command/recording-command.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2023-2024 EclipseSource and others.
* Copyright (c) 2023-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 Down Expand Up @@ -53,7 +53,6 @@ describe('RecordingCommand', () => {
});

it('should be undoable after execution', async () => {
// eslint-disable-next-line @typescript-eslint/no-empty-function
const command = new TestRecordingCommand(jsonObject, () => {});
expect(command.canUndo()).to.be.false;
await command.execute();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2023 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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 Down Expand Up @@ -44,7 +44,7 @@ export class RequestClipboardDataActionHandler implements ActionHandler {
selectedElements.forEach(element => {
schemas.push(this.modelSerializer.createSchema(element));
});
// eslint-disable-next-line no-null/no-null

clipboardData['application/json'] = JSON.stringify(schemas, undefined, 2);
return [SetClipboardDataAction.create(clipboardData)];
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2023 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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 @@ -15,11 +15,11 @@
********************************************************************************/
import { GModelElement } from '@eclipse-glsp/graph';
import { Args, LabeledAction, Point } from '@eclipse-glsp/protocol';
import { expect } from 'chai';
import { CommandPaletteActionProvider } from './command-palette-action-provider';
import { ContextActionsProvider } from './context-actions-provider';
import { ContextActionsProviderRegistry } from './context-actions-provider-registry';
import { DefaultToolPaletteItemProvider } from './tool-palette-item-provider';
import { expect } from 'chai';

describe('Test DefaultContextActionsProviderRegistry', () => {
it('check if default registry is empty', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2023 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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 Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2024 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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 Down
3 changes: 1 addition & 2 deletions packages/server/src/common/protocol/glsp-server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2023 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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 Down Expand Up @@ -68,7 +68,6 @@ export class DefaultGLSPServer implements GLSPServer {
protected validateProtocolVersion(params: InitializeParameters): void {
if (params.protocolVersion !== DefaultGLSPServer.PROTOCOL_VERSION) {
throw new Error(
// eslint-disable-next-line max-len
`Protocol version mismatch! The client protocol version ${params.protocolVersion} is not compatible with the server protocol version ${DefaultGLSPServer.PROTOCOL_VERSION}!`
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/server/src/common/test/mock-util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2022-2024 STMicroelectronics and others.
* Copyright (c) 2022-2026 STMicroelectronics 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
********************************************************************************/
/* eslint-disable @typescript-eslint/no-empty-function */

// Stub-implementation classes used for unit testing

import { GEdge, GModelElement, GModelElementConstructor, GNode } from '@eclipse-glsp/graph';
Expand Down
Loading