Skip to content
This repository was archived by the owner on Jul 17, 2022. It is now read-only.

Commit 221eb33

Browse files
feat(prisma-legacy): bring Prisma legacy up-to-date (#78)
* build(typeorm): match target of core package * refactor(prisma-legacy): simplify code * docs(prisma-legacy): add TS declarations * fix(prisma-legacy): add types to package * fix(prisma-legacy): type prisma client param * chore(deps): remove dev dependencies from packages * fix(prisma-legacy): use correct type
1 parent 7f29ab7 commit 221eb33

File tree

8 files changed

+273
-407
lines changed

8 files changed

+273
-407
lines changed

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
"packages/*"
2121
],
2222
"devDependencies": {
23+
"@babel/cli": "^7.13.16",
24+
"@babel/plugin-transform-runtime": "^7.13.15",
25+
"@babel/preset-env": "^7.14.1",
2326
"@typescript-eslint/eslint-plugin": "^4.22.0",
2427
"@typescript-eslint/parser": "^4.22.0",
2528
"eslint": "^7.25.0",

packages/prisma-legacy/.babelrc

-9
This file was deleted.

packages/prisma-legacy/.babelrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// We aim to have the same support as Next.js
2+
// https://nextjs.org/docs/getting-started#system-requirements
3+
// https://nextjs.org/docs/basic-features/supported-browsers-features
4+
5+
module.exports = {
6+
presets: [["@babel/preset-env", { targets: { node: "10.13" } }]],
7+
plugins: ["@babel/plugin-transform-runtime"],
8+
comments: false,
9+
}

packages/prisma-legacy/index.d.ts

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { PrismaClient } from ".prisma/client"
2+
import { Adapter } from "next-auth/adapters"
3+
4+
export type PrismaLegacyAdapter = Adapter<{
5+
prisma: PrismaClient
6+
modelMapping?: {
7+
User: string
8+
Account: string
9+
Session: string
10+
VerificationRequest: string
11+
}
12+
}>
13+
14+
export { PrismaLegacyAdapter as Adapter }

packages/prisma-legacy/package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
},
1616
"main": "dist/index.js",
1717
"files": [
18-
"dist"
18+
"dist",
19+
"index.d.ts"
1920
],
2021
"private": false,
2122
"publishConfig": {
@@ -34,8 +35,7 @@
3435
"@prisma/client": "^2.16.1",
3536
"next-auth": "^3.17.2"
3637
},
37-
"devDependencies": {
38-
"@babel/cli": "^7.13.16",
39-
"@babel/preset-env": "^7.13.15"
38+
"dependencies": {
39+
"@babel/runtime": "^7.14.0"
4040
}
4141
}

0 commit comments

Comments
 (0)