@dismissible/nestjs-postgres-storage 0.0.2-canary.8976e84.0 → 0.0.2-canary.b0d8bfe.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 +108 -10
- package/bin/dismissible-prisma.js +4 -2
- package/package.json +19 -23
- package/prisma/generated/prisma/commonInputTypes.ts +0 -75
- package/prisma/generated/prisma/internal/class.ts +4 -4
- package/prisma/generated/prisma/internal/prismaNamespace.ts +5 -37
- package/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts +1 -19
- package/prisma/generated/prisma/models/DismissibleItem.ts +1 -23
- package/prisma/migrations/20251219094936_init/migration.sql +12 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/schema.prisma +0 -1
- package/prisma.config.mjs +33 -0
- package/src/index.ts +1 -0
- package/src/postgres-storage.adapter.spec.ts +0 -88
- package/src/postgres-storage.adapter.ts +6 -17
- package/src/postgres-storage.module.ts +2 -2
- package/src/prisma-config.spec.ts +93 -0
- package/src/prisma-config.ts +63 -0
- package/src/prisma.service.spec.ts +125 -0
- package/src/prisma.service.ts +11 -1
- package/src/schema-path.spec.ts +22 -0
- package/src/schema-path.ts +3 -3
- package/jest.config.ts +0 -10
- package/project.json +0 -73
- package/tsconfig.json +0 -13
- package/tsconfig.lib.json +0 -14
package/src/schema-path.ts
CHANGED
|
@@ -6,12 +6,12 @@ import { join } from 'path';
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```typescript
|
|
9
|
-
* import {
|
|
9
|
+
* import { getPrismaSchemaPath } from '@dismissible/nestjs-postgres-storage';
|
|
10
10
|
* import { execSync } from 'child_process';
|
|
11
11
|
*
|
|
12
|
-
* execSync(`npx prisma generate --schema=${
|
|
12
|
+
* execSync(`npx prisma generate --schema=${getPrismaSchemaPath()}`);
|
|
13
13
|
* ```
|
|
14
14
|
*/
|
|
15
|
-
export function
|
|
15
|
+
export function getPrismaSchemaPath(): string {
|
|
16
16
|
return join(__dirname, '..', 'prisma', 'schema.prisma');
|
|
17
17
|
}
|
package/jest.config.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
displayName: 'postgres-storage',
|
|
3
|
-
preset: '../../jest.preset.js',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
transform: {
|
|
6
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.json' }],
|
|
7
|
-
},
|
|
8
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
9
|
-
coverageDirectory: '../../coverage/libs/postgres-storage',
|
|
10
|
-
};
|
package/project.json
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "postgres-storage",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "libs/postgres-storage/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"tags": [],
|
|
7
|
-
"targets": {
|
|
8
|
-
"build": {
|
|
9
|
-
"executor": "@nx/js:tsc",
|
|
10
|
-
"outputs": ["{options.outputPath}"],
|
|
11
|
-
"options": {
|
|
12
|
-
"outputPath": "dist/libs/postgres-storage",
|
|
13
|
-
"main": "libs/postgres-storage/src/index.ts",
|
|
14
|
-
"tsConfig": "libs/postgres-storage/tsconfig.lib.json",
|
|
15
|
-
"assets": [
|
|
16
|
-
"libs/postgres-storage/package.json",
|
|
17
|
-
"libs/postgres-storage/README.md",
|
|
18
|
-
{
|
|
19
|
-
"input": "libs/postgres-storage/prisma",
|
|
20
|
-
"glob": "**/*",
|
|
21
|
-
"output": "prisma"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"input": "libs/postgres-storage/bin",
|
|
25
|
-
"glob": "**/*",
|
|
26
|
-
"output": "bin"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"generatePackageJson": true
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"lint": {
|
|
33
|
-
"executor": "@nx/eslint:lint",
|
|
34
|
-
"outputs": ["{options.outputFile}"],
|
|
35
|
-
"options": {
|
|
36
|
-
"lintFilePatterns": ["libs/postgres-storage/**/*.ts"]
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
"test": {
|
|
40
|
-
"executor": "@nx/jest:jest",
|
|
41
|
-
"outputs": ["{workspaceRoot}/coverage/libs/postgres-storage"],
|
|
42
|
-
"options": {
|
|
43
|
-
"jestConfig": "libs/postgres-storage/jest.config.ts",
|
|
44
|
-
"passWithNoTests": true
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"prisma:generate": {
|
|
48
|
-
"executor": "nx:run-commands",
|
|
49
|
-
"options": {
|
|
50
|
-
"command": "npx prisma generate --schema=libs/postgres-storage/prisma/schema.prisma"
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
"prisma:migrate": {
|
|
54
|
-
"executor": "nx:run-commands",
|
|
55
|
-
"options": {
|
|
56
|
-
"command": "npx prisma migrate dev --schema=libs/postgres-storage/prisma/schema.prisma"
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
"prisma:push": {
|
|
60
|
-
"executor": "nx:run-commands",
|
|
61
|
-
"options": {
|
|
62
|
-
"command": "npx prisma db push --schema=libs/postgres-storage/prisma/schema.prisma"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
"npm-publish": {
|
|
66
|
-
"executor": "nx:run-commands",
|
|
67
|
-
"options": {
|
|
68
|
-
"command": "npm publish --access public",
|
|
69
|
-
"cwd": "dist/libs/postgres-storage"
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
package/tsconfig.json
DELETED
package/tsconfig.lib.json
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "../../dist/out-tsc",
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"module": "commonjs",
|
|
7
|
-
"types": ["node"],
|
|
8
|
-
"emitDecoratorMetadata": true,
|
|
9
|
-
"experimentalDecorators": true,
|
|
10
|
-
"target": "ES2021"
|
|
11
|
-
},
|
|
12
|
-
"exclude": ["node_modules", "**/*.spec.ts", "**/*.test.ts"],
|
|
13
|
-
"include": ["src/**/*.ts"]
|
|
14
|
-
}
|