From 644abf070a9ff31f629ef9d034ad1cdc0d4eefe4 Mon Sep 17 00:00:00 2001 From: Deven Navani Date: Wed, 17 Jan 2024 15:16:00 -0800 Subject: [PATCH] Add Makefile --- Makefile | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4e128a4 --- /dev/null +++ b/Makefile @@ -0,0 +1,43 @@ +######################## +#### Python targets #### +######################## + +install_pipx: + brew install pipx + pipx ensurepath + +install_poetry: + pipx install --suffix=@1.7.1 poetry==1.7.1 + +## This can be run outside of the Python virtual environment ## +py_reqs: # Install Python requirements (enter shell via "poetry@1.7.1 shell") + ( \ + cd backend && \ + poetry@1.7.1 install --no-root \ + ) + +######################## +#### NodeJS targets #### +######################## + +create_nenv: # Create Node virtual environment (enter via ". env/bin/activate") + ( \ + cd frontend && \ + nodeenv env --node=20.11.0 \ + ) + +######################## +#### GraphQL targets ### +######################## + +## Run this target inside the Python virtual environment ## +graphql-schema: ## Codegen GraphQL schema + mkdir -p frontend/src/graphql/__generated__ + strawberry export-schema backend.graphql.schema:schema > frontend/src/graphql/__generated__/schema.graphql + +## Run this target inside the Node virtual environment ## +graphql-client: ## Codegen client GraphQL types + ( \ + cd frontend && \ + npm run graphql-codegen \ + )