@prisma/config 6.20.0-integration-oidc-truster-publishers.2 → 6.20.0-integration-next.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.d.ts +0 -48
- package/dist/index.js +74 -138
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -204,20 +204,6 @@ declare type LoadConfigFromFileInput = {
|
|
|
204
204
|
configRoot?: string;
|
|
205
205
|
};
|
|
206
206
|
|
|
207
|
-
/**
|
|
208
|
-
* User's Prisma configuration should live in `prisma.config.ts` instead of `package.json#prisma`.
|
|
209
|
-
* See: https://pris.ly/prisma-config.
|
|
210
|
-
*
|
|
211
|
-
* This function returns `null` if no `package.json` is found, or if the `prisma` property is not defined therein.
|
|
212
|
-
*
|
|
213
|
-
* TODO: remove in Prisma 7.
|
|
214
|
-
* @deprecated
|
|
215
|
-
*/
|
|
216
|
-
export declare function loadConfigFromPackageJson(cwd?: string): Promise<{
|
|
217
|
-
config: PrismaConfigPackageJson;
|
|
218
|
-
loadedFromFile: string;
|
|
219
|
-
} | null>;
|
|
220
|
-
|
|
221
207
|
declare type MappedError = {
|
|
222
208
|
kind: 'GenericJs';
|
|
223
209
|
id: number;
|
|
@@ -369,25 +355,6 @@ export declare type PrismaConfigInternal = _PrismaConfigInternal & {
|
|
|
369
355
|
|
|
370
356
|
declare type _PrismaConfigInternal = Omit<PrismaConfig, 'engine' | 'datasource' | 'adapter'> & {
|
|
371
357
|
loadedFromFile: string | null;
|
|
372
|
-
/**
|
|
373
|
-
* The deprecated Prisma configuration from `package.json#prisma`.
|
|
374
|
-
* This is set to `null` if no `package.json#prisma` config was found.
|
|
375
|
-
* The configuration read from the Prisma config file (e.g., `prisma.config.ts`) takes precedence over
|
|
376
|
-
* this `package.json#prisma` config.
|
|
377
|
-
* @deprecated
|
|
378
|
-
*/
|
|
379
|
-
deprecatedPackageJson: {
|
|
380
|
-
/**
|
|
381
|
-
* The Prisma configuration from `package.json#prisma`.
|
|
382
|
-
* @deprecated
|
|
383
|
-
*/
|
|
384
|
-
config: PrismaConfigPackageJson;
|
|
385
|
-
/**
|
|
386
|
-
* The path from where the `package.json` config was loaded.
|
|
387
|
-
* @deprecated
|
|
388
|
-
*/
|
|
389
|
-
loadedFromFile: string;
|
|
390
|
-
} | null;
|
|
391
358
|
} & ({
|
|
392
359
|
engine: 'classic';
|
|
393
360
|
datasource: {
|
|
@@ -401,20 +368,6 @@ declare type _PrismaConfigInternal = Omit<PrismaConfig, 'engine' | 'datasource'
|
|
|
401
368
|
engine?: never;
|
|
402
369
|
});
|
|
403
370
|
|
|
404
|
-
/**
|
|
405
|
-
* Example:
|
|
406
|
-
* ```json
|
|
407
|
-
* {
|
|
408
|
-
* "schema": "./prisma/schema.prisma",
|
|
409
|
-
* "seed": "tsx ./prisma/seed.ts"
|
|
410
|
-
* }
|
|
411
|
-
* ```
|
|
412
|
-
*/
|
|
413
|
-
declare type PrismaConfigPackageJson = {
|
|
414
|
-
schema?: string;
|
|
415
|
-
seed?: string;
|
|
416
|
-
};
|
|
417
|
-
|
|
418
371
|
declare type PrismaConfigUnconditional = {
|
|
419
372
|
/**
|
|
420
373
|
* Experimental feature gates. Each experimental feature must be explicitly enabled.
|
|
@@ -497,7 +450,6 @@ declare type SchemaEngineConfigClassic = {
|
|
|
497
450
|
|
|
498
451
|
export declare type SchemaEngineConfigClassicDatasource = {
|
|
499
452
|
url: string;
|
|
500
|
-
directUrl?: string;
|
|
501
453
|
shadowDatabaseUrl?: string;
|
|
502
454
|
};
|
|
503
455
|
|
package/dist/index.js
CHANGED
|
@@ -34,8 +34,7 @@ __export(index_exports, {
|
|
|
34
34
|
defaultTestConfig: () => defaultTestConfig,
|
|
35
35
|
defineConfig: () => defineConfig,
|
|
36
36
|
env: () => env,
|
|
37
|
-
loadConfigFromFile: () => loadConfigFromFile
|
|
38
|
-
loadConfigFromPackageJson: () => loadConfigFromPackageJson
|
|
37
|
+
loadConfigFromFile: () => loadConfigFromFile
|
|
39
38
|
});
|
|
40
39
|
module.exports = __toCommonJS(index_exports);
|
|
41
40
|
|
|
@@ -358,7 +357,7 @@ var mockAdapterErrors = {
|
|
|
358
357
|
};
|
|
359
358
|
|
|
360
359
|
// src/PrismaConfig.ts
|
|
361
|
-
var
|
|
360
|
+
var import_effect2 = require("effect");
|
|
362
361
|
var import_Function = require("effect/Function");
|
|
363
362
|
|
|
364
363
|
// src/defineConfig.ts
|
|
@@ -367,8 +366,7 @@ var import_effect = require("effect");
|
|
|
367
366
|
// src/defaultConfig.ts
|
|
368
367
|
function defaultConfig() {
|
|
369
368
|
return makePrismaConfigInternal({
|
|
370
|
-
loadedFromFile: null
|
|
371
|
-
deprecatedPackageJson: null
|
|
369
|
+
loadedFromFile: null
|
|
372
370
|
});
|
|
373
371
|
}
|
|
374
372
|
|
|
@@ -513,133 +511,104 @@ function defineExtensionsConfig(config, configInput) {
|
|
|
513
511
|
debug2("[config.extensions]: %o", config["extensions"]);
|
|
514
512
|
}
|
|
515
513
|
|
|
516
|
-
// src/loadConfigFromPackageJson.ts
|
|
517
|
-
var import_promises = require("node:fs/promises");
|
|
518
|
-
var import_node_process = __toESM(require("node:process"));
|
|
519
|
-
var import_effect2 = require("effect");
|
|
520
|
-
var import_package = require("empathic/package");
|
|
521
|
-
var PrismaConfigPackageJsonShape = import_effect2.Schema.Struct({
|
|
522
|
-
schema: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
523
|
-
seed: import_effect2.Schema.optional(import_effect2.Schema.NonEmptyString)
|
|
524
|
-
});
|
|
525
|
-
async function loadConfigFromPackageJson(cwd = import_node_process.default.cwd()) {
|
|
526
|
-
const pkgPath = (0, import_package.up)({ cwd });
|
|
527
|
-
if (pkgPath === void 0) {
|
|
528
|
-
return null;
|
|
529
|
-
}
|
|
530
|
-
const pkgJson = await (0, import_promises.readFile)(pkgPath, { encoding: "utf-8" }).then((p) => JSON.parse(p));
|
|
531
|
-
const deprecatedConfig = pkgJson["prisma"];
|
|
532
|
-
if (deprecatedConfig === void 0) {
|
|
533
|
-
return null;
|
|
534
|
-
}
|
|
535
|
-
if (Object.keys(deprecatedConfig).length === 1 && deprecatedConfig["prismaCommit"] !== void 0) {
|
|
536
|
-
return null;
|
|
537
|
-
}
|
|
538
|
-
return {
|
|
539
|
-
config: deprecatedConfig,
|
|
540
|
-
loadedFromFile: pkgPath
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
|
|
544
514
|
// src/PrismaConfig.ts
|
|
545
515
|
var debug3 = Debug("prisma:config:PrismaConfig");
|
|
546
|
-
var SqlMigrationAwareDriverAdapterFactoryShape =
|
|
516
|
+
var SqlMigrationAwareDriverAdapterFactoryShape = import_effect2.Schema.declare(
|
|
547
517
|
(input) => {
|
|
548
518
|
return typeof input === "function";
|
|
549
519
|
},
|
|
550
520
|
{
|
|
551
521
|
identifier: "SqlMigrationAwareDriverAdapterFactory",
|
|
552
|
-
encode:
|
|
553
|
-
decode:
|
|
522
|
+
encode: import_effect2.identity,
|
|
523
|
+
decode: import_effect2.identity
|
|
554
524
|
}
|
|
555
525
|
);
|
|
556
|
-
var ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape =
|
|
526
|
+
var ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape = import_effect2.Schema.declare(
|
|
557
527
|
(input) => {
|
|
558
528
|
return typeof input === "function";
|
|
559
529
|
},
|
|
560
530
|
{
|
|
561
531
|
identifier: "ErrorCapturingSqlMigrationAwareDriverAdapterFactory",
|
|
562
|
-
encode:
|
|
563
|
-
decode:
|
|
532
|
+
encode: import_effect2.identity,
|
|
533
|
+
decode: import_effect2.identity
|
|
564
534
|
}
|
|
565
535
|
);
|
|
566
|
-
var SchemaEngineConfigClassicShape =
|
|
567
|
-
engine:
|
|
568
|
-
datasource:
|
|
569
|
-
url:
|
|
570
|
-
|
|
571
|
-
shadowDatabaseUrl: import_effect3.Schema.optional(import_effect3.Schema.String)
|
|
536
|
+
var SchemaEngineConfigClassicShape = import_effect2.Schema.Struct({
|
|
537
|
+
engine: import_effect2.Schema.Literal("classic"),
|
|
538
|
+
datasource: import_effect2.Schema.Struct({
|
|
539
|
+
url: import_effect2.Schema.String,
|
|
540
|
+
shadowDatabaseUrl: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
572
541
|
})
|
|
573
542
|
});
|
|
574
|
-
var SchemaEngineConfigJsShape =
|
|
575
|
-
engine:
|
|
543
|
+
var SchemaEngineConfigJsShape = import_effect2.Schema.Struct({
|
|
544
|
+
engine: import_effect2.Schema.Literal("js"),
|
|
576
545
|
adapter: SqlMigrationAwareDriverAdapterFactoryShape
|
|
577
546
|
});
|
|
578
|
-
var SchemaEngineConfigAbsentShape =
|
|
579
|
-
engine:
|
|
547
|
+
var SchemaEngineConfigAbsentShape = import_effect2.Schema.Struct({
|
|
548
|
+
engine: import_effect2.Schema.optional(import_effect2.Schema.Never)
|
|
580
549
|
});
|
|
581
|
-
var SchemaEngineConfigShape =
|
|
550
|
+
var SchemaEngineConfigShape = import_effect2.Schema.Union(
|
|
582
551
|
SchemaEngineConfigClassicShape,
|
|
583
552
|
SchemaEngineConfigJsShape,
|
|
584
553
|
SchemaEngineConfigAbsentShape
|
|
585
554
|
);
|
|
586
|
-
var SchemaEngineConfigJsInternal =
|
|
587
|
-
engine:
|
|
555
|
+
var SchemaEngineConfigJsInternal = import_effect2.Schema.Struct({
|
|
556
|
+
engine: import_effect2.Schema.Literal("js"),
|
|
588
557
|
adapter: ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape
|
|
589
558
|
});
|
|
590
|
-
var SchemaEngineConfigInternal =
|
|
559
|
+
var SchemaEngineConfigInternal = import_effect2.Schema.Union(
|
|
591
560
|
SchemaEngineConfigClassicShape,
|
|
592
561
|
SchemaEngineConfigJsInternal,
|
|
593
562
|
SchemaEngineConfigAbsentShape
|
|
594
563
|
);
|
|
595
|
-
var ExperimentalConfigShape =
|
|
596
|
-
adapter:
|
|
597
|
-
studio:
|
|
598
|
-
externalTables:
|
|
599
|
-
extensions:
|
|
564
|
+
var ExperimentalConfigShape = import_effect2.Schema.Struct({
|
|
565
|
+
adapter: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
566
|
+
studio: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
567
|
+
externalTables: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
568
|
+
extensions: import_effect2.Schema.optional(import_effect2.Schema.Boolean)
|
|
600
569
|
});
|
|
601
570
|
if (false) {
|
|
602
571
|
__testExperimentalConfigShapeValueA;
|
|
603
572
|
__testExperimentalConfigShapeValueB;
|
|
604
573
|
}
|
|
605
|
-
var MigrationsConfigShape =
|
|
606
|
-
path:
|
|
607
|
-
initShadowDb:
|
|
608
|
-
seed:
|
|
574
|
+
var MigrationsConfigShape = import_effect2.Schema.Struct({
|
|
575
|
+
path: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
576
|
+
initShadowDb: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
577
|
+
seed: import_effect2.Schema.optional(import_effect2.Schema.NonEmptyString)
|
|
609
578
|
});
|
|
610
579
|
if (false) {
|
|
611
580
|
__testMigrationsConfigShapeValueA;
|
|
612
581
|
__testMigrationsConfigShapeValueB;
|
|
613
582
|
}
|
|
614
|
-
var TablesConfigShape =
|
|
615
|
-
external:
|
|
583
|
+
var TablesConfigShape = import_effect2.Schema.Struct({
|
|
584
|
+
external: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(import_effect2.Schema.String)))
|
|
616
585
|
});
|
|
617
586
|
if (false) {
|
|
618
587
|
__testTablesConfigShapeValueA;
|
|
619
588
|
__testTablesConfigShapeValueB;
|
|
620
589
|
}
|
|
621
|
-
var EnumsConfigShape =
|
|
622
|
-
external:
|
|
590
|
+
var EnumsConfigShape = import_effect2.Schema.Struct({
|
|
591
|
+
external: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(import_effect2.Schema.String)))
|
|
623
592
|
});
|
|
624
593
|
if (false) {
|
|
625
594
|
__testEnumsConfigShapeValueA;
|
|
626
595
|
__testEnumsConfigShapeValueB;
|
|
627
596
|
}
|
|
628
|
-
var ViewsConfigShape =
|
|
629
|
-
path:
|
|
597
|
+
var ViewsConfigShape = import_effect2.Schema.Struct({
|
|
598
|
+
path: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
630
599
|
});
|
|
631
600
|
if (false) {
|
|
632
601
|
__testViewsConfigShapeValueA;
|
|
633
602
|
__testViewsConfigShapeValueB;
|
|
634
603
|
}
|
|
635
|
-
var TypedSqlConfigShape =
|
|
636
|
-
path:
|
|
604
|
+
var TypedSqlConfigShape = import_effect2.Schema.Struct({
|
|
605
|
+
path: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
637
606
|
});
|
|
638
607
|
if (false) {
|
|
639
608
|
__testTypedSqlConfigShapeValueA;
|
|
640
609
|
__testTypedSqlConfigShapeValueB;
|
|
641
610
|
}
|
|
642
|
-
var PrismaStudioConfigShape =
|
|
611
|
+
var PrismaStudioConfigShape = import_effect2.Schema.Struct({
|
|
643
612
|
/**
|
|
644
613
|
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
645
614
|
*/
|
|
@@ -653,18 +622,18 @@ if (false) {
|
|
|
653
622
|
__testPrismaConfig;
|
|
654
623
|
__testPrismaConfigInternal;
|
|
655
624
|
}
|
|
656
|
-
var PrismaConfigUnconditionalShape =
|
|
657
|
-
experimental:
|
|
658
|
-
schema:
|
|
659
|
-
studio:
|
|
660
|
-
migrations:
|
|
661
|
-
tables:
|
|
662
|
-
enums:
|
|
663
|
-
views:
|
|
664
|
-
typedSql:
|
|
665
|
-
extensions:
|
|
625
|
+
var PrismaConfigUnconditionalShape = import_effect2.Schema.Struct({
|
|
626
|
+
experimental: import_effect2.Schema.optional(ExperimentalConfigShape),
|
|
627
|
+
schema: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
628
|
+
studio: import_effect2.Schema.optional(PrismaStudioConfigShape),
|
|
629
|
+
migrations: import_effect2.Schema.optional(MigrationsConfigShape),
|
|
630
|
+
tables: import_effect2.Schema.optional(TablesConfigShape),
|
|
631
|
+
enums: import_effect2.Schema.optional(EnumsConfigShape),
|
|
632
|
+
views: import_effect2.Schema.optional(ViewsConfigShape),
|
|
633
|
+
typedSql: import_effect2.Schema.optional(TypedSqlConfigShape),
|
|
634
|
+
extensions: import_effect2.Schema.optional(import_effect2.Schema.Any)
|
|
666
635
|
});
|
|
667
|
-
var PrismaConfigShape =
|
|
636
|
+
var PrismaConfigShape = import_effect2.Schema.extend(SchemaEngineConfigShape, PrismaConfigUnconditionalShape);
|
|
668
637
|
if (false) {
|
|
669
638
|
__testPrismaConfigValueA;
|
|
670
639
|
__testPrismaConfigValueB;
|
|
@@ -672,58 +641,52 @@ if (false) {
|
|
|
672
641
|
function validateExperimentalFeatures2(config) {
|
|
673
642
|
const experimental = config.experimental || {};
|
|
674
643
|
if (config.engine === "js" && !experimental.adapter) {
|
|
675
|
-
return
|
|
644
|
+
return import_effect2.Either.left(
|
|
676
645
|
new Error("The `engine === 'js'` configuration requires `experimental.adapter` to be set to `true`.")
|
|
677
646
|
);
|
|
678
647
|
}
|
|
679
648
|
if (config.studio && !experimental.studio) {
|
|
680
|
-
return
|
|
649
|
+
return import_effect2.Either.left(new Error("The `studio` configuration requires `experimental.studio` to be set to `true`."));
|
|
681
650
|
}
|
|
682
651
|
if (config.tables?.external && !experimental.externalTables) {
|
|
683
|
-
return
|
|
652
|
+
return import_effect2.Either.left(
|
|
684
653
|
new Error("The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.")
|
|
685
654
|
);
|
|
686
655
|
}
|
|
687
656
|
if (config.enums?.external && !experimental.externalTables) {
|
|
688
|
-
return
|
|
657
|
+
return import_effect2.Either.left(
|
|
689
658
|
new Error("The `enums.external` configuration requires `experimental.externalTables` to be set to `true`.")
|
|
690
659
|
);
|
|
691
660
|
}
|
|
692
661
|
if (config.migrations?.initShadowDb && !experimental.externalTables) {
|
|
693
|
-
return
|
|
662
|
+
return import_effect2.Either.left(
|
|
694
663
|
new Error(
|
|
695
664
|
"The `migrations.initShadowDb` configuration requires `experimental.externalTables` to be set to `true`."
|
|
696
665
|
)
|
|
697
666
|
);
|
|
698
667
|
}
|
|
699
668
|
if (config["extensions"] && !experimental.extensions) {
|
|
700
|
-
return
|
|
669
|
+
return import_effect2.Either.left(
|
|
701
670
|
new Error("The `extensions` configuration requires `experimental.extensions` to be set to `true`.")
|
|
702
671
|
);
|
|
703
672
|
}
|
|
704
|
-
return
|
|
673
|
+
return import_effect2.Either.right(config);
|
|
705
674
|
}
|
|
706
675
|
function parsePrismaConfigShape(input) {
|
|
707
676
|
return (0, import_Function.pipe)(
|
|
708
|
-
|
|
677
|
+
import_effect2.Schema.decodeUnknownEither(PrismaConfigShape, {})(input, {
|
|
709
678
|
onExcessProperty: "error"
|
|
710
679
|
}),
|
|
711
|
-
|
|
680
|
+
import_effect2.Either.flatMap(validateExperimentalFeatures2)
|
|
712
681
|
);
|
|
713
682
|
}
|
|
714
683
|
var PRISMA_CONFIG_INTERNAL_BRAND = Symbol.for("PrismaConfigInternal");
|
|
715
|
-
var PrismaConfigInternalShape =
|
|
684
|
+
var PrismaConfigInternalShape = import_effect2.Schema.extend(
|
|
716
685
|
PrismaConfigUnconditionalShape,
|
|
717
|
-
|
|
686
|
+
import_effect2.Schema.extend(
|
|
718
687
|
SchemaEngineConfigInternal,
|
|
719
|
-
|
|
720
|
-
loadedFromFile:
|
|
721
|
-
deprecatedPackageJson: import_effect3.Schema.NullOr(
|
|
722
|
-
import_effect3.Schema.Struct({
|
|
723
|
-
config: PrismaConfigPackageJsonShape,
|
|
724
|
-
loadedFromFile: import_effect3.Schema.String
|
|
725
|
-
})
|
|
726
|
-
)
|
|
688
|
+
import_effect2.Schema.Struct({
|
|
689
|
+
loadedFromFile: import_effect2.Schema.NullOr(import_effect2.Schema.String)
|
|
727
690
|
})
|
|
728
691
|
)
|
|
729
692
|
);
|
|
@@ -740,10 +703,10 @@ function parsePrismaConfigInternalShape(input) {
|
|
|
740
703
|
debug3("Parsing PrismaConfigInternal: %o", input);
|
|
741
704
|
if (typeof input === "object" && input !== null && input["__brand"] === PRISMA_CONFIG_INTERNAL_BRAND) {
|
|
742
705
|
debug3("Short-circuit: input is already a PrismaConfigInternal object");
|
|
743
|
-
return
|
|
706
|
+
return import_effect2.Either.right(input);
|
|
744
707
|
}
|
|
745
708
|
return (0, import_Function.pipe)(
|
|
746
|
-
|
|
709
|
+
import_effect2.Schema.decodeUnknownEither(PrismaConfigInternalShape, {})(input, {
|
|
747
710
|
onExcessProperty: "error"
|
|
748
711
|
}),
|
|
749
712
|
// Brand the output type to make `PrismaConfigInternal` opaque, without exposing the `Effect/Brand` type
|
|
@@ -752,7 +715,7 @@ function parsePrismaConfigInternalShape(input) {
|
|
|
752
715
|
// - https://github.com/microsoft/rushstack/issues/1308
|
|
753
716
|
// - https://github.com/microsoft/rushstack/issues/4034
|
|
754
717
|
// - https://github.com/microsoft/TypeScript/issues/58914
|
|
755
|
-
|
|
718
|
+
import_effect2.Either.map(brandPrismaConfigInternal)
|
|
756
719
|
);
|
|
757
720
|
}
|
|
758
721
|
function makePrismaConfigInternal(makeArgs) {
|
|
@@ -762,14 +725,14 @@ function parseDefaultExport(defaultExport) {
|
|
|
762
725
|
const parseResultEither = (0, import_Function.pipe)(
|
|
763
726
|
// If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
|
|
764
727
|
parsePrismaConfigShape(defaultExport),
|
|
765
|
-
|
|
728
|
+
import_effect2.Either.map((config) => {
|
|
766
729
|
debug3("Parsed `PrismaConfig` shape: %o", config);
|
|
767
730
|
return defineConfig(config);
|
|
768
731
|
}),
|
|
769
732
|
// Otherwise, try to parse it as a `PrismaConfigInternal` shape.
|
|
770
|
-
|
|
733
|
+
import_effect2.Either.orElse(() => parsePrismaConfigInternalShape(defaultExport))
|
|
771
734
|
);
|
|
772
|
-
if (
|
|
735
|
+
if (import_effect2.Either.isLeft(parseResultEither)) {
|
|
773
736
|
throw parseResultEither.left;
|
|
774
737
|
}
|
|
775
738
|
return parseResultEither.right;
|
|
@@ -778,8 +741,7 @@ function parseDefaultExport(defaultExport) {
|
|
|
778
741
|
// src/defaultTestConfig.ts
|
|
779
742
|
function defaultTestConfig() {
|
|
780
743
|
return makePrismaConfigInternal({
|
|
781
|
-
loadedFromFile: null
|
|
782
|
-
deprecatedPackageJson: null
|
|
744
|
+
loadedFromFile: null
|
|
783
745
|
});
|
|
784
746
|
}
|
|
785
747
|
|
|
@@ -800,27 +762,16 @@ function env(name) {
|
|
|
800
762
|
|
|
801
763
|
// src/loadConfigFromFile.ts
|
|
802
764
|
var import_node_path = __toESM(require("node:path"));
|
|
803
|
-
var
|
|
765
|
+
var import_node_process = __toESM(require("node:process"));
|
|
804
766
|
var debug4 = Debug("prisma:config:loadConfigFromFile");
|
|
805
767
|
var SUPPORTED_EXTENSIONS = [".js", ".ts", ".mjs", ".cjs", ".mts", ".cts"];
|
|
806
768
|
async function loadConfigFromFile({
|
|
807
769
|
configFile,
|
|
808
|
-
configRoot =
|
|
770
|
+
configRoot = import_node_process.default.cwd()
|
|
809
771
|
}) {
|
|
810
772
|
const start = performance.now();
|
|
811
773
|
const getTime = () => `${(performance.now() - start).toFixed(2)}ms`;
|
|
812
774
|
const diagnostics = [];
|
|
813
|
-
const deprecatedPrismaConfigFromJson = await loadConfigFromPackageJson(configRoot);
|
|
814
|
-
if (deprecatedPrismaConfigFromJson) {
|
|
815
|
-
diagnostics.push({
|
|
816
|
-
_tag: "warn",
|
|
817
|
-
value: ({ warn, link }) => () => warn(
|
|
818
|
-
`The configuration property \`package.json#prisma\` is deprecated and will be removed in Prisma 7. Please migrate to a Prisma config file (e.g., \`prisma.config.ts\`).
|
|
819
|
-
For more information, see: ${link("https://pris.ly/prisma-config")}
|
|
820
|
-
`
|
|
821
|
-
)
|
|
822
|
-
});
|
|
823
|
-
}
|
|
824
775
|
try {
|
|
825
776
|
const { configModule, resolvedPath, error } = await loadConfigTsOrJs(configRoot, configFile);
|
|
826
777
|
if (error) {
|
|
@@ -855,20 +806,6 @@ For more information, see: ${link("https://pris.ly/prisma-config")}
|
|
|
855
806
|
`))
|
|
856
807
|
});
|
|
857
808
|
const prismaConfig = transformPathsInConfigToAbsolute(parsedConfig, resolvedPath);
|
|
858
|
-
if (deprecatedPrismaConfigFromJson) {
|
|
859
|
-
diagnostics.push({
|
|
860
|
-
_tag: "warn",
|
|
861
|
-
value: ({ warn, link }) => () => warn(`The Prisma config file in ${import_node_path.default.relative(
|
|
862
|
-
configRoot,
|
|
863
|
-
resolvedPath
|
|
864
|
-
)} overrides the deprecated \`package.json#prisma\` property in ${import_node_path.default.relative(
|
|
865
|
-
configRoot,
|
|
866
|
-
deprecatedPrismaConfigFromJson.loadedFromFile
|
|
867
|
-
)}.
|
|
868
|
-
For more information, see: ${link("https://pris.ly/prisma-config")}
|
|
869
|
-
`)
|
|
870
|
-
});
|
|
871
|
-
}
|
|
872
809
|
return {
|
|
873
810
|
config: {
|
|
874
811
|
...prismaConfig,
|
|
@@ -995,6 +932,5 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
|
|
|
995
932
|
defaultTestConfig,
|
|
996
933
|
defineConfig,
|
|
997
934
|
env,
|
|
998
|
-
loadConfigFromFile
|
|
999
|
-
loadConfigFromPackageJson
|
|
935
|
+
loadConfigFromFile
|
|
1000
936
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/config",
|
|
3
|
-
"version": "6.20.0-integration-
|
|
3
|
+
"version": "6.20.0-integration-next.4",
|
|
4
4
|
"description": "Internal package used to define and read Prisma configuration files",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"vitest": "3.2.4",
|
|
22
|
-
"@prisma/driver-adapter-utils": "6.20.0-integration-
|
|
23
|
-
"@prisma/get-platform": "6.20.0-integration-
|
|
22
|
+
"@prisma/driver-adapter-utils": "6.20.0-integration-next.4",
|
|
23
|
+
"@prisma/get-platform": "6.20.0-integration-next.4"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|