From 3ccde4785b7a28bac7a35cbd61fb3c308f9c33b3 Mon Sep 17 00:00:00 2001 From: Tobias Petrich Date: Mon, 25 Mar 2024 13:28:28 +0100 Subject: [PATCH] add Makefile --- Makefile | 28 ++++++++++++++++++++++++ src/components/molecules/PersonInput.tsx | 3 +-- src/components/molecules/PostenInput.tsx | 10 ++++----- 3 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..253c3bb --- /dev/null +++ b/Makefile @@ -0,0 +1,28 @@ +# Define variables for commands to keep it simple and centralized +NPM := npm +BUILD_DIR := dist + +# Default target executed when no arguments are given to make. +default: build + +# Target for installing dependencies +install_deps: + @echo "Installing project dependencies..." + @$(NPM) install + +# Target for building the project +build: install_deps + @echo "Building the project..." + @$(NPM) run build + @$(MAKE) banner + +# Target for printing a completion banner with colors +banner: + @echo -e "\033[1;36m================================================================================\033[0m" + @echo -e "\033[1;32m BUILD COMPLETED SUCCESSFULLY 🎉\033[0m" + @echo -e "\033[1;33m The $(BUILD_DIR) directory is ready to be served as a webroot.\033[0m" + @echo -e "\033[1;36m================================================================================\033[0m" + + +# Phony targets are not files +.PHONY: install_deps build banner diff --git a/src/components/molecules/PersonInput.tsx b/src/components/molecules/PersonInput.tsx index 110fbfc..5e2842b 100644 --- a/src/components/molecules/PersonInput.tsx +++ b/src/components/molecules/PersonInput.tsx @@ -59,8 +59,7 @@ const PersonInput = ({person, setPerson}: { person: Person, setPerson: any }) => newPerson.setTaxId(event.target.value); setPerson(newPerson); }}/> - { const newPerson = Object.assign(new Person(), person); diff --git a/src/components/molecules/PostenInput.tsx b/src/components/molecules/PostenInput.tsx index 0894573..1870ba3 100644 --- a/src/components/molecules/PostenInput.tsx +++ b/src/components/molecules/PostenInput.tsx @@ -1,12 +1,10 @@ -import {TextField, Typography, Select, SelectChangeEvent, MenuItem, FormControl, Button} from "@mui/material"; +import {TextField, Select, SelectChangeEvent, MenuItem, Button} from "@mui/material"; import {DatePicker} from '@mui/x-date-pickers/DatePicker'; -import DeleteIcon from '@mui/icons-material/Delete'; import DeleteOutlineOutlinedIcon from '@mui/icons-material/DeleteOutlineOutlined'; -import {Sachkonto, sachkontoDescription} from "../../data/Sachkonto.ts"; import Posten from "../../data/Posten.ts"; import Zahlungsart from "../../data/Zahlungsart.ts"; import dayjs from "dayjs"; -import {useEffect, useState} from "react"; +import {useState} from "react"; const styles = { textfield: { @@ -82,7 +80,7 @@ const PostenInput = ({thisPosten, posten, setPosten}: { thisPosten: Posten, post return ( <> - { @@ -110,7 +108,7 @@ const PostenInput = ({thisPosten, posten, setPosten}: { thisPosten: Posten, post }}/>