@friggframework/core 2.0.0--canary.454.348aedf.0 → 2.0.0--canary.454.d9f69b3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/package.json +21 -8
- package/prisma-mongodb/schema.prisma +4 -2
- package/prisma-postgresql/schema.prisma +4 -2
package/README.md
CHANGED
|
@@ -62,6 +62,34 @@ npm install @friggframework/core
|
|
|
62
62
|
yarn add @friggframework/core
|
|
63
63
|
```
|
|
64
64
|
|
|
65
|
+
### Prisma Support (Optional)
|
|
66
|
+
|
|
67
|
+
`@friggframework/core` supports both MongoDB and PostgreSQL via Prisma ORM. **Prisma is an optional peer dependency** - you only need to install it if you're using database features that require migrations or schema generation.
|
|
68
|
+
|
|
69
|
+
**When you need Prisma:**
|
|
70
|
+
- Running database migrations (`prisma migrate`, `prisma db push`)
|
|
71
|
+
- Generating Prisma clients for your application
|
|
72
|
+
- Using the migration Lambda function (`dbMigrate`)
|
|
73
|
+
|
|
74
|
+
**Installation:**
|
|
75
|
+
```bash
|
|
76
|
+
# Install Prisma CLI and Client as dev dependencies
|
|
77
|
+
npm install --save-dev prisma @prisma/client
|
|
78
|
+
|
|
79
|
+
# Or with yarn
|
|
80
|
+
yarn add -D prisma @prisma/client
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Generate Prisma Clients:**
|
|
84
|
+
```bash
|
|
85
|
+
# From @friggframework/core directory
|
|
86
|
+
npm run prisma:generate:mongo # MongoDB only
|
|
87
|
+
npm run prisma:generate:postgres # PostgreSQL only
|
|
88
|
+
npm run prisma:generate # Both databases
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Note:** The published npm package includes pre-generated Prisma clients, so you don't need to install Prisma just to use `@friggframework/core` in production. Prisma is only required if you're actively developing migrations or running the migration Lambda function.
|
|
92
|
+
|
|
65
93
|
### Prerequisites
|
|
66
94
|
|
|
67
95
|
- Node.js 16+
|
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0--canary.454.
|
|
4
|
+
"version": "2.0.0--canary.454.d9f69b3.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@hapi/boom": "^10.0.1",
|
|
7
|
-
"@prisma/client": "^6.16.3",
|
|
8
7
|
"aws-sdk": "^2.1200.0",
|
|
9
8
|
"bcryptjs": "^2.4.3",
|
|
10
9
|
"body-parser": "^1.20.2",
|
|
@@ -20,14 +19,26 @@
|
|
|
20
19
|
"lodash.get": "^4.4.2",
|
|
21
20
|
"mongoose": "6.11.6",
|
|
22
21
|
"node-fetch": "^2.6.7",
|
|
23
|
-
"prisma": "^6.16.3",
|
|
24
22
|
"serverless-http": "^2.7.0",
|
|
25
23
|
"uuid": "^9.0.1"
|
|
26
24
|
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@prisma/client": "^6.16.3",
|
|
27
|
+
"prisma": "^6.16.3"
|
|
28
|
+
},
|
|
29
|
+
"peerDependenciesMeta": {
|
|
30
|
+
"@prisma/client": {
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
"prisma": {
|
|
34
|
+
"optional": true
|
|
35
|
+
}
|
|
36
|
+
},
|
|
27
37
|
"devDependencies": {
|
|
28
|
-
"@friggframework/eslint-config": "2.0.0--canary.454.
|
|
29
|
-
"@friggframework/prettier-config": "2.0.0--canary.454.
|
|
30
|
-
"@friggframework/test": "2.0.0--canary.454.
|
|
38
|
+
"@friggframework/eslint-config": "2.0.0--canary.454.d9f69b3.0",
|
|
39
|
+
"@friggframework/prettier-config": "2.0.0--canary.454.d9f69b3.0",
|
|
40
|
+
"@friggframework/test": "2.0.0--canary.454.d9f69b3.0",
|
|
41
|
+
"@prisma/client": "^6.16.3",
|
|
31
42
|
"@types/lodash": "4.17.15",
|
|
32
43
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
33
44
|
"chai": "^4.3.6",
|
|
@@ -37,6 +48,7 @@
|
|
|
37
48
|
"eslint-plugin-promise": "^7.0.0",
|
|
38
49
|
"jest": "^29.7.0",
|
|
39
50
|
"prettier": "^2.7.1",
|
|
51
|
+
"prisma": "^6.16.3",
|
|
40
52
|
"sinon": "^16.1.1",
|
|
41
53
|
"typescript": "^5.0.2"
|
|
42
54
|
},
|
|
@@ -47,7 +59,8 @@
|
|
|
47
59
|
"prisma:generate:postgres": "npx prisma generate --schema ./prisma-postgresql/schema.prisma",
|
|
48
60
|
"prisma:generate": "npm run prisma:generate:mongo && npm run prisma:generate:postgres",
|
|
49
61
|
"prisma:push:mongo": "npx prisma db push --schema ./prisma-mongodb/schema.prisma",
|
|
50
|
-
"prisma:migrate:postgres": "npx prisma migrate dev --schema ./prisma-postgresql/schema.prisma"
|
|
62
|
+
"prisma:migrate:postgres": "npx prisma migrate dev --schema ./prisma-postgresql/schema.prisma",
|
|
63
|
+
"prepublishOnly": "npm run prisma:generate"
|
|
51
64
|
},
|
|
52
65
|
"author": "",
|
|
53
66
|
"license": "MIT",
|
|
@@ -64,5 +77,5 @@
|
|
|
64
77
|
"publishConfig": {
|
|
65
78
|
"access": "public"
|
|
66
79
|
},
|
|
67
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "d9f69b3fae85750ace618986d32b3eb1ab0e2e56"
|
|
68
81
|
}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
// Migration from Mongoose ODM to Prisma ORM
|
|
4
4
|
|
|
5
5
|
generator client {
|
|
6
|
-
provider
|
|
7
|
-
output
|
|
6
|
+
provider = "prisma-client-js"
|
|
7
|
+
output = "../node_modules/@prisma-mongodb/client"
|
|
8
|
+
binaryTargets = ["native", "rhel-openssl-3.0.x"] // native for local dev, rhel for Lambda deployment
|
|
9
|
+
engineType = "binary" // Use binary engines (smaller size)
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
datasource db {
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
// Converted from MongoDB schema for relational database support
|
|
4
4
|
|
|
5
5
|
generator client {
|
|
6
|
-
provider
|
|
7
|
-
output
|
|
6
|
+
provider = "prisma-client-js"
|
|
7
|
+
output = "../node_modules/@prisma-postgresql/client"
|
|
8
|
+
binaryTargets = ["native", "rhel-openssl-3.0.x"] // native for local dev, rhel for Lambda deployment
|
|
9
|
+
engineType = "binary" // Use binary engines (smaller size)
|
|
8
10
|
}
|
|
9
11
|
|
|
10
12
|
datasource db {
|