From: Jérôme Benoit Date: Wed, 14 Feb 2024 17:11:45 +0000 (+0100) Subject: fix(ci): fix web ui build X-Git-Tag: v1.2.37~53 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=bb29949603108e1bc169ffbad4bc76d2d126dc9d;p=e-mobility-charging-stations-simulator.git fix(ci): fix web ui build Signed-off-by: Jérôme Benoit --- diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48e5cfb9..16d73816 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,9 @@ jobs: if: ${{ matrix.os == 'ubuntu-latest' && matrix.node == '20.x' }} run: pnpm lint - name: pnpm build - run: pnpm build + run: | + pnpm build:prepare + pnpm build - name: pnpm test run: pnpm test - name: pnpm coverage diff --git a/docker/Dockerfile b/docker/Dockerfile index 0ffd4bf2..24881891 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 \ + && pnpm build:prepare \ && pnpm build FROM node:lts-alpine diff --git a/ui/web/build-prepare.js b/ui/web/build-prepare.js new file mode 100644 index 00000000..8dc7df94 --- /dev/null +++ b/ui/web/build-prepare.js @@ -0,0 +1,3 @@ +import { cp } from 'shelljs' + +cp('src/assets/config-template.ts', 'src/assets/config.ts') diff --git a/ui/web/package.json b/ui/web/package.json index 97643fc2..1aa9b956 100644 --- a/ui/web/package.json +++ b/ui/web/package.json @@ -22,6 +22,7 @@ "start": "pnpm build && node start.js", "dev": "vite", "serve": "vite preview", + "build:prepare": "node build-prepare.js", "build": "vite build", "clean:dist": "npx rimraf dist", "clean:node_modules": "npx rimraf node_modules", @@ -60,6 +61,7 @@ "jsdom": "^24.0.0", "prettier": "^3.2.5", "rimraf": "^5.0.5", + "shelljs": "^0.8.5", "typescript": "~5.3.3", "vite": "^5.1.1", "vitest": "^1.2.2" diff --git a/ui/web/pnpm-lock.yaml b/ui/web/pnpm-lock.yaml index bb0ed245..48d404d5 100644 --- a/ui/web/pnpm-lock.yaml +++ b/ui/web/pnpm-lock.yaml @@ -88,6 +88,9 @@ 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 @@ -2767,6 +2770,11 @@ 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'} @@ -3500,6 +3508,13 @@ 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'} @@ -3693,6 +3708,16 @@ 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'}