fix(ci): fix web ui build
authorJérôme Benoit <jerome.benoit@sap.com>
Wed, 14 Feb 2024 17:11:45 +0000 (18:11 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Wed, 14 Feb 2024 17:11:45 +0000 (18:11 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.github/workflows/ci.yml
docker/Dockerfile
ui/web/build-prepare.js [new file with mode: 0644]
ui/web/package.json
ui/web/pnpm-lock.yaml

index 48e5cfb9a9de7e94d2fe1950d8f674fce2f63535..16d7381696cd608c351b11ef3fe22c4aff54ff7c 100644 (file)
@@ -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
index 0ffd4bf28ef4d82b5db836008c8f7cc4587c733c..24881891034f75a33a7410811dd2fc54ff0c3d37 100644 (file)
@@ -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 (file)
index 0000000..8dc7df9
--- /dev/null
@@ -0,0 +1,3 @@
+import { cp } from 'shelljs'
+
+cp('src/assets/config-template.ts', 'src/assets/config.ts')
index 97643fc27203b0ad59f811a25be78ae1ce18967d..1aa9b956bfcab1718182cd93e625386bd20b6364 100644 (file)
@@ -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"
index bb0ed24589d2adabab280333ca97c295119cd2fe..48d404d58c22e10f6f4b8e1b0a96210ad4bf58d9 100644 (file)
@@ -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'}