Skip to content

Commit

Permalink
Merge branch 'main' of github.com:Zli-UoA/zoo-backend into story/#21
Browse files Browse the repository at this point in the history
  • Loading branch information
noharu36 authored and noharu36 committed Sep 10, 2024
2 parents b0b77af + adfd505 commit c9aa306
Show file tree
Hide file tree
Showing 12 changed files with 6,622 additions and 1,043 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.direnv/
.env

.idea/
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
.PHONY: migrate generate-entities
.PHONY: migrate generate-entities db-up db-down db-restart db-reset

migrate:
$(MAKE) -C backend migrate

generate-entities:
$(MAKE) -C backend generate-entities

db-up:
$(MAKE) -C infra db-up

db-down:
$(MAKE) -C infra db-down

db-restart:
$(MAKE) -C infra db-restart

db-reset:
$(MAKE) -C infra db-reset
File renamed without changes.
1 change: 0 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/target
.env
6 changes: 3 additions & 3 deletions backend/db-schema/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include .env
export $(shell sed 's/=.*//' .env)
include ../.env
export $(shell sed 's/=.*//' ../.env)

migrate:
set -a && source .env && set +a && \
set -a && source ../.env && set +a && \
npx prisma migrate dev --skip-generate

generate-entities:
Expand Down
13 changes: 12 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,21 @@
name = "rust-env";
nativeBuildInputs = with pkgs; [
toolchain
gcc
gnumake
nodejs_22
nodePackages.prisma
openssl
prisma-engines
];
shellHook = with pkgs; ''
export PRISMA_SCHEMA_ENGINE_BINARY="${prisma-engines}/bin/schema-engine"
export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine"
export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node"
export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/introspection-engine"
export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt"
'';
};
}
);
}
}
4 changes: 4 additions & 0 deletions frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ dist-ssr
*.njsproj
*.sln
*.sw?

# graphql-codegen

src/generated
1 change: 1 addition & 0 deletions frontend/biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
},
"linter": {
"enabled": true,
"ignore": ["src/generated/*"],
"rules": {
"recommended": true,
"correctness": {
Expand Down
22 changes: 22 additions & 0 deletions frontend/codegen.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import type { CodegenConfig } from "@graphql-codegen/cli";

const config: CodegenConfig = {
schema: "https://zoo-backend.zli.works/",
documents: ["src/**/*.tsx"],
ignoreNoDocuments: true, // for better experience with the watcher
generates: {
"./src/generated/": {
preset: "client",
config: {
strictScalars: true,
scalars: {},
nonOptionalTypename: true,
},
},
},
hooks: {
afterAllFileWrite: ["biome format --write"],
},
};

export default config;
Loading

0 comments on commit c9aa306

Please sign in to comment.