@prisma/orm-mongo 8.0.0-rc.12-dev.14 → 8.0.0-rc.12-dev.15

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/config.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import mongoAdapter from "@prisma/orm-target-mongo/adapter/control";
2
- import { defineConfig as defineConfig$1 } from "@prisma/orm-framework/config/config-types";
2
+ import { defaultContractOutputPath, defineConfig as defineConfig$1 } from "@prisma/orm-framework/config/config-types";
3
3
  import mongoDriver from "@prisma/orm-target-mongo/driver/control";
4
4
  import { mongoFamilyDescriptor } from "@prisma/orm-family-mongo/family/control";
5
5
  import { mongoContract } from "@prisma/orm-family-mongo/contract-psl/provider";
@@ -8,27 +8,9 @@ import { MONGO_INT32_CODEC_ID, MONGO_STRING_CODEC_ID } from "@prisma/orm-target-
8
8
  import { mongoTargetDescriptor } from "@prisma/orm-target-mongo/target/control";
9
9
  import { ifDefined } from "@prisma/orm-framework/utils/defined";
10
10
  import { extname, join } from "pathe";
11
- import { isDynamicPattern } from "tinyglobby";
12
11
  import { prisma6Contract } from "@prisma/orm-family-mongo/contract-prisma6/provider";
13
12
  import { prisma6MongoBinding } from "@prisma/orm-target-mongo/target/prisma6-binding";
14
13
  //#region ../../../3-extensions/mongo/dist/config.mjs
