@pkgverse/prismock 2.0.1-beta.2 → 2.0.1-beta.4
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/dist/index.mjs +2 -2
- package/dist/lib/prismock.d.ts +0 -7
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -5254,9 +5254,10 @@ function generateClient(delegates, getData, setData) {
|
|
|
5254
5254
|
};
|
|
5255
5255
|
}
|
|
5256
5256
|
function getPgLitePrismockData(options) {
|
|
5257
|
-
const
|
|
5257
|
+
const rawSql = execSync(`bun prisma migrate diff --from-empty --to-schema-datamodel=${options.schemaPath} --script`, {
|
|
5258
5258
|
encoding: "utf-8"
|
|
5259
5259
|
});
|
|
5260
|
+
const sql = rawSql.replace(/((?:CONSTRAINT\s+"[^"]+"\s+)?FOREIGN KEY\s*\([^)]*\)\s*REFERENCES\s+[^\s(]+\s*\([^)]*\))(?![\s\S]*?\bDEFERRABLE\b)/gi, `$1 DEFERRABLE INITIALLY DEFERRED`);
|
|
5260
5261
|
const connectionPromise = options.adapter.connect();
|
|
5261
5262
|
const reset = async () => {
|
|
5262
5263
|
const connection = await connectionPromise;
|
|
@@ -5396,7 +5397,6 @@ async function getDefaultClientClass() {
|
|
|
5396
5397
|
var createPrismock = getDefaultClient;
|
|
5397
5398
|
|
|
5398
5399
|
// src/lib/prismock.ts
|
|
5399
|
-
var PrismaInternals2 = await import("@prisma/internals");
|
|
5400
5400
|
async function generatePrismock(options = {}) {
|
|
5401
5401
|
const schema = await generateDMMF(options.schemaPath);
|
|
5402
5402
|
return generatePrismockSync({ models: schema.datamodel.models });
|
package/dist/lib/prismock.d.ts
CHANGED
|
@@ -12,13 +12,6 @@ type OptionsSync = {
|
|
|
12
12
|
export type Data = Record<string, Item[]>;
|
|
13
13
|
export type Properties = Record<string, DelegateProperties>;
|
|
14
14
|
export type Delegates = Record<string, Delegate>;
|
|
15
|
-
// export async function fetchGenerator(schemaPath?: string) {
|
|
16
|
-
// const pathToModule = schemaPath ?? require.resolve(path.resolve(process.cwd(), 'prisma/schema.prisma'));
|
|
17
|
-
// const config = await generateConfig(pathToModule);
|
|
18
|
-
// return getGenerator({
|
|
19
|
-
// schemaPath: pathToModule,
|
|
20
|
-
// });
|
|
21
|
-
// }
|
|
22
15
|
export declare function fetchProvider(schemaPath?: string): Promise<string>;
|
|
23
16
|
export declare function getProvider(generator: Generator): import("@prisma/generator").ActiveConnectorType | undefined;
|
|
24
17
|
export declare function generatePrismock<T = PrismaClient>(options?: Options): Promise<PrismockClientType<T>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkgverse/prismock",
|
|
3
|
-
"version": "2.0.1-beta.
|
|
3
|
+
"version": "2.0.1-beta.4",
|
|
4
4
|
"description": "A mock for PrismaClient, dedicated to unit testing.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/JQuezada0/prismock"
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@commitlint/cli": "19.8.1",
|
|
45
45
|
"@commitlint/config-conventional": "19.8.1",
|
|
46
|
-
"@electric-sql/pglite": "0.3.14",
|
|
47
46
|
"@prisma/client": "6.10.0",
|
|
48
47
|
"@semantic-release/changelog": "6.0.3",
|
|
49
48
|
"@semantic-release/commit-analyzer": "13.0.1",
|
|
@@ -73,7 +72,6 @@
|
|
|
73
72
|
"fs-jetpack": "5.1.0",
|
|
74
73
|
"husky": "9.1.7",
|
|
75
74
|
"lint-staged": "16.1.6",
|
|
76
|
-
"pglite-prisma-adapter": "0.6.1",
|
|
77
75
|
"prettier": "2.8.8",
|
|
78
76
|
"prisma": "6.10.0",
|
|
79
77
|
"release-it": "19.0.6",
|
|
@@ -105,6 +103,8 @@
|
|
|
105
103
|
"@paralleldrive/cuid2": "2.2.2",
|
|
106
104
|
"@prisma/generator-helper": "6.10.0",
|
|
107
105
|
"@prisma/internals": "6.10.0",
|
|
106
|
+
"@electric-sql/pglite": "0.3.14",
|
|
107
|
+
"pglite-prisma-adapter": "0.6.1",
|
|
108
108
|
"bson": "6.10.4"
|
|
109
109
|
},
|
|
110
110
|
"peerDependencies": {
|