Skip to content

Commit

Permalink
Fix import for prisma client
Browse files Browse the repository at this point in the history
- use pnpm in github actions
  • Loading branch information
tnagorra committed Apr 15, 2024
1 parent f2cba70 commit 7e30229
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/test-backend-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- uses: bahmutov/npm-install@v1
- uses: pnpm/action-setup@v3
with:
useLockFile: false
version: 8
run_install: |
- recursive: true
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Create test private key for signing alerts
run: ssh-keygen -m PKCS8 -t ecdsa -f $(pwd)/test-key
Expand All @@ -24,7 +27,7 @@ jobs:
run: docker-compose -f docker-compose-test-api.yml up -d

- name: Run backend API tests
run: npm run test:api
run: pnpm run test:api
env:
BASE_URL: http://example.com
VERIFIER_EMAIL: [email protected]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.json') }}-
- name: Build frontend
run: npm run build
run: pnpm run build
env:
NODE_ENV: test

- name: Run end-to-end tests
run: |
# Run Next.js frontend in background
npm run start &
npm run test:e2e
pnpm run start &
pnpm run test:e2e
env:
NODE_ENV: test
PRIVATE_KEY_FILENAME: test-key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
args: [--frozen-lockfile, --strict-peer-dependencies]
- name: Run frontend component tests
run: npm run test:frontend
run: pnpm run test:frontend

- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion lib/prisma.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PrismaClient } from ".prisma/client";
import { PrismaClient } from "@prisma/client";

declare global {
var prisma: PrismaClient | undefined;
Expand Down
2 changes: 1 addition & 1 deletion lib/xml/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Alert } from ".prisma/client";
import { Alert } from "@prisma/client";
import { Capgen } from "capgen";
import { XMLBuilder } from "fast-xml-parser";

Expand Down
2 changes: 1 addition & 1 deletion lib/xml/sign.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { webcrypto } from "node:crypto";
import { Application, Parse, SignedXml } from "xmldsigjs";

import { Alert } from ".prisma/client";
import { Alert } from "@prisma/client";
import { getPrivateKey } from "../crypto";
import { formatAlertAsXML } from "./helpers";
import { CAPV12JSONSchema } from "../types/cap.schema";
Expand Down
2 changes: 1 addition & 1 deletion pages/api/user/alertingAuthorities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlertingAuthority } from ".prisma/client";
import { AlertingAuthority } from "@prisma/client";
import { randomBytes, randomUUID } from "crypto";
import type { NextApiRequest, NextApiResponse } from "next";
import { getServerSession } from "next-auth";
Expand Down

0 comments on commit 7e30229

Please sign in to comment.