From: Jérôme Benoit Date: Wed, 14 Feb 2024 21:14:50 +0000 (+0100) Subject: fix(ui): fix configuration handling on the docker image X-Git-Tag: v1.2.37~49 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0d7042e20aa7c9a4019c433b8c05b770b861d2a2;p=e-mobility-charging-stations-simulator.git fix(ui): fix configuration handling on the docker image Signed-off-by: Jérôme Benoit --- diff --git a/docker/Dockerfile b/docker/Dockerfile index 0ffd4bf2..0e13a0dd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -25,6 +25,7 @@ RUN set -ex \ && pnpm set progress=false \ && pnpm config set depth 0 \ && pnpm install --ignore-scripts --frozen-lockfile \ + && cp src/assets/config-template.json public/config.json \ && pnpm build FROM node:lts-alpine diff --git a/ui/web/README.md b/ui/web/README.md index f2c21d13..2d78ce3b 100644 --- a/ui/web/README.md +++ b/ui/web/README.md @@ -39,27 +39,15 @@ Copy the configuration template [src/assets/config-template.json](src/assets/con ### Run -#### Compiles for production - -```shell -pnpm build -``` - -#### Compiles and preview locally for production +#### Compiles for production and preview locally ```shell pnpm preview ``` -#### Compiles and run for production - -```shell -pnpm start -``` - #### Try it out -For both options above you can then follow the link displayed in the terminal at the end of compilation. The Web UI looks like the following +You can now follow the link displayed in the terminal. The Web UI looks like the following: ![webui](./src/assets/webui.png) diff --git a/ui/web/build-prepare.js b/ui/web/build-prepare.js deleted file mode 100644 index 5ac031cf..00000000 --- a/ui/web/build-prepare.js +++ /dev/null @@ -1,3 +0,0 @@ -import shell from 'shelljs' - -shell.cp('src/assets/config-template.ts', 'src/assets/config.ts') diff --git a/ui/web/package.json b/ui/web/package.json index 3d9d373c..7135250a 100644 --- a/ui/web/package.json +++ b/ui/web/package.json @@ -19,10 +19,10 @@ "type": "module", "scripts": { "preinstall": "npx --yes only-allow pnpm", + "build": "vite build", + "preview": "pnpm build && vite preview", "start": "pnpm build && node start.js", "dev": "vite", - "preview": "vite preview", - "build": "vite build", "clean:dist": "npx rimraf dist", "clean:node_modules": "npx rimraf node_modules", "lint": "cross-env TIMING=1 eslint . --cache --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --ignore-path .gitignore", @@ -60,7 +60,6 @@ "jsdom": "^24.0.0", "prettier": "^3.2.5", "rimraf": "^5.0.5", - "shelljs": "^0.8.5", "typescript": "~5.3.3", "vite": "^5.1.2", "vitest": "^1.2.2" diff --git a/ui/web/pnpm-lock.yaml b/ui/web/pnpm-lock.yaml index a07c15aa..d8049601 100644 --- a/ui/web/pnpm-lock.yaml +++ b/ui/web/pnpm-lock.yaml @@ -88,9 +88,6 @@ devDependencies: rimraf: specifier: ^5.0.5 version: 5.0.5 - shelljs: - specifier: ^0.8.5 - version: 0.8.5 typescript: specifier: ~5.3.3 version: 5.3.3 @@ -2770,11 +2767,6 @@ packages: side-channel: 1.0.5 dev: true - /interpret@1.4.0: - resolution: {integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==} - engines: {node: '>= 0.10'} - dev: true - /is-array-buffer@3.0.4: resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} engines: {node: '>= 0.4'} @@ -3508,13 +3500,6 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true - /rechoir@0.6.2: - resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} - engines: {node: '>= 0.10'} - dependencies: - resolve: 1.22.8 - dev: true - /regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} @@ -3708,16 +3693,6 @@ packages: engines: {node: '>=8'} dev: true - /shelljs@0.8.5: - resolution: {integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==} - engines: {node: '>=4'} - hasBin: true - dependencies: - glob: 7.2.3 - interpret: 1.4.0 - rechoir: 0.6.2 - dev: true - /side-channel@1.0.5: resolution: {integrity: sha512-QcgiIWV4WV7qWExbN5llt6frQB/lBven9pqliLXfGPB+K9ZYXxDozp0wLkHS24kWCm+6YXH/f0HhnObZnZOBnQ==} engines: {node: '>= 0.4'}