@prisma/client-generator-ts 6.6.0-dev.95 → 6.6.0-dev.97
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/TSClient/Args.d.ts +0 -1
- package/dist/TSClient/Enum.d.ts +1 -3
- package/dist/TSClient/Generable.d.ts +0 -6
- package/dist/TSClient/PrismaClient.d.ts +1 -2
- package/dist/TSClient/TSClient.d.ts +2 -14
- package/dist/TSClient/common.d.ts +1 -3
- package/dist/TSClient/index.d.ts +0 -1
- package/dist/TSClient/utils/type-builders.d.ts +4 -0
- package/dist/file-extensions.d.ts +16 -0
- package/dist/generateClient.d.ts +8 -1
- package/dist/index.d.mts +20 -6
- package/dist/index.d.ts +20 -6
- package/dist/index.js +615 -874
- package/dist/index.mjs +543 -801
- package/dist/module-format.d.ts +13 -0
- package/dist/runtime-targets.d.ts +5 -0
- package/dist/typedSql/buildDbEnums.d.ts +1 -1
- package/dist/typedSql/buildIndex.d.ts +8 -3
- package/dist/typedSql/buildTypedQuery.d.ts +3 -3
- package/dist/typedSql/typedSql.d.ts +6 -3
- package/dist/utils/buildDMMF.d.ts +1 -10
- package/dist/utils/buildDirname.d.ts +1 -4
- package/dist/utils/buildGetWasmModule.d.ts +13 -0
- package/package.json +11 -11
- package/dist/resolvePrismaClient.d.ts +0 -16
- package/dist/utils/buildGetQueryCompilerWasmModule.d.ts +0 -6
- package/dist/utils/buildGetQueryEngineWasmModule.d.ts +0 -6
- package/dist/utils/buildRequirePath.d.ts +0 -6
- package/dist/utils/buildWarnEnvConflicts.d.ts +0 -6
- package/dist/utils/types/dmmfToTypes.d.ts +0 -6
- package/dist/utils/types/dmmfToTypes.spec.d.ts +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TsConfigJsonResolved } from 'get-tsconfig';
|
|
2
|
+
import { GeneratedFileExtension } from './file-extensions';
|
|
3
|
+
declare const moduleFormats: readonly ["esm", "cjs"];
|
|
4
|
+
export type ModuleFormat = (typeof moduleFormats)[number];
|
|
5
|
+
export declare function parseModuleFormat(format: string): ModuleFormat;
|
|
6
|
+
export declare function parseModuleFormatFromUnknown(value: unknown): ModuleFormat;
|
|
7
|
+
type InferModuleFormatOptions = {
|
|
8
|
+
tsconfig: TsConfigJsonResolved | undefined;
|
|
9
|
+
generatedFileExtension: GeneratedFileExtension;
|
|
10
|
+
importFileExtension: GeneratedFileExtension;
|
|
11
|
+
};
|
|
12
|
+
export declare function inferModuleFormat({ tsconfig, generatedFileExtension, importFileExtension, }: InferModuleFormatOptions): ModuleFormat;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const supportedRuntimes: readonly ["nodejs", "deno", "deno-deploy", "bun", "workerd", "edge-light", "react-native"];
|
|
2
|
+
export type RuntimeTarget = (typeof supportedRuntimes)[number];
|
|
3
|
+
export declare function parseRuntimeTarget(target: string): RuntimeTarget;
|
|
4
|
+
export declare function parseRuntimeTargetFromUnknown(target: unknown): RuntimeTarget;
|
|
5
|
+
export {};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { SqlQueryOutput } from '@prisma/generator';
|
|
2
|
+
import { FileNameMapper } from '../file-extensions';
|
|
2
3
|
import { DbEnumsList } from './buildDbEnums';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
type BuildIndexOptions = {
|
|
5
|
+
queries: SqlQueryOutput[];
|
|
6
|
+
enums: DbEnumsList;
|
|
7
|
+
importName: FileNameMapper;
|
|
8
|
+
};
|
|
9
|
+
export declare function buildIndex({ queries, enums, importName }: BuildIndexOptions): string;
|
|
10
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SqlQueryOutput } from '@prisma/generator';
|
|
2
|
+
import { FileNameMapper } from '../file-extensions';
|
|
2
3
|
import { DbEnumsList } from './buildDbEnums';
|
|
3
4
|
type BuildTypedQueryOptions = {
|
|
4
5
|
runtimeBase: string;
|
|
5
6
|
runtimeName: string;
|
|
6
7
|
query: SqlQueryOutput;
|
|
7
8
|
enums: DbEnumsList;
|
|
9
|
+
importName: FileNameMapper;
|
|
8
10
|
};
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function buildTypedQueryCjs({ query, runtimeBase, runtimeName }: BuildTypedQueryOptions): string;
|
|
11
|
-
export declare function buildTypedQueryEsm({ query, runtimeBase, runtimeName }: BuildTypedQueryOptions): string;
|
|
11
|
+
export declare function buildTypedQuery({ query, runtimeBase, runtimeName, enums, importName }: BuildTypedQueryOptions): string;
|
|
12
12
|
export {};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import type * as DMMF from '@prisma/dmmf';
|
|
2
2
|
import { SqlQueryOutput } from '@prisma/generator';
|
|
3
|
+
import { FileNameMapper } from '../file-extensions';
|
|
3
4
|
import { FileMap } from '../generateClient';
|
|
5
|
+
import type { RuntimeName } from '../TSClient/TSClient';
|
|
4
6
|
type TypeSqlBuildOptions = {
|
|
5
7
|
runtimeBase: string;
|
|
6
|
-
|
|
7
|
-
edgeRuntimeName: 'wasm' | 'edge';
|
|
8
|
+
runtimeName: RuntimeName;
|
|
8
9
|
dmmf: DMMF.Document;
|
|
9
10
|
queries: SqlQueryOutput[];
|
|
11
|
+
outputName: FileNameMapper;
|
|
12
|
+
importName: FileNameMapper;
|
|
10
13
|
};
|
|
11
|
-
export declare function buildTypedSql({ queries, runtimeBase,
|
|
14
|
+
export declare function buildTypedSql({ queries, runtimeBase, runtimeName, dmmf, outputName, importName, }: TypeSqlBuildOptions): FileMap;
|
|
12
15
|
export {};
|
|
@@ -2,15 +2,6 @@ import type * as DMMF from '@prisma/dmmf';
|
|
|
2
2
|
import { TSClientOptions } from '../TSClient/TSClient';
|
|
3
3
|
/**
|
|
4
4
|
* Given DMMF models, computes runtime datamodel from it and embeds
|
|
5
|
-
* it into generated client.
|
|
6
|
-
* compatibility, which will dynamically compute DMMF.Datamodel from runtime
|
|
7
|
-
* datamodel when accessed.
|
|
8
|
-
* Note: Prisma client itself never uses `Prisma.dmmf` and uses runtime datamodel
|
|
9
|
-
* instead. We are preserving it only for backward compatibility with third party tools.
|
|
10
|
-
* If we remove it in a future major version, we can further optimize the format — client
|
|
11
|
-
* needs way less information that is present there at the moment
|
|
12
|
-
*
|
|
13
|
-
* @param datamodel
|
|
14
|
-
* @returns
|
|
5
|
+
* it into generated client.
|
|
15
6
|
*/
|
|
16
7
|
export declare function buildRuntimeDataModel(datamodel: DMMF.Datamodel, runtimeName: TSClientOptions['runtimeName']): string;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Builds a `dirname` variable that holds the location of the generated client.
|
|
3
|
-
* @param edge
|
|
4
|
-
* @param relativeOutdir
|
|
5
|
-
* @returns
|
|
6
3
|
*/
|
|
7
|
-
export declare function buildDirname(edge: boolean
|
|
4
|
+
export declare function buildDirname(edge: boolean): "config.dirname = '/'" | "config.dirname = __dirname";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ActiveConnectorType } from '@prisma/generator';
|
|
2
|
+
import { ModuleFormat } from '../module-format';
|
|
3
|
+
import { RuntimeTarget } from '../runtime-targets';
|
|
4
|
+
import { RuntimeName } from '../TSClient/TSClient';
|
|
5
|
+
export type BuildWasmModuleOptions = {
|
|
6
|
+
component: 'engine' | 'compiler';
|
|
7
|
+
runtimeName: RuntimeName;
|
|
8
|
+
runtimeBase: string;
|
|
9
|
+
target: RuntimeTarget;
|
|
10
|
+
activeProvider: ActiveConnectorType;
|
|
11
|
+
moduleFormat: ModuleFormat;
|
|
12
|
+
};
|
|
13
|
+
export declare function buildGetWasmModule({ component, runtimeName, runtimeBase, target, activeProvider, moduleFormat, }: BuildWasmModuleOptions): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/client-generator-ts",
|
|
3
|
-
"version": "6.6.0-dev.
|
|
3
|
+
"version": "6.6.0-dev.97",
|
|
4
4
|
"description": "This package is intended for Prisma's internal use",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -27,21 +27,21 @@
|
|
|
27
27
|
"@antfu/ni": "0.21.12",
|
|
28
28
|
"@prisma/engines-version": "6.6.0-45.fbda4d61f6cc9c7361b803e72f3a0ffeb87db447",
|
|
29
29
|
"ci-info": "4.2.0",
|
|
30
|
-
"env-paths": "2.2.1",
|
|
31
30
|
"fast-glob": "3.3.3",
|
|
31
|
+
"get-tsconfig": "4.10.0",
|
|
32
32
|
"indent-string": "4.0.0",
|
|
33
33
|
"klona": "2.0.6",
|
|
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.6.0-dev.
|
|
38
|
-
"@prisma/debug": "6.6.0-dev.
|
|
39
|
-
"@prisma/dmmf": "6.6.0-dev.
|
|
40
|
-
"@prisma/generator": "6.6.0-dev.
|
|
41
|
-
"@prisma/
|
|
42
|
-
"@prisma/
|
|
43
|
-
"@prisma/internals": "6.6.0-dev.
|
|
44
|
-
"@prisma/ts-builders": "6.6.0-dev.
|
|
37
|
+
"@prisma/client-common": "6.6.0-dev.97",
|
|
38
|
+
"@prisma/debug": "6.6.0-dev.97",
|
|
39
|
+
"@prisma/dmmf": "6.6.0-dev.97",
|
|
40
|
+
"@prisma/generator": "6.6.0-dev.97",
|
|
41
|
+
"@prisma/get-platform": "6.6.0-dev.97",
|
|
42
|
+
"@prisma/fetch-engine": "6.6.0-dev.97",
|
|
43
|
+
"@prisma/internals": "6.6.0-dev.97",
|
|
44
|
+
"@prisma/ts-builders": "6.6.0-dev.97"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/pluralize": "0.0.33",
|
|
@@ -55,6 +55,6 @@
|
|
|
55
55
|
"scripts": {
|
|
56
56
|
"dev": "DEV=true tsx helpers/build.ts",
|
|
57
57
|
"build": "tsx helpers/build.ts",
|
|
58
|
-
"test": "vitest run"
|
|
58
|
+
"test": "vitest run --testTimeout 30000"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Command } from '@antfu/ni';
|
|
2
|
-
export declare const debug: ((...args: any[]) => void) & {
|
|
3
|
-
color: string;
|
|
4
|
-
enabled: boolean;
|
|
5
|
-
namespace: string;
|
|
6
|
-
log: (...args: string[]) => void;
|
|
7
|
-
extend: () => void;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Resolve the path to the Prisma Client to determine the default output directory.
|
|
11
|
-
*/
|
|
12
|
-
export declare function resolvePrismaClient(baseDir: string): Promise<string>;
|
|
13
|
-
/**
|
|
14
|
-
* Get the command to run for the given package manager in the given directory.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getPackageCmd(cwd: string, cmd: Command, ...args: string[]): Promise<string>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TSClientOptions } from '../TSClient/TSClient';
|
|
2
|
-
/**
|
|
3
|
-
* Builds the necessary glue code to load the query compiler wasm module.
|
|
4
|
-
* @returns
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildQueryCompilerWasmModule(wasm: boolean, copyCompiler: boolean, runtimeName: TSClientOptions['runtimeName']): "config.compilerWasm = {\n getRuntime: () => require('./query_compiler_bg.js'),\n getQueryCompilerWasmModule: async () => {\n const queryCompilerWasmFilePath = require('path').join(config.dirname, 'query_compiler_bg.wasm')\n const queryCompilerWasmFileBytes = require('fs').readFileSync(queryCompilerWasmFilePath)\n\n return new WebAssembly.Module(queryCompilerWasmFileBytes)\n }\n }" | "config.compilerWasm = {\n getRuntime: () => require('./query_compiler_bg.js'),\n getQueryCompilerWasmModule: async () => {\n const loader = (await import('#wasm-compiler-loader')).default\n const compiler = (await loader).default\n return compiler\n }\n}" | "config.compilerWasm = undefined";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TSClientOptions } from '../TSClient/TSClient';
|
|
2
|
-
/**
|
|
3
|
-
* Builds the necessary glue code to load the query engine wasm module.
|
|
4
|
-
* @returns
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildQueryEngineWasmModule(wasm: boolean, copyEngine: boolean, runtimeName: TSClientOptions['runtimeName']): "config.engineWasm = {\n getRuntime: () => require('./query_engine_bg.js'),\n getQueryEngineWasmModule: async () => {\n const queryEngineWasmFilePath = require('path').join(config.dirname, 'query_engine_bg.wasm')\n const queryEngineWasmFileBytes = require('fs').readFileSync(queryEngineWasmFilePath)\n\n return new WebAssembly.Module(queryEngineWasmFileBytes)\n }\n }" | "config.engineWasm = {\n getRuntime: () => require('./query_engine_bg.js'),\n getQueryEngineWasmModule: async () => {\n const loader = (await import('#wasm-engine-loader')).default\n const engine = (await loader).default\n return engine\n }\n}" | "config.engineWasm = undefined";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { TSClientOptions } from '../TSClient/TSClient';
|
|
2
|
-
/**
|
|
3
|
-
* Builds the necessary bits so that our users can get a helpful warning during
|
|
4
|
-
* "generate" in case of conflicts between their environment & their env files.
|
|
5
|
-
*/
|
|
6
|
-
export declare function buildWarnEnvConflicts(edge: boolean, runtimeBase: string, runtimeName: TSClientOptions['runtimeName']): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|