@cedarjs/project-config 2.8.1-next.116 → 2.8.1-rc.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/cjs/index.js +10 -43
- package/dist/cjs/prisma.d.ts +3 -13
- package/dist/cjs/prisma.d.ts.map +1 -1
- package/dist/index.js +10 -42
- package/dist/prisma.d.ts +3 -13
- package/dist/prisma.d.ts.map +1 -1
- package/package.json +4 -5
package/dist/cjs/index.js
CHANGED
|
@@ -46,7 +46,6 @@ __export(src_exports, {
|
|
|
46
46
|
getEnvVarDefinitions: () => getEnvVarDefinitions,
|
|
47
47
|
getMigrationsPath: () => getMigrationsPath,
|
|
48
48
|
getPaths: () => getPaths,
|
|
49
|
-
getPrismaSchemas: () => getPrismaSchemas,
|
|
50
49
|
getRawConfig: () => getRawConfig,
|
|
51
50
|
getRouteHookForPage: () => getRouteHookForPage,
|
|
52
51
|
getSchemaPath: () => getSchemaPath,
|
|
@@ -471,16 +470,6 @@ async function getSchemaPath(prismaConfigPath) {
|
|
|
471
470
|
}
|
|
472
471
|
return import_node_path.default.join(configDir, "schema.prisma");
|
|
473
472
|
}
|
|
474
|
-
async function getPrismaSchemas() {
|
|
475
|
-
const mod = require("@prisma/internals");
|
|
476
|
-
const { createSchemaPathInput, getSchemaWithPath } = mod.default || mod;
|
|
477
|
-
const schemaPath = await getSchemaPath(getPaths().api.prismaConfig);
|
|
478
|
-
const schemaPathInput = createSchemaPathInput({
|
|
479
|
-
baseDir: import_node_fs4.default.lstatSync(schemaPath).isDirectory() ? schemaPath : import_node_path.default.dirname(schemaPath),
|
|
480
|
-
schemaPathFromConfig: schemaPath
|
|
481
|
-
});
|
|
482
|
-
return getSchemaWithPath({ schemaPath: schemaPathInput });
|
|
483
|
-
}
|
|
484
473
|
async function getMigrationsPath(prismaConfigPath) {
|
|
485
474
|
const config = await loadPrismaConfig(prismaConfigPath);
|
|
486
475
|
const configDir = import_node_path.default.dirname(prismaConfigPath);
|
|
@@ -503,38 +492,17 @@ async function getDataMigrationsPath(prismaConfigPath) {
|
|
|
503
492
|
const migrationsDir = import_node_path.default.dirname(migrationsPath);
|
|
504
493
|
return import_node_path.default.join(migrationsDir, "dataMigrations");
|
|
505
494
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
const output = generator?.output?.value;
|
|
516
|
-
const generatedFileExtension = generator?.config?.generatedFileExtension;
|
|
517
|
-
const resolvedExtension = Array.isArray(generatedFileExtension) ? generatedFileExtension[0] : generatedFileExtension;
|
|
518
|
-
if (typeof resolvedExtension === "string" && resolvedExtension.length > 0) {
|
|
519
|
-
ext = resolvedExtension;
|
|
520
|
-
}
|
|
521
|
-
if (output) {
|
|
522
|
-
generatorOutputPath = import_node_path.default.isAbsolute(output) ? output : import_node_path.default.resolve(schemaRootDir, output);
|
|
523
|
-
}
|
|
524
|
-
} catch {
|
|
525
|
-
}
|
|
526
|
-
const prismaClientEntry = typeof generatorOutputPath === "string" ? import_node_path.default.join(generatorOutputPath, "client." + ext) : void 0;
|
|
527
|
-
if (!prismaClientEntry || !import_node_fs4.default.existsSync(prismaClientEntry)) {
|
|
528
|
-
const checked = prismaClientEntry ?? "(could not determine output path)";
|
|
529
|
-
return {
|
|
530
|
-
clientPath: prismaClientEntry,
|
|
531
|
-
error: `Could not find generated Prisma client entry. Checked: ${checked}. Run \`yarn cedar prisma generate\` and try again.`
|
|
532
|
-
};
|
|
495
|
+
function resolveGeneratedPrismaClient({ mustExist = false } = {}) {
|
|
496
|
+
const prismaClientEntry = import_node_path.default.join(
|
|
497
|
+
getPaths().base,
|
|
498
|
+
"node_modules/.prisma/client/index.js"
|
|
499
|
+
);
|
|
500
|
+
if (mustExist && !import_node_fs4.default.existsSync(prismaClientEntry)) {
|
|
501
|
+
throw new Error(
|
|
502
|
+
`Could not find generated Prisma client entry at ${prismaClientEntry}. Run \`yarn cedar prisma generate\` and try again.`
|
|
503
|
+
);
|
|
533
504
|
}
|
|
534
|
-
return
|
|
535
|
-
clientPath: prismaClientEntry,
|
|
536
|
-
error: void 0
|
|
537
|
-
};
|
|
505
|
+
return prismaClientEntry;
|
|
538
506
|
}
|
|
539
507
|
|
|
540
508
|
// src/envVarDefinitions.ts
|
|
@@ -598,7 +566,6 @@ function getEnvVarDefinitions() {
|
|
|
598
566
|
getEnvVarDefinitions,
|
|
599
567
|
getMigrationsPath,
|
|
600
568
|
getPaths,
|
|
601
|
-
getPrismaSchemas,
|
|
602
569
|
getRawConfig,
|
|
603
570
|
getRouteHookForPage,
|
|
604
571
|
getSchemaPath,
|
package/dist/cjs/prisma.d.ts
CHANGED
|
@@ -15,10 +15,6 @@ export declare function loadPrismaConfig(prismaConfigPath: string): Promise<Pris
|
|
|
15
15
|
* @returns Absolute path to the schema file or directory
|
|
16
16
|
*/
|
|
17
17
|
export declare function getSchemaPath(prismaConfigPath: string): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the Prisma schemas for the current project's default schema location.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getPrismaSchemas(): Promise<import("@prisma/schema-files-loader").GetSchemaResult>;
|
|
22
18
|
/**
|
|
23
19
|
* Gets the migrations path from Prisma config.
|
|
24
20
|
* Defaults to 'migrations' in the same directory as the schema.
|
|
@@ -46,13 +42,7 @@ export declare function getDbDir(prismaConfigPath: string): Promise<string>;
|
|
|
46
42
|
* @returns Absolute path to the data migrations directory
|
|
47
43
|
*/
|
|
48
44
|
export declare function getDataMigrationsPath(prismaConfigPath: string): Promise<string>;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} | {
|
|
53
|
-
clientPath: string | undefined;
|
|
54
|
-
error: string;
|
|
55
|
-
};
|
|
56
|
-
export declare function resolveGeneratedPrismaClient(): Promise<ResolveReturnType>;
|
|
57
|
-
export {};
|
|
45
|
+
export declare function resolveGeneratedPrismaClient({ mustExist }?: {
|
|
46
|
+
mustExist?: boolean | undefined;
|
|
47
|
+
}): string;
|
|
58
48
|
//# sourceMappingURL=prisma.d.ts.map
|
package/dist/cjs/prisma.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../src/prisma.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAO1C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,yBA8B9D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,MAAM,mBAY3D;AAED
|
|
1
|
+
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../../src/prisma.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAO1C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,yBA8B9D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,MAAM,mBAY3D;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED,wBAAgB,4BAA4B,CAAC,EAAE,SAAiB,EAAE;;CAAK,UActE"}
|
package/dist/index.js
CHANGED
|
@@ -407,16 +407,6 @@ async function getSchemaPath(prismaConfigPath) {
|
|
|
407
407
|
}
|
|
408
408
|
return path3.join(configDir, "schema.prisma");
|
|
409
409
|
}
|
|
410
|
-
async function getPrismaSchemas() {
|
|
411
|
-
const mod = await import("@prisma/internals");
|
|
412
|
-
const { createSchemaPathInput, getSchemaWithPath } = mod.default || mod;
|
|
413
|
-
const schemaPath = await getSchemaPath(getPaths().api.prismaConfig);
|
|
414
|
-
const schemaPathInput = createSchemaPathInput({
|
|
415
|
-
baseDir: fs4.lstatSync(schemaPath).isDirectory() ? schemaPath : path3.dirname(schemaPath),
|
|
416
|
-
schemaPathFromConfig: schemaPath
|
|
417
|
-
});
|
|
418
|
-
return getSchemaWithPath({ schemaPath: schemaPathInput });
|
|
419
|
-
}
|
|
420
410
|
async function getMigrationsPath(prismaConfigPath) {
|
|
421
411
|
const config = await loadPrismaConfig(prismaConfigPath);
|
|
422
412
|
const configDir = path3.dirname(prismaConfigPath);
|
|
@@ -439,38 +429,17 @@ async function getDataMigrationsPath(prismaConfigPath) {
|
|
|
439
429
|
const migrationsDir = path3.dirname(migrationsPath);
|
|
440
430
|
return path3.join(migrationsDir, "dataMigrations");
|
|
441
431
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
const output = generator?.output?.value;
|
|
452
|
-
const generatedFileExtension = generator?.config?.generatedFileExtension;
|
|
453
|
-
const resolvedExtension = Array.isArray(generatedFileExtension) ? generatedFileExtension[0] : generatedFileExtension;
|
|
454
|
-
if (typeof resolvedExtension === "string" && resolvedExtension.length > 0) {
|
|
455
|
-
ext = resolvedExtension;
|
|
456
|
-
}
|
|
457
|
-
if (output) {
|
|
458
|
-
generatorOutputPath = path3.isAbsolute(output) ? output : path3.resolve(schemaRootDir, output);
|
|
459
|
-
}
|
|
460
|
-
} catch {
|
|
461
|
-
}
|
|
462
|
-
const prismaClientEntry = typeof generatorOutputPath === "string" ? path3.join(generatorOutputPath, "client." + ext) : void 0;
|
|
463
|
-
if (!prismaClientEntry || !fs4.existsSync(prismaClientEntry)) {
|
|
464
|
-
const checked = prismaClientEntry ?? "(could not determine output path)";
|
|
465
|
-
return {
|
|
466
|
-
clientPath: prismaClientEntry,
|
|
467
|
-
error: `Could not find generated Prisma client entry. Checked: ${checked}. Run \`yarn cedar prisma generate\` and try again.`
|
|
468
|
-
};
|
|
432
|
+
function resolveGeneratedPrismaClient({ mustExist = false } = {}) {
|
|
433
|
+
const prismaClientEntry = path3.join(
|
|
434
|
+
getPaths().base,
|
|
435
|
+
"node_modules/.prisma/client/index.js"
|
|
436
|
+
);
|
|
437
|
+
if (mustExist && !fs4.existsSync(prismaClientEntry)) {
|
|
438
|
+
throw new Error(
|
|
439
|
+
`Could not find generated Prisma client entry at ${prismaClientEntry}. Run \`yarn cedar prisma generate\` and try again.`
|
|
440
|
+
);
|
|
469
441
|
}
|
|
470
|
-
return
|
|
471
|
-
clientPath: prismaClientEntry,
|
|
472
|
-
error: void 0
|
|
473
|
-
};
|
|
442
|
+
return prismaClientEntry;
|
|
474
443
|
}
|
|
475
444
|
|
|
476
445
|
// src/envVarDefinitions.ts
|
|
@@ -533,7 +502,6 @@ export {
|
|
|
533
502
|
getEnvVarDefinitions,
|
|
534
503
|
getMigrationsPath,
|
|
535
504
|
getPaths,
|
|
536
|
-
getPrismaSchemas,
|
|
537
505
|
getRawConfig,
|
|
538
506
|
getRouteHookForPage,
|
|
539
507
|
getSchemaPath,
|
package/dist/prisma.d.ts
CHANGED
|
@@ -15,10 +15,6 @@ export declare function loadPrismaConfig(prismaConfigPath: string): Promise<Pris
|
|
|
15
15
|
* @returns Absolute path to the schema file or directory
|
|
16
16
|
*/
|
|
17
17
|
export declare function getSchemaPath(prismaConfigPath: string): Promise<string>;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the Prisma schemas for the current project's default schema location.
|
|
20
|
-
*/
|
|
21
|
-
export declare function getPrismaSchemas(): Promise<import("@prisma/schema-files-loader").GetSchemaResult>;
|
|
22
18
|
/**
|
|
23
19
|
* Gets the migrations path from Prisma config.
|
|
24
20
|
* Defaults to 'migrations' in the same directory as the schema.
|
|
@@ -46,13 +42,7 @@ export declare function getDbDir(prismaConfigPath: string): Promise<string>;
|
|
|
46
42
|
* @returns Absolute path to the data migrations directory
|
|
47
43
|
*/
|
|
48
44
|
export declare function getDataMigrationsPath(prismaConfigPath: string): Promise<string>;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
} | {
|
|
53
|
-
clientPath: string | undefined;
|
|
54
|
-
error: string;
|
|
55
|
-
};
|
|
56
|
-
export declare function resolveGeneratedPrismaClient(): Promise<ResolveReturnType>;
|
|
57
|
-
export {};
|
|
45
|
+
export declare function resolveGeneratedPrismaClient({ mustExist }?: {
|
|
46
|
+
mustExist?: boolean | undefined;
|
|
47
|
+
}): string;
|
|
58
48
|
//# sourceMappingURL=prisma.d.ts.map
|
package/dist/prisma.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../src/prisma.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAO1C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,yBA8B9D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,MAAM,mBAY3D;AAED
|
|
1
|
+
{"version":3,"file":"prisma.d.ts","sourceRoot":"","sources":["../src/prisma.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAO1C;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,gBAAgB,EAAE,MAAM,yBA8B9D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,MAAM,mBAY3D;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAiBjB;AAED;;;;;;;GAOG;AACH,wBAAsB,QAAQ,CAAC,gBAAgB,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAQxE;AAED;;;;;;;;GAQG;AACH,wBAAsB,qBAAqB,CACzC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAAC,MAAM,CAAC,CAKjB;AAED,wBAAgB,4BAA4B,CAAC,EAAE,SAAiB,EAAE;;CAAK,UActE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cedarjs/project-config",
|
|
3
|
-
"version": "2.8.1-
|
|
3
|
+
"version": "2.8.1-rc.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/cedarjs/cedar.git",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"test:watch": "vitest watch"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@prisma/internals": "7.5.0",
|
|
40
39
|
"deepmerge": "4.3.1",
|
|
41
40
|
"fast-glob": "3.3.3",
|
|
42
41
|
"smol-toml": "1.6.0",
|
|
@@ -44,9 +43,9 @@
|
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
45
|
"@arethetypeswrong/cli": "0.18.2",
|
|
47
|
-
"@cedarjs/framework-tools": "2.8.1-
|
|
46
|
+
"@cedarjs/framework-tools": "2.8.1-rc.3",
|
|
48
47
|
"concurrently": "9.2.1",
|
|
49
|
-
"prisma": "
|
|
48
|
+
"prisma": "6.19.2",
|
|
50
49
|
"publint": "0.3.18",
|
|
51
50
|
"rimraf": "6.1.3",
|
|
52
51
|
"tsx": "4.21.0",
|
|
@@ -56,5 +55,5 @@
|
|
|
56
55
|
"publishConfig": {
|
|
57
56
|
"access": "public"
|
|
58
57
|
},
|
|
59
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "f778a5b70b97c0b129246e918083f42c63a6dc0a"
|
|
60
59
|
}
|