ui build: create requires web/ui/static dir ad hoc

Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
This commit is contained in:
Julius Volz 2024-09-09 18:28:57 +02:00 committed by Jan Fajerski
parent dadad9bd10
commit 785d595855
2 changed files with 8 additions and 6 deletions

3
.gitignore vendored
View file

@ -22,8 +22,7 @@ benchmark.txt
/documentation/examples/remote_storage/example_write_adapter/example_write_adapter /documentation/examples/remote_storage/example_write_adapter/example_write_adapter
npm_licenses.tar.bz2 npm_licenses.tar.bz2
/web/ui/static/react-app /web/ui/static
/web/ui/static/mantine-ui
/vendor /vendor
/.build /.build

View file

@ -21,6 +21,7 @@ then
fi fi
buildOrder=(lezer-promql codemirror-promql) buildOrder=(lezer-promql codemirror-promql)
assetsDir="./static"
function buildModule() { function buildModule() {
for module in "${buildOrder[@]}"; do for module in "${buildOrder[@]}"; do
@ -32,15 +33,17 @@ function buildModule() {
function buildReactApp() { function buildReactApp() {
echo "build react-app" echo "build react-app"
(cd react-app && npm run build) (cd react-app && npm run build)
rm -rf ./static/react-app mkdir -p ${assetsDir}
mv ./react-app/build ./static/react-app rm -rf ${assetsDir}/react-app
mv ./react-app/build ${assetsDir}/react-app
} }
function buildMantineUI() { function buildMantineUI() {
echo "build mantine-ui" echo "build mantine-ui"
npm run build -w @prometheus-io/mantine-ui npm run build -w @prometheus-io/mantine-ui
rm -rf ./static/mantine-ui mkdir -p ${assetsDir}
mv ./mantine-ui/dist ./static/mantine-ui rm -rf ${assetsDir}/mantine-ui
mv ./mantine-ui/dist ${assetsDir}/mantine-ui
} }
for i in "$@"; do for i in "$@"; do