https://github.com/strumenta/mpsserver
https://github.com/strumenta/mpsserver
jetbrains-mps
Last synced: 6 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/strumenta/mpsserver
- Owner: Strumenta
- Created: 2019-08-04T15:22:00.000Z (almost 7 years ago)
- Default Branch: mps2020.3
- Last Pushed: 2023-12-07T10:59:46.000Z (over 2 years ago)
- Last Synced: 2024-11-18T05:38:29.520Z (over 1 year ago)
- Topics: jetbrains-mps
- Language: Python
- Homepage:
- Size: 15.3 MB
- Stars: 19
- Watchers: 6
- Forks: 4
- Open Issues: 21
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- mps.rocks - MPSServer - A tool to make MPS accessible remotely. ([Built with MPS](#built-with-mps) / Other projects)
README
# MPSServer
[](https://actions-badge.atrox.dev/Strumenta/MPSServer/goto)
**Please take a look to this tutorial: [https://tomassetti.me/mpsserver-enabling-integration-with-mps/](https://tomassetti.me/mpsserver-enabling-integration-with-mps/)**
**The tutorial explain you what MPSServer can be used for, and how to use it**
This is a solution that starts a server to read and modify MPS models through HTTP and WebSocket.
The server can be started from MPS running normally or in headless mode.
There is also a framework to define web editors interoperable with MPSServer. This framework is called [WebEditKit](https://github.com/Strumenta/webeditkit) and it is open-source.
## License
MPSServer is released under the Apache License V2
## Exposed API
It is possible to use the MPSServer through:
* HTTP calls, [documented here](documentation/routes.md)
* WebSocket messages, [core messages](documentation/ws_core_documentation.html) and [Modelix extensions](documentation/ws_modelix_documentation.html)
## Extensions
It is possible to specify extensions for the MPS Server.
TODO: document how to do that.
## Development
### Testing
The project contains:
* unit tests: written within MPS
* functional tests: written in Python
To run the unit tests inside MPS, first you have to set the path
variable "mpsserver.home" (MPS > Preferences > Appearance & Behavior >
Path Variables) to the full path to the directory MPSServer/mpscode.
Then, you can launch them from the MPS UI (right click > run).
### Release a new version
* Check all tests pass on the CI server (currently using GitHub actions)
* Set the version number in build.gradle
* Add a tag: `git tag -a vVERSION_NAME` (message: "Version VERSION_NAME")
* Ensure the tag is pushed
* Run `./gradlew publish`
* Log into `https://oss.sonatype.org/` to close & release
## Test WebSocket
Open http://localhost:2904/
Open console
Type:
```
ws = new WebSocket("ws://localhost:2904/socket");
ws.onopen = () => {
ws.onmessage = (m)=>console.log("received", m.data);
ws.send(JSON.stringify({type:"GetProjectInfo"}));
}
```
# Troubleshooting
## The WebSocket connection is falling
It could be because of Chrome: https://solace.community/discussion/694/client-websocket-disconnects-when-browser-is-minimized-or-not-in-focus-chrome