@prisma-next/mongo 0.11.0-dev.4 → 0.11.0-dev.6
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.d.mts +1 -0
- package/dist/config.d.mts.map +1 -1
- package/dist/config.mjs +2 -2
- package/dist/config.mjs.map +1 -1
- package/package.json +19 -19
- package/src/config/define-config.ts +6 -2
package/dist/config.d.mts
CHANGED
|
@@ -4,6 +4,7 @@ import { ControlExtensionDescriptor } from "@prisma-next/framework-components/co
|
|
|
4
4
|
//#region src/config/define-config.d.ts
|
|
5
5
|
interface MongoConfigOptions {
|
|
6
6
|
readonly contract: string;
|
|
7
|
+
readonly outputPath?: string;
|
|
7
8
|
readonly db?: {
|
|
8
9
|
readonly connection?: string;
|
|
9
10
|
};
|
package/dist/config.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config/define-config.ts"],"mappings":";;;;UAYiB,kBAAA;EAAA,SACN,QAAA;EAAA,SACA,EAAA;IAAA,SACE,UAAA;EAAA;EAAA,SAEF,UAAA,YAAsB,0BAAA;EAAA,SACtB,UAAA;IAAA,SACE,GAAA;EAAA;AAAA;AAAA,iBAYG,YAAA,CAAa,OAAA,EAAS,kBAAA,GAAqB,gBAAA"}
|
|
1
|
+
{"version":3,"file":"config.d.mts","names":[],"sources":["../src/config/define-config.ts"],"mappings":";;;;UAYiB,kBAAA;EAAA,SACN,QAAA;EAAA,SACA,UAAA;EAAA,SACA,EAAA;IAAA,SACE,UAAA;EAAA;EAAA,SAEF,UAAA,YAAsB,0BAAA;EAAA,SACtB,UAAA;IAAA,SACE,GAAA;EAAA;AAAA;AAAA,iBAYG,YAAA,CAAa,OAAA,EAAS,kBAAA,GAAqB,gBAAA"}
|
package/dist/config.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { mongoContract } from "@prisma-next/mongo-contract-psl/provider";
|
|
|
6
6
|
import { typescriptContractFromPath } from "@prisma-next/mongo-contract-ts/config-types";
|
|
7
7
|
import { mongoTargetDescriptor } from "@prisma-next/target-mongo/control";
|
|
8
8
|
import { ifDefined } from "@prisma-next/utils/defined";
|
|
9
|
-
import { extname } from "pathe";
|
|
9
|
+
import { extname, join } from "pathe";
|
|
10
10
|
//#region src/config/define-config.ts
|
|
11
11
|
function deriveOutputPath(contractPath) {
|
|
12
12
|
const ext = extname(contractPath);
|
|
@@ -15,7 +15,7 @@ function deriveOutputPath(contractPath) {
|
|
|
15
15
|
}
|
|
16
16
|
function defineConfig(options) {
|
|
17
17
|
const extensions = options.extensions ?? [];
|
|
18
|
-
const output = deriveOutputPath(options.contract);
|
|
18
|
+
const output = options.outputPath !== void 0 ? join(options.outputPath, "contract.json") : deriveOutputPath(options.contract);
|
|
19
19
|
return defineConfig$1({
|
|
20
20
|
family: mongoFamilyDescriptor,
|
|
21
21
|
target: mongoTargetDescriptor,
|
package/dist/config.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":["coreDefineConfig"],"sources":["../src/config/define-config.ts"],"sourcesContent":["import mongoAdapter from '@prisma-next/adapter-mongo/control';\nimport type { PrismaNextConfig } from '@prisma-next/config/config-types';\nimport { defineConfig as coreDefineConfig } from '@prisma-next/config/config-types';\nimport mongoDriver from '@prisma-next/driver-mongo/control';\nimport { mongoFamilyDescriptor } from '@prisma-next/family-mongo/control';\nimport type { ControlExtensionDescriptor } from '@prisma-next/framework-components/control';\nimport { mongoContract } from '@prisma-next/mongo-contract-psl/provider';\nimport { typescriptContractFromPath } from '@prisma-next/mongo-contract-ts/config-types';\nimport { mongoTargetDescriptor } from '@prisma-next/target-mongo/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { extname } from 'pathe';\n\nexport interface MongoConfigOptions {\n readonly contract: string;\n readonly db?: {\n readonly connection?: string;\n };\n readonly extensions?: readonly ControlExtensionDescriptor<'mongo', 'mongo'>[];\n readonly migrations?: {\n readonly dir?: string;\n };\n}\n\nfunction deriveOutputPath(contractPath: string): string {\n const ext = extname(contractPath);\n if (ext.length === 0) {\n return `${contractPath}.json`;\n }\n return `${contractPath.slice(0, -ext.length)}.json`;\n}\n\nexport function defineConfig(options: MongoConfigOptions): PrismaNextConfig<'mongo', 'mongo'> {\n const extensions = options.extensions ?? [];\n const output
|
|
1
|
+
{"version":3,"file":"config.mjs","names":["coreDefineConfig"],"sources":["../src/config/define-config.ts"],"sourcesContent":["import mongoAdapter from '@prisma-next/adapter-mongo/control';\nimport type { PrismaNextConfig } from '@prisma-next/config/config-types';\nimport { defineConfig as coreDefineConfig } from '@prisma-next/config/config-types';\nimport mongoDriver from '@prisma-next/driver-mongo/control';\nimport { mongoFamilyDescriptor } from '@prisma-next/family-mongo/control';\nimport type { ControlExtensionDescriptor } from '@prisma-next/framework-components/control';\nimport { mongoContract } from '@prisma-next/mongo-contract-psl/provider';\nimport { typescriptContractFromPath } from '@prisma-next/mongo-contract-ts/config-types';\nimport { mongoTargetDescriptor } from '@prisma-next/target-mongo/control';\nimport { ifDefined } from '@prisma-next/utils/defined';\nimport { extname, join } from 'pathe';\n\nexport interface MongoConfigOptions {\n readonly contract: string;\n readonly outputPath?: string;\n readonly db?: {\n readonly connection?: string;\n };\n readonly extensions?: readonly ControlExtensionDescriptor<'mongo', 'mongo'>[];\n readonly migrations?: {\n readonly dir?: string;\n };\n}\n\nfunction deriveOutputPath(contractPath: string): string {\n const ext = extname(contractPath);\n if (ext.length === 0) {\n return `${contractPath}.json`;\n }\n return `${contractPath.slice(0, -ext.length)}.json`;\n}\n\nexport function defineConfig(options: MongoConfigOptions): PrismaNextConfig<'mongo', 'mongo'> {\n const extensions = options.extensions ?? [];\n const output =\n options.outputPath !== undefined\n ? join(options.outputPath, 'contract.json')\n : deriveOutputPath(options.contract);\n const ext = extname(options.contract);\n\n const contractConfig =\n ext === '.ts'\n ? typescriptContractFromPath(options.contract, output)\n : mongoContract(options.contract, { output });\n\n return coreDefineConfig({\n family: mongoFamilyDescriptor,\n target: mongoTargetDescriptor,\n adapter: mongoAdapter,\n driver: mongoDriver,\n extensionPacks: extensions,\n contract: contractConfig,\n ...ifDefined('db', options.db),\n ...ifDefined('migrations', options.migrations),\n });\n}\n"],"mappings":";;;;;;;;;;AAwBA,SAAS,iBAAiB,cAA8B;CACtD,MAAM,MAAM,QAAQ,aAAa;CACjC,IAAI,IAAI,WAAW,GACjB,OAAO,GAAG,aAAa;CAEzB,OAAO,GAAG,aAAa,MAAM,GAAG,CAAC,IAAI,OAAO,CAAC;;AAG/C,SAAgB,aAAa,SAAiE;CAC5F,MAAM,aAAa,QAAQ,cAAc,EAAE;CAC3C,MAAM,SACJ,QAAQ,eAAe,KAAA,IACnB,KAAK,QAAQ,YAAY,gBAAgB,GACzC,iBAAiB,QAAQ,SAAS;CAQxC,OAAOA,eAAiB;EACtB,QAAQ;EACR,QAAQ;EACR,SAAS;EACT,QAAQ;EACR,gBAAgB;EAChB,UAbU,QAAQ,QAAQ,SAGvB,KAAK,QACJ,2BAA2B,QAAQ,UAAU,OAAO,GACpD,cAAc,QAAQ,UAAU,EAAE,QAAQ,CAAC;EAS/C,GAAG,UAAU,MAAM,QAAQ,GAAG;EAC9B,GAAG,UAAU,cAAc,QAAQ,WAAW;EAC/C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma-next/mongo",
|
|
3
|
-
"version": "0.11.0-dev.
|
|
3
|
+
"version": "0.11.0-dev.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"description": "One-package Mongo setup for Prisma Next",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@prisma-next/adapter-mongo": "0.11.0-dev.
|
|
10
|
-
"@prisma-next/cli": "0.11.0-dev.
|
|
11
|
-
"@prisma-next/config": "0.11.0-dev.
|
|
12
|
-
"@prisma-next/contract": "0.11.0-dev.
|
|
13
|
-
"@prisma-next/driver-mongo": "0.11.0-dev.
|
|
14
|
-
"@prisma-next/family-mongo": "0.11.0-dev.
|
|
15
|
-
"@prisma-next/framework-components": "0.11.0-dev.
|
|
16
|
-
"@prisma-next/mongo-contract": "0.11.0-dev.
|
|
17
|
-
"@prisma-next/mongo-contract-psl": "0.11.0-dev.
|
|
18
|
-
"@prisma-next/mongo-contract-ts": "0.11.0-dev.
|
|
19
|
-
"@prisma-next/mongo-orm": "0.11.0-dev.
|
|
20
|
-
"@prisma-next/mongo-query-builder": "0.11.0-dev.
|
|
21
|
-
"@prisma-next/mongo-runtime": "0.11.0-dev.
|
|
22
|
-
"@prisma-next/target-mongo": "0.11.0-dev.
|
|
23
|
-
"@prisma-next/utils": "0.11.0-dev.
|
|
9
|
+
"@prisma-next/adapter-mongo": "0.11.0-dev.6",
|
|
10
|
+
"@prisma-next/cli": "0.11.0-dev.6",
|
|
11
|
+
"@prisma-next/config": "0.11.0-dev.6",
|
|
12
|
+
"@prisma-next/contract": "0.11.0-dev.6",
|
|
13
|
+
"@prisma-next/driver-mongo": "0.11.0-dev.6",
|
|
14
|
+
"@prisma-next/family-mongo": "0.11.0-dev.6",
|
|
15
|
+
"@prisma-next/framework-components": "0.11.0-dev.6",
|
|
16
|
+
"@prisma-next/mongo-contract": "0.11.0-dev.6",
|
|
17
|
+
"@prisma-next/mongo-contract-psl": "0.11.0-dev.6",
|
|
18
|
+
"@prisma-next/mongo-contract-ts": "0.11.0-dev.6",
|
|
19
|
+
"@prisma-next/mongo-orm": "0.11.0-dev.6",
|
|
20
|
+
"@prisma-next/mongo-query-builder": "0.11.0-dev.6",
|
|
21
|
+
"@prisma-next/mongo-runtime": "0.11.0-dev.6",
|
|
22
|
+
"@prisma-next/target-mongo": "0.11.0-dev.6",
|
|
23
|
+
"@prisma-next/utils": "0.11.0-dev.6",
|
|
24
24
|
"mongodb": "^6.16.0",
|
|
25
25
|
"pathe": "^2.0.3"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@prisma-next/test-utils": "0.11.0-dev.
|
|
29
|
-
"@prisma-next/tsconfig": "0.11.0-dev.
|
|
30
|
-
"@prisma-next/tsdown": "0.11.0-dev.
|
|
28
|
+
"@prisma-next/test-utils": "0.11.0-dev.6",
|
|
29
|
+
"@prisma-next/tsconfig": "0.11.0-dev.6",
|
|
30
|
+
"@prisma-next/tsdown": "0.11.0-dev.6",
|
|
31
31
|
"mongodb-memory-server": "11.1.0",
|
|
32
32
|
"tsdown": "0.22.0",
|
|
33
33
|
"typescript": "5.9.3",
|
|
@@ -8,10 +8,11 @@ import { mongoContract } from '@prisma-next/mongo-contract-psl/provider';
|
|
|
8
8
|
import { typescriptContractFromPath } from '@prisma-next/mongo-contract-ts/config-types';
|
|
9
9
|
import { mongoTargetDescriptor } from '@prisma-next/target-mongo/control';
|
|
10
10
|
import { ifDefined } from '@prisma-next/utils/defined';
|
|
11
|
-
import { extname } from 'pathe';
|
|
11
|
+
import { extname, join } from 'pathe';
|
|
12
12
|
|
|
13
13
|
export interface MongoConfigOptions {
|
|
14
14
|
readonly contract: string;
|
|
15
|
+
readonly outputPath?: string;
|
|
15
16
|
readonly db?: {
|
|
16
17
|
readonly connection?: string;
|
|
17
18
|
};
|
|
@@ -31,7 +32,10 @@ function deriveOutputPath(contractPath: string): string {
|
|
|
31
32
|
|
|
32
33
|
export function defineConfig(options: MongoConfigOptions): PrismaNextConfig<'mongo', 'mongo'> {
|
|
33
34
|
const extensions = options.extensions ?? [];
|
|
34
|
-
const output =
|
|
35
|
+
const output =
|
|
36
|
+
options.outputPath !== undefined
|
|
37
|
+
? join(options.outputPath, 'contract.json')
|
|
38
|
+
: deriveOutputPath(options.contract);
|
|
35
39
|
const ext = extname(options.contract);
|
|
36
40
|
|
|
37
41
|
const contractConfig =
|