Improve build pipeline

This commit is contained in:
Alexander Ungar 2023-03-22 00:56:59 +01:00
parent 118f52ab3c
commit 6c5de3d38d
3 changed files with 13 additions and 6 deletions

View file

@ -7,11 +7,14 @@
"type": "module",
"main": "dist/src/index.js",
"scripts": {
"build": "tsc",
"clean": "rimraf dist",
"generate-api-types": "openapi-typescript api/my-finance-pal.yml --output generated/api.ts",
"copy-resources": "copyfiles env/production.env api/* dist/",
"compile": "tsc",
"build": "run-s clean compile generate-api-types copy-resources",
"lint": "eslint --ext .ts src/",
"dev": "nodemon src/server.ts",
"test": "nodemon --config ./spec/nodemon.json",
"generate-api-types": "openapi-typescript api/my-finance-pal.yml --output generated/api.ts"
"test": "nodemon --config ./spec/nodemon.json"
},
"nodemonConfig": {
"execMap": {
@ -43,6 +46,7 @@
"@types/node": "^18.15.0",
"@types/uuid": "^9.0.1",
"@typescript-eslint/eslint-plugin": "^5.54.1",
"copyfiles": "^2.4.1",
"eslint": "^8.36.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-standard-with-typescript": "^34.0.0",
@ -51,7 +55,9 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"nodemon": "^2.0.21",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.4",
"rimraf": "^4.4.0",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.2",
"typescript": "^4.9.5"

View file

@ -1,9 +1,9 @@
import type BudgetRepository from "../budgetRepository.js";
import { BudgetEntityConverter } from "../entity/converters.js";
import { BudgetModel } from "./models.js";
import { BudgetSummaryModel } from "./models.js";
export const findBudgets: BudgetRepository["findAll"] = async () => {
const found = await BudgetModel.find().select("-transactions");
const found = await BudgetSummaryModel.find().select("-transactions");
return found.map(BudgetEntityConverter.toDomain);
};

View file

@ -79,6 +79,7 @@
"include": [
"src/**/*.ts",
"generated/**/*.ts",
"env/*.env"
"env",
"api"
],
}