@prisma/config 6.20.0-integration-merge-release-workflows.1 → 6.20.0-integration-next.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.
- package/dist/index.d.ts +0 -47
- package/dist/index.js +75 -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.
|
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,105 @@ 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
|
-
directUrl:
|
|
571
|
-
shadowDatabaseUrl:
|
|
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
|
+
directUrl: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
541
|
+
shadowDatabaseUrl: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
572
542
|
})
|
|
573
543
|
});
|
|
574
|
-
var SchemaEngineConfigJsShape =
|
|
575
|
-
engine:
|
|
544
|
+
var SchemaEngineConfigJsShape = import_effect2.Schema.Struct({
|
|
545
|
+
engine: import_effect2.Schema.Literal("js"),
|
|
576
546
|
adapter: SqlMigrationAwareDriverAdapterFactoryShape
|
|
577
547
|
});
|
|
578
|
-
var SchemaEngineConfigAbsentShape =
|
|
579
|
-
engine:
|
|
548
|
+
var SchemaEngineConfigAbsentShape = import_effect2.Schema.Struct({
|
|
549
|
+
engine: import_effect2.Schema.optional(import_effect2.Schema.Never)
|
|
580
550
|
});
|
|
581
|
-
var SchemaEngineConfigShape =
|
|
551
|
+
var SchemaEngineConfigShape = import_effect2.Schema.Union(
|
|
582
552
|
SchemaEngineConfigClassicShape,
|
|
583
553
|
SchemaEngineConfigJsShape,
|
|
584
554
|
SchemaEngineConfigAbsentShape
|
|
585
555
|
);
|
|
586
|
-
var SchemaEngineConfigJsInternal =
|
|
587
|
-
engine:
|
|
556
|
+
var SchemaEngineConfigJsInternal = import_effect2.Schema.Struct({
|
|
557
|
+
engine: import_effect2.Schema.Literal("js"),
|
|
588
558
|
adapter: ErrorCapturingSqlMigrationAwareDriverAdapterFactoryShape
|
|
589
559
|
});
|
|
590
|
-
var SchemaEngineConfigInternal =
|
|
560
|
+
var SchemaEngineConfigInternal = import_effect2.Schema.Union(
|
|
591
561
|
SchemaEngineConfigClassicShape,
|
|
592
562
|
SchemaEngineConfigJsInternal,
|
|
593
563
|
SchemaEngineConfigAbsentShape
|
|
594
564
|
);
|
|
595
|
-
var ExperimentalConfigShape =
|
|
596
|
-
adapter:
|
|
597
|
-
studio:
|
|
598
|
-
externalTables:
|
|
599
|
-
extensions:
|
|
565
|
+
var ExperimentalConfigShape = import_effect2.Schema.Struct({
|
|
566
|
+
adapter: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
567
|
+
studio: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
568
|
+
externalTables: import_effect2.Schema.optional(import_effect2.Schema.Boolean),
|
|
569
|
+
extensions: import_effect2.Schema.optional(import_effect2.Schema.Boolean)
|
|
600
570
|
});
|
|
601
571
|
if (false) {
|
|
602
572
|
__testExperimentalConfigShapeValueA;
|
|
603
573
|
__testExperimentalConfigShapeValueB;
|
|
604
574
|
}
|
|
605
|
-
var MigrationsConfigShape =
|
|
606
|
-
path:
|
|
607
|
-
initShadowDb:
|
|
608
|
-
seed:
|
|
575
|
+
var MigrationsConfigShape = import_effect2.Schema.Struct({
|
|
576
|
+
path: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
577
|
+
initShadowDb: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
578
|
+
seed: import_effect2.Schema.optional(import_effect2.Schema.NonEmptyString)
|
|
609
579
|
});
|
|
610
580
|
if (false) {
|
|
611
581
|
__testMigrationsConfigShapeValueA;
|
|
612
582
|
__testMigrationsConfigShapeValueB;
|
|
613
583
|
}
|
|
614
|
-
var TablesConfigShape =
|
|
615
|
-
external:
|
|
584
|
+
var TablesConfigShape = import_effect2.Schema.Struct({
|
|
585
|
+
external: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(import_effect2.Schema.String)))
|
|
616
586
|
});
|
|
617
587
|
if (false) {
|
|
618
588
|
__testTablesConfigShapeValueA;
|
|
619
589
|
__testTablesConfigShapeValueB;
|
|
620
590
|
}
|
|
621
|
-
var EnumsConfigShape =
|
|
622
|
-
external:
|
|
591
|
+
var EnumsConfigShape = import_effect2.Schema.Struct({
|
|
592
|
+
external: import_effect2.Schema.optional(import_effect2.Schema.mutable(import_effect2.Schema.Array(import_effect2.Schema.String)))
|
|
623
593
|
});
|
|
624
594
|
if (false) {
|
|
625
595
|
__testEnumsConfigShapeValueA;
|
|
626
596
|
__testEnumsConfigShapeValueB;
|
|
627
597
|
}
|
|
628
|
-
var ViewsConfigShape =
|
|
629
|
-
path:
|
|
598
|
+
var ViewsConfigShape = import_effect2.Schema.Struct({
|
|
599
|
+
path: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
630
600
|
});
|
|
631
601
|
if (false) {
|
|
632
602
|
__testViewsConfigShapeValueA;
|
|
633
603
|
__testViewsConfigShapeValueB;
|
|
634
604
|
}
|
|
635
|
-
var TypedSqlConfigShape =
|
|
636
|
-
path:
|
|
605
|
+
var TypedSqlConfigShape = import_effect2.Schema.Struct({
|
|
606
|
+
path: import_effect2.Schema.optional(import_effect2.Schema.String)
|
|
637
607
|
});
|
|
638
608
|
if (false) {
|
|
639
609
|
__testTypedSqlConfigShapeValueA;
|
|
640
610
|
__testTypedSqlConfigShapeValueB;
|
|
641
611
|
}
|
|
642
|
-
var PrismaStudioConfigShape =
|
|
612
|
+
var PrismaStudioConfigShape = import_effect2.Schema.Struct({
|
|
643
613
|
/**
|
|
644
614
|
* Instantiates the Prisma driver adapter to use for Prisma Studio.
|
|
645
615
|
*/
|
|
@@ -653,18 +623,18 @@ if (false) {
|
|
|
653
623
|
__testPrismaConfig;
|
|
654
624
|
__testPrismaConfigInternal;
|
|
655
625
|
}
|
|
656
|
-
var PrismaConfigUnconditionalShape =
|
|
657
|
-
experimental:
|
|
658
|
-
schema:
|
|
659
|
-
studio:
|
|
660
|
-
migrations:
|
|
661
|
-
tables:
|
|
662
|
-
enums:
|
|
663
|
-
views:
|
|
664
|
-
typedSql:
|
|
665
|
-
extensions:
|
|
626
|
+
var PrismaConfigUnconditionalShape = import_effect2.Schema.Struct({
|
|
627
|
+
experimental: import_effect2.Schema.optional(ExperimentalConfigShape),
|
|
628
|
+
schema: import_effect2.Schema.optional(import_effect2.Schema.String),
|
|
629
|
+
studio: import_effect2.Schema.optional(PrismaStudioConfigShape),
|
|
630
|
+
migrations: import_effect2.Schema.optional(MigrationsConfigShape),
|
|
631
|
+
tables: import_effect2.Schema.optional(TablesConfigShape),
|
|
632
|
+
enums: import_effect2.Schema.optional(EnumsConfigShape),
|
|
633
|
+
views: import_effect2.Schema.optional(ViewsConfigShape),
|
|
634
|
+
typedSql: import_effect2.Schema.optional(TypedSqlConfigShape),
|
|
635
|
+
extensions: import_effect2.Schema.optional(import_effect2.Schema.Any)
|
|
666
636
|
});
|
|
667
|
-
var PrismaConfigShape =
|
|
637
|
+
var PrismaConfigShape = import_effect2.Schema.extend(SchemaEngineConfigShape, PrismaConfigUnconditionalShape);
|
|
668
638
|
if (false) {
|
|
669
639
|
__testPrismaConfigValueA;
|
|
670
640
|
__testPrismaConfigValueB;
|
|
@@ -672,58 +642,52 @@ if (false) {
|
|
|
672
642
|
function validateExperimentalFeatures2(config) {
|
|
673
643
|
const experimental = config.experimental || {};
|
|
674
644
|
if (config.engine === "js" && !experimental.adapter) {
|
|
675
|
-
return
|
|
645
|
+
return import_effect2.Either.left(
|
|
676
646
|
new Error("The `engine === 'js'` configuration requires `experimental.adapter` to be set to `true`.")
|
|
677
647
|
);
|
|
678
648
|
}
|
|
679
649
|
if (config.studio && !experimental.studio) {
|
|
680
|
-
return
|
|
650
|
+
return import_effect2.Either.left(new Error("The `studio` configuration requires `experimental.studio` to be set to `true`."));
|
|
681
651
|
}
|
|
682
652
|
if (config.tables?.external && !experimental.externalTables) {
|
|
683
|
-
return
|
|
653
|
+
return import_effect2.Either.left(
|
|
684
654
|
new Error("The `tables.external` configuration requires `experimental.externalTables` to be set to `true`.")
|
|
685
655
|
);
|
|
686
656
|
}
|
|
687
657
|
if (config.enums?.external && !experimental.externalTables) {
|
|
688
|
-
return
|
|
658
|
+
return import_effect2.Either.left(
|
|
689
659
|
new Error("The `enums.external` configuration requires `experimental.externalTables` to be set to `true`.")
|
|
690
660
|
);
|
|
691
661
|
}
|
|
692
662
|
if (config.migrations?.initShadowDb && !experimental.externalTables) {
|
|
693
|
-
return
|
|
663
|
+
return import_effect2.Either.left(
|
|
694
664
|
new Error(
|
|
695
665
|
"The `migrations.initShadowDb` configuration requires `experimental.externalTables` to be set to `true`."
|
|
696
666
|
)
|
|
697
667
|
);
|
|
698
668
|
}
|
|
699
669
|
if (config["extensions"] && !experimental.extensions) {
|
|
700
|
-
return
|
|
670
|
+
return import_effect2.Either.left(
|
|
701
671
|
new Error("The `extensions` configuration requires `experimental.extensions` to be set to `true`.")
|
|
702
672
|
);
|
|
703
673
|
}
|
|
704
|
-
return
|
|
674
|
+
return import_effect2.Either.right(config);
|
|
705
675
|
}
|
|
706
676
|
function parsePrismaConfigShape(input) {
|
|
707
677
|
return (0, import_Function.pipe)(
|
|
708
|
-
|
|
678
|
+
import_effect2.Schema.decodeUnknownEither(PrismaConfigShape, {})(input, {
|
|
709
679
|
onExcessProperty: "error"
|
|
710
680
|
}),
|
|
711
|
-
|
|
681
|
+
import_effect2.Either.flatMap(validateExperimentalFeatures2)
|
|
712
682
|
);
|
|
713
683
|
}
|
|
714
684
|
var PRISMA_CONFIG_INTERNAL_BRAND = Symbol.for("PrismaConfigInternal");
|
|
715
|
-
var PrismaConfigInternalShape =
|
|
685
|
+
var PrismaConfigInternalShape = import_effect2.Schema.extend(
|
|
716
686
|
PrismaConfigUnconditionalShape,
|
|
717
|
-
|
|
687
|
+
import_effect2.Schema.extend(
|
|
718
688
|
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
|
-
)
|
|
689
|
+
import_effect2.Schema.Struct({
|
|
690
|
+
loadedFromFile: import_effect2.Schema.NullOr(import_effect2.Schema.String)
|
|
727
691
|
})
|
|
728
692
|
)
|
|
729
693
|
);
|
|
@@ -740,10 +704,10 @@ function parsePrismaConfigInternalShape(input) {
|
|
|
740
704
|
debug3("Parsing PrismaConfigInternal: %o", input);
|
|
741
705
|
if (typeof input === "object" && input !== null && input["__brand"] === PRISMA_CONFIG_INTERNAL_BRAND) {
|
|
742
706
|
debug3("Short-circuit: input is already a PrismaConfigInternal object");
|
|
743
|
-
return
|
|
707
|
+
return import_effect2.Either.right(input);
|
|
744
708
|
}
|
|
745
709
|
return (0, import_Function.pipe)(
|
|
746
|
-
|
|
710
|
+
import_effect2.Schema.decodeUnknownEither(PrismaConfigInternalShape, {})(input, {
|
|
747
711
|
onExcessProperty: "error"
|
|
748
712
|
}),
|
|
749
713
|
// Brand the output type to make `PrismaConfigInternal` opaque, without exposing the `Effect/Brand` type
|
|
@@ -752,7 +716,7 @@ function parsePrismaConfigInternalShape(input) {
|
|
|
752
716
|
// - https://github.com/microsoft/rushstack/issues/1308
|
|
753
717
|
// - https://github.com/microsoft/rushstack/issues/4034
|
|
754
718
|
// - https://github.com/microsoft/TypeScript/issues/58914
|
|
755
|
-
|
|
719
|
+
import_effect2.Either.map(brandPrismaConfigInternal)
|
|
756
720
|
);
|
|
757
721
|
}
|
|
758
722
|
function makePrismaConfigInternal(makeArgs) {
|
|
@@ -762,14 +726,14 @@ function parseDefaultExport(defaultExport) {
|
|
|
762
726
|
const parseResultEither = (0, import_Function.pipe)(
|
|
763
727
|
// If the given config conforms to the `PrismaConfig` shape, feed it to `defineConfig`.
|
|
764
728
|
parsePrismaConfigShape(defaultExport),
|
|
765
|
-
|
|
729
|
+
import_effect2.Either.map((config) => {
|
|
766
730
|
debug3("Parsed `PrismaConfig` shape: %o", config);
|
|
767
731
|
return defineConfig(config);
|
|
768
732
|
}),
|
|
769
733
|
// Otherwise, try to parse it as a `PrismaConfigInternal` shape.
|
|
770
|
-
|
|
734
|
+
import_effect2.Either.orElse(() => parsePrismaConfigInternalShape(defaultExport))
|
|
771
735
|
);
|
|
772
|
-
if (
|
|
736
|
+
if (import_effect2.Either.isLeft(parseResultEither)) {
|
|
773
737
|
throw parseResultEither.left;
|
|
774
738
|
}
|
|
775
739
|
return parseResultEither.right;
|
|
@@ -778,8 +742,7 @@ function parseDefaultExport(defaultExport) {
|
|
|
778
742
|
// src/defaultTestConfig.ts
|
|
779
743
|
function defaultTestConfig() {
|
|
780
744
|
return makePrismaConfigInternal({
|
|
781
|
-
loadedFromFile: null
|
|
782
|
-
deprecatedPackageJson: null
|
|
745
|
+
loadedFromFile: null
|
|
783
746
|
});
|
|
784
747
|
}
|
|
785
748
|
|
|
@@ -800,27 +763,16 @@ function env(name) {
|
|
|
800
763
|
|
|
801
764
|
// src/loadConfigFromFile.ts
|
|
802
765
|
var import_node_path = __toESM(require("node:path"));
|
|
803
|
-
var
|
|
766
|
+
var import_node_process = __toESM(require("node:process"));
|
|
804
767
|
var debug4 = Debug("prisma:config:loadConfigFromFile");
|
|
805
768
|
var SUPPORTED_EXTENSIONS = [".js", ".ts", ".mjs", ".cjs", ".mts", ".cts"];
|
|
806
769
|
async function loadConfigFromFile({
|
|
807
770
|
configFile,
|
|
808
|
-
configRoot =
|
|
771
|
+
configRoot = import_node_process.default.cwd()
|
|
809
772
|
}) {
|
|
810
773
|
const start = performance.now();
|
|
811
774
|
const getTime = () => `${(performance.now() - start).toFixed(2)}ms`;
|
|
812
775
|
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
776
|
try {
|
|
825
777
|
const { configModule, resolvedPath, error } = await loadConfigTsOrJs(configRoot, configFile);
|
|
826
778
|
if (error) {
|
|
@@ -855,20 +807,6 @@ For more information, see: ${link("https://pris.ly/prisma-config")}
|
|
|
855
807
|
`))
|
|
856
808
|
});
|
|
857
809
|
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
810
|
return {
|
|
873
811
|
config: {
|
|
874
812
|
...prismaConfig,
|
|
@@ -995,6 +933,5 @@ function transformPathsInConfigToAbsolute(prismaConfig, resolvedPath) {
|
|
|
995
933
|
defaultTestConfig,
|
|
996
934
|
defineConfig,
|
|
997
935
|
env,
|
|
998
|
-
loadConfigFromFile
|
|
999
|
-
loadConfigFromPackageJson
|
|
936
|
+
loadConfigFromFile
|
|
1000
937
|
});
|
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.3",
|
|
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.3",
|
|
23
|
+
"@prisma/get-platform": "6.20.0-integration-next.3"
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|