apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.08k stars 643 forks source link

How do you work with jena-fuseki-ui for local development? #2525

Closed OyvindLGjesdal closed 4 weeks ago

OyvindLGjesdal commented 1 month ago

Version

5.1.0-SNAPSHOT (1ddfdf1cca35f0984644ef9b12e4c3ebb8ad4a4d)

Question

I'm not sure how to run jena-fuseki from IntelliJ when doing changes to the jena-fuseki-ui.

What I have, runs a test server locally, but my changes to jena-fuseki-ui doesn't seem to pick up my local changes.

I also didn't see it mentioned in the docs, but thought the fuseki-dev script looked liked it could be what I was looking for:

#from root jena folder
mvn install  -B --file pom.xml -Dmaven.javadoc.skip=true
export FUSEKI_BASE=/Users/oyvind/repos/apache/jena/jena-fuseki2/jena-fuseki-webapp/target/FusekiTest
# in /Users/oyvind/repos/apache/jena/jena-fuseki2/jena-fuseki-webapp
./fuseki-dev

I checked out the documentation for working with eclipse, but it seemed a bit dated, and I didn't manage to get anything running after reading it. Would be grateful for any pointers.

Tested also yarn server fuseki but I thought that the functionality to test would necessarily not be available when running with mocks for part of the functionality.

yarn serve:fuseki
yarn run v1.22.22
$ nodemon src/services/mock/json-server.js
[nodemon] 3.1.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,cjs,json
[nodemon] starting `node src/services/mock/json-server.js`
JSON Server is running
GET /$/ping 200 4.339 ms - 40
GET /$/server 200 0.444 ms - 105
GET /$/stats/test 304 0.794 ms - -
GET / 404 1.494 ms - 2
GET / 404 1.675 ms - 2
kinow commented 4 weeks ago

I normally have IntelliJ with Jena (for Java changes), where I launch FusekiCmd.

image

And I have the jena-fuseki-ui open as a JS project in WebStorm, where I launch yarn run dev.

That starts a proxy at http://localhost:8080/ in yarn + vite, proxying requests to static files to go to the generated dev version of jena-fuseki-ui (i.e. if you modify the files I think it auto-reloads and refreshes the browser via websockets). Requests that are not to static files (e.g. /$/some-fuseki-endpoint) will be proxied to the 0.0.0.0:3030 address by default, which should find the Jena Fuseki executed with FusekiCmd.

serve:fuseki is a fake Fuseki backend with responses saved from a real instance, this is used for prototyping new UI components, and for e2e tests.

This should be documented in jena-fuseki-ui/README.md.

Hope that helps.

OyvindLGjesdal commented 4 weeks ago

Thank you @kinow this is super useful, hope to get to try it out during the weekend.

OyvindLGjesdal commented 4 weeks ago

I have a working dev set up for working with the UI after following your instructions, and managed to debug live, with updates reloading. Thanks again 💯

kinow commented 4 weeks ago

Awesome! Thanks for updating the issue, @OyvindLGjesdal !