- Do not rely on shell to glob anymore so it
should be more portable
- Do single tsc invocation with all packages
- Take list of runtime packages from tsconfig instead of duplicating
it in the script
Introduces a new package in order to avoid tutanota-crypto depending
on the whole tutanota-utils. With this package we can have one canonical
CryptoError.
We add another entry point to tutanota-crypto in order to be able to
import only error classes from any chunk.
We've adjusted moduleResolution for tsconfig to support export maps
for our new entry point.
We've updated @rollup/plugin-typescript to add support for export maps.
We have reorganized utils to adjust the chunking. Error utils are now
a part of the main chunk.
We have moved ServiceWorkerClient into the main chunk because we need
to handle the errors and also because it is anyway invoked only after
the other initialization is done.
close#6342
Building packages is a part of most build invocations. Our old approach
during dev builds was to
1. Invoke npm once to run build-packages
2. Invoke npm per each package to run tsc.
Unfortunately, npm is very slow. Additionally, the old approach was
leading to tsc re-checking some packages multiple times because of
dependencies between them. This would only worsen with time.
In our new approach we
1. invoke tsc only once
2. try to avoid invoking npm as much as possible
Unfortunately there is still one case where we invoke npx because we
can't be sure that the location of node_modules/.bin is stable as we
are sometimes used as a package. Without this we could reduce the time
even further.