@plentidev/cli-linux-x64-musl 0.0.18 → 0.0.19
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/bin/plenti-linux-x64-musl +0 -0
- package/package.json +3 -2
- package/templates/lambda-function-cron/db/schema.prisma +11 -0
- package/templates/lambda-function-cron/package.json +21 -0
- package/templates/lambda-function-cron/prisma.config.ts +8 -0
- package/templates/lambda-function-cron/src/config/env.ts +14 -0
- package/templates/lambda-function-cron/src/index.ts +8 -0
- package/templates/lambda-function-cron/src/infrastructure/database/db.ts +8 -0
- package/templates/lambda-function-cron/tsconfig.json +12 -0
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plentidev/cli-linux-x64-musl",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"description": "Official Plenti CLI (plenti-linux-x64-musl)",
|
|
5
5
|
"os": [
|
|
6
6
|
"linux"
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
"musl"
|
|
13
13
|
],
|
|
14
14
|
"files": [
|
|
15
|
-
"bin"
|
|
15
|
+
"bin",
|
|
16
|
+
"templates"
|
|
16
17
|
],
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{projectName}}",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"postinstall": "bun db:generate",
|
|
7
|
+
"db:generate": "DATABASE_URL=dummy prisma generate",
|
|
8
|
+
"clean": "rm -rf node_modules",
|
|
9
|
+
"typecheck": "tsgo --noEmit"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@prisma/adapter-pg": "^7.7.0",
|
|
13
|
+
"@prisma/client": "^7.7.0"
|
|
14
|
+
},
|
|
15
|
+
"devDependencies": {
|
|
16
|
+
"@types/aws-lambda": "^8.10.0",
|
|
17
|
+
"@typescript/native-preview": "latest",
|
|
18
|
+
"prisma": "^7.7.0",
|
|
19
|
+
"typescript": "^5.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const required = (name: string, value: string | undefined) => {
|
|
2
|
+
if (!value) {
|
|
3
|
+
throw new Error(`Missing required environment variable: ${name}`);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
return value;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export const env = {
|
|
10
|
+
NODE_ENV: (process.env.NODE_ENV || 'development') as
|
|
11
|
+
| 'development'
|
|
12
|
+
| 'production',
|
|
13
|
+
DATABASE_URL: required('DATABASE_URL', process.env.DATABASE_URL),
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PrismaPg } from '@prisma/adapter-pg';
|
|
2
|
+
import { DATABASE_URL } from '../../config/env';
|
|
3
|
+
import { type Prisma, PrismaClient } from '../../generated/prisma/client.js';
|
|
4
|
+
|
|
5
|
+
const adapter = new PrismaPg({ connectionString: DATABASE_URL });
|
|
6
|
+
export const db = new PrismaClient({ adapter });
|
|
7
|
+
|
|
8
|
+
export type Tx = Prisma.TransactionClient;
|