Skip to content

Commit

Permalink
Fixes build scripts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mup authored and domesticated-raptor committed Sep 20, 2024
1 parent f8c4189 commit 9c34018
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion buildSrc/buildWebapp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9c34018

Please sign in to comment.