From e894e9cf190b1b1dd0dca6e37baee1301310e987 Mon Sep 17 00:00:00 2001 From: Andy Bunce Date: Mon, 25 Aug 2025 10:09:56 +0100 Subject: [PATCH] [mod] lib/custom --- compose.yaml | 4 +- package.json | 4 +- scripts/rex.xq | 1 + position-tests.xqm => test/position-tests.xqm | 6 +-- {bundles/grammar => webapp/custom}/xq4.jar | Bin 105397 -> 105397 bytes webapp/static/clients/codemirror/index.html | 44 ++++++++---------- 6 files changed, 27 insertions(+), 32 deletions(-) rename position-tests.xqm => test/position-tests.xqm (97%) rename {bundles/grammar => webapp/custom}/xq4.jar (98%) diff --git a/compose.yaml b/compose.yaml index 46add6f..ee976c4 100644 --- a/compose.yaml +++ b/compose.yaml @@ -10,12 +10,10 @@ services: volumes: - ./data:/srv/basex/data # - ./webapp/web.xml:/srv/basex/webapp/WEB-INF/web.xml # set websocket options 12.1+ - - ./bundles/grammar/xq4.jar:/srv/basex/lib/custom/xq4.jar + - ./webapp/custom:/srv/basex/lib/custom # jars - ./webapp/lsp:/srv/basex/webapp/lsp - ./webapp/static/clients:/srv/basex/webapp/static/clients - -# - ./jars:/srv/basex/lib/custom # - ./repo:/srv/basex/repo environment: - "SERVER_OPTS= " diff --git a/package.json b/package.json index 253874f..a39d364 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,11 @@ "scripts": { "build": "rollup src/index.js -m true -f iife -o dist/cm6.bundle.js -p node-resolve,tla --output.name cm6", "build-cm": "rollup bundles/src/lsp.js -m true -f iife -o webapp/static/clients/codemirror/lsp.bundle.js -p node-resolve,tla --output.name lsp", + "min-cm": "cd webapp/static/clients/codemirror && npx minify lsp.bundle.js > lsp.bundle.min.js ", + "min": "cd dist && npx minify cm6.bundle.js > cm6.bundle.min.js && npx minify lsp.bundle.js > lsp.bundle.min.js", - "javac":"cd bundles/grammar && javac -cp %BASEX12%\\BaseX.jar -d build xq4.java && cd build && jar cf ../xq4.jar . " + "javac":"cd bundles/grammar && javac -cp %BASEX12%\\BaseX.jar -d build xq4.java && cd build && jar cf ../../../webapp/custom/xq4.jar . " } } diff --git a/scripts/rex.xq b/scripts/rex.xq index efec774..9042a08 100644 --- a/scripts/rex.xq +++ b/scripts/rex.xq @@ -5,6 +5,7 @@ declare function local:resolve($path as xs:string) as xs:string{ file:resolve-path($path,file:base-dir()) }; + declare function local:rex($ebnf,$opts as map(*)) { let $xq:= qform:post-form(map:put($opts,"@input",$ebnf),$REX) diff --git a/position-tests.xqm b/test/position-tests.xqm similarity index 97% rename from position-tests.xqm rename to test/position-tests.xqm index 5d7f952..63ea114 100644 --- a/position-tests.xqm +++ b/test/position-tests.xqm @@ -59,6 +59,6 @@ declare %unit:test function test:apply-change() { 33333333` let $ch:= {"text":`11111111, A22222222, -33333333`}; -pos:apply-change($text,$ch) - \ No newline at end of file +33333333`} +return pos:apply-change($text,$ch) +}; \ No newline at end of file diff --git a/bundles/grammar/xq4.jar b/webapp/custom/xq4.jar similarity index 98% rename from bundles/grammar/xq4.jar rename to webapp/custom/xq4.jar index a6a80170b673f018850985f2aa6a0b26c724bb89..9bb356d1456967e30b8f96e6e800eb9e664cfb66 100644 GIT binary patch delta 285 zcmdnGoo(xOHr@blW)=|!4h{~6O+Jznd99d1l-D&7wON^Q5hIv!f{B9(%(%?5j}^?A z!j;JaVr=5~hA8n9h=ed!37&zdtrU@9hNu<)0b%q@?}DiDkv#=rNXpBAjcK+}-fp4H z=u!;QFui^nqXn3;YZ~JgFr#ofqZ>qII%5c!Avl9E2+T;E!59i=?3=+D31&#mWDEo| q@@6syfEfp8G6sVg;qII%5c!Avl9E2+T;E!59i=?3=+D31&#mWDEo| q@@6syfEfp8G6sVg; diff --git a/webapp/static/clients/codemirror/index.html b/webapp/static/clients/codemirror/index.html index 8a633c7..0acc286 100644 --- a/webapp/static/clients/codemirror/index.html +++ b/webapp/static/clients/codemirror/index.html @@ -17,33 +17,27 @@
XQuery 4.0 LSP client - - -
- -
- - -
- + + +
@@ -130,7 +124,7 @@
- +