@pkgverse/prismock 2.0.2-beta.0 → 2.0.3

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.
@@ -4875,12 +4875,18 @@ function generateDelegate(model, data, name, properties, delegates, onChange) {
4875
4875
 
4876
4876
  // src/lib/dmmf.ts
4877
4877
  import * as path from "path";
4878
- var PrismaInternals = await import("@prisma/internals");
4879
- var { getDMMF, getSchemaWithPath, getConfig } = PrismaInternals.default;
4880
4878
  async function generateDMMF(schemaPath) {
4881
4879
  const pathToModule = schemaPath ?? __require.resolve(path.resolve(process.cwd(), "prisma/schema.prisma"));
4882
- const datamodel = await getSchemaWithPath(pathToModule);
4883
- return await getDMMF({ datamodel: datamodel.schemas });
4880
+ return await (async () => {
4881
+ if (false) {}
4882
+ const { getSchemaWithPath: getSchemaWithPathV7, getDMMF: getDMMFV7 } = await import("@prisma/internals-v7");
4883
+ const schema = await getSchemaWithPathV7({
4884
+ schemaPath: {
4885
+ configProvidedPath: pathToModule
4886
+ }
4887
+ });
4888
+ return await getDMMFV7({ datamodel: schema.schemas });
4889
+ })();
4884
4890
  }
4885
4891
 
4886
4892
  // src/lib/prismock.ts
@@ -5352,7 +5358,8 @@ async function getClient(options) {
5352
5358
  });
5353
5359
  const adapter = new PrismaPGlite(pglite);
5354
5360
  const prisma2 = new options.prismaClient({
5355
- adapter
5361
+ adapter,
5362
+ ...options.clientOptions
5356
5363
  });
5357
5364
  const prismockData = getPgLitePrismockData({
5358
5365
  schemaPath: options.schemaPath,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkgverse/prismock",
3
- "version": "2.0.2-beta.0",
3
+ "version": "2.0.3",
4
4
  "description": "An in-memory implementation of PrismaClient, dedicated to unit testing.",
5
5
  "repository": {
6
6
  "url": "https://github.com/JQuezada0/prismock"
@@ -9,15 +9,27 @@
9
9
  "license": "MIT",
10
10
  "packageManager": "bun@1.2.16",
11
11
  "type": "module",
12
- "main": "./dist/index.cjs",
12
+ "main": "./dist/v6/index.cjs",
13
13
  "types": "./dist/index.d.ts",
14
- "module": "./dist/index.mjs",
14
+ "module": "./dist/v6/index.mjs",
15
15
  "exports": {
16
16
  ".": {
17
17
  "types": "./dist/index.d.ts",
18
- "import": "./dist/index.mjs",
19
- "require": "./dist/index.cjs",
20
- "default": "./dist/index.mjs"
18
+ "import": "./dist/v6/index.mjs",
19
+ "require": "./dist/v6/index.cjs",
20
+ "default": "./dist/v6/index.mjs"
21
+ },
22
+ "./v6": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/v6/index.mjs",
25
+ "require": "./dist/v6/index.cjs",
26
+ "default": "./dist/v6/index.mjs"
27
+ },
28
+ "./v7": {
29
+ "types": "./dist/index.d.ts",
30
+ "import": "./dist/v7/index.mjs",
31
+ "require": "./dist/v7/index.cjs",
32
+ "default": "./dist/v7/index.mjs"
21
33
  }
22
34
  },
23
35
  "keywords": [
@@ -31,9 +43,7 @@
31
43
  "seed": "tsx prisma/seed.ts"
32
44
  },
33
45
  "scripts": {
34
- "build": "bun build:main & bun build:module & bun build:types",
35
- "build:main": "bun build src/index.ts --outfile=dist/index.cjs --format=cjs --target=node --external=@prisma/*",
36
- "build:module": "bun run build.ts",
46
+ "build": "bun run build.ts & bun build:types",
37
47
  "build:types": "tsgo -p tsconfig.json",
38
48
  "lint": "eslint",
39
49
  "test": "vitest",
@@ -93,12 +103,16 @@
93
103
  "vitest-mock-extended": "3.1.0"
94
104
  },
95
105
  "dependencies": {
106
+ "@electric-sql/pglite": "0.3.14",
96
107
  "@paralleldrive/cuid2": "2.2.2",
97
108
  "@prisma/generator-helper": "6.12.0",
98
- "@prisma/internals": "6.12.0",
99
- "@electric-sql/pglite": "0.3.14",
100
- "pglite-prisma-adapter": "0.6.1",
101
- "bson": "6.10.4"
109
+ "@prisma/generator-helper-v6": "npm:@prisma/generator-helper@6.12.0",
110
+ "@prisma/generator-helper-v7": "npm:@prisma/generator-helper@7.1.0",
111
+ "@prisma/internals": "7.1.0",
112
+ "@prisma/internals-v6": "npm:@prisma/internals@6.12.0",
113
+ "@prisma/internals-v7": "npm:@prisma/internals@7.1.0",
114
+ "bson": "6.10.4",
115
+ "pglite-prisma-adapter": "0.6.1"
102
116
  },
103
117
  "peerDependencies": {
104
118
  "@prisma/client": ">= 6.10.0",