From d400ebfda0d0c1e0cb73c5c2259b18cf2baf94ec Mon Sep 17 00:00:00 2001 From: Jed Fox Date: Tue, 16 May 2023 14:56:24 -0400 Subject: [PATCH] Fix the API (again) (#1002) --- .github/workflows/build.yml | 7 +++++++ packages/api/package.json | 8 ++++---- packages/api/tsconfig.dist.json | 7 +++++-- upcoming-release-notes/1002.md | 6 ++++++ 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 upcoming-release-notes/1002.md 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