From 9c3401800eeadbb85bc22bc21e9f3a01e413ae0f Mon Sep 17 00:00:00 2001 From: mup Date: Fri, 20 Sep 2024 11:45:48 +0200 Subject: [PATCH] Fixes build scripts After splitting the worker into two, we forgot to set the correct path for the built worker to worker-bootstrap. Now it gets the correct location depending on which app is being built. It also adds a new test to the github pipeline to ensure that both apps can be built using the rollup and respect the import rules. --- .github/workflows/test.yml | 3 +++ buildSrc/buildWebapp.js | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2be376d50378..4ac86901929b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -92,6 +92,9 @@ jobs: - name: build web app run: | node webapp --disable-minify + - name: build calendar web app + run: | + node webapp --disable-minify --app calendar - name: check for FIXMEs run: | if grep "FIXME\|[fF]ixme" -r src buildSrc test/tests packages/*/lib app-android/app/src app-ios/tutanota/Sources; then diff --git a/buildSrc/buildWebapp.js b/buildSrc/buildWebapp.js index 25a0a0e1d1ca..e7bb0856222b 100644 --- a/buildSrc/buildWebapp.js +++ b/buildSrc/buildWebapp.js @@ -34,6 +34,7 @@ export async function buildWebapp({ version, stage, host, measure, minify, proje const buildDir = isCalendarApp ? "build-calendar-app" : "build" const entryFile = isCalendarApp ? "src/calendar-app/calendar-app.ts" : "src/mail-app/app.ts" const workerFile = isCalendarApp ? "src/calendar-app/workerUtils/worker/calendar-worker.ts" : "src/mail-app/workerUtils/worker/mail-worker.ts" + const builtWorkerFile = isCalendarApp ? "calendar-worker.js" : "mail-worker.js" console.log("Building app", app) @@ -146,7 +147,7 @@ export async function buildWebapp({ version, stage, host, measure, minify, proje await fs.promises.writeFile( `${buildDir}/worker-bootstrap.js`, `importScripts("./polyfill.js") -const importPromise = System.import("./worker.js") +const importPromise = System.import("./${builtWorkerFile}") self.onmessage = function (msg) { importPromise.then(function () { self.onmessage(msg)