@prisma/client-generator-ts 6.7.0-dev.34 → 6.7.0-dev.36
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/generateClient.d.ts +3 -1
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +30 -6
- package/dist/index.mjs +30 -6
- package/dist/utils/addPreamble.d.ts +6 -0
- package/package.json +9 -9
package/dist/generateClient.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface GenerateClientOptions {
|
|
|
31
31
|
generatedFileExtension: GeneratedFileExtension;
|
|
32
32
|
importFileExtension: ImportFileExtension;
|
|
33
33
|
moduleFormat: ModuleFormat;
|
|
34
|
+
/** Include a "@ts-nocheck" comment at the top of all generated TS files */
|
|
35
|
+
tsNoCheckPreamble: Boolean;
|
|
34
36
|
}
|
|
35
37
|
export interface FileMap {
|
|
36
38
|
[name: string]: string | FileMap;
|
|
@@ -39,5 +41,5 @@ export interface BuildClientResult {
|
|
|
39
41
|
fileMap: FileMap;
|
|
40
42
|
prismaClientDmmf: DMMF.Document;
|
|
41
43
|
}
|
|
42
|
-
export declare function buildClient({ schemaPath, runtimeBase, datamodel, binaryPaths, outputDir, generator, dmmf, datasources, engineVersion, clientVersion, activeProvider, postinstall, copyEngine, envPaths, typedSql, target, generatedFileExtension, importFileExtension, moduleFormat, }: O.Required<GenerateClientOptions, 'runtimeBase'>): BuildClientResult;
|
|
44
|
+
export declare function buildClient({ schemaPath, runtimeBase, datamodel, binaryPaths, outputDir, generator, dmmf, datasources, engineVersion, clientVersion, activeProvider, postinstall, copyEngine, envPaths, typedSql, target, generatedFileExtension, importFileExtension, moduleFormat, tsNoCheckPreamble, }: O.Required<GenerateClientOptions, 'runtimeBase'>): BuildClientResult;
|
|
43
45
|
export declare function generateClient(options: GenerateClientOptions): Promise<void>;
|
package/dist/index.d.mts
CHANGED
|
@@ -45,6 +45,8 @@ export declare interface GenerateClientOptions {
|
|
|
45
45
|
generatedFileExtension: GeneratedFileExtension;
|
|
46
46
|
importFileExtension: ImportFileExtension;
|
|
47
47
|
moduleFormat: ModuleFormat;
|
|
48
|
+
/** Include a "@ts-nocheck" comment at the top of all generated TS files */
|
|
49
|
+
tsNoCheckPreamble: Boolean;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
declare type GeneratedFileExtension = (typeof expectedGeneratedFileExtensions)[number] | (string & {});
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ export declare interface GenerateClientOptions {
|
|
|
45
45
|
generatedFileExtension: GeneratedFileExtension;
|
|
46
46
|
importFileExtension: ImportFileExtension;
|
|
47
47
|
moduleFormat: ModuleFormat;
|
|
48
|
+
/** Include a "@ts-nocheck" comment at the top of all generated TS files */
|
|
49
|
+
tsNoCheckPreamble: Boolean;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
declare type GeneratedFileExtension = (typeof expectedGeneratedFileExtensions)[number] | (string & {});
|
package/dist/index.js
CHANGED
|
@@ -6106,6 +6106,23 @@ function buildTypedSql({
|
|
|
6106
6106
|
return fileMap;
|
|
6107
6107
|
}
|
|
6108
6108
|
|
|
6109
|
+
// src/utils/addPreamble.ts
|
|
6110
|
+
var generatedCodePreamble = `
|
|
6111
|
+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
6112
|
+
/* eslint-disable */
|
|
6113
|
+
`;
|
|
6114
|
+
var tsNoCheckPreamble = `/* @ts-nocheck */
|
|
6115
|
+
`;
|
|
6116
|
+
function addPreambleToTSFiles(fileMap, includeTSNoCheckPreamble) {
|
|
6117
|
+
for (const [key, value] of Object.entries(fileMap)) {
|
|
6118
|
+
if (typeof value === "string" && key.endsWith(".ts")) {
|
|
6119
|
+
fileMap[key] = generatedCodePreamble + (includeTSNoCheckPreamble ? tsNoCheckPreamble : "") + value;
|
|
6120
|
+
} else if (typeof value === "object" && value !== null) {
|
|
6121
|
+
addPreambleToTSFiles(value, includeTSNoCheckPreamble);
|
|
6122
|
+
}
|
|
6123
|
+
}
|
|
6124
|
+
}
|
|
6125
|
+
|
|
6109
6126
|
// src/generateClient.ts
|
|
6110
6127
|
var DenylistError = class extends Error {
|
|
6111
6128
|
constructor(message) {
|
|
@@ -6133,7 +6150,8 @@ function buildClient({
|
|
|
6133
6150
|
target,
|
|
6134
6151
|
generatedFileExtension,
|
|
6135
6152
|
importFileExtension,
|
|
6136
|
-
moduleFormat
|
|
6153
|
+
moduleFormat,
|
|
6154
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6137
6155
|
}) {
|
|
6138
6156
|
const clientEngineType = (0, import_internals9.getClientEngineType)(generator);
|
|
6139
6157
|
const runtimeName = getRuntimeNameForTarget(target, clientEngineType, generator.previewFeatures);
|
|
@@ -6159,7 +6177,8 @@ function buildClient({
|
|
|
6159
6177
|
target,
|
|
6160
6178
|
generatedFileExtension,
|
|
6161
6179
|
importFileExtension,
|
|
6162
|
-
moduleFormat
|
|
6180
|
+
moduleFormat,
|
|
6181
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6163
6182
|
};
|
|
6164
6183
|
if (runtimeName === "react-native" && !generator.previewFeatures.includes("reactNative")) {
|
|
6165
6184
|
throw new Error(`Using the "react-native" runtime requires the "reactNative" preview feature to be enabled.`);
|
|
@@ -6179,6 +6198,7 @@ function buildClient({
|
|
|
6179
6198
|
})
|
|
6180
6199
|
};
|
|
6181
6200
|
}
|
|
6201
|
+
addPreambleToTSFiles(fileMap, tsNoCheckPreamble2);
|
|
6182
6202
|
return {
|
|
6183
6203
|
fileMap,
|
|
6184
6204
|
// a map of file names to their contents
|
|
@@ -6213,7 +6233,8 @@ async function generateClient(options) {
|
|
|
6213
6233
|
target,
|
|
6214
6234
|
generatedFileExtension,
|
|
6215
6235
|
importFileExtension,
|
|
6216
|
-
moduleFormat
|
|
6236
|
+
moduleFormat,
|
|
6237
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6217
6238
|
} = options;
|
|
6218
6239
|
const clientEngineType = (0, import_internals9.getClientEngineType)(generator);
|
|
6219
6240
|
if (clientEngineType === import_internals9.ClientEngineType.Client && !generator.previewFeatures.includes("queryCompiler")) {
|
|
@@ -6239,7 +6260,8 @@ async function generateClient(options) {
|
|
|
6239
6260
|
target,
|
|
6240
6261
|
generatedFileExtension,
|
|
6241
6262
|
importFileExtension,
|
|
6242
|
-
moduleFormat
|
|
6263
|
+
moduleFormat,
|
|
6264
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6243
6265
|
});
|
|
6244
6266
|
const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf);
|
|
6245
6267
|
if (denylistsErrors) {
|
|
@@ -6439,7 +6461,7 @@ var import_get_tsconfig = require("get-tsconfig");
|
|
|
6439
6461
|
var import_ts_pattern2 = require("ts-pattern");
|
|
6440
6462
|
|
|
6441
6463
|
// package.json
|
|
6442
|
-
var version = "6.7.0-dev.
|
|
6464
|
+
var version = "6.7.0-dev.36";
|
|
6443
6465
|
|
|
6444
6466
|
// src/module-format.ts
|
|
6445
6467
|
function parseModuleFormat(format) {
|
|
@@ -6580,7 +6602,9 @@ var PrismaClientTsGenerator = class {
|
|
|
6580
6602
|
target,
|
|
6581
6603
|
generatedFileExtension,
|
|
6582
6604
|
importFileExtension,
|
|
6583
|
-
moduleFormat
|
|
6605
|
+
moduleFormat,
|
|
6606
|
+
tsNoCheckPreamble: true
|
|
6607
|
+
// Set to false only during internal tests
|
|
6584
6608
|
});
|
|
6585
6609
|
}
|
|
6586
6610
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -6105,6 +6105,23 @@ function buildTypedSql({
|
|
|
6105
6105
|
return fileMap;
|
|
6106
6106
|
}
|
|
6107
6107
|
|
|
6108
|
+
// src/utils/addPreamble.ts
|
|
6109
|
+
var generatedCodePreamble = `
|
|
6110
|
+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
|
|
6111
|
+
/* eslint-disable */
|
|
6112
|
+
`;
|
|
6113
|
+
var tsNoCheckPreamble = `/* @ts-nocheck */
|
|
6114
|
+
`;
|
|
6115
|
+
function addPreambleToTSFiles(fileMap, includeTSNoCheckPreamble) {
|
|
6116
|
+
for (const [key, value] of Object.entries(fileMap)) {
|
|
6117
|
+
if (typeof value === "string" && key.endsWith(".ts")) {
|
|
6118
|
+
fileMap[key] = generatedCodePreamble + (includeTSNoCheckPreamble ? tsNoCheckPreamble : "") + value;
|
|
6119
|
+
} else if (typeof value === "object" && value !== null) {
|
|
6120
|
+
addPreambleToTSFiles(value, includeTSNoCheckPreamble);
|
|
6121
|
+
}
|
|
6122
|
+
}
|
|
6123
|
+
}
|
|
6124
|
+
|
|
6108
6125
|
// src/generateClient.ts
|
|
6109
6126
|
var DenylistError = class extends Error {
|
|
6110
6127
|
constructor(message) {
|
|
@@ -6132,7 +6149,8 @@ function buildClient({
|
|
|
6132
6149
|
target,
|
|
6133
6150
|
generatedFileExtension,
|
|
6134
6151
|
importFileExtension,
|
|
6135
|
-
moduleFormat
|
|
6152
|
+
moduleFormat,
|
|
6153
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6136
6154
|
}) {
|
|
6137
6155
|
const clientEngineType = getClientEngineType3(generator);
|
|
6138
6156
|
const runtimeName = getRuntimeNameForTarget(target, clientEngineType, generator.previewFeatures);
|
|
@@ -6158,7 +6176,8 @@ function buildClient({
|
|
|
6158
6176
|
target,
|
|
6159
6177
|
generatedFileExtension,
|
|
6160
6178
|
importFileExtension,
|
|
6161
|
-
moduleFormat
|
|
6179
|
+
moduleFormat,
|
|
6180
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6162
6181
|
};
|
|
6163
6182
|
if (runtimeName === "react-native" && !generator.previewFeatures.includes("reactNative")) {
|
|
6164
6183
|
throw new Error(`Using the "react-native" runtime requires the "reactNative" preview feature to be enabled.`);
|
|
@@ -6178,6 +6197,7 @@ function buildClient({
|
|
|
6178
6197
|
})
|
|
6179
6198
|
};
|
|
6180
6199
|
}
|
|
6200
|
+
addPreambleToTSFiles(fileMap, tsNoCheckPreamble2);
|
|
6181
6201
|
return {
|
|
6182
6202
|
fileMap,
|
|
6183
6203
|
// a map of file names to their contents
|
|
@@ -6212,7 +6232,8 @@ async function generateClient(options) {
|
|
|
6212
6232
|
target,
|
|
6213
6233
|
generatedFileExtension,
|
|
6214
6234
|
importFileExtension,
|
|
6215
|
-
moduleFormat
|
|
6235
|
+
moduleFormat,
|
|
6236
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6216
6237
|
} = options;
|
|
6217
6238
|
const clientEngineType = getClientEngineType3(generator);
|
|
6218
6239
|
if (clientEngineType === ClientEngineType3.Client && !generator.previewFeatures.includes("queryCompiler")) {
|
|
@@ -6238,7 +6259,8 @@ async function generateClient(options) {
|
|
|
6238
6259
|
target,
|
|
6239
6260
|
generatedFileExtension,
|
|
6240
6261
|
importFileExtension,
|
|
6241
|
-
moduleFormat
|
|
6262
|
+
moduleFormat,
|
|
6263
|
+
tsNoCheckPreamble: tsNoCheckPreamble2
|
|
6242
6264
|
});
|
|
6243
6265
|
const denylistsErrors = validateDmmfAgainstDenylists(prismaClientDmmf);
|
|
6244
6266
|
if (denylistsErrors) {
|
|
@@ -6438,7 +6460,7 @@ import { getTsconfig } from "get-tsconfig";
|
|
|
6438
6460
|
import { match as match2 } from "ts-pattern";
|
|
6439
6461
|
|
|
6440
6462
|
// package.json
|
|
6441
|
-
var version = "6.7.0-dev.
|
|
6463
|
+
var version = "6.7.0-dev.36";
|
|
6442
6464
|
|
|
6443
6465
|
// src/module-format.ts
|
|
6444
6466
|
function parseModuleFormat(format) {
|
|
@@ -6579,7 +6601,9 @@ var PrismaClientTsGenerator = class {
|
|
|
6579
6601
|
target,
|
|
6580
6602
|
generatedFileExtension,
|
|
6581
6603
|
importFileExtension,
|
|
6582
|
-
moduleFormat
|
|
6604
|
+
moduleFormat,
|
|
6605
|
+
tsNoCheckPreamble: true
|
|
6606
|
+
// Set to false only during internal tests
|
|
6583
6607
|
});
|
|
6584
6608
|
}
|
|
6585
6609
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FileMap } from '../generateClient';
|
|
2
|
+
/**
|
|
3
|
+
* To ensure it is clear that this is generated code and shall not be lint and type checked.
|
|
4
|
+
* We still want to typecheck the generated code during our client tests => includeTSNoCheckPreamble = false.
|
|
5
|
+
*/
|
|
6
|
+
export declare function addPreambleToTSFiles(fileMap: FileMap, includeTSNoCheckPreamble: Boolean): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-ts",
|
|
3
|
-
"version": "6.7.0-dev.
|
|
3
|
+
"version": "6.7.0-dev.36",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"pkg-up": "3.1.0",
|
|
35
35
|
"pluralize": "8.0.0",
|
|
36
36
|
"ts-pattern": "5.6.2",
|
|
37
|
-
"@prisma/client-common": "6.7.0-dev.
|
|
38
|
-
"@prisma/dmmf": "6.7.0-dev.
|
|
39
|
-
"@prisma/
|
|
40
|
-
"@prisma/
|
|
41
|
-
"@prisma/
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/
|
|
44
|
-
"@prisma/ts-builders": "6.7.0-dev.
|
|
37
|
+
"@prisma/client-common": "6.7.0-dev.36",
|
|
38
|
+
"@prisma/dmmf": "6.7.0-dev.36",
|
|
39
|
+
"@prisma/debug": "6.7.0-dev.36",
|
|
40
|
+
"@prisma/fetch-engine": "6.7.0-dev.36",
|
|
41
|
+
"@prisma/generator": "6.7.0-dev.36",
|
|
42
|
+
"@prisma/get-platform": "6.7.0-dev.36",
|
|
43
|
+
"@prisma/internals": "6.7.0-dev.36",
|
|
44
|
+
"@prisma/ts-builders": "6.7.0-dev.36"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/pluralize": "0.0.33",
|