Skip to content

Commit

Permalink
Merge pull request #29 from Theodo-UK/build/prisma
Browse files Browse the repository at this point in the history
Build/prisma
  • Loading branch information
juskek committed Aug 23, 2023
2 parents 7b0e0a1 + 6ed3415 commit b89c5a0
Show file tree
Hide file tree
Showing 10 changed files with 405 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/**
4 changes: 4 additions & 0 deletions front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
"start": "next start",
"lint": "next lint",
"test": "jest",
"generate": "yarn prisma generate --generator client_js",
"db-push": "npx prisma db push"
},
"prisma": {
"schema": "../prisma/schema.prisma"
},
"engines": {
"node": ">=18.0.0"
},
Expand Down
63 changes: 63 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"devDependencies": {
"prisma": "^5.1.1"
},
"dependencies": {
"@prisma/client": "^5.1.1"
}
}
8 changes: 7 additions & 1 deletion front/prisma/schema.prisma → prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// schema.prisma

generator client {
generator client_py {
provider = "prisma-client-py"
output = "../sdk-python/.venv/lib/python3.11/site-packages/prisma/"
}

generator client_js {
provider = "prisma-client-js"
binaryTargets = ["native", "linux-arm64-openssl-1.0.x"]
output = "../front/node_modules/.prisma/client/"
}

datasource db {
Expand Down
2 changes: 1 addition & 1 deletion sdk-python/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.venv_*
.venv*
.env
**/*.pyc
.pypirc
Expand Down
12 changes: 10 additions & 2 deletions sdk-python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ Welcome to the OmniLogger Python Package!

## Table of Contents

- [OmniLogger Python Package](#omnilog-python-package)
- [OmniLogger Python Package](#omnilogger-python-package)
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Usage](#usage)
- [Contributing](#contributing)
- [Requirement](#requirement)
- [Managing Dependencies](#managing-dependencies)
- [Running Python Files](#running-python-files)
- [Tip](#tip)
- [Running Tests](#running-tests)
- [Configuring PyPI User](#configuring-pypi-user)
- [Publishing to PyPI](#publishing-to-pypi)
- [Generating prisma types](#generating-prisma-types)

## Introduction

Expand Down Expand Up @@ -131,3 +133,9 @@ poetry config pypi-token.pypi <YOUR_PYPI_TOKEN>
poetry publish
```
tip: Add the --build flag to do both steps at once.

## Generating prisma types
```sh
poetry run prisma generate --schema ../prisma/schema.prisma --generator client_py
```

Loading

0 comments on commit b89c5a0

Please sign in to comment.