mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 09:50:18 -05:00
* 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>
21 lines
498 B
Bash
Executable File
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 |