Skip to content

A local-first personal finance app

Fix the API (again) (#1002)

Jed Foxd400ebfda0d0
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 28395ac48a..f315aa7ec8 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -23,6 +23,13 @@ jobs:
uses: ./.github/actions/setup
- name: Build API
run: cd packages/api && yarn build
+ - name: Create package tgz
+ run: cd packages/api && yarn pack && mv package.tgz actual-api.tgz
+ - name: Upload Build
+ uses: actions/upload-artifact@v3
+ with:
+ name: actual-api
+ path: packages/api/actual-api.tgz
web:
runs-on: ubuntu-latest
diff --git a/packages/api/package.json b/packages/api/package.json
index f5292426c3..abd2e614e5 100644
--- a/packages/api/package.json
+++ b/packages/api/package.json
@@ -6,15 +6,15 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
- "dist",
- "default-db.sqlite",
- "migrations"
+ "dist"
],
"scripts": {
"lint": "eslint .",
"build:app": "yarn workspace loot-core build:api",
"build:node": "tsc --p tsconfig.dist.json",
- "build": "yarn run build:app && yarn run build:node"
+ "build:migrations": "cp migrations/*.sql dist/migrations",
+ "build:default-db": "cp default-db.sqlite dist/",
+ "build": "rm -rf dist && yarn run build:app && yarn run build:node && yarn run build:migrations && yarn run build:default-db"
},
"dependencies": {
"better-sqlite3": "^8.2.0",
diff --git a/packages/api/tsconfig.dist.json b/packages/api/tsconfig.dist.json
index b8ca13a9ae..81e315be11 100644
--- a/packages/api/tsconfig.dist.json
+++ b/packages/api/tsconfig.dist.json
@@ -1,11 +1,14 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
- "target": "es5",
+ // Using ES2021 because that’s the newest version where
+ // the latest Node 16.x release supports all of the features
+ "target": "es2021",
"module": "CommonJS",
"noEmit": false,
"declaration": true,
"outDir": "dist"
},
- "include": ["."]
+ "include": ["."],
+ "exclude": ["dist"]
}
diff --git a/upcoming-release-notes/1002.md b/upcoming-release-notes/1002.md
new file mode 100644
index 0000000000..23cf6ec44a
--- /dev/null
+++ b/upcoming-release-notes/1002.md
@@ -0,0 +1,6 @@
+---
+category: Maintenance
+authors: [j-f1]
+---
+
+Add missing migrations to the API package