Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use postinstall for generating Prisma client #735

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .devcontainer/postCreate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
corepack enable
yarn
yarn build:wasm
yarn prisma:generate
yarn sdks base
6 changes: 2 additions & 4 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
- name: Setup yarn
run: |
corepack enable
yarn --immutable --mode=skip-build
yarn prisma:generate
yarn --immutable
- name: Run ESLint
run: yarn workspaces foreach -Apv -j unlimited run lint
typecheck:
Expand All @@ -39,7 +38,6 @@ jobs:
- name: Setup yarn
run: |
corepack enable
yarn --immutable --mode=skip-build
yarn prisma:generate
yarn --immutable
- name: Run TypeScript
run: yarn workspaces foreach -Apv -j unlimited run typecheck
10 changes: 1 addition & 9 deletions docker/Dockerfile-ci
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ WORKDIR /workdir

# Copy files required for installing dependencies
COPY cache/yarn ./cache/yarn
COPY packages/backend/prisma ./packages/backend/prisma

# Install dependencies
RUN \
Expand All @@ -57,15 +58,6 @@ RUN \
corepack enable && \
yarn workspaces focus -A --production

# Generate Prisma client
COPY packages/backend/prisma ./packages/backend/prisma
RUN \
--mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=.yarnrc.yml,target=.yarnrc.yml \
--mount=type=bind,source=yarn.lock,target=yarn.lock \
--mount=type=bind,source=packages/backend/package.json,target=packages/backend/package.json \
yarn prisma:generate


FROM node:21.2.0-alpine as test
ENV FORCE_COLOR true
Expand Down
3 changes: 2 additions & 1 deletion packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"build:logFormatterConfig": "esbuild src/utils/logFormatterConfig.ts --bundle --minify --platform=node --format=cjs --legal-comments=none --log-override:commonjs-variable-in-esm=silent --outfile=dist/pino-pretty-config.cjs",
"typecheck": "tsc --noEmit --tsBuildInfoFile $HOME/.cache/rating-tracker/backend.tsbuildinfo",
"lint": "eslint --color --cache --cache-location $HOME/.cache/rating-tracker/backend.eslintcache --cache-strategy content --max-warnings 0 --ext .ts src/ test/",
"lint:fix": "yarn lint --fix"
"lint:fix": "yarn lint --fix",
"postinstall": "yarn prisma:generate"
},
"dependencies": {
"@prisma/client": "5.6.0",
Expand Down