Skip to content

Commit

Permalink
Update ui dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Nov 20, 2024
1 parent f249f05 commit 1be08ae
Show file tree
Hide file tree
Showing 46 changed files with 3,812 additions and 4,661 deletions.
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
package-lock.json -diff
1 change: 1 addition & 0 deletions .github/scripts/find-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const findNextVersion = (tags, branch) => {
if (version.preRelease == null || version.patch !== 0) {
version.minor += 1;
version.patch = 0;
version.preRelease = null
}
} else {
// It's a patch.
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/secrets.txt

# JetBrains IDE files
/.idea/
.idea/

# Local Docker volumes
/volumes/
Expand Down
2 changes: 1 addition & 1 deletion api/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/bash

SQLX_VERSION=0.8.2
if [[ ! -f ~/.cargo/bin/sqlx ]] || [[ $(sqlx --version) != "sqlx-cli $SQLX_VERSION" ]]; then
Expand Down
17 changes: 9 additions & 8 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ services:
- .env

ui:
image: node:22
image: swissgeol-viewer-app/ui:local
build:
context: ./ui
dockerfile: DockerfileDev
init: true
ports:
- "8000:8000"
environment:
NODE_ENV: development
working_dir: /app
command: ["sh", "-c", "npm ci && npm run start"]
depends_on:
- api
- abbreviator
volumes:
- ./ui:/app
- ui.node_modules:/app/node_modules
- ./:/app
- ui.node_modules:/app/ui/node_modules
tmpfs:
- /app/ui/dist

minio:
image: minio/minio:latest
Expand Down Expand Up @@ -84,4 +85,4 @@ volumes:
db:
api.cargo:
api.target:
ui.node_modules:
ui.node_modules:
2 changes: 2 additions & 0 deletions ui/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
/dist/
8 changes: 6 additions & 2 deletions ui/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"spec": "src/test/**/*.ts",
"spec": "src/test/**/*.test.ts",
"extension": ["ts", "js"],
"loader": "ts-node/esm"
"require": [
"ts-node/register/transpile-only",
"jsdom-global/register.js",
"./src/test/jquery.register.js"
]
}
13 changes: 13 additions & 0 deletions ui/DockerfileDev
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:22-alpine as build

ENV NODE_ENV=development

RUN apk add --no-cache git bash

WORKDIR /app/ui
COPY . .

EXPOSE 8000

ENTRYPOINT ["/bin/bash"]
CMD ["start.sh"]
16 changes: 4 additions & 12 deletions ui/index.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE html>
<html>
<html lang="de">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/png" href="src/images/swissgeol_favicon_viewer_small.png">

<link href="bundle.css" rel="stylesheet">

<meta name="description" content="swissgeol.ch is the 3D subsurface viewer of the Swiss Confederation. Geoscientific information below the terrain of Switzerland can be combined with geographic information above terrain.">
<title>swissgeol</title>

<link href="index.css" rel="stylesheet">
<script>window.activeEnvironment="default_active_env"</script>
</head>

Expand All @@ -34,15 +34,7 @@
document.querySelector('#outdated-browser').style.display = '';
document.querySelector('#loader').style.display = 'none';
</script>
<script type="module">
const debug = !location.search.includes('prod') && (location.search.includes('debug') || location.hostname === 'localhost');
const script = document.querySelector('#app-script');
const l = document.location;
const li = l.pathname.lastIndexOf('/');
const path = li != -1 ? l.pathname.substring(0, li) : l.pathname;
script.src = `${l.origin}${path}/${debug ? 'debug/index.js' : 'index.js'}`;
</script>
<script type="module" id="app-script" crossorigin="use-credentials"></script>
<script type="module" id="app-script" crossorigin="use-credentials" src="index.js"></script>
</body>

</html>
Loading

0 comments on commit 1be08ae

Please sign in to comment.