@prisma/client-generator-ts 6.6.0-dev.96 → 6.6.0-dev.98

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.
@@ -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 {};
@@ -5,7 +5,7 @@ type DbEnum = {
5
5
  values: string[];
6
6
  };
7
7
  export declare class DbEnumsList {
8
- private enums;
8
+ readonly enums: DbEnum[];
9
9
  constructor(enums: readonly DMMF.DatamodelEnum[]);
10
10
  isEmpty(): boolean;
11
11
  hasEnum(name: string): boolean;
@@ -1,5 +1,10 @@
1
1
  import { SqlQueryOutput } from '@prisma/generator';
2
+ import { FileNameMapper } from '../file-extensions';
2
3
  import { DbEnumsList } from './buildDbEnums';
3
- export declare function buildIndexTs(queries: SqlQueryOutput[], enums: DbEnumsList): string;
4
- export declare function buildIndexCjs(queries: SqlQueryOutput[], edgeRuntimeSuffix?: 'wasm' | 'edge' | undefined): string;
5
- export declare function buildIndexEsm(queries: SqlQueryOutput[], edgeRuntimeSuffix?: 'wasm' | 'edge' | undefined): string;
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 buildTypedQueryTs({ query, runtimeBase, runtimeName, enums }: BuildTypedQueryOptions): string;
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
- mainRuntimeName: string;
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, edgeRuntimeName, mainRuntimeName, dmmf, }: TypeSqlBuildOptions): FileMap;
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. Creates lazy `Prisma.dmmf` property for backward
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, relativeOutdir: string): string;
4
+ export declare function buildDirname(edge: boolean): "config.dirname = '/'" | "config.dirname = __dirname";
@@ -1,4 +1,5 @@
1
1
  import { ActiveConnectorType } from '@prisma/generator';
2
+ import { ModuleFormat } from '../module-format';
2
3
  import { RuntimeTarget } from '../runtime-targets';
3
4
  import { RuntimeName } from '../TSClient/TSClient';
4
5
  export type BuildWasmModuleOptions = {
@@ -7,5 +8,6 @@ export type BuildWasmModuleOptions = {
7
8
  runtimeBase: string;
8
9
  target: RuntimeTarget;
9
10
  activeProvider: ActiveConnectorType;
11
+ moduleFormat: ModuleFormat;
10
12
  };
11
- export declare function buildGetWasmModule({ component, runtimeName, runtimeBase, target, activeProvider, }: BuildWasmModuleOptions): string;
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.96",
3
+ "version": "6.6.0-dev.98",
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/debug": "6.6.0-dev.96",
38
- "@prisma/client-common": "6.6.0-dev.96",
39
- "@prisma/fetch-engine": "6.6.0-dev.96",
40
- "@prisma/get-platform": "6.6.0-dev.96",
41
- "@prisma/generator": "6.6.0-dev.96",
42
- "@prisma/dmmf": "6.6.0-dev.96",
43
- "@prisma/ts-builders": "6.6.0-dev.96",
44
- "@prisma/internals": "6.6.0-dev.96"
37
+ "@prisma/client-common": "6.6.0-dev.98",
38
+ "@prisma/dmmf": "6.6.0-dev.98",
39
+ "@prisma/debug": "6.6.0-dev.98",
40
+ "@prisma/generator": "6.6.0-dev.98",
41
+ "@prisma/fetch-engine": "6.6.0-dev.98",
42
+ "@prisma/get-platform": "6.6.0-dev.98",
43
+ "@prisma/internals": "6.6.0-dev.98",
44
+ "@prisma/ts-builders": "6.6.0-dev.98"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@types/pluralize": "0.0.33",
@@ -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
- /**
2
- * Builds a require statement for `path`.
3
- * @param edge
4
- * @returns
5
- */
6
- export declare function buildRequirePath(edge: boolean): "" | "\n const path = require('path')";
@@ -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,6 +0,0 @@
1
- import type * as DMMF from '@prisma/dmmf';
2
- /**
3
- * @internal
4
- * @remarks Used by, for example, the PDP to avoid child process calls to the CLI.
5
- */
6
- export declare function dmmfToTypes(dmmf: DMMF.Document): string;
@@ -1 +0,0 @@
1
- export {};