Files
actual-actualbudget-1/packages/loot-core/bin/build-api
DJ Mountney 0045d9212e Bundle loot-core types into the API (#2053)
* Bundle loot-core types into the API

So we can have loot-core be the source of truth
for some types that get passed through

- Improves downstream development with API by including types
- Use path aliases for dist vs dev tsconfigs
- Convert api index to typescript as example
- Permit ts-ignore for issues with our version of typescript

---------

Co-authored-by: Matiss Janis Aboltins <matiss@mja.lv>
2024-01-20 10:30:23 -08:00

21 lines
498 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
cd "$(dirname "$0")/.." || exit 1
ROOT="$(pwd -P)"
yarn tsc -p tsconfig.api.json --outDir ../api/@types/loot-core/
# Copy existing handwritten .d.ts files, as tsc doesn't move them for us
dest="../../api/@types/loot-core"
cd src
find . -type f -name "*.d.ts" | while read -r f
do
d=$(dirname "${f}")
d="${dest}/${d}"
mkdir -p "${d}"
cp "${f}" "${d}"
done
cd "$ROOT"
yarn webpack --config ./webpack/webpack.api.config.js;
./bin/copy-migrations ../api