15
- function staticPrefixDirectory(pattern) {
16
- const staticSegments = [];
17
- for (const segment of pattern.replaceAll("\\", "/").split("/")) {
18
- if (isDynamicPattern(segment)) break;
19
- staticSegments.push(segment);
20
- }
21
- return staticSegments.join("/");
22
- }
23
- function deriveOutputPath(contractPath) {
24
- if (isDynamicPattern(contractPath)) {
25
- const prefix = staticPrefixDirectory(contractPath);
26
- return prefix.length === 0 ? "contract.json" : `${prefix}/contract.json`;
27
- }
28
- const ext = extname(contractPath);
29
- if (ext.length === 0) return `${contractPath}.json`;
30
- return `${contractPath.slice(0, -ext.length)}.json`;
31
- }
32
14
  function contractConfigFromPath(contractPath, output) {
33
15
  return extname(contractPath) === ".ts" ? typescriptContractFromPath(contractPath, output) : mongoContract(contractPath, {
34
16
  output,
@@ -40,9 +22,9 @@ function contractConfigFromPath(contractPath, output) {
40
22
  }
41
23
  function resolveContractConfig(options) {
42
24
  const explicitOutput = options.output !== void 0 ? join(options.output, "contract.json") : void 0;
43
- if (typeof options.contract === "string") return contractConfigFromPath(options.contract, explicitOutput ?? deriveOutputPath(options.contract));
25
+ if (typeof options.contract === "string") return contractConfigFromPath(options.contract, explicitOutput ?? defaultContractOutputPath(options.contract));
44
26
  const firstInput = options.contract.source.inputs?.[0];
45
- const output = explicitOutput ?? options.contract.output ?? (firstInput !== void 0 ? deriveOutputPath(firstInput) : void 0);
27
+ const output = explicitOutput ?? options.contract.output ?? (firstInput !== void 0 ? defaultContractOutputPath(firstInput) : void 0);
46
28
  return {
47
29
  ...options.contract,
48
30
  ...ifDefined("output", output)
@@ -1 +1 @@
1
- {"version":3,"file":"config.mjs","names":[],"sources":["../../../../3-extensions/mongo/dist/config.mjs"],"sourcesContent":["import mongoAdapter from \"@internal/adapter-mongo/control\";\nimport { defineConfig as defineConfig$1 } from \"@internal/config/config-types\";\nimport mongoDriver from \"@internal/driver-mongo/control\";\nimport { mongoFamilyDescriptor } from \"@internal/family-mongo/control\";\nimport { mongoContract } from \"@internal/mongo-contract-psl/provider\";\nimport { typescriptContractFromPath } from \"@internal/mongo-contract-ts/config-types\";\nimport { MONGO_INT32_CODEC_ID, MONGO_STRING_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\nimport { mongoTargetDescriptor } from \"@internal/target-mongo/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { extname, join } from \"pathe\";\nimport { isDynamicPattern } from \"tinyglobby\";\nimport { prisma6Contract } from \"@internal/mongo-contract-prisma6/provider\";\nimport { prisma6MongoBinding } from \"@internal/target-mongo/prisma6-binding\";\n//#region src/config/define-config.ts\nfunction staticPrefixDirectory(pattern) {\n\tconst staticSegments = [];\n\tfor (const segment of pattern.replaceAll(\"\\\\\", \"/\").split(\"/\")) {\n\t\tif (isDynamicPattern(segment)) break;\n\t\tstaticSegments.push(segment);\n\t}\n\treturn staticSegments.join(\"/\");\n}\nfunction deriveOutputPath(contractPath) {\n\tif (isDynamicPattern(contractPath)) {\n\t\tconst prefix = staticPrefixDirectory(contractPath);\n\t\treturn prefix.length === 0 ? \"contract.json\" : `${prefix}/contract.json`;\n\t}\n\tconst ext = extname(contractPath);\n\tif (ext.length === 0) return `${contractPath}.json`;\n\treturn `${contractPath.slice(0, -ext.length)}.json`;\n}\nfunction contractConfigFromPath(contractPath, output) {\n\treturn extname(contractPath) === \".ts\" ? typescriptContractFromPath(contractPath, output) : mongoContract(contractPath, {\n\t\toutput,\n\t\tenumInferenceCodecs: {\n\t\t\ttext: MONGO_STRING_CODEC_ID,\n\t\t\tint: MONGO_INT32_CODEC_ID\n\t\t}\n\t});\n}\nfunction resolveContractConfig(options) {\n\tconst explicitOutput = options.output !== void 0 ? join(options.output, \"contract.json\") : void 0;\n\tif (typeof options.contract === \"string\") return contractConfigFromPath(options.contract, explicitOutput ?? deriveOutputPath(options.contract));\n\tconst firstInput = options.contract.source.inputs?.[0];\n\tconst output = explicitOutput ?? options.contract.output ?? (firstInput !== void 0 ? deriveOutputPath(firstInput) : void 0);\n\treturn {\n\t\t...options.contract,\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction defineConfig(options) {\n\treturn defineConfig$1({\n\t\tfamily: mongoFamilyDescriptor,\n\t\ttarget: mongoTargetDescriptor,\n\t\tadapter: mongoAdapter,\n\t\tdriver: mongoDriver,\n\t\textensions: options.extensions ?? [],\n\t\tcontract: resolveContractConfig(options),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"migrations\", options.migrations)\n\t});\n}\n//#endregion\n//#region src/config/prisma6-schema.ts\n/**\n* Reads a Prisma 6 MongoDB `schema.prisma` (or a directory of `.prisma` files) as the\n* contract source, so Prisma 8 can adopt a database a Prisma 6 application still uses.\n*/\nfunction prisma6Schema(schemaPath) {\n\treturn prisma6Contract(schemaPath, { binding: prisma6MongoBinding });\n}\n//#endregion\nexport { defineConfig, prisma6Schema };\n\n//# sourceMappingURL=config.mjs.map"],"mappings":";;;;;;;;;;;;;;AAcA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,CAAC;CACxB,KAAK,MAAM,WAAW,QAAQ,WAAW,MAAM,GAAG,CAAC,CAAC,MAAM,GAAG,GAAG;EAC/D,IAAI,iBAAiB,OAAO,GAAG;EAC/B,eAAe,KAAK,OAAO;CAC5B;CACA,OAAO,eAAe,KAAK,GAAG;AAC/B;AACA,SAAS,iBAAiB,cAAc;CACvC,IAAI,iBAAiB,YAAY,GAAG;EACnC,MAAM,SAAS,sBAAsB,YAAY;EACjD,OAAO,OAAO,WAAW,IAAI,kBAAkB,GAAG,OAAO;CAC1D;CACA,MAAM,MAAM,QAAQ,YAAY;CAChC,IAAI,IAAI,WAAW,GAAG,OAAO,GAAG,aAAa;CAC7C,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,MAAM,EAAE;AAC9C;AACA,SAAS,uBAAuB,cAAc,QAAQ;CACrD,OAAO,QAAQ,YAAY,MAAM,QAAQ,2BAA2B,cAAc,MAAM,IAAI,cAAc,cAAc;EACvH;EACA,qBAAqB;GACpB,MAAM;GACN,KAAK;EACN;CACD,CAAC;AACF;AACA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,QAAQ,WAAW,KAAK,IAAI,KAAK,QAAQ,QAAQ,eAAe,IAAI,KAAK;CAChG,IAAI,OAAO,QAAQ,aAAa,UAAU,OAAO,uBAAuB,QAAQ,UAAU,kBAAkB,iBAAiB,QAAQ,QAAQ,CAAC;CAC9I,MAAM,aAAa,QAAQ,SAAS,OAAO,SAAS;CACpD,MAAM,SAAS,kBAAkB,QAAQ,SAAS,WAAW,eAAe,KAAK,IAAI,iBAAiB,UAAU,IAAI,KAAK;CACzH,OAAO;EACN,GAAG,QAAQ;EACX,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,aAAa,SAAS;CAC9B,OAAO,eAAe;EACrB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAAY,QAAQ,cAAc,CAAC;EACnC,UAAU,sBAAsB,OAAO;EACvC,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,cAAc,QAAQ,UAAU;CAC9C,CAAC;AACF;;;;;AAOA,SAAS,cAAc,YAAY;CAClC,OAAO,gBAAgB,YAAY,EAAE,SAAS,oBAAoB,CAAC;AACpE"}
1
+ {"version":3,"file":"config.mjs","names":[],"sources":["../../../../3-extensions/mongo/dist/config.mjs"],"sourcesContent":["import mongoAdapter from \"@internal/adapter-mongo/control\";\nimport { defaultContractOutputPath, defineConfig as defineConfig$1 } from \"@internal/config/config-types\";\nimport mongoDriver from \"@internal/driver-mongo/control\";\nimport { mongoFamilyDescriptor } from \"@internal/family-mongo/control\";\nimport { mongoContract } from \"@internal/mongo-contract-psl/provider\";\nimport { typescriptContractFromPath } from \"@internal/mongo-contract-ts/config-types\";\nimport { MONGO_INT32_CODEC_ID, MONGO_STRING_CODEC_ID } from \"@internal/target-mongo/codec-ids\";\nimport { mongoTargetDescriptor } from \"@internal/target-mongo/control\";\nimport { ifDefined } from \"@internal/utils/defined\";\nimport { extname, join } from \"pathe\";\nimport { prisma6Contract } from \"@internal/mongo-contract-prisma6/provider\";\nimport { prisma6MongoBinding } from \"@internal/target-mongo/prisma6-binding\";\n//#region src/config/define-config.ts\nfunction contractConfigFromPath(contractPath, output) {\n\treturn extname(contractPath) === \".ts\" ? typescriptContractFromPath(contractPath, output) : mongoContract(contractPath, {\n\t\toutput,\n\t\tenumInferenceCodecs: {\n\t\t\ttext: MONGO_STRING_CODEC_ID,\n\t\t\tint: MONGO_INT32_CODEC_ID\n\t\t}\n\t});\n}\nfunction resolveContractConfig(options) {\n\tconst explicitOutput = options.output !== void 0 ? join(options.output, \"contract.json\") : void 0;\n\tif (typeof options.contract === \"string\") return contractConfigFromPath(options.contract, explicitOutput ?? defaultContractOutputPath(options.contract));\n\tconst firstInput = options.contract.source.inputs?.[0];\n\tconst output = explicitOutput ?? options.contract.output ?? (firstInput !== void 0 ? defaultContractOutputPath(firstInput) : void 0);\n\treturn {\n\t\t...options.contract,\n\t\t...ifDefined(\"output\", output)\n\t};\n}\nfunction defineConfig(options) {\n\treturn defineConfig$1({\n\t\tfamily: mongoFamilyDescriptor,\n\t\ttarget: mongoTargetDescriptor,\n\t\tadapter: mongoAdapter,\n\t\tdriver: mongoDriver,\n\t\textensions: options.extensions ?? [],\n\t\tcontract: resolveContractConfig(options),\n\t\t...ifDefined(\"db\", options.db),\n\t\t...ifDefined(\"migrations\", options.migrations)\n\t});\n}\n//#endregion\n//#region src/config/prisma6-schema.ts\n/**\n* Reads a Prisma 6 MongoDB `schema.prisma` (or a directory of `.prisma` files) as the\n* contract source, so Prisma 8 can adopt a database a Prisma 6 application still uses.\n*/\nfunction prisma6Schema(schemaPath) {\n\treturn prisma6Contract(schemaPath, { binding: prisma6MongoBinding });\n}\n//#endregion\nexport { defineConfig, prisma6Schema };\n\n//# sourceMappingURL=config.mjs.map"],"mappings":";;;;;;;;;;;;;AAaA,SAAS,uBAAuB,cAAc,QAAQ;CACrD,OAAO,QAAQ,YAAY,MAAM,QAAQ,2BAA2B,cAAc,MAAM,IAAI,cAAc,cAAc;EACvH;EACA,qBAAqB;GACpB,MAAM;GACN,KAAK;EACN;CACD,CAAC;AACF;AACA,SAAS,sBAAsB,SAAS;CACvC,MAAM,iBAAiB,QAAQ,WAAW,KAAK,IAAI,KAAK,QAAQ,QAAQ,eAAe,IAAI,KAAK;CAChG,IAAI,OAAO,QAAQ,aAAa,UAAU,OAAO,uBAAuB,QAAQ,UAAU,kBAAkB,0BAA0B,QAAQ,QAAQ,CAAC;CACvJ,MAAM,aAAa,QAAQ,SAAS,OAAO,SAAS;CACpD,MAAM,SAAS,kBAAkB,QAAQ,SAAS,WAAW,eAAe,KAAK,IAAI,0BAA0B,UAAU,IAAI,KAAK;CAClI,OAAO;EACN,GAAG,QAAQ;EACX,GAAG,UAAU,UAAU,MAAM;CAC9B;AACD;AACA,SAAS,aAAa,SAAS;CAC9B,OAAO,eAAe;EACrB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,YAAY,QAAQ,cAAc,CAAC;EACnC,UAAU,sBAAsB,OAAO;EACvC,GAAG,UAAU,MAAM,QAAQ,EAAE;EAC7B,GAAG,UAAU,cAAc,QAAQ,UAAU;CAC9C,CAAC;AACF;;;;;AAOA,SAAS,cAAc,YAAY;CAClC,OAAO,gBAAgB,YAAY,EAAE,SAAS,oBAAoB,CAAC;AACpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/orm-mongo",
3
- "version": "8.0.0-rc.12-dev.14",
3
+ "version": "8.0.0-rc.12-dev.15",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -10,18 +10,18 @@
10
10
  "skills"
11
11
  ],
12
12
  "dependencies": {
13
- "@prisma/orm-family-mongo": "8.0.0-rc.12-dev.14",
14
- "@prisma/orm-framework": "8.0.0-rc.12-dev.14",
15
- "@prisma/orm-target-mongo": "8.0.0-rc.12-dev.14",
16
- "@prisma/orm-toolchain": "8.0.0-rc.12-dev.14",
13
+ "@prisma/orm-family-mongo": "8.0.0-rc.12-dev.15",
14
+ "@prisma/orm-framework": "8.0.0-rc.12-dev.15",
15
+ "@prisma/orm-target-mongo": "8.0.0-rc.12-dev.15",
16
+ "@prisma/orm-toolchain": "8.0.0-rc.12-dev.15",
17
17
  "mongodb-connection-string-url": "^7.0.1",
18
18
  "pathe": "^2.0.3",
19
19
  "tinyglobby": "^0.2.17"
20
20
  },
21
21
  "devDependencies": {
22
- "@internal/mongo": "8.0.0-rc.12-dev.14",
23
- "@repo/tsconfig": "8.0.0-rc.12-dev.14",
24
- "@repo/tsdown": "8.0.0-rc.12-dev.14",
22
+ "@internal/mongo": "8.0.0-rc.12-dev.15",
23
+ "@repo/tsconfig": "8.0.0-rc.12-dev.15",
24
+ "@repo/tsdown": "8.0.0-rc.12-dev.15",
25
25
  "tsdown": "0.22.14",
26
26
  "typescript": "5.9.3"
27
27
  },
@@ -15,7 +15,7 @@ description: >-
15
15
  ORM 7 or earlier (schema.prisma + @prisma/client).
16
16
  metadata:
17
17
  library: '@prisma/orm-mongo'
18
- library_version: '8.0.0-rc.12-dev.14'
18
+ library_version: '8.0.0-rc.12-dev.15'
19
19
  version: '2026-09-12'
20
20
  ---
21
21